Pedestrian re-identification method based on multi-scale and attention feature extraction

By introducing multi-scale and attention feature extraction methods in pedestrian re-identification technology, using custom multi-scale feature attention modules and channel attention mechanisms, the problem of insufficient accuracy and robustness of pedestrian re-identification in complex backgrounds is solved, and more efficient pedestrian feature extraction and recognition is achieved.

CN119763026AInactive Publication Date: 2025-04-04HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411542594.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-04-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In a complex context, existing pedestrian re-identification technology is difficult to effectively extract local information at different scales in pedestrian images, resulting in insufficient accuracy and robustness of feature extraction, which easily confuses similar pedestrians and is greatly affected by background noise.

Method used

Using a pedestrian recognition method based on multi-scale and attention feature extraction, a custom multi-scale feature attention module MFA is constructed, combined with the channel attention mechanism, multi-scale features are extracted and irrelevant information in complex backgrounds are filtered.

Benefits of technology

It improves the robustness and accuracy of pedestrian re-identification, can more effectively distinguish fine-grained differences, reduce the rate of misidentification, and reduce the impact of background features on recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763026A_ABST
    Figure CN119763026A_ABST
Patent Text Reader

Abstract

A pedestrian re-identification method based on multi-scale and attention feature extraction comprises the following steps: acquiring a public pedestrian re-identification data set, and preprocessing the data set; performing feature extraction on an input pedestrian image by using an SAM model to generate an initial feature map; constructing a self-defined multi-scale feature attention module (MFA), and performing multi-scale feature extraction and region enhancement processing on the initial feature map; and performing Euclidean distance calculation on the final pedestrian features and the pedestrian feature vectors in the database, performing sorting according to the distance, and taking a result as final output. According to the method provided by the invention, salient pedestrian features which can be recognized are extracted through multi-scale features, a channel attention mechanism is introduced to enable the model to filter out irrelevant information in a complex background, background noise can be filtered out, a pedestrian feature map with higher fine granularity can be obtained, and the robustness and accuracy of pedestrian re-recognition are improved; the method can be used for identifying personnel in chemical plant dangerous areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition and pedestrian detection, and in particular to a pedestrian re-identification method based on multi-scale and attention feature extraction. Background Art

[0002] Dangerous working areas in chemical plants face some unique challenges, such as complex environments, uniform work clothes for workers, and the presence of hazardous chemicals and equipment, which require strict identification of personnel entering specific areas. Traditional monitoring and identification methods often rely on manual confirmation or wearable device-based identification, which are easily affected by the environment, such as occlusion and light changes. In high-risk areas of the factory, manual management is sometimes difficult to respond in real time, which may lead to safety hazards.

[0003] In recent years, the task of pedestrian re-identification in surveillance scenes has received extensive attention and application. Pedestrian re-identification technology can effectively verify the identity of pedestrians by identifying and matching the same pedestrians photographed by different cameras. However, in complex backgrounds, it will increase the difficulty of pedestrian detection. At present, the model based on the ResNet network structure mainly relies on a single-scale convolution operation to extract features, which often ignores the local information of different scales in pedestrian images, resulting in insufficient accuracy and robustness of feature extraction when processing pedestrian images in different scenes and angles. Specifically, the model cannot well identify subtle differences in pedestrian images and easily confuses similar pedestrians; or it is greatly affected by background noise, which interferes with the judgment of the model and further affects the recognition accuracy. Summary of the invention

[0004] In view of the above technical problems of being greatly affected by background noise and having difficulty distinguishing fine-grained differences, this technical solution provides a pedestrian re-identification method based on multi-scale and attention feature extraction. Multi-scale feature extraction can identify significant pedestrian features, and the introduction of a channel attention mechanism enables the model to filter out irrelevant information in complex backgrounds, thereby improving the robustness and accuracy of pedestrian re-identification; effectively solving the above problems. The present invention is implemented through the following technical solutions:

