The purpose of this study was to verify classification performance and the difference analysis between gender using optimal warping paths of dynamic time warping (DTW) and to examine the usefulness of root mean square error (RMSE) represented by the perpendicular distance from the optimal warping path to the diagonal. A 3-dimensional motion analysis experiment was performed with 24 healthy adults (male=12, female=12) in their 20s of age without gait-related diseases or injuries for the past 6 months to collect gait data. This study performed a DTW 132 times in total (male=62, female=62) for the flexion angle of the right leg’s hip, knee, and ankle joints. Then, the global cost and the RMSE of the optimal warping paths were calculated and normalized. The difference analysis was performed by independent

Gait is one of the main subjects in various fields, such as rehabilitation, sports medicine, and special physical education, for health management and quality of life improvement. Nevertheless, the gait study makes it difficult to analyze the similarity of gait patterns, such as determining normal gait or classifying gait patterns, because gait patterns vary not only among individuals but also within individuals.

So, researchers proposed the dynamic time warping (DTW) algorithm to solve the difficulty of analysis (

Generally, the normalization of the optimal warping path in DTW uses a method that divides the global cost of optimal warping paths by the sum of the lengths of elements of two sequences. This method makes it possible to compare optimal warping paths for the same variables. However, mutual comparison between variables with different scales or range of motion (ROM) is impossible. For compensate the limitation of classic normalization, this study used a normalization method that uses perpendicular distance (root mean square error [RMSE]) from indices of the optimal warping path to the diagonal line accepted as an ideal path instead of the global cost. Since the RMSE presented in this study indicates the degree to which the optimal warping path is away from the diagonal, it has the advantage of comparing variables measured with different scales and ROM. Therefore, this study will verify differences in gait patterns between genders, gender classification performance, and the usefulness of the RMSE.

Three-dimensional (3D) motion analysis experiment was performed with 24 healthy adults (male=12, female=12) in their 20s of age without gait-related diseases or injuries for the past six months to collect gait data. All subjects participated in the experiment voluntarily and signed the consent form after being informed of the contents and purpose of the experiment (IRB approval No: KUIRB-2021-0250-02, Korea University, Seoul, Korea). A 3D motion capture system made by MotionAnalysis Corp. (Rohnert Park, CA, USA) was used with ten infrared charge-coupled devise cameras operated by 120 frames/sec sampling frequency. Participants attached 41 reflective markers to their bodies and walked the 10-m walking path prepared in the laboratory with their self-selected normal walking. Results of

DTW program was developed by R-language for calculating the RMSE represented a perpendicular distance from an index of the warping path to the diagonal line accepted as an ideal path and for calculating the statistical variables such as mean and standard deviation In order to test whether DTW was operating normally, DTW was performed with 100 and 75 data extracted at equal intervals from the sine cycle and confirmed by comparing the results of the DTW program with the results manually calculated. In addition, the execution result of

This study calculated the flexion angle of the right leg’s hip, knee, and ankle joints, representing a gait pattern well in the gait cycle. Then, the global cost and RMSE of the optimal warping paths were calculated and normalized after performing DTW, respectively, for males and females to these variables. Therefore, DTW was performed 132 times in total (male=62, female=62). The normalization method of the optimal warping path was used as a general method of dividing the global local cost by the sum of two sequence sizes and a method divided by the diagonal length of the cost matrix. In addition, the mean of RMSE was calculated. A reason divided by the diagonal of the cost matrix is that even if the sum of two sequence lengths is equal, the diagonal length of the cost matrix can be different when the length of each sequence is different. These normalization methods were applied to the global cost and the RMSE. These normalization methods were applied to not only the local cost but also the RMSE. The independent

Results of

Results of

In this study, we demonstrated that the normalized global cost and normalized RMSE of the optimal warping path of DTW can be used for difference analysis and classification analysis in inter-gender gait analysis. Because the global cost is affected by the data values of two sequences, the normalization of classic DTW used in previous studies cannot compare among the optimal warping paths determined by the different scales and ROM. Therefore, even if the flexion angles of the joints are targeted, it is difficult to compare optimal warping paths when the flexion ranges of the joints are significantly different. On the other hand, since RMSE proposed in this study represents the perpendicular distance from the diagonal that is accepted as an ideal path, a comparison of the optimal warping path is possible not related to the data scale measured and ROM.

Results analyzed using global cost and RMSE for hip, knee, and ankle joints showed a statistically significant difference between genders in global cost and RMSE for hip and knee joints but not for ankle joints using RMSE. The reason for this phenomenon is considered to be influenced by the fact that women showed a larger ROM of the ankle joint than men (

This study verified the gender classification performance of DTW using SVM, neural network, and logistic regression among supervised classification models of ML (

This work was supported by the Ministry of Education of the Republic of Korea and the National Research Foundation of Korea (NRF-2021S1A5A8063345).

No potential conflict of interest relevant to this article was reported.

Compare the optimal warping path of dynamic time warping between this study and

Mean values according to normalization methods between gender. RMSE, root mean square error; div. N, divide by sum of two sequence’s length; div. diagonal, divide by diagonal length of cost matrix.

95% Confidence interval of mean according to normalization methods for joints. RMSE, root mean square error; div. N, divide by sum of two sequence’s length; div. diagonal length: divide by diagonal length of cost matrix.

Anthropometric data for participants

Variable | Gender | |
---|---|---|

Male (n=12) | Female (n=12) | |

Age (yr) | 24.67±2.29 | 21.80±1.83 |

Height (cm) | 176.12±6.59 | 163.59±5.12 |

Weight (kg) | 76.37±12.75 | 54.09±4.32 |

Values are presented as mean±standard deviation.

Results of

Variable | Gender | Number | Mean±SD | 95% CI | ES | |||
---|---|---|---|---|---|---|---|---|

Hip cost div. N | Female | 66 | 187.08±181.43 | 142.48–231.69 | 3.93 | 130 | <0.001 | 0.685 |

Male | 66 | 90.79±81.29 | 70.80–110.77 | |||||

| ||||||||

Hip cost div. diagonal | Female | 66 | 264.28±256.12 | 201.32–327.24 | 3.94 | 130 | <0.001 | 0.686 |

Male | 66 | 128.22±114.84 | 99.99–156.45 | |||||

| ||||||||

Hip RMSE div. N | Female | 66 | 3.44±2.10 | 2.93–3.96 | 3.90 | 130 | <0.001 | 0.680 |

Male | 66 | 2.27±1.24 | 1.97–2.58 | |||||

| ||||||||

Hip RMSE div. diagonal | Female | 66 | 4.87±2.96 | 4.14–5.59 | 3.91 | 130 | <0.001 | 0.681 |

Male | 66 | 3.21±1.76 | 2.78–3.64 | |||||

| ||||||||

Hip mean of RMSE | Female | 66 | 5.11±2.74 | 4.44–5.78 | 3.87 | 130 | <0.001 | 0.674 |

Male | 66 | 3.55±1.78 | 3.12–3.99 | |||||

| ||||||||

Knee cost div. N | Female | 66 | 168.19±128.61 | 136.58–199.81 | 3.27 | 130 | 0.001 | 0.568 |

Male | 66 | 109.82±67.43 | 93.24–126.40 | |||||

| ||||||||

Knee cost div. diagonal | Female | 66 | 237.66±181.74 | 192.98–282.34 | 3.27 | 130 | 0.001 | 0.569 |

Male | 66 | 155.10±95.22 | 131.69–178.51 | |||||

| ||||||||

Knee RMSE div. N | Female | 66 | 4.64±4.34 | 3.57–5.70 | 4.02 | 130 | <0.001 | 0.699 |

Male | 66 | 2.25±2.14 | 1.72–2.77 | |||||

| ||||||||

Knee RMSE div. diagonal | Female | 66 | 6.55±6.13 | 5.05–8.06 | 4.02 | 130 | <0.001 | 0.700 |

Male | 66 | 3.17±3.02 | 2.43–3.91 | |||||

| ||||||||

Knee mean of RMSE | Female | 66 | 6.28±5.36 | 4.96–7.60 | 3.98 | 130 | <0.001 | 0.692 |

Male | 66 | 3.34±2.71 | 2.67–4.00 | |||||

| ||||||||

Ankle cost div. N | Female | 66 | 115.96±71.00 | 98.51–133.41 | 2.69 | 130 | 0.008 | 0.468 |

Male | 66 | 88.16±44.98 | 77.1–99.22 | |||||

| ||||||||

Ankle cost div. diagonal | Female | 66 | 163.86±100.37 | 139.19–188.53 | 2.69 | 130 | 0.008 | 0.468 |

Male | 66 | 124.52±63.55 | 108.9–140.14 | |||||

| ||||||||

Ankle RMSE div. N | Female | 66 | 3.03±1.23 | 2.73–3.34 | −1.22 | 130 | 0.226 | −0.212 |

Male | 66 | 3.32±1.49 | 2.95–3.69 | |||||

| ||||||||

Ankle RMSE div. diagonal | Female | 66 | 4.28±1.74 | 3.85–4.71 | −1.21 | 130 | 0.228 | −0.211 |

Male | 66 | 4.69±2.11 | 4.17–5.21 | |||||

| ||||||||

Ankle mean of RMSE | Female | 66 | 4.48±1.69 | 4.07–4.90 | −1.09 | 130 | 0.278 | −0.189 |

Male | 66 | 4.82±1.91 | 4.35–5.29 |

RMSE, root mean square error; SD, standard deviation; CI, confidence interval;

Classification evaluation metrics according to machine learning models

Cost values | Model | AUC | CA | F1-score | Precision | Recall |
---|---|---|---|---|---|---|

Cost of warping path (distance) | SVM | 0.737 | 0.624 | 0.679 | 0.617 | 0.755 |

Neural network | 0.809 | 0.720 | 0.740 | 0.725 | 0.755 | |

Logistic regression | 0.807 | 0.710 | 0.752 | 0.683 | 0.837 | |

| ||||||

RMSE | SVM | 0.788 | 0.656 | 0.714 | 0.635 | 0.816 |

Neural network | 0.771 | 0.720 | 0.764 | 0.689 | 0.857 | |

Logistic regression | 0.792 | 0.710 | 0.761 | 0.672 | 0.878 |

AUC, area under the receiver operating characteristic curve; CA, classification accuracy; SVM, support vector machine; RNSE, root mean square error.