Person Re-ID Method Based on Multi-granularity Feature Fusion and Dual-branch Neural Network

Through parallel calculation of the global branch and feature fusion branch and loss function constraints, the effective fusion of multi-granularity features of pedestrian images is achieved, which solves the problem of feature instability in pedestrian re-identification and improves the recognition accuracy and anti-interference ability.

CN119649462BActive Publication Date: 2025-09-30TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411860297.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-09-30
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

In the pedestrian re-identification task, the instability and changes of pedestrian appearance features and appearance features between different domains lead to inaccurate feature distances, affecting the model's ability to extract robust pedestrian feature descriptions and resulting in incorrect matching.

Method used

A dual-branch neural network method based on multi-granularity feature fusion is adopted. Through parallel calculation of the global branch and the feature fusion branch, global features and fusion features are output. The loss function is used to constrain the network structure. Finally, the features of the two are fused to improve the discriminability and accuracy of the features.

Benefits of technology

The accuracy of pedestrian re-identification is improved, the interference of camera field of view and background changes on recognition is reduced, and the discriminability and utilization of features are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649462B_ABST
    Figure CN119649462B_ABST
Patent Text Reader

Abstract

The present invention proposes a dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion. The method mainly targets the multi-granularity feature fusion of pedestrian images, adopts a global branch and a feature fusion branch in parallel calculation mode, and outputs global features and fusion features. Finally, the features of the global branch and the fusion branch are fused as the final features, which have more accurate and rich features. The method of the present invention can effectively fuse the shallow texture features and deep semantic features extracted from pedestrian images to avoid the loss of target detail information; by adopting the global branch and the fusion branch to perform feature extraction respectively, it is ensured that the extracted features have the greatest degree of discriminability, improves the algorithm's utilization of image features, and enables the extracted features to fuse more feature information of the current target. The accuracy of pedestrian re-identification is improved, and the interference of factors such as camera field of view changes and background changes on pedestrian re-identification is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of pedestrian re-identification, and in particular relates to a pedestrian re-identification method based on a dual-branch neural network with multi-granularity feature fusion. Background Art

[0002] Person re-identification utilizes computer vision algorithms to search for pedestrians with the same identity within a multi-camera surveillance network with non-overlapping coverage areas. For most surveillance cameras, pedestrians in the frame are the primary focus, and identifying them is a key task in the security field. As a key infrastructure for public safety, video surveillance systems are widely used in public places such as roads, train stations, shopping malls, campuses, and communities, playing a crucial role in public security investigations, capturing traffic violations, and predicting danger.

[0003] In the task of person re-identification, pedestrian characteristics primarily include two aspects: first, clothing appearance features, including clothing color and texture, headwear, hairstyle, glasses, hats, foot shape and shoe texture, and objects and ornaments carried in the hands. Second, pedestrian appearance features, including posture, gait when walking, sitting position when cycling, and head and upper limb movements. Pedestrian appearance features and features are the primary basis for pedestrian identification. However, due to the complexity of real-world surveillance scenarios and the non-rigidity of pedestrian structure, the appearance features and features of pedestrians vary significantly across domains, resulting in features of the same pedestrian being too close together and features of the same pedestrian being too distant. This hinders the model's ability to extract robust pedestrian feature descriptions and leads to mismatches. Accurately extracting discriminative features for pedestrians is a key challenge in the task of person re-identification. Summary of the Invention

[0004] In light of this, the present invention aims to overcome the shortcomings of the prior art by proposing a dual-branch neural network person re-identification method based on multi-granularity feature fusion. This method employs a global branch and a feature fusion branch for parallel computation to output global and fused features. Ultimately, the features of the global and fusion branches are fused together to produce a final feature that is more accurate and richer in features. This improves person re-identification accuracy and mitigates interference from factors such as camera field of view changes and background variations.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] A first aspect of the present invention provides a person re-identification method based on a dual-branch neural network with multi-granularity feature fusion, comprising the following steps:

[0007] Step 1: Obtain person re-identification source and target domain datasets;

[0008] Step 2: Build a parallel training architecture. The parallel training architecture includes four feature extraction networks with the same network structure, which are used to generate hard labels and soft labels respectively. Each feature extraction network has two branches: a global branch and a feature fusion branch. The source domain data is input into the parallel training architecture.

