A method for human posture recognition based on convolutional neural network based on covariance matrix transformation

By introducing covariance matrix transformation into the convolutional neural network, the problem of reduced recognition accuracy caused by sensor data correlation is solved, real-time human posture recognition on smartphones is achieved, and recognition accuracy and efficiency are improved.

CN113642432BActive Publication Date: 2024-09-24NANJING NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110869054.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2024-09-24
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

Existing sensor-based human posture recognition methods lead to attenuation of recognition accuracy and increase in operation time due to data correlation, and traditional convolutional neural networks have data correlation problems when processing time series data, which affects recognition accuracy.

Method used

A convolutional neural network based on covariance matrix transformation is used to eliminate the correlation between data through covariance matrix transformation, reconstruct the convolutional layer to reduce the impact of time series, and detect human posture in real time on smartphones.

Benefits of technology

It improves the accuracy and efficiency of human posture recognition, reduces the use of computing resources, realizes real-time detection capabilities on smartphones, and expands the scope of applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642432B
    Figure CN113642432B
Patent Text Reader

Abstract

The invention discloses a method for human posture recognition using a convolutional neural network based on covariance matrix transformation, and relates to the application field of artificial intelligence. The method comprises the following steps: using a smart phone to collect a sensor time series about human posture, normalizing the original data, performing sliding window operations to divide a data set and fixing action attribute labels, then using covariance matrix transformation to build a convolutional neural network system, using the inverse transformation of the covariance matrix to eliminate data correlation, adding covariance operations before each layer of convolution to avoid data correlation, using a training data set to train network parameters, using a test data set to verify network accuracy, and finally solidifying the network model to generate a pb file, which is migrated to an android client through Android studio, so that the mobile device can use its own accelerometer and gyroscope to identify the current state of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of posture sensor data recognition, and in particular relates to a method for human posture recognition using a convolutional neural network based on covariance matrix transformation. Background Art

[0002] With the advancement of science and technology and the development of society, artificial intelligence has reached an unprecedented height of development and has been integrated into all aspects of life. For smart devices, better detection of human activities and status is a necessary research direction, which can facilitate people's lives and improve people's daily behaviors. Wearable devices are integrating more and more sensors and are applied to various fields: physical therapy, motion recognition, social interaction, etc. The time series data obtained by the sensor is used as the research object. Reasonable predictions are made for different models to obtain information about the human state. Posture research is mainly divided into two types: video image-based and sensor data-based. In essence, through the input of big data, the learnable neural network can autonomously identify the user's state under certain sample training. Compared with posture recognition based on video or pictures, posture recognition based on sensor data has gradually become the mainstream method due to its strong anti-interference ability, unrestricted environment, and low cost. In most sensor-based posture recognition methods, users must wear multiple dedicated motion sensors and attach them to specific parts of the body. Although these methods have been able to achieve high recognition performance, their position restrictions are not suitable for long-term monitoring of the human body. With the development of technology, various embedded sensors such as accelerometers, gyroscopes, and magnetometers in smartphones can be used to extract a large amount of valuable sensor data and have been successfully used for human posture recognition.

[0003] Machine learning has been studied since the rise of computers in the 20th century. It was not until the introduction of deep learning in artificial intelligence that convolutional neural networks entered the public's field of vision. From the initial manual feature extraction to the use of fully connected layers to the current automatic extraction of useful features by convolutional layers, from support vector machines, decision trees, Bayesian models to current deep learning models, the accuracy of posture recognition has been greatly improved. With the improvement of computing power, the data processing capabilities of computers have been qualitatively improved and applied in various pattern recognition and image recognition. Human posture recognition is a typical recognition problem. The widespread application of convolutional neural networks (CNNs) in human posture recognition (HAR) has promoted the development of this process, showing the most advanced performance and expanding the scope of application. More and more researchers have begun to devote themselves to this field. Since the sensor data collected by smartphones is ordered in time, each layer of convolution in the convolutional network will cause the correlation between data to gradually increase, so this is also one of the problems existing in the current convolutional layer. Summary of the invention

