Computer Science-2021.gz:143335
Computer Science
05fc5c87e65b5a4e57392324ba7bf1f9a9f970fb
STRESS PREDICTION USING RANDOM FOREST LINEAR REGRESSION

In today’s world stress has become a more familiar word because of its disastrous impact on the huge number of people worldwide. It is very important to keep stress under control every time, as it is the primitive reason for much major health issues. Some people meditate to g e t r i d o f i t and others choose to use medicines to control their stress levels. Students also found with very much stressed out because of academics, projects, exams, and whatnot. There are many ways through which one can check whether you have stress or not. According to this situation, the medical diagnosis system based on human physiology becomes more requisite as compared to others. Human physiology-based study plays a important character in the detection of mental stress in persons. There have also been eventual researches which are done on the detection of stress based on facial emotions. To find out whether stressed or not we need to see a doctor and get checked, but it seems to be not practical at all times to do so. In fact, in the era of digitalism, where everyone has a smartphone there is a dearth of finding novel ways through which we can make use of technology to detect your stress levels automatically. There are wearable devices that detect stress levels based on your body activity. Many approaches aim for the detection of stress through the use of wearable devices. The approach that we are presenting in this project is predicting stress through medical data of the patients using random forest regression. Additionally, an examination between oneself fabricated convolution neural model and a portion of the pre-trained models has been finished. This is another methodology and we are getting very promising precision by utilizing sufficient research experiments on 2000 irregular trees in the model. The results achieved are the outcomes of effectively anticipated with the accuracy utilizing the model. The outcomes of this research can be useful in directing the future which explores automated stress prediction-based systems.


Understanding Stress
Stress is a commonly used word, but the meaning is difficult to settle on because it is complex and difficult to demonstrate and quantify [8]. However, since stress can not be established by scientists, how can they measure it? The Merriam-Webster dictionary describes stress as a "social, chemical, or emotional force that induces physical or mental stress and may be a factor in the causation of disease." Stress may be defined non formally as the way the body responds to any demanding or unsafe condition [9]. The brain initiates a stress reaction as feedback to sensory inputs from the ear, eye, and nose. At time of the body senses a risk or panic situation, it could be real or the virtual, mechanism for resisting such hazardous situations started by the human body. The hippocampus rapidly sends a signal of pain towards the hypothalamus. The hypothalamus is closer to the brain's command center [10]. Stress can be categorized mainly into two types such as acute stress and chronic stress. The acute is somewhat beneficiary stress because a limitation of this type of stress becomes beneficial for our daily work. For example, if we have presented work in an office, feeling a little stress makes a person busy with his work which leads to success in his work. In this way, acute stress is becoming a motivating factor for the person. Again when such a stress level increases out of limit it becomes hazardous for an individual this type of stress is considered severe type stress. Chronic stress is stress that builds up over a prolonged period when you are subjected to a hectic environment. When you enter into this chronic mentality of stress, it will result in continuous feelings of fear, depression, or other stress signs that are very dangerous for such an individual's health. Again the question arises that how to identify that someone is under severe stress? there are some ways to identify that individual is under chronic stress such as Psychological symptoms include difficulties focusing, worrying, exhaustion, and difficulty recalling. Emotional signs such as temperate, angry, moody, or annoyed rise. Physical symptoms, such as high blood pressure, weight gain or lack, loss of immunity, and changes in women's menstrual cycle. It also leads to heart diseases like heart problems, hypertension, cancer, etc.

A. How Random Forest Regression works
Random Forest is one of the most effective machines learning models for predictive statistics, making it an industrial machine learning task. The random forest model is a type of add-on model that creates predictions by combining decisions from a sequence of basic models. where the ultimate model is the total of the basic simple models. Here, the division of each foundation is a simple decision tree. This deep method of using multiple models to obtain better guessing performance is called model integration. In random forests, all base models are built separately using a separate sample of data.

B. Motivation
Almost everyone has stress nowadays. When stress becomes chronic, it poses a high health risk and that's why it is a vital issue to be considered. Stress is caused by a lot of factors including deadlines, emotions, work stress, etc. It can easily be predicted by using medical data of patients using random forest regression. The Random Forest is volatile, it is convenient to use a machine learning algorithm that is built up, in the absence of hyper-parameter tuning, we get good results often. And it's one of the major widely used algorithms because of its clarity and that it can be used for regression and classification work. One of the biggest drawbacks with over-the-counter machine learning, but generally this won't happen so easily in a random forest algorithm. Hence if there are enough trees in the forest, the divider will not exceed the model.