[0005] A person re-identification method based on multi-scale and attention feature extraction includes the following steps:

[0006] Step 1: Obtain a public person re-identification dataset and preprocess the dataset;

[0007] Step 2: Use the SAM model to extract features from the input pedestrian image and generate the initial feature map F i ;

[0008] Step 3: construct a custom multi-scale feature attention module MFA, and use the constructed multi-scale feature attention module MFA to perform multi-scale feature extraction and region enhancement processing on the initial feature map to generate a final pedestrian feature vector; the custom multi-scale feature attention module MFA includes a structure: a linear projection layer, a multi-scale feature extraction layer, a feature enhancement layer, an attention layer, and an upsampling layer;

[0009] Step 4: Calculate the Euclidean distance between the final pedestrian features and the pedestrian feature vectors in the database, sort them according to the size of the distance, and use the result as the final output.

[0010] Furthermore, the constructed multi-scale feature attention module MFA described in step 3 is used to perform multi-scale feature extraction and region enhancement processing on the initial feature map to generate the final pedestrian feature vector, which specifically includes the following steps:

[0011] Step 3.1: The multi-scale feature attention module MFA receives the initial feature map F i First, the feature dimension is reduced by linear projection to ensure that the computational complexity is reduced while retaining important information, thereby obtaining the feature map F i ', the formula is:

[0012] F i '=τ(ReLU(W i ·F i ))

[0013] Among them, W i is the linear projection matrix, τ(·) is the reconstruction operation, τ is the reconstruction factor, and ReLU is the activation function;

[0014] Step 3.2: Linearly project the feature map F i 'Perform multi-scale convolution operations and use 6 average pooling layers of different scales to extract multi-scale features, where the pooling kernel sizes are 2×2, 3×3, 4×4, 5×5, 6×6, and 7×7 respectively;

[0015] Step 3.3: After each pooled feature map is subjected to a 1×1 convolution and a depth-wise convolution, the feature map F is obtained. i ' ,j , 1×1 convolution is used to adjust the number of channels, and depth convolution is used to enhance local detail information. The formula is:

[0016] F i ' ,j =DepthConv(φ 1×1 (AP(F i '))),1≤j≤6

[0017] Among them, DepthConv is the depth convolution operation, φ 1×1 is a 1×1 convolution operation, AP is an average pooling operation, and j is the jth scale of the feature map.

[0018] Step 3.4: Introduce the SE channel attention mechanism on each scale feature map, perform weighted processing on it, and obtain a channel-weighted feature map

[0019] Step 3.5: Weighted multi-scale feature map The feature map is obtained by upsampling through bilinear interpolation. The obtained feature map is compared with the linearly projected feature map F i 'Perform a series operation, and then a 1×1 convolution operation to obtain a fused feature map The formula is as follows:

[0020]

[0021]

[0022] Among them, US is the upsampling operation through bilinear interpolation; are feature maps extracted at different scales; φ 1×1 It is a 1×1 convolution operation used to integrate the number of channels.

[0023] Step 3.6: Concatenate the feature maps Through linear projection operation, the characteristic dimension is restored, and the formula is as follows:

[0024]

[0025] Among them, F″ is the final pedestrian feature vector, W i is the linear projection matrix;

[0026] Step 3.7: Perform residual processing to generate the final pedestrian feature vector F″.

[0027] Furthermore, the specific operation steps of step 3.4 include:

[0028] Step 3.4.1: Perform a global average pooling (GAP) on each multi-scale feature map to generate the global features of each channel;

[0029] Step 3.4.2: Generate a weight matrix through two fully connected layers and normalize it using the Sigmoid activation function.

[0030] Step 3.4.3: Substitute the weight matrix Wc Applied to the corresponding multi-scale feature map, adjust the channel weights in the feature map, and thus obtain the channel-weighted feature map Get the channel weighted feature map The formula is as follows:

[0031]