[0004] Purpose of the invention: The present invention aims to provide a convolutional neural network based on covariance matrix transformation for human posture recognition method, which can solve the problem of attenuation of recognition accuracy and operation time caused by correlation to a certain extent.

[0005] Technical solution: A method for human posture recognition based on a convolutional neural network using covariance matrix transformation, according to the specific implementation aspects of the present invention, comprises the following steps:

[0006] Step 1: Use sensors in wearable devices such as smartphones to collect human posture motion signal data to obtain different types of motion attributes, such as walking, going up and down stairs, running, falling, etc.

[0007] Step 2: Perform data preprocessing on the collected action signals, including data normalization, 1-norm processing, fixed-step sliding window processing, and division according to data attributes and adding corresponding action labels;

[0008] Step 3: Build a convolutional neural network with a covariance matrix, set hyperparameters and data batches, send the processed data as input vectors to the network training, and use gradient descent backpropagation to update the weight value of the convolution kernel to achieve optimal network performance.

[0009] Step 4: Use public data sets to test the generalization ability of the model and migrate the trained network model to the Android client. The accelerometer of the smartphone can be used to detect the state of the human body in real time.

[0010] In the Step 1, the sampling frequency is 20 Hz during the data collection process, and the 3-axis acceleration sensor and gyroscope data are taken, which are the acceleration direction and rotation angle of the body, to obtain sensor data with a time series.

[0011] In the data preprocessing part of Step 2, the data is processed by 1 norm, the noise data is removed, all the data is compressed between 0 and 1, and the sensor information contained in the data is not changed. Then the sliding window processing is performed to label the data and increase the data volume. The processed data is divided into 70% training set and 30% test set:

[0012] The convolutional neural network constructed in Step 3 has three convolutional layers and two fully connected layers. The size of each convolution kernel is set to 3x3, and the sliding step is 1. It is 64 convolution layers, 128 convolution layers, 256 convolution layers, and fully connected layers (Softmax). The core of the entire network is based on two-dimensional discrete convolution, and its basic convolution formula is:

[0013]

[0014] Where A is the matrix of the previous layer, K is the convolution kernel, and B is the feature output after convolution. When applied to a neural network, the convolution layer formula is:

[0015]

[0016] Where output is the input of the next layer, each convolution kernel W corresponds to a bias b, each layer multiplies the input X by the convolution kernel, and then the activation function is nonlinearized to obtain the feature output of the previous layer. Each layer adds a covariance matrix transformation to eliminate data correlation. Specifically: The basic formula of the covariance matrix transformation is:

[0017]

[0018] For the sensor data matrix X M*N , where N is the number of samples, M is the number of features, μ is the matrix mean of X, an action is sampled N times, each containing M features, which are multiple random tensors X1...X n A matrix representation of the covariance between different actions. For the mutual interference between different actions, the covariance matrix is ​​calculated at this time, and the reversible property of the matrix is ​​used to eliminate the correlation of actions in the convolutional network. For the mathematical formula of the inverse operation, the approximate square root of the covariance matrix D is calculated:

[0019]

[0020] Among them, COV is the covariance transform. The obtained sensor data can be transformed by the covariance matrix to eliminate the relevant influence of the data direction and the channel direction. The following is the specific operation process.

[0021] When human posture data is collected, the matrix transformation before being sent to the convolution layer does not affect the features contained in the data. The transformation process of the input data X can be regarded as an identity matrix with covariance:

[0022]

[0023] Where I is the unit matrix, indicating that this step does not change the motion characteristics. In the operation process, the covariance is applied to the convolution process to process the data. The sensor data with motion information will first be transformed by the inverse matrix to greatly reduce the correlation between the data and eliminate the interference between different actions. Then the convolution operation is performed, multiplied by w (convolution kernel), and the bias matrix b is added to reduce the offset of the data. The complete expression of this process is:

[0024] y=(X-μ)*D*W+b

[0025] Since the neural network has three convolutional layers to process data, the covariance operation in the i-th layer is represented as D i , at this time, the input data of each layer is simplified to the convolution operation between the data of the previous layer and the current layer. Therefore, the next convolution layer X i+1 The input becomes:

[0026] X i+1 =f i *w i *D i *X i

[0027] The matrix operations are all right-multiplication matrix operations, X i is the input data from the i-th layer, D i is the covariance matrix operation performed on this input, W i is the weight matrix in each convolutional layer, and f i It is an activation function used to enable the network to have nonlinear classification capabilities. It is placed after the convolution operation and uses the relu activation function to pass the information carried by the sensor data to the next layer:

[0028] f(x)=max(0,x).

[0029] The matrix operations are all right-multiplication matrix operations, X i is the input data from the i-th layer, D i is the covariance matrix operation performed on this input, W i is the weight matrix in each convolutional layer, and f i The activation function is used to enable the network to have nonlinear classification capabilities. The relu activation function is used to pass the information carried by the sensor data to the next layer:

[0030] f(x)=max(0,x).

[0031] The core idea of ​​this patent can be simplified to reconstruct the convolution layer. Before using the two-dimensional discrete convolution formula, the data matrix is ​​inversely covariance transformed to eliminate the previous time series influence. This transformation is adopted for the three layers of main convolution to construct a complete convolutional neural network.

[0032] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:

[0033] First, we use the built-in sensors in smartphones to take samples. The data comes from real human motion processes and is easy to migrate to smartphone clients later. Then we perform 1-norm processing on the original data to make the data more reasonably concentrated between 0 and 1. Then, we build a convolutional neural network based on covariance matrix transformation, which uses matrix transformation to eliminate the existing data correlation problems and reduce the decline in recognition accuracy caused by time series data. Finally, we migrate the fixed network model to mobile phones through Android Studio to expand the scope of use and enable real-time detection of human behavior and status. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a flow chart of the present invention;

[0035] Figure 2 It is a schematic diagram of the present invention;

[0036] Figure 3 It is a small batch waveform diagram of the original three-axis acceleration data of the present invention;

[0037] Figure 4 This is a graph of accuracy changes corresponding to the number of training times of the present invention;

[0038] Figure 5 It is a confusion matrix diagram of the test data set of the present invention;

[0039] Figure 6 This is the identification interface diagram transplanted to the Android terminal of the present invention. DETAILED DESCRIPTION

[0040] The data collection process and network construction of the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementations.

[0041] As shown in the flow chart, the present invention proposes a method for human posture recognition based on a convolutional neural network based on covariance matrix transformation, comprising the following steps:

[0042] Step 1: All subjects are equipped with the same model of smartphone (iPhone 11). The smartphones are placed above the left and right wrists by fixing the phone bags. Then the subjects perform daily actions (walking, running, going up and down stairs, jumping, etc.). The accelerometer and gyroscope in the smartphone will record the three-axis sensor data of the subjects during exercise. Each set of data collects 300 actions in advance.

[0043] The data collection scheme is shown in the attached figure, where the same subject carries a smartphone in both his left and right hands.

[0044] Step 2: Perform data preprocessing on the collected action signals, including data normalization, 1-norm processing, and fixed-step sliding window processing, and divide the data according to its attributes and add corresponding action labels;

[0045] Step 3: Build a convolutional neural network with a covariance matrix, set hyperparameters and data batches, send the processed data as input vectors to the network training, and use gradient descent backpropagation to update the weight value of the convolution kernel to achieve optimal network performance;

[0046] Step 4: Use public data sets to test the generalization ability of the model and migrate the trained network model to the Android client. The accelerometer of the smartphone can be used to detect the state of the human body in real time.

[0047] In the step 1, the sampling frequency is 20Hz during the data collection process, and the 3-axis acceleration sensor and gyroscope data are taken, which are the acceleration direction and rotation angle of the body, respectively, to obtain sensor data with time series. For example, when the tester goes upstairs with a smartphone, the built-in accelerometer of the phone can record the upward acceleration based on walking, so as to distinguish between going upstairs and walking on a flat road. For the neural network, these different subtle features will be extracted in the convolution layer to obtain a feature map about going upstairs. Multi-layer convolution deepens the feature part. Through training with certain training data, the active learning ability of the neural network can be used to enable the network to autonomously recognize human posture.

