# Phase-based gait prediction after botulinum toxin treatment using deep learning

Adil Khan, Omar Galarraga, Sonia Garcia-Salicetti, Vincent Vigneron

<figure><img src="image_1.png" /></figure>

## To cite this version:

Adil Khan, Omar Galarraga, Sonia Garcia-Salicetti, Vincent Vigneron. Phase-based gait prediction after botulinum toxin treatment using deep learning. Sensors, 2024, 24 (16), pp.5343. 10.3390/s24165343. [hal-04691449]

HAL Id: hal-04691449

https://hal.science/hal-04691449v1

Submitted on 24 Jul 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Article

# Phase-Based Gait Prediction after Botulinum Toxin Treatment Using Deep Learning

Adil Khan <fnref n="1" />,<fnref n="2" />,* and Vincent Vigneron <fnref n="1" />

**Abstract:** Gait disorders in neurological diseases are frequently associated with spasticity. Intra-muscular injection of Botulinum Toxin Type A (BTX-A) can be used to treat spasticity. Providing optimal treatment with the highest possible benefit-risk ratio is a crucial consideration. This paper presents a novel approach for predicting knee and ankle kinematics after BTX-A treatment based on pre-treatment kinematics and treatment information. The proposed method is based on a Bidirectional Long Short-Term Memory (Bi-LSTM) deep learning architecture. Our study's objective is to investigate this approach's effectiveness in accurately predicting the kinematics of each phase of the gait cycle separately after BTX-A treatment. Two deep learning models are designed to incorporate categorical medical treatment data corresponding to the injected muscles: (1) within the hidden layers of the Bi-LSTM network, (2) through a gating mechanism. Since several muscles can be injected during the same session, the proposed architectures aim to model the interactions between the different treatment combinations. In this study, we conduct a comparative analysis of our prediction results with the current state of the art. The best results are obtained with the incorporation of the gating mechanism. The average prediction root mean squared error is 2.99° ($R^2$ = 0.85) and 2.21° ($R^2$ = 0.84) for the knee and the ankle kinematics, respectively. Our findings indicate that our approach outperforms the existing methods, yielding a significantly improved prediction accuracy.

**Keywords:** botulinum toxin; clinical gait analysis; deep learning; gait rehabilitation; long short-term memory; multi-task learning

## 1. Introduction

Musculoskeletal and neurological diseases lead to diminished quality of life [1]. These diseases may be associated with spasticity, a motor disorder that causes excessive tendon jerks due to hyper-excitability of the stretch reflexes [2]. Medical doctors recommend rehabilitation for such deficiencies, in addition to pharmacologic treatment. In particular, spasticity is usually treated with intramuscular Botulinum Toxin Type A (BTX-A) injections that enhance lower and upper limb function [3,4]. It is essential to ensure that the total dose of BTX-A administered to the patient and the doses on each treated muscle do not exceed the recommended maximal doses [5]. BTX-A injections should be separated at least three months apart due to their dangers and reversible effects on muscular function. A good BTX-A outcome can enhance and accelerate the rehabilitation process, but a bad outcome could slow down and/or limit the patient's recovery. Therefore, optimizing BTX-A treatment by choosing the correct muscles to be treated and the dose distribution is a complex and crucial task that requires careful patient assessment. Anticipating the most likely outcome of a specific BTX-A treatment could help clinicians find the most adapted

<figure><img src="image_3.png" /></figure>

check for
updates

**Citation:** Khan, A.; Galarraga, O.; Garcia-Salicetti, S.; Vigneron, V. Phase-Based Gait Prediction after Botulinum Toxin Treatment Using Deep Learning. *Sensors* **2024**, *24*, 5343.
https://doi.org/10.3390/s24165343

Academic Editors: Elisa Digo and Laura Gastaldi

Received: 28 June 2024
Revised: 14 August 2024
Accepted: 17 August 2024
Published: 18 August 2024

<figure><img src="image_4.png" /></figure>

**Copyright:** © 2024 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

<footnote n="1">¹ Informatique, Bio-Informatique et Systèmes Complexes (IBISC) EA 4526, Univ Evry, Université Paris-Saclay, 91020 Evry, France; vincent.vigneron@univ-evry.fr</footnote>

<footnote n="2">² Department of Computer Science, Sukkur IBA University, Sukkur 65200, Sindh, Pakistan</footnote>

<footnote n="3">³ UGECAM Ile-de-France, Movement Analysis Laboratory, 77170 Coubert, France; omar.galarraga@ugecam.assurance-maladie.fr</footnote>

<footnote n="4">⁴ SAMOVAR, Télécom SudParis, Institut Polytechnique de Paris, 91120 Palaiseau, France</footnote>

<footnote>* Correspondence: adil.khan@universite-paris-saclay.fr (A.K.); sonia.garcia@telecom-sudparis.eu (S.G.-S)</footnote>
treatment combination (muscle and doses) for each patient. This could also potentially enhance the patient's participation in the treatment and rehabilitation process.

Clinical Gait Analysis (CGA) is considered for treatment decisions, along with a medical history and physical examination. Based on a biomechanical interpretation of instrumental measures, CGA examines walking issues and suggests causes [6]. CGA data are clinically reliable if quality standards are met [7]. Scientific research has shown that CGA helps assess and treat neurological diseases such as Cerebral Palsy (CP) [8], post-stroke hemiparesis [4] and Multiple Sclerosis (MS) [9].

Deep Neural Networks (DNN) have excelled in clinical decision-making [10,11]. Deep Learning (DL) has been used in several CGA works to predict gait trajectories, primarily for healthy gaits [12–15]. Most works on pathological gaits tackle classification [16–19]. Among them, a few studies predict the gait trajectory some timestamps ahead [20,21], but they do not attempt to predict the post-treatment gait trajectory. Kolaghassi et al. [22] studied the abnormal walking patterns of children with neurological disorders. They used Long Short-Term Memory (LSTM) and a Convolutional Neural Network (CNN) to predict future hip, knee, and ankle trajectories up to 200 ms. Su et al. [20] used LSTM to predict gait trajectories and the five gait phases (loading response, mid-stance, terminal stance, pre-swing, and swing) to help design exoskeletons. Karakish et al. [12] implemented more reliable and simple Artificial Neural Networks (ANNs) to predict the gait trajectories using shank and foot IMU data. Four subjects were used for training, and a fifth was used for testing (200 ms future trajectories). Ding et al. [13] proposed a model for motion prediction of a subject using the motion of complementary limbs. They implemented LSTM with an attention mechanism.

The goal of this research is to enhance the prediction of the post-treatment (with BTX-A) gait signals using DL models to help clinicians with therapeutic decision-making. Our contribution aims to predict the gait trajectory after BTX-A treatment and determine how different treatments might be combined. It is based on an architecture that can handle sparse inputs (treatment data) and construct a more robust model by sharing information between sub-models representing different treatments [21]. In our past study [23], we compared serial and parallel architectures. The best one was made up of parallel Bi-LSTM-shaped sub-models. Each sub-model was paired with a treatment (injected muscle). Those models learn to map gait sequences well before and after treatment [23].

In this work, we split the learning process into stance and swing phases for the parallel architectures in [23]. Indeed, as we work on pathological gaits, the signals show more variance than normal gaits [24]. We note that the duration of the stance phase is often longer for patients than for healthy subjects; for example, in post-stroke hemiparesis [25]. The stance and swing phases obey different biomechanical constraints; therefore, we train separate models on each phase to enhance post-treatment CGA prediction. This strategy increases the global model's ability to accurately predict the complete post-treatment gait cycle. We show significant improvements in the prediction quality of pathological gait cycles [23].

## 2. Materials and Methods

### 2.1. Dataset Description

This study gathered data at the Movement Analysis Laboratory at the Rehabilitation Center of UGECAM Coubert (France) using a four-camera CX1 optoelectronic Codamotion system operating at a frequency of 100 Hz. The participants were adults with varying gait abnormalities: MS, stroke, CP, Spinal Cord Injury (SCI), and Traumatic Brain Injury (TBI). The $N_{pat}$ = 43 patients (26 males and 17 females) received BTX-A injections for spasticity treatment. In this retrospective analysis, the patients participated in clinical activities. The institution's research ethics committee approved the use of these data. The patients were informed about the research and did not object to the use of their data. The patients had undergone treatment via injections into their lower limbs, with $N_{uni}$ = 19 patients (44.18%) affected unilaterally (10 right limbs and 9 left limbs) and $N_{bil}$ = 24 patients (55.82%) affected bilaterally. Their
ages ranged from 21 to 75 years old. The time lag between pre- and post-treatment CGA was between 3 and 6 weeks. A total of nineteen muscles were injected, but we selected four frequently injected muscles: soleus, gastrocnemius (medial and lateral), semitendinosus, and rectus femoris. A fifth category, “other muscles,” grouped all the other treated muscles (see Table 1). There were 28 combinations of BTX-A injections into these four muscles. A treatment binary code vector was attributed to each lower limb:

$$ \mathbf{s}^j = (s_1^j, \dots, s_c^j)^T, s_i^j \in \{0, 1\}, i = 1 \dots c \ (c = 5 \text{ as shown in Table 1}) $$

where $s_i^j = 1$ if muscle $i$ was injected in limb $j$, 0 otherwise, and $\mathbf{d}^j = (d_1^j, \dots, d_5^j)^T$, $d_i^j \in \{0, 1\}$ is a binary vector for the disease of the patient's limb $j$. This study included five diseases: CP, MS, TBI, SCI, and stroke. $^T$ is the transpose operator.

<table><caption>**Table 1.** Considered injected muscles and their frequencies in the database.</caption><thead><tr><th rowspan="2">Muscle Number</th><th rowspan="2">Muscle/Category</th><th colspan="2">Injections in Patient</th></tr><tr><th>Number</th><th>Proportion</th></tr></thead><tbody><tr><td>1</td><td>Soleus</td><td>53</td><td>28.3%</td></tr><tr><td>2</td><td>Gastrocnemius (medialis and/or lateralis)</td><td>51</td><td>27.2%</td></tr><tr><td>3</td><td>Rectus femoris</td><td>22</td><td>11.7%</td></tr><tr><td>4</td><td>Semitendinosus</td><td>14</td><td>7.4%</td></tr><tr><td>5</td><td>Other muscle</td><td>47</td><td>25.1%</td></tr></tbody></table>

## 2.2. Dataset Preparation

The participants were recorded walking in a straight line, with or without technical aids (i.e., cane, rollator, tripod, etc.), through a 10 m-long laboratory room. The patients wore anatomical markers, whose coordinates were tracked in 3D using four sensors. The patients walked back and forth throughout the gait hallway (trials). Depending on the patient's capability, multiple trials of each patient were recorded at 100 Hz. The 3D gait kinematics were computed following the recommendations of the International Society of Biomechanics [26] based on the marker data. Each trial was divided into cycles and then segmented into the stance phase, from initial contact to toe-off, and the swing phase, from toe-off to subsequent initial contact (see Figure 1). Gait events (initial contacts and toe-offs) were detected from force platform data and automatically extracted by the HPA algorithm [27]. A human expert validated and modified all the gait events (when needed). The process of extracting cycles from trials to normalized phases is shown in Figure 2.

We considered a person's right and left cycles as different samples. Each pre-treatment cycle phase was associated with a target post-treatment cycle's corresponding phase of the same patient, leading to $n = 2518$ samples in total. Note that the number of cycles per patient varied from one patient to another.

Patient data were recorded for the following five joints in 3D: pelvis, hip, knee, ankle, and foot. This study only considered the knee and ankle kinematics in the sagittal plane.

The kinematic data of each phase were resampled and normalized to 51 points following standard procedures in CGA [28]. Therefore, DL models could be trained on sequences of the same length. For any patient's limb $j$, the input vector is an angular time series $\mathbf{x}^j = (x_1^j, \dots, x_m^j)^T \in [-180, +180]^m$, and the target vector is $\mathbf{y}^j = (y_1^j, \dots, y_m^j)^T$, with $m = 51 \times 2 = 102$. Let $\mathbf{D} = \{x^j, y^j, d^j, s^j\}_{j=1}^n$ be the input-target training set.

The data were centered and reduced by the standard deviation for normalization purposes. The goal was to use $\mathbf{g}(x)$ to make a model that maps $\hat{\mathbf{Y}} = \mathbf{g}(x)$, where $\hat{\mathbf{Y}}$ is an estimation of $\mathbf{y}$.
<figure><img src="image_5.png" /><figcaption>(b) Ankle trial</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>(c) Knee cycles</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>(d) Ankle cycles</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>(e) One cycle of knee</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>(f) One cycle of ankle</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>(g) Stance phase of knee</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>(h) Swing phase of knee</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>(i) Stance phase of ankle</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>(j) Swing phase of ankle</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>**Figure 1.** Process of converting each patient's trial into normalized gait phases (stance and swing). (a,b) knee and ankle trials of a random Patient i, respectively; (c,d) knee and ankle cycles of Patient i extracted from their trials; (e,f) One cycle of the knee and ankle joints, respectively; (g,i) normalized stance phase of knee and ankle joints from given cycles, respectively; (h,j) normalized swing phase of knee and ankle joints, respectively.</figcaption></figure>
<figure><img src="image_15.png" /><figcaption>**Figure 2.** Flowchart of data preprocessing. We acquired the trajectories of patient trials from the database and extracted all cycles from the trials for the knee and ankle joints. After that, we selected each cycle and segmented them into stance and swing phases. Finally, we normalized the phases.</figcaption></figure>

## 2.3. *Description of Models*

In our previous study [23], seven models were developed for prediction. Four were Bi-LSTM-based parallel models, and the others were serial models. The parallel models achieved better prediction results in 38 patients. LSTM [29] is good at predicting time series and can retain information for a long period of time. It has a hidden state **h**<sub>t</sub> and a cell state **c**<sub>t</sub> of the same size as the input series **x**<sub>t</sub>. The cell state **c**<sub>t</sub> is the model's memory. The hidden state **h**<sub>t</sub> is the model's prediction of **x**<sub>t</sub>.

We use the best models from our previous study [23], which are based on a Bi-LSTM. Bi-LSTM combines two LSTM models trained simultaneously: one on the forward input series and the other on the reverse input series, starting with the last input and moving on to the next-to-last, and so forth.

In both models (see Figure 3), we use five parallel layers of Bi-LSTM. Each layer is responsible for a treatment, as reported in Table 1. The five treatments correspond to the five categories of injected muscles. Each Bi-LSTM layer had 51 units. Note that each unit receives a pair of inputs for the knee and ankle, respectively.

We train separate models for the stance and swing phases. For comparison with our previous work [23], we combine both predictions using the proportion of stance and swing phases of the pre-treatment gait cycle. We retrieve the prediction for a complete cycle of the knee and ankle joints.

**MTD-driven model (MTD-DM):** The input vectors **x** and **s** are sent to the five Bi-LSTM sub-models in this architecture. The pre-treatment knee and ankle kinematic signals are represented by vector **x**. The Medical Treatment Data (MTD) are represented by vector **s**. We initialize the cell states of the LSTM as 0. The MTD (vector **s**) is handled by the treatment supervisor and was used to set the values of the hidden states **h**. For example, if a patient had injections in muscles 1 and 3 (Table 1), then the states **h**<sub>1,t</sub>, **h**<sub>2,t</sub> in Bi-LSTM, layers 1 and 3 are set to 1, and the other layers' (2, 4, and 5) hidden states are set to 0. The results of the five Bi-LSTM sub-models are concatenated to form a single tensor 'output', a one-dimensional vector, and reshaped. The reshaped output is then processed through two subsequent fully connected layers (FC1 and FC2) to predict the post-treatment kinematics (see Figure 3a).

**MTD-gated model (MTD-GM):** This architecture uses a gating mechanism to handle MTD. Instead of passing the MTD as a hidden state of each sub-model, the treatment supervisor is exploited downstream, multiplying each sub-model's output by the associated binary value of the MTD. Figure 3b shows that if there is a treatment, it will be used in the model, but if there is none, it will be neglected (multiplied by 0). The results of the remaining Bi-LSTM sub-models are concatenated and reshaped. The reshaped output is then processed through two subsequent fully connected layers (FC1 and FC2) to predict the post-treatment kinematics (see Figure 3b). Leave-one-out cross-validation was used to assess model performance. For each iteration, $N_{train} = N_{pat} - 1$ patients were used to train the model, and one was used to test it. During the training process, mini-batches with 16 samples were used. DL models were trained based on the mean square error (MSE) loss function, controlled by the Adam optimizer [30]. RMSE [31], Standard Error (SE) [32], and the coefficient of determination ($R^2$) [33] were used to evaluate the performance of the proposed models.
<figure><img src="image_16.png" /><figcaption>(a) MTD-DM Model</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>(b) MTD-GM Model</figcaption></figure>

<caption>**Figure 3.** (a) Multi-task learning architecture with Bi-LSTM sub-models: processing of MTD in each sub-model. (b) Multi-task learning architecture with Bi-LSTM sub-models: incorporating MTD through a gating mechanism.</caption>

**3. Results**

A total of 43 participants were included in this study, whereas 38 were included in our previous work [23], and five new ones were added. We evaluated the two MTL models on the new dataset using the above-mentioned evaluation metrics.

**3.1. Analysis of Stance Phase and Swing Phase**

