Pedestrian re-identification model generation method, pedestrian re-identification method and device

By introducing the collaborative work of multi-branch networks and attention modules into the pedestrian re-identification model, combined with loss function optimization, the problem of lack of cooperation between branches is solved, and the accuracy of pedestrian re-identification is improved.

CN116563790BActive Publication Date: 2026-04-10SUZHOU VOCATIONAL UNIVERSITY (SUZHOU OPEN UNIVERSITY)
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU VOCATIONAL UNIVERSITY (SUZHOU OPEN UNIVERSITY)
Filing Date
2023-05-12
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing pedestrian re-identification methods, the lack of cooperation between branches in multi-branch structures makes it difficult to effectively extract multiple local information from pedestrian images, thus reducing the accuracy of re-identification.

Method used

A backbone feature extraction network with multiple branch networks and attention modules working together is adopted. Local information extraction is enhanced through channel and spatial attention mechanisms, and model parameters are optimized by combining cross-entropy, multiple similarity and center loss function.

Benefits of technology

The accuracy of pedestrian re-identification has been improved. The various branches of the backbone feature extraction network work together to enhance the ability to extract local information features from pedestrian images and improve recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563790B_ABST
    Figure CN116563790B_ABST
Patent Text Reader

Abstract

The application discloses a pedestrian re-identification model generation method, a pedestrian re-identification method and a device thereof. The pedestrian re-identification model generation method comprises the following steps: acquiring a plurality of pedestrian images, and preparing a training set according to the plurality of pedestrian images; creating a pedestrian re-identification model, and training the pedestrian re-identification model based on the training set. Thus, a model capable of performing pedestrian re-identification is generated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of pedestrian re-identification, in particular to a pedestrian re-identification model generation method, a pedestrian re-identification method and a device thereof. BACKGROUND

[0002] Pedestrian re-identification technology is an important branch of the security field, and the most important thing is to obtain a feature expression with strong discrimination ability. Most of the existing technologies use a multi-branch structure to learn features of different scales to enhance global features and local features. By applying an attention mechanism to pedestrian images to suppress irrelevant noise information, the discrimination ability of the feature expression can be further improved.

[0003] However, in the current pedestrian re-identification method, each branch basically works independently when applying a multi-branch structure and an attention mechanism, and there is no communication and cooperation between them. This weakens the ability of the network model to mine local details in pedestrian images, making it difficult to effectively extract multiple local information in pedestrian images, resulting in low pedestrian re-identification accuracy. SUMMARY

[0004] The purpose of the present application is to solve the above problems, and provide a pedestrian re-identification model generation method, a pedestrian re-identification method and a device thereof.

[0005] To achieve the above purpose, the technical scheme of the present application is as follows: a pedestrian re-identification model generation method, comprising the following steps: obtaining a plurality of pedestrian images, preparing a data set according to the plurality of pedestrian images, and dividing the data set into a training set and a test set; creating a pedestrian re-identification model, which includes a data preprocessing module, a feature extraction network module, and a training strategy module; the data preprocessing module is used to: randomly select a predetermined number of pedestrian images from the training set, and according to the pedestrian images, form a plurality of training batches, and preprocess the images in each training batch to obtain training images; the feature extraction network module is composed of a plurality of branch networks and an attention module, and is used to: perform feature extraction on the training images to obtain an output vector; the training strategy module is used to: calculate a loss value according to the output vector, and update the parameters of the neural network in the pedestrian re-identification model according to the loss value; based on the training set, the pedestrian re-identification model is trained.

[0006] As an improvement of an embodiment of the present application, the pedestrian images are images taken by a plurality of monitoring cameras with non-overlapping fields of view, and each image contains a pedestrian; the "dividing the data set into a training set and a test set" specifically includes: dividing the pedestrian images according to the IDs of the pedestrians at a specified ratio, thereby dividing the data set into a training set and a test set.