[0032] Among them, W c is the channel weight, GAP(F i ' ,j ) represents the feature map F i ' ,j Perform global average pooling, FC is the fully connected layer, and σ is the Sigmoid activation function.

[0033] Furthermore, the preprocessing of the data set described in step 1 includes data normalization and data enhancement processing, and the specific operation method is as follows:

[0034] Step 1.1: Data normalization: Resize the input image to a uniform size and resize the image to 384×192 through bilinear interpolation. The specific process of bilinear interpolation is: for each pixel position in the target image, find the corresponding floating-point coordinate in the original image, and then perform a weighted average of the four pixel values ​​around the floating-point coordinate to generate a smooth and detailed scaled image;

[0035] Step 1.2: Data enhancement: Image data enhancement is achieved by randomly flipping and erasing the image horizontally, increasing the number of images, and randomly selecting rectangular areas in the image and deleting the corresponding pixels.

[0036] Furthermore, the formula for bilinear interpolation in step 1.1 is:

[0037] V(x,y)=(1-a)(1-b)I(m,n)+a(1-b)I(m+1,n)+(1-a)bI(m,n+1)+abI(m+1,n+1)

[0038] Where V is the interpolation result of the pixel position (x, y) in the target image, (x, y) is the pixel in the target image, (m, n) is the pixel position in the original image, m and n are the coordinates rounded down, a and b are the decimal parts of the floating-point coordinates, which are used to represent the position offset of the pixel point of the target image relative to the pixel point of the original image; I is the pixel value in the original image, where I(m, n) is the pixel value of the original image at position (m, n).

[0039] Furthermore, the specific operation method of step 2 is: the SAM model encodes the input pedestrian image into a feature map through an image encoder based on Vision Transformer, which specifically includes the steps of:

[0040] Step 2.1: Input image I, size 384×192;

[0041] Step 2.2: Divide the input image into 16×16 image blocks, each block is the input unit of VIT;

[0042] Step 2.3: Add position information to each image block so that each block retains the spatial information of the VIT encoder;

[0043] Step 2.4: Convert the image block with position information into a high-dimensional initial feature map F through VIT i .

[0044] Furthermore, the Euclidean distance calculation is performed between the final pedestrian feature and the pedestrian feature vector in the database as described in step 4. The formula for calculating the Euclidean distance is:

[0045]

[0046] Among them, d is the final pedestrian feature vector F″ and the pedestrian feature vector F in the database db The Euclidean distance between them; n is the dimension of the feature vector; i is the i-th component of the feature vector; F” and F db Denote the feature vectors of the final pedestrian image and the database pedestrian image, respectively, i ” and F db,i are the i-th feature components respectively.

[0047] Beneficial Effects

[0048] The present invention proposes a pedestrian re-identification method based on multi-scale and attention feature extraction, which has the following beneficial effects compared with the prior art:

[0049] (1) The present invention constructs a customized multi-scale feature attention module MFA, and uses a channel attention mechanism to capture more fine-grained pedestrian features at different scales. The channel attention mechanism can effectively weight features at different scales according to different spatial dimensions, amplify more detailed key pedestrian local details at each scale, and improve the ability to distinguish details when pedestrians are dressed similarly; it can achieve targeted enhancement of responses to important areas and reduce the misrecognition rate. At the same time, with the segmentation ability of the SAM model, it can accurately distinguish pedestrians from other interfering elements in complex backgrounds, reducing the impact of background features on pedestrian re-recognition.

[0050] (2) The customized multi-scale feature attention module MFA in the present invention includes a linear projection layer, a multi-scale feature extraction layer, a feature enhancement layer, an attention layer and an upsampling layer. The optimized multi-scale convolution layer combines convolution kernels of different scales, deep convolution and upsampling operations, which can capture the detailed features of pedestrians from multiple levels. Even in a complex background or lighting environment, it can extract pedestrian features of different scales from the global features and distinguish the features of pedestrians, which is very suitable for dangerous areas in chemical plants. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0052] Figure 2 It is a structural schematic diagram of the SAM image encoder in the present invention.

