An occluded pedestrian re-identification method based on association information and attention mechanism

By combining associated information with an attention mechanism, the accuracy of pedestrian re-identification under occlusion is improved, the problem of poor robustness and saliency of feature extraction caused by occlusion is solved, and higher recognition accuracy is achieved.

CN116403237BActive Publication Date: 2025-12-05CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310205016.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2025-12-05
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

Existing technologies suffer from decreased accuracy in pedestrian re-identification under occlusion conditions, and their feature extraction robustness and saliency are weak.

Method used

We employ a method based on association information and attention mechanism. We construct an association information acquisition module and attention mechanism through the Vision Transformer network, and combine channel attention and spatial attention to extract robust and saliency features.

Benefits of technology

It improves the accuracy of pedestrian re-identification under occlusion conditions by obtaining channel correlation through the association information module and using the attention mechanism to focus on the unoccluded area, thereby extracting more robust and salient features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116403237B_ABST
    Figure CN116403237B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on association information and attention mechanism's occluded pedestrian re-identification method, association information and attention mechanism are combined to design a kind of network model for occluded pedestrian re-identification, by modeling the relationship between image channels, obtain inter-channel association information, then combined with channel attention and spatial attention, make model focus on the area of non-occlusion and obtain significant features.Finally, the model is optimized by combining triplet loss and cross-entropy loss, and the model accuracy is improved.Meanwhile, the application verifies the effect of the model on occluded pedestrian re-identification through experiments.Compared with various other methods, the model achieves the best effect, effectively utilizes the association information and attention mechanism to obtain more robust and related features, solves the problem of low accuracy of occluded pedestrian re-identification, and provides a more advantageous framework for the practical application of occluded pedestrian re-identification.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present application relates to the technical field of computer vision, and particularly relates to a method for occluded pedestrian re-identification based on correlation information and attention mechanism. BACKGROUND

[0002] Pedestrian re-identification is an important field of computer vision, and pedestrian re-identification refers to identifying whether a person in a picture or video is the same person across cameras. With the development of science and technology, the number of monitoring cameras is increasing, and people's demand for public safety is also increasing. Pedestrian re-identification plays a great role in intelligent security, intelligent business and the like, and has research significance and practical significance that cannot be ignored. However, due to the fact that pedestrians in pictures or videos captured by cameras in reality are often occluded, the accuracy of pedestrian re-identification is easily reduced. In order to solve the influence of the occlusion problem on pedestrian re-identification, the present application extracts robust features by obtaining inter-channel correlation information and combining attention mechanism.

[0003] In the field of deep learning, researchers usually improve the network in the spatial dimension to obtain more robust features. The present application is not improved in the spatial dimension, but in the channel. The present application explores the inter-channel correlation information, models the relationship between channels by designing a correlation information acquisition module, and obtains the inter-channel correlation information. And the deep learning network automatically learns the inter-channel correlation information, gives more weight to the key information, and extracts more significant features.

[0004] Attention mechanism originates from the research on human vision. Nowadays, computers can also realize attention mechanism. A commonly used method is to give a higher weight to the key attention part of the image, so that the computer extracts the features of the key area. Attention mechanism greatly improves the performance level of most computer vision tasks. Attention mechanism is generally divided into channel attention, spatial attention, temporal attention, branch attention and the like. The present application uses a hybrid attention mechanism combining channel attention and spatial attention, so that the model pays more attention to the area of the pedestrian that is not occluded, and extracts more significant features. SUMMARY

[0005] In view of the deficiencies of the prior art, the present application provides a method for occluded pedestrian re-identification based on correlation information and attention mechanism. The purpose is to solve the problem that the robustness and significance of pedestrian feature extraction are weak due to the occlusion problem.

[0006] In order to achieve the above purpose, the present application provides a method for occluded pedestrian re-identification based on correlation information and attention mechanism, comprising the following steps:

[0007] S1, construct a network framework, the backbone network of the network is composed of a Vision Transformer, mainly divided into an associated information acquisition module and an attention mechanism;

[0008] S2, given a pedestrian image X as input, obtain channel correlation features through the associated information acquisition module;

[0009] S3, given a pedestrian image X as input, obtain attention features through the channel attention module and the spatial attention module;

[0010] S4, fuse the correlation features obtained in step S2 and the attention features obtained in step S3 to form features with correlation and saliency, called fusion features, use the Vision Transformer network architecture to strengthen the correlation between features, and input the fusion features into the projection layer and the multi-layer deep self-attention network layer;

