Recognition of Common Non-Normal Walking Actions Based on Relief-F Feature Selection and Relief-Bagging-SVM

Action recognition algorithms are widely used in the fields of medical health and pedestrian dead reckoning (PDR). The classification and recognition of non-normal walking actions and normal walking actions are very important for improving the accuracy of medical health indicators and PDR steps. Existing motion recognition algorithms focus on the recognition of normal walking actions, and the recognition of non-normal walking actions common to daily life is incomplete or inaccurate, resulting in a low overall recognition accuracy. This paper proposes a microelectromechanical system (MEMS) action recognition method based on Relief-F feature selection and relief-bagging-support vector machine (SVM). Feature selection using the Relief-F algorithm reduces the dimensions by 16 and reduces the optimization time by an average of 9.55 s. Experiments show that the improved algorithm for identifying non-normal walking actions has an accuracy of 96.63%; compared with Decision Tree (DT), it increased by 11.63%; compared with k-nearest neighbor (KNN), it increased by 26.62%; and compared with random forest (RF), it increased by 11.63%. The average Area Under Curve (AUC) of the improved algorithm improved by 0.1143 compared to KNN, by 0.0235 compared to DT, and by 0.04 compared to RF.


Introduction
With the development of microelectromechanical system (MEMS) technology and the popularization of smartphones with integrated acceleration sensors, action recognition is receiving increasing attention. It is widely used in medical health, pedestrian dead reckoning (PDR) and other fields [1,2]. In medical health, it is necessary to accurately measure the amount of exercise to provide more important reference indicators for clinical decision-making. In the PDR field, it is necessary to accurately predict the movement trajectory to determine the accurate position. The implementation of the above technical solutions is based on the accurate measurement of pedestrians. The number of steps is used as a basis. The current mainstream method for measuring the amount of exercise is to detect the number of steps taken by the patient, and the accuracy of the step counting is largely determined by motion recognition. The existing motion recognition algorithms have high accuracy for the detection of common normal steps. A combination of Global Positioning System (GPS) and MEMS technology can be used to identify uncommon movements, but weak indoor GPS signals are recognized facts in the technical field and difficult points to be solved. Therefore, existing methods do not have high accuracy in identifying abnormal walking postures, leading to lower accuracy of motion recognition and affecting the overall step counting accuracy. This article will explore the recognition of abnormal walking movements in depth.
There are two types of mainstream international methods of action recognition. The first category is the recognition and classification of actions based on human action video images. Wang, C. et al. [3] proposed a pose recognition method based on a neural network algorithm. This method uses an improved filtering algorithm to reduce the computational complexity of the scale invariant feature transforms (SIFT) operator and effectively reduce the impact on pose differences and image blur on the recognition rate. However, the recognition categories for non-normal walking actions are not comprehensive enough, resulting in a low overall recognition rate. Ince, O. F. et al. [4] proposed a new type of biometric recognition system for checking human activities in 3D space. The joint angle obtained by RGB depth sensors was used as a feature, and the average algorithm was used to reduce the dimension. This method has more advantages than other machine learning algorithms. The algorithm has a high recognition rate for faces for complex human motion recognition, but the recognition category for non-normal walking actions is not comprehensive enough. Ravbar et al. [5] used visual intuition to design an automatic behavior recognition system to identify behaviors in animals. This method can efficiently and accurately recognize the behavior and posture of various animals. The effect of this system on human motion recognition needs to be verified. Ullah et al. [6] proposed a framework of activity recognition using the surveillance video of industrial systems that used a convolutional neural network (CNN) to select shots based on human salient features and proposed multilayer long and short term memory. The results showed that this method is effective for identifying activities in an industrial environment. However, the incompleteness of common non-normal walking actions identified will have a certain impact on the overall recognition accuracy.
The second category is the recognition and classification of actions based on sensor signals. An et al. [7] proposed a 3D pedestrian position estimation algorithm for an inertial measurement unit (IMU) sensor worn on the waist, using a linear regression algorithm to improve the generalization ability of the classification algorithm for going downstairs and going upstairs. The subject of this article focuses on the study of normal walking movements, without considering the effects of abnormal walking actions such as writing and sleeping. Diete et al. [8] proposed an action recognition algorithm combining inertial sensors and interactive sensors. This algorithm recognized different human actions in different scenes by fusing data such as inertia and video. There is also the problem of insufficient analysis of abnormal walking movements. Kabir et al. [9] proposed a state-space-based linear activity recognition method. The model was very flexible in terms of control and used three real datasets to verify the validity of the model. In work by Kelly et al. [10], an action recognition method based on a genetic algorithm for sensor fusion was proposed. Support vector machines can be used to predict 10 different health indicators, and their errors do not exceed the clinical error benchmark. This article did not explore the impact on non-normal walking actions on health indicators. Lee, J.S et al. [11] used experimental heuristics to perform multi position PDR (mpPDR), which identified six poses and four patterns of carrying smartphones. Although the article explored the posture and position of normal walking movements in depth, the influence of non-normal walking actions on the experimental results was also very significant. Ma et al. [12] proposed an adaptive action recognition algorithm based on a time window, which solved the problem that different types of actions have different durations. Tong et al. [13] proposed a method of PDR using MEMS magnetic, angular velocity, and gravity sensors. This method reduced position drift caused by heading error and fault zero speed measurement. However, this method did not eliminate errors caused by non-normal walking actions.
Unfortunately, the current motion recognition algorithm is not comprehensive and has low recognition accuracy for common non-normal walking actions (such as sleep, irregular actions, writing, etc.), but the recognition of non-normal walking actions is of great significance to improve the reliability of medical and health indicators and the accuracy of PDR positioning. In order to fully and accurately identify non-normal walking actions, this paper proposes an MEMS action recognition method based on Relief-F feature selection and relief-bagging-SVM.