[0007] As a further improvement of the embodiment of the application, the data preprocessing module is further configured to perform the following operations on all pedestrian images in the training set: scaling to a uniform size, random cropping, random horizontal and left-right flipping, random erasing, and standardization processing.

[0008] As a further improvement of the embodiment of the application, the feature extraction network module further comprises: the branch network is a first branch network, a second branch network, a third branch network, and a fourth branch network, the first branch network comprises Conv2, Conv3, Conv4, and Conv5 of the OSNet, and an attention module is embedded after the convolution blocks of Conv2, Conv3, and Conv4, the second branch network comprises Conv2, Conv3, and Conv4 of the OSNet, and an attention module is embedded after the convolution blocks of Conv3 and Conv4, the third branch network comprises Conv4 and Conv5 of the OSNet, and an attention module is embedded after the convolution block of Conv4, and the fourth branch network comprises Conv5 of the OSNet; the Conv3 module of the second branch network receives the output of Conv2 of the first branch network through the attention module, the Conv4 module of the second branch network receives the output of Conv3 of the first branch network through the attention module, and the Conv5 module of the second branch network receives the output of Conv4 of the first branch network through the attention module; the Conv4 module of the third branch network receives the output of Conv3 of the second branch network through the attention module, and the Conv5 module of the third branch network receives the output of Conv4 of the second branch network through the attention module; and the Conv5 module of the fourth branch network receives the output of Conv4 of the third branch network through the attention module.

[0009] As a further improvement of the embodiment of the application, the attention module is composed of a channel attention mechanism and a spatial attention mechanism.

[0010] As a further improvement of the embodiment of the application, the loss value is calculated by setting the loss value as The loss value is updated by a function wherein, is a cross-entropy loss, is a multi-similarity loss, is a center loss, and λ xe is a weight coefficient of the cross-entropy loss, λ ms is a weight coefficient of the multi-similarity loss, λ ce is a weight coefficient of the center loss.

[0011] As an improvement of the embodiment of the present application, the "updating the parameters of the branch network in the pedestrian re-identification model according to the loss value" specifically comprises: transmitting the loss value to the branch network through a back propagation algorithm, and optimizing the parameters of the branch network through a gradient descent method.

[0012] The embodiment of the present application also provides a pedestrian re-identification model generation device, comprising the following modules: an image acquisition module, configured to acquire a plurality of pedestrian images, make a data set according to the plurality of pedestrian images, and divide the data set into a training set and a test set; a model creation module, configured to create a pedestrian re-identification model, wherein the pedestrian re-identification model comprises a data preprocessing module, a feature extraction network module and a training strategy module; the data preprocessing module is configured to randomly select a preset number of pedestrian images from the training set, compose a plurality of training batches according to the pedestrian images, perform image processing on the images in each training batch and obtain training images; the feature extraction network module is composed of a plurality of branch networks and an attention module, and is configured to perform feature extraction on the training images and obtain an output vector; the training strategy module is configured to calculate a loss value according to the output vector, and update the parameters of a neural network in the pedestrian re-identification model according to the loss value; and a training module, configured to train the pedestrian re-identification model based on the training set.

[0013] The embodiment of the present application also provides a pedestrian re-identification method, comprising the following steps: performing the pedestrian re-identification model generation method to obtain a pedestrian re-identification model; acquiring a to-be-identified pedestrian image, inputting the to-be-identified pedestrian image into a feature extraction network module of the pedestrian re-identification model, outputting a feature expression of the pedestrian image, and judging whether the to-be-identified pedestrian image contains a target pedestrian according to the feature expression.

[0014] The embodiment of the present application also provides a pedestrian re-identification device, comprising the following modules: a model generation module, configured to perform the pedestrian re-identification model generation method to obtain a pedestrian re-identification model; and a pedestrian re-identification module, configured to acquire a to-be-identified pedestrian image, input the to-be-identified pedestrian image into a feature extraction network module of the pedestrian re-identification model, output a feature expression of the pedestrian image, and judge whether the to-be-identified pedestrian image contains a target pedestrian according to the feature expression.

