Human behavior identification method based on multilevel signal feature constraint
By adopting a multi-level signal feature constraint method in human behavior recognition to extract and weight trend, seasonal and universal signal features in the sliding window, the problem of reduced recognition accuracy caused by inconsistent sensor data distribution is solved and behavior recognition is improved. accuracy and stability.
Patent Information
- Application Number
- CN202410752835.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-27
AI Technical Summary
When existing sensor-based human behavior recognition methods face data from different age groups and scenarios, the distribution of the training set and the test set does not comply with the assumption of independent and identical distribution, resulting in a decrease in the accuracy of the model's recognition of novel and unobserved data. Especially when the data of the elderly are scarce, the accuracy of young people's data is not ideal when replacing learning.
Using a method based on multi-level signal feature constraints, by dividing each person's wearable sensor data into multiple sliding windows, the trend, seasonality and universal signal features are extracted, and combined with the statistical features of the sliding window, through weighted prediction The probability of human behavior reduces the impact of recognition accuracy.
It improves the accuracy and prediction stability of human behavior recognition, reduces the impact of sensor data differences on recognition, and is suitable for behavior recognition in complex living environments.
Smart Images

Figure CN118709072A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and in particular to a method and device for human behavior recognition based on multi-level signal feature constraints. Background Art
[0002] Human Activity Recognition (HAR) is a research hotspot in the field of machine learning and pattern recognition. Its goal is to classify the activities performed by participants through machine learning (ML) algorithms. It has been widely used in medical diagnosis monitoring, human-computer interaction, identity recognition and other fields. Compared with video- or image-based HAR, sensor-based HAR has more advantages in terms of cost and privacy. Traditional ML-based HAR methods such as support vector machines and K-nearest neighbors usually focus on feature engineering and need to be redesigned when the recognition task changes. In recent years, deep learning methods such as convolutional neural networks, long short-term memory units and transformers can achieve higher prediction accuracy and gradually become the main methods for HAR tasks. These models work well when the training and test data have similar or overlapping data distributions, which is achieved by dividing the data of each participant into a training set and a test set.
[0003] However, this approach has proven to be impractical in real-world scenarios, giving rise to a more practical alternative, cross-domain HAR, which requires isolating data based on different volunteers. Specifically, in sensor-based cross-domain HAR, sensor data exhibits variations in age, scenarios, and so on, and the distributions of the training and test sets do not conform to the assumption of independent and identical distribution (IID). For example, in the task of fall detection, data from the elderly is difficult to collect, and it is often necessary to use data from young people instead for model learning, while there are certain differences in behavioral data between the elderly and young people. In the application of human activity recognition tasks, the data of the training set comes from a controlled laboratory environment, while the data of the test set comes from a random living environment. For the above models, when faced with data from novel and unobserved subjects, the accuracy of the model in recognizing human behavior decreases significantly. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a human behavior recognition method based on multi-level signal feature constraints to solve or partially solve the problem that it is difficult to extract common human behaviors and the accuracy of behavior recognition is not ideal.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] One aspect of the present invention provides a method for human behavior recognition based on multi-level signal feature constraints, comprising the following steps:
[0007] Obtain a data set including wearable sensor data of multiple persons, regard the wearable sensor data of each person as a field, and divide the wearable sensor data in the field into multiple sliding windows;
[0008] For each sliding window in each field, extract the feature vector of the sliding window and decompose it into trend signal features, seasonal signal features and universal signal features through feature decomposition;
[0009] Based on the trend signal features, seasonal signal features and universal signal features, combined with the statistical characteristics of the sliding window, the predicted values of the three types of signal features are obtained respectively, and the predicted probability of each behavior is obtained by weighting to realize human behavior recognition.
[0010] As a preferred technical solution, the process of extracting the feature vector of the sliding window includes the following steps:
[0011] The sliding window is normalized and input into the two-dimensional convolutional layer to obtain the feature vector.
[0012] As a preferred technical solution, the process of obtaining trend signal features through feature decomposition is implemented by the following formula:
[0013]
[0014] Among them, θ t is the polynomial coefficient matrix representing the characteristic constraints of the trend signal, is the feature vector of the kth sliding window in the ith domain, p is the power of the polynomial, L represents the time step length, θ ′ t Represents the trend signal characteristics obtained through feature decomposition.
[0015] As a preferred technical solution, the process of obtaining seasonal signal characteristics through feature decomposition is implemented by the following formula:
[0016]
[0017] Among them, θ s The Fourier coefficient matrix representing the characteristics of the seasonal signal, is the feature vector of the kth sliding window in the ith domain, p is the power of the polynomial, L represents the time step length, θ s ' represents the seasonal signal characteristics obtained by feature decomposition.
[0018] As a preferred technical solution, the process of obtaining universal signal features through feature decomposition is implemented by the following formula:
[0019]
[0020] Among them, θ g The fully connected layer coefficient matrix representing the general signal features, is the feature vector of the kth sliding window in the ith domain, θ g ' represents the universal signal features obtained by feature decomposition.
[0021] As a preferred technical solution, after obtaining trend signal features, seasonal signal features and universal signal features through feature decomposition, the following steps are also included:
[0022] The trend signal features, seasonal signal features and universal signal features obtained by feature decomposition are denoised and clamped respectively to obtain the constraint signal, and the constraint signal is removed from the sliding window.
[0023] As a preferred technical solution, the denoising and clamping of signal features are implemented using the following formula:
[0024]
[0025] Among them, w is the feature obtained by denormalizing the signal features obtained by feature decomposition. They represent the standard deviation, mean, minimum and maximum values of the kth sliding window in the ith field respectively, CLAMP() represents the clamping function, and w' represents the signal features obtained by feature decomposition, denoising and clamping.
[0026] As a preferred technical solution, the predicted values of the three types of signal features are obtained respectively, and the predicted probability of each behavior is obtained by weighting, and the process of realizing human behavior recognition is realized by the following formula:
[0027]
[0028] Predict=Softmax(α×Predict t +β×Predict s +γ×Predict g )
[0029] Among them, Predict x It represents the prediction vector obtained by concatenating the signal feature with the statistical feature of the sliding window through the fully connected layer MLP(). θ represents the signal feature obtained by feature decomposition. t, s, and g represent trend signal features, seasonal signal features, and universal signals, respectively. They represent the standard deviation, mean, minimum and maximum values of the kth sliding window in the ith domain respectively. α, β and γ are the trainable weight coefficients of the three prediction vectors and α+β+γ=1.
[0030] Another aspect of the present invention provides an electronic device, comprising: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned human behavior recognition method based on multi-level signal feature constraints.
[0031] Another aspect of the present invention provides a computer-readable storage medium comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned human behavior recognition method based on multi-level signal feature constraints.
[0032] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0033] (1) Reducing the impact of sensor data differences on recognition accuracy: The present invention treats each person's wearable sensor data as a field, divides the wearable sensor data in the field into multiple sliding windows, treats sliding windows from different fields differently, extracts trend signal features, seasonal signal features, and universal signal features of human behavior in different fields, and combines them with prediction results, thereby reducing the impact of different human sensor data differences on recognition accuracy.
[0034] (2) Ensuring prediction stability: The present invention extracts feature vectors from a sliding window, decomposes them into trend signal features, seasonal signal features, and universal signal features, and predicts the results separately. Multi-level prediction increases the prediction stability of the present invention in human behavior recognition.
[0035] (3) Improving the accuracy of behavior recognition: The present invention considers the linear combination of multi-level prediction results and assigns weights to the three levels in a fixed sum manner, corresponding to the objective fact that different constraint signals account for different proportions in complex living environments, thereby improving the accuracy of human behavior recognition.
[0036] (4) Analyzing differences in human behavior: The signal features of human behavior in different fields extracted by the present invention can be used for visualization. The visualization of signal features can be used to qualitatively judge the similarities of the same human behavior in different fields, as well as the differences between different human behaviors in the same field, thereby helping to analyze differences in human behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Flow chart of a method for human behavior recognition based on multi-level signal feature constraints in an embodiment.
[0038] Figure 2 It is a model flow chart of the human behavior recognition method based on multi-level signal feature constraints in the embodiment.
[0039] Figure 3 Graph showing the relationship between trainable parameters and loss function of the human behavior recognition method based on multi-level signal feature constraints in the embodiment. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0041] Example 1
[0042] In view of the difficulties existing in the above-mentioned prior art, this embodiment provides a human behavior recognition method based on multi-level signal feature constraints, see Figure 1 , the method comprises the following steps:
[0043] Step S1: Divide the public wearable sensor dataset by domain and divide it into sliding windows.
[0044] Several human volunteers in the public wearable sensor dataset are regarded as several domains, and it is assumed that the joint distribution of sensor data between any domains is different; then, the sensor data of each domain is further divided into several sliding windows of equal length.
[0045] Specifically, for a population of N human volunteers P = {P1, P2, ..., P N} data set is divided into N fields For any domain D i , each with T time steps of sensor data X i and human behavior label Y i , X i and Y i With the same time step, each sensor data has a human behavior label.
[0046] Step S2: For each sliding window, train the model based on the sensor data of all time steps. This step specifically includes the following sub-steps:
[0047] Step S201: For each sliding window in each field, vectorization is performed to obtain the hidden layer features of the sliding window.
[0048] Sliding window is denoted as and They represent the kth sliding window of the ith domain and the human behavior label corresponding to the sliding window, respectively, where M represents the total number of sliding windows divided by the ith domain, that is, k = 1, 2, …, M, L is the number of time steps contained in the sliding windows of all domains, and S is the number of sensor features of each sliding window; the sliding window and the human behavior label corresponding to the sliding window are the basic data units input into the model for human behavior recognition.
[0049] In this step, the detailed process of vectorization of the sliding window is as follows: First, extract the maximum value of the sliding window Minimum Mean and standard deviation (i.e., the statistical characteristics of the sliding window) and standardize the sliding window.
[0050]
[0051] Then the sliding window Input to the two-dimensional convolutional layer to obtain the hidden layer features The calculation formula is:
[0052]
[0053] Among them, L×dimension is the final hidden layer feature The dimension of (hidden) is the number of hidden feature maps of the two-dimensional convolution Conv2D.
[0054] Step S202: For hidden layer features, the features are decomposed into constraint signals with trend, seasonality, and universality in turn through the polynomial coefficient matrix, Fourier coefficient matrix, and fully connected layer coefficient matrix in a multi-level structure. In this process, the constraint signal and the semantic information of the sliding window are continuously unified, and the constraint signal is continuously removed from the sliding window. Specifically, this step includes the following sub-steps:
[0055] Step S2021: Before implementing the multi-level signal feature constraints, define the time vector t, which is expressed as:
[0056]
[0057] t is the time vector, representing the time from 0 to The time step of the moment (the time step starts at 1 by default, but for classification, it is assumed that there is a time step 0 before time step 1). It is used to predict the human behavior label corresponding to time steps 1 to L. The denominator L in t represents the averaging of the time step length, so that the numerical range of the time vector t is not affected by the time step length.
[0058] Step S2022: The expression of the trend signal feature constraint is:
[0059] θ t (P×L)=[1,t,…,t p ]
[0060]
[0061] The trend signal feature indicates that the signal rises or falls with the increase of time steps. t is the polynomial coefficient matrix representing the characteristic constraints of the trend signal, and the P×L in the brackets represents θ t The shape of the matrix is is the hidden layer feature generated by the Conv2D convolution layer, p is the power of the polynomial. When the value of p is very low, the calculation formula will tend to obtain the trend feature θ of the hidden layer feature. t '. The coefficient matrix is right-multiplied by the hidden layer features to obtain the trend constraint signal.
[0062] Step S2023: The expression of seasonal signal characteristic constraint is:
[0063]
[0064] The seasonal signal characteristic indicates that the signal has regular fluctuation characteristics as the time step increases. s The Fourier coefficient matrix representing the seasonal signal features has a shape of L×L, which means that each step in the hidden layer features with a time step length of L is constrained to be a seasonal signal feature in the form of a Fourier series, so after the constraint, the matrix has a total of L×L items. The coefficient matrix is right-multiplied by the hidden layer features to obtain the seasonal constraint signal.
[0065] Step S2024: The expression of the universal signal characteristic constraint is:
[0066]
[0067] The universal signal feature represents the irregular fluctuation characteristics of the signal. g The fully connected layer coefficient matrix representing the general signal features is randomly initialized, and its training method is explained in step S303. By repeatedly training the coefficients, the signal feature residuals that do not have trend signal features and seasonal signal features are extracted.
[0068] Step S2025: The process of unifying the semantic information of the constraint signal and the sliding window is expressed as:
[0069]
[0070] w t is the constraint signal obtained after the trend feature is denormalized, w t 'It's t The signal obtained by signal clamping CLAMP. Seasonal characteristics w s ' and universal characteristics w g The calculation method of ' is similar.
[0071] When the sliding window is input into the model, statistical features are extracted: the maximum value Minimum Mean and standard deviation And the data was standardized. First, the trend constraint signal θ t 'The denormalization is performed to a certain data range by the mean and standard deviation, in order to keep the data range of the sliding window and the constraint signal feature consistent, thereby unifying the semantic information of the two. Then, the denormalized trend feature w is clamped by CLAMP. t Limited to range Range, get the trend feature w after denoising t '. The purpose of clamping is to remove the signal noise after the trend signal is convolved and denormalized. The noise is manifested as the signal value exceeding the minimum and maximum values of the sliding window. The values less than the minimum or greater than the maximum will be clamped to the minimum and maximum values. and The purpose of the smoothing process for signal denoising is to smooth the fluctuations caused by the original data acquisition, so the denoising requirements are relaxed in the model.
[0072] Step S2026: continuously remove constraint signals from the sliding window, expressed as:
[0073]
[0074] w t '、w s '、w g 'represent the constraint signals obtained by unifying the trend feature, seasonal feature, and universal feature through semantic information. Figure 2 As shown in the figure, the model is a serial constraint signal. The field will be extracted through trend feature, seasonal feature, and universal feature extraction modules respectively. After obtaining the trend constraint signal feature, it is spliced with the statistical features of the sliding window, and then the prediction result Predict corresponding to the feature is obtained through the fully connected layer. t; Then, denoising and clamping operations are performed on the trend constraint signal features and the sliding window to obtain a refined sliding window as the input of the next feature extraction module. This serial constraint signal method can avoid the coupling between different constraint signal features, which is conducive to strengthening the mutual independence of constraint signal features, thereby improving the accuracy of the model in predicting human behavior labels. For example, the sliding window The adjusted trend signal w will be subtracted t ', get the updated sliding window Similarly s ' and w g '.
[0075] Step S3: Based on the trained model, perform a classification task on each sliding window of the sensor data to be identified, obtain the human behavior prediction vector of each sliding window, and select the behavior with the highest prediction probability as the final prediction result.
[0076] Combine the three constraint signals with their respective statistical features as the final concatenated features, pass the three concatenated features through the model in turn to obtain prediction results, and linearly combine the three prediction results to obtain the model's prediction probability vector for all behaviors in each sliding window in each field. The sequence number where the maximum probability is located is the human behavior label of the model. This step includes the following sub-steps:
[0077] Step S301: Calculate the final concatenated features and obtain the predicted values through the three features respectively. The expressions are:
[0078]
[0079] Predict s and Preidct g The calculation method is similar to
[0080] Predict t After the trend signal and the statistical features of the sliding window are concatenated and passed through the fully connected layer, the sliding window is obtained. The purpose of splicing is to make the sliding window As many statistical features as possible are involved in prediction, rather than just using constraint features. s and Predict g The calculation method of is similar.
[0081] Step S302: The calculation formula for calculating the prediction result is:
[0082] Predict=α×Predict t +β×Predict s +γ×Predictg
[0083] Prediction probability = Softmax(Predict)
[0084] and i=1,2,…,C
[0085] α+β+γ=1
[0086] Predict is a linear combination of three prediction values, and its shape is (C), where C represents the number of human behaviors, and each number is the model's prediction value for the human behavior belonging to the sliding window; α, β, and γ are the trainable weighting coefficients of the three prediction vectors, and the sum of the three coefficients is 1 to ensure that the relative proportion of the predicted results remains unchanged; α, β, and γ are initialized at the beginning. It indicates that the importance of the three constraint signal features is the same, and is dynamically adjusted according to the importance of each prediction result during the training process. The weight coefficient is in the form of a fully connected network with an input dimension of 3, an output dimension of 1, and the sum of all weights is 1. Finally, the predicted probability of each behavior is obtained through the Softmax function, and the index of the value with the highest probability is taken as the sliding window. Corresponding human behavior labels.
[0087] Step S303: The model loss function and trainable parameter param are as follows:
[0088]
[0089] param←param-derivative
[0090] After obtaining the predicted value Predict of the model in step S302, the cross entropy is used as the loss function of the model. The loss function calculates the log value of Predict and the true label. Label represents the true label, and its shape is (C). C represents the number of human behaviors. For example, when the true label is 2, the second number in Label is 1, and the remaining C-1 numbers are all 0.
[0091] Figure 3 The relationship between the loss function and the trainable parameters is shown. When the loss function is calculated, the model will further optimize the trainable parameters. The solid line starts with the input and ends with the output. The dashed line only indicates that the two connected parts are related. This is because the sliding window is directly input into the trend constraint signal feature extraction module, while the seasonality and universality modules are only indirectly related to the initial sliding window, so they are represented by dashed lines. The model will calculate the derivative of each trainable parameter through the mechanism of automatic differentiation, thereby calculating θ g ,α,β,γThe values that need to be changed, The derivative calculation of is used to optimize the sliding window hidden vector representation, which is beneficial to the subsequent constraint signal feature extraction; g The derivative calculation of is used to optimize the feature representation of universal constraint signals and improve the feature extraction capability of universal new constraint signals; the derivative calculation of α, β, and γ is used to optimize the weighted sum of trend, seasonality, and universal newness, which is conducive to encouraging the model to pay attention to different modes of human behavior. For example, the model should attach importance to walking behaviors with strong seasonality, thereby increasing the weight β of the seasonal constraint signal prediction value.
[0092] The present invention has the following advantages:
[0093] (1) Aiming at the differences in sensor behaviors among different humans, the present invention divides the sensor data of different people into different fields, and divides each field into sliding windows of equal length. The model will treat sliding windows from different fields differently, extracting human behavior features in different fields and those that are not related to the field, thereby reducing the impact of differences in sensor data among different humans on recognition accuracy.
[0094] (2) The present invention introduces multi-level signal feature constraints, and obtains trend, seasonal, and universal constraint signals in the sliding window through constraint items, and obtains prediction results as features respectively. Multi-level prediction increases the prediction stability of the present invention in human behavior recognition;
[0095] (3) The present invention considers the linear combination of multi-level prediction results and assigns weights to the three levels by fixing the sum, which conforms to the objective fact that different constraint signals account for different proportions in complex living environments. In this way, the accuracy of human behavior recognition is improved.
[0096] Example 2
[0097] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the human behavior recognition method based on multi-level signal feature constraints as described in Example 1.
[0098] Example 3
[0099] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the human behavior recognition method based on multi-level signal feature constraints as described in Example 1.
[0100] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A human behavior recognition method based on multi-level signal feature constraints, characterized in that: The steps include: Obtain a data set including wearable sensor data of multiple persons, regard the wearable sensor data of each person as a field, and divide the wearable sensor data in the field into multiple sliding windows; For each sliding window in each field, extract the feature vector of the sliding window and decompose it into trend signal features, seasonal signal features and universal signal features through feature decomposition; Based on the trend signal features, seasonal signal features and universal signal features, combined with the statistical characteristics of the sliding window, the predicted values of the three types of signal features are obtained respectively, and the predicted probability of each behavior is obtained by weighting to realize human behavior recognition.
2. The method for human behavior recognition based on multi-level signal feature constraints according to claim 1, characterized in that: The process of extracting the feature vector of the sliding window includes the following steps: The sliding window is normalized and input into the two-dimensional convolutional layer to obtain the feature vector.
3. The method for human behavior recognition based on multi-level signal feature constraints according to claim 1 is characterized in that: The process of obtaining trend signal characteristics through feature decomposition is implemented by the following formula: Among them, θ t is the polynomial coefficient matrix representing the characteristic constraints of the trend signal, is the feature vector of the kth sliding window in the ith domain, p is the power of the polynomial, L represents the time step length, θ ′ t Represents the trend signal characteristics obtained through feature decomposition.
4. The method for human behavior recognition based on multi-level signal feature constraints according to claim 1 is characterized in that: The process of obtaining seasonal signal characteristics through feature decomposition is implemented as follows: Among them, θ s The Fourier coefficient matrix representing the characteristics of the seasonal signal, is the feature vector of the kth sliding window in the ith domain, p is the power of the polynomial, L represents the time step length, θ s ' represents the seasonal signal characteristics obtained by feature decomposition.
5. The method for human behavior recognition based on multi-level signal feature constraints according to claim 1 is characterized in that: The process of obtaining universal signal features through feature decomposition is implemented by the following formula: Among them, θ g The fully connected layer coefficient matrix representing the general signal features, is the feature vector of the kth sliding window in the ith domain, θ g ' represents the universal signal features obtained by feature decomposition.
6. The method for human behavior recognition based on multi-level signal feature constraints according to claim 1, characterized in that: After obtaining trend signal features, seasonal signal features and universal signal features through feature decomposition, the following steps are also included: The trend signal features, seasonal signal features and universal signal features obtained by feature decomposition are denoised and clamped respectively to obtain the constraint signal, and the constraint signal is removed from the sliding window.
7. The method for human behavior recognition based on multi-level signal feature constraints according to claim 6 is characterized in that: The denoising and clamping of signal features are achieved using the following formula: Among them, w is the feature obtained by denormalizing the signal features obtained by feature decomposition. They represent the standard deviation, mean, minimum and maximum values of the kth sliding window in the ith field respectively, CLAMP() represents the clamping function, and w' represents the signal features obtained by feature decomposition, denoising and clamping.
8. The method for human behavior recognition based on multi-level signal feature constraints according to claim 1, characterized in that: The predicted values of the three types of signal features are obtained respectively, and the predicted probability of each behavior is obtained by weighting. The process of realizing human behavior recognition is realized by the following formula: Predict=Softmax(α×Predict t +β×Predict s +γ×Predict g ) Among them, Predict x It represents the prediction vector obtained by concatenating the signal feature with the statistical feature of the sliding window through the fully connected layer MLP(). θ represents the signal feature obtained by feature decomposition. t, s, and g represent trend signal features, seasonal signal features, and universal signals, respectively. They represent the standard deviation, mean, minimum and maximum values of the kth sliding window in the ith domain respectively. α, β and γ are the trainable weight coefficients of the three prediction vectors and α+β+γ=1.
9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the human behavior recognition method based on multi-level signal feature constraints as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: It includes one or more programs executed by one or more processors of an electronic device, and the one or more programs include instructions for executing the human behavior recognition method based on multi-level signal feature constraints as described in any one of claims 1-8.
