Federal learning-based human body behavior recognition method and system, and storage medium

By designing the FedPA algorithm in federated learning, assigning weights based on the sum of client model parameters, optimizing the aggregation process of human behavior recognition models, solving the problems of data privacy and inefficiency in traditional centralized learning methods, and achieving more efficient model aggregation and accuracy.

CN119296178APending Publication Date: 2025-01-10ZHONGYUAN ENGINEERING COLLEGE +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411564702.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In human behavior recognition, traditional centralized learning methods based on deep learning increase in communication frequency of federated learning due to data privacy concerns and reduced efficiency, reducing the aggregation efficiency and accuracy of the model, especially in the large differences in behavior patterns among users. In the case of

Method used

A federated learning aggregation algorithm FedPA is designed to dynamically allocate weights based on the sum of client model parameters, optimize the model aggregation process, reduce communication rounds, and adjust the algorithm configuration parameters based on data imbalance characteristic analysis to improve the global model Convergence speed and accuracy.

Benefits of technology

It effectively improves the accuracy and robustness of the human behavior recognition model, alleviates data privacy issues, reduces communication overhead, and improves aggregation efficiency and model optimization performance under the federated learning framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296178A_ABST
    Figure CN119296178A_ABST
Patent Text Reader

Abstract

The invention discloses a federal learning-based human body behavior recognition method and system and a storage medium, and relates to the field of human body behavior recognition. The method comprises the following specific steps: acquiring a human body behavior recognition data set; preprocessing the human body behavior recognition data set to obtain a first data set; performing various data imbalance characteristic analysis on the first data set; designing a federated learning aggregation algorithm FedPA, and dynamically allocating weights for client model aggregation according to the sum of client model parameter quantities; and dividing the first data set into a training set and a test set, training the algorithm FedPA by using the training set, and evaluating the trained algorithm FedPA by using the test set. According to the method, the human behavior recognition accuracy under the federated learning framework is effectively improved, the aggregation performance of the server and the client model is optimized, the data privacy problem is relieved, and the communication overhead is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of human behavior recognition, and in particular to a human behavior recognition method, system and storage medium based on federated learning. Background Art

[0002] In the era of digital consumption, the widespread use of wearable and Internet of Things (IoT) devices has made human action recognition (HAR) technology the focus of academic and industrial attention. However, with the popularity of smart devices and the increasing importance of privacy protection, traditional centralized learning methods based on deep learning can no longer adapt to the surge in data from edge smart devices. Centralized methods are prone to privacy concerns when collecting and processing large amounts of behavioral data information. In addition, the growing amount of data also leads to a decrease in the efficiency of centralized deep learning models, slowing down the speed of data transmission and processing. Federated Learning, as a distributed learning paradigm, allows client model training on local devices. The client and server models only exchange model parameters without sharing the user's original behavioral data, thereby alleviating privacy concerns and improving data utilization efficiency. Therefore, as a distributed learning framework, the federated learning framework has demonstrated its potential in alleviating data privacy concerns, collaborative training, and optimization in human action recognition.

[0003] However, due to differences in behavior patterns and habitual preferences among users, the user behavior data collected by different clients are distributed differently. This non-independent and identically distributed (Non-IIP) problem requires more frequent exchange of model update parameters between the central server and the client to achieve convergence of the global model. Increasing the communication frequency increases the communication cost and reduces the effect of federated learning. This poses a challenge to the global convergence of the federated learning server model. Therefore, it is urgent to design and implement a new federated aggregation algorithm to effectively address these challenges, improve the aggregation efficiency and model optimization performance between the server and client models, and thus improve the accuracy and robustness of human behavior recognition. Summary of the invention

[0004] The purpose of the present invention is to provide a human behavior recognition method, system and storage medium based on federated learning to solve the problems raised in the background technology.

[0005] To achieve the above object, the present invention provides the following solution: a human behavior recognition method based on federated learning, the specific steps of which include the following:

[0006] Get the human behavior recognition dataset;

[0007] Preprocessing the human behavior recognition data set to obtain a first data set;

[0008] Design a federated learning aggregation algorithm FedPA to dynamically assign weights to client model aggregations based on the total number of client model parameters;

[0009] The first data set is divided into a training set and a test set, the training set is used to train the algorithm FedPA, and the test set is used to evaluate the trained algorithm FedPA.

[0010] Preferably, the method further includes performing a plurality of distribution imbalance characteristic analyses on the first data set to obtain analysis results, and designing a federated learning aggregation algorithm FedPA based on the analysis results.