[0015] The pedestrian re-identification model generation method, the pedestrian re-identification method and the pedestrian re-identification device provided by the embodiment of the present application have the advantages that: in the present application, the branch networks of the backbone feature extraction network work cooperatively, the feature extraction capability of the network for local information of a pedestrian image is enhanced, and the precision of pedestrian re-identification is improved. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1A flowchart of a generation method of a pedestrian re-identification model in the embodiment;

[0017] Figure 2 A network structure flowchart of a feature extraction module of the pedestrian re-identification model in the embodiment;

[0018] Figure 3 A spatial attention calculation flowchart in the embodiment;

[0019] Figure 4 A channel attention calculation flowchart in the embodiment. DETAILED DESCRIPTION

[0020] The present application will be described in detail below with reference to the specific embodiments shown in the drawings. However, these embodiments do not limit the present application, and the structural, method, or functional changes made by those of ordinary skill in the art based on these embodiments are included in the protection scope of the present application.

[0021] If the present application involves orientation (for example, up, down, left, right, front, back, outside, inside, etc.) when expressing, the orientation involved needs to be defined.

[0022] The scope of the embodiments herein includes the entire scope of the claims, and all available equivalents of the claims. Herein, the terms "first", "second", and the like are only used to distinguish one element from another element, and do not require or imply any actual relationship or order between the elements. In fact, the first element can also be referred to as the second element, and vice versa. Moreover, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the structure, device or equipment comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such structure, device or equipment. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of another identical element in the structure, device or equipment comprising the element.

[0023] Embodiment one

[0024] The embodiment one of the present application provides a generation method of a pedestrian re-identification model, as shown in the figure, the generation method of the pedestrian re-identification model comprises the following steps S101 to S107: Figure 1

[0025] S101: Obtain a plurality of pedestrian images, make a data set according to the plurality of pedestrian images, and divide the data set into a training set and a test set.

[0026] ​In the embodiment, a plurality of pedestrian images are captured by a plurality of cameras without overlapping fields of view, wherein each of the pedestrian images contains at least one pedestrian, and the pedestrians are assigned corresponding labels, and the same pedestrian in any image shares the same label;

[0027] In the embodiment, all the pedestrian images are divided into a training set and a test set according to a specified ratio, which can be adjusted artificially, and the proportion of the training set is usually higher than that of the test set, and the training set and the test set do not contain the same images; wherein the training set is used to train the feature extraction network module of the pedestrian re-identification model, and the test set is used to verify the performance of the feature extraction network module.

[0028] S102: Create a pedestrian re-identification model, specifically create a data preprocessing module, a feature extraction network module, and a training strategy module.

[0029] S103: Input all images in the training set into the data preprocessing module for image processing operation to obtain second pedestrian images; here, the training set without image processing is referred to as a first training set, the training set after complete image processing operation is referred to as a second training set, the pedestrian images in the first training set are referred to as first pedestrian images, and the pedestrian images in the second training set are referred to as second pedestrian images.

[0030] In the embodiment, the image processing operation for the first training set includes the following specific steps: 1, reset the size of all first pedestrian images to 384x128, wherein 384 is the height of the image and 128 is the width of the image; 2, randomly select 50% of the images in the first training set for enlargement operation, and then randomly crop a sub-image with a size of 384x128 from the enlarged image, and add the sub-image to the first training set; 3, randomly select 50% of the images in the first training set for random flipping and random mirroring processing, and add the obtained images to the first training set; 4, randomly select 50% of the images in the first training set, replace a certain sub-region in the selected image with a three-channel mosaic instead of a rectangular frame, and the size of the mosaic rectangular frame is 10% to 30% of the first pedestrian image; 5, standardize each pixel of each channel of all first pedestrian images, and the standardization processing is based on wherein x' is the new pixel value, x is the initial pixel value, μ = [0.485, 0.456, 0.406], and σ = [0.229, 0.224, 0.225]. The first training set is obtained after the above-mentioned five image processing operations, and the images in the second training set are second pedestrian images.

