STRESS DETECTION USING MACHINE LEARNING

Page 1

STRESS DETECTION USING MACHINE LEARNING

1Prof. Rohini hanchate, Dept. of Computer Engineering, NMIET, Maharashtra, India

2Harshal Narute, Dept. of Computer Engineering, NMIET, Maharashtra, India

3Siddharam Shavage, Dept. of Computer Engineering, NMIET, Maharashtra,India

4Karan Tiwari, Dept. of Computer Engineering, NMIET, Maharashtra, India ***

Abstract - The management of stress is essential in recognizing the levels of stress that can hinder our personal and social wellbeing.AccordingtotheWorldHealthOrganization,approximately one in four individuals experience stress-related psychological problems, leading to mental and socioeconomic issues, poor workplace relationships, and even suicide in severe cases. Counseling is a necessary resource to help individuals cope with stress. While stress cannot be entirely avoided, preventive measures can assist in managing stress levels. Currently, only medical and physiological experts can determine whether someone is experiencing stress or not. However, the traditional method of detecting stress based on self-reported answers from individuals is unreliable. Automating the detection of stress levels using physiological signals providesa moreaccurateandobjective approach to minimizing health risks andpromoting the welfare of society. The detection of stress levels is a significant social contribution that can enhance people's lifestyles. The IT industry has introduced new technologies and products that aid in the detection of stress levels in employees, which is critical in enhancingtheirperformance.Althoughseveralorganizationsoffer mental health schemes for their employees, the issue remains challengingtomanage.

Key Words: Python, Machine Learning, Stress Detection, Haarcascade Algorithm, CNN(Convolutional Neural Netwrok ) algorithm

1. INTRODUCTION

Stress is an inevitable aspect of life that causes unpleasant emotional states, especially when individuals work long hours in front of computers. Therefore, monitoring the emotional status of people in such situations is crucial for theirsafety.Acameraispositionedtocaptureanearfrontal viewofthepersonwhiletheyworkinfrontofthecomputer, allowing for the man-machine interface to be more flexible and user-friendly. Human experts possess privileged knowledge regarding facial features that indicate ageing, suchassmoothness,facestructure,skininflammation,lines, and under-eye bags, which is not available for automated ageestimates.Toaddressthisissue,asymmetricdatacanbe utilizedtoenhancethegeneralizabilityofthetrainedmodel. The proposed model aims to predict mood levels or activities based on scores with class labels, implement the testmodelusingsupervisedlearning,andachievemaximum accuracy in executing the proposed system. Overall, this research seeks to enhance the accuracy and reliability of stressandagedetectionsystemstobetterservesociety.

1.1 Problem Statement

Stressisa widespreadissue thatcanhavea negative impact on people's personal and professional lives. The current methods of detecting stress based on self-reported answers are subjective and unreliable, which calls for the need for a more accurate and objective approach. Automated detection usingphysiologicalsignals,particularlyheartratevariability, has been proposed as a potential solution, but it is essential to evaluate the effectiveness of these systems in real-world settings to ensure their practicality and reliability. Furthermore, exploring novel technologies like computer vision could improve the accuracy and generalizability of stress detection systems. Therefore, the problem statement of this report is to investigate how automated physiological andcomputervision-basedapproachescaneffectivelydetect stress levels in real-world settings and explore ways to enhancetheiraccuracyandgeneralizability.

1.2 Literature Survey

1.2.1 A novel depression detection method based on pervasive EEG and EEG splitting criterion

Depression is a mental health disorder characterized by persistentlowmoodstates,anditisexpectedtobecomethe secondlargestcauseofillnessworldwidein2020,according totheWorldHealthOrganization.Earlydetection,diagnosis, and treatment of depression are critical to saving lives and preserving health. Therefore, there is a pressing need for a portable and accurate method for detecting and diagnosing depression. However, the highly complex, non-linear, and non-stationary nature of electroencephalogram (EEG) data presents a challenge for developing effective depression detection methods. In this paper, a novel approach is proposedforpervasiveEEG-baseddetectionanddiagnosisof depressionusing resting-state eye-closedEEG data collected fromFp1,Fpz,andFp2locationsofscalpelectrodesthrough a three-electrode pervasive EEGcollection device. Thestudy collected EEG data from 170 participants (81 depressive patients and 89 normal subjects) and used Support Vector Machine (SVM) analysis to analyze the data. The average accuracy of the method was found to be 83.07%, demonstrating its effectiveness in detecting and diagnosing depression. Furthermore, the study suggests that the threeelectrode pervasive EEG collection device has potential for useindepressiondetectionanddiagnosis.

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056 p-ISSN: 2395-0072 Volume: 10 Issue: 05 | May 2023 www.irjet.net © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page1
Prof. Rohini Hanchate1 , Harshal Narute2 , Siddharam Shavage3 , Karan Tiwari4