[0011] Preferably, the data imbalance characteristic analysis includes data volume imbalance analysis, label imbalance analysis, and feature distribution imbalance analysis.

[0012] Preferably, in the federated learning aggregation algorithm FedPA, by calculating the sum of parameters of each client model, an aggregation weight coefficient is dynamically allocated to it according to the sum of parameters in each communication round.

[0013] Preferably, the configuration parameters of the federated learning aggregation algorithm FedPA include: the number of clients K, the number of communication rounds T between the server and the client, the local batch size B, the learning rate η, and the number of local iterations E.

[0014] Preferably, the training process of the federated learning aggregation algorithm FedPA is:

[0015] Step 1: Use the preset initial parameters to initialize the global model w0;

[0016] Step 2: At the beginning of each round of communication, the server sends the global model w0 to all clients participating in the training to ensure that each client is trained on the same starting model;

[0017] Step 3: After receiving w0, the client loads the global model w0 into the client's local model, and uses its own data and computing resources to perform E iterations of training to optimize the model parameters;

[0018] Step 4: During the local training process, use the stochastic gradient descent algorithm to minimize the loss function.

[0019] Step 5: Select cross entropy loss as the loss function to evaluate the gap between the client model predicted label and the actual label;

[0020] Step 6: After each round of local training, the client will update its client model After receiving the updated models from all clients, the server calculates the parameters and W of all client models and obtains the aggregated global model w′ t ;

[0021] Step 7: Loop through steps 2 to 5 to complete a communication round, and continue until all specified rounds are completed, thereby obtaining an optimized global model consistent with the predetermined goal of federated learning.

[0022] Preferably, the calculation process of minimizing the loss function using the stochastic gradient descent algorithm is:

[0023]

[0024] Where, for each client k in round t, the client model parameters Use learning rate η = 0.01 to update, b represents a specific data batch, L represents the loss function, and use a specific data batch b to determine the loss function L. The gradient of

[0025] Preferably, the calculation formula of the loss function is:

[0026]

[0027] Among them, C represents the total number of categories, y i,c is an indicator function indicating whether sample i belongs to category c, is the probability that sample i belongs to class c assigned by the client model.

[0028] On the other hand, a human behavior recognition system based on federated learning is provided, including a data acquisition module, a preprocessing module, an analysis module, a model building module, and a training module; wherein:

[0029] The data acquisition module is used to acquire a human behavior recognition data set;

[0030] The preprocessing module is used to preprocess the human behavior recognition data set to obtain a first data set;

[0031] The analysis module is used to perform multiple data imbalance characteristic analyses on the first data set;

[0032] The model building module is used to design a federated learning aggregation algorithm FedPA, which dynamically allocates weights for client model aggregation according to the sum of client model parameter quantities;

[0033] The training module is used to divide the first data set into a training set and a test set, use the training set to train the algorithm FedPA, and use the test set to evaluate the trained algorithm FedPA.

[0034] Finally, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the human behavior recognition method based on federated learning are implemented.

[0035] According to the specific embodiment provided by the present invention, the present invention discloses the following technical effects: FedPA dynamically allocates corresponding aggregation weights to the client model according to the size of the sum of the client model parameters to accurately reflect the contribution of each client model in the aggregation process, thereby effectively improving the performance of the human behavior recognition model under the federated learning framework, coping with the challenges brought by the non-independent and identically distributed client distributed data under the federated learning framework, and alleviating the privacy concerns of client users about data use. At the same time, FedPA reduces the number of aggregation communication rounds, improves aggregation efficiency, improves the accuracy of human behavior recognition under the federated learning framework, optimizes the aggregation performance of server and client models, alleviates data privacy issues and reduces communication overhead. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0038] Figure 2 A schematic diagram of the number of samples of each behavior of different client users in the Pamap2 dataset of the present invention;

[0039] Figure 3 A schematic diagram of the number of samples of each behavior of different client users in the RealWorld dataset of the present invention;

[0040] Figure 4 It is a t-SNE diagram of the client user behavior in the Pamap2 dataset of the present invention;

[0041] Figure 5 t-SNE diagram of client user behavior in the RealWorld dataset of the present invention;

[0042] Figure 6This is a schematic diagram of the framework structure of the federated learning aggregation algorithm FedPA of the present invention;

[0043] FIG7( a ) is a diagram showing the verification results of the FedPA algorithm of the present invention using the ID-CNN model on the Pamap2 dataset;