[0011] S5, finally, calculate the cross-entropy loss and the triplet loss according to the features output in step S4, take the sum of the two losses as the total loss, and continuously optimize the model according to the total loss.

[0012] The application provides a method for occluded pedestrian re-identification based on associated information and attention mechanism.

[0013] The application studies the problem that the extracted pedestrian features have noise and poor saliency caused by occlusion, not only uses the associated information module to obtain the associated information between channels in the picture, but also uses the channel attention and spatial attention to make the model pay more attention to the unoccluded part of the pedestrian, so as to extract more robust and salient features in the case of occluded pedestrians, thereby effectively solving the problem that the extracted pedestrian features have noise and poor saliency caused by occlusion, and further improving the recognition accuracy of occluded pedestrian re-identification. BRIEF DESCRIPTION OF DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0015] Figure 1 is the total network structure diagram of the occluded pedestrian re-identification method based on associated information and attention mechanism in the application.

[0016] Figure 2 is the structure diagram of the associated information acquisition module in the application.

[0017] Figure 3 is the structure diagram of the channel attention module in the patent of the application.

[0018] Figure 4 is the structure diagram of the spatial attention module in the patent of the application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the application described below can be combined with each other as long as they do not conflict with each other.

[0020] The present application is described in detail below in combination with the drawings and specific embodiments. A method for occluded pedestrian re-identification based on associated information and attention mechanism includes steps S1-S5:

[0021] S1, construct a network framework, the backbone network of the network is composed of Vision Transformer, mainly divided into two parts of associated information acquisition module and attention mechanism;

[0022] S2, given a pedestrian image X as input, obtain the channel correlation feature through the associated information acquisition module;

[0023] S3, given a pedestrian image X as input, obtain attention features through the channel attention module and the spatial attention module;

[0024] S4, fuse the correlation features obtained in step S2 and the attention features obtained in step S3 to form features with correlation and saliency, called fusion features, use Vision Transformer network architecture to strengthen the mutual correlation between features, and input the fusion features into the projection layer and the multi-layer deep self-attention network layer;

[0025] S5, finally, calculate the cross-entropy loss and the triplet loss according to the features output in step S4, take the sum of the two losses as the total loss, and continuously optimize the model according to the total loss.

[0026] Each step is described in detail below.

[0027] In step S1, the network architecture is constructed, as shown in Figure 1 The network is mainly composed of two parts of associated information acquisition module and attention mechanism. The steps are as follows:

[0028] S101, construct a framework based on Vision Transformer, mainly composed of two branches of association information module and attention mechanism.

[0029] S102, pre-process the pedestrian image and convert it into digital information.

[0030] In step S2, the given pedestrian image X is taken as input. As shown in Figure 2 , the channel association feature is obtained through the association information acquisition module. The steps are as follows:

[0031] S201, the feature extraction of the association information acquisition module uses a multi-layer convolutional neural network, mainly including a global average pooling layer and a fully connected layer. First, the picture is compressed through the global average pooling layer, and then reshaped to obtain a channel descriptor D c :

[0032] D c (X)=View(Avgpool(X)) (1)

[0033] Where X represents the pedestrian image, B represents the number of input pictures, C represents the number of channels of the picture, H represents the height of the picture, and W represents the width of the picture. Avgpool represents a global average pooling layer, and View represents reshaping the channel descriptor to a two-dimensional feature of BxC. The channel descriptor

[0034] S202, the channel descriptor is sent to two fully connected layers to construct the inter-channel association information, and the channel correlation weight Y is obtained:

[0035] Y(D c )=View(σ(FC2(ReLU(FC1(D c ))))) (2)

[0036] Where FC1 represents a fully connected layer with input channels C and output channels C / 3, FC2 represents a fully connected layer with input channels C / 3 and output channels C, ReLU represents a ReLU activation function, σ represents a Sigmoid activation function, and the View function is used to reshape the channel correlation weight to

[0037] S203, expand the channel correlation weight Y to facilitate multiplication with the original picture, and output the channel association feature T c :

[0038]

[0039] The Expand function expands Y to the same dimension as X, and * represents the element-wise multiplication of the two matrices.

[0040] In step S3, a pedestrian image X is required as input, and attention features are obtained through the channel attention module and the spatial attention module.

