Person Re-ID Method Based on Adaptive Personalized Federated Learning

By adopting the adaptive personalized federated learning method in pedestrian recognition, a personalized local model and global model are constructed, and through adaptive aggregation weights and collaborative learning, the problem of large differences in data distribution in pedestrian recognition and data cannot be centrally shared, improving model performance and accuracy.

CN115565206BActive Publication Date: 2025-08-29CHINA UNIV OF MINING & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211404940.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-08-29
Estimated Expiration
2042-11-10

Smart Images

  • Figure CN115565206B_ABST
    Figure CN115565206B_ABST
Patent Text Reader

Abstract

The present invention discloses a pedestrian re-identification method based on adaptive personalized federated learning, which belongs to the field of image processing technology. The specific steps are as follows: preprocessing pedestrian re-identification data in different regions; constructing training data sets in different regions; building personalized local models; collaboratively training local models and global models; constructing test data sets in different regions; performing inference based on the customized personalized local models; and outputting pedestrian re-identification results. The present invention solves the problem that existing methods are difficult to quickly and centrally learn based on the wide distribution of surveillance cameras and the rapid update of collected image data. The method has simple steps, high processing efficiency, and high pedestrian re-identification accuracy in federated learning scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing technology, and in particular relates to a pedestrian re-identification method based on adaptive personalized federated learning in the field of pedestrian re-identification. Background Art

[0002] With the development and expansion of deep learning, deep learning models have made significant progress in various fields, including person re-identification (PRI). With the rapid advancement of deep learning, PRI technology is also continuously improving. Similar to image retrieval, the goal of PRI is to use a given pedestrian image to search for the presence of the same pedestrian in a library of images or videos. Due to the higher similarity of pedestrian features, PRI is more challenging than general image retrieval. Due to its significant application value, it has been widely used in smart cities, unmanned supermarkets, drone search, autonomous driving, and other fields, and has attracted increasing research attention in recent years. Current PRI research methods mostly follow a centralized learning paradigm, aggregating all training data for model parameter training. However, in real-world applications, the widespread distribution of surveillance cameras and the rapid update of collected video data pose challenges to this centralized learning paradigm.

[0003] To address these issues, some recent research has applied federated learning to person re-identification tasks. This allows for the construction of a globally universal model without requiring direct access to local training data from other domains. However, video surveillance data from different regions exhibits significant distributional variations. Models derived from existing federated learning-based person re-identification methods are difficult to efficiently apply to data from different regions simultaneously, resulting in poor model performance at each node. Therefore, it is necessary to address this issue of poor model performance across different nodes.

[0004] Compared with general person re-identification, person re-identification based on federated learning has the following problems:

[0005] (1) Data has statistical heterogeneity: Data is affected by factors such as geographic location, clothing style, shooting environment, and time, which can cause significant differences in image style, that is, differences between domains. Huge domain differences often significantly affect the performance of pedestrian re-identification algorithms;

[0006] (2) Data cannot be centralized: Due to privacy protection and other issues, different datasets in different regions cannot be shared with each other, nor can they be uploaded to a public server for centralization.

[0007] These issues significantly limit the development of federated learning algorithms for person re-identification. Existing methods often focus on building a good, universal global model, but ignore the statistical heterogeneity between different datasets, resulting in poor model performance at each node. Summary of the Invention

[0008] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and propose a pedestrian re-identification method based on adaptive personalized federated learning. Compared with the prior art, the global model is difficult to adapt to the distribution characteristics of different data in multiple domains at the same time. A personalized local model is designed. The model contains two modules, one for global aggregation and the other for assisting the global model in personalized modeling of local data; a collaborative learning method of local model and global model is proposed to improve the adaptability of the local model to local domain data, and an adaptive aggregation weight method is designed for updating the global model parameters to improve the performance of the global model, thereby effectively solving the problem of poor performance of the local model of pedestrian re-identification based on federated learning, and using a personalized local model to customize an exclusive local model for each node to solve the problem of statistical heterogeneity of data in different regions.