Data Acquisition and Preprocessing
This paper uses an independently designed acceleration acquisition platform to obtain acceleration signals under different actions. After preprocessing, feature extraction and selection were performed, and the LG function was used for nonlinear normalization. The improved action recognition algorithm was used for identification and classification. The framework of this paper is shown in Figure 1. This paper uses an independently designed acceleration acquisition platform to obtain acceleration signals under different actions. After preprocessing, feature extraction and selection were performed, and the LG function was used for nonlinear normalization. The improved action recognition algorithm was used for identification and classification. The framework of this paper is shown in Figure 1.

Acceleration signal acquisition
Feature extraction and selection

Acceleration Acquisition Hardware Platform
To obtain the acceleration information about human action accurately in real time, an acceleration signals acquisition device (worn on the wrist) was designed. The hardware design is shown in Figure 2 [14]. Some important parameter settings of the hardware platform are shown in Table 1.

Acceleration Acquisition Hardware Platform
To obtain the acceleration information about human action accurately in real time, an acceleration signals acquisition device (worn on the wrist) was designed. The hardware design is shown in Figure 2 [14]. Some important parameter settings of the hardware platform are shown in Table 1.

Acceleration Synthesis
The randomness of the acceleration sensor carried by the human body causes the three-axis acceleration direction to be inconsistent with the direction of the human action. The noise generated by this factor can be partially eliminated by calculating the synthetic acceleration, as shown in Figure  3. (1)

Acceleration Synthesis
The randomness of the acceleration sensor carried by the human body causes the three-axis acceleration direction to be inconsistent with the direction of the human action. The noise generated by this factor can be partially eliminated by calculating the synthetic acceleration, as shown in Figure 3.
Sensors 2020, 20, x FOR PEER REVIEW 5 of 16 Figure 3. Acceleration signal after acceleration synthesis and filtering.