[0044] FIG7( b ) is a diagram showing the verification results of the FedPA algorithm of the present invention using the ID-CNN model on the RealWorld dataset;

[0045] FIG8( a ) is a diagram showing the verification results of the FedPA algorithm of the present invention using the LSTM model on the Pamap2 dataset;

[0046] FIG8( b ) is a diagram showing the verification results of the FedPA algorithm of the present invention using the LSTM model on the RealWorld dataset. DETAILED DESCRIPTION

[0047] 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 only 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 are within the scope of protection of the present invention.

[0048] The purpose of the present invention is to provide a human behavior recognition method based on federated learning to reduce the adverse effects of the non-independent and identically distributed problem of client data on the collaborative training of server and client models. FedPA allocates aggregation weights according to the size of the sum of client model parameters, improving the strategy of aggregating only according to the number of client samples in traditional federated learning. The algorithm directly reflects the diversity and richness of client data based on the size of model parameters, and reflects the contribution of client models to the update of global model parameters. FedPA allocates higher weights to clients with richer data, ensuring that the central server gives priority to client models with greater contributions when aggregating model parameters, thereby accelerating the convergence of the global model, reducing communication costs, and improving the overall accuracy of human behavior recognition under the federated learning framework.

[0049] like Figure 1 As shown, the specific steps include the following:

[0050] S1. Obtain human behavior recognition dataset;

[0051] S2, preprocessing the human behavior recognition data set to obtain a first data set;

[0052] S3, performing multiple data imbalance characteristic analyses on the first data set to obtain analysis results;

[0053] S4. Based on the analysis results, a federated learning aggregation algorithm FedPA is designed to dynamically allocate weights for client model aggregation according to the total amount of client model parameters;

[0054] S5. Divide the first data set into a training set and a test set, use the training set to train the algorithm FedPA, and use the test set to evaluate the trained algorithm FedPA.

[0055] Specifically, the human behavior recognition datasets obtained in step S1 of this embodiment are: two public human behavior recognition datasets, Pamap2 and RealWorld. The Pamap2 dataset uses three Colibri wireless inertial measurement units and a heart rate meter to collect more than 10 hours of behavior data from 9 volunteers. The Pamap2 used in this patent technology involves data from eight of the volunteers, all of whom performed eight common behaviors, including lying, sitting, standing, walking, going upstairs, going downstairs, using a vacuum cleaner to clean and ironing clothes. The RealWorld dataset contains 15 participants who recorded 18 hours of behavior data using Samsung Galaxy S4 smartphones and LG G Watch R smart watches. These wearable devices were worn on seven different body parts: chest, forearm, head, calf, thigh, upper arm and waist. The eight different behaviors collected from the volunteers were going up / downstairs, jumping, lying, standing, sitting, running and walking, and each behavior lasted about 10 minutes.

[0056] Furthermore, in data preprocessing, the Pamap2 dataset was divided into a window sequence of size 64; the number of samples in each window of the RealWorld partition was 128; the overlap rate between two adjacent windows after the two datasets were divided was 50%. These window sequences were divided into training sets and test sets in a ratio of 4:1, providing high-quality data support for the subsequent training and optimization of the federated learning aggregation algorithm FedPA.

[0057] In a specific embodiment, in step S3, an imbalance analysis is performed on the data set, including data volume imbalance analysis, label imbalance analysis, and feature distribution imbalance analysis. Tables 1 and 2 respectively intuitively show the differences in the number of samples between clients. In the Pamap2 dataset, the difference between the highest and lowest number of samples is 1217, while in the RealWorld dataset, the difference is 6421. These differences indicate that there is a significant imbalance in the number of samples between different clients.

[0058] Client 1 Client 2 Client 3 Client 4 Client 5 Client 6 Client 7 Client 8 3107 3849 2632 2908 3036 3036 2691 3419

[0059] Table 1 Number of samples per client in Pamap2

[0060] Client 1 Client 2 Client 3 Client 4 21598 20356 24926 26777

[0061] Table 2 Number of samples per client in RealWord

[0062] To further illustrate the client data imbalance phenomenon, Figure 2 and Figure 3 The imbalance of label distribution in each client is shown. In the Pamap2 dataset, the distribution ratios of the behavior "lying down" on different clients are 14%, 18.5%, 9%, 11%, 11%, 12%, 9.5%, and 15%, respectively. Similarly, in the RealWorld dataset, the proportions of the behavior "running" on each client are 23%, 16%, 28%, and 33%, respectively.

