A person re-identification method based on channel feature aggregation

By adopting channel feature aggregation and attention mechanism in the pedestrian re-identification model, combined with data enhancement and activation function optimization, the problems of difficulty in feature extraction and model performance degradation in the existing technology are solved, and higher recognition accuracy and model performance are achieved. stability.

CN113283320BActive Publication Date: 2024-09-06GUILIN ANWEI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110524584.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-13
Publication Date
2024-09-06
Estimated Expiration
2041-05-13

AI Technical Summary

Technical Problem

Existing pedestrian re-identification methods are difficult to extract features under the influence of factors such as light and weather, resulting in a decline in model performance. Moreover, the deep learning model is bloated and prone to gradient dispersion or explosion problems, making it difficult to apply on a large scale in real life.

Method used

Using a method based on channel feature aggregation, by segmenting and weighting the original residual network, combined with the attention mechanism to build a pedestrian re-identification model, and performing data enhancement and regularization processing, using WReLU and LWReLU activation functions, combined with CrossEntropyLoss and Circle loss optimization model.

Benefits of technology

It improves the model's ability to extract channel features, enhances network performance, reduces overfitting, improves recognition accuracy and generalization capabilities, and solves the problem of feature loss caused by the Dead ReLU phenomenon of WReLU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113283320B
    Figure CN113283320B
Patent Text Reader

Abstract

The present invention discloses a pedestrian re-identification method based on channel feature aggregation, and its main innovations are as follows: first, a SE Block structure is connected at the end of the residual block to improve the network's ability to extract channel features; second, two new activation functions WReLU and LWReLU are proposed in combination with ReLU and weight bias terms to effectively improve the neural network's ability to represent global features; third, LWReLU is applied in Split-Attention and SE Block to improve Split-Attention's ability to calculate the weights of each group of feature maps and SE Block's ability to extract channel features; fourth, a new loss function Circle Loss is applied to enable the model to be optimized more flexibly and to have a clearer convergence target, thereby improving the performance of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of neural network technology, and in particular to a pedestrian re-identification method based on channel feature aggregation. Background Art

[0002] Some existing research directions at home and abroad are to identify pedestrians by capturing local features. In terms of practicality, such methods can adapt to some scenarios, but the accuracy cannot be guaranteed, and often cannot achieve a high recognition accuracy, which will cause a great impact. Its limitations also include fewer scenarios for use. Because the extracted features are relatively few, the data under experimental conditions may be relatively excellent, but when conducting experiments in different field scenarios, objective factors such as light, weather, and wind level will disrupt the established capture features. Broadly speaking, due to the small number of features, although there is a certain degree of accuracy, it is impossible to apply it on a large scale in real life.

[0003] Traditional deep learning-based person re-identification algorithms mostly improve accuracy by simply stacking network layers or increasing the amount of data. However, doing so will inevitably make the size of the neural network bloated, and problems such as gradient diffusion or gradient explosion will occur. In addition, currently supervised learning in deep learning is mostly applicable to image data, while pedestrian data is difficult to extract features due to factors such as light and occlusion, resulting in reduced model performance. Summary of the invention

[0004] The purpose of the present invention is to provide a pedestrian re-identification method based on channel feature aggregation to improve model performance.

[0005] To achieve the above object, the present invention provides a pedestrian re-identification method based on channel feature aggregation, comprising the following steps:

[0006] The original residual network is segmented and weighted, and combined with the attention mechanism to build a pedestrian re-identification model;

[0007] Performing random data enhancement on the acquired images, and inputting the divided multiple data sets into the pedestrian re-identification model for training and verification, to obtain corresponding confidence scores;

[0008] The confidence scores are normalized, and a regularization strategy is used to suppress overfitting to obtain a predicted probability value.

[0009] Among them, the original residual network is segmented and weighted combined, and combined with the attention mechanism to build a pedestrian re-identification model, including:

[0010] Separate channels using 1x1 convolution and divide the input data into multiple groups, and divide each group into multiple small blocks;

[0011] All the groups and small blocks are grouped and fused, and combined with the attention mechanism to build a pedestrian re-identification model.

[0012] Among them, all the groups and small blocks are grouped and fused, and combined with the attention mechanism to build a pedestrian re-identification model, including:

[0013] All the small blocks in each of the small groups are separated by 1x1 convolution channels and fused by 3x3 convolution;

[0014] All the fused groups are aggregated and output, and after a 1x1 convolution operation, combined with the attention mechanism, a pedestrian re-identification model is constructed.

[0015] The acquired images are randomly enhanced, and the divided data sets are respectively input into the pedestrian re-identification model for training and verification to obtain corresponding confidence scores, including:

[0016] Randomly crop, erase and horizontally flip the acquired images;

[0017] The image after data enhancement is divided into a training set, a query image and a retrieval library image by using a cross-validation method;

[0018] Based on the Mini-Batch gradient descent algorithm and the cosine annealing method, the pedestrian re-identification model is trained using the training set, and the trained pedestrian re-identification model is tested using the query image and the retrieval library image to obtain corresponding multiple confidence scores.

[0019] Among them, the acquired image is randomly cropped, erased and horizontally flipped, including:

[0020] For randomly inserting background factors into the main features of multiple categories in the acquired image, based on the ratio of information gain or weight, deleting the corresponding background factors, and completing the cropping of the image;