Tables 2–4 report the performance of both models in predicting the post-treatment gait kinematics of the stance phase, swing phase, and complete gait cycle concerning the disease. The bold entries in the following tables represent the best predictions (lowest RMSE and highest $R^2$ scores). We notice that the performances of both models are equivalent in the stance phase for the knee and ankle joints (average RMSE between 1.79° and 3.17°). On the contrary, for the swing phase, MTD-GM is much better than MTD-DM, decreasing the RMSE from 3.08° and 7.01° (knee) for MTD-DM to 2.43° and 3.89° (ankle) for MTD-GM. With the MTD-GM, in the swing phase, the $R^2$ score is better for the knee than for the ankle. It is the opposite of the ankle for the stance phase.

**3.2. Analysis of Complete Cycle**

As reported in Table 4, we combine the stance and swing phase predictions to obtain the prediction for each complete cycle. We note that the MTD-GM outperforms MTD-DM, showing much better $R^2$ scores for the knee (higher than 0.8) and ankle (higher than 0.7). Table 5 reports the overall prediction results on both joints for MTD-DM and MTD-GM.
Our results improve the R² scores, which become higher than 0.9 in all cases. We also note that the R² score is increased for all groups of diseases, because combining both series changes the variance of the whole series.

Finally, the detailed results of MTD-GM for each patient per phase and joint and on both joints together are available in the Appendix A (show Figure A1). An average RMSE predicted by MTD-GM (all patients) for the stance phase of the knee, stance phase of the ankle, swing phase of the knee, swing phase of the ankle, complete knee, and complete ankle are 2.61°, 1.98°, 3.84°, 2.43°, 2.99°, and 2.21°, respectively.

<table><caption>**Table 2.** Performance of both models in predicting the post-treatment gait trajectories of the stance phase with respect to different diseases. Bold entries denote the best predictions: lowest average RMSE and maximum R² over all limbs for a given disease.</caption><thead><tr><th>Model</th><th>Model Type</th><th>Body Joint</th><th>Spinal Cord In-<br>jury (SCI)</th><th>Multiple<br>rosis (MS)</th><th>Stroke</th><th>Cerebral Palsy<br>(CP)</th><th>Traumatic<br>Brain<br>Injury<br>(TBI)</th></tr></thead><tbody><tr><td></td><td></td><td></td><td>13</td><td>12</td><td>No. of Patients<br>11</td><td>4</td><td>3</td></tr><tr><td></td><td></td><td></td><td>400</td><td>351</td><td>No. of Cycles<br>260</td><td>138</td><td>74</td></tr><tr><td colspan="8" style="text-align: center;">RMSE Mean (°) ± Standard Error<br>R<sup>2</sup> Score</td></tr><tr><td rowspan="2">MTD-DM</td><td rowspan="2">MTL, 5<br>Bi-LSTMs</td><td>Knee</td><td>2.6 ± 0.76<br>0.54</td><td>2.48 ± 0.73<br>0.79</td><td>2.65 ± 0.78<br>0.64</td><td>2.62 ± 1.08<br>0.62</td><td>3.17 ± 1.23<br>0.18</td></tr><tr><td>Ankle</td><td>2.09 ± 0.79<br>0.87</td><td>1.83 ± 0.64<br>0.93</td><td>2.02 ± 0.5<br>0.67</td><td>1.99 ± 0.8<br>0.85</td><td>2.44 ± 0.78<br>0.84</td></tr><tr><td rowspan="2">MTD-GM</td><td rowspan="2">MTL, 5 gated<br>Bi-LSTMs</td><td>Knee</td><td>2.59 ± 0.84<br>0.52</td><td>2.48 ± 0.7<br>0.80</td><td>2.7 ± 0.78<br>0.62</td><td>2.65 ± 1.08<br>0.46</td><td>2.89 ± 1.03<br>0.32</td></tr><tr><td>Ankle</td><td>2.09 ± 0.75<br>0.85</td><td>1.79 ± 0.61<br>0.93</td><td>2.01 ± 0.49<br>0.68</td><td>1.96 ± 0.82<br>0.85</td><td>2.25 ± 0.75<br>0.86</td></tr></tbody></table>

<table><caption>**Table 3.** Performance of both models in predicting post-treatment gait trajectories of the swing phase with respect to different diseases. Bold entries denote the best predictions: lowest average RMSE and maximum R² over all limbs for a given disease.</caption><thead><tr><th>Model</th><th>Model Type</th><th>Body Joint</th><th>Spinal Cord In-<br>jury (SCI)</th><th>Multiple<br>rosis (MS)</th><th>Stroke</th><th>Cerebral Palsy<br>(CP)</th><th>Traumatic<br>Brain<br>Injury<br>(TBI)</th></tr></thead><tbody><tr><td></td><td></td><td></td><td>13</td><td>12</td><td>No. of Patients<br>11</td><td>4</td><td>3</td></tr><tr><td></td><td></td><td></td><td>400</td><td>351</td><td>No. of Cycles<br>260</td><td>138</td><td>74</td></tr><tr><td colspan="8" style="text-align: center;">RMSE Mean (°) ± Standard Error<br>R<sup>2</sup> Score</td></tr><tr><td rowspan="2">MTD-DM</td><td rowspan="2">MTL, 5<br>Bi-LSTMs</td><td>Knee</td><td>6.23 ± 2.05<br>0.31</td><td>7.01 ± 2.2<br>0.59</td><td>7.0 ± 1.73<br>-1.56</td><td>6.72 ± 2.29<br>-3.86</td><td>6.8 ± 1.17<br>0.26</td></tr><tr><td>Ankle</td><td>5.15 ± 2.05<br>-3.35</td><td>5.15 ± 2.2<br>-1.18</td><td>4.36 ± 1.73<br>-5.16</td><td>5.3 ± 2.29<br>-4.36</td><td>3.08 ± 1.17<br>-1.34</td></tr><tr><td rowspan="2">MTD-GM</td><td rowspan="2">MTL, 5 gated<br>Bi-LSTMs</td><td>Knee</td><td>3.52 ± 1.2<br>0.72</td><td>3.89 ± 1.24<br>0.84</td><td>2.85 ± 1.04<br>0.52</td><td>2.88 ± 1.49<br>0.63</td><td>4.86 ± 1.28<br>0.57</td></tr><tr><td>Ankle</td><td>2.62 ± 1.2<br>0.06</td><td>2.29 ± 1.24<br>0.53</td><td>2.63 ± 1.04<br>-1.45</td><td>1.71 ± 1.49<br>0.15</td><td>2.43 ± 1.28<br>-0.25</td></tr></tbody></table>

### 3.3. Visualizing predictions of MTD-GM

Figure 4 represents the average predictions by the MTD-GM model across all cycles of five patients, each suffering from a different disease. The ankle dorsiflexion or knee flexion is shown on the Y-axis, and the patient's gait cycle is shown on the X-axis. Figure 4a,b
represent the average predictions of the CP patient, Figure 4c,d represent the average predictions of the MS patient, Figure 4e,f represent the average predictions of the stoke patient, Figure 4g,h represent the average predictions of the SCI patient, and Figure 4i,j represent the average predictions of the TBI patient. In all these graphs, we observe that each patient's average predicted gait trajectory is very close to the average actual trajectory. Hence, it shows that our model performs well in predicting the post-treatment gait trajectory of patients with disabilities, as reported in Tables 2–4.

<table><caption>**Table 4.** Performance of both models in predicting the post-treatment gait trajectories of a complete cycle with respect to different diseases. Bold entries denote the best predictions: lowest average RMSE and maximum R² over all limbs for a given disease.</caption><thead><tr><th>Model</th><th>Model Type</th><th>Body Joint</th><th>Spinal Cord In-<br>jury (SCI)</th><th>Multiple Scler-<br>osis (MS)</th><th>Stroke</th><th>Cerebral Palsy<br>(CP)</th><th>Traumatic<br>Brain<br>Injury<br>(TBI)</th></tr></thead><tbody><tr><td></td><td></td><td></td><td>13</td><td>12</td><td>No. of Patients<br>11</td><td>4</td><td>3</td></tr><tr><td></td><td></td><td></td><td>400</td><td>351</td><td>No. of Cycles<br>260</td><td>138</td><td>74</td></tr><tr><td colspan="8" style="text-align: center;">RMSE Mean (°) ± Standard Error<br>R<sup>2</sup> Score</td></tr><tr><td rowspan="2">MTD-DM</td><td rowspan="2">MTL, 5<br>Bi-LSTMs</td><td>Knee</td><td>4.18 ± 0.97<br>0.70</td><td>4.58 ± 1.11<br>0.85</td><td>4.58 ± 1.09<br>0.69</td><td>4.82 ± 1.23<br>-0.17</td><td>4.26 ± 0.77<br>0.72</td></tr><tr><td>Ankle</td><td>3.61 ± 0.99<br>0.55</td><td>3.35 ± 0.8<br>0.81</td><td>2.92 ± 0.85<br>0.47</td><td>3.6 ± 1.02<br>0.44</td><td>2.86 ± 0.73<br>0.75</td></tr><tr><td rowspan="2">MTD-GM</td><td rowspan="2">MTL, 5 gated<br>Bi-LSTMs</td><td>Knee</td><td>3.05 ± 0.7<br>0.80</td><td>3.08 ± 0.69<br>0.93</td><td>2.9 ± 0.79<br>0.88</td><td>2.88 ± 0.99<br>0.80</td><td>3.28 ± 0.78<br>0.80</td></tr><tr><td>Ankle</td><td>2.37 ± 0.8<br>0.83</td><td>2.02 ± 0.54<br>0.94</td><td>2.3 ± 0.44<br>0.70</td><td>1.92 ± 0.72<br>0.86</td><td>2.44 ± 0.49<br>0.82</td></tr></tbody></table>