[0053] Figure 3 Schematic diagram of the MFA architecture of the multi-scale feature attention module in the present invention.

[0054] Figure 4 Schematic diagram of feature visualization in the present invention. DETAILED DESCRIPTION

[0055] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Under the premise of not departing from the design concept of the present invention, various modifications and improvements made by ordinary persons in the art to the technical solutions of the present invention should all fall within the protection scope of the present invention.

[0056] Embodiment 1:

[0057] like Figure 1 As shown, a pedestrian re-identification method based on multi-scale and attention feature extraction includes the following steps:

[0058] Step 1: Obtain a public person re-identification dataset and preprocess the dataset. Preprocessing the dataset includes normalizing and enhancing the data. The specific operation is as follows:

[0059] Step 1.1: Data normalization: Adjust the input image to a uniform size and resize the image to 384×192 by bilinear interpolation. The formula for bilinear interpolation is:

[0060] V(x,y)=(1-a)(1-b)I(m,n)+a(1-b)I(m+1,n)+(1-a)bI(m,n+1)+abI(m+1,n+1)

[0061] Where V is the interpolation result of the pixel position (x, y) in the target image, (x, y) is the pixel in the target image, (m, n) is the pixel position in the original image, m and n are the coordinates rounded down, a and b are the decimal parts of the floating-point coordinates, which are used to represent the position offset of the pixel point of the target image relative to the pixel point of the original image; I is the pixel value in the original image, where I(m, n) is the pixel value of the original image at position (m, n).

[0062] The specific process of bilinear interpolation is: for each pixel position in the target image, find the corresponding floating-point coordinates in the original image, and then perform a weighted average of the four pixel values ​​around the floating-point coordinates to generate a smooth and detailed scaled image.

[0063] Step 1.2: Data enhancement: Image data enhancement is achieved by randomly flipping and erasing the image horizontally, increasing the number of images, and randomly selecting rectangular areas in the image and deleting the corresponding pixels.

[0064] Step 2: Use the SAM model to extract features from the input pedestrian image and generate the initial feature map F i ; The architecture of the SAM model is as follows Figure 2 The specific operation is as follows: The SAM model encodes the input pedestrian image into a feature map through an image encoder based on Vision Transformer, which includes the following steps:

[0065] Step 2.1: Input image I with size 384×192.

[0066] Step 2.2: Divide the input image into 16×16 image blocks, each block is the input unit of VIT.

[0067] Step 2.3: Add position information to each image block so that each block retains the spatial information of the VIT encoder.

[0068] Step 2.4: Convert the image block with position information into a high-dimensional initial feature map F through VIT i .

[0069] Step 3: Construct a customized multi-scale feature attention module MFA, and use the constructed multi-scale feature attention module MFA to perform multi-scale feature extraction and region enhancement processing on the initial feature map to generate the final pedestrian feature vector.

[0070] like Figure 3 As shown in the figure, the customized multi-scale feature attention module MFA includes the structure: linear projection layer, multi-scale feature extraction layer, feature enhancement layer, attention layer and upsampling layer.

[0071] The constructed multi-scale feature attention module MFA is used to perform multi-scale feature extraction and region enhancement processing on the initial feature map to generate the final pedestrian feature vector F″, which specifically includes the following steps:

[0072] Step 3.1: The multi-scale feature attention module MFA receives the initial feature map F i First, the feature dimension is reduced by linear projection to ensure that the computational complexity is reduced while retaining important information, thereby obtaining the feature map F i ', the formula is:

[0073] F i '=τ(ReLU(W i ·F i ))

[0074] Among them, W i is the linear projection matrix, τ(·) is the reconstruction operation, τ is the reconstruction factor, and ReLU is the activation function.