1.2.2 Multi-Modal Depression Detection and Estimation

Depression and anxiety are significant mental health concerns in modern society, with the World Health Organization reporting that about 12.8% of the global population suffers from depression. In this study, we propose innovative approaches to multi-modal depression detection and estimation. In our previous research, we exploredmulti-modalfeaturesandfusionstrategies,andthe hybriddepressionclassificationandestimationmulti-modal fusion framework showed promising performance. The current studyconsists oftwoparts: To address the issueof insufficient data for training depression deep models, we utilize Generative Adversarial Network (GAN) to augment depression audio features, enhancing depression severity estimation performance. We introduce a novel FACS3DNet that combines 3D and 2D convolution networks for facial Action Unit (AU) detection. To our knowledge, this is the first study that applies 3D CNN to AU detection. Our future research will focus on combining depression estimation with dimensional affective analysis through the proposed FACS3DNet, as well as collecting a Chinese depression database. These studies will be part of the author's dissertation.Ourresearchprimarilyfocusesonthreeareas:

(1) investigating effective multi-modal features and fusion strategies for depression recognition; (2) mitigating the impact of insufficient data on training depression deep models; and (3) integrating depression estimation with dimensionalaffectiveanalysis.Intermsofthefirstpoint,we found that when depression classification and estimation are considered together, superior performance can be achieved. Language information, such as text features, can effectively classify depression, while audio and video can construct a preliminary depression estimation framework. For the second point, the DCGAN-based data generation approach significantly improves depression estimation performance and provides new insights into depression dataaugmentation.Additionally,wehavebeguncollectinga Chinesedepressiondatabase.Asforthethirdpoint,whichis our future work, we will utilize the FACS3D-Net to simultaneously integrate depression estimation with dimensionalaffectiveanalysis.Webelievethatthisresearch willofferauniqueperspectiveondepressionrecognition.

1.2.3 Quantification of depression disorder using EEG signal

Depression is a prevalent psychological disorder that has become a growing concern in the field of science. To determine the level of depression in individuals, mental health questionnaires like Beck’s questionnaire assign a numerical indicator. Recent studies have revealed that the level of depression is linked to structural changes in the brain, which means it is possible to detect the level of depression by analyzing brain signals. This paper proposes a new method for estimating the Beck’s index of each subject by extracting specific features from the patient’s EEGsignal.Theproposedalgorithmutilizesacombination

of a fuzzy classifier and support vector machine (SVM) to quantifydepression.Theresultsoftheexperimentshowthat the designed system has a good ability to determine the numerical index for depression, with a percent relative difference (PRD) of 5% and a Pearson correlation of 0.92. These results suggest that the estimated numerical value of the proposed system is highly correlated and has a low amountofPRDwhencomparedtotheoriginalBeck number assignedtoeachperson.

1.2.4 Prediction of Depression from EEG signal using Short term memory(LSTM)

Depression is a neurological disorder that has become a major global concern. EEG recordings have proven to be effective in diagnosing and analyzing various neurological disorders,includingdepression.Inthisstudy,adeeplearning modelbasedonLSTM(LongShort-TermMemory)isusedto predict depression trends for future time instants based on extractedfeatures..ThemodelusesasingleLSTMlayerwith ten hidden neurons for prediction. The model is trained using5600outofatotalof7000meanvaluesobtainedfrom a sample of 30 patient records. The LSTM network successfully predicted the next 1400 sample mean values with a root mean square error of 0.000064. The model's performance is compared with ConvLSTM and CNNLSTM, anditisconcludedthattheLSTMpredictormodelisthemost effectiveforpredictingdepressiontrends.

2. Proposed System

Fig -1.3.1: System Architecture

Thepurposeofthisproposedsystemistodetectstressbased on the CNN algorithm and Haar cascade algorithm using machine learning model. The system will use a camera to analyzefacial expressions and detect stress.The systemwill provide users with a stress level result in terms of percentagevalue,alongwithrecordedfacialexpressions

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056 p-ISSN: 2395-0072 Volume: 10 Issue: 05 | May 2023 www.irjet.net © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page670

stored in database to help users understand their stress triggersandtakenecessarymeasures.

System Architecture:

The proposed system architecture includes the following components:

1.Camera:Alivecamera will capturethefacial expressions oftheuser.

2.Preprocessing: Preprocessing involves cleaning and transforming raw data into a format that is suitable for analysis.Intheproposedsystem,preprocessingwillinvolve taskssuchasremovingnoisefromimages,correctingimage orientation, scaling images to a consistent size, and convertingimagestograyscale.

3.Feature extraction: Feature extraction involves identifying and extracting relevant information (features) fromthepreprocesseddata.Intheproposedsystem,feature extraction will involve tasks such as identifying shape or structuralfeaturesfromimages,extractingcolorfeatures,or identifying texture features. These extracted features can then be used as inputs for further analysis, such as classificationorclustering.