<table><caption>**Table 5.** Performance of both models for both joints in predicting the post-treatment gait trajectories with respect to different diseases. Bold entries denote the best predictions: lowest average RMSE and maximum R² over all limbs for a given disease.</caption><thead><tr><th>Model</th><th>Model Type</th><th>Body Joint</th><th>Spinal Cord In-<br>jury (SCI)</th><th>Multiple Sclero-<br>sis (MS)</th><th>Stroke</th><th>Cerebral Palsy<br>(CP)</th><th>Traumatic Brain<br>Injury (TBI)</th></tr></thead><tbody><tr><td></td><td></td><td></td><td>13</td><td>12</td><td>No. of Patients<br>11</td><td>4</td><td>3</td></tr><tr><td></td><td></td><td></td><td>400</td><td>351</td><td>No. of Cycles<br>260</td><td>138</td><td>74</td></tr><tr><td colspan="8" style="text-align: center;">RMSE Mean (°) ± Standard Error<br>R<sup>2</sup> Score</td></tr><tr><td>MTD-DM</td><td>MTL, 5<br>Bi-LSTMs</td><td>Knee</td><td>4.02 ± 0.76<br>0.87</td><td>4.12 ± 0.79<br>0.91</td><td>3.91 ± 0.79<br>0.89</td><td>4.33 ± 1.02<br>0.77</td><td>3.76 ± 0.61<br>0.86</td></tr><tr><td>MTD-GM</td><td>MTL, 5<br>gated<br>Bi-LSTMs</td><td>Knee<br>and<br>Ankle</td><td>2.78 ± 0.61<br>0.94</td><td>2.65 ± 0.53<br>0.96</td><td>2.65 ± 0.57<br>0.95</td><td>2.48 ± 0.75<br>0.94</td><td>2.97 ± 0.57<br>0.90</td></tr></tbody></table>

However, the CGA kinematics were difficult to predict for a few patients' post-treatment. In Figures 5a–d, we report that the post-treatment cycles for these patients show more variability between cycles than before treatment. This is not the case for most of the other patients. We investigate this phenomenon below.
<figure><img src="image_18.png" /><figcaption>(a) Knee joint of patient with CP.</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>(b) Ankle joint of patient with CP.</figcaption></figure>

<figure><img src="image_20.png" /><figcaption>(c) Knee joint of patient with MS.</figcaption></figure>

<figure><img src="image_21.png" /><figcaption>(d) Ankle joint of patient with MS.</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>(e) Knee joint of patient with Stroke.</figcaption></figure>

<figure><img src="image_23.png" /><figcaption>(f) Ankle joint of patient with Stroke.</figcaption></figure>

<figure><img src="image_24.png" /><figcaption>(g) Knee joint of patient with SCI.</figcaption></figure>

<figure><img src="image_25.png" /><figcaption>(h) Ankle joint of patient with SCI.</figcaption></figure>

<figure><img src="image_26.png" /><figcaption>(i) Knee joint of patient with TBI.</figcaption></figure>

<figure><img src="image_27.png" /><figcaption>(j) Ankle joint of patient with TBI.</figcaption></figure>

<caption>**Figure 4.** Comparison of MTD-GM prediction and post-treatment kinematics for a patient with a given disease.</caption>
Figure 5a shows the trajectories of the right limb of a patient with SCI. The knee kinematics of this patient show more inter-cycle variability than most patients. The MTD-GM model predicted this patient's post-treatment kinematics with an average RMSE of 6.06° and an $R^2$ value of -0.16 for the knee joint. This is worse than the average RMSE of 3.05°. We also notice that the stance phase's prediction error is higher than the swing phase. Figure 5b shows the trajectories of a TBI patient with an issue in his left limb. The post-treatment gait kinematics of the knee joint of this patient were more intra-variant. The prediction for this patient was also not good, with an RMSE of 6.03° and an $R^2$ = 0.41 for the knee joint. Figure 5c shows the trajectories of a patient with CP. Both the pre- and post-treatment gait kinematics of this patient showed high variance between cycles. The prediction of this patient shows an average RMSE of 3.02° and an $R^2$ score of 0.27 for the knee joint. It is difficult for our DL models to predict the post-treatment gait trajectories, which show significant variance. Figure 5d shows the trajectories of a stroke patient with an issue in his lower limbs. His kinematics were also more inter- and intra-variant, with a prediction of an average RMSE of 2.98° and $R^2$ = -0.04 for the knee joint.

<figure><img src="image_28.png" /><figcaption>Figure 5. Outliers.</figcaption></figure>

## 4. Comparison between Cycle-Based Prediction, Phased-Based Prediction, and Related Works

It is difficult to compare our results to other research, because this is the first time that the entire knee and ankle kinematic signals in the sagittal plane have been predicted for BTX-A treatment, except for in ref. [23]. In this study, we worked on the kinematic prediction per phase (stance and swing) of each gait cycle, while in [23], the complete cycles were considered. The results of the total cycles of this study and the previous study are compared in Table 6. It is important to note that five additional patients are considered in this work; thus, the dataset is similar but nonidentical. For MS and TBI diseases, we recruited the same patients in both studies, but the difference in the prediction performance is evident. We can see that the $R^2$ scores for stroke, TBI, and CP were negative in [23]. For our new approach, there was an improvement, achieving more than 0.7 in the $R^2$ score. Furthermore, we compare our results with those described by [4] for forecasts of peak knee and ankle flexion in the sagittal plane for rectus femoris BTX-A injection in stroke patients with see [Table 6]. In this case, our proposed method (MTD-GM) for stroke had a higher $R^2$ score for knee flexion and ankle dorsiflexion. However, since the
models were not trained and tested using the same databases, this comparison should be interpreted with care. In addition, we also compare how well our model predicted the post-treatment kinematics for patients with CP. Even though the proposed methods were not tested on the same databases, their results were better than the postoperative predictions for CP made by Galarraga et al. [34], Niiler et al. [35], and Niiler [36], as shown in Table 6. MTD-GM predicted knee flexion and ankle dorsiflexion with an average RMSE of 2.9° and 1.92°, respectively.