[0021] Obtaining the original width, height and area of ​​the image, and the width, height and area of ​​the randomly erased area;

[0022] Obtain any pixel point in the image, and when the pixel point meets the erasing requirement, change the pixel values ​​of all points in the random erasing area to any random number between (0, 255), so as to complete cropping of the image;

[0023] The image is randomly flipped horizontally based on the Auto Augmentation method.

[0024] Wherein, after the original residual network is segmented and weightedly combined, and the attention mechanism is combined to construct a pedestrian re-identification model, the method further includes:

[0025] Based on the ReLU activation function, the positive interval value of the ReLU activation function is modified to the sum of the weight bias term and the feature map matrix element to obtain a modified WReLU activation function.

[0026] Wherein, after the original residual network is segmented and weightedly combined, and the attention mechanism is combined to construct a pedestrian re-identification model, the method further includes:

[0027] Based on the ReLU activation function, the negative interval value of the ReLU activation function is modified to a weight bias term to obtain a modified LWReLU activation function.

[0028] The original residual network is segmented and weightedly combined, and an attention mechanism is combined to construct a person re-identification model. The method further includes:

[0029] In the original residual network and attention mechanism, according to the structural proportion, the WReLU activation function is selected to extract the positive interval feature information or the LWReLU activation function is used to extract the negative interval feature information.

[0030] The confidence scores are normalized, and regularization strategies are used to suppress overfitting to obtain predicted probability values, including:

[0031] Normalizing the confidence scores and calculating the corresponding loss function;

[0032] Based on the regularization strategy, hyperparameters are introduced to improve the loss function to obtain the final optimal prediction probability value.

[0033] The confidence scores are normalized and the corresponding loss function is calculated, including:

[0034] The confidence scores are normalized, and the values ​​of the two loss functions CrossEntropyLoss and Circleloss are calculated respectively;

[0035] The values ​​of the CrossEntropyLoss and Circle loss loss functions are summed to obtain the corresponding loss function value.

[0036] The present invention discloses a pedestrian re-identification method based on channel feature aggregation. On the basis of the original neural network, the ability of Split-Attention to calculate the weights of each group of feature maps is improved, and SEBlock that can better learn channel features is introduced, thereby enhancing the performance of the network. At the same time, the activation functions WReLU and LWReLU proposed in the present invention have better global representation capabilities, and the combined use of Circle loss and CrossEntropyLoss can better optimize the model. Finally, the present invention conducts a comparative experiment on the use of activation functions ReLu and WReLU, and the results show that the effect of using all WReLU in the neural network is better than the effect of using all ReLu. In order to solve the problem of possible loss of key features due to the Dead ReLU phenomenon of WReLU, the present invention uses LWReLU in important positions of the feature aggregation part, and obtains better results than using WReLU in the entire network. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 It is a schematic diagram of the steps of a pedestrian re-identification method based on channel feature aggregation provided by the present invention.

[0039] Figure 2 It is a structural schematic diagram of the pedestrian re-identification model provided by the present invention.

[0040] Figure 3 This is the network structure diagram of the improved split-attention provided by the present invention.

[0041] Figure 4 This is a comparison diagram before (left) VS after (right) WReLU transformation provided by the present invention.

[0042] Figure 5 : The WReLU image (left) VS the ReLU image (right) provided by the present invention.

[0043] Figure 6 This is a comparison diagram before (left) VS after (right) the LWReLU transformation provided by the present invention.

[0044] Figure 7 : The LWReLU image (left) VS the LeakyReLU image (right) provided by the present invention.

[0045] Figure 8 This is a structural diagram of the SE Block provided by the present invention.

[0046] Fig. 9 This is a comparison diagram before random erasure (left) VS after random erasure (right) provided by the present invention. DETAILED DESCRIPTION

[0047] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0048] In the description of the present invention, “plurality” means two or more than two, unless otherwise clearly and specifically defined.

[0049] See also Figure 1 The present invention provides a pedestrian re-identification method based on channel feature aggregation, comprising the following steps:

[0050] S101. Segment and weighted combination of the original residual network, and combine it with the attention mechanism to build a pedestrian re-identification model.

[0051] Specifically, a 1x1 convolution separation channel is used to divide the input data into multiple groups, and each group is divided into multiple small blocks; all the small blocks in each group are fused through a 1x1 convolution separation channel and a 3x3 convolution; all the fused groups are aggregated and output, and after a 1x1 convolution operation, combined with an attention mechanism, a pedestrian re-identification model (ResNest) is constructed. The specific process is as follows:

[0052] ResNeSt is an improvement on ResNet, which incorporates the split attention of feature maps in a single network. That is, the feature map of each block is divided into several groups and finer-grained subgroups or partitions along the channel dimension. Among them, the feature representation of each group is determined by the weighted combination of its partition representation. This unit is a modular Split-Attention. By stacking several Split-Attention blocks, a pedestrian re-identification model is built.

[0053] ResNest uses 1x1 convolution to separate channels, and divides the input data into k small groups (Cardinal). Each Cardinal is divided into r small blocks (Split). The r Splits in each Cardinal are separated by 1x1 convolution and 3x3 convolution, connected by Split-Attention blocks, and finally the outputs of all groups are aggregated and added to the original input x. The number of channels is divided proportionally in k Cardinals and r Splits, and then spliced ​​in the channel dimension, which can better aggregate channel information.

