A human activity recognition method based on residual shrinkage network

By using the residual shrinkage network in human activity recognition, using GRU and dilated convolutional layers to extract temporal dependencies, and combining channel attention and soft threshold layers, the problem of low recognition accuracy in hardware-limited environments is solved and low-level recognition is achieved. Cost-effective, high-accuracy human activity recognition.

CN117523672BActive Publication Date: 2024-08-30GUANGDONG POLYTECHNIC NORMAL UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311570380.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2024-08-30
Estimated Expiration
2043-11-23

AI Technical Summary

Technical Problem

Existing sensor-based human activity recognition methods blindly deepen the network in hardware-constrained environments, resulting in increased delays and costs, and low recognition accuracy, making it difficult to effectively mine human activity features in sensor data.

Method used

The human activity recognition method based on the residual shrinkage network is used to extract multi-layer temporal dependencies through the GRU network and dilated convolution layers, and is combined with the channel attention mechanism and soft threshold layer to perform feature extraction and mapping, reducing computational costs and improving recognition accuracy. Rate.

Benefits of technology

It achieves high-accuracy human activity recognition at low computational cost, is suitable for resource-constrained hardware environments, and improves recognition accuracy and network classification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117523672B
    Figure CN117523672B
Patent Text Reader

Abstract

The present invention belongs to the technical field of intelligent human-computer interaction, and discloses a method for human activity recognition based on a residual shrinkage network. The method includes a residual shrinkage network for human activity recognition, and the steps of the method are: S1, obtaining a time series data set of human activities; S2, preprocessing the time series data set; S3, initializing the residual shrinkage network; S4, inputting the data set into the residual shrinkage network and training it; S5, deploying the weight-optimized residual shrinkage network to an intelligent wearable device that needs to recognize human activities, and completing the recognition of human activities. The present invention considers the multi-layer correlation of data generated by human activities through the residual shrinkage network structure, and the GRU network and the hole convolution layer extract multiple time scale time dependencies in the activity data. The method extracts human activity features at a lower computational cost and achieves a higher accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent human-computer interaction, and in particular to a human activity recognition method based on a residual shrinkage network. Background Art

[0002] With the rapid development of science and technology and the popularization of smart devices, people's demand for understanding and analyzing human behavior patterns is growing. Human Activity Recognition (HAR) technology aims to automatically identify and classify human activities by analyzing and understanding human movements and behaviors in different environments. It is widely used in health monitoring (such as exercise tracking and sleep monitoring), smartphone applications (such as step counting and navigation), virtual reality (such as hand movement tracking), industrial safety (such as dangerous activity detection) and other fields.

[0003] In recent years, with the rise of deep learning, sensor-based HAR technology has made significant progress. By building a neural network model, features in sensor data are automatically learned and extracted, and then these features are used to classify and identify activities. Compared with vision-based HAR, the former is cheaper and easier to solve privacy issues. Among the existing methods, a Chinese patent (publication number CN115329800A) discloses a convolutional neural network recognition method based on decoupled training. The model is decoupled into a training phase and an inference phase through a structured re-parameter algorithm in human activity recognition. It involves HAR of wearable sensor data sources, but this method only has convolutional layers and fully connected layers, and lacks the ability to extract features of human activities.

[0004] At present, sensor-based HAR methods often use a deeper network structure to improve recognition accuracy, but in hardware-constrained environments, blindly deepening the network will bring higher latency and costs. Therefore, how to achieve low cost, high accuracy and be able to fully explore the characteristics of human activities in sensor data is one of the problems that technicians in this field urgently need to solve. Summary of the invention

[0005] The present invention is intended to provide a method for human activity recognition based on a residual shrinkage network. The multi-layer correlation of data generated by human activities is considered through the residual shrinkage network structure. The GRU network and the hole convolution layer extract the time dependencies of multiple time scales in the activity data. The channel attention mechanism is used to enhance useful features and suppress irrelevant features, and the shrinkage process is performed through the soft threshold layer, and the feature mapping is performed by the classification network layer. The method extracts human activity features with lower computational cost and achieves higher accuracy. The problems in the background technology are solved.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A human activity recognition method based on a residual shrinkage network, the human activity recognition method comprising a residual shrinkage network for human activity recognition, the residual shrinkage network comprising a convolutional network layer, two adjacent residual shrinkage layers and a classification network layer;