II. LITERATURE SURVEY
As stress becomes a worldwide problem, there are so many researches are going on stress. Mr.Purnendu Shekhar Pandey in his research uses the relation between heart rate and mental stress. They use machine learning techniques like linear regression and SVM(Scaler Vector Machine) for the classification work which is useful in the prediction of stress. IoT is used here to alarm the person when they are in actual risk condition. they classify the stress level in 6 classes as Resting, warm-up, Exercising, Endurance, dangerous, and max [1]. They got an accuracy of 68% which can be improved further. Only heart rate is can't be sufficient to detect the stress of the person. We have to consider the facial expressions as well to detect the level of stress of that person. Sriramprakash.S, Prasanna Vadana. D, O. V. Ramana Murthy proposed a technique that was applied on SWELL-KW dataset on Kaggle. They Considered the physiological signals obtained from ECG (Electrocardiogram), galvanic skin response sensors, etc. Again they use the SVM and KNN (K-Nearest Neighbour) Machine Learning algorithms to classify the data. they proposed the technique for the selection of dominant features and use this with overlapping techniques to get better results. They conclude that HeartRate (HR), HeartRate Variability (HRV), Galvanic Skin Response (GSR) which are the time and frequency domain features are sufficient for the prediction of stress [2]. There proposed system gives classification accuracy by using KNN is 66.52% and by using SVM is 72.82%.

Martin Gjoreski, Hristijan Gjoreski, Mitja
Lustrek, Matjaz Gams proposed a system that can be used either in the laboratory or in real life for continuous stress detection purposes. The web application was developed for collecting the data in the laboratory. In this application, they use certain equations to classify the stress levels of a person. Again in real life for the collection of data they used a combination of Ecological Momentary Assessment (EMA) as well as stress log, which was implemented on a smartphone [3]. In actual method they use Base stress-detection classifier, Activityrecognition classifier, Context-based stress detector for detection of stress. they got 92% accuracy in this work but there is t h e actual the challenge of collecting results from the laboratory with measuring the cortisol level in the body for a longer period. In this era of technology and innovation where computers are used to monitor the emotions of people's, however, The problem is that there is so much technology accessible for emotional detection such as image processing but it has some demerits because it is tough to see the real feeling from artificial emotions. Because of the growth of the technological world, this field needs more awareness and research contribution. Mr. Anil R Surve and Mr. Manish N. Patil have proposed a system to make existing sensory processing extremely effective. Bio (non-invasive) sensors are used to collect sensory-related data in the human body. Using Electrodermal Activity (EDA) they measure the skin's movement of the human body to detect various processes. After the diagnosis is made using behavioral analysis like emotional patterns they can predict future illnesses and other disorders [13]. The proposed researches are done with the long-term use of wearable devices for detection and prediction of stress simply means they use the Supervised learning methods and operated on large labeled datasets. Elena Vildjiounaite, Johanna Kallio, Vesa Kyllönen, Mikko Nieminen, Jani Mäntyjärvi, and Georgy Gimel'farb proposed a randomly controlled pressure control device based on a smartphone as a single device. They use Markov Hidden Discrete models (HMM) with Maximum posterior marginal (MPM) resolutions [4]. As they don't use any other hardware requirements they can be suitable for lifelong use. They suggested a full-day normal behavior model and distinguished it into two pieces of difficult and normal days. The main limitation for this work which uses an unsupervised technique is the compulsion to belonging a smartphone with the person all time. The various factors such as HR, HRV, ECG, EEG can be used to detect and predict stress but by using facial emotions as an additional factor we can improve the accuracy for detection and prediction of stress work to great extent.G. Giannakakis, M. Pediaditis, D. Manousos, E. Kazantzakis, F. Chiarugi, P.G. Simos, K. Marias, M. Tsiknakis proposed the study which is characterized by a paradigm for the identification and interpretation process of stress-related emotional states with the aid of video captured facial signals. The in-depth research is performed on different internal or external stressors impacting established body states such as normal, calm, and stressed. The various features like heart rate estimation through Photoplethysmography, events related to the eye, various mouth activities, and motions of the head are considered. The comparative study of relaxed state with stress or anxiety state is done [5].In classification work, they use different classifications tools like shape templates, Eigen vectors, Hidden Markov Model (HMM), Support Vector Machine(SVM), Artificial Neural Network (ANN). As a result, they validate that the eye blinking rate is increased during stress or anxiety condition. In addition to that head, movement velocity is also affected. Considering mouth activity, while watching videos that are stressful the median and temporal variability (VTI) is increased. they got an average of 86.23 % accuracy for the proposed work. Anil R Surve, Vijay R. Ghorpade, and Anil S. Patthe these authors proposed a system for continuous recognition of facial expressions. Considering the facial expressions, we can detect the emotions of that person. It is easy to detect the emotions of a person for a human being but for the computer, it is difficult to detect the emotions of a person. This proposed work gives a solution to detect one's emotion by considering facial expressions. The technique used here is Emergencebased Eigen face technique. For extracting information from image frames and to reduce the dimensionality of computations Principal Component Analysis(PCA) technique is used [6]. In classification work, they use Euclidian distance metric as well as temporal dynamics for the redundancy removing process. They present the results into four categories of emotions such as neutral, Happy, Disgust, Anger, Sad. They got an accuracy of 91.26% for the identification of emotions of the person using this technique.