[0075] Step 3.2: Linearly project the feature map F i 'Perform multi-scale convolution operations and use 6 average pooling layers of different scales to extract multi-scale features, where the pooling kernel sizes are 2×2, 3×3, 4×4, 5×5, 6×6, and 7×7 respectively.

[0076] Step 3.3: After each pooled feature map is subjected to a 1×1 convolution and a depth-wise convolution, the feature map F is obtained. i ' ,j , 1×1 convolution is used to adjust the number of channels, and depth convolution is used to enhance local detail information. The formula is:

[0077] F i ' ,j =DepthConv(φ 1×1 (AP(F i '))),1≤j≤6

[0078] Among them, DepthConv is the depth convolution operation, φ 1×1 is a 1×1 convolution operation, AP is an average pooling operation, and j is the jth scale of the feature map.

[0079] Step 3.4: Introduce the SE channel attention mechanism on each scale feature map, perform weighted processing on it, and obtain a channel-weighted feature map The specific steps include:

[0080] Step 3.4.1: Perform a global average pooling (GAP) on each multi-scale feature map to generate the global features of each channel.

[0081] Step 3.4.2: Generate a weight matrix through two fully connected layers and normalize it using the Sigmoid activation function.

[0082] Step 3.4.3: Substitute the weight matrix W c Applied to the corresponding multi-scale feature map, adjust the channel weights in the feature map, and thus obtain the channel-weighted feature map Get the channel weighted feature map The formula is as follows:

[0083]