[0008] The convolutional network layer includes a convolutional layer, a normalization layer and an activation layer;

[0009] Any of the residual shrinkage layers includes a gated recurrent unit (GRU) network, two hole convolution layers, a channel attention threshold self-learning layer and a soft thresholding layer; wherein any of the hole convolution layers includes a normalization layer and an activation layer; the channel attention threshold self-learning layer includes a pooling compression layer, two fully connected layers, a normalization layer and an activation layer;

[0010] The classification network layer includes a feature fusion layer, a fully connected network layer and an activation layer; the feature fusion layer includes a pooling compression layer and a fusion layer; the fully connected network layer includes two fully connected layers and a normalization layer;

[0011] The human activity recognition method further comprises the following steps:

[0012] S1. Obtain a time series dataset of human activities;

[0013] S2, preprocessing the time series data set obtained in step S1 to obtain a data set of the residual shrinkage network;

[0014] S3, initialize the residual shrinkage network;

[0015] S4, inputting the data set obtained in step S2 into the residual shrinkage network and training it to obtain a residual shrinkage network with optimized weights;

[0016] S5. Deploy the weight-optimized residual shrinkage network obtained in step S4 to the smart wearable device that needs to recognize human activities, so as to complete the recognition of human activities.

[0017] Furthermore, in S1, the time series data set of human activities obtained includes data collected from no less than three wearable sensors, including data collected by accelerometer, gyroscope and magnetometer sensors, and the collected data include time series data types of at least six human daily activities such as walking, jogging, going upstairs, going downstairs, sitting and standing.

[0018] Furthermore, in S2, the data set is preprocessed as follows: first, a low-pass filter is used to filter high-frequency noise, abnormal data is removed, and the missing data is supplemented by a polynomial interpolation method; then, all data are divided using a sliding window method, specifically: the number of data channels is set to the dimension of the data collected by the sensor, and L (L>0) is set to represent the size of the sliding window. The data set is divided according to the number of data channels and the size of the sliding window, where the data of a window is: x = [x 1 ,x 2 ,...,x n ,...,x N ], N is the number of data channels, x n It is the data of the nth (1≤n≤N) channel, with a length of L.

[0019] Further, in S3, the residual shrinkage network is initialized to initialize the weights of the convolutional layer, GRU network, and fully connected layer in the network;

[0020] The initialization of the convolutional layer and the fully connected layer is: for each weight, randomly sample from a uniform distribution in the range of (-b, b), where b is determined by g is the gain of the activation function, f i is the number of input channels of the layer, i.e., the input dimension;

[0021] The GRU network is initialized by randomly selecting numbers from the range (-s, s) using the uniform distribution method, where s is determined as follows:

[0022]

[0023] In the formula, h s is the hidden state size in the GRU layer.

[0024] Further, in S4, the method of inputting the data set into the residual shrinkage network and training it includes the following steps:

[0025] S401, dividing the data set into a training set and a test set in proportion, and initializing the training counter to 0;

[0026] S402, the accuracy counter is initialized to 0;

[0027] S403, inputting the training set into the convolutional network layer of the residual shrinkage network to extract preliminary features of human activities;

[0028] S404, inputting the preliminary features of the human activity obtained in step S403 into the first residual shrinkage layer to extract the deep features of the human activity;

[0029] S405, adding the preliminary features of the human activity extracted in step S403 and the deep features of the human activity extracted in step S404 to obtain aggregated features;

[0030] S406, inputting the aggregated features obtained in step S405 into the second residual shrinkage layer to extract complex features of human activities;

[0031] S407, adding the aggregated features obtained in step S405 and the complex features extracted in step S406 to obtain aggregated complex features;