Four-Point Median Filtering
Median filtering is a low-frequency enhanced spatial domain filtering technique. In this paper, the four-point median filtering principle is used to implement the linear filter [15]. The specific mathematical expression is shown in Equation (2). The processed synthetic acceleration signal is

Four-Point Median Filtering
Median filtering is a low-frequency enhanced spatial domain filtering technique. In this paper, the four-point median filtering principle is used to implement the linear filter [15]. The specific mathematical expression is shown in Equation (2). The processed synthetic acceleration signal is shown in Figure 3.
From the analysis in Figure 3, it can be seen that the acceleration signals of the eight kinds of actions are subjected to acceleration synthesis and four-point median filtering to reduce the number of pseudo waves and glitches, which is more conducive to action recognition and classification.

Feature Extraction and Selection
Human action contains many characteristic parameters. Commonly used types include time-domain features, frequency domain features, wavelet transform features, and frequency domain features. This article uses the mean, standard deviation, variance, average slope, absolute slope, maximum, minimum, kurtosis, skewness, root mean square, interquartile range, correlation coefficient, and maximum in the time domain, fast Fourier transform (FFT) spectrum energy, FFT average power, and FFT median frequency. There are 15 features in total, and the feature vector has 23 dimensions so that the feature information of various actions can be relatively comprehensively extracted. However, these features are directly used for identification and classification. Due to the redundancy between these features and the complexity of the calculation, the final classification effect is not ideal. Therefore, this paper uses the relief algorithm to select features. By selecting features with significant classification weights, it can both improve the classification accuracy and reduce the time complexity of the algorithm. The features extracted in this paper are shown in Table 2. The relief algorithm is a commonly used filtering feature selection algorithm. This algorithm mainly designs a relevant statistic to measure the importance of features. In this paper, the relevant statistic is defined as the feature classification weight, as shown in Equation (3).
Sensors 2020, 20, 1447 6 of 15 The acceleration signals of eight kinds of actions are extracted from this paper, and the support vector machine with eight classifications is used. Therefore, relief is deformed, and Relief-F is used to solve the eight classification problems in this paper [16,17].
Among them, x k i,nh in Equations (3) and (4) is "near-hit" and x k i,nm is "near-miss", x k i represents the value of sample x i on feature k, and di f f x k i , x k i,nh 2 determines the type of feature k. p l is the proportion of type l samples of the dataset.
The feature classification weights map analyzed by relief after feature extraction is shown in Figure 4. After analyzing the observation data onto a large number of experiments, setting the classification weights threshold to 9000 is the best feature selection effect, and continuous fusion of the selected seven-dimensional features is shown in Figure 5 to achieve the best classification effect. The serial number of the seven-dimensional feature is good. The feature names are shown in Table 3.
In this paper, the mainstream feature selection method least absolute shrinkage and selection operator (LASSO) and principal component analysis (PCA) are compared horizontally. The classification effect of (LASSO) is shown in Figure 6. The classification accuracy is shown in Table 4.     In this paper, the mainstream feature selection method least absolute shrinkage and selection operator (LASSO) and principal component analysis (PCA) are compared horizontally. The classification effect of (LASSO) is shown in Figure 6. The classification accuracy is shown in Table 4.  After comprehensive analysis of Table 4, Figures 4-6, the average accuracy of the Relief-F method is 30.83% higher than the LASSO method, far better than LASSO only methods.  After comprehensive analysis of Table 4, Figures 4-6, the average accuracy of the Relief-F method is 30.83% higher than the LASSO method, far better than LASSO only methods.

