*3.7. Gait-Event Identification*

The foot–floor-contact signal was predicted by chronologically arranging the binary output of MLP network. A vector was provided as output, where sequences of 1 (swing phase) alternate with sequences of 0 (stance phase). Literature reported that stance and swing phase during healthy walking at typical speed last on average around 60% and 40% of gait cycle. Starting from this observation, the predicted foot–floor-contact signal was cleaned by removing the sequences of samples shorter than 500 samples (≈ 23% of gait cycle). Then, gait events were identified in the cleaned signal. Swing-to-stance transitions (heel strike, HS) were assessed as the sample when the sample value switched from 1 to 0. In the same way, stance-to-swing transitions (toe o ff, TO) were assessed as the sample when the sample value switched from 0 to 1. Performance of predictions was provided in terms of precision, recall, and F1-score.

A predicted HS or TO at time *tp* was acknowledged as true positive (TP) if an event of the same type occurs in the ground truth signal at time *tg* such that |*tg - tp* |< T. T is a temporal tolerance, set to 600 milliseconds. Otherwise, the predicted event was acknowledged as a false positive (FP). For all the true positives, mean absolute error (*MAE*) was computed as the average time distance between the predicted event and the corresponding one in ground truth signal.