[0009] To achieve the above technical objectives, the present invention provides a person re-identification method based on adaptive personalized federated learning, which utilizes a person re-identification system. The pedestrian re-identification system includes a server for aggregating federated model parameters. The server is connected to multiple client nodes with training capabilities and performing training on different data sets. The server assigns training weights to different client nodes, and the client nodes transmit weights back to the server.

[0010] Taking advantage of the wide distribution of surveillance cameras and the rapid update of collected image data, we conduct rapid centralized learning and pre-process pedestrian re-identification data in different areas;

[0011] Build a pedestrian re-identification model based on adaptive personalized federated learning. The pedestrian re-identification model includes a local personalized model and a global model.

[0012] Generate training datasets with different characteristics for different regions and train a person re-identification model based on adaptive personalized federated learning:

[0013] Acquire and construct test datasets for different regions. For different client nodes, input the test samples into the personalized local models in different client nodes. The global aggregation module and the local personalized module work together to perform inference and obtain feature vectors.

[0014] The cosine distance is calculated between the feature vector obtained from the query image and the feature vector obtained from the images in the image library, and the result with the highest ranking is taken as the final result.

[0015] The specific steps are as follows:

[0016] S1. Build a pedestrian re-identification model based on adaptive personalized federated learning. The pedestrian re-identification model includes multiple local personalized models M L and the global model M G , where each client node has a local personalized model M L , global model M G Only set in the server; the local personalized model includes two sub-modules, namely the global aggregation module E g and local personalization module E l The two submodules belong to the Osnet network. A tensor with a dimension equal to the output feature map is initialized to connect the two submodules. The structure of the global model is consistent with the global aggregation module of the local personalized model. It also uses the Osnet network. The parameters are obtained by the global aggregation module of the local personalized model through personalized weight aggregation.

[0017] S2. Construct a training dataset of pedestrian information in different areas for each client: Use multiple public pedestrian re-identification datasets to simulate the dataset, divide the training set and test set according to the official documents of different datasets, adjust each image in the pedestrian re-identification dataset to a uniform size, and perform data enhancement; Construct a data loader for each client node to personalize the client's model M. L Provide data for training;

[0018] S3. Each client trains a person re-identification model based on adaptive personalized federated learning on its own dataset, and uses the local training dataset of the client node to ground the client’s own global aggregation module E. g Train and then use the trained global aggregation module E g Send it to the server and use the adaptive aggregation weight to fuse it to obtain the global model M G ; Local Personalization Module E l Use the local dataset only for training without global aggregation; the aggregated global model M G Send it to the client in each different region, and aggregate the global model M G Replacement for local personalized model M L Global aggregation module E g , and then use the local personalized module E trained above l For the global aggregation module E g Make corrections to prevent global aggregation module E g The deviation from the local data feature space is too large. After several rounds of iterative training, the trained local personalized model M is obtained. LFinally, the personalized weights in S1 will be used to use the trained local personalized model M L Global aggregation module E g and local personalization module E l The two are connected and then trained together using the local training dataset to obtain the final local personalized model M L ;

[0019] S4. Repeat step S2 to obtain test samples from different regions, so that all client nodes generate data sets from different regions:

[0020] S5. Input the test samples from different regions into the exclusive local personalized models of the client nodes in different regions, and the global aggregation module and the local module jointly infer the test sample features;

[0021] S6. Compare and sort the obtained sample features with the features in the image library officially divided by the dataset, and select the image in the image library with the highest similarity as the final test result.