[0041] S301. First, the channel attention features T are obtained through the channel attention module. chanel ,like Figure 3 As shown, the channel attention module includes an average pooling layer, a max pooling layer, and a multilayer perceptron. First, the pedestrian image is passed through an average pooling layer and then through a multilayer perceptron to obtain T. A Meanwhile, T is obtained through a max pooling layer and then through a multilayer perceptron. M The obtained T A With T M The features are added together, and then multiplied by the pedestrian image X through an activation function to obtain the channel attention features T. chanel :

[0042]

[0043] Where MLP (Multilayer Perceptron) represents a multilayer perceptron, Avgpool represents average pooling, Maxpool represents max pooling, and σ represents the sigmoid activation function.

[0044] S302. Next, the channel attention features obtained in S301 are fed into the spatial attention module to obtain the channel-spatial hybrid attention T. cas ,like Figure 4 As shown, the spatial attention module includes average pooling layers, max pooling layers, and convolutional layers. First, the pedestrian image is passed through average pooling and max pooling layers, and the resulting features are concatenated and then fed into a convolutional layer with a kernel of 7. After passing through a sigmoid activation function, the feature is multiplied with the pedestrian image X to obtain the channel-space hybrid attention feature T. cas :

[0045]

[0046] in, This indicates a concatenation operation, which joins two matrices. *, σ, Maxpool, and Avgpool are the same as described above and will not be repeated. Conv represents a convolutional layer.

[0047] In step S4, the obtained relevance features of step S2 are fused with the attention features of step S3 to form features with relevance and saliency, referred to as fusion features, using a Vision Transformer network architecture to enhance the mutual relevance between features, and the fusion features are input into a projection layer and a multi-layer deep self-attention network layer.

[0048] S401, the channel relevance features T c obtained in step S2 are added to the channel spatial mixed attention features T cas obtained in step S3 to obtain fusion features T fuse :

[0049] T fuse = T c + T cas (6)

[0050] wherein T fuse represents fusion features fused with relevance information and attention mechanisms,

[0051] S402, the fusion features T fuse are input into a self-attention layer to obtain feature mapping, and then projected through a projection layer to obtain the output of the first layer deep self-attention network

[0052]

[0053] wherein Attention represents a self-attention module for exploring the relevance information between the fusion features, and Projection represents a projection module for reshaping the features into the input dimension required by the Vision Transformer.

[0054] S403, then the output obtained in step S402 is input into the L-layer deep self-attention network layer of the Vision Transformer to obtain the final features with robustness and saliency

[0055]

[0056] wherein, represents the output of the first layer deep self-attention network, represents the output of the previous layer deep self-attention network, LN represents a LayerNomal layer for preserving the size relationship between different features and the temporal relationship between features, and MSA (Multi-head Self-Attention) represents a multi-head self-attention for obtaining context information between features.

[0057] S5, the specific steps are: calculating the cross-entropy loss and the triplet loss according to the output features, and continuously optimizing the model according to the loss

[0058] S501, the loss function of the network structure model includes cross-entropy loss and triplet loss. Cross-entropy loss is a commonly used machine learning loss function. For a batch of n-class pedestrian pictures, the cross-entropy function L CrossEntropy is defined as follows:

[0059]

[0060] where batch represents how many pedestrian pictures are input at a time, n represents how many bits (classes) of pedestrians, log represents the mathematical logarithm operation, y ji represents the true probability of the batch of pedestrians, y′ ji represents the predicted probability of the batch of pedestrians. In general, the cross-entropy loss function is used to make the predicted value obtained by the model infinitely close to the true value, and can evaluate the accuracy of the model. After multiple iterations, the prediction is more accurate and closer to the true value.

[0061] In addition to the cross-entropy loss function, a triplet loss function is also used to train the triplet in the training set, that is, to calculate the loss of three entities or entity pairs to improve the accuracy of the machine learning model. It is mainly used for reasoning and relationship modeling tasks, which require predicting the relationship between triplets. The triplet loss function can help model training, thereby improving the accuracy of the model. The triplet loss L triplet is defined as follows:

[0062]

[0063] where, represents the feature expression of the sample, represents the feature expression of the positive sample, represents the feature expression of the negative sample, represents the Euclidean distance of the negative sample pair (sample and negative sample), that is, the distance of the sample pair of the target image and the least similar image, represents the distance of the positive sample pair (sample and negative sample). That is, the distance of the sample pair of the target image and the most similar image. Lambda is a necessary parameter, which represents that the distance between the negative sample pair and the positive sample pair should have a minimum interval.

[0064] The total loss of the final model is the sum of the partial triplet loss and the cross-entropy loss:

[0065] Loss=L CrossEntropy +αL triplet (11)