[0032] S408, inputting the aggregated complex features obtained in step S407 into the classification network layer of the residual shrinkage network to obtain the recognition result of the training set;

[0033] S409, calculating the loss rate according to the recognition result obtained in step S408;

[0034] S410, updating the weight of the residual shrinkage network according to the loss rate calculated in step S409;

[0035] S411, input the test set in step S401 into the residual shrinkage network after the weight update in step S410, perform verification and tuning, and obtain the accuracy of the test set;

[0036] S412, determine whether the accuracy of the test set in S411 is greater than or equal to the accuracy threshold; if so, jump to step S415; if not, go to step S413;

[0037] S413, training counter plus 1;

[0038] S414, determining whether the value of the training counter is greater than or equal to the threshold of the training calculator; if so, jumping to step S417; if not, returning to step S402;

[0039] S415, the accuracy counter is increased by 1;

[0040] S416, determine whether the value of the accuracy counter is equal to the threshold of the accuracy counter; if so, go to step S417; if not, return to step S403;

[0041] S417: The latest weight-updated residual shrinkage network is determined as the weight-optimized residual shrinkage network, and the training process ends.

[0042] Further, in S403, the method for extracting preliminary features of human activities is: inputting the training set data into a convolution layer with a convolution kernel size of M (M>0), and the convolution layer slides the convolution kernel on the input data, and the weight of the convolution kernel is multiplied by the input data point by point to obtain preliminary features;

[0043] In S404, the method for extracting the deep features of human activities is: inputting the preliminary features obtained in step S403 into the GRU network to obtain the time features;

[0044] The temporal features are input to the dilated convolution layer and the following operations are performed: the convolution kernel slides over the input data at a specific dilation rate to obtain multi-scale features; the dilation rate is the spacing between the values ​​when the convolution kernel processes the data;

[0045] The multi-scale features are input into the pooling compression layer in the channel attention threshold self-learning layer. The pooling compression layer compresses the multi-scale features using global average pooling, and then the compressed features are input into the fully connected layer for threshold self-learning to obtain the threshold of each channel. The expression of threshold self-learning is:

[0046] τ=α*Avg|z|

[0047] In the formula, α is given by the formula α=σ(w 2 (ReLU(w 1 (|z|)))) is determined, σ is the sigmoid function, w 1 、w 2 are the weights of fully connected layers 1 and 2 respectively, and z is given by Sure;

[0048] The multi-scale features after the threshold and the hole convolution layer are input into the soft thresholding layer and processed according to the formula y=sign(x)*max((|x|-τ),0)) to obtain the deep features of human activities, where sign(.) is the sign function and max(.) is the maximum value function;

[0049] In step S406, the method of extracting the complex features of human activities is the same as the method in step S403;

[0050] In S408, the method for obtaining the recognition result of the training set is as follows: the complex features are input into the feature fusion layer in the classification network layer for feature fusion, the pooling compression layer in the feature fusion layer extracts features using global average pooling and global maximum pooling and inputs them into the fusion layer, and according to formula f t =Concat(GAP(x i ),GMP(x i )) Perform fusion and splicing to obtain fusion features;

[0051] Input the fused features into the fully connected network layer, and the processing process of the fully connected network layer is the same as the processing process of the fully connected layer in step S403;

[0052] The features output by the fully connected layer are input to the activation layer. The activation layer uses the formula Determine the probability of human activity type; where P(yi ) is the probability that the current activity is the i-th type of activity, h i is the output score of the i-th neuron in the fully connected layer, and C is the sum of the activity categories in the dataset;

[0053] In S409, the loss rate is calculated by comparing the probability of each type of activity output by the residual shrinkage network with the true value using a cross entropy loss function to obtain a loss;

[0054] In S410, the method for updating the weight of the residual shrinkage network is: taking a partial derivative of the weight of a layer of the network according to the loss to obtain a back propagation error, and then updating the weight according to the back propagation error and the learning rate of the residual shrinkage network.