[0063] In order to illustrate the imbalance in the feature distribution of the two datasets, the t-distributed Stochastic Neighbor Embedding (t-SNE) technique is used to show the distribution of data with the same behavior on different clients after dimensionality reduction. Figure 4 The feature distribution of the "ironing" behavior in the Pamap2 dataset is shown. The data clusters formed by Client 1 (black solid circle) and Client 8 (black pentagon) are clearly separated from the data clusters of other clients, indicating that there are significant differences in the feature distribution between different clients. Compared with Client 1, the feature distribution of Client 5 is more dispersed and forms more clusters, indicating greater data diversity. The data feature diversity of Client 8 is the most obvious.

[0064] like Figure 5 As shown in Figure 1, in the RealWorld dataset, for the behavior of “station”, although the behavior labels on different clients are consistent, their data distributions are very different. In particular, client 4 shows the most diverse feature distribution.

[0065] In a specific embodiment, in step S4, the FedPA algorithm proposed in the present invention optimizes the global model by allocating the aggregation weights proportionally to the sum of the parameters of the client model. This method stems from two key factors:

[0066] Knowledge representation: During the training of the neural network model, the learned knowledge is encoded into the parameters of the model. Therefore, the size of the parameters of the client model after training directly represents its knowledge representation. FedPA effectively utilizes these parameters by assigning different weight coefficients to clients during the aggregation process, aiming to better reflect the contribution of each client model in the aggregation process and improve the optimization effect of the global model.

[0067] Information density and feature complexity: Datasets with high information density describe more details or contain more distinguishable features, and usually require larger model parameters to effectively encode information. This suggests that clients with richer data and more balanced label distribution are able to represent more complex knowledge, and require expanded client model parameters to effectively encapsulate this knowledge. Therefore, the sum of the client model parameters indicates both the depth of the client model knowledge representation and their potential to enhance global model updates.

[0068] In the model aggregation process, assigning higher weight coefficients to client models with larger parameters is a move aimed at enriching the global model with more subtle knowledge. This is different from other aggregation methods that assign weights based on the size of client samples, and encourages the integration of client knowledge representation. Figure 6 As shown in Figure 1, although the dataset of client 1 is smaller, it has data features such as stars and squares that client 2 does not have. Therefore, the model of client 1 obtains rich representations through local training, which is reflected in the larger sum of its model parameters.

[0069] The traditional federated average algorithm (FedAvg) tends to give higher weights to client 2 with a larger dataset, which may cause the global model to favor the knowledge of client 2, thereby weakening the generalization ability of the global model. On the other hand, the FedPA algorithm ensures that the aggregate model integrates more comprehensive information from all clients by giving priority to clients with larger model parameters. This not only reduces the average loss of the client, but also speeds up the convergence of the global model and reduces the number of communication rounds required to obtain the optimal accuracy.

[0070] By adjusting the weights according to the sum of the client model parameters, FedPA effectively weighs the contribution of each client to the global model, improving the efficiency and accuracy of federated learning in behavior recognition tasks.

[0071] In the present invention, the configuration parameters of the federated learning aggregation algorithm FedPA include: the number of clients K, the number of communication rounds T between the server and the client, the local batch size B, the learning rate η, and the number of local iterations E, in order to obtain the final global model w.

[0072] The training process of the federated learning aggregation algorithm FedPA is:

[0073] S41, global model initialization: using preset initial parameters to initialize the global model w0;

[0074] S42, model transfer: At the beginning of each round of communication, the server sends the global model w0 to all clients participating in the training to ensure that each client is trained on the same starting model;

[0075] S43, local training: After receiving w0, the client loads the global model w0 into the local model of the client, and uses its own data and computing resources to perform E iterations of training to optimize the model parameters;

[0076] S44, local update algorithm: During the local training process, the stochastic gradient descent algorithm is used to minimize the loss function;

[0077] The calculation process of minimizing the loss function using the stochastic gradient descent algorithm is:

[0078]

[0079] Where, for each client k in round t, the client model parameters Use learning rate η = 0.01 to update, b represents a specific data batch, L represents the loss function, and use a specific data batch b to determine the loss function L. The gradient of

[0080] S45, selection of loss function: select cross entropy loss as the loss function to evaluate the gap between the client model predicted label and the actual label; the cross entropy loss function is suitable for the multi-classification problem of human behavior recognition in the present invention, and is expressed as

