A Bi-LSTM model was developed to detect muscle fatigue and mental stress from EMG and ECG signals respectively. To develop the model data were collected, prepared, preprocessed, and delivered to the training algorithm. The test data was then given into the classifier, whose performance was assessed using a variety of metrics. Figure 1 shows the general block diagram of the method used in this study.
2.1. Experiment setup
Subjects were informed about the experimental procedure and consented to confidentiality before the setup at Jimma University Physiotherapy Clinic. The SCU-7 EMG system with reusable electrodes was used for data recording. Subjects performed warm up exercises to prevent cramp or injury, then electrodes were placed on the flexor and extensor digitorum muscles of dominant arm as shown in Fig. 2. Isometric exercises were selected as they can easily be performed and increase muscle mass [16]. For healthy subjects, the hand grasp was set at 25kg for males and 15kg for females.
2.2. Dataset preparation
A study involving 40 healthy subjects aged 21–32 and 7 moderate severity score trauma injured patients aged 32–38 were selected for EMG data recording during isometric contraction using hand grip. The subjects had no muscle-related injuries, cardiovascular or metabolic diseases, or mental disorders. The study excluded pregnancy, smoking, and prostheses or orthoses. The moderate severity scale was chosen to prevent patient risk during the experimental procedure. 188 myoelectric signals were obtained from 40 healthy subjects and 7 injured datasets for each fatigue classes. The wearable stress and affection dataset (WESAD) were utilized for mental stress analysis, using various annotation methods and stress generation techniques based on arousal and valence [17]. The study involved 15 subjects aged 24–35, with exclusion criteria for pregnancy, heavy smoking, mental disorders, and chronic diseases. The bio-signal data included ECG, blood volume pulse, electrodermal activity, EMG, respiration, and temperature. The data was labeled using positive and negative affect schedules, self-reported questionnaires, state trait anxiety inventory, and self-assessment manikins. From WESAD recording 238 ECG dataset of was obtained, consisting of 223 normal state and 15 under stress classes.
2.3 Signal pre-processing
The EMG signal consists of four classes: Non-Fatigue, Low-level Fatigue, Medium-level Fatigue, and High-level Fatigue. The signal is filtered using a band pass Butterworth 4th order filter, a notch filter, and a 3rd order Butterworth band pass filter to remove artifacts.
The WESAD dataset includes baseline, stress, amusement, and meditation classes, with six sensor datasets. The data points in each class are labeled as normal, while stress signals are used as under-stress conditions. Balancing the dataset was performed using the synthetic minority oversampling technique (SMOTE), which duplicates data points from the minority class to create a balance between classes. SMOTE was applied only on the training dataset to reduce overfitting problems. The class distribution of ECG data for normal and under-stress before and after applying the SMOTE technique is shown in Fig. 3.
2.4. Signal Analysis
A random selection of five people was used to look into how muscle fatigue affects the Root Mean Square (RMS) and Median Frequency (MDF) of temporal and frequency domain characteristics. Figure 4(a) and Fig. 4(b) show the MDF and RMS feature plots in relation to labeled classes, respectively. These two characteristics were picked because they are commonly used to analyze muscle fatigue based on EMG signals [80].
The amplitude change of the average RMS and the frequency change of the average MDF were determined as the muscle fatigue increases. As shown in the Fig. 4 the increase in fatigue level results in an increase in amplitude of the RMS and a decrease in MDF.
2.5. Deep learning model
After the signals were properly preprocessed, the dataset was successfully divided into a training, validation, and testing data set with a ratio of 60:20:20 using the hold out strategy. After being smoothed, the preprocessed signals were eventually fed to the Bi-LSTM model.
Additionally, the 1D CNN and MLP models were developed to compare the accuracy performance of each model and choose the one that performed the best. With an Adam optimizer, categorical cross-entropy, a learning rate of 0.01, and 50 iterations, the hyperparameters were changed. An overview of the suggested model development is shown in Fig. 5. The model's performance was evaluated using the accuracy, precision, recall, F-Measure, confusion matrices, and specificity curve metrics. Figure 5 shows the general deep learning architecture implemented in this study.
60% of the ECG of WESAD data was used as a training dataset [18]. The distribution of the two class training datasets before and after using the SMOTE approach is shown in Table 1. The same procedure used in the EMG model was followed for the EMG signal model. However, the hyperparameters are modified with a reduced number of layers, an Adam optimizer, sigmoid activation function, and binary cross-entropy at epochs of 50.
Table 1
Class distribution of the WESAD stress training dataset
Class
|
Datasets before SMOTE
|
Datasets after SMOTE
|
Normal state
|
132
|
132
|
Under-stress
|
10
|
132
|
Total
|
142
|
264
|
The classification of an input signal into one of several classes, together with a specific likelihood percentage out of 100%, has finally been made possible via a precisely designed graphical user interface within the streamlit environment.