Fatigue detection using decision tree method based on PPG signal

— Fatigue can be defined as a complex psycho-physiological situation marked by sleepiness or fatigue, poor achievement, and some physiological alteration. The fatigue can be known by using Heart Rate Variability (HRV). HRV frequency-domain analysis is used to determine based on the absolute or relative signal strength distributed in high-frequency band (HF band), low-frequency band (LF band), very-low-frequency band (VLF band), and ultra-low-frequency band (ULF band). A decision tree may categorize weariness based on the subject’s heart rate data. To initiate the experiment, a dataset of the heart rate signal was obtained by applying photoplethysmography (PPG). The signal was recorded during the subject conducting the physical activity session. The PPG sensor is mounted behind the left ear and read at 100 samples per second. The signal has already undergone preprocessing. The feature obtained through preprocessing is then used to construct the decision model. Four attributes were involved in this study. The feature used in developing a decision tree is the the HF power, LF power, normalized HF power, and normalized LF power. The decision tree was chosen in this study because it will produce a criterion in constructing an if-then rule. The decision tree C4.5 method is developed by choosing the feature as the root, generating branches, separating each instance into a branch, and repeating until all instance has been allocated into a leaf. This research has a 75.94% accuracy rating. This research precision, recall, and F-measure scores were 0.736, 0.736, and 0.736, respectively.


I. INTRODUCTION
Fatigue is a complicated psychophysiological syndrome characterized by weariness or drowsiness, inadequate performance, and physiological alterations [1], [2]. Fatigue impairs physical and mental achievement by reducing alertness and attentiveness, lowering planning and decision-making abilities, memory loss, greater risk-taking and mistakes in perception, higher sick time, increasing incident levels, and rising medical expenses [2]. As a result, fatigue management methods have gained a lot of attention for managing possible tiredness hazards in businesses and enhancing individual well-being [3]- [6]. They all share the goal of detecting people's tiredness in real time and intervening to reduce any consequent gaps in achievement.
Experimental definitions of fatigue emphasize weariness, feelings of exhaustion and low energy, a lack of encouragement, and a total refusal to complete a task. Fatigue or tiredness as an experience construct is quantified using people's self-reported sensations, which are frequently measured using a variety of standardized fatigue assessment measures [2]. Targeting an experienced standard of exhaustion can be a relevant therapeutic aim for medically weary persons and a preferred result for fatigue management technology in general. However, there might be a disconnect between an individual's experience of exhaustion and fatigue and the exterior effects. Heart rate is usually described by counting the times of the heart beats over a while, usually in one minute [7]. Photoplethysmography (PPG) is a noninvasive and low-cost method of measuring cardiovascular blood volume pulses using differences in reflected or transmitted light [8]. PPG is widely assessed in medical diagnosis using a sensor attached to the subject Jurnal Infotel, Vol. 15, No. 2, May 2023 https://doi.org/10.20895/infotel.v15i2.935 Fatigue detection using decision tree method based on PPG signal fingertip to collect critical heart physiological signals. The PPG apparatus employs an optical sensor, which is made up of a source of light and photodiodes [9]. A green light-emitting diode is usually chosen as the light source to illuminate the blood vessels under the patient skin tissue. The photodetector is applied to monitor the quantity of light returned by the blood, which changes with each heartbeat [9].
Heart rate variability (HRV) is the difference between heartbeats sequentially appearing in a given interval [7]. HRV may be measured and computed on the time or frequency domain analysis. For example, the HRV can be analyzed in the time domain based on the inter-beat interval (IBI) readings variation. The absolute or relative signal strength distributed in the high-frequency band (HF band), the low-frequency band (LF band), the very-low-frequency band (VLF band), and the ultra-low frequency band (ULF band) bands is computed during the HRV frequency-domain analysis [10].
Each frequency band on the HRV frequency-domain analysis represents a different condition. The HF band representing the respiration band has a frequency range of 0.15 Hz -0.40 Hz. This frequency band is impacted by breathing rates ranging 9-24 bpm [11]. When the person sighs or does a deep breath, the influence of activity related to the respiratory system may be seen in the LF band. This band is impacted by breathing rates ranging from 3-9 bpm and has a frequency range of 0.04 Hz -0.15 Hz [12]. The frequency range of the VLF band is 0.0033 Hz -0.04 Hz, while the ULF band indicated by a frequency range under 0.003 Hz [13].
The C4.5 method is a popular classification technique in research. C4.5 is a modification of the ID3 algorithm [14]. The C4.5 algorithm has proven a good performance when used in various kinds of applications, including customer categorization as a foundation for credit [15], [16]. The C4.5 algorithm was also used to forecast self-candidate incoming students in university [17] and to categorize the graduation predicate [18]. Furthermore, the C4.5 algorithm has been applied in the medical field for diagnosing patient sicknesses such as strokes, dengue fever, and diabetic patients [19]- [21]. This classification method has also been used on classification tasks based on the biological signal, such as emotion classification based on the EEG signal [22].
This research was carried out to the subject's fatigue based on the heart signal. The heart signal is preprocessed and applied as the input of C4.5 to determine the subject fatigue. The categorization results can be used to inform a fatigue management campaign. The purpose of this campaign is to improve worker health and increase worker productivity.