<table><caption>**Table 6.** Performance comparison to related works. Bold entries denote the best predictions: lowest average RMSE and maximum R² over all limbs for a given disease. * Only peak flexion and not over the whole time series.</caption><thead><tr><th rowspan="2">Model</th><th rowspan="2">Model Type</th><th rowspan="2">Body Joint</th><th colspan="5">RMSE Mean (°) ± Standard Error<br>R<sup>2</sup> Score</th></tr><tr><th>Spinal Cord In-<br>jury (SCI)</th><th>Multiple Sclero-<br>sis (MS)</th><th>Stroke</th><th>Cerebral Palsy<br>(CP)</th><th>Traumatic<br>Brain<br>Injury<br>(TBI)</th></tr></thead><tbody><tr><td rowspan="2">Model 1 [23]</td><td rowspan="2">MTL, 5<br>Bi-LSTMs</td><td>Knee</td><td>7.51 ± 1.67<br>0.63</td><td>7.23 ± 1.69<br>0.63</td><td>7.14 ± 1.08<br>0.01</td><td>6.75 ± 1.73<br>0.7</td><td>5.81 ± 1.33<br>0.54</td></tr><tr><td>Ankle</td><td>5.01 ± 0.99<br>0.38</td><td>4.38 ± 1.15<br>0.55</td><td>6.85 ± 1.61<br>-3.58</td><td>6.4 ± 1.19<br>-0.01</td><td>4.68 ± 0.82<br>0.4</td></tr><tr><td rowspan="2">Model 2 [23]</td><td rowspan="2">MTL, 5<br>gated<br>Bi-LSTMs</td><td>Knee</td><td>7.62 ± 1.89<br>0.53</td><td>7.23 ± 2.01<br>0.48</td><td>8.02 ± 1.09<br>0.21</td><td>7.00 ± 2.42<br>0.68</td><td>5.60 ± 1.4<br>0.65</td></tr><tr><td>Ankle</td><td>4.56 ± 1.05<br>0.27</td><td>5.39 ± 1.37<br>0.28</td><td>7.14 ± 1.44<br>-3.65</td><td>3.77 ± 1.41<br>-0.16</td><td>4.93 ± 1.0<br>-0.5</td></tr><tr><td rowspan="2">MTD-DM</td><td rowspan="2">MTL, 5<br>Bi-LSTMs</td><td>Knee</td><td>4.18 ± 0.97<br>0.70</td><td>4.58 ± 1.11<br>0.85</td><td>4.58 ± 1.09<br>0.69</td><td>4.82 ± 1.23<br>-0.17</td><td>4.26 ± 0.77<br>0.72</td></tr><tr><td>Ankle</td><td>3.61 ± 0.99<br>0.55</td><td>3.35 ± 0.8<br>0.81</td><td>2.92 ± 0.85<br>0.47</td><td>3.6 ± 1.02<br>0.44</td><td>2.86 ± 0.73<br>0.75</td></tr><tr><td rowspan="2">MTD-GM</td><td rowspan="2">MTL, 5<br>gated<br>Bi-LSTMs</td><td>Knee</td><td>3.05 ± 0.7<br>0.80</td><td>3.08 ± 0.69<br>0.93</td><td>2.9 ± 0.79<br>0.88</td><td>2.88 ± 0.99<br>0.80</td><td>3.28 ± 0.78<br>0.80</td></tr><tr><td>Ankle</td><td>2.37 ± 0.8<br>0.83</td><td>2.02 ± 0.54<br>0.94</td><td>2.3 ± 0.44<br>0.70</td><td>1.92 ± 0.72<br>0.86</td><td>2.44 ± 0.49<br>0.82</td></tr><tr><td rowspan="2">LigReg Stroke *<br>[4] (R<sup>2</sup> Score)</td><td rowspan="2">Linear<br>Regression</td><td>Knee</td><td>-</td><td>-</td><td>0.24</td><td>-</td><td>-</td></tr><tr><td>Ankle</td><td>-</td><td>-</td><td>0.43</td><td>-</td><td>-</td></tr><tr><td rowspan="2">MLinReg CP [34]<br>(RMSE(°))</td><td rowspan="2">Multiple<br>Linear<br>Regression</td><td>Knee</td><td>-</td><td>-</td><td>-</td><td>9.0</td><td>-</td></tr><tr><td>Ankle</td><td>-</td><td>-</td><td>-</td><td>7.5</td><td>-</td></tr><tr><td rowspan="2">NN99 CP [35]<br>(RMSE(°))</td><td rowspan="2">NN</td><td>Knee</td><td>-</td><td>-</td><td>-</td><td>9.7</td><td>-</td></tr><tr><td>Ankle</td><td>-</td><td>-</td><td>-</td><td>6.7</td><td>-</td></tr><tr><td rowspan="2">NN01 CP [36]<br>(RMSE(°))</td><td rowspan="2">NN</td><td>Knee</td><td>-</td><td>-</td><td>-</td><td>9.2</td><td>-</td></tr><tr><td>Ankle</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></tbody></table>

## 5. Discussion and Conclusions

In this study, we used two DL models using Bi-LSTM modules to predict the effects of BTX-A injections on gait kinematics. As far as we know, except for our previous work [23], no other study in the literature has used DL to look at this specific prediction task. The prediction task we assess in this work is more challenging than predicting normal gait due to the high variability between and within subjects in pathological gait.

DL architectures allow information about medical treatments to be added to the model. Instead of performing a simple pre-to-post regression task, previous results show that adding information about the treatment (i.e., which muscles were treated using BTX-A) improves performance [23].

In this work, we predict knee and ankle kinematics in the sagittal plane, but we perform this prediction per gait phase separately and only by exploiting the best DL
architectures proposed in [23]. These best architectures are based on Bi-LSTM sub-models. The best DL model incorporates the presence or absence of treatments based on a gating mechanism (MTD-GM model). This model predicts post-treatment gait kinematics with a lower RMSE and higher $R^2$ score than the MTD-DM model and for all the considered pathologies. MTD-DM introduces treatments by initializing the hidden units of each Bi-LSTM sub-model. Instead, we randomly initialize hidden units in MTD-GM and apply the gating mechanism on the outputs of the Bi-LSTM sub-models, each devoted to a unique muscle treatment.

In our previous work [23], this model (gated model) was not the best in all situations. This improvement is due to the approach proposed in this work: splitting the learning process of each DL architecture between the stance and swing phases. This proposal allows the model to cope with the high variance present in pre-treatment and post-treatment gait between individuals and within each individual. We notice the effectiveness of our approach by exploiting the advantages of DL architectures on each gait phase separately. We note that the gated model has a relative improvement of around 55% on both joints. We have thus proven the increased capability of the global model (after combining the predictions of both phases) in accurately predicting the complete gait cycles after treatment.

If we examine the results per phase, for the stance phase, both models' performances (MTD-DM and MTD-GM) are equivalent. For the swing phase, the difference between both models is essential. The gated model (MTD-GM) is much better: it often divides the RMSE by a factor of 2. The $R^2$ score is generally good for the knee (higher than 0.7) but close to 0 for the ankle. Moreover, no proposed model adequately explained the variance of the swing phase of the ankle joint (note that MTD-DM performed badly, as shown by negative $R^2$ scores).

We conclude that using treatment data to initialize hidden variables in each Bi-LSTM sub-model is not enough to cope with the high variance encountered in the data, especially in the swing phase. Indeed, for this phase, we remark that a more drastic treatment supervisor for the outputs of the Bi-LSTM sub-models is required. In this work, we do not address the segmentation between phases of gait cycles; instead, we focus on the prediction quality of our models by exploiting the segmentation of the pre-treatment gait cycles on the post-treatment gait cycles. In future work, we will study the impact of considering treatment dosage information. We expect to refine our predictions of post-treatment kinematics by including this information in our DL architecture.

**Author Contributions:** Conceptualization, A.K., O.G., S.G.-S. and V.V.; methodology, A.K.; software, A.K.; validation, A.K.; formal analysis, A.K., O.G., S.G.-S. and V.V.; investigation, A.K., O.G., S.G.-S. and V.V.; resources, O.G., S.G.-S. and V.V.; data curation, A.K. and O.G.; writing—original draft preparation, A.K.; writing—review and editing, A.K., O.G., S.G.-S. and V.V.; visualization, A.K.; supervision, S.G.-S. and V.V.; project administration, S.G.-S. and V.V.; funding acquisition, O.G. and V.V. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was part of a Ph.D. project funded by HEC Pakistan.

**Institutional Review Board Statement:** This retrospective study was approved by the local research ethics committee.

**Informed Consent Statement:** Since this is a retrospective study, no informed consent was needed. The patients were informed about the research and did not oppose to the utilization of their data.

**Data Availability Statement:** Due to the nature of this research, the participants of this study did not agree for their data to be shared publicly, so the supporting data are not available.

**Acknowledgments:** The authors would like to thank HEC Pakistan for funding part of this research. We thank the staff of the Movement Analysis Laboratory of UGECAM Coubert, who acquired all the data used in this work. We would also like to acknowledge the anonymous reviewers for their valuable observations and suggestions.

**Conflicts of Interest:** The authors declare no conflicts of interest.
## Abbreviations

The following abbreviations are used in this manuscript:

<table><tr><td>AI</td><td>Artificial intelligence</td></tr><tr><td>ML</td><td>Machine learning</td></tr><tr><td>DL</td><td>Deep learning</td></tr><tr><td>MTL</td><td>Multi-task learning</td></tr><tr><td>CP</td><td>Cerebral palsy</td></tr><tr><td>CGA</td><td>Clinical gait analysis</td></tr><tr><td>LSTM</td><td>Long short-term memory</td></tr><tr><td>CNN</td><td>Convolutional neural network</td></tr><tr><td>MAE</td><td>Mean absolute error</td></tr><tr><td>RMSE</td><td>Root mean squared error</td></tr><tr><td>SE</td><td>Standard error</td></tr><tr><td>BTX-A</td><td>Botulinum toxin type A</td></tr><tr><td>TBI</td><td>Traumatic brain injury</td></tr><tr><td>SCI</td><td>Spinal cord injury</td></tr><tr><td>MS</td><td>Multiple sclerosis</td></tr><tr><td>CMA</td><td>Clinical movement analysis</td></tr><tr><td>DNN</td><td>Deep neural network</td></tr><tr><td>RNN</td><td>Recurrent neural network</td></tr><tr><td>IMU</td><td>Inertial measurement unit</td></tr><tr><td>HPA</td><td>High-pass algorithm</td></tr><tr><td>Bi-LSTM</td><td>Bi-directional LSTM</td></tr><tr><td>MTD</td><td>Medical treatment data</td></tr></table>