[0055] Further, in S5, the smart wearable device includes an electronic device with accelerometer, gyroscope and magnetometer sensors and the ability to run deep learning models.

[0056] The beneficial effects of the technical solution are:

[0057] The present invention provides a method for human activity recognition based on a residual shrinkage network. The constructed residual shrinkage network structure fully considers the multi-layer correlation of data generated by human activities. The model extracts multiple time scale time dependencies in activity data through a GRU network and a dilated convolution layer; uses a channel attention mechanism to enhance useful features and suppress irrelevant features and performs shrinkage processing through a soft threshold layer; and performs feature mapping with a classification network layer. This method can achieve a high recognition accuracy rate and a low computational cost, and can be deployed on resource-constrained hardware.

[0058] Among them, the convolutional layer and residual shrinkage layer in the residual shrinkage network structure can effectively extract the features of the input data, which helps to improve the recognition accuracy of human activities;

[0059] The introduction of the channel attention threshold self-learning layer can automatically learn channel attention according to the characteristics of the input data, further improving the network's attention to important features;

[0060] By training the data set, the network can adapt to different human activity recognition tasks by optimizing weights and improving the classification performance of the network;

[0061] The trained residual shrinkage network can be deployed in smart wearable devices to provide users with real-time human activity recognition services, which is convenient and practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A flowchart of a human activity recognition method based on a residual shrinkage network according to the present invention;

[0063] Figure 2 A structural diagram of a neural network model in an embodiment of the present invention;

[0064] Figure 3 Flow chart of residual shrinkage network training in an embodiment of the present invention;

[0065] Figure 4 It is a principle diagram of multi-time scale feature extraction in an embodiment of the present invention;

[0066] Figure 5 This is a schematic diagram of the principle of self-learning of the channel attention mechanism threshold in an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments:

[0068] like Figure 1 As shown, a human activity recognition method based on residual shrinkage network includes the following steps:

[0069] S1. Recruit 5 volunteers, each wearing a WT9011G4K 9-axis attitude sensor on the left wrist. The volunteers perform multiple sets of actions and record the sensor data of each set of actions; the actions include walking, jogging, going upstairs, going downstairs, sitting and standing; the sensor records data from a total of 9 data channels including 3-axis acceleration, 3-axis gyroscope and 3-axis magnetic field at a sampling frequency of 20Hz;

[0070] S2. Apply a low-pass filter to remove high-frequency noise in the sensor data to retain the main motion signal. For possible missing values, use the polynomial interpolation method to estimate and fill in the missing data points based on the trend of the existing data to maintain the integrity of the data. Finally, use a sliding window with a length of 60 and a step size of 30 to segment the sensor data. The segmented data is: x = [x 1 ,x 2 ,...,x 9 ];

[0071] S3 and the residual shrinkage network weight initialization methods are all random sampling from uniform distribution; among them, the intervals of convolutional network layers and fully connected network layers are Where g is the gain value, f i is the input dimension;

[0072] The gain of the fully connected layer, the Sigmoid activation function in the fully connected network layer, and the convolutional layer in the convolutional network layer is 1, and the gain of the ReLU activation function is

[0073] The interval of the GRU network is (-s, s), and the calculation method of s is:

[0074]

[0075] In the formula, h s is the hidden state size in the GRU layer;

[0076] S4, such as Figure 2 As shown, the residual shrinkage network structure includes a convolutional network layer, two residual shrinkage layers and a classification network layer;

[0077] The convolutional network layer includes convolution layer, normalization layer and activation layer;

[0078] The two residual shrinkage layers have similar network structures. Any residual shrinkage layer includes a gated recurrent unit network, two hole convolution layers, a channel attention threshold self-learning layer and a soft thresholding layer. Among them, the two hole convolution layers have similar structures. Any hole convolution layer includes a normalization layer and an activation layer. The channel attention threshold self-learning layer includes two fully connected layers, a normalization layer and an activation layer. The soft thresholding layer includes a soft threshold function.