II. RESEARCH METHOD
This research proposes fatigue detection based on the subject heart rate (HR) signal by applying a decision tree method. The research was started by collecting the dataset of the HR signal. Next, the HR signal is preprocessed. The feature which has been extracted from the preprocessing step is then applied as inputs for developing the model of a decision tree.
The developed model has then tested its performance. The research step is shown in Fig. 1.

A. Dataset Collection
The dataset was collected based on the study of Kalanadhabhatta et al. [23]. In addition, the researchers provide FatigueSet, a dataset that includes sensor data collected by 4 wearable apparatuses gathered when people perform physically and psychologically taxing tasks. FatigueSet enables additional study into tiredness and the creation of other fatigue-aware apps.
Based on the study, participants were equipped with ear PPGs to measure physiological signals. The overall data acquisition process for fatigue measurement is shown in Fig. 2. For three minutes, they sat at rest in a relaxed posture while initial physiological data was collected. After the baseline collecting time, volunteers filled out a survey to assess their physical and mental exhaustion, as well as two cognitive tests to assess baseline cognitive function for subsequent stages of the experiment. The experiment was conducted by asking the subject to do a 3-minute physical exercise session in which subjects were allocated to one of 3 intensity activities on a specific day (low, medium, or high). As a result, 5 km/h pace walking, 7 km/h pace jogging, and 9 km/h pace running were chosen to represent low, medium, and high-level fitness activities, respectively. In every activity phase, physical exercise was continued by a  quick assessment of mental tiredness and cognitive function.
The PPG signal was acquired by implementing a pulse sensor. The PPG sensor was mounted behind the subject's left ear. The sensor's output is read at a sampling rate of 100 samples per second. The PPG signal is recorded during all sessions of the data acquisition. This research uses only the PPG signal during physical activity sessions and the survey. The total PPG signal length is 5 minutes.

B. Signal Preprocessing
Several steps are used to preprocess the signal read from the PPG sensor in the PC. A low pass filter was applied to filter the signal. The second order Butterworth was chosen to develop the filter. The Butterworth filter [24] used in this study can be seen in the given transfer function in (1).
where Q is the damping ratio parameter chosen in this filter design, the value is 0.707. The ω 0 is equivalent to 2πf c . The f c represents the filter's cut-off frequency, which is equivalent to 5 Hz. After that, the function in (1) is turned into a discrete and then transformed into a difference equation, yielding the following formula in (2).
where x[n] is the input signal and y[n] is the output signal. The values at the current, past, and m-past sampling points are represented by the indices n, n−1, and n−m, respectively. Fig. 3 is displaying an example of a filtered signal.
Feature extraction can be considered as one of the most significant steps or procedures in the categorization of heart signal [25]. The filtered signal is then used for the feature extraction process. The feature extraction is conducted by calculating the LF and HF power of the PPG signal. The HF band is estimated with a frequency band of 0.15 Hz to 0.40 Hz. The LF band is estimated with a frequency range of 0.04 Hz to 0.15 Hz. Therefore, two feature, including LF dan HF power, has been extracted. The first LF and HF power is applied as a baseline and used to normalize other LF and HF power. Therefore, two additional features, namely normalized LF and HF power, were also used in the study.

C. Decision Model
This research implements one of decision tree methods called C4.5 as the decision model. Ross Quinlan [14] created the C4.5 decision-making method. The primary idea behind this technique is to build a decision tree by picking characteristics that has the greatest priority or may be expected to get the best result based on the entropy parameter [16].
The C4.5 decision tree contains two important concepts: tree model generation and implementing the tree rule model. The rules in the C4.5 will produce a criterion in the construct of an if-then statement [26]. The C4.5 method makes a decision tree in four steps: picking characteristics as the root, generating branches for every data, splitting each occurrence into a branch, and recursively repeat the procedure in each branch until all branch events have the same class.
The important parameter in developing a decision tree is entropy and information gain. The entropy is calculated as shown in (3).
where S denotes the collection of classes. The n represents the number of divisions S, while the pi represents the percentage of class i in the dataset. Based on the entropy, the gain is calculated and used  to determine the root or branches in the tree. The gain is determined by using (4).
where S represents the collection of target classes and A represents the attribute/feature. The number n represents the number of feature A, the number |S i | represents the number of instances on the i th split, and the number |S| represents the number of instances in S.
Some branches inside the training set may reflect noise or outliers during the decision tree development process. By trimming trees, it is possible to detect and cut branches. Trees that have been pruned should be narrower and more understandable.