[0022] Furthermore, the local personalized model in the pedestrian re-identification model includes a global aggregation module and a local personalized module. Both the global aggregation module and the local personalized module use the Osnet structure. The parameters of the global aggregation module and the local personalized module are not shared. It is a pseudo twin network. The images in the input sample dataset are respectively passed through the global aggregation module E g and local personalization module E l Get the final feature map E l (x), Then initialize the learnable weight parameters The first dimension of the weights is equal to the feature map E output by the global aggregation module and the local personalization module l (x), The channel dimension of the remaining two dimensions are H and W, which are set to 1, and then the output feature map E l (x), Multiply by weights λ and 1-λ respectively and add them together to get the final feature output. The formula is as follows:

[0023] F(E l (x),E g (x))=λE g (x)+(1-λ)E l (x).

[0024] Furthermore, the global model M in the person re-identification model G The Osnet structure is used, and the global model parameters are obtained by the global aggregation module of the personalized local model through adaptive aggregation weight aggregation.

[0025] The adaptive weight specifically includes, in the first 5 iterations of training, using the dataset size of different client nodes as the aggregation weight to perform weighted aggregation on the global aggregation module of the personalized local model of different clients, assuming that the dataset size of different client nodes is N i , global model M G The parameter is w g , global aggregation module E of local personalized model g The weight of Then use the formula: Get the full global model M G , where N represents the sum of the training dataset sizes of all client nodes. In subsequent training iterations, the dynamically adjusted adaptive cosine distance is used as the aggregation weight, and the local personalized model M of each client node is used. L Global aggregation module E g Dynamically assign weights to changes in the global model M. Large changes should be G The aggregation process has a greater weight so that more newly learned knowledge can be included;

[0026] The model change of each node k is measured by cosine distance. The steps are as follows: the client node randomly selects a batch of training data D from the local training data set batch ; When the client node receives the global model M sent back to the client node from the server that aggregates the global model in the tth round of training G When using training data D batch Through local personalized model M L Global aggregation module E g Get the logit vector Then the global aggregation module E is trained using the local dataset. g , and use D again after training batch Through local personalized model M L Global aggregation module E g Get the logit vector The aggregate weight of the client node is:

[0027]

[0028] By calculating the cosine distance between two logit vectors as weights, we dynamically assign weights according to the changes in the model. Larger changes should contribute more to the model aggregation.

[0029] Furthermore, the steps for training the person re-identification model based on adaptive personalized federated learning are as follows:

[0030] S3a, first use the local personalized model M on each client nodeL Global aggregation module E g and local personalization module E l Use different datasets for training separately, use cross entropy loss as loss function, and then only use the global aggregation module E of each client node g Send it to the server and use the adaptive aggregation weight to fuse it to obtain the global model M G Parameters, local personalization only uses local datasets for training without global aggregation;

[0031] S3b, the new global model M after server-side aggregation G The parameters are sent back to each client node, using the new global model M G Replacement for local personalized model M L Global aggregation module E g ;

[0032] S3c, repeat the training of S3a and S3b until the training requirements are met, and obtain a trained local personalized model M L Then, the trained global aggregation module and local personalized module are combined for collaborative training using a collaborative learning method. This allows the local personalized model to adapt well to the distribution of the local dataset and obtain information from the datasets of other client nodes, ensuring that the local personalized model does not overfit the local dataset.

[0033] Collaborative learning uses a person re-identification model based on adaptive personalized federated learning to fuse the global aggregation module and local personalized module of the local personalized model using learnable weights. The weights of the global aggregation module are then frozen. On each client node, the parameters of the local personalized module and the learnable weight parameters are trained using the client node's local dataset. Finally, a customized personalized local model is obtained for each client node.

[0034] S3d, repeat the collaborative learning operation of S3c to obtain the local personalized model finally trained on each client node.

[0035] Furthermore, using the new global model M G Replacement for local personalized model M L Global aggregation module E g Finally, to prevent severe performance degradation, a momentum update method is used to update the global aggregation module sent to the local personalized model after the global model is aggregated. This allows the weight parameters of the global aggregation module to be adjusted towards the local personalized module, preventing severe performance degradation caused by model aggregation instability and alleviating the statistical heterogeneity of the training data.