[0009] Step 3: The global branch uses ResNet-50 to learn the global feature c5 of each image in the source domain data. The step size of res_conv5x in ResNet-50 is 1 and the output size is [16, 8].

[0010] Step 4: The fusion branch uses a pyramid network to fuse the c2, c3, c4, and c5 features in the global branch ResNet-50, where c2 is the output result after the input passes through res2, with a size of [64, 32] and 256 channels, c3 is the result after c2 passes through res3, with a size of [32, 16] and 512 channels, c4 is the result after c3 passes through res4, with a size of [16, 8] and 1024 channels, and c5 is the result after c4 passes through res The result after s5 is of size [16,8], 2048 channels, and outputs p2, p3, and p4. P4 is obtained by adding c4 after upsampling and adjusting the channels of c5, with a size of [16,8], 256 channels. P3 is obtained by adding c3 after upsampling and adjusting the channels of p4, with a size of [32,16], 256 channels. P2 is obtained by adding c2 after upsampling and adjusting the channels of p3, with a size of [64,32], 256 channels.

[0011] Step 5: Adjust the size of p2, p3, and p4 to [16, 8] by downsampling to obtain p2', p3', and p4';

[0012] Step 6: Concatenate p2', p3', and p4' along the channel, compress the channel to 1024, and obtain c4_f;

[0013] Step 7: Input c4_f into the res_conv5x module to obtain c5_f. The parameters of the res_conv5x module are the same as those in the global branch.

[0014] Step 8: Use the loss function to constrain the entire network structure;

[0015] Step 9: Determine whether the number of iterations set during network training has been reached. If yes, proceed to step 10; if no, proceed to step 3.

[0016] Step 10: Fuse c5 and c5_f obtained from each pedestrian image to obtain the final feature feature_r for pedestrian re-identification;

[0017] Step 11: Use distance measurement to identify the pedestrian's identity based on the feature feature_r of each pedestrian and output the recognition result.

[0018] Furthermore, in step 8, the loss function is expressed as follows:

[0019]

[0020]

[0021] is the hard label identity loss in the feature extraction network, is the hard label triplet loss in the feature extraction network, is the soft label identity loss in the feature extraction network, is the soft label triplet loss in the feature extraction network, and is the weight coefficient, is the classification of the target domain under the four networks, They are the feature output of the main branch and the feature output of the fusion branch under the same network,

[0022] Represent the current feature, the most difficult positive sample and the most difficult negative sample respectively. The most difficult positive sample represents the most dissimilar feature in the current training batch data and the current one that belongs to the same pedestrian. The most difficult negative sample represents the most similar feature in the current training batch data and the current one that does not belong to the same pedestrian. express is the true weight matrix of the kth person, E (T) is the balance coefficient between the Tth iteration and the T-1th iteration of each model weight parameter.

[0023] Furthermore, in step 10, the fusion method is to take the maximum value of each dimension of c5 and c5_f as the final feature_r.

[0024] The second aspect of the present invention provides a dual-branch neural network person re-identification device based on multi-granularity feature fusion, comprising:

[0025] Data acquisition unit: used to obtain source domain and target domain datasets for person re-identification;

[0026] Construction unit: used to build a parallel training architecture. The parallel training architecture includes four feature extraction networks with the same network structure, which are used to generate hard labels and soft labels respectively. Each feature extraction network includes two branches: a global branch and a feature fusion branch. The source domain data is input into the parallel training architecture.

[0027] The first processing unit: used for the global branch to learn the global feature c5 of each image in the source domain data using ResNet-50. The step size of res_conv5x in ResNet-50 is 1, and the output size is [16, 8].

[0028] The second processing unit is used to fuse the c2, c3, c4, and c5 features of the global branch ResNet-50 using a pyramid network, where c2 is the output result after the input passes through res2, with a size of [64, 32] and 256 channels, c3 is the result after c2 passes through res3, with a size of [32, 16] and 512 channels, c4 is the result after c3 passes through res4, with a size of [16, 8] and 1024 channels, and c5 is the result after c4 passes through The result after res5 is of size [16,8], 2048 channels, and the output is p2, p3, p4. P4 is obtained by adding c4 after upsampling and adjusting the channel of c5, with a size of [16,8], 256 channels. P3 is obtained by adding c3 after upsampling and adjusting the channel of p4, with a size of [32,16], 256 channels. P2 is obtained by adding c2 after upsampling and adjusting the channel of p3, with a size of [64,32], 256 channels.