[0048] In the data preprocessing part of step 2, the data is processed by 1 norm to eliminate noise data, compress all data between 0 and 1, and the sensor information contained in the data is not changed, such as the special acceleration signal caused by going up and down stairs. Then, the sliding window processing is performed to label the data and increase the data volume. The processed data is divided into 70% training set and 30% test set.

[0049] After the above processing, the data is a four-dimensional tensor, which contains data, features and channel information.

[0050] The two-dimensional convolutional neural network built in the step three is mainly composed of a convolution layer, a pooling layer and a fully connected layer. By superimposing the coupling of these layers, a complete convolutional neural network model can be constructed. In the present invention, the network builds three convolutional layers and two fully connected layers. The reconstructed convolutional layers are all equipped with covariance matrix transformation to eliminate data correlation. The convolution kernel size is set to a fixed 3x3 in the network, and the sliding step size is 1, which is 64 layers of convolution-128 layers of convolution-256 layers of convolution-fully connected layer (Softmax). Specifically: The basic formula of covariance matrix transformation is:

[0051]

[0052] For the sensor data matrix X M*N , where N is the number of samples, M is the number of features, μ is the matrix mean of X, an action is sampled N times, each containing M features, which are multiple random tensors X1...X n A matrix representation of the covariance between different actions. For the mutual interference between different actions, the covariance matrix is ​​calculated at this time, and the reversible property of the matrix is ​​used to eliminate the correlation of actions in the convolutional network. For the mathematical formula of the inverse operation, the approximate square root of the covariance matrix D is calculated:

[0053]

[0054] Among them, COV is the covariance transform. The obtained sensor data can be transformed by the covariance matrix to eliminate the relevant influence of the data direction and the channel direction. The following is the specific operation process.

[0055] When human posture data is collected, the matrix transformation before being sent to the convolution layer does not affect the features contained in the data. The transformation process of the input data X can be regarded as an identity matrix with covariance:

[0056]

[0057] Where I is the unit matrix, indicating that this step does not change the motion characteristics. In the operation process, the covariance is applied to the convolution process to process the data. The sensor data with motion information will first be transformed by the inverse matrix to greatly reduce the correlation between the data and eliminate the interference between different actions. Then the convolution operation is performed, multiplied by w (convolution kernel), and the bias matrix b is added to reduce the offset of the data. The complete expression of this process is:

[0058] y=(X-μ)*D*W+b

[0059] Since the neural network has three convolutional layers to process data, the covariance operation in the i-th layer is represented as D i , at this time, the input data of each layer is simplified to the convolution operation between the data of the previous layer and the current layer. Therefore, the next convolution layer X i+1 The input becomes:

[0060] X i+1 =f i *w i *D i *X i

[0061] The matrix operations are all right-multiplication matrix operations, X i is the input data from the i-th layer, D iis the covariance matrix operation performed on this input, W i is the weight matrix in each convolutional layer, and f i It is an activation function used to enable the network to have nonlinear classification capabilities. It is placed after the convolution operation and uses the relu activation function to pass the information carried by the sensor data to the next layer:

[0062] f(x)=max(0,x).

[0063] The core idea of ​​this patent can be simplified to reconstruct the convolution layer, change the original convolution calculation formula, and perform inverse covariance transformation on the data matrix before using the two-dimensional discrete convolution formula to eliminate the previous time series influence. This transformation is adopted for the three layers of main convolution to construct a complete convolutional neural network.

[0064] The implementation is based on the deep learning module under Pytorch at the software writing stage.

[0065] In step 4, the public datasets include UCI-HAR dataset, PAMAP2 dataset, UNIMIB-SHAR dataset and WISDM dataset. These datasets can be downloaded from the UCI human posture recognition website. They are the most cited datasets in the industry and can evaluate the performance and generalization ability of the model.