## Appendix A

The detailed results of all the patients using the MTD-GM model are listed in the following figure.

<table><caption>Figure A1. Detailed results of all patients using the MTD-GM model.</caption><thead><tr><th rowspan="2">Patient No.</th><th rowspan="2">Disease</th><th rowspan="2">No. of cycles</th><th rowspan="2">Stance knee phase</th><th rowspan="2">Stance ankle phase</th><th rowspan="2">Swing knee phase</th><th rowspan="2">Swing ankle phase</th><th rowspan="2">Knee phase</th><th rowspan="2">Ankle phase</th><th rowspan="2">Both joints</th></tr><tr><th colspan="2">RMSE Mean (%) ± Standard Error<br>(R<sup>2</sup>)</th></tr></thead><tbody><tr><td>1</td><td>CP</td><td>32</td><td>3.02±1.4 (-0.88)</td><td>1.96±0.61 (0.85)</td><td>2.71±1.00 (-0.8)</td><td>1.42±0.39 (0.7)</td><td>3.02±0.99 (0.27)</td><td>1.83±0.43 (0.85)</td><td>2.54±0.63 (0.9)</td></tr><tr><td>2</td><td>CP</td><td>30</td><td>2.18±0.68 (0.91)</td><td>2.02±0.49 (0.9)</td><td>4.71±1.87 (0.86)</td><td>1.72±0.45 (0.69)</td><td>3.34±0.96 (0.95)</td><td>1.95±0.36 (0.88)</td><td>2.76±0.6 (0.96)</td></tr><tr><td>3</td><td>CP</td><td>36</td><td>2.36±0.67 (0.92)</td><td>1.92±0.69 (0.88)</td><td>2.3±0.53 (0.87)</td><td>1.93±0.71 (0.53)</td><td>2.4±0.5 (0.96)</td><td>1.98±0.55 (0.89)</td><td>2.22±0.43 (0.97)</td></tr><tr><td>4</td><td>CP</td><td>40</td><td>3.04±1.23 (0.88)</td><td>1.94±0.67 (0.78)</td><td>1.83±0.43 (0.87)</td><td>1.76±0.63 (-1.3)</td><td>2.82±0.98 (0.96)</td><td>1.93±0.53 (0.82)</td><td>2.43±0.74 (0.96)</td></tr><tr><td>5</td><td>MS</td><td>24</td><td>3.28±0.49 (0.76)</td><td>2.33±0.67 (0.92)</td><td>4.13±1.53 (0.8)</td><td>4.27±2.67 (-1)</td><td>3.61±0.69 (0.83)</td><td>3.21±1.25 (0.81)</td><td>3.49±0.71 (0.93)</td></tr><tr><td>6</td><td>MS</td><td>30</td><td>1.57±0.44 (0.5)</td><td>2.26±0.65 (0.85)</td><td>3.62±1.48 (0.81)</td><td>2.7±0.45 (0.38)</td><td>2.57±0.83 (0.92)</td><td>2.52±0.44 (0.95)</td><td>2.59±0.46 (0.97)</td></tr><tr><td>7</td><td>MS</td><td>16</td><td>1.95±0.57 (0.91)</td><td>1.99±0.27 (0.95)</td><td>5.38±2.42 (0.23)</td><td>3.59±1.48 (0.85)</td><td>3.67±1.33 (0.92)</td><td>2.74±0.75 (0.94)</td><td>3.33±0.77 (0.97)</td></tr><tr><td>8</td><td>MS</td><td>12</td><td>2.02±0.66 (0.97)</td><td>2±0.64 (0.92)</td><td>3.29±0.74 (0.96)</td><td>2.01±0.72 (0.94)</td><td>2.55±0.47 (0.98)</td><td>2.18±0.56 (0.95)</td><td>2.4±0.42 (0.98)</td></tr><tr><td>9</td><td>MS</td><td>16</td><td>1.98±0.6 (0.95)</td><td>1.46±0.74 (0.96)</td><td>4.52±2.45 (0.92)</td><td>1.67±0.25 (0.9)</td><td>2.99±1.12 (0.96)</td><td>1.59±0.55 (0.97)</td><td>2.44±0.75 (0.97)</td></tr><tr><td>10</td><td>MS</td><td>25</td><td>3.68±1.38 (0.88)</td><td>2±0.7 (0.94)</td><td>7.12±1.9 (0.77)</td><td>3.25±1.39 (0.32)</td><td>4.23±1.24 (0.89)</td><td>2.2±0.67 (0.94)</td><td>3.39±0.93 (0.92)</td></tr><tr><td>11</td><td>MS</td><td>24</td><td>4.01±2.03 (0.4)</td><td>2.01±0.59 (0.95)</td><td>5.13±2.05 (0.8)</td><td>2.05±0.34 (0.42)</td><td>4.54±1.63 (0.84)</td><td>2.08±0.36 (0.96)</td><td>3.56±1.07 (0.93)</td></tr><tr><td>12</td><td>MS</td><td>40</td><td>1.98±0.62 (0.92)</td><td>1.56±0.42 (0.93)</td><td>3.53±1.16 (0.96)</td><td>1.62±0.47 (0.41)</td><td>2.66±0.66 (0.97)</td><td>1.61±0.33 (0.9)</td><td>2.21±0.48 (0.97)</td></tr><tr><td>13</td><td>MS</td><td>72</td><td>1.59±0.49 (0.92)</td><td>1.34±0.44 (0.93)</td><td>2.05±1.17 (0.95)</td><td>1.93±0.97 (0.65)</td><td>1.83±0.6 (0.97)</td><td>1.61±0.46 (0.95)</td><td>1.75±0.43 (0.97)</td></tr><tr><td>14</td><td>MS</td><td>60</td><td>2.3±0.77 (0.86)</td><td>1.57±0.48 (0.93)</td><td>2.78±1.22 (0.97)</td><td>1.73±0.39 (0.9)</td><td>2.52±0.75 (0.96)</td><td>1.67±0.37 (0.95)</td><td>2.16±0.53 (0.97)</td></tr><tr><td>15</td><td>MS</td><td>32</td><td>2.59±0.96 (0.71)</td><td>1.34±0.4 (0.97)</td><td>2.47±0.87 (0.96)</td><td>1.32±0.31 (0.79)</td><td>2.63±0.66 (0.94)</td><td>1.36±0.27 (0.97)</td><td>2.11±0.43 (0.97)</td></tr><tr><td>16</td><td>MS</td><td>36</td><td>2.79±1.17 (0.76)</td><td>1.65±0.32 (0.96)</td><td>2.69±0.89 (0.98)</td><td>1.36±0.31 (0.84)</td><td>2.86±0.79 (0.96)</td><td>1.57±0.25 (0.95)</td><td>2.31±0.55 (0.97)</td></tr><tr><td>17</td><td>SCT</td><td>25</td><td>6.58±0.81(-3.33)</td><td>5.13±0.78 (0.22)</td><td>4.58±1.53 (0.02)</td><td>2.81±1.32 (-1.17)</td><td>6.06±0.62 (-0.16)</td><td>4.59±0.67 (0.53)</td><td>5.38±0.59 (0.76)</td></tr><tr><td>18</td><td>SCT</td><td>25</td><td>2.58±0.67 (0.76)</td><td>2.63±1.06 (0.89)</td><td>3.9±1.79 (0.11)</td><td>5.54±2.43 (0.17)</td><td>3.02±0.84 (0.78)</td><td>3.7±1.16 (0.87)</td><td>3.42±0.84 (0.91)</td></tr><tr><td>19</td><td>SCT</td><td>60</td><td>2.68±0.91 (0.78)</td><td>2.38±0.78 (0.92)</td><td>2.73±0.95 (0.77)</td><td>2.41±1.28 (-0.21)</td><td>2.73±0.74 (0.83)</td><td>2.47±0.69 (0.91)</td><td>2.65±0.52 (0.96)</td></tr><tr><td>20</td><td>SCT</td><td>30</td><td>2.25±0.9 (0.84)</td><td>1.76±0.64 (0.88)</td><td>4.3±1.35 (0.69)</td><td>3.78±1.88 (-0.65)</td><td>2.66±0.75 (0.91)</td><td>2.19±0.73 (0.83)</td><td>2.48±0.6 (0.93)</td></tr><tr><td>21</td><td>SCT</td><td>40</td><td>3.12±1.29 (0.83)</td><td>2.17±0.79 (0.86)</td><td>3.37±1.52 (0.85)</td><td>1.98±1.03 (0.45)</td><td>3.31±1.03 (0.91)</td><td>2.19±0.72 (0.83)</td><td>2.85±0.76 (0.93)</td></tr><tr><td>22</td><td>SCT</td><td>60</td><td>2.87±0.9 (0.69)</td><td>2±0.69 (0.89)</td><td>3.91±1.48 (0.96)</td><td>2.33±0.71 (0.78)</td><td>3.34±0.85 (0.96)</td><td>2.15±0.56 (0.88)</td><td>2.83±0.64 (0.96)</td></tr><tr><td>23</td><td>SCT</td><td>30</td><td>2.16±0.7 (0.89)</td><td>1.93±0.83 (0.9)</td><td>3.62±1.16 (0.85)</td><td>2.67±1.05 (0.46)</td><td>2.75±0.65 (0.94)</td><td>2.28±0.68 (0.88)</td><td>2.56±0.54 (0.95)</td></tr><tr><td>24</td><td>SCT</td><td>16</td><td>2.66±0.79 (0.92)</td><td>2.42±0.57 (0.8)</td><td>4.64±1.38 (0.74)</td><td>4.21±2.48 (-2.51)</td><td>3.72±0.8 (0.95)</td><td>3.37±1.34 (0.8)</td><td>3.64±0.75 (0.96)</td></tr><tr><td>25</td><td>SCT</td><td>48</td><td>2.03±0.54 (0.78)</td><td>1.25±0.49 (0.93)</td><td>3.17±1.41 (0.69)</td><td>1.42±0.58 (0.67)</td><td>2.4±0.77 (0.9)</td><td>1.33±0.45 (0.91)</td><td>1.96±0.57 (0.95)</td></tr><tr><td>26</td><td>SCT</td><td>20</td><td>1.63±0.56 (0.92)</td><td>1.37±0.32 (0.93)</td><td>2.07±0.59 (0.98)</td><td>1.93±0.71 (0.77)</td><td>1.86±0.39 (0.98)</td><td>1.63±0.36 (0.89)</td><td>1.76±0.31 (0.98)</td></tr><tr><td>27</td><td>SCT</td><td>16</td><td>1.74±0.48 (0.87)</td><td>1.39±0.38 (0.88)</td><td>2.85±0.63 (0.92)</td><td>1.99±0.7 (0.5)</td><td>2.18±0.38 (0.95)</td><td>2.19±0.29 (0.91)</td><td>1.93±0.28 (0.94)</td></tr><tr><td>28</td><td>SCT</td><td>24</td><td>1.57±0.43 (0.94)</td><td>1.51±0.45 (0.95)</td><td>1.92±0.71 (0.99)</td><td>1.52±0.5 (0.92)</td><td>1.74±0.38 (0.99)</td><td>1.55±0.38 (0.95)</td><td>1.67±0.29 (0.99)</td></tr><tr><td>29</td><td>SCT</td><td>16</td><td>1.8±0.62 (0.91)</td><td>1.19±0.21 (0.97)</td><td>4.61±1.93 (0.8)</td><td>1.46±0.45 (0.64)</td><td>2.58±0.82 (0.95)</td><td>1.29±0.18 (0.96)</td><td>2.05±0.54 (0.97)</td></tr><tr><td>30</td><td>Stroke</td><td>25</td><td>1.46±0.51 (0.96)</td><td>1.62±0.67 (0.94)</td><td>2.66±0.3 (0.86)</td><td>1.95±0.92 (-0.62)</td><td>1.92±0.27 (0.97)</td><td>1.8±0.54 (0.95)</td><td>1.89±0.28 (0.97)</td></tr><tr><td>31</td><td>Stroke</td><td>12</td><td>3.22±1.29 (0.87)</td><td>1.81±0.74 (0.9)</td><td>2.96±1.19 (0.84)</td><td>1.84±0.69 (-1.27)</td><td>3.27±0.96 (0.91)</td><td>1.94±0.43 (0.94)</td><td>2.7±0.71 (0.94)</td></tr><tr><td>32</td><td>Stroke</td><td>12</td><td>2.82±0.83 (0.75)</td><td>1.66±0.35 (0.97)</td><td>3.27±0.59 (0.95)</td><td>3.15±1.05 (-3.74)</td><td>3.01±0.58 (0.91)</td><td>2.25±0.45 (0.98)</td><td>2.67±0.45 (0.98)</td></tr><tr><td>33</td><td>Stroke</td><td>16</td><td>2.82±0.68 (0.78)</td><td>2.05±1.06 (0.95)</td><td>4.83±1.67 (0.88)</td><td>3.85±1.24 (0.89)</td><td>3.53±0.77 (0.9)</td><td>2.81±0.75 (0.96)</td><td>3.22±0.64 (0.97)</td></tr><tr><td>34</td><td>Stroke</td><td>20</td><td>1.58±0.48 (0.82)</td><td>2.43±0.24 (0.84)</td><td>1.48±0.51 (0.86)</td><td>2.7±0.79 (-1.33)</td><td>1.59±0.42 (0.94)</td><td>2.55±0.28 (0.87)</td><td>2.13±0.28 (0.98)</td></tr><tr><td>35</td><td>Stroke</td><td>30</td><td>3.43±0.93 (0.08)</td><td>1.86±0.67 (0.54)</td><td>2.53±1.41 (-2.02)</td><td>2.92±1.7 (-2.44)</td><td>3.25±0.9 (0.05)</td><td>2.39±0.79 (0.4)</td><td>2.9±0.67 (0.89)</td></tr><tr><td>36</td><td>Stroke</td><td>15</td><td>3.15±0.89 (0.31)</td><td>2.9±2.17 (-0.54)</td><td>3.02±0.55 (0.91)</td><td>2.64±0.77 (-1.95)</td><td>3.18±0.73 (0.82)</td><td>2.98±1.89 (-0.04)</td><td>3.18±1.2 (0.98)</td></tr><tr><td>37</td><td>Stroke</td><td>20</td><td>2.5±0.8 (0.66)</td><td>1.46±0.43 (0.43)</td><td>2.44±0.5 (0.28)</td><td>1.62±0.55 (-0.41)</td><td>2.52±0.6 (0.87)</td><td>1.54±0.37 (0.4)</td><td>2.09±0.47 (0.93)</td></tr><tr><td>38</td><td>Stroke</td><td>60</td><td>2.85±1.28 (0.24)</td><td>1.83±0.94 (0.77)</td><td>2.68±0.68 (0.59)</td><td>3.03±0.82 (-0.62)</td><td>2.86±0.92 (0.79)</td><td>2.36±0.72 (0.69)</td><td>2.65±0.75 (0.86)</td></tr><tr><td>39</td><td>Stroke</td><td>30</td><td>2.49±1.19 (0.49)</td><td>1.93±0.72 (0.73)</td><td>2.51±0.59 (0.57)</td><td>2.45±1.72 (-1.6)</td><td>2.56±0.92 (0.77)</td><td>2.18±0.82 (0.63)</td><td>2.42±0.76 (0.89)</td></tr><tr><td>40</td><td>Stroke</td><td>20</td><td>3.42±0.84 (0.85)</td><td>2.6±0.9 (0.91)</td><td>2.9±1.28 (0.97)</td><td>2.8±1.05 (-1.1)</td><td>3.37±0.65 (0.95)</td><td>2.8±0.61 (0.95)</td><td>3.14±0.53 (0.96)</td></tr><tr><td>41</td><td>TBI</td><td>25</td><td>4.02±1.65(-0.08)</td><td>2.9±1.11 (0.82)</td><td>8.59±1.77 (0.2)</td><td>3.81±0.98 (-0.93)</td><td>6.03±1.06 (0.41)</td><td>3.31±0.88 (0.73)</td><td>4.89±0.81 (0.7)</td></tr><tr><td>42</td><td>TBI</td><td>24</td><td>2.28±0.57 (0.9)</td><td>1.36±0.49 (0.89)</td><td>3.46±1 (0.92)</td><td>1.7±0.63 (0.36)</td><td>2.8±0.41 (0.94)</td><td>1.53±0.43 (0.82)</td><td>2.27±0.31 (0.95)</td></tr><tr><td>43</td><td>TBI</td><td>25</td><td>2.38±0.8 (0.13)</td><td>2.5±1 (0.87)</td><td>2.52±1.24 (0.59)</td><td>1.77±0.73 (0.54)</td><td>2.49±0.86 (0.9)</td><td>2.34±0.78 (0.89)</td><td>2.43±0.78 (0.96)</td></tr><tr><td colspan="2">Mean Results</td><td></td><td>2.61±0.85 (0.60)</td><td>1.98±0.65 (0.83)</td><td>3.84±1.19 (0.68)</td><td>2.43±0.94 (-0.20)</td><td>2.99±0.77 (0.85)</td><td>2.21±0.60 (0.84)</td><td>2.68±0.6 (0.94)</td></tr><tr><td colspan="2">Mean Results (MTD-DM)</td><td></td><td>2.62±0.83 (0.62)</td><td>2.01±0.68 (0.83)</td><td>6.73±2 (-0.48)</td><td>4.82±1.64 (-3.16)</td><td>4.45±1.07 (0.66)</td><td>3.31±0.87 (0.61)</td><td>4.03±0.79 (0.64)</td></tr></tbody></table>
## References

