Generalization performance optimization method, device and storage medium for human activity recognition system

By adopting generalization performance optimization method in WiFi-HAR system, and updating model parameters using the similarity of loss values ​​and gradients, the identification performance problems caused by data set imbalance and environmental diversity are solved, and the generalization ability of the model is significantly improved.

CN119337258BActive Publication Date: 2025-03-18UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411872777.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-18
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Existing WiFi-HAR systems face problems such as data set imbalance, environmental diversity and model training overhead, resulting in poor generalization performance when identifying human activities.

Method used

Through a generalization performance optimization method, the human activity recognition model is trained using the standard training method of the benchmark model, the loss value and gradient of each category are calculated, the network parameters are updated according to the gradient similarity, and the model parameters are updated by weighted merging of the planarized loss value and the original loss value until the network parameters converge stably.

Benefits of technology

It significantly improves the recognition performance and generalization capabilities of human activity recognition systems in WiFi environments, effectively alleviating the impact of long-tail data distribution and environmental changes on model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337258B_ABST
    Figure CN119337258B_ABST
Patent Text Reader

Abstract

The present invention discloses a generalization performance optimization method, device and storage medium for a human activity recognition system, and belongs to the field of human activity recognition. The method comprises: step 1, in the human activity recognition model training of the human activity recognition system, a benchmark model standard method is used to train the model to obtain temporary network parameters; step 2, human activity recognition is performed using the temporary network parameters, and the loss value of each category is calculated to obtain the respective gradients; step 3, a number of gradients with the highest similarity between the respective gradients and the average gradient are selected to update the network parameters; step 4, the model after updating the parameters is used to forward propagate the network input data to calculate the flattened loss value; step 5, the flattened loss value is weighted and combined with the original loss value into the final loss value to update the network parameters, and the parameter update of a round of training is completed, and each step is repeated to train to the optimized human activity recognition model. The method can improve the accuracy and stability of the human activity recognition model through the class region flattening solution strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of human activity recognition in smart homes and health monitoring, and in particular to a generalization performance optimization method for a human activity recognition system in a WiFi environment. Background Art

[0002] Driven by the rapid progress of the Internet of Things and machine learning, WiFi-based human activity recognition (HAR) technology has gradually become a research focus. By utilizing the temporal stability and frequency diversity of channel state information (CSI), this technology can capture the tiny WiFi signal changes caused by human activities, and analyze these processed signals through deep learning models to identify specific human activities. Currently, this method is favored because of its low hardware requirements and easy deployment.

[0003] In the process of human activity recognition based on WiFi, the WiFi signal emitted by the transmitter will change during the propagation process due to human movement, and these changes are reflected in the CSI value of the signal captured by the receiver. By denoising and reducing the dimension of these signals, a data set suitable for deep learning model input can be generated, so that the deep learning model can predict the corresponding human activities.

[0004] The deep learning model takes the processed CSI value as input and the specific action sequence as output label, and adjusts the model parameters through data collection during the training process to achieve accurate fitting of the relationship between input and output. Nevertheless, the existing WiFi-HAR system still faces some key challenges:

[0005] (1) There is an imbalanced dataset problem: In actual applications, the amount of data for common activities (such as walking and sitting) is much larger than that for rare activities (such as falling), resulting in an imbalanced distribution of activity types in the training dataset. This long-tail data distribution problem may cause the model to overfit common activities while reducing its ability to recognize rare activities, which in turn affects the generalization performance of the model.

[0006] (2) There is a problem of environmental diversity: Various objects in different environments (home, office, public places, etc.) have different effects on the propagation of WiFi signals, which can easily introduce signal changes unrelated to human activities and interfere with model training. This will cause the performance of the model to fluctuate in different environments, affecting its stability and accuracy.

[0007] (3) High model training overhead: Due to the high complexity of deep learning models, some existing domain adaptation models have certain computational overheads during the training process. In addition, in order to adapt to specific tasks or specific environments, such as solving tasks that domain adaptation models are insufficient in dealing with long-tail problems, some methods that can solve long-tail problems will bring additional computational overhead if they are directly added to the baseline model.