Design and Optimization of Relief-SVM
SVM is one of the mainstream algorithms for statistical machine learning. SVM has an excellent effect on the classification of small sample data. SVM can map linearly indivisible samples to the hyperplane for classification, and its essence is to solve the smallest problem. The minimum soft interval problem from the support vector to the dividing line is shown in Equation (5). This is a convex quadratic programming problem. In the face of the quadratic programming problem with constraints, this paper uses the Lagrange operator method, which is then transformed into solving the dual problem, as shown in Equation (6) [18][19][20].
in Equation (5) is a loss function. Since the theoretical loss function has noncontinuous and nonconvex mathematical properties that are difficult to solve, a function that is easy to solve is used instead. In Equation (6), C represents a penalty coefficient, which determines the number of support vectors and is one of the key indicators. The complexity of the inner product of x T i x j determines the performance of the SVM to a large extent, so the sample can be mapped to an optimal high-dimensional space by using an appropriate kernel function and gamma value. Therefore, this paper uses the grid optimization method and k-fold cross-validation method to solve the optimal C and gamma, as shown in Figure 7, and the classification kernel to select the most suitable kernel function is shown in Table 5.
It can be seen in Table 5 that the optimal kernel function is a polynomial kernel, and the optimal penalty coefficient C corresponding to the polynomial kernel is 13.9288, and the optimal gamma value is 2.1435.
Sensors 2020, 20, x FOR PEER REVIEW 9 of 16 vectors and is one of the key indicators. The complexity of the inner product of determines the performance of the SVM to a large extent, so the sample can be mapped to an optimal highdimensional space by using an appropriate kernel function and gamma value. Therefore, this paper uses the grid optimization method and k-fold cross-validation method to solve the optimal C and gamma, as shown in Figure 7, and the classification kernel to select the most suitable kernel function is shown in Table 5. It can be seen in Table 5 that the optimal kernel function is a polynomial kernel, and the optimal penalty coefficient C corresponding to the polynomial kernel is 13.9288, and the optimal gamma value is 2.1435. Table 5. Relief-F-SVM kernel function classification accuracy.

Design of Relief-Bagging-SVM
From the analysis in Tables 6 and 7, it can be seen that although Relief-SVM has excellent performance in time performance and classification accuracy, the classification accuracy in man-made step counting is only 40%. The focus and innovation of this article are on the recognition and classification of abnormal walking actions. Ensemble learning performs well in improving the classification performance of weak learners. Therefore, the bagging algorithm in ensemble learning is used to design a relief-bagging-SVM action recognition algorithm, as shown in Figure 8, to accurately identify man-made step counting and other abnormal walking actions.  The key to the performance of relief-bagging-SVM is to generate "good and different" base learners. In this paper, bootstrap sampling is used to generate different datasets. The bootstrap sampling method is for a dataset that includes M samples. According to the principle of nonreplacement extraction, sampling is performed M times to obtain a training set, and according to the analysis of Equation (7), it can be seen that each training set includes only 63.2% of the original data, while the remaining 36.8% of the samples are used as the test set [21].
in Equation (7) is the probability that each sample is taken. The key to the performance of relief-bagging-SVM is to generate "good and different" base learners. In this paper, bootstrap sampling is used to generate different datasets. The bootstrap sampling method is for a dataset that includes M samples. According to the principle of non-replacement extraction, sampling is performed M times to obtain a training set, and according to the analysis of Equation (7), it can be seen that each training set includes only 63.2% of the original data, while the remaining 36.8% of the samples are used as the test set [21].

Performance Evaluation of SVM Learners
1 M in Equation (7) is the probability that each sample is taken.

Performance Evaluation of SVM Learners
This article uses the Receiver Operating Characteristic curve (ROC) and AUC to evaluate the modeling effect of the SVM learner. The samples are sorted according to the score of the predictor's prediction result, the samples are predicted as positive examples in this order, the true positive rate (TPR) is calculated each time as Equation (8), and the false positive (false positive rate, FPR) is shown in Equation (9), where TPR is the vertical axis of the ROC curve and FPR is the horizontal axis of the ROC curve.