1. McLoughlin, J.; Barr, C.; Crotty, M.; Lord, S.; Sturnieks, D. Association of postural sway with disability status and cerebellar dysfunction in people with multiple sclerosis: A preliminary study. *Int. J. MS Care* **2015**, *17*, 146–151. [CrossRef]

2. Blumhardt, L. *Multiple Sclerosis Dictionary*; Taylor & Francis: Abingdon, UK, 2004.

3. Sun, L.C.; Chen, R.; Fu, C.; Chen, Y.; Wu, Q.; Chen, R.; Lin, X.; Luo, S. Efficacy and Safety of Botulinum Toxin Type A for Limb Spasticity after Stroke: A Meta-Analysis of Randomized Controlled Trials. *BioMed Res. Int.* **2019**, *2019*, 8329306. [CrossRef] [PubMed]

4. Roche, N.; Boudarham, J.; Hardy, A.; Bonnyaud, C.; Bensmail, D. Use of gait parameters to predict the effectiveness of botulinum toxin injection in the spastic rectus femoris muscle of stroke patients with stiff knee gait. *Eur. J. Phys. Rehabil. Med.* **2015**, *51*, 361–370.

5. Notice Patient—DYSPORT 500 UNITES SPEYWOOD, Poudre Pour Solution Injectable—Base de DonnéEs Publique des Médicaments. Available online: https://base-donnees-publique.medicaments.gouv.fr/affichageDoc.php?specid=60242321&typedoc=N (accessed on 15 June 2022).