[0008] In view of this, the present invention is proposed. Summary of the invention

[0009] The purpose of the present invention is to provide a generalization performance optimization method, device and storage medium for a human activity recognition system, which can significantly improve the recognition performance and generalization ability of the human activity recognition system under environmental changes and data imbalance conditions in a WiFi environment, thereby solving the above-mentioned technical problems existing in the prior art.

[0010] The objective of the present invention is achieved through the following technical solutions:

[0011] A method for optimizing the generalization performance of a human activity recognition system, comprising:

[0012] Step 1, in the process of training a human activity recognition model of a WiFi-based human activity recognition system, training the human activity recognition model using a standard training method of a benchmark model to obtain a set of temporary network parameters;

[0013] Step 2: Use the human activity recognition model with temporary network parameters to perform human activity recognition, calculate the loss value of each category, and obtain the gradient of each category according to the loss value of each category;

[0014] Step 3, based on the similarity between each gradient and the average gradient, select several gradients with the highest similarity to update the network parameters of the human activity recognition model;

[0015] Step 4, using the human activity recognition model with updated network parameters to forward propagate the input data, and calculate the flattened loss value after flattening;

[0016] Step 5, weighting and merging the obtained flattened loss value and the original loss value into a final loss value, and using the final loss value to update the network parameters of the human activity recognition model, thereby completing a round of training of the network parameter update process of the human activity recognition model;

[0017] Step 6, repeat steps 2 to 5 until the network parameters of the human activity recognition model are stably converged, that is, stop training to obtain the human activity recognition model with optimized generalization performance, and use the obtained human activity recognition model with optimized generalization performance to perform WiFi-based human activity recognition.

[0018] A processing device, comprising:

[0019] at least one memory for storing one or more programs;

[0020] At least one processor can execute one or more programs stored in the memory. When the one or more programs are executed by the processor, the processor can implement the method described in the present invention.

[0021] A readable storage medium stores a computer program, which can implement the method described in the present invention when the computer program is executed by a processor.

[0022] Compared with the prior art, the generalization performance optimization method, device and storage medium of the human activity recognition system provided by the present invention have the following beneficial effects:

[0023] With the help of the class region flattening (CRF) solution strategy, the problem that the existing technology is difficult to adapt to the long-tail data distribution during model learning can be effectively alleviated. Specifically, the present invention adopts a two-step learning update method. First, the update operation of the human activity recognition model parameters is carried out according to the conventional training method of the benchmark model; second, the flat loss value is calculated according to the loss value of a specific category, so as to help the human activity recognition model find a flat loss value point. In the process of exploring the flat loss value point, the gradient selection strategy is also used, that is, the selective class region flattening strategy proposed in the present invention, so as to further optimize the update of the human activity recognition model. Experimental results show that the method of the present invention can significantly improve the accuracy and stability of the human activity recognition model for human activity recognition, and extremely well solves the problem of poor generalization performance of existing domain adaptation models such as human activity recognition models when processing long-tail data. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0025] Figure 1 A schematic flow chart of a method for optimizing the generalization performance of a human activity recognition system provided in an embodiment of the present invention.

[0026] Figure 2 A comprehensive framework diagram of a method for optimizing the generalization performance of a human activity recognition system in a method provided in an embodiment of the present invention.

[0027] Figure 3A schematic diagram of a multi-source long-tail domain adaptation experiment in the method provided in an embodiment of the present invention.

[0028] Figure 4 A schematic diagram of a multi-objective long-tail domain adaptation experiment in the method provided in an embodiment of the present invention.

[0029] Figure 5 A schematic diagram of the change in model loss value corresponding to the region flattening method provided in an embodiment of the present invention.

[0030] Figure 6 A schematic diagram of the change in model loss value corresponding to the selective class region flattening method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in combination with the specific content of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, which does not constitute a limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0032] First, the terms that may be used in this article are explained as follows:

[0033] The term “and / or” means that either or both of them can be realized at the same time. For example, X and / or Y means both “X” or “Y” and “X and Y”.

[0034] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.

[0035] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.

[0036] Unless otherwise specified or limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this article can be understood according to specific circumstances.

[0037] The orientation or position relationship indicated by terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", etc. are based on the orientation or position relationship shown in the drawings and are only for the convenience and simplification of description, and do not explicitly or implicitly indicate that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation of this document.

[0038] The scheme provided by the present invention is described in detail below. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professionals in the field. If the specific conditions are not specified in the embodiments of the present invention, they are carried out according to the conventional conditions in the field or the conditions recommended by the manufacturer. If the manufacturers are not specified in the reagents or instruments used in the embodiments of the present invention, they are all conventional products that can be purchased commercially.

[0039] like Figure 1 As shown, an embodiment of the present invention provides a method for optimizing the generalization performance of a human activity recognition system, comprising:

[0040] Step 1, in the process of training a human activity recognition model of a WiFi-based human activity recognition system, training the human activity recognition model using a standard training method of a benchmark model to obtain a set of temporary network parameters;

[0041] Step 2: Use the human activity recognition model with temporary network parameters to perform human activity recognition, calculate the loss value of each category, and obtain the gradient of each category according to the loss value of each category;

[0042] Step 3, based on the similarity between each gradient and the average gradient, select several gradients with the highest similarity to update the network parameters of the human activity recognition model;

[0043] Step 4, using the human activity recognition model with updated network parameters to forward propagate the input data, and calculate the flattened loss value after flattening;

[0044] Step 5, weighting and merging the obtained flattened loss value and the original loss value into a final loss value, and using the final loss value to update the network parameters of the human activity recognition model, thereby completing a round of training of the network parameter update process of the human activity recognition model;

[0045] Step 6, repeat steps 2 to 5 until the network parameters of the human activity recognition model are stably converged, that is, stop training to obtain the human activity recognition model with optimized generalization performance, and use the obtained human activity recognition model with optimized generalization performance to perform WiFi-based human activity recognition.

[0046] In actual training, multiple rounds of network parameter updates are usually required until the network parameters of the human activity recognition model converge stably. Training stops only when the network parameters of the human activity recognition model reach a convergence state.

[0047] The loss value of each category and its corresponding gradient are calculated in the above step 2. This is mainly because the data to be processed has a long-tail distribution phenomenon. There are large differences in the loss values ​​of each category, and a unified summed loss value cannot be used for update. Therefore, it is necessary to calculate the loss value of each category and its corresponding gradient.

[0048] In step 3 above, the gradients with the highest similarity are updated mainly because only those gradients with high similarity to the average gradient are useful for the model contribution, and other gradients contribute less to the model or are not conducive to the model update. In addition, selecting fewer gradients is conducive to reducing the amount of calculation. If there are many categories to be identified, it is necessary to update based on many gradients. Selecting the first few gradients with the highest similarity to the average gradient for update is conducive to reducing the complexity of calculation.

[0049] Preferably, in step 1 of the above method, a set of temporary network parameters is obtained by training the human activity recognition model using a standard training method of a benchmark model. for:

[0050] (1);

[0051] In the above formula (1), the meanings of the parameters are: are the network parameters for the current training round; is the hyperparameter learning rate; is the gradient descent symbol; For experience loss.

[0052] Preferably, in step 3 of the above method, several gradients with the highest similarity are selected according to the similarity between the respective gradients and the average gradient according to the following formula, including:

[0053] (2);

[0054] (3);

[0055] In the above formula (2) and formula (3), the meaning of each parameter is: Indicates The similarity between the categories and the average gradient; Indicates The gradient of the categories; represents the average gradient; Indicates the total number of categories; Indicates The loss value of each category; Represents the gradient descent symbol; It indicates that a set of temporary network parameters are obtained by training the human activity recognition model using the standard training method of the benchmark model.

[0056] Preferably, in step 4 of the above method, the human activity recognition model after updating the network parameters is used to forward propagate the data, and the flattened loss value after flattening is calculated by the following formula: ,include:

[0057] (4);

[0058] (5);

[0059] (6);

[0060] In the above formulas (4), (5) and (6), the meanings of the parameters are: Indicates that a set of temporary network parameters are obtained by training the human activity recognition model using the standard training method of the benchmark model; and They are specific categories and total number of categories respectively; Indicates temporary network parameters The specific category below Flattening loss value; It is a theoretically specific category The optimal perturbation vector of Indicates a specific category The perturbation radius vector of ; Represents the network parameters after theoretical disturbance The specific category corresponding to experience loss; Represents the network parameters after actually receiving the disturbance The specific category corresponding to experience loss; Indicates the specific category actually obtained The disturbance vector of Represents the network parameters after actually receiving the disturbance The specific category corresponding to experience loss, and The meaning is the same; is a hyperparameter; Represents the gradient descent symbol; Indicates temporary network parameters Under a specific category The gradient corresponding to the empirical loss of Represents the 2-norm symbol.

[0061] Preferably, in the above method, the specific category actually obtained The perturbation vector The following first-order Taylor expansion gives:

[0062] ;

[0063] (7);

[0064] In the above formula (7), the meanings of the parameters are: represents the network parameters after perturbation; , and Respectively represent the disturbance radius, specific category Unperturbed experience loss and specific categories Experience loss after being disturbed; For specific categories under temporary network parameters The gradient corresponding to the empirical loss of Indicates a theoretically specific category The transposed matrix of the optimal perturbation vector .

[0065] Preferably, in step 5 of the above method, the obtained flattening loss value and the original loss value are weighted and combined into a final loss value, and the final loss function is for:

[0066] (8);

[0067] In the above formula (8), the meanings of the parameters are: For experience loss; is a preset hyperparameter used to adjust the balance between the two losses; is the flattening loss.

[0068] The embodiment of the present invention further provides a processing device, including:

[0069] at least one memory for storing one or more programs;

[0070] At least one processor can execute one or more programs stored in the memory. When the one or more programs are executed by the processor, the processor can implement the method described in the present invention.

[0071] The embodiments of the present invention further provide a readable storage medium storing a computer program, which can implement the method described in the present invention when the computer program is executed by a processor.

[0072] In summary, it can be seen that the embodiment of the present invention improves the recognition accuracy and stability of the human activity recognition model of the WiFi-based human activity recognition system by adopting a solution strategy of class region flattening, and effectively solves the problem that the domain adaptation model in the human activity recognition system has poor generalization performance when processing long-tail data, resulting in low recognition accuracy and poor stability.

[0073] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the solution provided by the embodiment of the present invention is described in detail with specific embodiments below.

[0074] Example 1

[0075] The embodiment of the present invention provides a generalization performance optimization method for a human activity recognition system, which is a domain adaptation model training method. The human activity recognition model of a WiFi-based human activity recognition system can be trained, and the recognition performance and generalization ability of the WiFi-HAR system under environmental changes and data imbalance conditions can be significantly improved.

[0076] The following introduces a flattening operation that helps the model find flat minima and further improves the model performance.

[0077] (1) Region flattening operation:

[0078] The specific implementation steps of the method of the present invention will be described in detail below.

[0079] The core goal of deep neural network training is to minimize the empirical loss in order to optimize the model parameters and improve its classification effect. Usually, the fitting function of the model exhibits nonlinear characteristics and there are many local minimum points. These local minima are mainly divided into two categories: one is the local minima with strong generalization ability and flat performance; the other is the local minima with weak generalization ability and sharp performance. In the learning scenario of long-tail distribution, the model tends to converge to sharp local minima, resulting in a decrease in generalization ability. In order to overcome this challenge and find flat local minima with better generalization ability, a dual strategy is adopted: on the one hand, it is committed to minimizing the empirical loss; on the other hand, the flattening operation is introduced to adjust the model training process.

[0080] (9);