4.CNN Algorithm: The CNN algorithm will analyze images afterfeatureextractionandclassifythem.

5.HaarCascadeAlgorithm:TheHaarcascadealgorithmwill detectfacialfeaturesandpatterns.

6.StressDetectionSystem:Thestressdetectionsystemwill determine the stress level of the user in percentage and provide the most recorded expression like happy, sad or neutral.

7. User Interface: The user interface will display the stress levelresultandaverageofrecordedfacialexpressions.

Working:

The live camera of the device will capture the facial expressions of the user, which will be preprocessed and then undergo feature extraction. The CNN algorithm will recognize facial features and patterns to detect stress. The Haar cascade algorithm will analyze facial expressions to detect stress-related patterns. The stress detection system will integrate the results of both algorithms to determine the user's stress level. The user interface will display the stress level result, along with recorded facial expressions. The recorded facial expressions will help users understand theirstresstriggersandtakenecessarymeasures.

3. Algorithm:

3.1 Convolutional Neural Network (CNN):

The CNN algorithm, or Convolutional Neural Network algorithm, is a type of deep learning algorithm used in computer vision and image processing. It uses filters or kernels to extract features from images by performing convolution operations. These features are then passed through a series of layers, including pooling and activation layers, to create a feature map. The feature map is then flattened into a vector and passed through fully connected layerstomakepredictionsabouttheimage.CNNsareusedin many applications, such as object detection, facial recognition,andmedicalimaging.CNN(ConvolutionalNeural Network) can play a critical role in object detection and image classification tasks in the proposed system, particularly in computer vision applications. CNNs are knowntobehighlyeffectiveinrecognizingvisualpatternsin images and detecting objects with high accuracy. They can extract relevant features from images and classify them into differentcategories,makingthemusefulinapplicationssuch as facial recognition, object detection, and autonomous vehicles.

3.2 Haar cascade Algorithm:

Haar cascade algorithm is a machine learning-based object detection algorithm used to detect objects in images or videos. It uses a set of pre-trained classifiers to identify featuresofanobject,suchasedges,curves,andcorners.The algorithmthenusesthesefeaturestoscantheimageorvideo to detect the presence of the object. The Haar cascade algorithmisbasedontheideathatanobjectcanbedetected bylookingforspecificfeaturesinitslighteranddarkerareas. Itusesacascadeofclassifierstodetecttheobjectatmultiple scales and orientations. The Haar cascade algorithm plays a crucial role in the above proposed system as it is used for object detection and recognition. The algorithm utilizes the concept of feature extraction and machine learning to identify and detect specific objects of interest. In the proposed system, the Haar cascade algorithm is used to detect and recognize faces. Since the algorithm is computationallyintensive,itusestheintegralimagemethod to speed up the calculations. This reduces the algorithm's processingtime,makingreal-timeobjectdetectionpossible.

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056 p-ISSN: 2395-0072 Volume: 10 Issue: 05 | May 2023 www.irjet.net © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page671
International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056 p-ISSN: 2395-0072 Volume: 10 Issue: 05 | May 2023 www.irjet.net © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page672 4. RESULTS LOGINPAGE REGISTRATION PAGE ACCOUNTCREATED MAINPAGE FACEEVALUATIONPAGE FACE EVALUATION

3.FUTURE SCOPE

Future work on the study will focus on creating a system that can analyse Future work on the study will focus on creatingasystemthatcananalyseatweet'sdiscussiontopic in addition to detecting stress. As a survey system, this might work. On every contentious issue, it would offer a better resolution and reveal the general consensus in fields likepoliticsandthepress.

4. CONCLUSION

Our proposed system aims to determine whether an individual is experiencing stress or not, with the results presented in percentage format. The primary objective of thissystemistoraiseawarenessaboutmentalhealthandto encourageindividualstoeffectivelymanageorreducestress levelsduringextendedworksessions.Byprovidingreal-time updatesandalerts,thissystemwillenableindividualstotake proactivemeasurestomaintaintheirwell-beingandprevent the negative impact of stress on their physical and mental health.

5. ACKNOWLEGEMENT

Wearedelightedtopresenttheinitialprojectreportforour project titled "Stress detection using machine learning". Our sincere appreciation goes out to our mentor Prof. Rohini Hanchate and project coordinator Prof. Pritam Ahire for her constant help and guidance throughout the project. And We are immensely grateful for her kind support, and her invaluable suggestions have been instrumental in shaping our project. We would also like to express our gratitude to Dr. Saurabh Savaji, the Head of the Computer Engineering Department at Nutan Maharashtra Institute of Engineering and Technology, for their unwavering support and suggestions. Lastly, we would like to extend our heartfelt thanks to Dr. Vilas Deotare, the Principal of our college, for providinguswithaccesstovariousresourcessuchasafullyequipped laboratory with all the necessary software platforms and uninterrupted internet connectivity for our project.