6. Baker, R.W. *Measuring Walking: A Handbook of Clinical Gait Analysis*, 1st ed.; MacKeith Press: London, UK, 2013.

7. McGinley, J.L.; Baker, R.; Wolfe, R.; Morris, M.E. The reliability of three-dimensional kinematic gait measurements: A systematic review. *Gait Posture* **2009**, *29*, 360–369. [CrossRef]

8. Lerner, Z.F.; Damiano, D.L.; Bulea, T.C. A lower-extremity exoskeleton improves knee extension in children with crouch gait from cerebral palsy. *Sci. Transl. Med.* **2017**, *9*, eaam9145. [CrossRef] [PubMed]

9. Di Russo, F.; Berchicci, M.; Perri, R.L.; Ripani, F.R.; Ripani, M. A passive exoskeleton can push your life up: Application on multiple sclerosis patients. *PLoS ONE* **2013**, *8*, e77348. [CrossRef] [PubMed]

10. Goodfellow, I.; Bengio, Y.; Courville, A. *Deep Learning*; MIT Press: Cambridge, MA, USA, 2016.

11. Topol, E.J. High-performance medicine: The convergence of human and artificial intelligence. *Nat. Med.* **2019**, *25*, 44–56. [CrossRef] [PubMed]

12. Karakish, M.; Fouz, M.A.; ELsawaf, A. Gait trajectory prediction on an embedded microcontroller using deep learning. *Sensors* **2022**, *22*, 8441. [CrossRef] [PubMed]

13. Ding, G.; Plummer, A.; Georgilas, I. Deep learning with an attention mechanism for continuous biomechanical motion estimation across varied activities. *Front. Bioeng. Biotechnol.* **2022**, *10*, 1021505. [CrossRef] [PubMed]

14. Morbidoni, C.; Cucchiarelli, A.; Fioretti, S.; Di Nardo, F. A deep learning approach to EMG-based classification of gait phases during level ground walking. *Electronics* **2019**, *8*, 894. [CrossRef]

15. Bauman, V.V.; Brandon, S.C. Gait phase detection in walking and stairs using machine learning. *J. Biomech. Eng.* **2022**, *144*, 121007. [CrossRef]

16. Lempereur, M.; Rousseau, F.; Rémy-Néris, O.; Pons, C.; Houx, L.; Quellec, G.; Brochard, S. A new deep learning-based method for the detection of gait events in children with gait disorders: Proof-of-concept and concurrent validity. *J. Biomech.* **2020**, *98*, 109490. [CrossRef] [PubMed]

17. Tunca, C.; Salur, G.; Ersoy, C. Deep learning for fall risk assessment with inertial sensors: Utilizing domain knowledge in spatio-temporal gait parameters. *IEEE J. Biomed. Health Inform.* **2019**, *24*, 1994–2005. [CrossRef] [PubMed]

18. Sadeghzadehyazdi, N.; Batabyal, T.; Acton, S.T. Modeling spatiotemporal patterns of gait anomaly with a CNN-LSTM deep neural network. *Expert Syst. Appl.* **2021**, *185*, 115582. [CrossRef]

19. Chen, I.; Yeh, P.Y.; Chang, T.C.; Hsieh, Y.C.; Chin, C.L. Sarcopenia Recognition System Combined with Electromyography and Gait Obtained by the Multiple Sensor Module and Deep Learning Algorithm. *Sensors Mater.* **2022**, *34*, 2403–2425. [CrossRef]

20. Su, B.; Gutierrez-Farewik, E.M. Gait trajectory and gait phase prediction based on an LSTM network. *Sensors* **2020**, *20*, 7127. [CrossRef] [PubMed]

21. Zhang, Y.; Yang, Q. A survey on multi-task learning. *IEEE Trans. Knowl. Data Eng.* **2021**, *34*, 5586–5609. [CrossRef]

22. Kolaghassi, R.; Al-Hares, M.K.; Marcelli, G.; Sirlantzis, K. Performance of Deep Learning Models in Forecasting Gait Trajectories of Children with Neurological Disorders. *Sensors* **2022**, *22*, 2969. [CrossRef] [PubMed]

23. Khan, A.; Hazart, A.; Galarraga, O.; Garcia-Salicetti, S.; Vigneron, V. Treatment Outcome Prediction Using Multi-Task Learning: Application to Botulinum Toxin in Gait Rehabilitation. *Sensors* **2022**, *22*, 8452. [CrossRef] [PubMed]

24. Klejman, S.; Andrysek, J.; Dupuis, A.; Wright, V. Test-Retest Reliability of Discrete Gait Parameters in Children With Cerebral Palsy. *Arch. Phys. Med. Rehabil.* **2010**, *91*, 781–787. [CrossRef]

25. Galarraga, O.; Le Saux, A.; Hareb, F. O 083-A new method for computing gait deviation scores in hemiparesis. *Gait Posture* **2018**, *65*, 170–171. [CrossRef]

26. Wu, X.; Yuan, Y.; Zhang, X.; Wang, C.; Xu, T.; Tao, D. Gait phase classification for a lower limb exoskeleton system based on a graph convolutional network model. *IEEE Trans. Ind. Electron.* **2021**, *69*, 4999–5008. [CrossRef]

27. Desailly, E.; Daniel, Y.; Sardain, P.; Lacouture, P. Foot contact event detection using kinematic data in cerebral palsy children and normal adults gait. *Gait Posture* **2009**, *29*, 76–80. [CrossRef]

28. Schwartz, M.H.; Rozumalski, A. The Gait Deviation Index: A new comprehensive index of gait pathology. *Gait Posture* **2008**, *28*, 351–357. [CrossRef] [PubMed]

29. Hochreiter, S.; Schmidhuber, J. Long short-term memory. *Neural Comput.* **1997**, *9*, 1735–1780. [CrossRef] [PubMed]
30. Kinga, D.; Adam, J.B. A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), San Diego, CA, USA, 7–9 May 2015; Volume 5, p. 6.

31. Bishop, C.M. *Pattern Recognition And Machine Learning*, 2nd ed.; Springer: New York, NY, USA, 2006.

32. Altman, D.G.; Bland, J.M. Standard deviations and standard errors. *BMJ* **2005**, *331*, 903. [CrossRef]

33. Hastie, T.; Tibshirani, R.; Friedman, J. An Introduction to Statistical Learning. 2009. Available online: https://www.stat.berkeley.edu/users/rabbee/s154/ISLR.First_Printing.pdf (accessed on 13 August 2024).

34. Galarraga, C.O.A.; Vigneron, V.; Dorizzi, B.; Khouri, N.; Desailly, E. Predicting postoperative gait in cerebral palsy. *Gait Posture* **2017**, *52*, 45–51. [CrossRef]

35. Niiler, T.A.; Richards, J.G.; Miller, F.; Sun, J.Q.; Castagno, P. Reliability of predictions of post-operative gait in rectus transfer patients using FFT neural networks. *Gait Posture* **1999**, *9*.

36. Niiler, T.A. Efficacy of Predictions of Post-Operative Gait in Rectus Transfer Patients Using Neural Networks. Ph.D. Thesis, University of Delaware, Newark, DE, USA, 2001.

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.