[0079] The classification network layer includes a feature fusion layer, a fully connected network layer, and an activation layer; the feature fusion layer includes a global average pooling, a global maximum pooling, and a fusion layer; the fully connected network layer includes two fully connected layers and a normalization layer;

[0080] The training process is as follows Figure 3 As shown;

[0081] S401: Divide the data set processed in step S3 into a training set and a test set in a ratio of 7:3, and initialize the training counter to 0;

[0082] S402: Initialize the accuracy counter to 0;

[0083] S403: The convolutional network layer of the residual shrinkage network inputted into the training set extracts preliminary features of human activities; specifically, the convolutional layer in the convolutional network layer slides a convolution kernel of length 5 on the input data, and the corresponding weights of the convolution kernel are multiplied point by point with the input data to obtain a new feature sequence.

[0084] The new feature sequence is normalized and processed by the ReLU activation function through the normalization layer and activation layer respectively, so as to obtain the preliminary features of human activities;

[0085] S404: Input the preliminary features of human activities into the first residual contraction layer to extract the deep features of human activities; specifically, the preliminary features are first extracted through the GRU network to extract the temporal dependency, and the GRU controls the forgetting and memory of feature information through the gating mechanism, specifically y t =(1-z t )*h t '+zt *x t , where y t is the output of the current time step, z t is the update gate, which determines whether the new input information should be added to the output of the current time step. t ' is the candidate hidden state, which is the candidate output of the current time step, x t Preliminary features for the current time step input;

[0086] The above features are input into the dilated convolution layer to extract multi-scale features. Specifically, the first dilated convolution layer uses the hyperparameters of convolution kernel size 2 and dilation rate 2 to extract features, and then undergoes normalization and ReLU activation. Then, it is input into the second dilated convolution layer. The second dilated convolution layer uses the hyperparameters of convolution kernel size 3 and dilation rate 4 to extract features, and then undergoes normalization and ReLU activation to obtain the final multi-scale features. The principle is as follows: Figure 4 As shown in the figure, when the convolution kernel size is 3, the step size is 1, there is no zero filling, and the void rate is (2, 4), the feature data of each layer contains the data information of the previous layers, and changes with the void rate and the convolution kernel. The multi-scale feature extraction is controlled by controlling the void rate and the convolution kernel size of each layer; the mathematical expression of this control process of the amount of information contained in each layer of the previous layers is:

[0087]

[0088] In the formula, r i The current layer contains the information of the previous layer, r i-1 is the previous layer information, s n-1 is the convolution step size of each layer, d is the dilation rate, and k is the convolution kernel size;

[0089] The multi-scale features are input into the channel attention threshold self-learning layer to learn the threshold of each data channel; specifically, the fully connected network layer in the channel attention threshold self-learning layer is an improved SENet network, the principle is as follows Figure 5 As shown in the figure, the input feature sequence is compressed by global average pooling for subsequent weight calculation, and then passed to the first fully connected layer to learn the importance weight of each data channel and perform normalization and activation processing. Then, it is input to the second fully connected layer to continue learning and the output of the fully connected layer is mapped to between 0 and 1 through the sigmoid activation function to obtain the final importance weight α of each channel; finally, the above compressed multi-scale features are averaged for each data channel using the average function to obtain an average value, and then the value is multiplied by α to obtain the final threshold. The mathematical expression of this process is:

[0090]

[0091] α=σ(w 2 (ReLU(w 1 (|z|))))

[0092] τ=α*Avg|z|

[0093] Where σ is the sigmoid function, w 1 ,w 2 are the weights of fully connected layers 1 and 2 respectively;

[0094] The above thresholds and multi-scale features are input into the soft thresholding layer to obtain the deep features of human activities. The mathematical expression of this process is: y = sign (x) * max ((|x|-τ), 0)), in order to remove redundant features in the feature sequence, enhance useful features and suppress irrelevant features;

