## 2 Methods and System Setup
### Activity Recognition Method  
Activity recognition is performed in two stages (as shown in Figure 5). In Stage 1, the probabilistic neural network (PNN) is first trained on routine activities to identify potential falls. This stage of the classifier is mainly intended to perform rapid prejudgments of possible falls to enable sufficient time to protect patients; therefore, timeliness is the most important factor. As mentioned above, we selected acceleration \(A_{sum}\) and \(T_{sum}\) to predict falls. PNN is a feed-forward neural network based on the Bayesian criterion and a Parzen window for probability distribution function estimation that also exhibits good pattern recognition accuracy. The most important advantage of PNN is that training it is easy and nearly instantaneous. Other advantages offered by PNN are that the user needs to set only one parameter (the so-called smoothing parameter). This model can achieve reasonable accuracy, even with small numbers of training samples. Moreover, the network is tolerant to erroneous data and operates entirely in parallel without requiring feedback from the individual neurons to the inputs [32]. The PNN consists of nodes allocated in three layers after the inputs:  
Pattern layer: In this layer, one pattern node exists for each training example. Each pattern node forms a product of the weight vector and the given example for classification, where the weights entering a node stem from a particular example. Next, the vector is passed to the summation layer. \[e^{[(x^{T}\omega_{k}-1)/\sigma^{2}]} \tag{7}\]  
Summation layer: This layer weights the output of the hidden neurons belonging to the same class in the hidden layer. \[\sum_{l=1}^{NK}e^{[(x^{T}\omega_{k}-1)/\sigma^{2}]} \tag{8}\]  
Output layer: The output nodes are binary neurons that produce the classification decision:  
\[\sum_{i=1}^{NK}e^{[(x^{T}\omega_{k}-1)/\sigma^{2}]}>\sum_{i=1}^{NK}e^{[(x^{T} \omega_{k})_{i}-1)/\sigma^{2}]} \tag{9}\]  
where \(X\) is the input data, NK is the number of samples, \(k\) is the dimensionality of the training samples, and \(\sigma\) is a smoothing factor, which is the deviation of the Gaussian functions. An appropriate deviation is chosen through experimentation. In Stage 2, the SVM-RBF-KNN classifier is trained to classify specific falls or an abnormal gait in a supervised manner. The goal of this classifier is to provide the rehabilitation physician with a detailed gait status for functional assessment. Supplying a classification that includes as much detail as possible is the most important factor. During the rehabilitation process, activity recognition is critical, because in addition to fall prediction, we need to identify and record gait situations so that therapists fully understand the rehabilitation process and provide essential data for designing reasonable and scientific rehabilitation therapy schedules. Traditional machine learning techniques such as perception, backpropagation (BP) neural network, and one-class support vector machines (OC-SVM) have limitations in modeling human behavior because they lack the reference points of human decision-making [33]. They discriminate a target class from other data by calculating the optimal hyperplane with a bias term such that all training data patterns are classified to the target class [34]. However, for many real-life datasets, such a hyperplane may not exist, and thus, the input space must be mapped to a new feature space with a specific structure (the same as for OC-SVM). Therefore, we proposed a multiple classifier system that combines the SVM, radial basis function (RBF), and KNN classifiers to form an ensemble, which significantly improves fall detection and activity recognition systems. The k-nearest neighbor (KNN) algorithm is a simple and effective technique for object classification based on finding the closest training examples in the feature space [35].