[0081]

[0082] Among them, C represents the total number of categories, y i,c is an indicator function indicating whether sample i belongs to category c, is the probability that sample i belongs to class c assigned by the client model.

[0083] S46, model aggregation and optimization: After each round of local training, the client will update its client model After receiving the updated models from all clients, the server calculates the parameters and W of all client models and obtains the aggregated global model w′ t ;

[0084] Specifically, the calculation formula for calculating the parameters of all client models and W is:

[0085]

[0086] Calculate the aggregated global model w′ t The calculation formula is:

[0087]

[0088] S47. Repeat the process: loop through steps S42 to S45 to complete a communication round, and continue until all specified rounds are completed, thereby obtaining an optimized global model consistent with the predetermined goal of federated learning.

[0089] Further, in step S5, the client and server models are trained using the training set data and the aggregation algorithm FedPA, and evaluated using the test set. The evaluation criteria include defined aggregation accuracy, personalization accuracy, and generalization accuracy, which are summarized as follows:

[0090] Aggregate Accuracy: This metric evaluates the performance of the global model aggregated from all clients by testing on a central test dataset. The purpose is to determine whether the global model in the federated learning framework provides better performance than the traditional centralized approach.

[0091] Personalized Accuracy: This metric measures the performance of a personalized client model by calculating its accuracy using local data. It evaluates whether federated learning outperforms traditional local learning methods in the task of behavior recognition for a specific client.

[0092] Generalization accuracy: This metric is determined by the client using a central test dataset to evaluate the performance of the client model on behaviors it has never encountered before. It examines whether federated learning provides better performance than traditional local learning methods when faced with new, unknown behaviors. Evaluating the generalization ability of the model helps understand the potential advantages of federated learning in handling different behavior patterns and maintaining personalized recognition.

[0093] In the validation experiment, the model performance was evaluated by calculating the number of communication rounds required to achieve the best aggregate accuracy, personalized accuracy, and generalization accuracy. Each client dataset was divided into a training set and a test set using a 4:1 ratio, and the test data from each client was merged to form a central test dataset. The global model was evaluated on this central test dataset to obtain the aggregate accuracy. Each client was trained on its respective training set to obtain the client model parameters. These client models were then evaluated on their respective local test sets, the personalized accuracy of each client was calculated, and these results were averaged to obtain the overall personalized accuracy. In addition, each client model was evaluated based on the central test dataset to measure the generalization accuracy of each client, and its average was used as the final generalization accuracy.

[0094] In order to comprehensively analyze the advantages of human action recognition under the federated learning framework, centralized experiments and local experimental verifications were added.

[0095] Centralized experimental verification: This experiment follows the traditional centralized approach, pooling data from all clients to train and test the behavior recognition model. The results are used as a benchmark and compared with the aggregated accuracy to evaluate whether federated learning can be aggregated and optimized into a generally effective model.

[0096] Local experimental verification: This experiment is independent of the federated learning framework and focuses on training and evaluating client models, determining the accuracy of personalized local models only for their own datasets. Their performance is compared with the client models under the federated learning framework to determine whether the client can benefit from federated learning, thereby revealing the advantages and limitations of centralized learning and federated learning.

[0097] In order to verify the effectiveness of FedPA, under the federated learning framework, the present invention selects 1D-CNN and LSTM as experimental models, and the experimental results are shown in Table 3.

[0098]

[0099] Table 3. FedPA algorithm verification results

[0100] The experimental verification results of the ID-CNN model on the Pamap2 and RealWorld datasets show that the proposed FedPA requires (100, 83, 83) and (95, 80, 80) rounds of communication, respectively, and performs well in terms of generalization accuracy, indicating that its aggregation strategy enhances the generalization of the client model. Experiments on the LSTM model further show that FedPA reduces the number of aggregated communication rounds while maintaining global model accuracy. Figures 7(a) and 7(b) further demonstrate the aggregation dynamics of FedPA based on the 1D-CNN model on Pamap2 and RealWorld and its effectiveness under different verification modes. Figures 8(a) and 8(b) show the verification comparison of FedPA based on the LSTM model on the Pamap2 and RealWorld datasets.

[0101] On the other hand, a human behavior recognition system based on federated learning is provided, including a data acquisition module, a preprocessing module, an analysis module, a model building module, and a training module; wherein:

[0102] A data acquisition module is used to acquire a human behavior recognition data set;