[0066] wherein, alpha represents a parameter.

[0067] S502, the network model loss optimization in machine learning is a method for adjusting model parameters to minimize the loss function. It is a process of continuous optimization iteration by reducing the loss, which helps the model to fit the data more effectively to obtain better prediction results. The specific process is that after training a round, the loss obtained in this round is fed back to the model, and then the next round of training is carried out. After a plurality of repeated iterations, the effect of reducing the loss is achieved, so that the prediction result is closer and closer to the true value, that is, the pedestrian re-identification effect is better and better.

[0068] In order to verify the effectiveness of the method of the application, experiments are carried out on Market1501, a commonly used data set for pedestrian recognition, and DukeMTMC, a commonly used data set for occluded pedestrian re-identification.

[0069] (1) Market1501 dataset is a total of 32668 images of 1501 people collected by six different cameras in Tsinghua University campus. The dataset uses DPM and manual annotation to label pedestrian pictures. There are two evaluation modes: single query and multiple query. Single query refers to querying with a pedestrian picture, and the application uses single query for experiment.

[0070] (2) DukeMTMC dataset is a total of 36411 images of 1812 people collected by eight different cameras in Duke University. Unlike Market1501, the pedestrian label of this dataset uses a manual labeling method. This dataset is a challenging dataset for pedestrian re-identification, because not only is there a high degree of similarity between different pedestrians, but even different pictures of the same pedestrian also have a large difference.

[0071] The operating system used in the experiment of the application is Ubuntu 20.04.1 LTS, and two GPUs with 12G of video memory (model GeForce GTX TITAN X) are used. In addition, the open source deep learning framework used in the implementation of the occluded pedestrian re-identification method based on association information and attention mechanism is Pytorch.

[0072] The application carries out experiments on formula (11) alpha, which is set to 0.6-1.4, and after a series of experiments, it is finally found that the best effect is achieved when alpha = 1.0.

[0073] Table 1 Effect of total loss alpha parameter setting on pedestrian re-identification

[0074] Value of a mAP (%) Rank-1 (%) 0.6 86.57 93.82 0.7 87.01 94.66 0.8 86.93 94.15 0.9 87.09 94.21 1.0 87.57 94.80 1.1 87.26 94.60 1.2 87.25 94.66 1.3 87.38 94.69 1.4 87.49 94.54

[0075] The experimental results of the alpha parameter setting are shown in Table 1, which is carried out on the pedestrian re-identification general dataset Market1501, mAP is the average accuracy mean, Rank-1 is the first hit rate, which represents the probability that the model returns the first result correct matching in the sorted picture list, both of which are evaluation indexes (the higher the better) of pedestrian re-identification. When alpha is set to 1.0, the evaluation indexes mAP and Rank-1 are higher than when alpha is set to other values, so the alpha parameter of the application is set to 1.0.

[0076] The performance of the method of the application is compared with some mainstream pedestrian re-identification methods: CBN+Bot, DG-Net, IS-GAN, CAP, SPReID, SGGNN, GPS, APDR, SONA2+3, P2-Net, ISP. In order to compare the retrieval performance of the method of the application with other pedestrian re-identification methods based on deep learning, the average accuracy mean (mAP), the first hit rate (Rank-1), the fifth hit rate (Rank-5) and the tenth hit rate (Rank-10) are used as evaluation criteria, and the experimental results on Market1501 are shown in Table 2:

[0077] Table 2 Comparison of experimental results of the method of the application and other methods on dataset Market1501

[0078] Method mAP (%) Rank-1 (%) Rank-5 (%) Rank-10 (%) CBN+Bot 83.6 94.3 97.9 98.7 DG-Net 86.7 90.9 - - IS-GAN 87.1 95.2 - - CAP 85.1 93.3 97.5 98.4 SPReID 81.3 92.5 97.2 81.3 SGGNN 82.8 92.3 96.1 97.4 Ours 87.31 94.77 98.28 98.87

[0079] The experimental results of the application on DukeMTMC are shown in Table 3:

[0080] Table 3 Comparison of experimental results of the method of the application and other methods on dataset DukeMTMC

[0081] Method mAP (%) Rank-1 (%) Rank-5 (%) Rank-10 (%) CAP 67.3 81.1 89.3 91.8 GPS 78.7 88.2 95.2 96.7 APDR 69.7 84.3 92.4 94.7 SONA2+3 78.3 89.4 95.4 96.6 P2-Net 73.1 86.5 931 95.0 ISP 80.0 89.6 95.5 - Ours 80.09 89.77 95.83 97.4