[0081] In the above formula (1), Represents the empirical loss, which is used to promote rapid convergence of the model; Represents flat loss, which is used to guide the model to evolve towards a flatter loss region, thereby improving generalization ability; is a preset hyperparameter used to adjust the balance between the two losses; in order to ensure that this method can be applied to different domain adaptation models, The calculation of follows the original training strategy of each model;

[0082] Recent studies have shown that by minimizing the loss area of ​​the model near the local minimum point, the model can be effectively flattened. This process can be expressed by the following formula:

[0083] (10);

[0084] In the above formula (10), represents a small perturbation of a parameter; is the maximum permissible radius of the disturbance; represents the parameter value after disturbance; Represents the corresponding loss value after disturbance.

[0085] Although this method can achieve good results on balanced data sets, its performance will be significantly reduced when facing long-tail data distribution, especially in minority categories. To this end, the present invention introduces PAC-Bayesian generalization theory to improve the above method, with the aim of finding flatter minimum points on specific categories. The framework of the improved method of the present invention is as follows Figure 2 As shown, it can be called CRF. Figure 2 The demonstration region flattening describes in detail how to apply the flattening operation to update the network parameters of the mainstream domain adaptation model.

[0086] Step 1: First, the human activity recognition model of the WiFi-based human activity recognition system is trained according to the standard training process of the baseline model to obtain a set of temporary network parameters. :

[0087] (1);

[0088] In the above formula (1), the meanings of the parameters are: are the network parameters for the current training round; is the hyperparameter learning rate; is the gradient descent symbol; For experience loss;

[0089] In step 2 and step 3, the previous method needs to calculate specific gradients for all categories and re-estimate the loss value for each gradient. However, experiments show that this calculation of gradients and losses for all categories greatly increases the computational complexity, especially when dealing with models with many categories, which increases the training time. To alleviate this problem, the present invention introduces a method of selecting the most beneficial vectors for model training based on similarity through the following formula. According to the similarity between each gradient and the average gradient, several gradients with the highest similarity are selected to update the network parameters of the human activity recognition model, specifically:

[0090] (2);

[0091] (3);

[0092] In the above formula (2) and formula (3), the meaning of each parameter is: Indicates The similarity between the categories and the average gradient; Indicates The gradient of the categories; represents the average gradient; Indicates the total number of categories; Indicates The loss value of each category; Represents the gradient descent symbol;

[0093] Step 4: Flatten the model according to the PAC-Bayesian generalization theory by:

[0094] (4);

[0095] (5);

[0096] (6);

[0097] In the above formulas (4), (5) and (6), the meanings of the parameters are: Indicates that a set of temporary network parameters are obtained by training the human activity recognition model using the standard training method of the benchmark model; and They are specific categories and total number of categories respectively; Indicates temporary network parameters The specific category corresponding to Flattening loss value; It is a theoretically specific category The optimal perturbation vector of Indicates a specific category The perturbation radius vector of ; Represents the network parameters after theoretical disturbance The corresponding empirical loss for a specific category 𝑐 is: Represents the network parameters after actually receiving the disturbance The corresponding empirical loss for a specific category 𝑐 is: Indicates the specific category actually obtained The disturbance vector of Represents the network parameters after actually receiving the disturbance The specific category corresponding to experience loss, and The meaning is the same; is a hyperparameter; Represents the gradient descent symbol; Indicates temporary network parameters Under a specific category The gradient corresponding to the empirical loss of Represents the 2-norm symbol.

[0098] The specific categories of The perturbation vector It is obtained by the following first-order Taylor expansion:

[0099] ;

[0100] (7);

[0101] In the above formula (7), the meanings of the parameters are: represents the network parameters after perturbation; , and Respectively represent the disturbance radius, specific category Unperturbed experience loss and specific categories Experience loss after being disturbed; is the gradient corresponding to the empirical loss of a specific category 𝑐 under the temporary network parameters; Indicates a theoretically specific category The transposed matrix of the optimal perturbation vector .

[0102] Preferably, in step 5 of the above method, the obtained flattening loss value and the original loss value are weighted and combined into a final loss value, and the final loss function is for:

[0103] (8);

[0104] In the above formula (8), the meanings of the parameters are: For experience loss; is a preset hyperparameter used to adjust the balance between the two losses; is the flattening loss.

[0105] Although class region flattening aims to find a flat minimum point for all classes, it may be difficult to achieve this goal in the actual optimization process. Like most algorithms, it is inevitable to lose the accuracy of the head class to improve the accuracy of the tail class.

[0106] In summary, the method of the embodiment of the present invention can improve the accuracy and stability of human activity recognition by the human activity recognition model through the class region flattening (CRF) solution strategy, and well solve the problem of poor generalization performance of the existing domain adaptation model when processing long-tail data.

[0107] The following is the comparison result between the method of the present invention and the traditional method:

[0108] First, a one-to-one domain adaptation experiment was conducted in six indoor environments, and different environments were selected as source and target domains in each experiment. Comparing the three mainstream domain adaptation models, it can be seen from Table 1 that although the method of the present invention did not significantly improve in some individual experiments, in most and average cases, CRF and its selective strategy CRF-S effectively improved the model performance, especially the TOSS model showed significant improvement, which is in line with the expectations of the present invention.

[0109] Table 1 shows the comparison results of long-tail one-to-one domain adaptation.

[0110] ;

[0111] .

[0112] Furthermore, the multi-source and multi-target long-tail domain experiment also confirmed a similar trend. The last four domains were used as the source domain and target domain, and the first domain was used as the target domain and source domain respectively. The experimental results are shown in Figure 2. Figure 3 and Figure 4As shown, Figure 3 and Figure 4 The effect of the method of the present invention in multi-source domains and multi-target situations is demonstrated. It can be observed that the method of the present invention shows similar trends in all models and single experiments.

[0113] In order to evaluate the stability of model updates, we took the CNN model as an example and observed the fluctuation of the loss value in the last 60 iterations of training. Figure 5 , Figure 5 The loss value changes of the model corresponding to the class region flattening method (i.e. CRF) for the last 60 training batches of CNN are shown. The results show that see Figure 6 , Figure 6 The change in loss value of the model corresponding to the selective class region flattening method (i.e., CRF-S) of the present invention is demonstrated. Compared with the class region flattening method, the selective class region flattening method of the present invention exhibits smaller loss oscillations and reduces the instability caused by gradient conflicts.

[0114] Example 2

[0115] This embodiment provides a method for optimizing the generalization performance of a human activity recognition system, which is implemented by the following steps:

[0116] (2) System construction:

[0117] The following hardware and software specifications were configured for this system setup: CPU (Intel Core i7-8700), GPU (NVIDIARTX 3090), 16 GB RAM, and Ubuntu 20.04 operating system. In the machine learning experiments, the PyTorch deep learning framework was used. The training process used the Adam optimizer, and the learning rate of the outer loop and inner loop of the meta-learning module in TOSS was set to 0.001.

[0118] (3) The method steps are as follows:

[0119] Step 1: During the model training process, first follow the standard training method of the benchmark model to obtain a set of temporary network parameters;

[0120] Step 2, then, Figure 2 As shown, the loss value of each category is calculated, and the respective gradients are obtained based on these loss values;

[0121] According to the similarity between each gradient and the average gradient, several gradients with the highest similarity are selected to update the model network parameters;

[0122] After that, the updated network parameters are used to forward propagate the data and calculate the flattened loss value after flattening;

[0123] Finally, the flattened loss value is weighted and combined with the original loss value to form the final loss value, which is used to update the model parameters and complete the network parameter update process of a round of model training.

[0124] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0125] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.

Claims