[0029] The third processing unit is used to resize p2, p3, and p4 to [16, 8] by downsampling to obtain p2', p3', and p4';

[0030] The fourth processing unit is used to splice p2', p3', and p4' along the channel, compress the channel to 1024, and obtain c4_f;

[0031] The fifth processing unit is used to input c4_f into the res_conv5x module to obtain c5_f. The parameters of the res_conv5x module are the same as those of the res_conv5x module in the global branch.

[0032] The sixth processing unit is used to constrain the entire network structure using the loss function;

[0033] The seventh processing unit is used to determine whether the number of iterations set during network training has been reached. If yes, the eighth processing unit is executed; if not, the first processing unit is executed.

[0034] The eighth processing unit: fuses c5 and c5_f obtained from each pedestrian image to obtain the final feature feature_r for pedestrian re-identification;

[0035] Result output unit: used to identify the pedestrian using a distance metric for each pedestrian's feature feature_r and output the recognition result.

[0036] A third aspect of the present invention provides an electronic device, comprising

[0037] at least one processor, and

[0038] at least one memory in communication with the processor, wherein:

[0039] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the above-mentioned dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion.

[0040] A fourth aspect of the present invention provides a non-volatile computer-readable storage medium, which, when the computer-executable instructions are executed by one or more processors, enables the processors to execute the above-mentioned dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion.

[0041] Compared with the existing technology, the dual-branch neural network person re-identification method based on multi-granularity feature fusion described in the present invention has the following advantages:

[0042] The present invention proposes a dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion, which can effectively fuse the shallow texture features and deep semantic features extracted from pedestrian images to avoid the loss of target detail information; by adopting global branches and fusion branches to extract features respectively, it ensures that the extracted features have the greatest degree of discriminability, improves the algorithm's utilization of image features, and enables the extracted features to integrate more feature information of the current target; the present invention improves the accuracy of pedestrian re-identification and reduces the interference of factors such as camera field of view changes and background changes on pedestrian re-identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings: Figure 1 This is an overall flow chart of a dual-branch neural network person re-identification method based on multi-granularity feature fusion according to the present invention;

[0044] Figure 2 Schematic diagram of the training network framework of the present invention;

[0045] Figure 3 This is a schematic diagram of a dual-branch network for feature extraction according to the present invention;

[0046] Figure 4 Schematic diagram of the global feature and fusion feature fusion method of the present invention. DETAILED DESCRIPTION

[0047] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0048] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0049] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0050] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0051] Example 1:

[0052] The pedestrian re-identification algorithm of the present invention achieves multi-granularity feature fusion of pedestrian images, adopts a global branch and a feature fusion branch parallel computing mode, outputs global features and fused features. Finally, the features of the global branch and the fusion branch are fused as the final features. Figure 1 This is the overall flow chart of the dual-branch neural network person re-identification method based on multi-granularity feature fusion proposed in this invention. The specific steps are as follows:

[0053] 1) Unsupervised cross-domain person re-identification is trained based on a mutually taught parallel training architecture. The architecture consists of four feature extraction networks: NetA (θ1), NetB (θ2), MeanNetA (θ3), and MeanNetB (θ4). NetA (θ1) and NetB (θ2) generate hard labels, which are used to ensure uniqueness. MeanNetA (θ3) and MeanNetB (θ4) generate soft labels, which are used to improve the accuracy of pseudo-labels. Each network has the same structure, with MeanNetA and MeanNetB used to supervise and correct NetA and NetB, respectively. Person images are input to each of the four feature extraction networks.

[0054] 2) The feature extraction network consists of two branches: a global branch and a feature fusion branch. The global branch uses ResNet-50 to learn the global feature c5 of pedestrian images. The stride of res_conv5x in ResNet-50 is 1, and the output size is [16, 8].