[0036] The momentum update method adopts the exponential moving average algorithm. The weight of the exponential moving average algorithm is measured by the similarity between the global and local models. The model parameter of the k-th local personalized module updated for the r+1th time is recorded as θ r+1 , the model parameters of the global aggregation module updated for the r+1th time are recorded as The formula is as follows:

[0037]

[0038] Among them, μ is the weight that measures the importance of the global aggregation module and the local personalized module, and the weight of μ is between [0,1].

[0039] Beneficial effects:

[0040] First, this method designs personalized local models to address the problem that global models are difficult to adapt to the distribution characteristics of different data in multiple domains at the same time. It customizes local exclusive models according to the characteristics of datasets in different regions, effectively solving the problem of large differences in data distribution in different domains.

[0041] Second, the proposed local personalized model contains two modules: one for global aggregation and the other to assist the global model in personalized modeling of local data. To improve the local model's adaptability to local domain data, a collaborative learning method for the local model is proposed. This dual-module collaborative learning effectively learns information from other datasets while preventing the model from forgetting the characteristics of the local data.

[0042] Third, in order to improve the performance of the global model, an adaptive aggregation weight method was designed to update the global model parameters. The dataset size was used as the weight at the beginning of model training, hoping that the global model could find the accurate update direction more quickly. The cosine distance weight was used in the later stage of training, hoping that the global model could obtain more different knowledge. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a schematic diagram of a person re-identification method based on adaptive personalized federated learning of the present invention;

[0044] Figure 2 It is a collaborative learning flow chart of the local personalized model of the present invention. DETAILED DESCRIPTION

[0045] The present invention will be further described below with reference to the accompanying drawings.

[0046] The present invention proposes a person re-identification method based on adaptive personalized federated learning: (1) A personalized local model structure is designed based on the federated learning scenario. The model is divided into two modules, which are trained simultaneously. One module is used for global aggregation, and the other module is used only for local training. (2) During the training process, the local model and the global model are fused for collaborative learning. At the same time, the local model is used to correct the global model to prevent the global model from seriously deviating from the local data features. (3) An adaptive aggregation weight is designed to aggregate the local model parameters into the global model.

[0047] The specific steps include the following:

[0048] (1) Constructing a person re-identification model based on adaptive personalized federated learning:

[0049] (1a) Local Personalization Model: The local personalization model consists of two modules, namely the global aggregation module and the local personalization module. In this invention, both modules use the Osnet structure, and the parameters of the two modules are not shared (pseudo twin network). The input image is respectively passed through the global aggregation module E g and local personalization module E l Get the final feature map E l (x), Then use nn.Parameter(torch.zeros(C,1,1)) to initialize a learnable weight The first dimension of the weight is equal to the feature map E output by the above module l (x), The channel dimension of , the remaining two dimensions are set to 1, and then the two output feature maps are multiplied by weights λ and 1-λ respectively and added to get the final feature output. The formula is as follows:

[0050] F(E l (x),E g (x))=λE g (x)+(1-λ)E l (x)

[0051] (1b) Global model: The global model structure is consistent with the global aggregation module of the local personalized model. The present invention uses the Osnet structure. The global model parameters are obtained by the global aggregation module of the personalized local model through adaptive aggregation weight aggregation.

[0052] The adaptive weight is specifically introduced as follows. In the first five iterations of training, the present invention uses the data set size of different nodes as the aggregation weight, assuming that the data set size of different nodes is N i , the parameter of the global model is w g , the global module weight of the local personalized model is Then pass Obtain the parameters of the global model, where N represents the total size of the dataset. In the following epochs, the present invention uses a dynamically adjusted adaptive cosine distance as the aggregation weight, dynamically assigning weights according to the changes in the model. Larger changes should contribute more to the model aggregation (i.e., have a larger weight) so that more new knowledge can be learned. We measure the model change of each client k by cosine distance. The steps are as follows: The local node randomly selects a batch of training data D batch ; Then when the local node receives the global model from the server in the tth round of training, it uses D batch Obtain the logit vector through the global aggregation module of the local personalized model The global aggregation module is then trained on the local dataset and D batch Obtain the logit vector through the global aggregation module of the local personalized model The aggregate weight of the node is expressed as