[0095] S405: Add the preliminary features of human activity extracted in step S403 and the deep features of human activity extracted in step S404 to obtain aggregated features; this is a characteristic of the residual network, which prevents the gradient from disappearing; that is, when the feature output by step S404 is 0, the feature of S403 still exists and can continue to be input to the next layer for learning;

[0096] S406: inputting the aggregated features into the second residual shrinkage layer to extract complex features of human activities. This process is similar to step S403;

[0097] S407: Add the aggregated features of step S405 and the complex features of step S406 to obtain aggregated complex features;

[0098] S408: Input the aggregated complex features into the classification network layer of the residual shrinkage network to obtain the recognition result of the training set; specifically, input the above complex features into the feature fusion layer in the classification network layer for feature fusion, and the pooling compression layer in the feature fusion layer uses global average pooling (GAP) and global maximum pooling (GMP) to compress the features and input them into the fusion layer for fusion and splicing: t =Concat(GAP(x i ),GMP(x i ));

[0099] Input the fused features into the fully connected network layer, and the processing flow of the fully connected network layer is similar to the processing flow of the fully connected layer in step S403;

[0100] The features output by the fully connected layer are input to the final activation layer, which uses the Softmax function to output the probability of various activities:

[0101]

[0102] In the formula, P(y i ) is the probability that the current activity is i, h i is the output score of the i-th neuron in the fully connected layer, and the sum in the denominator is the sum of the scores of all categories;

[0103] S409: Calculate the loss rate according to the recognition result; specifically, use the cross entropy loss function to compare the output probability of each type of activity with the true value, and the mathematical expression is:

[0104]

[0105] In the formula, p is the probability predicted by the model, and y is the true label, which is 0 or 1;

[0106] S410: Update the weight of the residual shrinkage network according to the loss rate; specifically, take the partial derivative of the loss value L calculated above with respect to the weight of each layer to obtain the error value of back propagation, and then update the weight by the error value. The mathematical expression of this process is:

[0107]

[0108] Where η is the learning rate of the residual shrinkage network, which is set to 0.001, and w represents the old weight;

[0109] S411: input the test set in step S401 into the residual shrinkage network after weight update, perform verification and tuning, and obtain the accuracy of the test set;

[0110] S412: Determine whether the accuracy of the test set is not less than the accuracy threshold; if so, jump to step S415; if not, go to step S413; specifically, the accuracy threshold of the test set is set to 97%;

[0111] S413: training counter is incremented by 1;

[0112] S414: Determine whether the value of the training counter is greater than or equal to the threshold of the training counter; if so, jump to step S417 and the training ends; if not, return to step S402 and continue training; specifically, the training counter threshold is set to 100;

[0113] S415: The accuracy counter is incremented by 1.

[0114] S416: Determine whether the value of the accuracy counter is equal to the threshold of the accuracy counter; if so, jump to step S417 and the training ends; if not, return to step S402 and continue training; specifically, the threshold of the accuracy counter is set to 10;

[0115] S417: Determine the latest weight-updated residual shrinkage network as the weight-optimized residual shrinkage network, and the training process ends;

[0116] S5. Deploy the weight-optimized residual shrinkage network to wearable devices that need to recognize human activities; specifically, save and convert the trained model into .ONNX format, which is suitable for various platforms and is an open cross-platform deep learning model representation format; wearable devices include but are not limited to smart wearable devices with accelerometers, gyroscopes, and magnetometers.

[0117] Among them, the convolutions in this embodiment are all 1D convolutions, and the number of convolution kernels in the training process is the same, that is, the input and output data channels are the same, both 70.