[0084] Among them, W c is the channel weight, GAP(F i ' ,j ) represents the feature map F i ' ,j Perform global average pooling, FC is the fully connected layer, and σ is the Sigmoid activation function.

[0085] Step 3.5: Weighted multi-scale feature map The feature map is obtained by upsampling through bilinear interpolation. The obtained feature map is compared with the linearly projected feature map F i 'Perform a series operation, and then a 1×1 convolution operation to obtain a fused feature map The formula is as follows:

[0086]

[0087] Among them, US is the upsampling operation through bilinear interpolation; are feature maps extracted at different scales; φ 1×1 It is a 1×1 convolution operation used to integrate the number of channels.

[0088] Step 3.6: Concatenate the feature maps Through linear projection operation, the characteristic dimension is restored, and the formula is as follows:

[0089]

[0090] Among them, F″ is the final pedestrian feature vector, W i is the linear projection matrix.

[0091] Step 3.7: Perform residual processing to generate the final pedestrian feature vector F″.

[0092] Step 4: Calculate the Euclidean distance between the final pedestrian feature and the pedestrian feature vector in the database. The formula for calculating the Euclidean distance is:

[0093]

[0094] Among them, d is the final pedestrian feature vector F″ and the pedestrian feature vector F in the database db The Euclidean distance between them; n is the dimension of the feature vector; i is the i-th component of the feature vector; F” and F db Denote the feature vectors of the final pedestrian image and the database pedestrian image, respectively, i ” and F db,i are the i-th feature components respectively. They are sorted according to the size of the distance and the result is used as the final output.

[0095] In order to verify the feasibility and superiority of this solution, the inventor conducted a comparative experiment for comparison. The specific experimental steps are as follows:

[0096] Experimental verification:

[0097] In this paper, in order to efficiently train the pedestrian re-identification model, experiments were conducted using NVIDIA A4000 GPU on the PyTorch platform. The specific experimental settings were: the batch size was set to 32, the optimizer was selected to use AdamW, and the weight decay was set to 1e -4 , the learning rate is set to 5e -4 In order to better evaluate the performance of the pedestrian re-identification model, two common indicators are used, namely Rank-1 and mAP. Rank-1 indicates whether the model can find the correct match in the first place among all the pedestrians in the database. mAP measures the average accuracy of the model under different queries and is an important indicator in the pedestrian re-identification task.

[0098] In order to verify the effectiveness of the proposed module, the pedestrian features are visualized. The visualization results are shown in Figure 4 As shown, from left to right are the original image, the preprocessed image, the initial feature map, the MFA feature map, and the baseline feature map. The baseline feature map here is generated based on the resnet-50 network structure.

[0099] It can be seen that compared with the unprocessed initial feature map, the processed feature map shows a higher degree of discrimination in the pedestrian part. The focus of the baseline model is not prominent, and after the MFA module, the model pays more attention to the pedestrian's limbs, such as feet, hands and head features, and the pedestrian's outline and clothing also receive a certain amount of attention. This shows that the MFA module effectively enhances the model's attention to pedestrian features through multi-scale and attention mechanisms, verifying its effectiveness in the pedestrian re-identification task.

[0100] In this embodiment, the inventors conducted a comparative experiment on the Market-1501 dataset between the present solution and the existing method. The experimental results are shown in Table 1:

[0101] Table 1 Comparative experimental results

[0102] Backbone network Rank-1(%) mAP(%) PCB 89.7 81.2 Ours 90.3 86.4

[0103] PCB is a local feature extraction person re-identification model, which divides the feature map horizontally into several parts and extracts the features of each part separately. Table 1 shows that Ours outperforms the existing models on Market-1501, with an accuracy increase of 0.6% and 5.2%. This verifies the feasibility and effectiveness of the proposed method in person re-identification detection.

[0104] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the present invention.

Claims

1. A person re-identification method based on multi-scale and attention feature extraction, characterized by: The following steps are involved: Step 1: Obtain a public person re-identification dataset and preprocess the dataset; Step 2: Use the SAM model to extract features from the input pedestrian image and generate the initial feature map F i ; Step 3: construct a custom multi-scale feature attention module MFA, and use the constructed multi-scale feature attention module MFA to perform multi-scale feature extraction and region enhancement processing on the initial feature map to generate a final pedestrian feature vector; the custom multi-scale feature attention module MFA includes a structure: a linear projection layer, a multi-scale feature extraction layer, a feature enhancement layer, an attention layer, and an upsampling layer; Step 4: Calculate the Euclidean distance between the final pedestrian features and the pedestrian feature vectors in the database, sort them according to the size of the distance, and use the result as the final output.

2. The method for person re-identification based on multi-scale and attention feature extraction according to claim 1, characterized in that: The multi-scale feature attention module MFA constructed in step 3 is used to perform multi-scale feature extraction and region enhancement processing on the initial feature map to generate the final pedestrian feature vector, which specifically includes the following steps: Step 3.1: The multi-scale feature attention module MFA receives the initial feature map F i , first reduce the feature dimension by linear projection to obtain the feature map F i ', the formula is: F i '=τ(ReLU(W i ·F i )); Among them, W i is the linear projection matrix, τ(·) is the reconstruction operation, τ is the reconstruction factor, and ReLU is the activation function; Step 3.2: Linearly project the feature map F i 'Perform multi-scale convolution operations and use 6 average pooling layers of different scales to extract multi-scale features, where the pooling kernel sizes are 2×2, 3×3, 4×4, 5×5, 6×6, and 7×7 respectively; Step 3.3: After each pooled feature map is subjected to a 1×1 convolution and a depth-wise convolution, the feature map F is obtained. i ' ,j , 1×1 convolution is used to adjust the number of channels, and depth convolution is used to enhance local detail information. The formula is: F i ' ,j =DepthConv(φ 1×1 (AP(F i '))),1≤j≤6 Among them, DepthConv is the depth convolution operation, φ 1×1 is a 1×1 convolution operation, AP is an average pooling operation, and j is the jth scale of the feature map. Step 3.4: Introduce the SE channel attention mechanism on each scale feature map, perform weighted processing on it, and obtain a channel-weighted feature map Step 3.5: Weighted multi-scale feature map The feature map is obtained by upsampling through bilinear interpolation. The obtained feature map is compared with the linearly projected feature map F i 'Perform a series operation, and then a 1×1 convolution operation to obtain a fused feature map The formula is as follows: Among them, US is the upsampling operation through bilinear interpolation; are feature maps extracted at different scales; φ 1×1 It is a 1×1 convolution operation used to integrate the number of channels. Step 3.6: Concatenate the feature maps Through linear projection operation, the characteristic dimension is restored, and the formula is as follows: Among them, F″ is the final pedestrian feature vector, W i is the linear projection matrix; Step 3.7: Perform residual processing to generate the final pedestrian feature vector F″.