[0066] The migration to the Android client described in the present invention firstly enables the network to achieve the optimal accuracy through the training of the data set. At this time, the model weight parameters are the optimal values. The network model is solidified and a pb file is generated to save the network structure and weight graph. The pb file can be imported into the Android program package by using Android Studio. By building an Android app applet, it can be migrated to a specific smartphone after compilation.

[0067] The present invention is a human body posture recognition method for wearable devices based on a convolutional neural network, which can recognize six action postures: jumping, walking, going upstairs, going downstairs, standing, and sitting down.

[0068] Figure 1 The flowchart of the invention object starts from the original sensor data collection, which is input into the convolutional neural network for model training after data preprocessing, and the ideal model obtained after training is applied to the mobile smart terminal to realize the recognition of human body posture. It is divided into two categories: data collection and action recognition process.

[0069] Figure 2This is a structural diagram of a convolutional neural network based on covariance matrix transformation for human posture recognition. It includes the convolution layer and the final classification layer, and only two convolution layers are drawn. The figure also includes the reconstructed internal structure of the convolution layer with a covariance matrix, that is, after the data is input, the data is first de-correlated through the covariance matrix transformation, and then a normal two-dimensional discrete convolution is performed. The weight value is learned autonomously through back propagation, and finally the activation function RELU is used to activate the network nonlinearly, so that the network changes from linear to nonlinear, and a new convolution layer is built to couple to the convolutional neural network. The final fully connected layer is mainly used for the final classification task, and the Softmax function is generally used.

[0070] Figure 3 This is a small batch waveform of the original sensor's three-axis acceleration data. The downsampling frequency of the mobile sensor is artificially fixed at 30Hz. The figure shows the real-time acceleration of the three axes.

[0071] In order to train the convolutional neural network, the present invention divides the collected data samples into two categories: training samples and test samples. The training samples are used as the input of the convolutional neural network for model training, and the test samples are used as a reference for recognition accuracy. In this embodiment, 70% of the data set is used as the training set, and 30% of the data set is used as the test set.

[0072] Figure 4 This is the accuracy change chart of the neural network model after 200 epochs training.

[0073] The example of the present invention can reduce the use of computing resources, and at the same time has a strong generalization ability, etc. Through experimental comparison, it can be seen that the implementation can be significantly better than the traditional convolutional neural network in terms of accuracy and the speed is basically the same.

[0074] Figure 5 This is the confusion matrix diagram of the test set of this implementation. The confusion matrix is ​​a technique used to summarize the performance of a classification algorithm. If the number of samples in each class is not equal, or there are more than two classes in the data set, it may be misleading to use only the classification accuracy as the criterion. Calculating the confusion matrix can better understand the performance of the classification model and the types of mistakes it makes. In the figure, you can see that the horizontal axis is the predicted result, the vertical axis is the actual label result, and the main diagonal is the number of samples where the predicted result and the actual result are the same.

[0075] By analyzing the confusion matrix, the recognition accuracy of the convolutional neural network model for different actions can be obtained, thereby helping to modify the network parameters. The present invention uses the recognition of the public data set Pamap2. When the final model classification accuracy meets the requirements of practical applications, the model can be transplanted to the smart terminal for use.

[0076] Figure 6 This is the identification interface diagram of the present invention transplanted to the Android terminal, and the mobile phone is Huawei mata30 pro.

[0077] It should be noted that the human posture recognition model in the embodiment of the present invention can be integrated into an intelligent mobile terminal. The above-mentioned intelligent terminal can specifically be a smart phone, a smart watch and other terminals, which are not limited here. In the real-time detection process using a smart phone, the model gives the final Softmax classification recognition accuracy based on the trained network, that is, the network's predicted value for each action. The higher the score, the more the network tends to judge it as the current action.

[0078] As can be seen from the above, the human posture recognition device in the embodiment of the present invention collects acceleration data from the intelligent terminal, then performs time series signal 1 norm and normalization processing on the collected data, and inputs the pre-processed data into a human posture recognition neural network model, and finally obtains the human posture recognition result. Since the human posture recognition model is obtained by training the convolutional neural network based on the preset training set, the current human posture can be recognized by inputting the acceleration data obtained in real time into the trained human posture recognition model, thereby realizing the human posture recognition by non-visual means based on acceleration data.