[0118] The above is only an embodiment of the present invention, and the common knowledge such as the known specific technical solutions or characteristics in the solution is not described in detail here. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the technical solution of the present invention, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A human activity recognition method based on residual shrinkage network, characterized in that: The human activity recognition method comprises a residual shrinkage network for human activity recognition, wherein the residual shrinkage network comprises a convolutional network layer, two adjacent residual shrinkage layers and a classification network layer; The convolutional network layer includes a convolutional layer, a normalization layer and an activation layer; Any of the residual shrinkage layers includes a gated recurrent unit network, two hole convolution layers, a channel attention threshold self-learning layer and a soft thresholding layer; wherein any of the hole convolution layers includes a normalization layer and an activation layer; the channel attention threshold self-learning layer includes a pooling compression layer, two fully connected layers, a normalization layer and an activation layer; The classification network layer includes a feature fusion layer, a fully connected network layer and an activation layer; the feature fusion layer includes a pooling compression layer and a fusion layer; the fully connected network layer includes two fully connected layers and a normalization layer; The human activity recognition method further comprises the following steps: S1. Obtain a time series dataset of human activities; S2, preprocessing the time series data set obtained in step S1 to obtain a data set of the residual shrinkage network; S3, initialize the residual shrinkage network; S4, inputting the data set obtained in step S2 into the residual shrinkage network and training it to obtain a residual shrinkage network with optimized weights; S5. Deploy the weight-optimized residual shrinkage network obtained in step S4 to the smart wearable device that needs to recognize human activities, so as to complete the recognition of human activities.

2. According to the method of human activity recognition based on residual shrinkage network in claim 1, it is characterized in that: In S1, the time series data set of human activities includes data collected by no less than three wearable sensors, including data collected by accelerometer, gyroscope and magnetometer sensors. The collected data include time series data types of at least six human daily activities such as walking, jogging, going upstairs, going downstairs, sitting and standing.

3. According to the method of human activity recognition based on residual shrinkage network in claim 1, it is characterized in that: In S2, the data set is preprocessed as follows: first, a low-pass filter is used to filter high-frequency noise, abnormal data is removed, and the missing data is supplemented by a polynomial interpolation method; then the sliding window method is used to divide all the data, specifically: the number of data channels is set to the dimension of the data collected by the sensor, let L represent the size of the sliding window, L>0, and the data set is divided according to the number of data channels and the size of the sliding window, where the data of a window is: x=[x1,x2,...,x n ,...,x N ], N is the number of data channels, x n is the data of the nth channel, 1≤n≤N, and its length is L.

4. The method for human activity recognition based on residual shrinkage network according to claim 1, characterized in that: In S3, the residual shrinkage network is initialized to initialize the weights of the convolutional layer, GRU network, and fully connected layer in the network; The initialization of the convolutional layer and the fully connected layer is: for each weight, randomly sample from a uniform distribution in the range of (-b, b), where b is determined by g is the gain of the activation function, f i is the number of input channels of the layer, i.e., the input dimension; The GRU network is initialized by randomly selecting numbers from the range (-s, s) using the uniform distribution method, where s is determined as follows: In the formula, h s is the hidden state size in the GRU layer.

5. The method for human activity recognition based on residual shrinkage network according to claim 1, characterized in that: In S4, the method of inputting the data set into the residual shrinkage network and training the residual shrinkage network includes the following steps: S401, dividing the data set into a training set and a test set in proportion, and initializing the training counter to 0; S402, the accuracy counter is initialized to 0; S403, inputting the training set into the convolutional network layer of the residual shrinkage network to extract preliminary features of human activities; S404, inputting the preliminary features of the human activity obtained in step S403 into the first residual shrinkage layer to extract the deep features of the human activity; S405, adding the preliminary features of the human activity extracted in step S403 and the deep features of the human activity extracted in step S404 to obtain aggregated features; S406, inputting the aggregated features obtained in step S405 into the second residual shrinkage layer to extract complex features of human activities; S407, adding the aggregated features obtained in step S405 and the complex features extracted in step S406 to obtain aggregated complex features; S408, inputting the aggregated complex features obtained in step S407 into the classification network layer of the residual shrinkage network to obtain the recognition result of the training set; S409, calculating the loss rate according to the recognition result obtained in step S408; S410, updating the weight of the residual shrinkage network according to the loss rate calculated in step S409; S411, input the test set in step S401 into the residual shrinkage network after the weight update in step S410, perform verification and tuning, and obtain the accuracy of the test set; S412, determine whether the accuracy of the test set in S411 is greater than or equal to the accuracy threshold; if so, jump to step S415; if not, go to step S413; S413, training counter plus 1; S414, determining whether the value of the training counter is greater than or equal to the threshold of the training calculator; if so, jumping to step S417; if not, returning to step S402; S415, the accuracy counter is increased by 1; S416, determine whether the value of the accuracy counter is equal to the threshold of the accuracy counter; if so, go to step S417; if not, return to step S403; S417: The latest weight-updated residual shrinkage network is determined as the weight-optimized residual shrinkage network, and the training process ends.

