3.3.3. Data Processing for Mental Fatigue Prediction
After the data preprocessing, to better adapt to the research on mental fatigue prediction, further data processing is carried out: data label processing based on reverse data binning technology. Inspired by the data binning technology [
52], this technology can group continuous data, with each group represented by a common data, achieving the transformation from continuous to discrete data. The schematic diagram of data binning is shown in
Figure 3. Specifically,
Figure 3 illustrates the mechanism of data binning, where the x-axis represents the original continuous data values, and the y-axis denotes the frequency or count of data points in each bin. The diagram visually demonstrates how continuous data is segmented into discrete bins, each assigned a representative value, laying the foundation for understanding the subsequent reverse data binning technique in this study.
During the data collection process, labels for mental fatigue data were obtained using a modified Karolinska Sleepiness Scale (KSS). These labels are discrete data ranging from 1 to 5 with a step size of 1. Due to the characteristics of mental states under fatigue, a specific level of fatigue typically does not occur instantaneously but persists for a certain period. As a result, numerous straight lines appear in the line chart. Given these characteristics of mental fatigue data labels, it is unreasonable to directly perform time series prediction on them. Therefore, a reverse data binning technique was proposed to process the data labels, converting discrete data into continuous data.
The conversion of labels from discrete values to continuous values is achieved by actively introducing random perturbations into the fatigue levels (as shown in Equation (4)). Suppose for a fatigue level x (where x is an integer), a random perturbation within the range of (−σ, σ) is applied, transforming x from a fixed integer value to a random distribution within this range. Considering that the mental fatigue data labels are obtained by averaging the scores given by experts and the participants themselves and then rounding off, the range of σ is restricted to (0, 0.5]. If σ is greater than 0.5, it may lead to an upward or downward shift in the continuous fatigue level, thereby affecting subsequent prediction results.
To accurately determine the optimal value of σ, the study employed the GridSearchCV method [
53] combined with a cross-validation strategy for parameter optimization. Specifically, the grid was divided into five candidate values: 0.1, 0.2, 0.3, 0.4, and 0.5. The generalization ability of the model under different σ values was evaluated through cross-validation—that is, the dataset was divided into a training set and a validation set each time, the model was trained using the training set, and its performance was tested on the validation set. This process was repeated multiple times to reduce the impact of randomness in data partitioning on the results. Finally, through grid search and cross-validation, it was found that when σ is 0.3, the cross-validation score is the highest, indicating that the model performs the most stably and excellently on different data subsets under this value. Therefore, σ was set to 0.3, and the operational formula for the continuous transformation of discretized data labels was obtained (as shown in Equation (4)). This parameter selection method combined with cross-validation effectively ensures the reliability of key parameters in the reverse data binning technique, laying a foundation for the accuracy of subsequent time series prediction models.
In this equation,
represents the original discretized integer data label sequence, and
is a random variable that follows a uniform distribution within the range of (−0.3, 0.3), while
represents the data label sequence after continuous transformation. An example of discrete label continuous transformation is shown in
Figure 4.
Following the data annotation procedure, it is essential to conduct a screening of the data employed for mental fatigue prediction. This research posits that mental fatigue is a complex and progressive psychophysiological phenomenon, which can be categorized into three distinct stages: non-fatigued, intermediate, and fatigued. The intermediate state, serving as a crucial transitional phase, encompasses physiological and psychological traits that mirror the dynamic alterations of fatigue.
The research aim is to establish an effective model for predicting the mental fatigue of operators. Given that incorporating all non-fatigue data during the training process may potentially disrupt model learning and diminish prediction accuracy, a systematic data screening mechanism has been introduced. This mechanism aims to retain the intermediate state data that can prominently reflect the characteristics of fatigue and the rules governing state transitions, thereby laying a solid data foundation for enhancing the prediction accuracy of the model.
Prior to the data screening procedure, two concepts are presented. First and foremost, studies have indicated that the reaction time of humans in response to emergencies can extend up to 15 s [
54]. Building upon this finding, this research utilizes 15 s as a boundary value, and the operational duration of numerous steps will also be determined on the basis of this data.
Secondly, the concept of the 3 s rule [
55] is introduced. The 3 s rule stipulates that when predicting mental fatigue, it is possible to detect the state 3 s prior to a given state, meaning that it is feasible to identify whether the fatigue state has changed 3 s in advance. Considering the diverse requirements for the reliability of experimental research, the time need not be rigidly fixed at 3 s; rather, it can range from 2 to 6 s.
Taking into account the specific circumstances of this study, where the state is determined every 2 s, and aiming to balance reliability with the early detection of fatigue transitions, 6 s has been selected as the length of the detection window. This can be referred to as the “6 s principle”.
The specific steps of data filtering can be roughly divided into three steps. In step one, the experimental data of each participant needs to be transformed. Specifically, the data is converted into a tensor with a step size of 7 based on the labels, and a sliding window of length 7 is constructed centered on each state. Since it was found in the experiment that the collection time of seven states is approximately 15 s, and in combination with the two concepts introduced earlier, both the step size and the length of the sliding window are set to 7. For example, if state
is to be analyzed, a sliding window from
to
is constructed centered on this state. Step two involves classifying the instantaneous states of the experimental participants. The mental states of the subjects are divided into four categories: State 1, State 2, State 3, and State 4. The specific contents corresponding to each of these four states will be provided later. According to the “6 s rule”, each state requires 2 s. Therefore, the basis for distinguishing these states is the first three states and the last three states within the sliding window. Taking State
as an example (instantaneous state), if the category of the state needs to be determined, the average values of the first three states and the last three states need to be calculated, that is,
and
. In this study, fatigue level 3 was chosen as the dividing line for distinguishing states. Based on this definition, the classification and explanation of mental fatigue states are shown in
Table 3. The schematic diagram of the data screening logic is shown in
Figure 5.
After determining the instantaneous states of all subjects in Step 3, screening is conducted according to the four mental fatigue prediction data screening rules detailed in
Table 4.
Following data processing and screening, the data will exhibit two significant advantages. Firstly, it optimizes the dataset for mental fatigue prediction, enabling the timely anticipation of imminent mental fatigue. This corresponds precisely to the prediction of fatigue levels 4 and 5 within the fatigue assessment framework of this study. This procedure refines the data, rendering it more conducive to subsequent predictions of fatigue levels 4 and 5. Moreover, experimental measurements demonstrate that the screening criteria do not result in an inadequate amount of data.
Secondly, it rectifies potential problems inherent in the dataset. During the experiment, participants tend to forcibly overcome drowsiness and become more alert as the experiment nears its conclusion. This phenomenon leads to relatively poor data quality towards the end of the experiment. Given that mental fatigue prediction is a time-series prediction task, the trailing part of the data is utilized for testing purposes. Without screening, paradoxically, the better the model’s performance, the poorer its predictive ability on this particular dataset. Through data screening, data that is detrimental to prediction is effectively removed, thereby resolving this latent issue.
3.3.4. Models for Predicting Mental Fatigue
Prediction of mental fatigue falls into the category of time series prediction tasks. Each algorithm selected in this study is chosen for its unique advantages to address the specific challenges of fatigue dynamic modeling in industrial environments.
In the field of machine learning, the Light Gradient Boosting Machine (LightGBM), based on the gradient boosting framework, optimizes its performance through Gradient-based One-Side Sampling (GOSS) and Exclusive Feature Bundling (EFB). In this way, it not only maintains high accuracy but also improves training efficiency, making it highly suitable for processing high-dimensional time series data [
56,
57]. Its significance lies in its ability to balance accuracy and speed, which is crucial for industrial control rooms that require real-time fatigue warnings to prevent operational errors. Unlike computationally intensive models, LightGBM requires fewer resources, making on-site deployment feasible, and its robustness to noise in facial feature data (such as brief occlusions) ensures reliability in dynamic working environments.
Among deep learning models, the Gated Recurrent Unit (GRU), a lightweight alternative to the Long Short-Term Memory (LSTM) network, captures long-term dependencies through update gate and reset gate mechanisms. With fewer parameters and faster training speed, it provides a more efficient solution [
58,
59,
60]. It is selected because of its focus on sequential dependencies, which aligns with the gradually cumulative nature of mental fatigue—a key aspect for modeling the transition from alertness to fatigue over time.
The Temporal Convolutional Network (TCN), integrating causal convolution, dilated convolution, and residual connections, can effectively model long-term dependencies and support parallel computing, thereby enabling efficient processing of time series data [
61,
62]. This makes it valuable in analyzing multi-scale patterns in fatigue evolution (such as short-term fluctuations in eye movements and long-term changes in posture), providing a complementary perspective to recursive models like GRU.
The Transformer architecture [
63,
64], leveraging self-attention mechanisms and positional encoding, overcomes the distance constraints in temporal dependencies. This makes it particularly adept at capturing global feature correlations and has demonstrated excellent performance in multi-variable time series prediction. The motivation for introducing it lies in its ability to highlight critical moments in the fatigue timeline (such as sudden changes in blink frequency), which is crucial for identifying early warning signals in noisy operational data.
In this study, mental fatigue prediction is performed using the aforementioned models. By comparing their performance—from the efficiency of LightGBM to the global awareness of Transformer—we aim to identify the optimal approach that balances accuracy, speed, and industrial applicability. Ultimately, a performance comparison is conducted based on actual experimental data to verify which model best meets the needs of fatigue management in control rooms.
To statistically validate the performance differences among the models, a one-way analysis of variance (ANOVA) was employed. This method was chosen because it can test whether there are significant differences in the means of performance metrics (accuracy and mean absolute error) across the five model types (independent variable). Additionally, post hoc pairwise comparisons were conducted to identify specific differences between individual models, ensuring the reliability of the performance conclusions.