Gait recognition model training method and system based on federated learning mode
By adopting the gait recognition model training method with federated learning mode in gait recognition, the problem of achieving effective gait recognition while protecting user privacy is solved, data localization is realized, data centralization is avoided, and legal compliance and model performance is ensured.
Patent Information
- Application Number
- CN202210355478.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-04-06
AI Technical Summary
Existing gait recognition technologies are difficult to achieve effective gait recognition while protecting user privacy, especially when complying with privacy and data protection regulations such as the General Data Protection Regulations.
The gait recognition model training method based on federated learning mode is adopted. The client performs preprocessing and model training of gait data locally through the client, and the updated model parameters are sent to the server for aggregation, realizing the update and push of the global model, ensuring that the data is processed and stored locally, and avoiding centralized processing of sensitive data.
It realizes effective gait recognition while protecting user privacy, avoids the legal risk of data leakage, and improves the robustness and generalization of the model.
Smart Images

Figure CN114882582B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gait recognition, and in particular to a gait recognition model training method and system based on a federated learning mode. Background Art
[0002] Gait recognition is a biometric recognition technology that can identify a person through his gait pattern. Unlike other biometric recognition technologies (such as face, fingerprint, palm print, etc.), gait recognition has unique characteristics, including long-distance recognition, non-contact and difficult to forge. With the development of deep neural networks, the performance of gait recognition has been greatly improved. Since gait data is affected by many factors, such as camera angle, clothing, and objects carried, gait recognition based on deep learning requires a large number of diverse gait profile sequences for training to obtain a deep learning model with strong generalization. However, all countries currently attach great importance to biometric privacy and have introduced regulations to protect citizens' privacy from infringement. The General Data Protection Regulation (GDPR) is a privacy and data protection regulation promulgated by the European Union. The General Data Protection Regulation requires companies to strictly protect the privacy of users and not to disclose user information without the knowledge of users. The privacy information protected by the General Data Protection Regulation includes identity information, network data, biometric information, etc. Similar regulations include the California Consumer Privacy Act and the China Data Security Law. Due to the above-mentioned regulations, there are certain difficulties in collecting biometric data.
[0003] Federated learning is to conduct joint learning modeling and optimization of the data of each participant under the premise that the participants do not leak data, that is, to train locally, and to find the optimal global model. The so-called participants refer to different institutions or computing devices with certain computing power, such as hospitals and schools or mobile phones and computers. The so-called machine learning model refers to a model composed of a series of neural network units; the modeling optimization process refers to changing the model parameters under the condition that the structure of the machine learning model is certain, so that the model can better fit the training and test data. Generally, according to the characteristics of data distribution, federated learning can be divided into two types: horizontal federated learning and vertical federated learning. Horizontal federated learning represents the scenario where the training data of each participant has the same feature space but different sample spaces. The so-called sample space refers to the category to which the data belongs. The current gait recognition scenario meets the scope of horizontal federated learning. At present, the most popular algorithm in horizontal federated learning is the FedAvg algorithm. The FedAvg algorithm averages the training parameters of each participant so that each participant can converge quickly during training and the trained model is more generalized.
[0004] However, there is currently no gait recognition solution that can avoid leakage of user privacy data. Summary of the invention
[0005] During the gait recognition process, the user's identity information will inevitably be obtained. How to protect the user's identity privacy data during the recognition process, ensure the security of the recognition data, and avoid legal risks is a problem that needs to be solved urgently.
[0006] In view of the above problems, a gait recognition model training method and system based on the federated learning mode are proposed. The local gait recognition model unit is trained by using the global model parameters of the corresponding local gait recognition model obtained by the client, the local model parameters are updated, and the updated local model parameters are sent to the server. The server aggregates the received local model parameters, trains the global gait recognition model unit, updates the corresponding global model parameters, and sends the updated global model parameters corresponding to the local model parameters to multiple clients respectively, thereby realizing simultaneous but non-centralized training of multiple local model data, and having strong robustness and generalization.
[0007] In the first aspect, a gait recognition model training method based on a federated learning mode includes:
[0008] Step 100: pre-processing the local gait data of the client;
[0009] Step 200, the server initializes global model parameters, current communication times and total communication times;
[0010] Step 300: After receiving the global model parameters of the corresponding local gait recognition model transmitted by the server, the client uses the preprocessed local gait data to train the local gait recognition model and sends the trained local model parameters to the server;
[0011] Step 400: The server uses an aggregation function to aggregate all uploaded local model parameters, updates the global model parameters, and sends the local model parameters to each corresponding client.
[0012] Step 500, repeating steps 300 to 400 until the total number of communications reaches a specified threshold;
[0013] The global model parameters are used to update the local gait recognition model parameters of multiple clients communicating with the server, the current communication times are used to record the current number of federated communications, and the total communication times are used to limit the number of federated communications.
[0014] In conjunction with the gait recognition model training method based on the federated learning mode described in the first aspect of the present invention, in a first possible implementation, step 100 includes:
[0015] Step 110: performing target detection on the collected gait video;
[0016] Step 120: extract the content in the target detection frame to obtain the original image;
[0017] Step 130, separating the front and back background of the original image to obtain a binary image;
[0018] Step 140: Normalize the binary image to obtain a gait profile image x at time t t ;
[0019] Step 150: Repeat steps 110 to 140 to obtain a gait profile sequence:
[0020] X={x1,x2,...,x t ,...,x k} (1)
[0021] Wherein, k is the length of the gait profile sequence, and preferably, the value range of k is [24,32].
[0022] In combination with the first possible implementation of the first aspect of the present invention, in a second possible implementation, step 110 includes:
[0023] Step 111: Use the target detection SSD algorithm to perform target detection on the acquired gait video to obtain the target detection frame position;
[0024] Step 112: Use the target detection frame position to mark the detected pedestrian image information.
[0025] In combination with the first possible implementation manner of the first aspect of the present invention, in a third possible implementation manner, step 130 includes:
[0026] Step 131, grayscale the original image to obtain a grayscale image;
[0027] Step 132, using the image segmentation Ostu algorithm to separate the front and back background of the grayscale image to obtain a binary image;
[0028] The background is set to black and the pedestrian foreground is set to white.
[0029] In combination with the first possible implementation manner of the first aspect of the present invention, in a fourth possible implementation manner, step 140 includes:
[0030] Step 141, performing pixel search on the binary image to obtain the positions of the topmost and bottommost white pixels;
[0031] Step 142, cropping the binary image to remove the image above the top and the image below the bottom, to obtain a cropped binary image;
[0032] Step 143: Scale the cropped binary image to a fixed ratio to obtain the gait profile image x at time t t .
[0033] In combination with the gait recognition model training method described in the first aspect of the present invention, in a fifth possible implementation, step 300 includes:
[0034] Step 310, initializing the number of local training iterations and the current number of iterations;
[0035] Step 320: forward input the global model parameters to the local gait recognition model to obtain gait features and predicted gait feature categories;
[0036] Step 330: constraining the generation of the gait feature and the determination of the gait feature category by a local loss function;
[0037] Step 340: Repeat steps 310 to 330 to update the local gait recognition model parameters and the current iteration number until the current iteration number reaches the local training iteration number threshold.
[0038] In combination with the fifth possible implementation manner of the first aspect of the present invention, in a sixth possible implementation manner, step 330 includes:
[0039] Step 331: Obtain the triplet loss function L according to different gait characteristics and set boundary values triplet :
[0040]
[0041] Where N is the number of triplets. Preferably, the value range of N is [8, 32], and the value range of i is [1, N]. i a and f i p represents the features extracted from different sequences of the same person, f i a and f i n represents the features extracted from gait sequences of different people, m is the boundary value, preferably, the value range of m is [0.1,1];
[0042] Step 332: Predict x belongs to y according to the fully connected layer i The probability p i , get the cross entropy loss function L cross (x):
[0043]
[0044] Among them, K is the number of categories, which is related to the number of categories in the training data set, i is a temporary variable, and its value range is [1, K]; x represents the input feature, y i Represents the true label of the input feature.
[0045] Step 333: Configure the local loss function L as the triple loss function L triplet With the cross entropy loss function L cross The sum of (x):
[0046] L=αL triplet +βL cross (4)
[0047] Among them, α and β are the weight values of the triplet loss function and the cross entropy loss function respectively, and the value range of α and β is [0,1].
[0048] In combination with the fifth possible implementation manner of the first aspect of the present invention, in a seventh possible implementation manner, step 340 includes:
[0049] Step 341: derive the local loss function L to obtain its derivative function
[0050] Step 342: Update the local model parameters using equation (5):
[0051]
[0052] Where, e = 1, 2, ..., E, E is the total number of local training iterations, η is the training learning rate, It is derived from the above loss function, W e are the model parameters for the e-th training iteration.
[0053] In a second aspect, a gait recognition model training system based on a federated learning mode adopts the training method described in the first aspect, including:
[0054] Multiple clients;
[0055] Server side;
[0056] The client comprises:
[0057] Local gait recognition model unit;
[0058] Training unit;
[0059] The server side includes
[0060] Global gait recognition model unit;
[0061] Aggregate unit;
[0062] The training unit is used to train the local gait recognition model unit according to the global model parameters of the corresponding local gait recognition model received from the server, update the local model parameters, and send the updated local model parameters to the server;
[0063] The aggregation unit is used to aggregate the received local model parameters, update the global model parameters, and send the updated corresponding global model parameters to multiple corresponding clients respectively.
[0064] In conjunction with the gait recognition model training system based on the federated learning mode described in the second aspect of the present invention, in a first possible implementation manner, the training unit includes:
[0065] Identify the unit;
[0066] The determination unit is used to calculate a local loss function according to a triplet loss function and a cross entropy loss function, and determine a gait feature and a category to which the gait feature belongs according to the local loss function;
[0067] The aggregation unit aggregates the local model parameters of each client using an aggregation function to obtain a global model parameter, and the global model parameter expression is:
[0068]
[0069] Where, h = 0, 1, 2, ..., H, c represents the total number of clients; Indicates the ratio of the data on the cth client to the total amount of data; represents the local model parameters of the c-th client before the c-th aggregation; W h+1 represents the global model parameters after the hth aggregation; H is the total number of aggregation cycles.
[0070] The present invention is implemented in a method and system for training a gait recognition model based on a federated learning mode. The local gait recognition model unit is trained by using the global model parameters of the corresponding local gait recognition model obtained by the client, the local model parameters are updated, and the updated local model parameters are sent to the server. The server aggregates the received local model parameters, trains the global gait recognition model unit, updates the corresponding global model parameters, and sends the updated global model parameters corresponding to the local model parameters to multiple clients respectively, thereby realizing simultaneous but non-centralized training of multiple local model data and having strong robustness and generalization. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0072] Figure 1 It is a logical connection diagram of the first embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0073] Figure 2 It is a logical connection diagram of the second embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0074] Figure 3 It is a logical connection diagram of the third embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0075] Figure 4 It is a logical connection diagram of the fourth embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0076] Figure 5 It is a logical connection diagram of the fifth embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0077] Figure 6 It is a logical connection diagram of the sixth embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0078] Figure 7 It is a logical connection diagram of the seventh embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0079] Figure 8 It is a logical connection diagram of the eighth embodiment of the gait recognition model training method based on the federated learning mode in the present invention;
[0080] Fig. 9 It is a logical connection diagram of the first embodiment of the gait recognition model training system based on the federated learning mode in the present invention;
[0081] Fig.10 It is a logical connection diagram of the second embodiment of the gait recognition model training system based on the federated learning mode in the present invention;
[0082] The numbers in the accompanying drawings indicate the following parts: 10 - client, 11 - local gait recognition model unit, 12 - training unit, 20 - server. DETAILED DESCRIPTION
[0083] The following will be combined with the accompanying drawings in the invention to clearly and completely describe the technical solutions in 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 in the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0084] Name Explanation
[0085] The SSD (Single Shot MultiBox Detector) algorithm is a network that uses multi-scale features for target detection.
[0086] The Ostu algorithm, also known as the Otsu algorithm, is an algorithm for automatically binarizing cluster-based images. The Otsu algorithm calculates the optimal threshold that can divide the image into two classes of pixels (0 and 255) based on the image, so that the intra-class variance of these two classes of pixels is minimized.
[0087] During the gait recognition process, the user's identity information will inevitably be obtained. How to protect the user's identity privacy data during the recognition process, ensure the security of the recognition data, and avoid legal risks is a problem that needs to be solved urgently.
[0088] To address the above problems, a gait recognition model training method and system based on the federated learning model is proposed.
[0089] First, as Figure 1 , Figure 1 It is a logical connection diagram of the first embodiment of the gait recognition model training method based on the federated learning mode in the present invention, a gait recognition model training method based on the federated learning mode, including: step 100, preprocessing the local gait data of the client 10; step 200, the server 20 initializes the global model parameters, the current communication number and the total communication number; step 300, after the client 10 receives the global model parameters of the corresponding local gait recognition model transmitted by the server 20, the preprocessed local gait data is used to train the local gait recognition model and the trained local model parameters are sent to the server 20; step 400, the server 20 uses an aggregation function to aggregate all uploaded local model parameters, updates the global model parameters and sends the local model parameters to each corresponding client 10 respectively;
[0090] The global model parameter expression is:
[0091]
[0092] Wherein, h=0,1,2,...,H, c represents the total number of clients 10; represents the ratio of the data on the cth client 10 to the total amount of data; represents the local model parameters of the c-th client 10 before the c-th aggregation; W h+1 represents the global model parameters after the hth aggregation; H is the total number of aggregation cycles.
[0093] Step 500, repeat steps 300-400 until the total number of communications reaches a specified threshold; wherein the global model parameters are used to update the local gait recognition model parameters of multiple clients 10 communicating with the server 20, the current number of communications is used to record the current number of federal communications, and the total number of communications is used to limit the number of federal communications.
[0094] The server 20 sends the initial parameters corresponding to the local gait recognition model of the client 10 to each client 10. The client 10 initializes the local gait recognition model according to the initial parameters and performs cyclic training on the local gait recognition model. After one round of training, the local model parameters are uploaded to the server 20. The server 20 aggregates the received local model parameters of the client 10 using an aggregation function and then sends them to each client 10 one by one.
[0095] Preferably, if Figure 2 , Figure 2 1 is a logical connection diagram of the second embodiment of the gait recognition model training method based on the federated learning mode in the present invention. Step 100 includes: step 110, performing target detection on the collected gait video; step 120, extracting the content in the target detection frame to obtain the original image; step 130, separating the front and back background of the original image to obtain a binary image; step 140, normalizing the binary image to obtain a gait profile image x at time t t ; Step 150, repeat steps 110-140 to obtain a gait profile sequence:
[0096] X={x1,x2,...,x t ,...,x k} (1)
[0097] Wherein, k is the length of the gait profile sequence, and preferably, the value range of k is [24,32].
[0098] Usually k=32 is a gait cycle, and the gait profile is a binary image composed of 0 and 255.
[0099] Preferably, if Figure 3 , Figure 3It is a logical connection diagram of the third embodiment of the gait recognition model training method based on the federated learning mode in the present invention. Step 110 includes: Step 111, using the target detection SSD algorithm to perform target detection on the acquired gait video to obtain the target detection frame position; Step 112, using the target detection frame position to mark the detected pedestrian image information.
[0100] Preferably, if Figure 4 , Figure 4 It is a logical connection diagram of the fourth embodiment of the gait recognition model training method based on the federated learning mode in the present invention, and step 130 includes: step 131, graying the original image to obtain a gray image; step 132, using the image segmentation Ostu algorithm to separate the front and back background of the gray image to obtain a binary image; wherein the background is set to black and the pedestrian foreground is set to white.
[0101] Preferably, if Figure 5 , Figure 5 1 is a logical connection diagram of the fifth embodiment of the gait recognition model training method based on the federated learning mode in the present invention, and step 140 includes: step 141, performing pixel retrieval on the binary image to obtain the positions of the topmost and bottommost white pixels; step 142, cropping the binary image to remove the image above the topmost and the image below the bottommost to obtain a cropped binary image; step 143, scaling the cropped binary image to a fixed ratio to obtain a gait profile image x at time t. t .
[0102] Preferably, if Figure 6 , Figure 6 It is a logical connection diagram of the sixth embodiment of the gait recognition model training method based on the federated learning mode in the present invention, and step 300 includes: step 310, initializing the local training iteration number and the current iteration number; step 320, forward inputting the global model parameters to the local gait recognition model to obtain the gait features and the predicted gait feature categories; step 330, constraining the generation of gait features and the judgment of gait feature categories through the local loss function; step 340, repeating steps 310-330 to update the local gait recognition model parameters and the current iteration number until the current iteration number reaches the local training iteration number threshold.
[0103] After receiving the global model parameters transmitted from the server 20, the client 10 assigns the global model parameters to the local gait recognition model as local model parameters, and further trains the local gait recognition model. The local gait recognition model refers to the model of the client 10, which cannot be transmitted and communicated with other clients 10. The local gait recognition model of each client 10 is the same model. The local gait recognition model can be: a gait recognition model GaitSet, GaitPart based on a neural network. By using the client 10 to train the local gait recognition model unit 11 with the global model parameters corresponding to the local gait recognition model obtained, the local model parameters are updated, and the updated local model parameters are sent to the server 20, and the server is used to aggregate the received local model parameters, and the global gait recognition model unit is trained, the corresponding global model parameters are updated, and the updated global model parameters corresponding to the local model parameters are sent to multiple clients 10 respectively, so that the local model data of multiple parties can be trained simultaneously but not centralized, and it has strong robustness and generalization.
[0104] Preferably, if Figure 7 , Figure 7 330 is a logical connection diagram of the seventh embodiment of the gait recognition model training method based on the federated learning mode in the present invention. Step 331 includes: Step 332, obtaining the triple loss function L according to different gait characteristics and the set boundary value triplet :
[0105]
[0106] Where N is the number of triplets. Preferably, the value range of N is [8, 32], and the value range of i is [1, N]. i a and f i p represents the features extracted from different sequences of the same person, f i a and f i n represents the features extracted from gait sequences of different people, m is the boundary value, preferably, the value range of m is [0.1,1];
[0107] Step 332: Predict x belongs to y according to the fully connected layer i The probability p i , get the cross entropy loss function L cross (x):
[0108]
[0109] Among them, K is the number of categories, which is related to the number of categories in the training data set, i is a temporary variable, and its value range is [1, K]; x represents the input feature, y i Represents the true label of the input feature.
[0110] Step 333: Configure the local loss function L as the triple loss function L triplet With the cross entropy loss function L cross The sum of (x):
[0111] L=αL triplet +βL cross (4)
[0112] Among them, α and β are the weight values of the triplet loss function and the cross entropy loss function respectively, and the value range of α and β is [0,1].
[0113] Preferably, if Figure 8 , Figure 8 is a logical connection diagram of the eighth embodiment of the gait recognition model training method based on the federated learning mode in the present invention; step 340 includes: step 341, deriving the local loss function L to obtain its derivative function Step 342: Update the local model parameters using equation (5):
[0114]
[0115] Where, e = 1, 2, ..., E, E is the total number of local training iterations, η is the training learning rate, It is derived from the above loss function, W e are the model parameters for the e-th training iteration.
[0116] Second, as Fig. 9 and Fig.10 , Fig. 9 is a logical connection diagram of the first embodiment of the gait recognition model training system based on the federated learning mode in the present invention, Fig.10It is a logical connection diagram of the second embodiment of the gait recognition model training system based on the federated learning mode in the present invention; a gait recognition model training system based on the federated learning mode, adopts the training method of the first aspect, includes multiple clients 10 and a server 20; the client 10 includes a local gait recognition model unit 11 and a training unit 12; the server 20 includes an aggregation unit; the training unit 12 is used to train the local gait recognition model unit 11 according to the global model parameters of the corresponding local gait recognition model received from the server 20, update the local model parameters, and send the updated local model parameters to the server 20; the aggregation unit is used to aggregate the received local model parameters, update the global model parameters, and send the updated corresponding global model parameters to multiple corresponding clients 10 respectively.
[0117] Preferably, in a first possible implementation manner, the training unit 12 includes:
[0118] Determination unit: The determination unit is used to calculate the local loss function according to the triplet loss function and the cross entropy loss function, and determine the gait feature and the category to which the gait feature belongs according to the local loss function.
[0119] First, the triplet loss function L is obtained according to different gait characteristics and set boundary values. triplet :
[0120]
[0121] Where N is the number of triplets, the value range of N is [8,32], and the value range of i is [1,N] (indicated in the formula) i a and f i p represents the features extracted from different sequences of the same person, f i a and f i n Represents the features extracted from gait sequences of different people, m is the boundary value, and the value range of m is [0.1,1].
[0122] Then, according to the fully connected layer, we predict that x belongs to y i The probability p i , get the cross entropy loss function L cross (x):
[0123]
[0124] Among them, K is the number of categories, and the value range of K is; p i The value range of i in (whether it is the same as i in formula 3); x represents the input feature, yi Represents the true label of the input feature.
[0125] Finally, the local loss function L is configured as the triplet loss function L triplet With the cross entropy loss function L cross The sum of (x):
[0126] L=αL triplet +βL cross (4)
[0127] Among them, α and β are the weight values of the triplet loss function and the cross entropy loss function respectively.
[0128] The aggregation unit uses an aggregation function to aggregate the local model parameters of each client to obtain the global model parameters. The expression of the global model parameters is:
[0129]
[0130] Where, h = 0, 1, 2, ..., H, c represents the total number of clients; Indicates the ratio of the data on the cth client to the total amount of data; represents the local model parameters of the c-th client before the c-th aggregation; W h+1 represents the global model parameters after the hth aggregation; H is the total number of aggregation cycles.
[0131] The method and system for training a gait recognition model based on a federated learning mode described in the present invention are implemented. The local gait recognition model unit 11 is trained by using the client 10 to obtain the global model parameters corresponding to the local gait recognition model, the local model parameters are updated, and the updated local model parameters are sent to the server 20. The server is used to aggregate the received local model parameters, train the global gait recognition model unit, update the corresponding global model parameters, and send the updated global model parameters corresponding to the local model parameters to multiple clients 10 respectively, thereby realizing simultaneous but non-centralized training of multiple local model data, and having strong robustness and generalization.
[0132] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A gait recognition model training method based on a federated learning model, characterized in that: include: Step 100, preprocessing the local gait data of the client, said step 100 includes: step 110, performing target detection on the collected gait video to obtain the target detection frame; step 120, extracting the content in the target detection frame to obtain the original image; step 130, separating the front and back background of the original image to obtain a binary image; step 140, normalizing the binary image to obtain the gait profile image x at time t t ; Step 150, repeat steps 110-140 to obtain a gait profile sequence: X = {x1, x2, ..., x t ,...,x k }, where k is the length of the gait profile sequence; Step 200, the server initializes global model parameters, current communication times and total communication times; Step 300: After receiving the global model parameters of the corresponding local gait recognition model transmitted by the server, the client uses the preprocessed local gait data to train the local gait recognition model and sends the trained local model parameters to the server; Step 400: The server uses an aggregation function to aggregate all uploaded local model parameters, updates the global model parameters, and sends the local model parameters to each corresponding client. Step 500, repeating steps 300 to 400 until the total number of communications reaches a specified threshold; The global model parameters are used to update the local gait recognition model parameters of multiple clients communicating with the server, the current communication times are used to record the current number of federated communications, and the total communication times are used to limit the number of federated communications.
2. The gait recognition model training method according to claim 1, characterized in that: The step 110 includes: Step 111: Use the target detection SSD algorithm to perform target detection on the acquired gait video to obtain the target detection frame position; Step 112: Use the target detection frame position to mark the detected pedestrian image information.
3. The gait recognition model training method according to claim 1, characterized in that: The step 130 includes: Step 131, grayscale the original image to obtain a grayscale image; Step 132, using the image segmentation Ostu algorithm to separate the front and back background of the grayscale image to obtain a binary image; The background is set to black and the pedestrian foreground is set to white.
4. The gait recognition model training method according to claim 1, characterized in that: The step 140 includes: Step 141, performing pixel search on the binary image to obtain the positions of the topmost and bottommost white pixels; Step 142, cropping the binary image to remove the image above the top and the image below the bottom, to obtain a cropped binary image; Step 143: Scale the cropped binary image to a fixed ratio to obtain the gait profile image x at time t t .
5. The gait recognition model training method according to claim 1, characterized in that: The step 300 includes: Step 310, initializing the number of local training iterations and the current number of iterations; Step 320: forward input the global model parameters to the local gait recognition model to obtain gait features and predicted gait feature categories; Step 330: constraining the generation of the gait feature and the determination of the gait feature category by a local loss function; Step 340: Repeat steps 310 to 330 to update the local gait recognition model parameters and the current iteration number until the current iteration number reaches the local training iteration number threshold.
6. The gait recognition model training method according to claim 5, characterized in that: The step 330 includes: Step 331: Obtain the triplet loss function L according to different gait characteristics and set boundary values triplet : Where N is the number of triplets, i ranges from [1, N], and f i a and f i p represents the features extracted from different sequences of the same person, f i a and f i n represents the features extracted from gait sequences of different people, and m is the boundary value; Step 332: Predict x belongs to y according to the fully connected layer i The probability p i , get the cross entropy loss function L cross (x): Among them, K is the number of categories, i is a temporary variable; x represents the input feature, y i Represents the true label of the input feature; Step 333: Configure the local loss function L as the triple loss function L triplet With the cross entropy loss function L cross The sum of (x): L=αL triplet +βL cross (4) Among them, α and β are the weight values of the triplet loss function and the cross entropy loss function respectively, and the value range of α and β is [0,1].
7. The gait recognition model training method according to claim 5, characterized in that: The step 340 includes: Step 341: Derivative the local loss function L to obtain its derivative function Step 342: Update the local model parameters using equation (5): Where, e=1,2,...,E, E is the total number of local training iterations, η is the training learning rate, W e are the model parameters for the e-th training iteration.
8. A gait recognition model training system based on a federated learning mode, using the training method described in any one of claims 1 to 7, characterized in that: include: Multiple clients; Server side; The client comprises: Local gait recognition model unit; Training unit; The server side includes: Global gait recognition model unit; Aggregate unit; The training unit is used to train the local gait recognition model unit according to the global model parameters of the corresponding local gait recognition model received from the server, update the local model parameters, and send the updated local model parameters to the server; The aggregation unit is used to aggregate the received local model parameters, update the global model parameters, and send the updated corresponding global model parameters to multiple corresponding clients respectively; The aggregation unit aggregates the local model parameters of each client using an aggregation function to obtain a global model parameter, and the global model parameter expression is: Where, h = 0, 1, 2, ..., H, c represents the total number of clients; Indicates the ratio of the data on the cth client to the total amount of data; represents the local model parameters of the c-th client before the c-th aggregation; W h+1 represents the global model parameters after the hth aggregation; H is the total number of aggregation cycles.
9. The gait recognition model training system according to claim 8, characterized in that: The training unit comprises: Identify the unit; The determination unit is used to calculate a local loss function according to a triplet loss function and a cross entropy loss function, and to determine a gait feature and a category to which the gait feature belongs according to the local loss function.
Citation Information
Patent Citations
Method for establishing data analysis model
CN111190487A
Cross-sample federal classification modeling method and device, storage medium and electronic equipment
CN113408209A