[0079] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0080] The above embodiments are only for illustrating the technical idea of ​​the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for human posture recognition based on convolutional neural network based on covariance matrix transformation, It is characterized in that The method includes: Step 1: Collect human posture motion signal data through sensors in wearable devices to obtain motion attributes of different categories, wherein the acquisition process uses phyphox software to collect sensor data in real time, the sampling frequency is 20Hz, and the 3-axis acceleration sensor and gyroscope data are collected, which are the acceleration magnitude and rotation angle of each direction of the body, to obtain sensor data with time series; Step 2: Perform data preprocessing on the collected action signals, including data normalization, 1-norm processing, and fixed-step sliding window processing, and divide the data according to its attributes and add corresponding action labels; Step 3: input the human body posture motion signal data into the convolutional neural network model, take different categories of motion attributes as output, and train to obtain a convolutional neural network model that can autonomously judge the current posture of the human body; the convolutional neural network model is a convolutional neural network with a covariance matrix, and hyperparameters and data batches are set during training. The sensor data with time series is sent to the network training, and the weight value of the convolution kernel is updated by using gradient descent back propagation to achieve optimal network performance; Step 4: Migrate the trained network model to the Android client and use the accelerometer of the smartphone to detect the human body's state in real time; In the step 3, three convolution layers and two fully connected layers are built in the convolutional neural network. The size of each convolution kernel is set to 3x3, the sliding step is 1, and the sequence is 64 convolution layers, 128 convolution layers, 256 convolution layers, and fully connected layers. The covariance matrix transformation is added to the convolution layers to eliminate data correlation. The basic formula of the covariance matrix transformation is: For the sensor data matrix X M*N , where N is the number of samples, M is the number of features, μ is the matrix mean of X, an action is sampled N times, each containing M features, is a number of random tensors X 1 ...X n A matrix representation of the covariance between different actions. For the mutual interference between different actions, the covariance matrix is ​​calculated at this time. The reversible property of the matrix is ​​used to eliminate the correlation of actions in the convolutional network. For the mathematical formula of the inverse operation, the approximate square root of the covariance matrix D is calculated: Among them, COV is the covariance transform. The obtained sensor data is transformed through the covariance matrix to eliminate the relevant influence of the data direction and the channel direction. The specific process is as follows: When human posture data is collected, the matrix transformation before being sent to the convolutional layer does not affect the features contained in the data. The transformation process of the input data X is regarded as an identity matrix with covariance: Among them, I is the unit matrix, indicating that this step does not change the action characteristics. In the operation process, the covariance is applied to the convolution process to process the data. The sensor data with action information will first be transformed by the inverse matrix to reduce the correlation between the data and eliminate the interference between different actions. Then the convolution operation is performed and multiplied by w, w is the convolution kernel, plus the bias matrix b to reduce the offset of the data. The complete expression of this process is: y=(X-μ)*D*W+b Since the neural network has three convolutional layers to process data, the covariance operation in the i-th layer is represented as D i At this time, for the input data of each layer, it is simplified into the convolution operation between the data of the previous layer and the current layer. The next convolution layer X i+1 The input becomes: X i+1 =f i *w i *D i *X i f(x)=max(0,x) Among them, the matrix operation method is right multiplication matrix operation, X i is the input data from the i-th layer, D i is the covariance matrix operation performed on this input, W i is the weight matrix in each convolutional layer, and f i It is the activation function used to make the network have the ability of nonlinear classification. It is placed after the convolution operation and uses the relu activation function to pass the information carried by the sensor data to the next layer. Finally, the sensor data is classified through the linear classifier to automatically identify the current action of the human body.

2. A method for human posture recognition using a convolutional neural network based on covariance matrix transformation according to claim 1, It is characterized in that In the step 2, the data is processed by 1 norm to remove noise data, and all data are compressed between 0 and 1 without changing the sensor information contained in the data. Then, the sliding window processing is performed to label the data and increase the data volume. The processed data is divided into 70% training set and 30% test set.