6. The method for human activity recognition based on residual shrinkage network according to claim 5, characterized in that: In S403, the method for extracting preliminary features of human activities is: inputting the training set data into a convolution layer with a convolution kernel size of M, where M>0, and the convolution layer obtains preliminary features by sliding the convolution kernel on the input data and multiplying the weight of the convolution kernel by the input data point by point; In S404, the method for extracting the deep features of human activities is: inputting the preliminary features obtained in step S403 into the GRU network to obtain the time features; The temporal features are input to the dilated convolution layer and the following operations are performed: the convolution kernel slides over the input data at a specific dilation rate to obtain multi-scale features; the dilation rate is the spacing between the values ​​when the convolution kernel processes the data; The multi-scale features are input into the pooling compression layer in the channel attention threshold self-learning layer. The pooling compression layer compresses the multi-scale features using global average pooling, and then the compressed features are input into the fully connected layer for threshold self-learning to obtain the threshold of each channel. The expression of threshold self-learning is: τ=α*Avg|z| Where α is determined by α = σ(w2(ReLU(w1(|z|)))), σ is the sigmoid function, w1 and w2 are the weights of fully connected layers 1 and 2 respectively, and z is given by Sure; The multi-scale features after the threshold and the hole convolution layer are input into the soft thresholding layer and processed according to the formula y=sign(x)*max((|x|-τ),0)) to obtain the deep features of human activities, where sign(.) is the sign function and max(.) is the maximum value function; In step S406, the method of extracting complex features of human activities is the same as the method in step S403; In S408, the method for obtaining the recognition result of the training set is as follows: the complex features are input into the feature fusion layer in the classification network layer for feature fusion, the pooling compression layer in the feature fusion layer extracts features using global average pooling and global maximum pooling and inputs them into the fusion layer, and according to formula f t =Concat(GAP(x i ),GMP(x i )) Perform fusion and splicing to obtain fusion features; Input the fused features into the fully connected network layer, and the processing process of the fully connected network layer is the same as the processing process of the fully connected layer in step S403; The features output by the fully connected layer are input to the activation layer. The activation layer uses the formula Determine the probability of human activity type; where P(y i ) is the probability that the current activity is the i-th type of activity, h i is the output score of the i-th neuron in the fully connected layer, and C is the sum of the activity categories in the dataset; In S409, the loss rate is calculated by comparing the probability of each type of activity output by the residual shrinkage network with the true value using a cross entropy loss function to obtain a loss; In S410, the method for updating the weight of the residual shrinkage network is: taking a partial derivative of the weight of a layer of the network according to the loss to obtain a back propagation error, and then updating the weight according to the back propagation error and the learning rate of the residual shrinkage network.

7. The method for human activity recognition based on residual shrinkage network according to claim 1, characterized in that: In the S5, the smart wearable device includes electronics with accelerometer, gyroscope and magnetometer sensors and the ability to run deep learning models.

Citation Information

Patent Citations

  • Convolutional neural network activity identification method based on decoupling training

    CN115329800A

  • Behavior recognition technical method based on deep learning

    CN110188637A

  • Video-based human behavior network model and recognition method

    CN112949460A

  • Parkinson's disease early warning method based on human body posture estimation

    CN114783065A

  • Radio frequency fingerprint unsupervised blind identification method based on deep contrast learning

    CN116502061A