[0055] 3) The fusion branch uses a pyramid network to fuse the c2, c3, c4, and c5 features in the global branch ResNet-50, where c2 is the output result after the input passes through res2, with a size of [64, 32] and 256 channels. c3 is the result after c2 passes through res3, with a size of [32, 16] and 512 channels. c4 is the result after c3 passes through res4, with a size of [16, 8] and 1024 channels. c5 is the result after c4 passes through res5, with a size of [16, 8] and 2048 channels. The outputs are p2, p3, and p4. P4 is the sum of c5 and c4 after upsampling and adjusting the channels, with a size of [16, 8] and 256 channels. P3 is the sum of p4 and c3 after upsampling and adjusting the channels, with a size of [32, 16] and 256 channels. P2 is the sum of p3 and c2 after upsampling and adjusting the channels, with a size of [64, 32] and 256 channels.

[0056] 4) Adjust the size of p2, p3, and p4 to [16, 8] and the channel to 1024 by downsampling to obtain p2', p3', and p4'.

[0057] 5) Concatenate p2', p3', and p4' along the channel, and then compress the channel to 1024 to obtain c4_f.

[0058] 6) Input c4_f into the res_conv5x module to obtain c5_f. The parameters of the res_conv5x module are the same as those in the global branch.

[0059] 7) Use the loss function L(θ1,θ2,θ3,θ4) to constrain the entire network structure. The network loss function is expressed as follows:

[0060]

[0061]

[0062] is the hard label identity loss in the feature extraction network, Hard label triplet loss in feature extraction network. is the soft label identity loss in the feature extraction network, Soft label triplet loss in feature extraction network. and is the weight coefficient. is the classification of the target domain under the four networks. They are the feature output of the global branch and the feature output of the fusion branch under the same network.

[0063] Represent the current feature, the most difficult positive sample and the most difficult negative sample respectively. The most difficult positive sample represents the most dissimilar feature in the current training batch data and the current one that belongs to the same pedestrian. The most difficult negative sample represents the most similar feature in the current training batch data and the current one that does not belong to the same pedestrian. express is the true weight matrix of the kth person. E (T) is the balance coefficient between the Tth iteration and the T-1th iteration of each model weight parameter.

[0064] 8) Determine whether the number of iterations set during network training has been reached. If yes, proceed to step 9) If not, proceed to step 2)

[0065] 9) For each pedestrian image, c5 and c5_f are fused to obtain the final feature feature_r for pedestrian re-identification. The specific fusion method is to take the maximum value of each dimension of c5 and c5_f as the final feature_r.

[0066] 10) The feature feature_r of each pedestrian is used to determine the pedestrian's identity using a distance metric. The closer the distance, the greater the possibility that they are the same person, and the farther the distance, the greater the possibility that they are not the same person.

[0067] The dual-branch neural network person re-identification method based on multi-granularity feature fusion proposed in the present invention realizes the fusion of multi-granularity features of pedestrian images. At the same time, by optimizing the network hyperparameters, the extraction of global image features and fused image features is optimized, and finally the global image features and fused features are encoded into representation features for pedestrian re-identification. Here, Resnet50 and IBN-Resnet50 networks and the mutual mean teaching method (MMT) for pedestrian re-identification are used as reference algorithms. The test datasets are Market-1501, DukeMTMC-reid and MSMT datasets respectively. On Duke-to-Market, compared with the reference algorithm MMT, the present invention achieved an improvement of Rank-1 / mAP = +5.8% / 8.5%. As shown in Table 1.

[0068] Table 1

[0069]

[0070]

[0071] Example 2:

[0072] A dual-branch neural network person re-identification device based on multi-granularity feature fusion, comprising:

[0073] Data acquisition unit: used to obtain source domain and target domain datasets for person re-identification;

[0074] Construction unit: used to build a parallel training architecture. The parallel training architecture includes four feature extraction networks with the same network structure, which are used to generate hard labels and soft labels respectively. Each feature extraction network includes two branches: a global branch and a feature fusion branch. The source domain data is input into the parallel training architecture.

[0075] The first processing unit: used for the global branch to learn the global feature c5 of each image in the source domain data using ResNet-50. The step size of res_conv5x in ResNet-50 is 1, and the output size is [16, 8].