[0054] Split-Attention module of ResNeSt

[0055] The Split-Attention module of ResNeSt first fuses the groups, and then connects an attention mechanism (SENet) structure, that is, global pooling + two fully connected layers (Fc1+Fc2). SENet mainly learns the correlation between channels and selects the attention for channels. It only increases the amount of calculation, but it can make the network more effective. The improved structure is as follows: Figure 2 As shown, the two fully connected layers are replaced by 1×1 convolution. The formula of Globalpooling is as follows:

[0056]

[0057] in:

[0058] U k ∈R H×W×C ,k∈1,2,...K

[0059] Where S: global pooling; c: number of channels of input feature map; H: height of output feature map; W: width of output feature map; U k : represents the kth cardinal group; k: k = 1, 2, 3...K (K is the number of cardinal groups); Perform global pooling on the k-th input feature map in the c-th dimension; The k-th basis array over the c-th dimension.

[0060] H, W, and C are the height, width, and number of channels of the input feature before the ResNeSt block. Global pooling is mainly used to collect context information. Each channel of the input feature map is an H×W matrix. The sum of all elements in this rectangle is averaged to get the Cth channel. right Perform rsoftmax (i.e. perform softmax by group) to obtain the weights of each group. The formula for rsoftmax is as follows:

[0061]

[0062] Where, a: weight;

[0063] c: the number of channels of the input feature map;

[0064] i: represents the split block, i=1,2,3...R;

[0065] k: k = 1, 2, 3, ... K (K is the number of base arrays);

[0066] R: hyperparameter, indicating the number of splits in the cardinal group;

[0067] G: Attention mechanism equation, implemented by two fully connected layers;

[0068] s k : Perform global pooling on the kth input feature map;

[0069] The weight of the i-th small block in the k-th basis array on the c-th dimension;

[0070] The i-th block in the c-th dimension uses the attention mechanism equation to s k Do mapping.

[0071] is based on the global context information k To determine the weight of the Cth channel of each group. Then fuse the features of each group according to the weight, and the output feature map is V k , V k The fusion calculation formula of the Cth channel in is as follows:

[0072]

[0073] In the traditional pooling process, each channel of the feature map is equal in value by default. However, in actual applications, the importance of feature maps in different channels varies. The attention mechanism can reduce the interference of irrelevant information on the extraction of main features, thereby improving the network's ability to extract features. SE Block is an attention mechanism added to the channel dimension, which only requires a small amount of calculation to automatically learn the importance of channel features. The implementation process of SE Block is as follows: Figure 8 As shown, it mainly includes two operations: Squeeze and Excitation.

[0074] The Squeeze operation is essentially a feature compression method, which is mainly achieved by global pooling of feature maps. The calculation formula is as follows:

[0075]

[0076] Where H and W are the height and width of the feature map, U c Represents the c-th two-dimensional matrix in the feature map U, where c represents the corresponding channel.

[0077] The Excitation operation models the correlation between channels through two 1×1×c fully connected layers and outputs the weights corresponding to the eigenvalues. The calculation formula is as follows:

[0078] E c =F ex (Z c ,W)=σ(W2δ(W1Z c ))

[0079] Among them W1Z c represents the first full connection, σ represents the Sigmoid function, δ represents the ReLU activation function, and W2δ represents the second full connection operation.

[0080] Assuming that the input is a h×w×c feature map, first perform a global average pooling on it. The global pooling (pooling size is h×w) operation can obtain a 1×1×c feature map, which can be understood as having a global receptive field. Then connect two fully connected layers. The number of neurons in the first fully connected layer is c / 16 to achieve the purpose of dimensionality reduction. The second fully connected layer is increased to C neurons. The advantage of this is that more nonlinear processing processes are added to fit the complex correlations between channels. Then connect a sigmoid layer to obtain a 1×1×c feature map. Finally, connect a full multiplication operation of the original h×w×c and 1×1×c feature maps to obtain feature maps with different importance of different channels.

[0081] SE Block mainly learns the correlation between channels and filters out the attention of different channels. The present invention embeds SEBlock at the end of ResNeSt Block to improve the network's ability to extract channel features.

[0082] The ReLU function stands for "rectified linear unit", which is the maximum function of the input x with the convolution image (x, 0). The ReLU function sets all negative values ​​in the matrix x to zero and leaves the rest unchanged. Its formula is as follows:

[0083]

[0084] ReLU has high computational efficiency and can make the network converge quickly. When x>0, the function value remains unchanged, so that the features can be continued to the next layer of the network. However, the importance of different features varies.

[0085] WReLU activation function To improve the representation ability of the activation function, the present invention proposes to apply the weight bias term on the basis of ReLU to obtain WReLU. Compared with ReLU, the value of WReLU in the positive gradient is the sum of the weight bias term and x, and its formula is as follows:

[0086]

[0087] Where S×x is the weight bias term, and S is given by the following formula:

[0088]

