**5. Discussion**

The goal of this study is to propose a novel approach for classifying stance vs. swing and assessing HS and TO timing, based on deep learning analysis of sagittal knee-angle data measured with a single electrogoniometer per each leg. This so-called Knee approach achieves average stance/swing-classification accuracy over 23 folds (± SD) of 90.9 ± 0.4% in LS-test and 90.6 ± 2.9% in US (last row of Tables 1 and 2, respectively). A reduction of accuracy is detected, compared to Reference approach in both LS-test (3.9 points) and US (2.8 points). This reduction is expected, since only one signal per leg is used in Knee approach vs. the four signals per leg used in the Reference approach (more input information, better classification performance). Despite this, the average accuracy of stance/swing classification is still > 90% and falls in the range identified by the di fferent machine-learning-based approaches (sEMG, angular sensors) reported in literature [10,13,21,23,24] (see Section 2). Moreover, the absence of any significant di fference between classification accuracies in US vs. LS-test (*p* > 0.05) highlights that the network is able to keep the same performance even when tested on brand new subjects (US). Classification accuracy > 90% in US subjects is supposed to be very useful in clinical environments, where brand new subjects are analyzed every day. This outcome is associated also to a limited standard deviation, as in the Reference approach. As expected, SD is higher in US, indicating a large variability of classification for subjects not used during training phase.

Besides the suitable classification performance, a reliable post-processing of model output was implemented for gait-event estimation in US (see Section 3.7), ensuring values of prediction, recall, and F1-score very close to 1 (Tables 3 and 4). These values are not statistically di fferent from the correspondent values provided by the Reference approach. Furthermore, a mean MAE over population of 29.4 ± 13.7 ms and 99.5 ± 28.9 ms is achieved in predicting HS and TO (Tables 3 and 4, respectively). Compared to Reference value, average MAE value in HS prediction is 7.8 ms higher. However, Knee approach performs better than the sEMG approach proposed in [13], which achieved a mean HS MAE of 35 ms. TO prediction is less accurate: mean *MAE* value of 99.5 ms vs. 38.1 ms (Reference value, Table 4). It has been reported that it is more challenging identifying toe-o ffs rather than heel-strikes [13,14,33]. Thus, higher MAE in TO prediction was expected. Liu et al. achieved high accuracy in classifying gait phases with joint-angular-sensor data [10]. However, despite not reporting detailed MAE for TO prediction, they detected the most relevant recognition errors just around the transition from stance to swing (i.e., TO). Di fferences in toe-o ff MAE compared to above-mentioned studies would be likely attributable to a di fferent number of signals (and consequently of sensors) used in the di fferent approaches: one single signal per leg in Knee method, two signals in [13], four signals in the Reference approach, and even more in [10]. Thus, the desirable simplification of experimental set-up (one single sensor) is paid with a deterioration of only TO (not HS) prediction. However, this could be a good compromise for general task such as stride recognition, stride-time computation, identification of toe walking, and so on, where only HS event is involved. Moreover, it should be taken into account that present performances are achieved in condition of high variability of foot–floor contact, due to the eight-shaped path followed during ground (not treadmill) walking which includes acceleration, deceleration, curves, and reversing. Larger variability of the signal to predict, indeed, is expected to affect the performance of the classifier.

As mentioned above, promising performances in classifying gait phases and predicting gait events are provided by studies proposing a machine learning analysis of only sEMG signals, [13,14,21,23,24]. All those studies present suitable and reliable outcomes, but, to our knowledge, the best results in terms of mean absolute value in the prediction of HS and TO are achieved in a recent study of the present group of studies [14]. The technique introduced by this study is adopted here as the Reference approach. The present study is further aimed to test if the addition of electrogoniometer data could improve the classification performance of this Reference approach. The approach including both knee-angle and sEMG data to feed the neural network is referred to as KEMG approach. Detailed accuracy values in the 23 folds for stance/swing classification accomplished in LS-test and US are shown in Table 1 and in Table 2, respectively. Comparison analysis (in Figure 3 for US) shows as KEMG approach (blue bars) achieves improved accuracy values in each one of the 23 folds, with respect to Knee approach (red bars), implying a significant increase (around 4 points for both LS-test and US, *p* < 0.05) of mean accuracy over 23 folds. Mean accuracies of KEMG approach outperform of around 1 point also the Reference approach: i.e., 95.6 ± 0.3% vs. 94.8 ± 0.2% in Learned set and 94.6 ± 2.3% vs. 93.4 ± 2.3% in Unlearned set. As for Knee and Reference approaches, KEMG provides values of prediction, recall, and F1-score very close to 1, in predicting HS and TO (Tables 3 and 4). MAE values are significantly lower than the correspondent values provided by Knee approach (reduction of 36.1% for HS and 63.9% for TO, *p* < 0.05). It is worth noticing that also SD values decreased (from 13.7 to 7.9 for HS and from 28.9 to 20.6 for TO), suggesting an improved repeatability of prediction quality among di fferent folds. A significant improvement of prediction error in KEMG is observed also compared to Reference approach, in terms of reduction of MAE (18.8 vs. 21.6 for HS and 35.9 vs. 38.1 for TO). These outcomes sugges<sup>t</sup> that the introduction of knee-angle data could improve the performances of sEMG-based approaches, both in classification accuracy and in prediction error.

As introduced earlier, the clinically oriented aim of this work is trying to simplify the experimental set-up associated to instrumental gait analysis, assessing the signal of foot–floor contact from deep learning analysis of sagittal knee-angles measured by a single electrogoniometer. Gait analysis is acknowledged as a suitable procedure for quantitatively estimating the deterioration of motor function in clinics. The issue of cumbersome and time-consuming experimental protocols is getting increasingly relevant, particularly for evaluation in pathology. This is true for classical approaches based on foot-switch sensors, pressure mats, and stereo-photogrammetric systems, but also for the more recently-developed wearable sensors, which could need specific care for the suitable placement and necessity of precise calibration process, not always compatible with the clinical timetable.

Thus, an approach based on a single, reliable, easy-to-attach sensor (electrogoniometer) is truly desirable: the fewer sensors are involved, the simpler is to protect patient comfort. Aforesaid studies seem to indicate that a large data-set of signals from many sensors is needed to classify gait phases and/or estimate gait events during normal or aided walking [10,13,14]. Outcomes achieved here sugges<sup>t</sup> that it is strongly dependent on the task to pursue. If the aim is to classify stance vs. swing phase or to assess gait parameters where only HS event is involved (stride recognition, stride-time computation, identification of toe walking), the present Knee approach provides performances in line with what reported in literature, but with the clinical advantage of using one single simple sensor. When the aim is more complicated to pursue (gait sub-phase recognition, swing and stance time duration and so on) and/or more elevated performances are needed, approaches based on sensor fusion, as KEMG approach proposed here, are preferable. Thus, the main contribution of the present study consists in showing that for specific simple (but essential) tasks such as stride recognition, stride-time computation, and identification of toe walking, the single-sensor approach is able to provide classification performance comparable to those achieved by multi-sensor approaches. The information included in the present study would be particularly suitable for specific environments, such as the walking-aid devices or of portable rehabilitation system [34–37], where sensors could already be embedded in the system.