Experiments and Results Analysis
The experimental platform of this article uses Matlab2018a. By observing the daily life of a large number of students and faculty members of Xinjiang University and sampling with a questionnaire survey, we found that the top four most frequent occurrences of non-normal walking actions are: standing (defined as people who have no regular or obvious movements, with a few occasional movements; for example, sitting would be considered a standing posture in this article), writing (defined as the state of a person writing with a pen or chalk), sleeping, and man-made (this action exists more in China, especially in some college students; in order to increase the number of steps in various apps, various devices are used to simulate the movement of the human body to create the number of steps. The acceleration trajectory of such devices is a sine or cosine diagram). These four non-normal walking actions account for more than 90% of all non-normal walking actions, so this article focuses on the four types of non-normal walking actions. The first four occurrences of normal walking actions are: walking, upstairs, downstairs, and running. These four occupy 99% of the normal walking actions of the human body. To reduce the effect of age, height, weight, and gender on the robustness of the algorithm, our experiment object consisted of four men and four women, aged between 19-45 years old, weighing between 45-85 kg with a height between 150-190 cm. The experimental data collect acceleration information of eight kinds of actions in Table 8. For each walking action, 5000 synthetic acceleration information is collected, which takes 50 s and is processed by frame. Each sample generates 50 samples, so the experimental acceleration of the dataset has a total of 400 samples (acceleration information for eight different ages, heights, weights and genders under each action,). After the relief feature selection, the features are serially fused, and the dataset becomes a 400 × 7 feature matrix. The experimental data used a bootstrap sampling method to generate a training set and a test set. Cross-validation was used during the experiment. The 10-fold cross-validation method [22,23] uses the libsvm package to implement SVM multiclassification [24]. From the analysis above, we know that the polynomial kernel is used for experiments. The number of basic learners for integrated learning is five, as shown in Tables 6 and 7. The average is taken after 10 category experiments. This paper compares the results with mainstream decision tree (DT), k-nearest neighbor (KNN) and random forest (RF). The classification accuracy is shown in Table 6. The time performance is shown in Table 7. DT, RF and KNN parameter adjustments are shown in Table 9.

Action Classification Accuracy and Time Performance
It can be intuitively seen from Table 6 that the traditional methods for identifying non-normal walking actions are not effective, and the improved algorithm for identifying non-normal walking actions had an accuracy of 96.63%. Compared with DT, it increased by 11.63%; compared with KNN, it increased by 26.62%; and the recognition performance has been greatly improved.
From Tables 6 and 7, the average classification accuracy of the improved relief-bagging-SVM reached 94.37%. Compared with relief-SVM, the average classification accuracy improved by 2.71% while maintaining time performance. The accuracy of step counting reached 100%, which increased by 60%. Compared with SVM, both the time performance and classification accuracy were comprehensively and greatly improved. The average recognition accuracy of the improved algorithm was 9.37% higher than KNN, 1.87% higher than DT and 1.87% higher than RF.

ROC Curve of the SVM Model
In Figure 9, the man-made step counting and standing ROC curves of the SVM are both below the random guess curve. The recognition and classification of these two types are worse than the random guess, and the ROC curves of the other six actions are in the random guess model. Above, the properties of the ROC curve are generally average.
In Figure 10, the man-made step counting ROC curve of relief-SVM is much lower than the random guess curve, and its classification recognition effect is not ideal. However, the ROC curves of the other seven categories have good properties, and the classification effect and generalization ability are very strong.
reached 94.37%. Compared with relief-SVM, the average classification accuracy improved by 2.71% while maintaining time performance. The accuracy of step counting reached 100%, which increased by 60%. Compared with SVM, both the time performance and classification accuracy were comprehensively and greatly improved. The average recognition accuracy of the improved algorithm was 9.37% higher than KNN, 1.87% higher than DT and 1.87% higher than RF.  In Figure 9, the man-made step counting and standing ROC curves of the SVM are both below the random guess curve. The recognition and classification of these two types are worse than the reached 94.37%. Compared with relief-SVM, the average classification accuracy improved by 2.71% while maintaining time performance. The accuracy of step counting reached 100%, which increased by 60%. Compared with SVM, both the time performance and classification accuracy were comprehensively and greatly improved. The average recognition accuracy of the improved algorithm was 9.37% higher than KNN, 1.87% higher than DT and 1.87% higher than RF.  In Figure 9, the man-made step counting and standing ROC curves of the SVM are both below the random guess curve. The recognition and classification of these two types are worse than the In Figure 11, the properties of the ROC curve of the man-made step counting of relief-bagging-SVM have reached the optimal, and except for the properties of the ROC curve of the upstairs and the downstairs, are worse compared with the relief-SVM.