[0089] in, It represents the value of the i,jth element in the feature map matrix on the cth channel, i,j=0,1,2,3……,H,W are the width and height of the feature matrix; c is the number of channels, k=1,2,3……K (K is the number of basis arrays). The calculated S represents the weight of x. Because S is determined by the ratio of x to the sum of the absolute values ​​of all channel feature map elements, the activation function with weight bias term has better expression ability for global features.

[0090] WReLU transforms the feature map as follows Figure 4 As shown. Assume that the input feature map is 3×3×1, and take the value 1 in the upper left corner as an example. First, calculate that the sum of the absolute values ​​in the feature matrix corresponding to the feature map is 45, and then calculate S=1 / 45, then f(1)=1+1 / 45×1=1.022; and -2<0, so it is set to 0. Repeat the above operation to get Figure 4 Right picture.

[0091] When the independent variable x∈[0,1], the images of WReLU and ReLU are as follows Figure 5 As shown. When x>0, S>0, so x+S×x>x; when x=1, f SReLU >1, and f ReLU = 1. It can be seen that the larger the weight S of x, the greater the difference between WReLU and ReLU.

[0092] LWReLU activation function

[0093] Although WReLU inherits the advantages of ReLU in sparse matrix and accelerated convergence, it also inherits the disadvantages of ReLU. The phenomenon of ReLU being killed in the negative area is called Dead ReLU. ReLU is very "fragile" during training. When x<0, the gradient is 0. The gradient of this neuron and subsequent neurons is always 0, and no longer responds to any data, causing the corresponding parameters to never be updated. This may lead to the problem of losing some important features. To solve this problem, the traditional LeakyReLU uses a minimum value to initialize the neurons of the network, so that ReLU is more inclined to activate rather than disappear in the negative area. Its mathematical expression:

[0094] y=max(0,x)+Leaky×min(0,x)

[0095] Among them, Leaky is a very small constant. After adding Leaky, LeakyReLU retains some values ​​of the negative axis, so that the information of the negative axis will not be completely lost.

[0096] Drawing on the idea of ​​the LeakyReLU activation function, S is applied to the negative x-axis, so that the LWReLU keeps the value unchanged on the positive x-axis, and multiplies the eigenvalue by a coefficient on the negative x-axis. The difference is that the coefficient Leaky of LeakyReLU is a very small fixed value, while the coefficient S of LWReLU is dynamically determined by the ratio of the eigenvalue to the sum of all eigenvalues ​​of the feature map. Therefore, LWReLU not only does not have the Dead ReLU problem, but also has better global representation capabilities. Its formula is as follows:

[0097]

[0098] LWReLU transforms the feature map as follows Figure 6 shown.

[0099] Assume that the input feature map is 3×3×1. Taking the value 1 in the upper left corner as an example, first calculate that the sum of the absolute values ​​in the feature matrix corresponding to the feature map is 45, and then calculate S=1 / 45. Since 1>0, f(1)=1; and -2<0, so Repeat the above steps to get Figure 6 Right picture.

[0100] When the independent variable x∈[0,1], the images of LWReLU and LeakyReLU are as follows Figure 7 Shown: From Figure 7 It can be seen that the value of LeakyReLU in the negative direction of the x-axis is a fixed value, while the value of LWReLU in the negative direction is a dynamic value. In the negative direction of the x-axis, the smaller the x, the larger the S, and the greater the difference between LWReLU and LeakyReLU.

[0101] In places where the structure is heavy, such as where there are 3 Cardinals and n Splits, the WReLU activation function is used to extract positive interval feature information; and in places where the network structure is light, such as where there is only 1 Split-Attenton and 1 SE Block, the LWReLU activation function is used to extract negative interval feature information.

[0102] S102: Randomly perform data enhancement on the acquired image, and input the divided multiple data sets into the pedestrian re-identification model for training and verification, to obtain corresponding confidence scores.

[0103] Specifically, the acquired images are randomly cropped, erased, and horizontally flipped to improve the accuracy and generalization ability of the model, including:

[0104] For randomly inserted background factors in the main features of multiple categories in the acquired image, the corresponding background factors are deleted based on the information gain or weight ratio to complete the cropping of the image, specifically:

[0105] Randomly cropping the data is a way to reduce data noise and increase model stability while increasing data. For example, suppose a two-category classification problem (how to distinguish between human faces and cat faces). The main features of the G1 category are {E1, F1, G1}, and the main features of the G2 category are {E2, F2, G2}. The features here may be non-discrete. In order to increase the authenticity of the data, background data noise is added, that is, N1, N2, and N3 are randomly added to G1 and G2, which can be represented as background areas that are not human faces or cat faces. At this time, random cropping can get pictures. For convenience, the correlation between the combined features and the categories is not considered, that is, multiple local features can be combined into global features. At this time, the global features have an association relationship with the categories, which is different from the local features it contains, such as:

[0106] I1={E1,F1,G1}

[0107] I2={E1,G1,N1}

[0108] I3={E1,F1,N2}

[0109] Because N1, N2, N3 are random, and E1, F1, G1 can always generate the mapping E1, F1, G1 → G1 with high probability, which means that any factor in {E1, F1, G1} has higher information gain or weight than N1, N2, N3. That is:

[0110] P(C1|x∈{E1,F1,G1})>>P(C1|x∈{N1,N2,N3})