[0082] The bold results in the table represent the best results among a large number of pedestrian re-identification methods. As can be seen from Table 2, the effect of the method of the application on the Market1501 dataset reaches a good level, and three of the four evaluation indexes (mAP, Rank-5, Rank-10) are the first.

[0083] As can be seen from Table 3, the effect of the method of the application on the DukeMTMC dataset reaches an excellent level. The DukeMTMC dataset is commonly used for occluded pedestrian re-identification, and on this dataset, the four evaluation indexes of the application are the best compared with other pedestrian re-identification methods.

[0084] Obviously, the method has great advantages compared with other methods, and has good performance on both pedestrian re-identification dataset and occluded pedestrian re-identification dataset.

[0085] The method solves the problem of pedestrian re-identification under occlusion by using correlation information and attention mechanism, and the good effect is verified through experiments, and the experimental results are better than other deep learning methods of pedestrian re-identification.

[0086] The application further provides a computer device comprising a memory and a processor, the memory has a computer program stored, and the processor realizes the steps of the method when executing the computer program.

[0087] The above only describes the preferred embodiments of the application, and does not limit the patent scope of the application, and any equivalent structural transformation made under the inventive concept of the application, or direct / indirect application in other related technical fields is included in the patent protection scope of the application.

Claims

1. A method for occluded pedestrian re-identification based on association information and attention mechanism, characterized in that, The method is executed by a computer and includes the following steps: S1, constructing a network framework, the backbone network of the network is composed of a Vision Transformer, mainly divided into two parts of an association information acquisition module and an attention mechanism; S2, given a pedestrian image X as input, obtaining channel association features through the association information acquisition module; S3, given a pedestrian image X as input, obtaining attention features through the channel attention module and the spatial attention module; S4, fusing the association features obtained in step S2 and the attention features obtained in step S3 to form features with association and saliency, called fusion features, using a Vision Transformer network architecture to strengthen the mutual association between features, and inputting the fusion features into a projection layer and a multi-layer deep self-attention network layer, the specific implementation process of S4 is as follows: S401、the channel correlation feature T obtained in step S2 c In addition, the channel spatial mixed attention feature T obtained in step S3 cas to obtain the fusion feature T fuse : T fuse = T c + T cas (6) wherein T fuse represents a fusion feature that fuses the associated information and the attention mechanism, S402、fuse the features T fuse The input is sent to the self-attention layer to obtain a feature mapping, and then projected through the projection layer to obtain the output of the first layer of the deep self-attention network Where, Attention represents a self-attention module, which is used to explore the association information between the fusion features, and Projection represents a projection module, which is used to reshape the features to the input dimension required by the Vision Transformer; S403、Subsequently, the output obtained in step S402 is sent into the L-layer deep self-attention network layer of the Vision Transformer to obtain the final feature with robustness and saliency wherein, denotes the output of the first layer deep self-attention network, denotes the output of the previous layer deep self-attention network, LN denotes a LayerNomal layer for preserving the size relationship between different features and the temporal relationship between features, MSA (Multi-head Self-Attention) denotes a multi-head self-attention for obtaining the context information between features; S5, finally, calculate the cross-entropy loss and the triplet loss according to the features output by step S4, take the sum of the two losses as the total loss, and continuously optimize the model according to the total loss.

2. The occluded pedestrian re-identification method based on association information and attention mechanism according to claim 1, wherein, The specific implementation process of S1 is as follows: S101, construct a framework based on Vision Transformer, mainly composed of an association information module and an attention mechanism branch; S102, pre-process the pedestrian image and convert it into digital information.