1. A method for optimizing the generalization performance of a human activity recognition system, characterized in that: include: Step 1, in the process of training a human activity recognition model of a WiFi-based human activity recognition system, training the human activity recognition model using a standard training method of a benchmark model to obtain a set of temporary network parameters; Step 2: Use the human activity recognition model with temporary network parameters to perform human activity recognition, calculate the loss value of each category, and obtain the gradient of each category according to the loss value of each category; Step 3, based on the similarity between each gradient and the average gradient, select several gradients with the highest similarity to update the network parameters of the human activity recognition model; Step 4: Use the human activity recognition model with updated network parameters to forward propagate the input data and calculate the flattened loss value after flattening. ,include: (4); (5); (6); In the above formulas (4), (5) and (6), the meanings of the parameters are: Indicates that a set of temporary network parameters are obtained by training the human activity recognition model using the standard training method of the benchmark model; and They are specific categories and total number of categories respectively; Indicates temporary network parameters The specific category below Flattening loss value; It is a theoretically specific category The optimal perturbation vector of Indicates a specific category The perturbation radius vector of ; Represents the network parameters after theoretical disturbance The specific category below experience loss; Represents the network parameters after actually receiving the disturbance The specific category corresponding to experience loss; Indicates the specific category actually obtained The disturbance vector of Represents the network parameters after actually receiving the disturbance The specific category below experience loss, and The meaning is the same; is a hyperparameter; Represents the gradient descent symbol; Indicates temporary network parameters Under a specific category The gradient corresponding to the empirical loss of represents the 2-norm symbol; Step 5, weighting and merging the obtained flattened loss value and the original loss value into a final loss value, and using the final loss value to update the network parameters of the human activity recognition model, thereby completing a round of training of the network parameter update process of the human activity recognition model; Step 6, repeat steps 2 to 5 until the network parameters of the human activity recognition model are stably converged, that is, stop training to obtain the human activity recognition model with optimized generalization performance, and use the obtained human activity recognition model with optimized generalization performance to perform WiFi-based human activity recognition.

2. The generalization performance optimization method of the human activity recognition system according to claim 1, characterized in that: In step 1, the human activity recognition model is trained using the standard training method of the benchmark model to obtain a set of temporary network parameters. for: (1); In the above formula (1), the meanings of the parameters are: are the network parameters for the current training round; is the hyperparameter learning rate; is the gradient descent symbol; For experience loss.

3. The generalization performance optimization method of the human activity recognition system according to claim 1 or 2, characterized in that: In step 3, according to the similarity between each gradient and the average gradient, several gradients with the highest similarity are selected according to the following formula, including: (2); (3); In the above formula (2) and formula (3), the meaning of each parameter is: Indicates The similarity between the categories and the average gradient; Indicates The gradient of the categories; represents the average gradient; Indicates the total number of categories; Indicates The loss value of each category; Represents the gradient descent symbol; It indicates that a set of temporary network parameters are obtained by training the human activity recognition model using the standard training method of the benchmark model.

4. The generalization performance optimization method of the human activity recognition system according to claim 1, characterized in that: The specific category actually obtained The perturbation vector The following first-order Taylor expansion gives: ; (7); In the above formula (7), the meanings of the parameters are: represents the network parameters after perturbation; , and Respectively represent the disturbance radius, specific category Unperturbed experience loss and specific categories Experience loss after being disturbed; For specific categories under temporary network parameters The gradient corresponding to the empirical loss of Indicates a theoretically specific category The transposed matrix of the optimal perturbation vector .

5. The generalization performance optimization method of the human activity recognition system according to claim 1 or 2, characterized in that: In step 5, the obtained flattened loss value is weighted and combined with the original loss value to form the final loss value. The final loss function is for: (8); In the above formula (8), the meanings of the parameters are: For experience loss; is a preset hyperparameter used to adjust the balance between the two losses; is the flattening loss.

6. A processing device, characterized in that: include: at least one memory for storing one or more programs; At least one processor can execute one or more programs stored in the memory, and when the one or more programs are executed by the processor, the processor can implement the method described in any one of claims 1 to 5.

7. A readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the method described in any one of claims 1 to 5 can be implemented.

Citation Information

Patent Citations

  • Network training method and device, action recognition method and device, equipment and storage medium

    CN112070027A

  • Classification model training method and device, equipment, medium and program product

    CN117216550A