1. Introduction
Understanding lower limb biomechanics is essential for accurately modeling and estimating joint angles, which is critical for optimizing human performance and improving prosthetic design [
1]. Accurate knowledge of lower limb kinematics is particularly important for analyzing ankle motions such as dorsiflexion, the forward rotation of the tibia relative to the foot, and plantarflexion, its opposite backward movement that contributes to propulsion during walking [
2]. When these motions are altered, such as after transtibial amputation, the natural coordination between the shank and foot is disrupted, compromising gait efficiency and stability [
3,
4]. Therefore, precise modeling of these dynamics is fundamental for simulation-based reference generation and for future control strategies aimed at restoring more natural ankle behavior in prosthetic devices [
5,
6].
Lower-limb prostheses are essential for people with transtibial amputation because they support mobility, independence, and participation in daily life, while also helping to reduce the functional burden associated with limb loss [
7,
8]. The sustained growth of prosthetic-foot research further reflects the clinical and technological relevance of improving prosthetic function [
9].
Transtibial amputation disrupts normal movement patterns, most notably the ability to perform controlled dorsiflexion during forward body progression, which relies on a coordinated shank–foot interaction [
4,
5]. This motion supports impact absorption, stability, and forward progression [
10]. Individuals with below-knee amputation lose or shorten key musculotendinous structures, such as the tibialis anterior and gastrocnemius, reducing ankle torque generation and fine motor control [
6,
11]. They frequently adopt compensatory strategies that increase energy expenditure and joint stress, which may affect walking stability [
7,
8].
To mitigate these effects, contemporary prosthetic designs aim to reproduce natural ankle mechanics [
12,
13]. Modern devices can be categorized as passive, semi-active, or active. Passive systems provide structural support but lack adaptability [
14]; semi-active designs incorporate damping mechanisms for improved comfort yet remain unpowered [
15,
16]; active prostheses, by contrast, use actuators and sensor-based controllers to mimic muscle function, enabling real-time adjustment to terrain and user intent [
17,
18].
Recent innovations in active prostheses have integrated artificial intelligence to enhance control systems [
19,
20,
21]. These systems employ predictive models that anticipate user movements and adjust prosthetic behavior in real time [
22]. Such innovations are particularly promising for controlling dorsiflexion, which is critical for stability and proper transition toward propulsion [
23]. AI-based control strategies, including deep learning, have demonstrated potential to improve prosthetic performance by predicting gait phases and adjusting joint angles accordingly [
24].
However, despite these advances, most AI-driven prosthesis control systems rely on multiple sensors, complex training data, or hardware validation alone, limiting accessibility and reproducibility [
4]. Moreover, many studies have focused on generic gait classification rather than direct estimation of clinically meaningful joint angles, such as dorsiflexion, which are fundamental for simulation-based assessment of prosthetic ankle behavior and for future adaptive control strategies [
25]. Before clinical translation, lightweight, low-sensor AI pipelines capable of accurately estimating ankle motion in controlled simulation environments are still required.
Furthermore, the use of computer-aided design software for mechanical modeling and simulation environments for dynamic testing provides a powerful and controlled platform for developing and refining prosthetic designs and control algorithms [
26]. These virtual tools facilitate experimentation with different AI models and their interactions with physical systems while mitigating risks associated with live trials [
27]. Simulation platforms integrate with Robot Operating System 2, enabling modular communication with virtual actuators and providing a suitable environment for simulating complex human-like movements [
28]. This integration supports reproducible coupling of biomechanics, sensing, and controller interfaces, justifying its use for the present simulation-based evaluation [
29].
The objective of this study was to determine the level of accuracy with which ankle dorsiflexion can be recovered from a single shank-mounted IMU without using a foot-mounted sensor. This estimation problem was formulated as an interpretable two-stage waveform-mapping pipeline: first, shank pitch was recovered from local inertial signals; second, an ankle-dorsiflexion reference was generated from the shank-pitch waveform. This formulation was motivated by the biomechanical distinction between shank pitch, an absolute segment orientation, and ankle dorsiflexion, a relative distal joint angle. Temporal models were trained and evaluated under a strict subject-held-out protocol and compared with compact feature-based, instantaneous polynomial, direct single-stage, and recurrent baselines. It was hypothesized that, if shank kinematics preserve sufficient information about distal ankle motion, a temporal waveform model would recover ankle dorsiflexion with lower error than instantaneous or compact mappings and would better preserve the phase-dependent structure of the gait cycle. The pipeline was evaluated on a multi-subject subset of the NONAN GaitPrint database and was subsequently executed in a ROS2–Gazebo transtibial prosthesis simulation as a software integration test.
2. Materials and Methods
2.1. Input Data and Data Acquisition
The data used in this study were obtained from the NONAN GaitPrint database [
30], an open-access IMU gait dataset that includes recordings from 35 healthy young adults who were able to walk independently without an assistive device and reported no neurological disease, lower-limb disability, or injury (18 men and 17 women; mean ± 1 s.d. age: 24.6 ± 2.7 years; height: 1.73 ± 0.078 m; body mass: 72.44 ± 15.04 kg). Each participant completed approximately 18 overground walking trials of about 4 min each on a 200 m indoor looping track at a self-selected walking speed (
) while wearing Noraxon Ultium Motion™ inertial measurement units (IMUs; Noraxon U.S.A., Inc., Scottsdale, AZ, USA) IMUs attached to multiple body segments. Each trial was recorded at a sampling frequency of 200 Hz.
For this study, we used the complete set of 35 participants, totaling 598 trials and approximately 122,468 gait cycles. Among the multiple IMUs recorded, we selected the shank-mounted sensor located on the anterior and slightly medial aspect of the tibia (
Figure 1), as it captures the segmental dynamics most relevant for the proposed estimation pipeline.
One gait cycle was defined as the interval between two consecutive right heel strikes. Each trial was segmented into complete, non-overlapping gait cycles, and each cycle was temporally normalized to 100 samples representing 0–100% of the gait cycle.
To prevent intra-subject temporal dependencies from influencing model performance, data partitioning was performed at the participant level. Thus, all gait cycles from a given participant were assigned exclusively to one subset: training, validation, or testing.
The input features for the machine learning models consisted of raw three-axis linear accelerations and angular velocities measured solely by the shank-mounted IMU. The predictive models were trained to estimate shank pitch, expressed in degrees and referenced to the horizontal plane following the conventions of the source database. In the proposed two-stage pipeline, ankle dorsiflexion was estimated by transforming the shank pitch waveform into an ankle-dorsiflexion waveform using a second-stage temporal mapping model. Direct IMU-to-ankle models were used as ablation baselines. The supervised target of this stage was the native ankle dorsiflexion of the ipsilateral (right) limb, as provided by the Noraxon reference system and expressed in physical degrees. In this study, dorsiflexion was defined as the sagittal-plane angle between the shank and the foot.
2.2. Implementation of the AI Techniques and Database
Training and evaluation were conducted on a workstation equipped with an AMD Ryzen 7 5700G (4.6 GHz) processor with integrated graphics, 32 GB RAM, and Ubuntu 22.04 operating system. The training codes were written in Python 3.10.12, using the PyTorch 2.1.2 and scikit-learn 1.7.2 libraries. All input features were normalized using Equation (
1), where the mean value was subtracted, and the result was divided by the standard deviation, transforming the data to have a mean of 0 and a standard deviation of 1. This normalization facilitates training convergence. For all learning models, normalization parameters were fitted using the training set only and then applied to the validation and test sets.
The mean and standard deviation of each input component are presented in
Table 1, which supports replicability if new data are used for testing.
A correlation matrix was computed to examine the relationships between the six IMU input signals and the primary kinematic quantities used in this study, particularly shank pitch and the variables involved in the dorsiflexion mapping stage.
Detailed architecture, training, and subject-held-out split information for the primary run are provided in
Supplementary Materials S1.
2.3. Deep Neural Network (DNN)
The deep learning model used to estimate shank pitch from the inertial data was a one-dimensional convolutional neural network operating on temporally normalized gait cycles. Each input sample consisted of a sequence of 100 time points with six channels corresponding to the three-axis linear accelerations and angular velocities measured at the shank. The output of the model was the corresponding shank pitch waveform over the same gait cycle.
The network architecture included an initial convolutional stem followed by residual temporal convolutional blocks and a regression head. This design allowed the model to capture both local temporal patterns and global waveform structure. Training was performed using the Adam optimizer with an initial learning rate of 0.001 and a combined loss function defined as 0.7 mean squared error (MSE) and 0.3 mean absolute error (MAE) [
31,
32]. Early stopping was applied based on validation loss to prevent overfitting.
To ensure generalization, the dataset was split using a strict subject-held-out protocol, with 70% of participants used for training, 15% for validation, and 15% for testing [
33,
34]. This prevented data leakage across subjects and provided a realistic evaluation of model performance on unseen individuals (see
Figure 2).
2.4. Random Forest
A Random Forest (RF) regression model was implemented as a feature-based baseline. Instead of operating on the full temporal waveform, each gait cycle was summarized into statistical descriptors derived from the six IMU channels, including mean, standard deviation, minimum, maximum, and range. These features were used as inputs to the RF model.
The RF was trained under the same subject-held-out protocol used for the DNN. Hyperparameters, including tree depth and number of estimators, were selected empirically to balance performance and model simplicity. The RF results were used to assess whether compact cycle-level representations were sufficient for the estimation task, in comparison with the waveform-based deep learning approach. Because the RF operated on cycle-level descriptors, its target was the cycle-level mean shank pitch. In contrast, the DNN was trained to estimate the complete shank-pitch waveform.
2.5. Prosthesis Modeled in Gazebo
A simplified shank-foot prosthesis model was created using an open-source design [
35]. It consisted of two parts, the shank and foot connected by a revolute joint acting as the ankle (
Figure 3). A support fixture was included to represent the knee joint.
Previous studies have successfully used ROS2–Gazebo simulators to illustrate prosthetic joint actuation [
18,
19]. In this study, the simulation was used to evaluate the execution of the generated ankle-dorsiflexion reference as a software integration test, within a controlled environment; foot–ground contact and stance-phase ground reaction forces are excluded, and the prosthesis operates in a suspended configuration (
Figure 3).
The ankle joint is actuated by the joint_trajectory_controller in open-loop position control mode. The controller follows the estimated reference with position tracking only; no impedance modulation or interaction dynamics are modeled. The input reference corresponds to the dorsiflexion waveform obtained from the two-stage pipeline.
The mass, inertia tensor, and center of mass of each component were specified in the Gazebo simulation (
Table 2).
When the controller was active, the reference frames of the system were visualized within Gazebo (
Figure 4). The yellow arrows represent the axes of rotation of the ankle and knee joints.
Quantitative metrics were incorporated to characterize the temporal performance of the ROS2–Gazebo environment. Simulator stability was assessed using the world statistics topic world_stats. The communication latency between Gazebo and ROS2 was measured using ros2 topic delay on /joint_states. Because timestamps were based on simulated time, these measurements primarily reflect clock and scheduling characteristics of the simulation rather than closed-loop control delays.
The publication frequency of /joint_states and the ankle controller tracking error, computed as the difference between the commanded and simulated joint positions, was also recorded.
Beyond these metrics, ROS2–Gazebo was selected for reproducible, simulation-based integration. ROS2 provides DDS-based communication, multithreading, and real-time executors for distributed control architectures [
29]. Gazebo offers a mature physics engine with configurable joints, virtual sensors, and simplified biomechanical modeling. Together, they enable modular and reproducible integration of biomechanics, control, and sensing, supporting simulation-based reference-generation pipelines [
28,
29].
2.6. Temporal Mapping for Dorsiflexion Estimation
The estimation of ankle dorsiflexion was implemented as a second-stage temporal mapping problem. Rather than using an instantaneous analytical relationship, the full shank pitch waveform was used as input to a second neural network that estimated the corresponding ankle dorsiflexion waveform.
This mapping was implemented using a one-dimensional convolutional neural network operating on temporally normalized gait cycles of 100 points. The model captured temporal dependencies within the gait cycle, allowing it to account for phase-dependent and hysteresis effects that cannot be represented by pointwise mappings. Training followed the same subject-held-out protocol as the first-stage model.
This stage was designed to learn a supervised waveform-to-waveform transformation from reference shank pitch to ankle dorsiflexion, preserving the temporal structure of the gait cycle.
To support the ablation analysis, three families of models were evaluated. First, the proposed CNN temporal mapping was compared with a BiLSTM alternative trained using the same reference shank-pitch input and ankle-dorsiflexion target. Second, direct single-stage models were trained to estimate ankle dorsiflexion directly from the six shank IMU channels, without using shank pitch as an intermediate representation. Third, full two-stage cascade configurations were evaluated by propagating the shank pitch estimated by the first-stage CNN into either the CNN or BiLSTM temporal mapping model. All configurations produced full ankle-dorsiflexion waveforms and were evaluated under the same subject-held-out protocol.
To characterize robustness to data partitioning, the temporal mapping, direct single-stage, and cascade configurations were repeated across three random seeds. Performance was summarized on the test set as the mean and standard deviation across seeds.
2.7. Model Evaluation and Statistical Analysis
Model performance was evaluated using RMSE, MAE, , and Pearson correlation. Agreement between measured and estimated waveforms was further examined using Bland–Altman analysis, with bias defined as the mean prediction error and 95% limits of agreement computed as the bias standard deviations of the error. Unless otherwise stated, waveform metrics were computed over the normalized gait-cycle samples of the test set. Proportional bias was assessed by regressing the prediction error on the mean of the measured and estimated values; the error standard deviation was additionally summarized across the measurement range.
For the ankle-dorsiflexion estimate, errors were also summarized by gait sub-phase using five predefined intervals of the normalized gait cycle: early stance/loading response (0–10%), mid-stance (10–30%), terminal stance (30–50%), pre-swing (50–60%), and swing (60–100%). Within each interval, RMSE, MAE, and bias were computed from the corresponding waveform samples. Landmark accuracy was assessed for the terminal-stance dorsiflexion peak and the maximum plantarflexion value. The dorsiflexion peak was identified within a physiologic terminal-stance window (30–55% of the normalized gait cycle), and the maximum plantarflexion was located using circular distance to respect the cyclic continuity of the gait cycle. For each landmark, magnitude error was defined as the absolute angular difference between the measured and predicted landmark values. Timing error was defined as the absolute difference between the measured and predicted landmark locations, expressed as a percentage of the normalized gait cycle.
Model uncertainty and paired comparisons were assessed at the subject level. For the primary test split (seed = 42), bootstrap confidence intervals were obtained by resampling held-out subjects with replacement. For each bootstrap sample, model performance was recomputed after pooling the cycles from the resampled subjects. The bootstrap confidence interval was reported for the primary waveform-level goodness-of-fit metric. Paired model comparisons were performed using per-subject RMSE values. For each comparison, the mean paired difference was reported together with a subject-level bootstrap 95% confidence interval and a Wilcoxon signed-rank test. The selected comparisons were aligned with the main methodological questions of the study: the choice of temporal mapping architecture and the performance of the deployable two-stage configurations relative to direct IMU-to-ankle-dorsiflexion estimation.
4. Discussion
The main finding of this study is that a single shank-mounted IMU can be used to generate an able-bodied ankle-dorsiflexion reference when the problem is formulated as a two-stage temporal estimation pipeline. In the first stage, shank pitch was estimated directly from raw shank accelerations and angular velocities. In the second stage, the estimated shank pitch waveform was transformed into an ankle-dorsiflexion waveform. Across both stages, accuracy depended on preserving the temporal structure of the gait cycle, which compact cycle-level representations could not capture.
For shank pitch estimation, the waveform-based DNN provided a waveform-level estimate of shank pitch, whereas the RF served as a feature-based probe of whether compact cycle-level descriptors were sufficient to summarize shank motion. The DNN yielded strong agreement with the reference waveform, reaching test values close to 0.97. By contrast, the Random Forest predicted a cycle-level summary of shank pitch from compact descriptors and therefore did not constitute a point-by-point waveform comparison with the DNN. Its predictions collapsed to a narrow range and yielded a negative coefficient of determination, indicating that cycle-level descriptors were insufficient to represent the temporal structure required for waveform reconstruction. This suggests that the shank-mounted IMU contains sufficient information to reconstruct the reference shank orientation accurately, but that this information is primarily encoded in the temporal evolution of the inertial signals rather than in compact cycle-level descriptors.
The second-stage mapping provided an additional insight. Global polynomial mappings yielded weak performance, even when augmented with phase-related terms, indicating that the relationship between shank pitch and ankle dorsiflexion cannot be adequately represented as an instantaneous transformation across subjects. In contrast, the temporal mapping DNN achieved test values between approximately 0.77 and 0.85 across different random seeds, together with an overall RMSE of 3. and MAE of 2. on the test set.
This level of agreement is within the range reported for generalized, subject-independent IMU-based joint kinematic estimation, where errors commonly fall between approximately
and
[
22,
36,
37]. The reconstruction RMSE corresponds to approximately 12% of the near
dorsiflexion excursion. Consistent with prior work, generalized models that are not personalized are expected to incur higher errors than subject-specific models [
22]. A distinctive feature of this configuration is that ankle dorsiflexion, a distal joint angle, is inferred from a single proximal segment without a foot-mounted sensor, extending approaches that estimate joint motion from proximal information alone [
38] or from a single IMU across multiple joints [
39].
The architecture comparison clarifies the role of the two-stage formulation. The two-stage pipeline is not proposed as an absolute accuracy improvement over every direct model; rather, it is an interpretable decomposition that allows three questions to be examined separately: how much segment motion can be recovered from a single IMU, how much ankle dorsiflexion can be explained from the temporal evolution of that segment, and how much error propagates through the full cascade. The deployable two-stage pipeline showed no detectable loss in accuracy relative to the direct single-stage model in the present subject-held-out evaluation, while additionally exposing an interpretable and highly recoverable intermediate representation, shank pitch, which a direct model does not provide. This decomposition is relevant because it separates a highly recoverable proximal segment state from the more variable distal joint-angle mapping, thereby making the source of estimation error biomechanically interpretable. The larger error of the fully convolutional cascade is consistent with error propagation from the intermediate estimate and motivates the modular design, in which the temporal mapping can be selected independently of the first stage.
The Bland–Altman analysis revealed a near-zero bias () with 95% limits of agreement of to . However, the error distribution was not uniform across the measurement range, showing increased dispersion for more negative dorsiflexion values. This indicates that, while the model captures the central tendency of the mapping, its accuracy varies across different regions of the gait cycle.
The phase-resolved analysis localizes this non-uniformity. The largest error occurred during pre-swing, the push-off region, where the ankle plantarflexes most rapidly. This phase is driven by plantarflexor power, which is not directly observed by a shank-mounted IMU and varies considerably between individuals. The timing of the push-off landmark was nonetheless recovered accurately, while its magnitude carried a larger error, indicating that the model captures when the event occurs more reliably than how pronounced it is. Because propulsion intensity is highly individual, subject-specific fine-tuning is a plausible route to reduce the push-off error, whereas the more stereotyped early-stance phase was estimated with the smallest error.
As a contextual reference for measurement error, the reconstruction RMSE (3.
) was below the approximately
minimal detectable change reported for gait kinematics in healthy young adults [
40]. However, the 95% limits of agreement (
to
) exceeded this value, with the largest deviations concentrated near push-off. Thus, although the average waveform error falls within the range of between-session reproducibility reported for standard gait analysis [
41], individual waveform deviations can exceed clinically relevant reference values. Whether this tolerance is acceptable for prosthetic use depends on the gait sub-phase, particularly swing-phase foot clearance and push-off behavior, and on amputee-specific tolerances that cannot be established from a healthy-cohort study.
The Gazebo/ROS2 simulation further supports the technical feasibility of integrating the proposed pipeline into a physics-based environment. The generated dorsiflexion reference was executed in a suspended transtibial prosthesis model under open-loop position control, producing smooth and repeatable virtual joint trajectories. Under these unloaded, open-loop conditions, the Gazebo results should be interpreted as evidence of reference transmission and software execution rather than functional performance. The simulation therefore shows that the estimated reference can be executed within a simulation-based integration framework, but it does not establish stability, usefulness, or safety during loaded gait. A single shank-mounted IMU has previously been used for real-time pose estimation of a lower-limb prosthesis [
42], and deep learning has been applied to prosthetic-ankle quantities such as joint torque [
43], situating the present pipeline within this line of work while differing in its target and reference-generation purpose.
These findings are consistent with prior IMU-based lower-limb estimation, which has moved from multi-sensor configurations with explicit kinematic constraints [
44] toward reduced-sensor, data-driven strategies [
45]. The present results extend this direction by establishing that the shank-to-ankle mapping is phase-dependent and is recovered reliably only when the temporal structure of the gait cycle is preserved, which a global analytical transformation does not achieve. The integration of the estimation stages into a simulation-executable pipeline is reported as an engineering demonstration rather than as the central novelty.
This study has several limitations. First, all experiments were performed on a dataset of healthy young adults; the results therefore describe able-bodied ankle dorsiflexion and cannot be generalized to amputee populations, the transtibial residual limb, or pathological gait. The generated trajectory should therefore be understood as an able-bodied reference rather than a subject-specific control signal. Second, the prosthesis evaluation was conducted in simulation only, as a software integration test, and under a suspended configuration without foot-ground contact, stance-phase loading, or actuator dynamics under load; the integration test does not characterize behavior during loaded gait. Third, the within-test uncertainty was estimated from a held-out set of six subjects, which produced wide confidence intervals and limited the resolution of the statistical tests. Fourth, although the average waveform RMSE was within the range of reported measurement-error thresholds for healthy gait analysis, the 95% limits of agreement exceeded this range, indicating that individual waveform deviations may be clinically relevant. The absolute accuracy therefore remains modest relative to clinical requirements, and the largest error concentrates at push-off. Finally, although the subject-held-out protocol strengthens the validity of the results, further evaluation across additional datasets and walking conditions is necessary. Future work should therefore examine the transfer of this framework to amputee populations, incorporate stance-phase contact and loading in simulation, and evaluate real-time performance in hardware implementations, which remains an active challenge in lower-limb prosthetic systems [
46,
47,
48].
The proposed framework should therefore be interpreted as a preliminary, simulation-based pipeline for able-bodied ankle-dorsiflexion reference generation from a single shank-mounted IMU. The results support temporal consistency and waveform-level feasibility, but not clinical readiness or functional prosthetic control.
5. Conclusions
This study evaluated the technical feasibility of generating able-bodied ankle-dorsiflexion references from a single shank-mounted IMU through a two-stage machine learning pipeline. In the first stage, shank pitch was estimated from raw shank accelerations and angular velocities, and in the second stage this waveform was transformed into an ankle-dorsiflexion waveform through a temporal mapping model. Under a strict subject-held-out evaluation on a multi-subject dataset, the waveform-based deep learning approach showed that preserving the temporal structure of the gait cycle was necessary, whereas a compact feature-based baseline was insufficient to represent the waveform-level relationship, supporting the importance of temporal modeling for this task.
The integration of the proposed framework within a ROS2–Gazebo simulation enabled evaluation of the software integration of the estimation-to-reference-generation pipeline. The generated references were transmitted and executed in a suspended virtual transtibial prosthesis model, confirming that the pipeline can be implemented within a physics-based simulation environment without implying functional behavior during loaded gait.
Overall, the results support the potential of low-sensor, data-driven strategies for able-bodied ankle-dorsiflexion reference generation, while also showing that the mapping from shank kinematics to ankle dorsiflexion cannot be adequately represented by a simple global analytical transformation in a multi-subject setting. Instead, temporal modeling is required to capture the underlying segment-to-joint relationship.
Further work is required to evaluate this framework in amputee populations, incorporate stance-phase contact and loading, and assess performance in real-time prosthetic hardware before considering clinical translation. The pipeline should therefore be regarded as a preliminary, simulation-based approach for able-bodied reference generation rather than a clinically ready or functional prosthetic controller.