3. The occluded pedestrian re-identification method based on association information and attention mechanism of claim 1, wherein, The specific implementation process of S2 is as follows: S201, the feature extraction of the correlation information acquisition module uses a multi-layer convolutional neural network, mainly including a global average pooling layer and a full connection layer. First, the picture is compressed through the global average pooling layer, and then reshaped to obtain a channel descriptor D c : D c (X) = View(Avgpool(X)) (1) wherein X represents a pedestrian image, B represents the number of input pictures, C represents the number of channels of the picture, H represents the height of the picture, W represents the width of the picture, Avgpool represents a global average pooling layer, View represents a channel descriptor reshaped into a two-dimensional feature of BxC, and the channel descriptor after global average pooling and reshaping S202, input the channel descriptor into two fully connected layers to construct the association information between channels, and obtain the channel correlation weight Y: Y(D c ) = View(σ(FC2(ReLU(FC1(D c )))))) (2) wherein FC1 denotes a fully connected layer with input channels C and output channels C / 3, FC2 denotes a fully connected layer with input channels C / 3 and output channels C, ReLU denotes a ReLU activation function, σ denotes a Sigmoid activation function, and the View function serves to reshape the channel-dependent weights to S203, the channel correlation weight Y is expanded so as to be multiplied with the original picture, and a channel correlation feature T is output c : Where, the Expand function represents expanding Y to the same dimension as X, and * represents multiplying the corresponding elements of the two matrices. 4.The occluded pedestrian re-identification method based on association information and attention mechanism of claim 1, wherein, The specific implementation process of S3 is as follows: S301、First, the channel attention feature T is obtained through the channel attention module chanel The channel attention module includes an average pooling layer, a maximum pooling layer, and a multi-layer perceptron, etc. First, the pedestrian picture passes through the average pooling layer and then the multi-layer perceptron to obtain T A Meanwhile, the pedestrian picture passes through the maximum pooling layer and then the multi-layer perceptron to obtain T M Then, the obtained T A and T M are added, and then the channel attention feature T chanel is obtained by passing through an activation function and multiplying the pedestrian picture X. T chanel (X) = X * σ(T A + T M ) =X*σ(MLP(Avgpool(X))+MLP(Maxpool(X))) (4) where MLP (Multilayer Perceptron) denotes a multilayer perceptron, Avgpool denotes average pooling, Maxpool denotes max pooling, and σ denotes a sigmoid activation function, S302, secondly, the channel attention feature obtained in S301 is sent to a spatial attention module to obtain a channel-spatial mixed attention T cas The spatial attention module includes an average pooling layer, a maximum pooling layer, and a convolution layer, etc. First, the pedestrian picture is passed through the average pooling layer and the maximum pooling layer, the obtained features are connected and then sent to a convolution layer with a convolution kernel of 7, then passed through a Sigmoid activation function, and then multiplied by the pedestrian image X to obtain the channel-spatial mixed attention feature T cas : wherein, denotes a concatenation operation, which is to concatenate two matrices, and, Maxpool and Avgpool are the same as above, and Conv denotes a convolution layer, 5. The method of claim 1, wherein the method further comprises: The specific implementation process of S5 is as follows: S501、The loss function of the network framework in step S1 includes a cross-entropy loss and a triplet loss. The cross-entropy loss is a commonly used machine learning loss function. For a batch of n pedestrian pictures of a class, the cross-entropy function L for pedestrian classification is CrossEntropy is defined as follows: Where batch represents how many pedestrian pictures are input at a time, n represents how many bits (classes) of pedestrians, log represents the mathematical logarithm operation, y ji represents the true probability of the batch of pedestrians, y′ ji represents the predicted probability of the batch of pedestrians, in addition to the cross-entropy loss function, a triplet loss function is also used, which is used to calculate the loss of three entities or entity pairs in the training set to improve the accuracy of the machine learning model. Triplet loss is mainly used for reasoning and relationship modeling tasks. The triplet loss function can help model training, thereby improving the accuracy of the model. The triplet loss L triplet is defined as follows: wherein, represents the feature expression of the sample, represents the feature expression of the positive sample, represents the feature expression of the negative sample, represents the Euclidean distance of the negative sample pair (sample and negative sample), that is, the distance of the sample pair of the target image and the least similar image, represents the distance of the positive sample pair (sample and negative sample), that is, the distance of the sample pair of the target image and the most similar image, margin is a necessary parameter, which indicates that there is a minimum interval between the distance of the negative sample pair and the distance of the positive sample pair, and the final model total loss is the sum of the partial triplet loss and the cross-entropy loss: Loss = L CrossEntropy + aL triplet (11) Where, α represents a parameter; S502, network model loss optimization in machine learning is a method for adjusting model parameters to minimize the loss function, which is a process of continuously optimizing iteration by reducing loss, which helps the model to fit the data more effectively to obtain better prediction results, the specific process is to feed back the loss obtained in this round to the model after training a round, and then train the next round, after multiple iterations, the effect of reducing loss is achieved, so that the prediction result is closer and closer to the true value, that is, the pedestrian re-identification effect is better and better.

Citation Information

Patent Citations

  • Pedestrian re-identification method based on multi-component self-attention mechanism

    CN111368815A

  • Person re-identification method combining reverse attention and multi-scale deep supervision

    US20210232813A1