[0031] S104: In the feature extraction network module, the second pedestrian images are used to obtain output vectors.

[0032] In the embodiment, the feature extraction network module extracts features of the second pedestrian image through a backbone feature extraction network, Figure 2 is a structural diagram of the backbone feature extraction network, Figure 2 The arrow in represents the data flow direction when the backbone feature extraction network operates, Atten is an attention module, Convolution Block is a convolution operation module, is a feature suppression operation module, is a summation operation on a feature tensor, GMP is a maximum pooling operation on a feature, GAP is an average pooling operation on a feature, Drop Block is a dropout operation on a feature after a mask is obtained by random erasing and point multiplication with the original feature; BNNeck is composed of batch normalization and a fully connected layer; the network of the backbone feature extraction network is as follows:

[0033] In the embodiment, the backbone feature extraction network is composed of four branch networks and an attention module, wherein the four branch networks are all transformed from OSNet, including a first branch network, a second branch network, a third branch network, and a fourth branch network, and there is data communication between the four branch networks instead of working alone.

[0034] In the embodiment, the first branch network intercepts the Conv2, Conv3, Conv4, and Conv5 modules of OSNet, and an attention module is embedded after the convolution blocks of Conv2, Conv3, and Conv4, the second branch network intercepts the Conv2, Conv3, and Conv4 of OSNet, and an attention module is embedded after the convolution blocks of Conv3 and Conv4, the third branch network intercepts the Conv4 and Conv5 of OSNet, and an attention module is embedded after the convolution block of Conv4, and the fourth branch network intercepts the Conv5 of OSNet; the Conv2 of the first branch network is received by the Conv3 module of the second branch network through the output of the attention module, the Conv3 of the first branch network is received by the Conv4 module of the second branch network through the output of the attention module, and the Conv4 of the first branch network is received by the Conv5 module of the second branch network through the output of the attention module; the Conv3 of the second branch network is received by the Conv4 module of the third branch network through the output of the attention module, and the Conv4 of the second branch network is received by the Conv5 module of the third branch network through the output of the attention module; the Conv4 of the third branch network is received by the Conv5 module of the fourth branch network through the output of the attention module.

[0035] In the embodiment, the attention module is composed of a spatial attention mechanism and a channel attention mechanism. In the embodiment, the spatial attention mechanism is first used to calculate the weight of the feature map to obtain a spatial attention feature map with spatial weight, and then the spatial attention feature map is input into the channel attention mechanism to obtain a hybrid attention feature map with spatial weight and channel weight. In the embodiment, the calculation process of the spatial attention mechanism and the channel attention mechanism from the feature map to the hybrid attention feature map is as shown in Figure 3 and Figure 4 . The calculation process is as follows: 1. For the input feature map X ∈ R H×W×C , the input feature map is converted into a two-dimensional matrix M ∈ R H×W by , where X c is the c-th channel dimension of the feature map X, and (x, y) is the coordinate of the pixel point. Then, the two-dimensional matrix M is transposed into a first one-dimensional tensor of 1 × 1 × HW, the first one-dimensional tensor is divided into g first sub-tensors of 1 × 1 × HW / g in size, a convolution kernel of 1 × 1 size is used to perform convolution operation on the sub-tensors to obtain g second sub-tensors of size HW / rg, where r is a channel contraction coefficient, the second sub-tensors are reassembled into a third sub-tensor with a channel number of HW / r, the third sub-tensor is restored to a second one-dimensional tensor of 1 × 1 × HW by using grouped convolution, and a spatial attention weight graph H ∈ R H×W is obtained by using a softmax activation function. The spatial attention weight graph is multiplied with the input feature map to obtain a second feature map, the second feature map is added with the input feature map to obtain the output of the spatial attention module, i.e., a spatial attention feature map, and the calculation method of the spatial attention feature map is where γ is an attention adjustment coefficient, · is a dot product operation, A sp ∈ R H×W×C is the output of the spatial attention mechanism, i.e., a spatial attention feature map; 2. The spatial attention feature map A sp ∈ R H×W×C is input into the channel attention mechanism, the feature map A sp is averaged and pooled along the high dimension to obtain a one-dimensional tensor a avg ∈ R 1×1×C , the feature map A sp is maximum-pooled along the wide dimension to obtain a one-dimensional tensor a max ∈ R 1×1×C , and a avg is added with a max to obtain a ∈ R 1×1×CThe channel attention weight map h is obtained using the formula h = softmax(gconv2(gconv1(a))), where gconv1 represents the first group convolution and gconv2 represents the second group convolution. The function of the first group convolution is to... avg and a max The number of channels is reduced to C / r, where r is the shrinkage coefficient. The second group convolution restores the number of channels to C through a 1×1 convolution operation. Softmax is the activation function. The output of the channel attention, i.e., the hybrid attention feature map, is obtained by adding the spatial attention feature map and the channel attention weight map. The hybrid attention feature map is calculated as A. ch =γA sp ·h+A sp Where γ is the attention modulation coefficient, · is the dot product operation, and A sp ∈R H×W×C The output of the spatial attention mechanism is the spatial attention feature map, A. ch ∈R H×W×C This is the output of the channel attention mechanism.