D. Validation and Testing
Cross-Validation is applied in the testing and validation process in this investigation. Cross-validation is used to compile and evaluate the training data and test data that will be used. In this investigation, one cross-validation approach will be employed, with as many as k experiments is conducting for validating the categorization result. The value of k which is utilized in this research is 10, which is commonly used in many studies as the best option for the validation method. The C4.5 algorithm's output was used to determine its accuracy based on a confusion matrix. The precision and recall were also computed.

III. RESULT
This section discusses the extracted feature and the decision tree model validation and testing. Based on the explanation on the previous section, there are four features that has been extracted. The features are HF power, LF power, normalized HF power, and normalized LF power. The scatter plot of the features is shown in Fig. 4.
The scatter plot in Fig. 4 shows the extracted feature. Fig. 4(a) displays the scatter plot of HF power on the x-axis vs LF power on the y-axis. The Fig. 4(a) shows the scatter plot of normalized HF power on xaxis vs normalized LF power on y-axis. The blue mark represents low fatigue, while the red and green marks represent medium and high fatigue, respectively. The scatter plot shows that the data is mixed and cannot be easily classified. The decision tree will help to classify the fatigue based on the extracted feature.

B. Decision Tree Model Validation and Testing
The extracted feature is used to classify the fatigue. The class label in this study is the level of the activity that has been conducted during the data acquisition. The activity can represent the fatigue level of the participant. The class labels are low, medium, and high.
To evaluate data to categorize weariness based on activity, a cross validation technique is utilized. This method is used to divide the number of train and test sets. A prominent cross-validation approach is k-fold cross-validation. The variable k is set to 10 in this study.
In 10-fold cross-validation, the dataset is segmented into 10 folds, with the organization of the dataset supplied for approximately to 10 % of the entire dataset in each fold. Folds 2 to 10 are used for training data if fold 1 is used for testing data. As a consequence, ten training and testing dataset combination will be generated by this procedure. Therefore, the assessment will be carried out 10 times. Table 1 shows the overall outcome of the model testing as a confusion matrix. Based on Table 1, it is possible to infer that the majority of data can be appropriately categorized. Only a handful of the data were wrongly categorized. There are 43 and 37 occurrences of 319 low fatigue instances that are classed as medium and high fatigue, respectively. There are 40 and 52 medium fatigue cases that are classed as low and high fatigue, respectively. There are 43 and 8 high fatigue instances, that are classed as low and medium fatigue, respectively.
According to Table 1, there are 704 out of 927 cases were accurately categorized. This research has a 75.94 % accuracy rate. This degree of accuracy is appropriate for classifying fatigue but still needs accuracy improvement. This study only yielded an accuracy of 75.94 % because using limited features such as HF power and LF power. The extracted feature has overlapped data for each class, as shown in Fig 4. The error rate is determined to demonstrate the system's performance. There were 223 wrongly labeled instances out of 927 total. This study has a 24,06 % error rate. The error value is regarded as a reasonable result [27]. Based on the confusion matrix, the overall result can be calculated. The overall result of the model testing is represented as a performance evaluation and shown in Table 2. The weighted mean of precision in this investigation is 0.736 based on the performance evaluation presented in Table 2. Precision values for low, medium, and high fatigue are 0.742, 0.737, and 0.728, respectively. The precision of the class label is almost the same.
The weighted mean of recall in this investigation is 0.736 based on the performance evaluation presented in Table 2. The Recall values for low, medium, and high fatigue are 0.749, 0.712, and 0.746, respectively. The recall value of every class label is almost the same.
The weighted mean of the F-measure in this investigation is 0.736 based on the performance evaluation presented in Table 2. The F-measure values for low, medium, and high fatigue are 0.746, 0.724, and 0.737, respectively. The F-measure value of every class label is almost the same. Based on the result, there are some misclassified data, but the result shows a stable performance on the precision, recall, and F-measure.

IV. CONCLUSION
A tiredness categorization based on the subject heart rate data may be performed using a decision tree. The dataset of the heart rate signal was collected to begin the investigation. The signal has already been preprocessed. The feature retrieved during preprocessing is then used to build the decision model. Four characteristics have been retrieved. The characteristics are the HF power, the LF power, the normalized HF power, and the normalized LF power. The accuracy rating for this research is 75.94 %. This investigation yielded precision and recall scores of 0.736 and 0.736, respectively. In comparison, the F-measure in this research was 0.736.