[0103] A preprocessing module, used for preprocessing the human behavior recognition data set to obtain a first data set;

[0104] An analysis module, configured to perform a plurality of data imbalance characteristic analyses on the first data set;

[0105] The model building module is used to design the federated learning aggregation algorithm FedPA, which dynamically allocates weights for client model aggregation according to the sum of the client model parameters;

[0106] The training module is used to divide the first data set into a training set and a test set, use the training set to train the algorithm FedPA, and use the test set to evaluate the trained algorithm FedPA.

[0107] Finally, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a human behavior recognition method based on federated learning are implemented.

[0108] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A human behavior recognition method based on federated learning, characterized in that: The specific steps include the following: Get the human behavior recognition dataset; Preprocessing the human behavior recognition data set to obtain a first data set; Design a federated learning aggregation algorithm FedPA to dynamically assign weights to client model aggregations based on the total number of client model parameters; The first data set is divided into a training set and a test set, the training set is used to train the algorithm FedPA, and the test set is used to evaluate the trained algorithm FedPA.

2. According to the method for human behavior recognition based on federated learning in claim 1, it is characterized in that: It also includes performing multiple distribution imbalance characteristic analyses on the first data set to obtain analysis results, and designing a federated learning aggregation algorithm FedPA based on the analysis results.

3. According to claim 2, a method for human behavior recognition based on federated learning is characterized in that: The data imbalance characteristic analysis includes data volume imbalance analysis, label imbalance analysis, and feature distribution imbalance analysis.

4. The method for human behavior recognition based on federated learning according to claim 1, characterized in that: In the federated learning aggregation algorithm FedPA, the sum of parameters of each client model is calculated, and an aggregation weight coefficient is dynamically allocated to it according to the sum of parameters in each communication round.

5. The method for human behavior recognition based on federated learning according to claim 1, characterized in that: The configuration parameters of the federated learning aggregation algorithm FedPA include: the number of clients K, the number of communication rounds T between the server and the client, the local batch size B, the learning rate η, and the number of local iterations E.

6. The method for human behavior recognition based on federated learning according to claim 5, characterized in that: The training process of the federated learning aggregation algorithm FedPA is as follows: Step 1: Use the preset initial parameters to initialize the global model w0; Step 2: At the beginning of each round of communication, the server sends the global model w0 to all clients participating in the training to ensure that each client is trained on the same starting model; Step 3: After receiving w0, the client loads the global model w0 into the client's local model, and uses its own data and computing resources to perform E iterations of training to optimize the model parameters; Step 4: During the local training process, use the stochastic gradient descent algorithm to minimize the loss function. Step 5: Select cross entropy loss as the loss function to evaluate the gap between the client model predicted label and the actual label; Step 6: After each round of local training, the client will update its client model After receiving the updated models from all clients, the server calculates the parameters and W of all client models and obtains the aggregated global model w′ t ; Step 7: Loop through steps 2 to 5 to complete a communication round, and continue until all specified rounds are completed, thereby obtaining an optimized global model consistent with the predetermined goal of federated learning.

7. The method for human behavior recognition based on federated learning according to claim 6, characterized in that: The calculation process of minimizing the loss function using the stochastic gradient descent algorithm is: Where, for each client k in round t, the client model parameters Use learning rate η = 0.01 to update, b represents a specific data batch, L represents the loss function, and use a specific data batch b to determine the loss function L. The gradient of 8. The method for human behavior recognition based on federated learning according to claim 6, characterized in that: The calculation formula of the loss function is: Among them, C represents the total number of categories, y i,c is an indicator function indicating whether sample i belongs to category c, is the probability that sample i belongs to class c assigned by the client model.

9. A human behavior recognition system based on federated learning, characterized in that: It includes data acquisition module, preprocessing module, analysis module, model building module and training module; among them, The data acquisition module is used to acquire a human behavior recognition data set; The preprocessing module is used to preprocess the human behavior recognition data set to obtain a first data set; The analysis module is used to perform multiple data imbalance characteristic analyses on the first data set; The model building module is used to design a federated learning aggregation algorithm FeddPA, which dynamically allocates weights for client model aggregation according to the sum of client model parameter quantities; The training module is used to divide the first data set into a training set and a test set, use the training set to train the algorithm FedPA, and use the test set to evaluate the trained algorithm FedPA.

10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of a human behavior recognition method based on federated learning as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Tumor radiotherapy adverse reaction prediction system based on federated learning

    CN120524231A