[0036] In this embodiment, the output obtained by the second pedestrian image through the four branch networks is the first branch output vector, the second branch output vector, the third branch output vector, and the fourth branch output vector.

[0037] S105: In the training strategy module, the pedestrian loss of the backbone feature extraction network for the pedestrian image is calculated using the output vectors of the first branch, the second branch, the third branch, and the fourth branch. The specific steps are as follows:

[0038] In this embodiment, the global feature vector g is obtained by performing max pooling on the first branch output vector, the second branch output vector, and the third branch output vector. b ∈R 512 Where b∈B, B={2,3,5}; average pooling and horizontal slicing are performed on the output vectors of the first branch, the second branch, and the third branch to obtain the local feature representation vectors. Where b∈B; the global feature vector g1∈R is obtained by performing max pooling on the output vector of the fourth branch. 512 The feature vector g is obtained by sequentially masking and max pooling the output vector of the fourth branch using DropBlock. drop ∈R 512 The output vector of the fourth branch is subjected to global average pooling and channel splitting to obtain two 256-dimensional sub-feature vectors. A fully connected layer is then used to expand the dimension of these sub-feature vectors from 256 to 512, resulting in two channel feature vectors c. i∈ R 512 where i = 1, 2;

[0039] In the embodiment, g b , g drop , c i are mapped to the same dimension as the number of labels of pedestrians in the training set to obtain a feature expression vector set where b' ∈ B' = B ∪ {1}, b ∈ B, 1 ≤ i ≤ b, k ∈ {1, 2}, the BNNeck is sequentially composed of a batch normalization processing layer and a mapping fully connected layer, and the mapping fully connected layer maps a 512-dimensional feature vector to a vector with the same dimension as the number of labels of pedestrians in the training set;

[0040] In the embodiment, all global feature vectors are represented by a set R ∈ {g drop , g b′}(b' ∈ B'), and a cross-entropy loss function with label smoothing is used to calculate a cross-entropy loss value, where B represents the total number of pedestrian images in a training batch, K is the number of pedestrian labels in the training set, is the true value of the current pedestrian image label, ∈ is a smoothing coefficient, ∈ ∈ (0, 1), is the result of the feature vector after being activated by a softmax function, and L xe is the cross-entropy loss value;