III. PROPOSED SCHEME
The main purpose of this work is to develop a system that can predict stress. In this case, a machine-based approach was used. A random forest regression-based model was developed that assumes the inclusion of medical information for patients. When training is applied to the model on this data, the model predicts the level of stress of the patient whose medical information is included. Random forest Regression has been used in various fields for e.g. in banking, medical field, share market, and electronic commerce. In this field, it is also helpful for detecting fraud customers which may be responsible for scams in the bank. It is used to determine future stock performance in the finance department. In the healthcare area, it helps identify the perfect composition of components in drugs and to examine a medical history of patient which will help to detect diseases belonging to this patient. Also, efficiency metrics will apply between this work and the existing works to analyze if the proposed model based on random forest regression is efficient and feasible.

IV. METHODOLOGY
The objectives of our work were: To find how efficient and accurate the Random Forest-based models using patient's data can be in stress prediction. To carry out this work, we chose the alternative of using random forest because It can be easily predicted by using medical data of patients using random forest regression. The Random Forest is volatile, it is convenient to use a machine learning algorithm that is built up, in the absence of hyper-parameter tuning, we get good results often. Also, this technology has not been yet applied for solving stress prediction problems using patient's medical data. Thus, we planned to find a database that had medical data which plays a great role in stress. After data acquisition, the dataset was pre-processed to recover the missing values by using the mean method. After this, feature scaling was applied to the dataset so that no attribute intimidates other attributes. Finally, regression using Random Forest models was done and the results were compared.

A. Data pre-processing
The training details come from a project done at MIT by Healey as part of his Ph.D. concept, which consists of body measurements performed on young people driving in stressful environments and leisure time to create a troublefree basic reading [12].

B. Different attributes used in Dataset:
Galvanic Skin Response (GSR) sensors are often used to measure stress by measuring skin resistance, and when a person is more stressed, sweating profusely and resisting weight loss. Heart rate variability (HRV) is a superset for the various factors found in the interval between heartbeats called RR intervals. HRV on average is measured by a clinical level electrocardiogram (ECG) [13]. The NN interval is a different way of saying RR interval, or interval between R peaks. The letter N is used to distinguish whether these figures are intended to be found in the "normal" RR spaces, or RR intervals that represent normal heart time and are not an artifact.
Time According to the above graph, handGSR is an attribute on which prediction of stress highly depends. After that interval in seconds is the second most important attribute in stress prediction. While footGSR and NNRR have the same importance in stress prediction. The graph also represents that stress is also related to ECG, EMG, and HR. RESP is a factor next to them in stress prediction. Which seems complete we were there as a factor that can be used to determine the stress or are relatable to stress. This graph also shows that the remaining attributes have very little relation with stress.

IX. NUMERICAL MEASURES FOR EVALUATING THE MODEL
To find how reliable our model is we have calculated several measures. One in them is explained the difference in values. This value leads to individual estimates points for corresponding diversity Target variation. This setting determines the value of the whole world that has captured the unbroken diversity. Multi-output value = 'variance weighted' is the default value of the r2 score for backward compatibility. Thus our explained variance score is 0.921048 and the r2 score is 0.920961 which shows our model is very much reliable as the higher the value of these variables closer to the one the higher will be the reliability which shows our model is very good in its prediction.

X. CONCLUSIONS
The Random forest algorithm is one of the proven algorithms which were used in various researches. It is the most promising option as compared to other different algorithms, because of its compatibility with both classification and regression. The research attempt is configured in such a way that it predicts the stress level of patients whose data was made available. The Random forest regression-based model takes the medical data of patients as input and it gives results into the stress level of that patient as output.
The proposed stress-predictive system using randomized learning equipment based on a random forest rescue model has achieved 95.6 percent accuracy which is the optimum finding of the research. XI.