[0053]

[0054] By calculating the cosine distance between two logit vectors as weights, we dynamically assign weights according to the changes in the model. Larger changes should contribute more to the model aggregation.

[0055] (2) Constructing a training dataset:

[0056] (2a) Using eight public person re-identification datasets to simulate datasets from different regions

[0057] (2b) Different datasets are divided into training sets and test sets according to the official dataset standards

[0058] (2b) Resize each image to a uniform size, perform random flipping and random cropping to enhance data;

[0059] (2c) Construct dataloader;

[0060] (3) Training a person re-identification model based on adaptive personalized federated learning:

[0061] (3a) First, each node uses the local personalized global aggregation module and the local personalized module to train the local dataset, using the cross-entropy loss as the loss function. Then, only the global aggregation module of each node is sent to the server and fused using the adaptive aggregation weights mentioned in (2a) to obtain the parameters of the global model. Local personalized training is only performed using the local dataset without global aggregation.

[0062] (3b) The new global model parameters after aggregation on the server side are sent back to each client node, and the global aggregation module of the local personalized model is replaced by the new global model, and then the collaborative learning method proposed in this invention is used for training, such as Figure 2 shown.

[0063] Since common federated learning algorithms can easily cause the global model weight parameter space obtained by aggregation to deviate seriously from the client's local model weight parameter space, this may cause the performance of the model to deteriorate seriously locally after aggregation, because model aggregation is unstable. Therefore, based on this feature, a momentum update method is first proposed to update the global aggregation module sent to the local personalized model after global model aggregation, so that the weight parameters of the global aggregation module are adjusted to the local personalized module to prevent the performance from being seriously degraded due to the instability of model aggregation. At the same time, this method can also alleviate the statistical heterogeneity of training data to a certain extent. The momentum update proposed in the present invention adopts the exponential moving average algorithm. The weight of the exponential moving average algorithm is measured by the similarity between the global and local models. The model parameter updated for the kth local personalized module for the r+1th time is denoted as θ r+1 , the model parameters of the global aggregation module updated for the r+1th time are recorded as The formula is as follows.

[0064]

[0065] The weight of μ is between [0, 1]. μ is the weight that measures the importance of the global aggregation module and the local personalized module.

[0066] The specific μ algorithm calculates the Euclidean distance between the model parameters of each node's global aggregation module and local personalized module layer by layer, averages the distances at each layer, multiplies them by a scaling factor (0.01 in this case), and records the final value as μ. When the global aggregation module differs significantly from the local personalized module, the updated global aggregation module retains more historical information of the local model, which makes the data in the client more personalized. This approach can effectively alleviate data heterogeneity and the deviation from the local model caused by aggregation, thereby improving accuracy.

[0067] (3c) Repeat steps 3a and 3b to obtain a trained global aggregation module. Then, use the learnable weights mentioned in step 1a to perform collaborative learning on the two modules. The specific steps are as follows:

[0068] First, the parameter weights of the global aggregation module are frozen, and then the parameters of the local personalized module and the learnable weight parameters are trained on each node using the node's local dataset, and finally a personalized customization model of the node is obtained.

[0069] (4) Obtaining test samples

[0070] (5) The test samples of different clients are input into different personalized local models respectively. The global aggregation module and the local personalized module use the learned weights to perform weighted fusion on the output features to obtain the final sample features.

[0071] (6) Compare and sort the obtained sample features with the features in the image library, and select the 10 images in the image library with the highest similarity as the final test results.

[0072] Example 1