[0041] In the embodiment, a multi-similarity loss function is used to calculate a multi-similarity loss value, where S ik = <ψ i , ψ k >, S ik is the inner product similarity between feature expression vectors ψ i and ψ k , P i and N i are the class sample and inter-class sample set when ψ i is an anchor point, α, β, λ are hyperparameters, and L ms is the multi-similarity loss value;

[0042] In the embodiment, all feature expression vectors in T ∪ R are used to calculate a center loss value by a center loss function is the center point of all corresponding samples of label y i in the training batch, and L ce is the center loss value; ​

[0043] In this embodiment, the total loss value of the backbone feature extraction network is obtained by weighted sum of the cross-entropy loss function, the multi-similarity loss function and the center loss function through loss function L = λ xe ∑ ψ∈T L xe +λ ms ∑ ψ∈R L ms +λ ce ∑ ψ∈T∪R L ce , wherein λ xe is the weight coefficient of the cross-entropy loss, λ ms is the weight coefficient of the multi-similarity loss, λ ce is the weight coefficient of the center loss, and L is the loss value of the backbone feature extraction network for identifying pedestrian images.

[0044] S106: The parameters in the backbone feature extraction network are updated through the gradient descent algorithm using the pedestrian loss value.

[0045] S107: The pedestrian re-identification model is obtained by repeating steps S104 to S106.

[0046] In this embodiment, the backbone feature extraction network is trained by repeating steps S104 to S106, and all pedestrian labels in the second training set are used once as the completion of an iteration. All training results and related parameters are saved in a hard disk. When any one of the stop training conditions is met, the process of repeating steps S104 to S106 is stopped, the corresponding parameters of the backbone feature extraction network with the best performance are selected from the hard disk to replace the corresponding parameters of the original backbone feature extraction network, and the pedestrian re-identification model is obtained.

[0047] In this embodiment, the stop training conditions include: 1. The number of iterations reaches a preset threshold; 2. The pedestrian loss value remains stable without significant fluctuations; 3. Forced stop.

[0048] In order to verify the effectiveness of the pedestrian re-identification model, the backbone feature extraction network of the pedestrian re-identification model is evaluated in performance on the Market-1501 dataset, the recognition performance of the current optimal pedestrian re-identification network on the Market-1501 dataset is compared, and the Rank-1 matching accuracy and mAP (mean Average Precision) are used as evaluation indexes. In order to be fair, all networks use the optimal parameters reported by the original author, as shown in the following table, the performance of the backbone feature extraction network of the pedestrian re-identification model of the present application on the Market-1501 dataset is better than that of the current optimal pedestrian re-identification network, which further verifies the effectiveness of the pedestrian re-identification model of the present application.

[0049] Algorithm model mAP Rank-1 Rank-5 Rank-10 AlignedReID 79.1 91.8 - - OSNet 84.9 94.8 - - CDNet 86 95.1 - - MGN 86.9 95.7 - - Pyramid 88.2 95.7 98.4 99 ABD-Net 88.3 95.6 - - RGA 88.4 96.1 - - SCSN 88.5 95.7 - - TransReID 89.5 95.2 - - HAT 89.5 95.6 - - The invention 91.8 97 99 99.5

[0050] Embodiment two

[0051] The embodiment two of the present application provides a pedestrian re-identification method, comprising the following steps:

[0052] S201: performing the generation method of the pedestrian re-identification model to obtain the pedestrian re-identification model.

[0053] S202: obtaining a to-be-identified pedestrian image, inputting the to-be-identified pedestrian image into the feature extraction network module of the pedestrian re-identification model, and outputting the feature expression of the pedestrian image.

[0054] In the embodiment, the backbone feature extraction network in the feature extraction network module of the pedestrian re-identification model is used to extract the feature expression of the to-be-identified pedestrian image.

[0055] S203: judging whether the to-be-identified pedestrian image contains a target pedestrian or not by using the feature expression.

[0056] In the embodiment, if it is intended to judge whether the pedestrian image A contains the target pedestrian B or not, the feature expression A of the pedestrian image A is obtained by using step S202, the feature expression B of the target pedestrian B is obtained by using step S202, and the Euclidean distance between the feature expression A and the feature expression B is calculated.

