# A Low-Cost Video-Based System for Neurodegenerative Disease Detection by Mobility Test Analysis
## 2 Materials and Methods
### Feature Extraction and Data Augmentation  
In this work, the skeleton model used in the OpenPose procedure was the Body_25 model, which considers 25 joints as shown in Figure 4(a). In our study, the joints relative to the feet, eyes and ears were discarded, as they did not affect the analysis of movements involved in the StS test. Therefore, the total number of considered joints was \(K=15\) as shown in Figure 4(b). Considering the 2D coordinates of the skeleton joints, calculated by OpenPose, significant features could be extracted before training the classifiers. This study estimated two types of geometric features to capture the subjects' posture during the execution of the StS test. Furthermore, the derivatives of the geometric features were also estimated to capture the dynamics of the posture. Due to the difference in body sizes of the subjects and the variations in camera location and orientation, features were first normalized to make them invariant to these variations. Figure 4: Plots of \(x\) and \(y\) coordinate of nose joint (joint 1) before and after applying the tracking procedure, in the case of a sick patient (**a**) and healthy subject (**b**), respectively. Figure 3: Sample frames of the videos acquired in the two different nursing homes. Joint-to-joint distances and angles were considered as geometric features. These were calculated for each frame of the acquired videos. Given \(K\) skeleton joints, let us denote by \(J_{i,j}=(x_{i,j},y_{i,j})\) the coordinates of joint \(j\) in frame \(i\). The distance features, indexed by \(d\), were calculated between all couples of joints as follows:  
\[D_{d,i}=\frac{\|J_{j,i}-J_{j,i}\|_{2}}{D_{Norm,j}}\ \ \forall i,\]  
where \(D_{Norm,j}\) represents the normalization factor, which was defined as the sum of two distances: (1) the distance \(\|J_{3,i}-J_{6,i}\|_{2}\) between the joints of the right and left shoulders and (2) the distance \(\|J_{2,i}-J_{9,i}\|\) between the joints of the neck and mid hip. The total number of distance features in each frame was \((\frac{K}{2})\). Analogously, angle features, indexed by \(a\), were calculated considering triplets of joints. Let \(\textbf{v}=J_{j,i}-J_{j,i}\) and \(\textbf{w}=J_{j^{\prime},i}-J_{j,i}\) be the vectors defined by three different body joints \((J_{j,i},J_{j^{\prime},i},J_{j^{\prime\prime},i})\) in frame \(i\); the angle features were calculated as follows:  
\[A_{a,i}=\arccos\frac{\textbf{v}\cdot\textbf{w}}{\|\textbf{v}\|_{2}\ \ \|\textbf{w}\|_{2}}\ \ \forall i.\]  
In this case, the total number of possible angles in each frame was \(K(\frac{K-1}{2})\). Considering both distance and angle features, their first-order and second-order derivatives were calculated to approximate the velocity and acceleration of the subject's posture during the StS test. These features could be defined as follows:  
\[D^{\prime}_{d,i}=\frac{(d_{d,j+\Delta i}-d_{d,i})}{\Delta i}\ \ \forall i,\]  
\[D^{\prime\prime}_{d,i}=\frac{(D^{\prime}_{d,j+\Delta i}-D^{\prime}_{d,i})}{ \Delta i}\ \ \forall i,\]  
where \(\Delta i\) is the considered interval of frames. Analogously, the velocity \(A^{\prime}_{a,i}\) and acceleration \(A^{\prime\prime}_{a,i}\) of the angle features could be similarly estimated. The length of these feature vectors depended on the number of frames of the acquired videos and could be very dissimilar among the subjects, as they executed the StS test according to their abilities. Indeed, some patients affected by neurodegenerative diseases were unable to stand up. The length of the feature vectors highly affects the dimension of  
Figure 5: (**a**) Skeleton joints extracted by using Body_25 model in OpenPose. (**b**) Skeleton joints used in this study. the training set to be provided to any machine learning approach.