6. REFERENCES

1. Y. Kwon and N. Lobo, “Age classication from facial images,” in Proc. IEEE Conf. Comput. Vis. Pattern Recognit., Seattle,WA,USA,Jun.1994,pp.762–67

2. DasS,O’KeefeJ.“Behavioralcardiology:recognizingand addressingthepro-foundimpactofpsychosocialDepression oncardiovascularhealth”.CurrAtherosclerRep.2006;8:111

3. Shusterman V, Aysin B, Gottipaty V, Weiss R, Brode S, Schwartzman D, Anderson KP. “Autonomic Nervous System Activity and the Spontaneous Initiation of Ventricular Tachycardia.”ESVEMInvestigators.ElectrophysiologicStudy Versus Electrocardiographic Monitoring Trial. J Am Coll Cardiol.1998;32:1891-9.

4. Leenhardt A, Lucet V, DenjoyI, Grau F,Ngoc DD, Coumel P. “Cate- cholaminergic polymorphic ventricular tachycardia in children. A 7-year follow- up of 21 patients.” Circulation. 1995;91:1512-9.

5. A REVIEW ON INCREASING THE ACCURACY OF INTRUSION DETECTION SYSTEM (IDS). IJCRT 2320- 2882 9/220211Prof.PritamAhire,2AbhijeetMowade,3Nikhil

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056 p-ISSN: 2395-0072 Volume: 10 Issue: 05 | May 2023 www.irjet.net © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page673 CLASSIFICATION CLASSIFICATION PREDICTIONPAGE

Bankar 1Professor, 2Student, 3Student 1Computer Engineering, 1D.Y. Patil Institute of Engineering and TechnologyAmbi,Pune,India

6. “MACHINE LEARNING BASED INTRUSION DETECTION SYSTEM” Prof. Pritam Ahire, Abhijeet Mowade, Nikhil Bankar,(IDS),International Journal of Advanced Research in Computer and Communication Engineering(IJARCCE) Vol 10,2021.

7. .PredictiveandDescriptiveAnalysisforHealthcareData, A Hand book on Intelligent Health Care AnalyticsKnowledge Engineering with Big Data” A. Jaya (Editor), K. Kalaiselvi (Editor), Dinesh Goyal (Editor), Dhiya Al-Jumeily (Editor)WileyGroup,2021.

8. Voice-Print Recognition system using python and machine learning with IBM watson” Prof Pritam Ahire, Hariharan Achary, Pratik Kalaskar, Sourabh ShirkeInternational Advanced Research Journal in Science, EngineeringandTechnology(IARJSET)vol8,2021.

9. Y. Kwon and N. Lobo, “Age classication from facial images,” Comput. Vis. Image Understand., vol. 74, no. 1, pp. 1

1,1999.

10. W. B. Horng, C. P. Lee, and C.W. Chen, “Classication of age groups based on facial features,” Tamkang J. Sci. Eng., vol.4,no.3,pp.183–92,2001.

11.J. Hayashi, M. Yasumoto, H. Ito, Y. Niwa, and H. Koshimizu, “Age and gender estimation from facial image processing,” in Proc. 41st SICE Annu. Conf., vol. 1. Osaka, Japan,Aug.2002,pp.13–8.

12. A. Lanitis, C. Taylor, and T. Cootes, “Toward automatic simulation of aging effects on face images,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 24, no. 4, pp. 442–55, Apr. 2002.

13.Fevre, Mark Le; Kolt, Gregory S.; Matheny, Jonathan,. ”EuDepression, diDepression and their interpretation in primary and secondary occupational Depression management interventions: which way first?”. Journal of Managerial Psychology, 2006, 21 (6): 547 -565. doi:10.1108/0268390610684391.

8. BIOGRAPHY

Prof Rohini Hanchate, Assistant Professor at Department of Computer Eng, Nutan Maharashtra Institute of Engineering and Technology, Talegaon

Harshal Rajesh Narute, Student,DepartmentofComputer Eng., Nutan Maharashtra Institute of Engineering and Technology, Talegaon.

Siddharam Kailas Shavage, Student,DepartmentofComputer Eng., Nutan Maharashtra Institute of Engineering and Technology, Talegaon

Karan Krushnachandra Tiwari, Student,DepartmentofComputer Eng., Nutan Maharashtra Institute of Engineering and Technology, Talegaon

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056 p-ISSN: 2395-0072 Volume: 10 Issue: 05 | May 2023 www.irjet.net © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page674
–

Turn static files into dynamic content formats.

Create a flipbook