[0076] The second processing unit is used to fuse the c2, c3, c4, and c5 features of the global branch ResNet-50 using a pyramid network, where c2 is the output result after the input passes through res2, with a size of [64, 32] and 256 channels, c3 is the result after c2 passes through res3, with a size of [32, 16] and 512 channels, c4 is the result after c3 passes through res4, with a size of [16, 8] and 1024 channels, and c5 is the result after c4 passes through The result after res5 is of size [16,8], 2048 channels, and the output is p2, p3, p4. P4 is obtained by adding c4 after upsampling and adjusting the channel of c5, with a size of [16,8], 256 channels. P3 is obtained by adding c3 after upsampling and adjusting the channel of p4, with a size of [32,16], 256 channels. P2 is obtained by adding c2 after upsampling and adjusting the channel of p3, with a size of [64,32], 256 channels.

[0077] The third processing unit is used to resize p2, p3, and p4 to [16, 8] by downsampling to obtain p2', p3', and p4';

[0078] The fourth processing unit is used to splice p2', p3', and p4' along the channel, compress the channel to 1024, and obtain c4_f;

[0079] The fifth processing unit is used to input c4_f into the res_conv5x module to obtain c5_f. The parameters of the res_conv5x module are the same as those of the res_conv5x module in the global branch.

[0080] The sixth processing unit is used to constrain the entire network structure using the loss function;

[0081] The seventh processing unit is used to determine whether the number of iterations set during network training has been reached. If yes, the eighth processing unit is executed; if not, the first processing unit is executed.

[0082] The eighth processing unit: fuses c5 and c5_f obtained from each pedestrian image to obtain the final feature feature_r for pedestrian re-identification;

[0083] Result output unit: used to identify the pedestrian using a distance metric for each pedestrian's feature feature_r and output the recognition result.

[0084] Example 3:

[0085] An electronic device comprising

[0086] at least one processor, and

[0087] at least one memory in communication with the processor, wherein:

[0088] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the above-mentioned dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion.

[0089] Example 4:

[0090] A non-volatile computer-readable storage medium, when the computer-executable instructions are executed by one or more processors, causes the processors to execute the above-mentioned dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion.

[0091] The above description is only a preferred embodiment of the present invention and is 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 scope of protection of the present invention.

Claims

1. A dual-branch neural network person re-identification method based on multi-granularity feature fusion, characterized by: The steps include: Step 1: Obtain person re-identification source and target domain datasets; Step 2: Build a parallel training architecture. The parallel training architecture includes four feature extraction networks with the same network structure, which are used to generate hard labels and soft labels respectively. Each feature extraction network has two branches: a global branch and a feature fusion branch. The source domain data is input into the parallel training architecture. Step 3: The global branch uses ResNet-50 to learn the global feature c5 of each image in the source domain data. The step size of res_conv5x in ResNet-50 is 1 and the output size is [16, 8]. Step 4: The fusion branch uses a pyramid network to fuse the c2, c3, c4, and c5 features in the global branch ResNet-50, where c2 is the output result after the input passes through res2, with a size of [64, 32] and 256 channels, c3 is the result after c2 passes through res3, with a size of [32, 16] and 512 channels, c4 is the result after c3 passes through res4, with a size of [16, 8] and 1024 channels, and c5 is the result after c4 passes through res The result after s5 is of size [16,8], 2048 channels, and outputs p2, p3, and p4. P4 is obtained by adding c4 after upsampling and adjusting the channels of c5, with a size of [16,8], 256 channels. P3 is obtained by adding c3 after upsampling and adjusting the channels of p4, with a size of [32,16], 256 channels. P2 is obtained by adding c2 after upsampling and adjusting the channels of p3, with a size of [64,32], 256 channels. Step 5: Adjust the size of p2, p3, and p4 to [16,8] by downsampling to obtain p2', p3', and p4'; Step 6: Concatenate p2', p3', and p4' along the channel, compress the channel to 1024, and obtain c4_f; Step 7: Input c4_f into the res_conv5x module to obtain c5_f. The parameters of the res_conv5x module are the same as those in the global branch. Step 8: Use the loss function to constrain the entire network structure; Step 9: Determine whether the number of iterations set during network training has been reached. If yes, proceed to step 10; if no, proceed to step 3. Step 10: Fuse c5 and c5_f obtained from each pedestrian image to obtain the final feature feature_r for pedestrian re-identification; Step 11: Use distance measurement to identify the pedestrian's identity based on the feature feature_r of each pedestrian and output the recognition result.