ROC Curve of the SVM Model
From Table 10 combined with the analysis of Figures 9-11, it can be seen that during abnormal walking actions, the AUC of relief-bagging-SVM improved compared to SVM and relief-SVM. The average AUC of relief-bagging-SVM reached 0.9466, a 0.0325 improvement over the relief-SVM, and a 0.2089 improvement over the SVM. Comprehensive analysis showed that the generalized ability and time performance of the improved relief-bagging-SVM model were the best.
From Table 10 and Figure 12, it can be concluded that the average AUC of the improved algorithm improved by 0.1143 compared to KNN, 0.0235 compared to DT and 0.04 compared to RF. random guess curve, and its classification recognition effect is not ideal. However, the ROC curves of the other seven categories have good properties, and the classification effect and generalization ability are very strong.
In Figure 11, the properties of the ROC curve of the man-made step counting of relief-bagging-SVM have reached the optimal, and except for the properties of the ROC curve of the upstairs and the downstairs, are worse compared with the relief-SVM. From Table 10 combined with the analysis of Figures 9-11, it can be seen that during abnormal walking actions, the AUC of relief-bagging-SVM improved compared to SVM and relief-SVM. The average AUC of relief-bagging-SVM reached 0.9466, a 0.0325 improvement over the relief-SVM, and a 0.2089 improvement over the SVM. Comprehensive analysis showed that the generalized ability and time performance of the improved relief-bagging-SVM model were the best. From Table 10 and Figure 12, it can be concluded that the average AUC of the improved algorithm improved by 0.1143 compared to KNN, 0.0235 compared to DT and 0.04 compared to RF.

Leave-One-Person-Out Cross Validation
We also used Leave-One-Person-Out cross validation (LOPOCV) to evaluate the generalization ability of our model, and the basic situation of eight test subjects is shown in Table 8. The test results are shown in Table 11. Table 11. Leave-One-Person-Out cross validation (LOPO-CV) experiment accuracy table.

Leave-One-Person-Out Cross Validation
We also used Leave-One-Person-Out cross validation (LOPOCV) to evaluate the generalization ability of our model, and the basic situation of eight test subjects is shown in Table 8. The test results are shown in Table 11. In Table 8, we have listed in detail the personal information of the eight people who participated in the experiment.
We used seven people's data for training each time, leaving one person's data for testing. The test results are shown in Table 8. The average accuracy of the eight people was 94.25%, and the variance was 0.62%. The standard deviation was 0.79%.

Conclusions
This paper explores common non-normal walking actions recognition problems and solves the problems of incomplete classification and low accuracy of the existing motion recognition algorithms for non-normal walking actions. It uses the relief algorithm for feature selection and the improved relief-bagging-SVM algorithm for action classification. The improved algorithm for identifying non-normal walking actions has an accuracy of 96.63%. Compared with decision tree (DT), it increased by 11.63%; compared with k-nearest neighbor (KNN), it increased by 26.62%, the average AUC of the improved algorithm improved by 0.1143 compared to KNN, improved by 0.0235 compared to DT, improved 0.04 compared to RF. These results are of great practical significance to the accuracy of medical health indicators and the detection of steps in PDR.