Human body complex behavior recognition and prediction method based on multivariate data
By combining the Transformer model and SGCN, self-attention and LIF neurons are used to process sensor data, which solves the problems of low accuracy and high resource pressure of traditional models in complex behavior recognition and prediction, and achieves high-accuracy complex behavior recognition. and predictions.
Patent Information
- Application Number
- CN202410720020.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, in the recognition and prediction of complex human behaviors, traditional models are difficult to effectively capture the spatiotemporal context, resulting in a low recognition rate of complex behaviors, and graph convolutional neural networks face the problem of excessive memory and CPU pressure when processing complex behaviors.
Using the self-attention mechanism based on the Transformer model and Spiking-based Graph Convolutional Networks (SGCN), combined with self-attention, sensor modality attention, global attention mechanism and LIF neurons, the sensor data is processed through the sliding window mechanism to generate high-dimensional features Represent and reduce data noise, improving recognition and prediction accuracy.
It achieves high-accuracy recognition and prediction of complex human behaviors, with a recognition rate of more than 80% and a prediction accuracy of 90%. It also significantly reduces CPU operating pressure and computing power requirements, and is suitable for complex behavior recognition and prediction in real life. predict.
Smart Images

Figure CN118568545A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of complex human behavior recognition and prediction, and specifically relates to a complex human behavior recognition and prediction method based on multivariate data. Background Art
[0002] Nowadays, research on human behavior recognition is basically based on pictures or videos, which has led to a lack of good development in the field of real-time recognition. With the rapid development of wearable devices such as smartphones in recent years, the various accelerometers built into them have become increasingly sophisticated, which has provided convenience in data acquisition for detecting and identifying various human behaviors, making human behavior recognition and prediction increasingly a hot research field in artificial intelligence. Although there are many methods and technologies for collecting human behavior data and performing simple behavior recognition, most human behavior recognition methods select a few common simple daily behaviors, such as standing, walking, etc., which leads to these methods often having a high recognition rate for a small number of simple behaviors, while the recognition rate for other more complex behaviors is very low. Human behavior is often complex and diverse, such as playing basketball, exercising, washing clothes, eating, and other complex activities. It is difficult to apply the recognition and classification of simple behaviors alone in real life. In this regard, existing models of recurrence or convolution or their mixtures for activity recognition have difficulty capturing the spatiotemporal context from the feature space of the sensor reading sequence. In order to solve this complex problem,
[0003] To solve this problem, this paper proposes a neural network model based on the existing Transformer model framework and the self-attention mechanism. The model uses different types of attention mechanisms to generate high-dimensional feature representations for classification and obtain higher recognition accuracy. For the sake of convenience, the following text still uses Transformer to describe this new model.
[0004] At the same time, in research, since label annotation tasks are generally performed after the fact, the task is relatively arduous and prone to human labeling errors or missing data. These incorrect labels or missing data will generate noise interference in the data, which will have an adverse impact on model development and training. However, behavioral activities often have an inherent habit table. For example, we brush our teeth after getting up. This implicit habit table can be used to learn unknown labels. Graph Convolutional Neural Networks (GCNs) are undoubtedly the most suitable for extracting data with such graph structures. Existing research has also shown that they perform better than other methods in processing graph-type data. However, a challenge faced by GCNs is that using the ReLU function as an activation function, if the behavior is too complex, the memory and CPU pressure will be too high, and the training of the model parameters will be ineffective. Therefore, based on the idea of spiking neural networks, this paper uses LIF neurons to reduce the operating pressure and computing power requirements of the memory and CPU, so that GCNs can learn more actions and learn more complex implicit habit tables to improve the prediction accuracy of missing data. This is the Spiking-based Graph Convolutional Networks, hereinafter referred to as (SGCN). Summary of the Invention
[0005] In order to address the shortcomings of the existing technology, a method for recognizing and predicting complex human behaviors based on multivariate data is provided, which can use the data from sensors worn on the human body to judge the complex movements made by the human body in real time.
[0006] To achieve the above technical objectives, the present invention discloses a method for recognizing and predicting complex human behaviors based on multivariate data, which comprises the following steps:
[0007] Sensors worn on the human body collect data on the body's status during various activities, including heart rate, blood pressure, acceleration in different directions of various parts of the body, and angular velocity. The sensors are set on the dominant arm, chest, and ankle of the dominant side.
[0008] Generate and train a human action recognition and prediction model, and use the trained recognition and prediction model to predict the next action based on human action information collected by wearable devices;
[0009] The recognition and prediction model includes a prediction module and a recognition module;
[0010] The prediction module is a pulse-based graph convolutional neural network SGCN. The input of SGCN is an action sequence, which is then modeled into a graph structure. At this time, each similar action is interconnected and has the same weight. Through the voting mechanism of the sliding window, the missing action labels and data are supplemented or the wrong labels are modified, and finally become a complete training data set to reduce data noise and improve the training effect. At the same time, based on the identified data, it assists in subsequent action prediction; SGCN includes a sequentially connected graph convolution layer GCN for processing the input graph vector, three consecutive convolution layers CNN for extracting feature vectors, and a prediction layer for outputting the predicted label of the graph. The connections between GCN and CNN, CNN and CNN, and CNN and the prediction layer are all equipped with interconnected LIF neurons and ReLU functions to convert continuous data into pulses of 0 and 1 to reduce the pressure of memory on storage parameters;
[0011] The recognition module is an improved Transformer model. The improved Transformer model is based on the self-attention mechanism, abandons the recurrent network, and uses sensor modal attention, self-attention, and global attention mechanisms to construct a high-dimensional feature representation for classification. In the improved Transformer model, the input time series data passes through the attention mechanism, and then enters the feedforward layer with a multi-head attention mechanism. After passing through a feedforward layer with a multi-head attention mechanism, it passes through the ConvLSTM module and the global attention mechanism, and finally passes through the softmax output. Based on the user's heart rate, blood pressure, and the acceleration and angular velocity data of various parts of the human body in different directions obtained by the sensor, the user's various daily behavioral activities are identified and predicted. Finally, the recognition module accurately identifies the user's individual real-time movement and daily activities, and the prediction module predicts the user's next specific action.
[0012] Furthermore, the training of recognition and prediction models requires the use of the simple human behavior dataset UCI-HAR and the complex human behavior dataset PAMAP2.
[0013] In UCI-HAR, a smartphone was tied to the human waist and six activities were completed, including walking, climbing stairs, descending stairs, sitting still, standing, and lying flat. The data included x, y, and z-axis accelerometer data and gyroscope data. The data sampling frequency was 50Hz. Feature engineering was applied to window data to obtain a 561-dimensional feature vector. The training set and test set in the dataset were divided in a ratio of 7:3; PAMAP2 contains data on 24 different physical activities. The sampling actions of the human-worn sensor include lying, sitting, standing, walking, running, cycling, Nordic walking, watching TV, playing computer games, driving, climbing stairs, descending stairs, vacuuming, ironing, folding clothes, cleaning the house, playing football, and jumping rope.
[0014] Furthermore, the improved Transformer model includes a sequentially connected input layer, a sensor attention layer, a position encoding layer, two residual connections and normalization layers including a feedforward layer, a Conv-LSTM layer, a global attention mechanism, a softmax layer, and an output layer. The feedforward layer is connected with a residual connection and normalization layer including a multi-head attention mechanism.
[0015] The input layer is used to receive time series data.
[0016] The time series data is processed by the sensor attention layer, which uses a convolutional neural network to assign feature importance to the time series data. A 1x1 convolutional layer is applied to further map the features, with an output dimension of 128. A ReLU activation function is used as a fully connected layer to convert the data feature dimension into the required model dimension dmodel.
[0017] A position encoding layer is introduced to assign relative position information to sequence elements, incorporating sequence position information to improve the performance of sequence modeling. Multiple encoding layers are used to process and encode time series data. The encoding layer combines multi-head self-attention and forward networks to encode and extract features of sequence data. A Conv-LSTM layer is used to further extract temporal features between samples, obtaining the features of the latent state ht and cell state Ct at different time steps t.
[0018] Finally, by calculating the attention weight vector fn of the input sequence, the vectors of each time step t are weighted to obtain the weighted context vector, which is used to represent the information sn of the entire human motion data sequence;
[0019] The final output data is obtained through the softmax layer.
[0020] Furthermore, the SGCN prediction module includes sequentially connected graph convolution layers, multiple convolution layers and the final prediction layer, and a mixture of LIF neurons and ReLU as connection functions between the multiple convolution layers and the final prediction layer;
[0021] The SGCN model is used to convert human feature data into a graph dataset. In the function that constructs the activity graph data, the feature vector is divided into multiple sliding windows of the same size as the number of nodes, and the node features and labels within each window are merged into a tensor. The noisy or missing labels of the nodes are set according to the threshold of the number of incorrect labels. The data within each window is converted into a graph data structure, including the adjacency matrix A and the node feature matrix V, and the true label and noisy or missing label of the node. Finally, the obtained data is stored in the data_dict dictionary and serialized into binary data for storage.
[0022] Define a graph convolution layer to process the input graph vector. Initialize the graph convolution layer by considering the dimensions of the input features, the dimensions of the output features, and whether a bias term is required. Define the weight parameters of the convolution kernel during the graph convolution layer initialization process, and define the bias parameters based on whether a bias term is required.
[0023] Multiply the input features by the weight matrix of the convolution kernel to obtain the support matrix, which is the weighted kernel A of the activity graph. norm ;
[0024] Multiply the adjacency matrix by the support matrix to obtain the output features;
[0025] The CNN layer is used to extract feature vectors and further process the feature matrix output by the graph convolution layer.
[0026] Finally, a convolutional prediction layer is defined to output the predicted label of the graph through the defined convolutional prediction layer.
[0027] Furthermore, the method of using the recognition and prediction model to recognize and predict complex human behaviors is as follows:
[0028] The improved Transformer module is trained using simple human behavior recognition data UCI-HAR. The model parameters of the Transformer are continuously adjusted to obtain the Transformer model with the best recognition effect. Then the entire recognition and prediction model is trained based on complex behaviors: the PAMAP2 training data is first normalized, downsampled by sliding window, one-hot encoded, and pre-filtered.
[0029] The SGCN module is used to construct an activity graph from the PAMAP2 training data, and the human behavior sequence is modeled as a graph structure, defined as G = (V, E), where V = {V|V∈V} is a vertex set representing the information of each sensor, and each vertex V = [ft,c t ] contains both the measurement value on a time window, the subscript t represents the time step, specifically referring to which moment, and the related multi-label class, E = {E i,j |E∈E;i,j∈|V|}, where E is the set of all graph edges, representing the correlation between different sensors at the same time. The initial weights are all set to 1, and the weight of each edge is equal. The nodes in the graph structure are then subjected to the LIF activation function of the spiking neural network and converted into data in the frequency domain. After continuous feature extraction, the missing labels are finally predicted.
[0030] After the data is constructed, the recognition module is trained and the Transformer model is improved. The input data is time series data. First, the attention score is obtained through the sensor modality attention module and the self-attention module. Then, the multi-head attention mechanism is used to sort the data output by different self-attention modules according to their importance. The output data enters the ConvLSTM module, and finally the output is the recognized action.
[0031] With the help of the trained recognition and prediction model, all actions performed by the human body for each input data are identified; the data will first enter the trained prediction module, and if there is any missing data, the data will be supplemented, and then enter the recognition module. Through multiple attention modules, the recognition results are obtained, and then the data with the recognition results are input into the prediction module to predict the next action and then output the results.
[0032] Furthermore, the weighted kernel of the activity graph in step 2 above is:
[0033]
[0034] Where D represents the next node matrix of A+I, I is the identity matrix, and Λ is the degree matrix of graph G;
[0035] The LIF neuron formula used is as follows:
[0036] v (t+1),pre =τυ (t) +c (t) ,wherec (t) =Ws (t) Where: c (t) is the amount of charge at time t, v (t) refers to the membrane potential at time t, v (t+1),pre is the membrane potential before the receiving synapse at time t+1; let τ be the attenuation factor, τ is a constant between 0 and 1, which is used to control the relationship with the time series, and W is the weight parameter. Then the data will be passed to the next layer in LIF. The formula is as follows:
[0037]
[0038] where s (t+1) represents the pulse value at t+1;
[0039] Here V th Represents the threshold value. If the neuron LIF is activated, that is, S (t+1) =1, then
[0040] v (t+1) =υ (t+1),pre -s (t+ 1)*V th
[0041] During back propagation, S at time t+1 (t+1) It is discrete and cannot be differentiated; the derivative of the pulse with respect to the threshold is defined as the derivative of the neuron:
[0042]
[0043] Furthermore, the attention score in step 3 above is used:
[0044]
[0045] Where, f n is the output of the self-attention layer, q, k are the three data after encoding the input data, q represents the query, which is the object being queried, and is the feature vector of self-awareness, k represents the key value, which is the item being compared, and is the most prominent feature vector of the object, and v is the feature vector of the object. The multi-head attention mechanism used is as follows:
[0046] s n =w0·concat(f (1) ,f (2) …f (n) )
[0047] Where s n represents the output of the multi-head attention layer, f (n) Represents the output of different self-attention layers, and w0 is the weight.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] The method disclosed in this invention currently has a recognition rate of nearly 95% for some complex activities, such as running and jumping, and has a good recognition effect. From the analysis of the confusion matrix, the model has the best recognition effect for activities such as walking and Nordic walking, which is close to 100%. However, it has poor recognition of sitting activities, and many examples are misclassified as standing, resulting in a decrease in the overall recognition rate, but the average recognition rate is high. The recognition rate of a single model is only about 75%, and the method of combining the above two modules can make the recognition accuracy reach more than 80%, which is a significant improvement.
[0050] For behavior prediction, the construction of the graph and the use of the sliding window mechanism make up for the problem of poor prediction results caused by missing or incorrect labels in complex human behavior datasets, making the average prediction accuracy of this method reach 90%, and the prediction accuracy for a small number of complex actions can reach 98%. The prediction accuracy of only a single GCN model is only around 90%, which is a significant improvement.
[0051] At the same time, due to the addition of LIF neurons, this method significantly reduces its computing power and CPU requirements. Using sparsity as a measure of hardware usage, the higher the sparsity, the more it can avoid excessive calculations of model parameter weights on computer hardware, thereby providing more computing space. Traditional models using the ReLU activation function have a sparsity of approximately 50%, which leads to model redundancy and has a very negative impact on model training. It also places a burden on computing power and CPU. However, the SGCN used in this new method converts data into the frequency domain, with a sparsity of approximately 80%. This significantly reduces the operating pressure on the CPU, reduces computing power requirements, and makes computer hardware more efficient, thus allowing more model parameters to be saved.
[0052] Moreover, this method has a good recognition accuracy for simulated fall tests and can also make predictions before a fall, with a prediction success rate of 55% and an identification rate of 85%. This is of great significance in the medical and health field and can effectively protect the personal safety of the elderly. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a framework diagram of a complex behavior recognition and prediction method based on a pulse graph convolutional neural network in an embodiment of the present invention.
[0054] Figure 2 This is a flow chart of the identification module according to an embodiment of the present invention.
[0055] Figure 3 4 is a flow chart of a prediction module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The embodiments of the present invention are further described below with reference to the accompanying drawings:
[0057] Attachment Figure 1 As shown in the figure, the method for recognizing and predicting complex human behaviors based on multivariate data disclosed in the present invention includes an overview of its main framework and various modules:
[0058] 1) First, the input data will undergo data preprocessing. First, it is inevitable that there will be some NaN missing values in the input data. When the Python function method determines that there are more than 9 missing values in a data, the data will be deleted. In other cases, the missing values are first masked. Then, to reduce the amount of data, the data set is downsampled, taking every two samples. Since the label values of the data are added manually later, a large number of errors and omissions are inevitable. For this reason, the sliding window voting method is designed. The window size is the number of samples considered at a time when constructing the representation for the classification task. The activity recognition window is constructed based on two dimensions: time step and sensor feature, and is determined by majority voting.
[0059] 2) The processed data is then fed into a model trained on the PAMAP2 and UCI-HAR datasets. The data first enters the SGCN module, where SGCN predicts and supplements the missing data. The supplemented data is then fed into the improved Transformer model, which recognizes the input data and annotates the data with the recognized labels. The data is then returned to the SGCN, which makes further predictions about its next action and ultimately obtains the output data.
[0060] Attachment Figure 2 This is the overall framework of the recognition module. It is an improved Transformer model based on the self-attention mechanism, abandoning the recurrent network. It is constructed by utilizing sensor attention, self-attention, and global attention mechanisms along with ConvLSTM modules. First, an input layer is defined to receive time series data. The data is then processed by the sensor attention layer, which uses a convolutional neural network to assign feature importance to the sequence data. Next, a 1x1 convolutional layer is applied to further map features, with an output dimension of 128 and a ReLU activation function. This convolutional layer is effectively a fully connected layer, transforming the data feature dimension into the required model dimension (often denoted as dmodel). Subsequently, a positional encoding layer is introduced to assign relative position information to sequence elements. This step aims to incorporate sequence position information into the model to improve sequence modeling performance. Next, multiple EncoderLayer layers are used to process the time series data. These layers combine multi-head self-attention and a feed-forward network to encode and extract features from the sequence data. Finally, a Conv-LSTM layer is used to further extract features. Finally, by calculating the attention weight vector AttentionWithContext of the input sequence, we weight the vectors of each time step to obtain a weighted context vector that represents the information of the entire sequence. Finally, we link the input layer and the output layer together and pass it through the softmax layer to obtain the final output data.
[0061] Attachment Figure 3The following diagram shows the architecture of the SGCN prediction module. It consists of a graph convolutional layer, multiple convolutional layers, and a final prediction layer, with the connection function being a mix of LIF neurons and ReLU. First, we define a class called HARSGCNDataset to convert feature data into a graph dataset. The constructor accepts parameters such as a list of feature vectors, a list of labels, a single label, the number of nodes, a missingness threshold, a noise threshold, a normalization method, and the dimensions of the feature vectors and labels. We partition the feature vector into sliding windows of the same size as the number of nodes and merge the node features and labels within each window into a single tensor. Next, we set the noisy or missing labels for the nodes based on a threshold for the number of incorrect labels. Finally, we convert the data within each window into a graph data structure, including the adjacency matrix A and the node feature matrix V, as well as the true and noisy or missing labels for the node. Finally, we store the resulting data in the data_dict dictionary and serialize it into binary data and write it to a file for later use. Next, we define a graph convolution layer called GraphConvolution to process the input graph vector. Initialization of this module includes the dimensions of the input features, the dimensions of the output features, and whether a bias term is required. During initialization, we define the weight parameters of the convolution kernel and, depending on whether a bias term is required, define the bias parameters. Next, we multiply the input features by the convolution kernel weight matrix to obtain the support matrix; then, we multiply the adjacency matrix by the support matrix to obtain the output features. The CNN layer is used to extract feature vectors and further process the feature matrix output by the graph convolution layer. Finally, a convolutional prediction layer is defined to output the predicted label of the graph.
[0062] The innovation of the above model lies in the major modification of the Transformer model, abandoning the recurrent network and adding sensor attention, self-attention, global attention mechanism and ConvLSTM module to build a new model. First, sensor encoding is performed, then position encoding, followed by four layers of feedforward layers and multi-head attention layers for transition connection, and batch normalization and residual calculation operations are performed between them; finally, Conv-LSTN is used to further extract features in time, enter the global attention mechanism, and undergo softmax to obtain the final result. Such a model has better complex behavior recognition capabilities than the ordinary Transformer model. Secondly, the highlight of the SGCN model is that, based on the existing GCN and CNN modules, its connection mode and activation function are changed. Without reducing the accuracy, the computing power, memory and CPU operating pressure are greatly reduced, and more iterative training of parameters can be performed, and the prediction rate is also significantly improved compared to a single model.
[0063] Example
[0064] Step 1) Use the simple human behavior recognition data (UCI-HAR) to train the Transformer module. The model structure and parameters are continuously adjusted to obtain the optimal recognition model, which is then saved for future use. The complex behavior data (PAMAP2) is then preprocessed using sliding window resampling, interpolation, and normalization. Because the dataset contains a large number of missing labels and wearable devices do not always accurately collect data, any missing values for a data feature that exceeds nine are deleted.
[0065] Step 2) When performing complex behavior training, after the data is preprocessed, it first enters the prediction module. The prediction module of this embodiment is a new type of neural network structure, the pulse graph convolutional neural network, which inputs the node feature matrix V and the adjacency matrix A into the graph convolution layer, and models all the behavior sequence data into a graph structure, defined as G = (V, E), where V = {V|V∈V} is a vertex set, and each vertex V = [f t ,c t ] contains both the measurement value on a time window and the related multi-label class, E = {E i,j |E∈E;i,j∈|V|}, where E is the set of all graph edges, all weights are set to 1, and each edge has equal weight, which means that all nodes are equally important, resulting in the feature matrix x. Next, x is weighted by the value of the normalized adjacency matrix Anorm. The function of this layer is to perform classification prediction of behavioral data by accepting the activity graph G of missing data to output the category of unknown data. The data then passes through the LIF neurons to convert the data to the frequency domain, greatly reducing the operating pressure of the memory and providing more information features. It then enters the three-layer CNN layer to predict each activity label or other missing data, improving the efficiency of the prediction. The output data is directly regressed according to the cross-entropy loss function to predict the label C to supplement the label or correct the incorrect label.
[0066] Step 3) After the data is constructed, the recognition module is trained. This embodiment is a new type of Transformer module. The input data is time series data. First, it passes through the sensor modal attention module and converts the input multi-channel data into a single-channel output through a convolution operation. Then it enters the self-attention module, which consists of two sublayers: a multi-head self-attention layer and a feedforward network layer to obtain the attention score. Then, the multi-head attention mechanism is used to sort the data output by different self-attention modules according to their importance to predict the class label corresponding to the East China window. The output data enters the ConvLSTM module and finally outputs the recognized action.
[0067] Step 4) Use the trained model to identify all actions performed by each individual in the input data; the data will first enter the prediction module, which will convert various activity sequence data into a graph form. If some data is missing, the window of the trained pulse graph convolutional neural network will be used for prediction assignment, and then the complete data will be obtained. Then it will enter the recognition module, and through multiple attention modules, the recognition results will be obtained. The data with the recognition results are then input into the prediction module to predict the next action, and finally the output recognition and prediction results are obtained.
Claims
1. A method for identifying and predicting complex human behaviors based on multivariate data, characterized in that: Here are the steps: The sensors worn on the human body collect the status information data of the human body during various activities, including: heart rate, blood pressure, acceleration in different directions of various parts, angular velocity, where the sensors are set at the dominant arm, chest, and ankle of the dominant side; Generate a human action recognition and prediction model and complete the training, and use the trained recognition and prediction model to predict the next action based on the human action information collected by the wearable device; The recognition and prediction model includes a prediction module and a recognition module; The prediction module is a pulse-based graph convolutional neural network SGCN. The input of SGCN is an action sequence, which is then modeled into a graph structure. At this time, each similar action is interconnected and has the same weight. Through the voting mechanism of the sliding window, the missing action labels and data are supplemented or the wrong labels are modified, and finally become a complete training data set to reduce data noise and improve the training effect. At the same time, according to the identified data, it assists in subsequent action prediction; SGCN includes a graph convolution layer GCN that processes the input graph vector in sequence, three consecutive convolution layers CNN for extracting feature vectors, and a prediction layer for outputting the predicted label of the graph. The connections between GCN and CNN, CNN and CNN, and CNN and the prediction layer are all equipped with interconnected LIF neurons and ReLU functions to convert continuous data into the form of pulses 0 and 1 to reduce the pressure of memory on storage parameters; The recognition module is an improved Transformer model. The improved Transformer model is based on the self-attention mechanism, abandons the recurrent network, and uses sensor modal attention, self-attention, and global attention mechanisms to construct a high-dimensional feature representation for classification. In the improved Transformer model, the input time series data passes through the attention mechanism, and then enters the feedforward layer with a multi-head attention mechanism, and then passes through a feedforward layer with a multi-head attention mechanism. After passing through the ConvLSTM module and the global attention mechanism, it is finally output through softmax. According to the user's heart rate, blood pressure, and the acceleration and angular velocity data of various parts of the human body in different directions obtained by the sensor, the user's various daily behavioral activities are identified and predicted. Finally, the recognition module accurately identifies the user's individual real-time movement and daily activities, and the prediction module predicts the user's next specific action.
2. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 1, characterized in that: The training of recognition and prediction models requires the use of the simple human behavior dataset UCI-HAR and the complex human behavior dataset PAMAP2. In UCI-HAR, a smartphone was tied to the human waist, and six activities were completed, including walking, climbing stairs, descending stairs, sitting still, standing, and lying flat. The data included x, y, and z-axis accelerometer data and gyroscope data. The sampling frequency of the data was 50 Hz. Feature engineering was applied to the window data to obtain a 561-dimensional feature vector. The training set and test set in the dataset were divided in a ratio of 7:
3. PAMAP2 contains data on 24 different physical activities. The sampling actions of the sensors worn on the human body include lying, sitting, standing, walking, running, cycling, Nordic walking, watching TV, playing computer games, driving, climbing stairs, descending stairs, vacuuming, ironing, folding clothes, cleaning the house, playing football, and skipping rope.
3. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 1, characterized in that: The improved Transformer model includes a sequentially connected input layer, a sensor attention layer, a position encoding layer, two residual connections & normalization layers Add&Norm including a feedforward layer, a Conv-LSTM layer, a global attention mechanism, a softmax layer, and an output layer, wherein the feedforward layer is connected with a residual connection & normalization layer Add&Norm with a multi-head attention mechanism; The input layer is used to receive time series data. The time series data is processed through the sensor attention layer, which uses a convolutional neural network to assign feature importance to the time series data; A 1x1 convolutional layer is applied to further map the features, with an output dimension of 128, and a ReLU activation function is used as a fully connected layer to transform the data feature dimension into the required model dimension dmodel; The position encoding layer is introduced to give relative position information to sequence elements, and the position information of the sequence is integrated to improve the performance of sequence modeling. Multiple encoding layers are used to process time series data and encode the time series data. The encoding layer combines multi-head self-attention and forward network to encode and extract the features of sequence data. The Conv-LSTM layer is used to further extract the temporal features between samples, and obtain the features of the implicit state ht and the cell state Ct at different time steps t. Finally, by calculating the attention weight vector fn of the input sequence, the vectors of each time step t are weighted to obtain a weighted context vector, which is used to represent the information sn of the entire human motion data sequence; The final output data is obtained through the softmax layer.
4. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 1, characterized in that: The SGCN prediction module includes sequentially connected graph convolution layers, multiple convolution layers and the final prediction layer. LIF neurons and ReLU are mixed as connection functions between multiple convolution layers and the final prediction layer. The human feature data is converted into a graph data set using the SGCN model; in the function of constructing the activity graph data, the feature vector is divided into multiple sliding windows of the same size as the number of nodes, and the node features and labels in each window are merged into a tensor; the noise or missing labels of the nodes are set according to the threshold of the number of wrong labels; the data in each window is converted into a graph data structure, including the adjacency matrix A and the node feature matrix V, and the true label and the noise or missing label of the node are recorded; finally, the obtained data is stored in the data_dict dictionary, and it is serialized into binary data and written into the storage; Define a graph convolution layer to process the input graph vector; the initialization of the graph convolution layer includes the dimension of the input feature, the dimension of the output feature, and whether a bias term is required; Define the weight parameters of the convolution kernel during the initialization of the graph convolution layer, and define the bias parameters based on whether a bias term is needed; Multiply the input features by the weight matrix of the convolution kernel to obtain the support matrix, which is the weighted kernel Anorm of the activity graph; Multiply the adjacency matrix by the support matrix to get the output features; The CNN layer is used to extract feature vectors and further process the feature matrix output by the graph convolutional layer. Finally, a convolutional prediction layer is defined, and the predicted label of the graph is output through the defined convolutional prediction layer.
5. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 1, characterized in that: The method of using recognition and prediction models to recognize and predict complex human behaviors is as follows: The improved Transformer module is trained using simple human behavior recognition data UCI-HAR, and the model parameters of the Transformer are continuously adjusted to obtain the Transformer model with the best recognition effect. Then, the entire recognition and prediction model is trained based on complex behaviors: the PAMAP2 training data is first normalized, the sliding window is downsampled, the one-hot encoding is performed, and the filtering preprocessing operation is performed. The SGCN module is used to construct an activity graph from the PAMAP2 training data and model the human behavior sequence as a graph structure, defined as G = (V, E), where V = {V|V∈V} is a vertex set representing the information of each sensor, and each vertex V = [f t ,c t ] contains both the measurement value on a time window, where the subscript t indicates the time step, and the relevant multi-label class, E = {E i,j |E∈E; i, j∈|V|}, where E is the set of all graph edges, representing the correlation between different sensors at the same time. The initial weights are all set to 1, and the weight of each edge is equal. The nodes in the graph structure are equally important. The graph structure then enters the LIF activation function of the pulse neural network and is converted into data in the frequency domain. After continuous feature extraction, the missing labels are finally predicted.
6. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 3, characterized in that: After the data is constructed, the recognition module is trained to improve the Transformer model. The input data is time series data. First, the attention score is obtained through the sensor modality attention module and the self-attention module. Then, the multi-head attention mechanism is used to sort the data output by different self-attention modules according to their importance. The output data enters the ConvLSTM module and finally the output is the recognized action. With the help of the trained recognition and prediction model, all the actions performed by the human body for each input data are identified; the data will first enter the trained prediction module, and if there is any missing data, the data will be completed, and then enter the recognition module, and through multiple attention modules, the recognition result is obtained, and then the data with the recognition result is input into the prediction module to predict the next action and then output the result.
7. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 6, characterized in that: The weighted kernel of the activity graph in step 2 above: Where D represents the next node matrix of A+I, I is the identity matrix, and Λ is the degree matrix of graph G; The LIF neuron formula used is as follows: v (t+1),pre =τv (t) +c (t) ,where c (t) =Ws (t) Where: c (t) is the charge at time t, v (t) is the membrane potential at time t, v (t+1),pre is the membrane potential before the receiving synapse at t+1; let τ be the attenuation factor, τ be a constant between 0 and 1, which is used to control the relationship with the time series, W is the weight parameter, and then the data will be passed to the next layer in LIF, the formula is as follows: where s (t+1) represents the pulse value at t+1; Here V th represents the threshold value. If the neuron LIF is activated, that is, S (t+1) =1, then v (t+1) =υ (t+1),pre -s (t+1) *V th During back propagation, S at time t+1 (t+1) It is discrete and cannot be differentiated; the derivative of the pulse with respect to the threshold is defined as the derivative of the neuron:
8. The method for identifying and predicting complex human behaviors based on multivariate data according to claim 7, characterized in that: The attention scores in step 3 above are used: In the formula, f n is the output of the self-attention layer, q, k are the three data after encoding the input data, q represents the query, which is the object being queried, and is the feature vector with self-awareness, k represents the key value, which is the item being compared, and is the most prominent feature vector of the object, and v is the multi-head attention mechanism used by the feature vector of the object, specifically: s n =w0·concat(f (1) ,f (2) …f (n) ) In the formula, s n represents the output of the multi-head attention layer, f (n) Represents the output of different self-attention layers, and w0 is the weight.
Citation Information
Patent Citations
Multi-target behavior action recognition and prediction method, electronic equipment and storage medium
CN110689041A
Attention mechanism human behavior recognition method based on wrist wearable device
CN116578192A
Synchronous human motion identification and prediction method and system
CN117475518A