3. The method for person re-identification based on multi-scale and attention feature extraction according to claim 2, characterized in that: The specific operation steps of step 3.4 include: Step 3.4.1: Perform a global average pooling GAP on each multi-scale feature map to generate the global features of each channel; Step 3.4.2: Generate a weight matrix through two fully connected layers and normalize it using the Sigmoid activation function. Step 3.4.3: Substitute the weight matrix W c Applied to the corresponding multi-scale feature map, adjust the channel weights in the feature map to obtain a channel-weighted feature map Get the channel weighted feature map The formula is as follows: Among them, W c is the channel weight, GAP(F i ' ,j ) represents the feature map F i ' ,j Perform global average pooling, FC is the fully connected layer, and σ is the Sigmoid activation function.

4. The method for person re-identification based on multi-scale and attention feature extraction according to claim 1, characterized in that: The preprocessing of the data set described in step 1 includes data normalization and data enhancement processing. The specific operation method is as follows: Step 1.1: Data normalization: Resize the input image to a uniform size and resize the image to 384×192 through bilinear interpolation. The specific process of bilinear interpolation is: for each pixel position in the target image, find the corresponding floating-point coordinate in the original image, and then perform a weighted average of the four pixel values ​​around the floating-point coordinate to generate a smooth and detailed scaled image; Step 1.2: Data enhancement: Image data enhancement is achieved by randomly flipping and erasing the image horizontally, increasing the number of images, and randomly selecting rectangular areas in the image and deleting the corresponding pixels.

5. The method for person re-identification based on multi-scale and attention feature extraction according to claim 4, characterized in that: The formula for bilinear interpolation in step 1.1 is: V(x,y)=(1-a)(1-b)I(m,n)+a(1-b)I(m+1,n)+(1-a)bI(m,n+1)+abI(m+1,n+1) Where V is the interpolation result of the pixel position (x, y) in the target image, (x, y) is the pixel in the target image, (m, n) is the pixel position in the original image, m and n are the coordinates rounded down, a and b are the decimal parts of the floating-point coordinates, which are used to represent the position offset of the pixel point of the target image relative to the pixel point of the original image; I is the pixel value in the original image, where I(m, n) is the pixel value of the original image at position (m, n).

6. The method for person re-identification based on multi-scale and attention feature extraction according to claim 1, characterized in that: The specific operation method of step 2 is: the SAM model encodes the input pedestrian image into a feature map through an image encoder based on Vision Transformer, which specifically includes the steps of: Step 2.1: Input image I, size 384×192; Step 2.2: Divide the input image into 16×16 image blocks, each block is the input unit of VIT; Step 2.3: Add position information to each image block so that each block retains the spatial information of the VIT encoder; Step 2.4: Convert the image block with position information into a high-dimensional initial feature map F through VIT i .

7. The method for person re-identification based on multi-scale and attention feature extraction according to claim 1, characterized in that: The Euclidean distance calculation is performed between the final pedestrian feature and the pedestrian feature vector in the database as described in step 4. The formula for calculating the Euclidean distance is: Among them, d is the final pedestrian feature vector F″ and the pedestrian feature vector F in the database db The Euclidean distance between them; n is the dimension of the feature vector; i is the i-th component of the feature vector; F” and F db Denote the feature vectors of the final pedestrian image and the database pedestrian image, respectively, i ” and F db,i are the i-th feature components respectively.