[0111] If N1, N2, and N3 also exist in G2, it means that the information gain of N1, N2, and N3 for classification is close to zero. Assume that the model has never seen data I x ={E1,G1,N1}, then from the above formula we can see that the weights of E1 and F1 are much higher than other features. Even if other unseen noises are added, the weights of E1 and F1 factors still play a major role, and the missing of individual factor features will not significantly affect the prediction results of the model. This is the same as the dropout principle in deep learning. The difference is that the way they are used and dropout are more random, so the overall model has higher stability.

[0112] Random clipping is equivalent to establishing a weight relationship between each factor feature and the corresponding category, weakening the weight of the background (or noise) factor, and making the model insensitive to missing values, which can produce better learning effects and increase model stability.

[0113] The original width, height and area of ​​the image and the width, height and area of ​​the randomly erased area are obtained; any pixel point in the image is obtained, and when the pixel point meets the erasure requirement, the pixel values ​​of all points in the randomly erased area are changed to any random number in (0, 255) to complete the cropping of the image, specifically:

[0114] like Fig. 9 As shown in the figure, occlusion is very common in life. However, in a dataset without occlusion, that is, all objects are clearly visible, the trained neural network may get a higher accuracy, but its generalization ability is limited, and it may not be able to recognize those occluded objects. Random erasing is to solve the occlusion problem.

[0115] Assume that the width and height of the input original image I are W×H, and the area S=W×H. The randomly erased area is I e , width and height are W e ×H e , area S e =W e ×H e , aspect ratio:

[0116]

[0117] Among them, r e : Aspect ratio of the erased area

[0118] r1:r e The lower threshold

[0119] r2:r e The upper threshold

[0120] He : Erase area height

[0121] W e : Width of the erase area

[0122] I and I e The area ratio is:

[0123]

[0124] Where, S: the area of ​​the original image

[0125] S e : The area of ​​the erased area

[0126] S l : S and S e Lower threshold of ratio

[0127] S h : S and S e Upper threshold of ratio

[0128] Set the probability of random erasing to p, that is, the probability of keeping the original image unchanged is 1-p. When a random erasing operation is required: first randomly find a pixel point P(x e ,y e ), if the following formula is satisfied:

[0129]

[0130] Then I e All pixel values ​​within are changed to a random number in the range (0,255).

[0131] The image is randomly flipped horizontally based on the Auto Augmentation method, specifically:

[0132] Images have many symmetries that do not change the information present in the image. For example, the mirror reflection of a dog is still a dog. While some of these "invariances" are obvious to humans, many are not. For example, mixup methods augment data by superimposing images on top of each other during training, producing data that improves the performance of neural networks.

[0133] Auto Augmentation is an automatic way to design custom data augmentation strategies for computer vision datasets. For example, it can guide the selection of basic image transformation operations, such as flipping images horizontally / vertically, rotating images, and changing image colors. AutoAugment not only predicts the image transformations to be combined, but also predicts the probability and number of transformations used for each image, so that image operations are not limited to one way. Auto Augmentation can select the best strategy from a search space with 2.9×1032 image transformation possibilities.

[0134] Auto Augmentation learns different transformations depending on the dataset it is run on. For example, for the House Number Street View (SVHN) images, which contain images of digital natural scenes, Auto Augmentation focuses on geometric transformations such as shearing and translation, which represent distortions commonly observed in this dataset. In addition, given the diversity of different building and house number materials in the world, Auto Augmentation has learned to completely invert the colors that naturally appear in the original SVHN dataset.

[0135] A cross-validation method is used to divide the image after data enhancement into a training set, a query image and a retrieval library image; based on a mini-batch gradient descent algorithm and a cosine annealing method, the training set is used to train the pedestrian re-identification model, and the trained pedestrian re-identification model is tested using the query image and the retrieval library image to obtain corresponding multiple confidence scores.

[0136] Mini-Batch is a concept of SGD algorithm in machine learning. In the early days of machine learning, because the data sets were usually very small, people would often go through the entire data set, find a gradient vector and make corresponding parameter updates. In the 21st century, as the cost of data collection and annotation continued to decline, the amount of data showed an exponential growth trend. The traditional gradient descent algorithm is no longer applicable. People often randomly sample a mini-batch and calculate the gradient of the mini-batch to update the parameters. The mini-batch of existing image classification models is relatively large, such as 128, 256, and even the latest 32K images. Larger mini-batches can not only speed up training, but also have a better approximation of the overall distribution of data, making parameter updates more efficient.

[0137] When we use the gradient descent algorithm to optimize the objective function, as we get closer and closer to the global minimum of the Loss value, the learning rate should become smaller to make the model as close to this point as possible, and cosine annealing can reduce the learning rate through the cosine function. In the cosine function, as x increases, the cosine value first decreases slowly, then accelerates, and then decreases slowly again. This descent mode can work with the learning rate to produce good results in a very efficient way.

[0138] S103, normalizing the confidence score, and using a regularization strategy to suppress overfitting to obtain a predicted probability value.

[0139] Specifically, the confidence score is normalized and the corresponding loss function is calculated; based on the regularization strategy, hyperparameters are introduced to improve the loss function to obtain the final optimal prediction probability value and improve the recognition accuracy, specifically:

