# Detecting Fatigue during Exoskeleton-Assisted Trunk Flexion Tasks: A Machine Learning Approach
## 4 Discussion  
This study focuses on developing an exoskeleton-specific fatigue detection model through a controlled laboratory experiment where study participants performed 30 repetitive trunk flexion tasks with/without medium-high back fatigue while assisted by a BSIE. Our detailed analysis included segmenting each bending cycle into three portions based on the trunk movement as bending, transitioning from bending to retraction, and retraction. This led to 135 features from measures of muscle activity in the lower back and legs, trunk motion, and whole-body stability during each trunk flexion and return cycle. While prior studies have developed similar fatigue detection models by recording physiological signals [40; 41; 42; 43; 45; 46; 54], this study is the first to develop a task- and exoskeleton-specific fatigue detection model. The fatiguing task selected for this study included intermittent trunk flexion task cycles with sustained bending and short duration relaxation breaks (15 s intervals), as most real-world tasks are defined as cycles with a diverse set of static, sustained, and dynamic activities. Between intermittent task cycles and repetitive tasks, we performed feature analysis on repetitive tasks, as they provided higher consistency between  
Figure 7: Feature importance values for measures of whole-body stability for Random Forest (RF) and XGBoost (XGB) classifiers (note: features are displayed in the format ‘value/featurename_portion’, with portions as B: bending, I: transition, R: retraction). no fatigue and medium-high fatigue levels, as well as a higher amount of datapoints, which are crucial factors to develop efficient machine learning models. We assessed the performance of four classification algorithms (SVM, LR, RF, and XGB) in detecting fatigue while performing BSIE-assisted trunk flexion tasks. These algorithms were primarily selected based on previous studies that developed similar models to detect/classify fatigue levels [43; 45]. The results of our analysis demonstrated that the Random Forest (RF) and XGBoost (XGB) algorithms consistently outperformed the Support Vector Machine (SVM) and Logistic Regression (LR) algorithms in terms of accuracy (A), recall (R), and specificity (S) across all three types of measures--muscle activity, whole-body stability, and trunk motion. Similar outcomes have been reported in past studies, where RF and Gradient Boosted Decision Tree algorithms showed better performance over SVM [35; 38; 43]. Particularly noteworthy were the high values obtained for measures of muscle activity, with the RF (A: 94.5%, R: 93.6%, S: 95.5%) and XGB (A: 94.6%, R: 94.9%, S: 94.5%) algorithms utilizing 48 features from all four EMG sensors. High accuracy from EMG measures was expected due to the correlation of muscle fatigue and global fatigue [36; 65; 66]. However, placing four EMG sensors in real-world scenarios may be infeasible due to challenges in field evaluations, especially while wearing EXOs [6]. Subsequent analyses revealed a reduction in values with a decrease in the number of sensors (and features), yet RF and XGB algorithms consistently demonstrated good predictability. For instance, XGB achieved good performance (A: 86.1%, R: 86%, S: 86.3%) when utilizing data from a single EMG sensor located on the lower back (erector spinae) muscle. Interestingly, employing data obtained from the force plate yielded high predictability with RF (A: 92.9%, R: 91.9%, S: 94.1%) and XGB (A: 93.5%, R: 94.1%, S: 93.1%) algorithms. This could have been due to a combination of kinematic (movement in COP) and kinetic (ground reaction forces/GRF) features provided by force plates, as opposed to motion or muscle activation alone. These findings suggest that floor-embedded force plates may offer greater effectiveness in detecting fatigue. The dominance of 'delta' parameters in both RF and XGB algorithms (Figure 4) suggests that changes in muscle activity over time play a crucial role in predicting fatigue during trunk bending tasks.