[0073] 1. Example conditions:

[0074] The embodiments of the present invention are carried out in the hardware environment of a single-card NVIDIA GTX 1080 GPU and the software environment of pytorch 1.7.1.

[0075] The embodiment uses eight pedestrian re-identification datasets: MSMT17, DukeMTMC, Market-1501, CUHK03-NP, PRID, CUHK01, VIPeR, and iLIDS.

[0076] Step 1: Construct a training dataset. Use eight datasets to simulate data with different distributions in different regions. Split the dataset into training and test sets according to the dataset description. Perform data augmentation on the training images, and then resize each image to a uniform size. Shuffle the dataset and construct a data loader.

[0077] Step 2: Build a pedestrian re-identification model based on adaptive personalized federated learning.

[0078] Local personalized model: Two modules are designed as described in 1a. In the present invention, the two module structures belong to the Osnet structure. A tensor with a dimension equal to the output feature map is initialized to connect the two modules.

[0079] As described in 1b, the global model structure is consistent with the global aggregation module of the local personalized model, and the parameters are obtained by the global aggregation module of the personalized local model through personalized weight aggregation.

[0080] The global aggregation module in the local personalized model is trained using the local dataset and then sent to the server for fusion using adaptive aggregation weights to obtain the global model. The local module is only trained using the local dataset without global aggregation.

[0081] The aggregated global model is sent back to each client node to replace the global aggregation module of the local personalized model. The local module is then used to perform momentum updates on the global aggregation module to prevent the global aggregation module from deviating too much from the local data feature space.

[0082] Repeat the above operations to obtain the trained global aggregation module and global model. Then, use the collaborative learning method as described in 3c to collaboratively train the local personalization module and the global aggregation module. The output feature maps of the two modules are weightedly fused using learnable weights to obtain the final output features.

[0083] In the design of the model's loss function, only cross-entropy loss is used for training, and the triplet loss commonly used in pedestrian re-identification is abandoned. The triplet loss will have an adverse effect on federated learning.

[0084] Step 3: Build a test set and use the test samples in the eight datasets to build a data loader.

[0085] Step 4: Send the test samples to the local personalized model for inference to obtain feature vectors.

[0086] Step 5: Calculate the cosine distance between the feature vector obtained from the query image and the feature vector obtained from the images in the image library, and obtain the top-ranked result as the final result.

[0087] 2. Result analysis:

[0088] This embodiment uses the method of the present invention to compare its effects with the most popular methods, and also conducts ablation experiments on each module of the present invention.

[0089] Tables 1 and 2 test the rank-1 and mAP indicators on seven pedestrian re-identification datasets, respectively. Table 1 tests the results on four larger datasets, and Table 2 tests the results on three smaller datasets. Through comparative experiments with the latest methods, these results show that compared with the current state-of-the-art methods, both on large and small datasets, the method of the present invention has very obvious superiority and achieves the best results on most datasets.

[0090] Table 1 Comparative experimental results of large datasets

[0091]

[0092] Table 2 Comparative experimental results of small datasets

[0093]

[0094] Table 3 shows the rank-1 results, and Table 4 shows the mAP results. Baseline refers to my baseline model, CDW refers to dynamic weighted convergence, Osnet refers to an Osnet backbone, and multi refers to collaborative learning using a local personalized model. We can see that the final results of our method improve rank-1 performance by 3%-27% compared to the baseline results, with the highest improvement reaching 27% on the prid dataset. mAP also improves by 6%-29%, with the most significant improvements on the cuhk03 and prid datasets. Ablation experiments demonstrate the effectiveness of our method.

[0095] Table 3 Ablation experiment results Rank-1

[0096]

[0097] Table 4 Ablation experiment results mAP

[0098]

Claims