[0140] There are two basic paradigms for feature learning: classification learning and sample pair learning. When performing classification learning, a classification loss function such as CrossEntropyLoss is usually required to optimize the similarity between samples and weight vectors. When performing sample pair learning, a metric loss function such as triplet loss is usually required. However, the optimization of these two feature learning methods lacks flexibility and the convergence state is unclear. To solve the above problems, Yifan Sun et al. proposed Circle loss, which unifies the two feature learning paradigms. The formula is as follows:

[0141]

[0142] Among them, s p represents the intra-class similarity, s n represents the inter-class similarity, K represents the total number of intra-class similarity scores associated with a single sample in a given feature space, and L represents the total number of inter-class similarity scores associated with a single sample in a given feature space.

[0143] As a commonly used loss function, CrossEntropyLoss also has the advantage of being a convex optimization function, making it easier to find the optimal solution using the gradient descent method. The formula for CrossEntropyLoss is as follows:

[0144] H(p,q)=-∑ x (p(x)logq(x)

[0145] Where probability distribution p is the expected output and probability distribution q is the actual output.

[0146] In order to combine the advantages of CrossEntropyLoss and Circle loss, the present invention simply adds the outputs of the two to obtain the loss function used in the present invention:

[0147]

[0148] We conducted multiple experiments on the original ReId algorithm, the ReId algorithm with SENet, and the ReId algorithm with improved Split-Attention to compare the performance of the network models. We also used strategies such as random erasing of data, warm-up before model training, and learning rate decay.

[0149] The experiments of the present invention train and verify the model on three mainstream public datasets: Market1501, DukeMTMC-ReID, and CUHK03-NP, as shown in Table 1.

[0150] Table 1 Dataset introduction

[0151]

[0152] The Market1501 dataset uses 6 cameras to capture 1501 pedestrian data, including 32668 images and manual annotations. The training set contains 751 pedestrian objects and 12936 images; the test set contains 750 pedestrian objects and 19732 images; the DukeMTMC-ReID dataset uses 8 cameras to capture 1404 pedestrian objects and manual annotations, including 36411 pedestrian images. The training set contains 702 pedestrian objects and 16522 images; the test set contains 702 pedestrian objects and 17661 images; the CUHK03-NP dataset uses 5 pairs of cameras to capture 1467 pedestrian objects and manual annotations, including 13164 pedestrian images. The CUHK03-NP dataset is divided into two parts: detected and labeled according to different annotation methods. Each part has independent training and test sets. The pedestrian boxes of the detected data are annotated by machines, and the pedestrian boxes of the labeled data are annotated manually. The present invention uses the 2017 evaluation protocol on the CUHK03-NP dataset.

[0153] The experiment of the present invention was carried out on NVIDIATITAN XP GPU, using Pytorch as the algorithm framework and ResNest50 as the backbone network. Before entering the network, the input image was subjected to data enhancement operations such as random cropping, horizontal flipping and random erasing, and the image size was adjusted to 256×128 before being normalized and input into the neural network. The initial learning rate lr was set to 0.02, and the learning rate decayed to lr×0.65 after each epoch. The batch size of the experiment was set to 8, and a total of 90 epochs were trained. The pre-trained model used a classification model trained on the ImageNet dataset using ResNeSt50. All experiments of the present invention used a single query, that is, for each pedestrian under each camera, only one image was randomly selected for query, and the performance of the pedestrian re-identification algorithm was evaluated using Rank-1 and mean average precision (mAp).

[0154] Experimental Training Strategy

[0155] 1. Large Mini-batch. Mini-batch is a concept of the SGD algorithm in machine learning. In the early days of machine learning, because the data sets were usually very small, people would often go through the entire data set, find a gradient vector and make corresponding parameter updates. In the 21st century, as the cost of data collection and annotation continued to decline, the amount of data showed an exponential growth trend. The traditional gradient descent algorithm is no longer applicable. People often randomly sample a mini-batch and calculate the gradient of the mini-batch to update the parameters. The mini-batch of existing image classification models is relatively large, such as 128, 256, and even the latest 32K images. Larger mini-batches can not only speed up training, but also have a better approximation to the overall distribution of data, making parameter updates more efficient.

[0156] Label smoothing is a method to prevent overfitting in classification problems. In multi-classification tasks, the neural network will output a confidence score for each category of the current data. These scores will be normalized through softmax, and finally the probability q of the current data belonging to each category will be obtained. i .q i The calculation formula is as follows:

[0157]

[0158] Among them, q i : The probability of each category, that is, the predicted value; K: The total number of categories

[0159] i: one of the multiple categories

[0160] Zi : Predicted probability distribution

[0161] Then calculate the cross entropy loss function Loss:

[0162]

[0163]

[0164] Among them, Loss: cross entropy loss; K: total number of categories

[0165] i: one of the multiple categories

[0166] q i : The probability of each category, that is, the predicted value

[0167] p i : The true value of each category

[0168] p i : The true value of each category

[0169] i: one of the multiple categories

[0170] j: predicted category

[0171] K is the total number of categories, and i represents a category among multiple categories. When training a neural network, the cross entropy between the predicted probability and the true probability of the label is minimized to obtain the optimal predicted probability distribution. The optimal predicted probability distribution is:

[0172]

[0173] The neural network will force itself to learn in the direction with the largest difference between the correct label and the wrong label. When the training data is small and insufficient to represent all sample features, it will cause the network to overfit.

[0174] Label smoothing can solve the above problem. It is a regularization strategy that mainly adds noise through softone-hot, reducing the weight of the category of the real sample label when calculating the loss function, and ultimately suppressing overfitting. After adding label smoothing, the real probability distribution has the following changes:

[0175]

[0176] ε is a small hyperparameter. The corresponding change of cross entropy loss function is as follows:

[0177]

[0178] The final optimal prediction probability distribution is as follows:

[0179]

[0180] Here ε is an arbitrary real number. The final model suppresses the difference between positive and negative sample outputs, making the network more generalizable.

[0181] Experimental data and result analysis

[0182] The improved model is trained and tested on Market1501, DukeMTMC-ReID and CUHK03-NP respectively, and the performance of the improved person re-identification algorithm model is evaluated using mAp and Rank-1 performance evaluation indicators. Among them, mAp proposed by Zheng et al. is used to test the pedestrian retrieval performance under multiple cameras. Rank-k means that in the ordered list returned after the algorithm retrieval, the first k positions are the hit rate of the correct retrieval target, such as Rank-1 means that the first retrieval is the retrieval target.

[0183] Embedding SE Block Experiment

[0184] Table 2 Performance comparison after embedding SE Block

[0185]

[0186]

[0187] The performance of the model after embedding SE Block on the three major datasets is shown in Table 2. As can be seen from Table 2, the performance of the improved model on the three large datasets has been improved, among which the improvement on the DukeMTMC-ReID dataset is more significant, which may be related to factors such as the shooting environment of the dataset. On the DukeMTMC-ReID dataset, Rank-1 increased by 1.22% and mAp increased by 2.23%; on the Market1501 dataset, Rank-1 increased by 0.54% and mAp increased by 0.49%.

[0188] WReLU activation function experiment

[0189] Table 3 shows the experimental results of applying WReLU in the network. The experiment found that the performance of the model after applying the WReLU activation function was significantly improved on the three major datasets. The improvement on the CUHK03-NP dataset was particularly significant, and the experimental data was the average of three repeated experiments. On the DukeMTMC-ReID dataset, Rank-1 increased by 1.53% and mAp increased by 1.56%; on the Market1501 dataset, Rank-1 increased by 0.54% and mAp increased by 1.42%.

[0190] Table 3 Performance comparison after applying WReLU

[0191]

[0192] LWReLU activation function experiment

[0193] As can be seen from Table 4, the overall performance improvement after applying LWReLU in the network is not as obvious as that of WReLU on the three major data sets. The main difference between LWReLU and WReLU is that the value of the former in the negative area is a weight bias term while the latter is 0, which also shows that LWReLU is not suitable for global use, and indirectly shows that most of the features "discarded" by WReLU in the negative area do not affect the performance of the network. The experiment improved Rank-1 by 0.77% and mAp by 2.08% on the DukeMTMC-ReID dataset; Rank-1 improved by 0.33% and mAp improved by 1.31% on the Market1501 dataset.

[0194] Table 4 Performance comparison after applying LWReLU

[0195]

[0196]

[0197] Model ablation experiment

[0198] To verify the effectiveness of each component of the improved model, the present invention conducted ablation experiments on three data sets, using a single query mode and using Rank-1 and mAp as evaluation indicators. SE means embedding SE Block, WReLU means applying WReLU activation function, and LWReLU means applying LWReLU activation function. The experimental results are shown in Table 5.

[0199] Comparison with existing methods

[0200] As shown in Table 5, after embedding SE Block in the ResNeSt50 network, the Rank-1 and mAp indicators of the model have been improved to a certain extent. After further adding the newly proposed activation function and applying the improved loss function, the two indicators of the model are further improved. In the Market1501 dataset, the Rank-1 increased by 0.98% and the mAp increased by 2.11% after the improved algorithm was applied. On the DukeMTMC dataset, the Rank-1 increased by 2.02% and the mAp increased by 2.56% after the improved algorithm was applied.

[0201] Table 5 Ablation experiment of the method proposed in the present invention

[0202]

[0203] Table 6 Performance comparison of different algorithm models

[0204]

[0205] As shown in Table 6, the improved model has obvious improvements on the Market1501, DukeMTMC and CUHK03-NP datasets, indicating that the improved model has good robustness. It also shows that the improved model can extract features more effectively in the feature extraction stage.

[0206] As can be seen from Table 6, compared with other ReID methods, the ResNeSt50 network that applies all the improvements in this paper has improved on the three major datasets. Compared with the 2017 ICCV paper SVDnet, the Rank-1 and mAp of the method proposed in this paper on the Market1501 dataset increased by 11.04% and 20.20 respectively. Compared with the 2018 CVPR paper AACN, the Rank-1 and mAp of this paper on the Market1501 dataset increased by 7.44% and 15.43% respectively. Among them, the method proposed by ACCN has the best effect on the CUHK03-NP dataset. This paper analyzes that the network parameters of ACCN on the CUHK03-NP dataset are better adjusted, and the backbone network used by ACCN is ACCN, while the backbone network used in this paper is ResNeSt. If the innovations proposed in this paper are used for ACCN, better results should be achieved.

[0207] The present invention discloses a pedestrian re-identification method based on channel feature aggregation. On the basis of the original neural network, the ability of Split-Attention to calculate the weights of each group of feature maps is improved, and SEBlock that can better learn channel features is introduced, thereby enhancing the performance of the network. At the same time, the activation functions WReLU and LWReLU proposed in the present invention have better global representation capabilities, and the combined use of Circle loss and CrossEntropyLoss can better optimize the model. Finally, the present invention conducts a comparative experiment on the use of activation functions ReLu and WReLU, and the results show that the effect of using all WReLU in the neural network is better than the effect of using all ReLu. In order to solve the problem of possible loss of key features due to the Dead ReLU phenomenon of WReLU, the present invention uses LWReLU in important positions of the feature aggregation part, and obtains better results than using WReLU in the entire network.

[0208] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.

Claims

1. A pedestrian re-identification method based on channel feature aggregation, characterized in that: The following steps are involved: The original residual network is segmented and weighted, and combined with the attention mechanism to build a pedestrian re-identification model; Performing random data enhancement on the acquired images, and inputting the divided multiple data sets into the pedestrian re-identification model for training and verification, to obtain corresponding confidence scores; The confidence scores are normalized and regularized to suppress overfitting, thereby obtaining a predicted probability value; The original residual network is segmented and weighted, and combined with the attention mechanism to build a pedestrian re-identification model, including: Separate channels using 1x1 convolution and divide the input data into multiple groups, and divide each group into multiple small blocks; All the groups and small blocks are grouped and fused, and an attention mechanism is combined to construct a person re-identification model; All the groups and small blocks are grouped and fused, and combined with the attention mechanism to build a pedestrian re-identification model, including: All the small blocks in each of the small groups are separated by 1x1 convolution channels and fused by 3x3 convolution; All the fused groups are aggregated and output, and after a 1x1 convolution operation, combined with the attention mechanism, a pedestrian re-identification model is constructed.

2. The pedestrian re-identification method based on channel feature aggregation according to claim 1, characterized in that: The acquired images are randomly enhanced, and the divided multiple data sets are respectively input into the pedestrian re-identification model for training and verification to obtain corresponding confidence scores, including: Randomly crop, erase and horizontally flip the acquired images; The image after data enhancement is divided into a training set, a query image and a retrieval library image by using a cross-validation method; Based on the Mini-Batch gradient descent algorithm and the cosine annealing method, the pedestrian re-identification model is trained using the training set, and the trained pedestrian re-identification model is tested using the query image and the retrieval library image to obtain corresponding multiple confidence scores.

3. The pedestrian re-identification method based on channel feature aggregation as claimed in claim 2, characterized in that: The acquired images are randomly cropped, erased, and horizontally flipped, including: For randomly inserting background factors into the main features of multiple categories in the acquired image, based on the information gain or weight ratio, the corresponding background factors are deleted to complete the cropping of the image; Obtaining the original width, height and area of ​​the image, and the width, height and area of ​​the randomly erased area; Obtain any pixel point in the image, and when the pixel point meets the erasing requirement, change the pixel values ​​of all points in the random erasing area to any random number between 0 and 255, so as to complete the cropping of the image; The image is randomly flipped horizontally based on the Auto Augmentation method.

4. The pedestrian re-identification method based on channel feature aggregation according to claim 1, characterized in that: After segmenting and weighted combining the original residual network and combining the attention mechanism to construct a person re-identification model, the method further includes: Based on the ReLU activation function, the positive interval value of the ReLU activation function is modified to the sum of the weight bias term and the feature map matrix element to obtain a modified WReLU activation function.

5. The pedestrian re-identification method based on channel feature aggregation as claimed in claim 4, characterized in that: After segmenting and weighted combining the original residual network and combining the attention mechanism to construct a person re-identification model, the method further includes: Based on the ReLU activation function, the negative interval value of the ReLU activation function is modified to a weight bias term to obtain a modified LWReLU activation function.

6. The pedestrian re-identification method based on channel feature aggregation according to claim 5, characterized in that: The original residual network is segmented and weightedly combined, and an attention mechanism is combined to construct a pedestrian re-identification model. The method further includes: In the original residual network and attention mechanism, according to the structural proportion, the WReLU activation function is selected to extract the positive interval feature information or the LWReLU activation function is used to extract the negative interval feature information.

7. The pedestrian re-identification method based on channel feature aggregation as claimed in claim 1, characterized in that: The confidence scores are normalized, and regularization strategies are used to suppress overfitting to obtain predicted probability values, including: Normalizing the confidence scores and calculating the corresponding loss function; Based on the regularization strategy, hyperparameters are introduced to improve the loss function to obtain the final optimal prediction probability value.

8. The pedestrian re-identification method based on channel feature aggregation according to claim 7, characterized in that: The confidence scores are normalized and the corresponding loss function is calculated, including: The confidence scores are normalized, and the values ​​of the two loss functions, CrossEntropyLoss and Circle loss, are calculated respectively; Circle loss loss function, its formula is as follows: Among them, s p represents the intra-class similarity, s n represents the inter-class similarity, K represents the total number of intra-class similarity scores associated with a single sample in a given feature space, and L represents the total number of inter-class similarity scores associated with a single sample in a given feature space; The values ​​of the CrossEntropyLoss and Circle loss loss functions are summed to obtain the corresponding loss function value.