[0057] In the embodiment, if the Euclidean distance is less than a preset threshold, it is determined that the pedestrian image A contains the target pedestrian B.

[0058] In the embodiment, if the Euclidean distance is not less than the preset threshold, it is determined that the pedestrian image A does not contain the target pedestrian B.

[0059] Embodiment three

[0060] The embodiment three of the present application provides a pedestrian re-identification device, comprising the following modules:

[0061] The model generation module is configured to generate the pedestrian re-identification model by executing the pedestrian re-identification model generation method in the embodiment one.

[0062] The pedestrian re-identification module is configured to acquire a to-be-identified pedestrian image, input the to-be-identified pedestrian image into the feature extraction network module of the pedestrian re-identification model, output a feature expression of the pedestrian image, and determine whether the to-be-identified pedestrian image contains a target pedestrian according to the feature expression.

[0063] It should be noted that although the above describes each step in a specific order, it does not mean that each step must be performed in the above specific order, and in fact, some of the steps can be performed concurrently or even in a changed order, as long as the required function can be achieved.

[0064] The present application can be a system, a method, and / or a computer program product. The computer program product can include a readable storage medium having computer-readable program instructions loaded thereon, the computer-readable program instructions being used to cause a processor to implement various aspects of the present application.

[0065] The readable storage medium can be a tangible device that keeps and stores instructions for use by an instruction execution device. The readable storage medium may, for example, include, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a hole-in-the-wall structure having instructions stored thereon, and any suitable combination of the foregoing.

[0066] The above has described various embodiments of the present application, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those skilled in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements in the technology in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein.

Claims

1. A method for generating a pedestrian re-identification model, characterized in that, Includes the following steps: Acquire several pedestrian images, create a dataset based on the pedestrian images, and divide the dataset into a training set and a test set; A pedestrian re-identification model is created, comprising a data preprocessing module, a feature extraction network module, and a training strategy module. The data preprocessing module is used to: randomly select a preset number of pedestrian images from the training set, form several training batches based on the pedestrian images, and perform image processing on the images in each training batch to obtain training images. The feature extraction network module, composed of multiple branch networks and an attention module, is used to: extract features from the training images to obtain output vectors. The training strategy module is used to: calculate a loss value based on the output vectors and update the parameters of the neural network in the pedestrian re-identification model based on the loss value. The feature extraction network module further includes: the branch networks are a first branch network, a second branch network, a third branch network, and a fourth branch network; the first branch network includes OSNet Conv2, Conv3, Conv4, and Conv5, with an attention module embedded after the convolutional blocks of Conv2, Conv3, and Conv4; the second branch network includes OSNet... Conv2, Conv3, and Conv4, with attention modules embedded after the convolutional blocks of Conv3 and Conv4; the third branch network includes OSNet's Conv4 and Conv5, with an attention module embedded after the convolutional block of Conv4; the fourth branch network includes OSNet's Conv5; the Conv3 module of the second branch network receives the output of the first branch network's Conv2 after the attention module; the Conv4 module of the second branch network receives the output of the first branch network's Conv3 after the attention module; the Conv5 module of the second branch network receives the output of the first branch network's Conv4 after the attention module; the Conv4 module of the third branch network receives the output of the second branch network's Conv3 after the attention module; the Conv5 module of the fourth branch network receives the output of the third branch network's Conv4 after the attention module; The pedestrian re-identification model is trained based on the training set.

2. The generation method according to claim 1, characterized in that, The pedestrian images are images taken by multiple surveillance cameras with non-overlapping fields of view, and each image contains pedestrians; The phrase "dividing the dataset into training and testing sets" specifically includes: segmenting the pedestrian images according to the pedestrian IDs at a specified ratio, thereby dividing the dataset into training and testing sets.