1. A person re-identification method based on adaptive personalized federated learning, characterized by: Utilize a person re-identification system, which includes a server capable of aggregating federated model parameters. The server is connected to multiple client nodes that have training capabilities and perform training on different datasets. The server assigns training tasks to different client nodes, and the client nodes transmit weights back to the server. Taking advantage of the wide distribution of surveillance cameras and the rapid update of collected image data, we conduct rapid centralized learning and pre-process pedestrian re-identification data in different areas; Build a pedestrian re-identification model based on adaptive personalized federated learning. The pedestrian re-identification model includes a local personalized model and a global model. Generate training datasets with different characteristics for different regions and train a person re-identification model based on adaptive personalized federated learning: Acquire and construct test datasets for different regions. For different client nodes, input the test samples into the personalized local models in different client nodes. The global aggregation module and the local personalized module work together to perform inference and obtain feature vectors. Calculate the cosine distance between the feature vector obtained from the query image and the feature vector obtained from the image in the image library, and output the top-ranked result as the final result to complete pedestrian re-identification; The specific steps are as follows: S1. Build a pedestrian re-identification model based on adaptive personalized federated learning. The pedestrian re-identification model includes multiple local personalized models. and global models , where each client node has a local personalized model , global model Only set in the server; the local personalized model includes two sub-modules, namely the global aggregation module and local personalization modules The two submodules belong to the Osnet network. A tensor with a dimension equal to the output feature map is initialized to connect the two submodules. The structure of the global model is consistent with the global aggregation module of the local personalized model. The Osnet network is also used. The parameters are obtained by the global aggregation module of the local personalized model through personalized weight aggregation. S2. Construct a training dataset of pedestrian information in different areas for each client: Use multiple public pedestrian re-identification datasets to simulate the dataset, divide the training set and test set according to the official documents of different datasets, adjust each image in the pedestrian re-identification dataset to a uniform size, and perform data enhancement; construct a data loader for each client node to personalize the model for the client. Provide data for training; S3. Each client trains a person re-identification model based on adaptive personalized federated learning on its own dataset, and uses the local training dataset of the client node to train its own global aggregation module. Perform training and then complete the global aggregation module Send to the server and use adaptive aggregation weights for fusion to obtain the global model ; Local personalization module Use local datasets for training only without global aggregation; the aggregated global model Send it to the clients in each different region and aggregate the global model Alternative local personalization models Global aggregation module , and then use the local personalized module trained above For global aggregation modules Make corrections to prevent global aggregation modules The deviation from the local data feature space is too large. After several rounds of iterative training, a trained local personalized model is obtained. Finally, the trained local personalized model is trained using the learnable weight parameters in S1. Global aggregation module and local personalization modules The two are connected and fused, and then the local training data set is used to train them together to obtain the final local personalized model. ; S4. Repeat step S2 to obtain test samples from different regions, so that all client nodes generate data sets from different regions: S5. Input the test samples from different regions into the exclusive local personalized models of the client nodes in different regions, and the global aggregation module and the local module jointly infer the test sample features; S6. Compare and sort the obtained sample features with the features in the image library officially divided by the dataset, and select the image in the image library with the highest similarity as the final test result.