2. The dual-branch neural network person re-identification method based on multi-granularity feature fusion according to claim 1 is characterized by: In step 8, the loss function is expressed as follows: is the hard label identity loss in the feature extraction network, is the hard label triplet loss in the feature extraction network, is the soft label identity loss in the feature extraction network, is the soft label triplet loss in the feature extraction network, and is the weight coefficient, is the classification of the target domain under the four networks, They are the feature output of the main branch and the feature output of the fusion branch under the same network, Represent the current feature, the most difficult positive sample and the most difficult negative sample respectively. The most difficult positive sample represents the most dissimilar feature in the current training batch data and the current one that belongs to the same pedestrian. The most difficult negative sample represents the most similar feature in the current training batch data and the current one that does not belong to the same pedestrian. express is the true weight matrix of the kth person, E (T) is the balance coefficient between the Tth iteration and the T-1th iteration of each model weight parameter.

3. The dual-branch neural network person re-identification method based on multi-granularity feature fusion according to claim 1 is characterized by: In step 10, the fusion method is to take the maximum value of each dimension of c5 and c5_f as the final feature_r.

4. A dual-branch neural network person re-identification device based on multi-granularity feature fusion, characterized by: include: Data acquisition unit: used to obtain source domain and target domain datasets for person re-identification; Construction unit: used to build a parallel training architecture. The parallel training architecture includes four feature extraction networks with the same network structure, which are used to generate hard labels and soft labels respectively. Each feature extraction network includes two branches: a global branch and a feature fusion branch. The source domain data is input into the parallel training architecture. The first processing unit: used for the global branch to learn the global feature c5 of each image in the source domain data using ResNet-50. The step size of res_conv5x in ResNet-50 is 1, and the output size is [16, 8]. The second processing unit is used to fuse the c2, c3, c4, and c5 features of the global branch ResNet-50 using a pyramid network, where c2 is the output result after the input passes through res2, with a size of [64, 32] and 256 channels, c3 is the result after c2 passes through res3, with a size of [32, 16] and 512 channels, c4 is the result after c3 passes through res4, with a size of [16, 8] and 1024 channels, and c5 is the result after c4 passes through The result after res5 is of size [16,8], 2048 channels, and the output is p2, p3, p4. P4 is obtained by adding c4 after upsampling and adjusting the channel of c5, with a size of [16,8], 256 channels. P3 is obtained by adding c3 after upsampling and adjusting the channel of p4, with a size of [32,16], 256 channels. P2 is obtained by adding c2 after upsampling and adjusting the channel of p3, with a size of [64,32], 256 channels. The third processing unit is used to resize p2, p3, and p4 to [16, 8] by downsampling to obtain p2', p3', and p4'; The fourth processing unit is used to splice p2', p3', and p4' along the channel, and then compress the channel to 1024 to obtain c4_f; The fifth processing unit is used to input c4_f into the res_conv5x module to obtain c5_f. The parameters of the res_conv5x module are the same as those of the res_conv5x module in the global branch. The sixth processing unit is used to constrain the entire network structure using the loss function; The seventh processing unit is used to determine whether the number of iterations set during network training has been reached. If yes, the eighth processing unit is executed; if not, the first processing unit is executed. The eighth processing unit: fuses c5 and c5_f obtained from each pedestrian image to obtain the final feature feature_r for pedestrian re-identification; Result output unit: used to identify the pedestrian using a distance metric for each pedestrian's feature feature_r and output the recognition result.

5. An electronic device, characterized in that: include at least one processor, and at least one memory in communication with the processor, wherein: The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion as described in any one of claims 1-3.

6. A non-volatile computer-readable storage medium, which, when the computer-executable instructions are executed by one or more processors, enables the processors to execute the dual-branch neural network pedestrian re-identification method based on multi-granularity feature fusion according to any one of claims 1 to 3.