3. The generation method according to claim 2, characterized in that, The data preprocessing module is also used to perform scaling to a uniform size, random cropping, random horizontal flipping, random erasing, and standardization operations on all pedestrian images in the training set.

4. The generation method according to claim 1, characterized in that, The attention module consists of a channel attention mechanism and a spatial attention mechanism.

5. The generation method according to claim 1, characterized in that, The method for calculating the loss value is as follows: Set the loss value to... Through function Update the loss value, where, For cross-entropy loss, For multiple similarity loss, Loss at the center These are the weighting coefficients for the cross-entropy loss. These are the weighting coefficients for the multi-similarity loss. The weighting coefficients for center loss.

6. The generation method according to claim 1, characterized in that, The phrase "updating the parameters of the branch network in the pedestrian re-identification model based on the loss value" specifically includes: transmitting the loss value to the branch network through the backpropagation algorithm, and optimizing the parameters of the branch network through the gradient descent method.

7. A device for generating a pedestrian re-identification model, characterized in that, Includes the following modules: The image acquisition module is used to acquire several pedestrian images, create a dataset based on the pedestrian images, and divide the dataset into a training set and a test set. A model creation module is used to create a pedestrian re-identification model. The pedestrian re-identification model includes a data preprocessing module, a feature extraction network module, and a training strategy module. The data preprocessing module is used to: randomly select a preset number of pedestrian images from the training set, form several training batches based on the pedestrian images, and perform image processing on the images in each training batch to obtain training images. The feature extraction network module is composed of multiple branch networks and an attention module, and is used to: extract features from the training images to obtain output vectors. The training strategy module is used to: calculate a loss value based on the output vectors and update the parameters of the neural network in the pedestrian re-identification model based on the loss value. The feature extraction network module further includes: the branch networks are a first branch network, a second branch network, a third branch network, and a fourth branch network. The first branch network includes OSNet Conv2, Conv3, Conv4, and Conv5, and an attention module is embedded after the convolutional blocks of Conv2, Conv3, and Conv4. The second branch network includes O... The SNet's Conv2, Conv3, and Conv4 have attention modules embedded after the convolutional blocks of Conv3 and Conv4. The third branch network includes OSNet's Conv4 and Conv5, with an attention module embedded after the convolutional block of Conv4. The fourth branch network includes OSNet's Conv5. The Conv3 module of the second branch network receives the output of the first branch network's Conv2 after passing through the attention module. The Conv4 module of the second branch network receives the output of the first branch network's Conv3 after passing through the attention module. The Conv5 module of the second branch network receives the output of the first branch network's Conv4 after passing through the attention module. The Conv4 module of the third branch network receives the output of the second branch network's Conv3 after passing through the attention module. The Conv5 module of the third branch network receives the output of the second branch network's Conv4 after passing through the attention module. The Conv5 module of the fourth branch network receives the output of the third branch network's Conv4 after passing through the attention module. The training module is used to train the pedestrian re-identification model based on the training set.

8. A pedestrian re-identification method, characterized in that, Includes the following steps: A pedestrian re-identification model is obtained by performing the generation method described in any one of claims 1-6; A pedestrian image to be identified is acquired, and the pedestrian image to be identified is input into the feature extraction network module of the pedestrian re-identification model. The feature expression of the pedestrian image is output, and the target pedestrian is determined based on the feature expression.

9. A pedestrian re-identification device, characterized in that, Includes the following modules: A model generation module is used to execute the generation method described in any one of claims 1-6 to obtain a pedestrian re-identification model; The pedestrian re-identification module is used to acquire images of pedestrians to be identified, input the images of pedestrians to be identified into the feature extraction network module of the pedestrian re-identification model, output the feature representation of the pedestrian image, and determine whether the images of pedestrians to be identified contain the target pedestrian based on the feature representation.

Citation Information

Patent Citations

  • Pedestrian re-identification method and system based on polarization self-attention and related equipment

    CN114792430A