2. The person re-identification method based on adaptive personalized federated learning according to claim 1, characterized in that: The local personalized model in the pedestrian re-identification model includes a global aggregation module and a local personalized module. Both the global aggregation module and the local personalized module use the Osnet structure. The parameters of the global aggregation module and the local personalized module are not shared. It is a pseudo twin network. The images in the input sample dataset are respectively passed through the global aggregation module and local personalization modules Get the final feature map , and then initialize the learnable weight parameters , the first dimension of the weight is equal to the feature map of the output of the global aggregation module and the local personalization module The channel dimension of the remaining two dimensions are H and W, which are set to 1, and then the output feature map Multiply by the weights and And add them together to get the final feature output. The formula is as follows: 。 3. The person re-identification method based on adaptive personalized federated learning according to claim 2 is characterized in that: Global Model in Person Re-ID Model The Osnet structure is used, and the global model parameters are obtained by the global aggregation module of the personalized local model through adaptive aggregation weight aggregation. The adaptive weight specifically includes, in the first 5 iterations of training, using the dataset size of different client nodes as the aggregation weight to perform weighted aggregation on the global aggregation module of the personalized local model of different clients. Assume that the dataset size of different client nodes is , global model The parameters are , global aggregation module for local personalized models The weight is , and then use the formula: , to obtain the full global model , where N represents the sum of the training dataset sizes of all client nodes. In subsequent training iterations, the dynamically adjusted adaptive cosine distance is used as the aggregation weight to adjust the local personalized model of each client node. Global aggregation module Dynamically assign weights to changes in the global model. Larger changes should be The aggregation process has a greater weight so that more newly learned knowledge can be included; The model change of each node k is measured by cosine distance. The steps are as follows: the client node randomly selects a batch of training data from the local training data set ; When the client node receives the global model sent back to the client node from the server that aggregates the global model in the tth round of training When using training data Through local personalized models Global aggregation module Get the logit vector , and then use the local dataset to train the global aggregation module , and use it again after training Through local personalized models Global aggregation module Get the logit vector , the aggregate weight of the client node is: ; By calculating the cosine distance between two logit vectors as weights, we dynamically assign weights according to the changes in the model. Larger changes should contribute more to the model aggregation.

4. The person re-identification method based on adaptive personalized federated learning according to claim 3 is characterized in that: The steps for training the pedestrian re-identification model based on adaptive personalized federated learning are as follows: S3a, first use the local personalized model on each client node Global aggregation module and local personalization modules Use different datasets for training separately, use cross entropy loss as loss function, and then only use the global aggregation module of each client node Send to the server and use adaptive aggregation weights for fusion to obtain the global model Parameters, local personalization only uses local datasets for training without global aggregation; S3b, the new global model after server-side aggregation The parameters are sent back to each client node using the new global model Alternative local personalization models Global aggregation module ; S3c, repeat the training of S3a and S3b until the training requirements are met to obtain a trained local personalized model Then, the trained global aggregation module and local personalized module are combined for collaborative training using a collaborative learning method. This allows the local personalized model to adapt well to the distribution of the local dataset and obtain information from the datasets of other client nodes, ensuring that the local personalized model does not overfit the local dataset. Collaborative learning uses a person re-identification model based on adaptive personalized federated learning to fuse the global aggregation module and local personalized module of the local personalized model using learnable weights. The weights of the global aggregation module are then frozen. On each client node, the parameters of the local personalized module and the learnable weight parameters are trained using the client node's local dataset. Finally, a customized personalized local model is obtained for each client node. S3d: Repeat the collaborative learning operation of S3c to obtain the local personalized model that is finally trained for each client node.

5. The pedestrian re-identification method based on adaptive personalized federated learning according to claim 4 is characterized in that: With the new global model Alternative local personalization models Global aggregation module Finally, to prevent severe performance degradation, a momentum update method is used to correct the global aggregation module sent to the local personalized model after global model aggregation. This allows the weight parameters of the global aggregation module to be adjusted towards the local personalized module, preventing severe performance degradation caused by model aggregation instability and alleviating the statistical heterogeneity of the training data. The momentum update method adopts the exponential moving average algorithm. The weight of the exponential moving average algorithm is measured by the similarity between the global and local models. The model parameters of the k-th local personalized module updated for the r+1th time are recorded as , the model parameters of the global aggregation module updated for the r+1th time are recorded as , the formula is as follows: ; Among them, 𝜇 is the importance weight of the global aggregation module and the local personalized module, and the weight of 𝜇 ​​is between [0,1].

Citation Information

Patent Citations

  • Unsupervised cross-domain pedestrian re-identification method based on clustering

    CN111860678A

  • Pedestrian re-identification method based on federal splitting learning

    CN114417999A