A method for re-identification of occluded pedestrians based on masked self-supervised reconstruction of occluded pixels
Through the mask self-supervised occlusion pixel reconstruction method and dynamic graph structure module, the occlusion problem in pedestrian re-identification is solved, the recognition accuracy and robustness are improved, and efficient pedestrian recognition in complex scenes is achieved.
Patent Information
- Application Number
- CN202410016648.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-04
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing pedestrian re-identification methods lack robustness in complex scenes. In particular, occlusion problems lead to low recognition accuracy, and similar obstacles affect feature discriminability, resulting in poor recognition performance.
An occluded pixel reconstruction method based on mask self-supervision is used to reconstruct de-occluded pedestrian images through the image completion model and dynamic graph structure module, and self-supervised training and graph convolution feature propagation modules are used to improve recognition performance.
It improves the accuracy and robustness of pedestrian re-identification in complex scenes, avoids the waste of time in large-scale annotation of data, has the same performance as supervised methods, and effectively utilizes image spatial information.
Smart Images

Figure CN117877068B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of pedestrian re-identification in computer vision, and in particular relates to an occluded pedestrian re-identification method based on mask self-supervised occluded pixel reconstruction. Background Art
[0002] Person re-identification is a task to retrieve specific pedestrians captured by different cameras. It plays a vital role in surveillance systems and has attracted widespread attention. However, due to challenges such as camera position differences, low resolution, illumination changes, and obstacle occlusion during data collection, existing person re-identification methods lack robustness and have relatively low recognition accuracy. Among them, the occlusion problem is one of the most difficult problems in the current field of person re-identification.
[0003] At present, deep learning-based methods mostly rely on human key point detection or human structure detection. However, due to occlusion problems, key points or structures are often blocked by other obstacles, resulting in the inability of existing methods to accurately identify them. Moreover, relatively similar obstacles will cause similar content to appear in different pedestrian images, which greatly reduces the discriminability of neural network feature extraction, further affecting the accuracy and robustness of pedestrian re-identification methods. Therefore, a new pedestrian re-identification technology that can effectively overcome the occlusion problem is needed to improve recognition performance in complex scenes. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a method for re-identifying occluded pedestrians based on mask self-supervision reconstruction of occluded pixels, the method comprising the steps of:
[0005] The training data A, training data B and test data are collected from the surveillance camera device. The training data A includes the pedestrian re-identification pictures with occlusion and the annotations and pedestrian numbers at the instance segmentation level. The training data B includes the pedestrian re-identification pictures with relatively complete human body parts. The test data is divided into query pictures and library pictures, and the test data only includes the original pedestrian re-identification pictures with occlusion and pedestrian numbers.
[0006] First, the image completion model is trained to convergence using training data A and training data B. The test image is input into the converged image completion model, and the obscured pedestrian pixels in the image are reconstructed to obtain a de-occluded pedestrian image. Then, the obscured pedestrian re-identification network is trained to convergence using training data B. Finally, the test data is input into the image completion module and a de-occluded pedestrian image is obtained. The de-occluded pedestrian image is input into the pedestrian re-identification network to obtain a better pedestrian recognition accuracy.
[0007] The mask-guided masked autoencoder fine-tuning image completion model is characterized by performing de-occlusion processing on the occluded pedestrian image. The completion model training process is as follows:
[0008] (1) Using training data A, the existing instance segmentation network Mask2former is trained until convergence, and an instance segmentation network that can output human body masks in pedestrian images is obtained. The converged instance segmentation network can predict the image X of identity i i The corresponding pedestrian mask M i Among them, the original image X i The unoccluded pedestrian pixels in the corresponding pedestrian mask M i Pixels in the image location are white, and other pixels are black.
[0009] (2) Use the image modeling network guided by the self-supervised mask to reconstruct the obscured pedestrian pixels in the obscured pedestrian image. i , (H and W are the height and width of the image, and 3 is the three dimensions of the RGB image) Use the image block function to convert it into an image block embedding, where the height and width of each image block are P h With P w For image X i , the image block function is for each image X i Perform convolution with a kernel size of P h With P w , and the step length is also P h With P w , the output dimension of each image block is C. The image is converted into an image block embedding using the image block function and flattened to obtain the following image block embedding:
[0010] X iP =Patch(X i ,θ)
[0011] M iP = Random(M i )
[0012] Among them, Patch is the image block function. Where C is the number of dimensions. (P h ,P w ) represents the resolution of each image block, is the total number of image patches, and θ is a learnable parameter. The Random function calculates the number of image patches based on the input mask image size and randomly generates the corresponding number of pixel retention scores. iP Indicates the current image X iThe pixel retention score of each image block in M ranges from 0 to 105. The image blocks with pixel retention scores less than 60 will be marked as reconstructed blocks. The image block embeddings corresponding to the marked image blocks are discarded and will not enter the encoder part. In the training stage, M iP Generated using a random function.
[0013] (3) The non-discarded image block embedding and the image block position coding are added and then input into the pixel reconstruction encoder. The position coding uses the 2D position coding formula as follows:
[0014]
[0015]
[0016] The pos X With pos Y is the horizontal and vertical coordinates of the image block in the original image. model is the dimension of the position encoding. In the present invention, d model The same as the image block embedding C. The value of i is a positive integer from 0 to 0.5C-1. After each item of the position encoding is calculated, the obtained codes are arranged in the following way to obtain the 2D position encoding: PE(pos X ,0),PE(pos Y ,1),PE(pos X ,2),PE(pos Y ,3)...PE(pos X ,C-2),PE(pos Y ,C-1).
[0017] The original image block is embedded into the input reconstruction encoder to obtain an intermediate tensor. The learnable tensor is inserted into the position of the discarded pixel block in the intermediate tensor to obtain the intermediate tensor to be learned. The shape of the learnable tensor is the same as the embedding shape of the replaced image block, which is C represents the number of dimensions of the image block embedding. The intermediate tensor to be learned is input into the decoder to obtain the reconstructed image block embedding, and the reconstructed image block embedding is unpacked to obtain the reconstructed image.
[0018] During the training process, the image modeling network guided by the self-supervised mask is trained using the training data B and its mask image. Specifically, the black pixels in the mask of each pedestrian image are covered on the corresponding pedestrian image, and the white pixels are not processed. The training data B_withMask is obtained. The image modeling network is self-supervised trained using the training data B_withMask.
[0019] The self-supervised mask-guided image modeling network only calculates the loss for image patches with a pixel retention score less than 60, and uses the mean square error as the loss function.
[0020] Furthermore, during the prediction process, the test data is fed into the converged instance segmentation network to obtain the test image mask M iTest . Combine the test data with the test image mask M iTest The image modeling network is inputted together to obtain a de-occluded pedestrian image. The image modeling network process in the prediction process is as follows:
[0021] The pedestrian image and the test image mask M iTest Input the image block function together to get the image block embedding and flatten the image block embedding and pixel retention score M iP Pixel retention score M iP Image blocks with less than 60 will be discarded. The embedding of the non-discarded image blocks is added to the image block position code and input into the pixel reconstruction encoder to obtain an intermediate tensor. The learnable tensor is inserted into the position of the discarded pixel blocks in the intermediate tensor to obtain the intermediate tensor to be learned. The intermediate tensor to be learned is input into the decoder to obtain the embedding of the reconstructed image block, and the reconstructed image block embedding is unpacked to obtain the reconstructed image.
[0022] During the prediction process, only the pixel retention score M iP The way to obtain M is different from the training process. iP The method of obtaining is as follows:
[0023] M iP =Patch_formask(M iTest ,1)
[0024] M iP Indicates the current image X i The pixel retention scores of all image blocks in the image are from 0 to 105. Image blocks with pixel retention scores less than 60 will be marked as reconstructed blocks. The X corresponding to the marked image blocks iP are discarded and do not enter the encoder section.
[0025] Patch_formask is an image segmentation function with the same structure as the Patch function. The difference between them is that the learnable parameter of the convolution kernel in the Patch function is θ, while the parameters in the convolution kernel in the Patch_formask function are not learnable and are fixed to 1. The output dimension of the pixel retention score is 1, that is, each image patch corresponds to a pixel retention score. In the Patch_formask function, 1 means that the parameters in the convolution kernel are not learnable and are fixed to 1.
[0026] Furthermore, the pedestrian re-identification network uses a dynamic graph structure module and a graph convolution feature propagation module to assist in propagating features. The dynamic graph structure module establishes different graph structures at multiple positions in the convolutional neural network, that is, converts the feature graph into a K nearest neighbor graph structure at multiple positions in the convolutional neural network. The dynamic graph structure module inputs a feature graph with a height of H and a width of W, and outputs an adjacency matrix corresponding to the feature graph. The pseudo code of the dynamic graph structure module is as follows:
[0027]
[0028]
[0029] Furthermore, the correlation of each node in the feature graph is calculated to obtain the correlation matrix. The formula is as follows:
[0030] R=θ(F)φ(F) T
[0031] Where R is the correlation matrix, is the feature map output by the convolutional layer, C is the dimension of the feature map, and W and H are the width and height of the feature map respectively. T Represents the transpose of the matrix X. θ(F) and φ(F) represent the input of the feature map F into two transfer functions with exactly the same structure but different parameters. The transfer function consists of a 1×1 convolution layer, a batch normalization layer, and a ReLU activation function.
[0032] Next, multiply the correlation matrix R by the adjacency matrix A and normalize it using the softmax function to obtain the similarity adjacency matrix. The formula is as follows:
[0033]
[0034] in, is the similarity adjacency matrix, N is the number of nodes in the feature graph, A is the adjacency matrix output by the dynamic graph structure module, and ⊙ represents the Hadamard product of the matrix.
[0035] Then, node feature propagation is performed on the graph structure A. The formula is as follows:
[0036]
[0037] in, is the feature after feature propagation, It is the feature obtained by matrix transformation of the feature map output by the convolution layer. Through matrix transformation, the propagated features can be converted back into feature maps.
[0038] All the processes of the above dynamic graph structure module and graph convolution feature propagation module are denoted as OGA(F). It is the feature map output by the convolutional layer.
[0039] Furthermore, the residual structure is introduced into the feature propagation process. At the same time, multiple stacking of OGA modules can make the features propagate more fully. The stacking method of the OGA modules with residual structure is as follows:
[0040]
[0041] Where β represents the learnable parameter.
[0042] Furthermore, during the training process, the loss function of the occluded person re-identification network is expressed as:
[0043] L=L ID +L Triplet +εL C
[0044] Among them, L Triplet is the triplet loss, L ID is the ID loss, L C is the Center loss. ε is the balance weight of the Center loss, which is set to 0.1 in this network.
[0045] The L Triplet The expression is as follows:
[0046]
[0047] In the above formula, B is the number of training mini-batch samples. represents the benchmark sample, represents a positive sample of the same category but different from the benchmark sample, represents a negative sample of a different category from the benchmark sample. α represents a set training interval, which is set to 0.2 in the present invention. f(x) is the feature of image x.
[0048] The L ID The expression is as follows:
[0049]
[0050]
[0051] In the above formula, y represents the true label value of the training sample. N represents the number of pedestrian identities in the dataset. i ) represents the network's response to image x i The predicted embedding is: In the present invention, the ε value is a constant, set to 0.1.
[0052] The L C The expression is as follows:
[0053]
[0054] In the above formula, f(x i ) is the image x i features. B is the number of training mini-batch samples. Indicates that the category is y i The center of all features of , that is, all categories y in the mini-batch i The average value of the features of the image.
[0055] Furthermore, after all networks are trained to convergence, the test data is sent to a masked autoencoder fine-tuned image completion model based on mask guidance to obtain a de-occluded pedestrian image. Then, the de-occluded pedestrian image is sent to an occluded pedestrian re-identification network based on dynamic graphs and graph convolution to obtain the features of each image. For each query image, sort by feature distance, and the library images with closer distances will be ranked in front, and the 10 library images with the closest distances are taken as the query results of the query image. The library images with the same identity label are taken as the correct results matched to the query graph, and the average accuracy of the query image is calculated. The average accuracy of all query images is calculated to obtain the average accuracy mean of the present invention on the data set. The average of the accuracy of the library images with the closest feature distances of all query images is calculated to obtain the first hit rate.
[0056] The present invention provides a masked pedestrian re-identification method for self-supervised reconstruction of occluded pixels, which has the following advantages:
[0057] (1) The self-supervised mask-guided image modeling network of the method is trained in a self-supervised manner, which avoids the time waste of large-scale labeling of image data, and its effect is comparable to that of supervised methods.
[0058] (2) The method adopts pixel completion technology, so that the network can completely complete the occluded pedestrians in the occluded data, so that the existing method based on human key points can be applied to occluded images.
[0059] (3) The method adopts an occluded pedestrian re-identification network based on a combination of dynamic graph neural networks and graph convolution, which effectively utilizes the image spatial information. The dynamic graph neural network is conducive to increasing the effective receptive field of the convolutional neural network and improving the pedestrian recognition performance in different scenes and occlusion conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] 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 labor.
[0061] Figure 1 It is a flow chart of a method for re-identifying an occluded pedestrian by mask self-supervising occluded pixel reconstruction provided by the present invention;
[0062] Figure 2 is a schematic diagram of the completion model (including an instance segmentation network and an image modeling network);
[0063] Figure 3 It is a schematic diagram of the completion model's completion effect on the occluded image;
[0064] Figure 4 This is a schematic diagram of the occluded person re-identification network structure based on dynamic graphs and graph convolution; DETAILED DESCRIPTION
[0065] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0066] Exemplary Methods
[0067] like Figure 1 The present invention provides a flowchart of a method for re-identifying an occluded person based on mask self-supervised reconstruction of occluded pixels, and the method steps are as follows:
[0068] Step S110: First, all test set images in the data set are retained, and the training data is divided into images with relatively complete pedestrian human body structures (referred to as training data B) and pedestrian re-identification images with large occlusions (referred to as training data A). In addition, pedestrians in the training data A images are labeled at the instance segmentation level. All data are converted to 210 pixels in height and 98 pixels in width.
[0069] Step S120: Train the instance segmentation network using the training data A. The instance segmentation network uses the Mask2former network and the loss function uses Diceloss. After completion, the images in the training data B are sent to the instance segmentation network to obtain the pedestrian mask of each image in the training data B.
[0070] The self-supervised mask-guided image modeling network is trained using the training data B and its mask image until convergence. Specifically, the black pixels in the mask of each pedestrian image are covered on the corresponding pedestrian image, and the white pixels are not processed. The training data B_withMask is obtained. The image modeling network is self-supervised using the training data B_withMask (the self-supervised mask-guided image modeling network training does not use the image mask, M iP Generated using a random function).
[0071] The image modeling network maps the predicted image to the corresponding mask X i , (H and W are the image height and width, 3 is the dimension of RGB images) into multiple image blocks, where each image block is 15 pixels high and 7 pixels wide. i , the Patch operation is for each image X i Convolution is performed with a kernel size of 15 in height and 7 in width, and a stride of 15 in height and 7 in width. The output dimension of each image block is C. The image is converted into image blocks and flattened to obtain the following image block embedding results:
[0072] X iP =Patch(X i ,θ)
[0073] M iP = Random(M i )
[0074] Where C is the number of dimensions, and in the present invention, C is 768. The number of dimensions of the mask is 1. (P h ,P w ) represents the resolution of each image block, i.e. (15, 7), is the total number of image patches, which is 196 in the present invention. Patch is an image partitioning function, and the learnable parameter of the convolution kernel in the Patch function is θ. The Random function calculates the number of image patches according to the input mask image size and randomly generates a corresponding number of pixel retention scores. iP Indicates the current image X i The pixel retention score of each image block in the training process ranges from 0 to 105. The image blocks with a pixel retention score less than 60 will be marked as reconstructed blocks. The image block embeddings corresponding to the marked image blocks are discarded and will not enter the encoder part. iP Randomly generated.
[0075] The non-discarded image block embedding and the image block position coding are added and then input into the pixel reconstruction encoder. The position coding uses the 2D position coding formula as follows:
[0076]
[0077]
[0078] The pos X With pos Y is the horizontal and vertical coordinates of the image block in the original image. model is the dimension of the position encoding. In the present invention, d model The same as the image block embedding C. The value of i is a positive integer from 0 to 0.5C-1. After each item of the position encoding is calculated, the obtained codes are arranged in the following way to obtain the 2D position encoding: PE(pos X ,0),PE(pos Y ,1),PE(pos X ,2),PE(pos Y ,3)...PE(pos X ,766),PE(pos Y ,767).
[0079] After the reconstruction encoder, the original image block embedding is converted into an intermediate tensor. The learnable tensor is inserted into the position of the discarded pixel block in the intermediate tensor to obtain the decoder input tensor. The shape of the learnable tensor is the same as the shape of the replaced image block data, which is C represents the number of dimensions of the image block embedding, that is, 768. The decoder input tensor is input into the decoder to obtain embeddings of all reconstructed image blocks after pixel reconstruction, and the reconstructed image blocks are embedded in the deblocking to obtain a reconstructed image.
[0080] The self-supervised mask-guided image modeling network only calculates the loss for image patches with pixel retention scores less than 60, and the loss uses the mean square error loss.
[0081] Furthermore, during the test process, the test data is fed into the converged instance segmentation network to obtain the test image mask M iTest . Combine the test data with the test image mask M iTest The two images are input into the image modeling network to obtain a de-occluded pedestrian image.
[0082] During the test, only the pixel retention score M iP The way to obtain M is different from the training process. iP The method of obtaining is as follows:
[0083] M iP =Patch_formask(M iTest ,1)
[0084] M iP Indicates the current image M i The pixel retention scores of all image blocks in the image are from 0 to 105. Image blocks with pixel retention scores less than 60 will be marked as reconstructed blocks. The X corresponding to the marked image blocks iP are discarded and do not enter the encoder section.
[0085] Patch_formask is an image segmentation function with the same structure as the Patch function. The difference between them is that the learnable parameter of the convolution kernel in the Patch function is θ, while the parameters in the convolution kernel in the Patch_formask function are not learnable and are fixed to 1. The output dimension of the pixel retention score is 1, that is, each image block corresponds to one pixel retention score.
[0086] In the Patch_formask function, 1 means that the parameters in the convolution kernel are not learnable and are fixed to 1.
[0087] The rest of the process is exactly the same as the training process. That is, the test data is fed into the real segmentation network to obtain the test image mask. The test data and the test image mask are fed into the self-supervised mask-guided image modeling network to obtain the de-occluded pedestrian image. The de-occluded pedestrian image is used as the test data for the occluded pedestrian re-identification network based on dynamic graph and graph convolution.
[0088] Step S130: Use training set B to train the occluded pedestrian re-identification network. The pedestrian re-identification network includes a ResNet-50 network, a dynamic graph structure module and a graph convolution feature propagation module. The ResNet-50 network is used to extract feature maps in pedestrian re-identification images, and the dynamic graph neural network feature propagation module is used to propagate features on the standardized feature maps to obtain more robust and discriminative features. Specifically, the dynamic graph structure establishment module inserts a multi-layer dynamic graph structure establishment module and a dynamic graph convolution feature propagation module after stage 1, 2, 3, and 4 of ResNet-50 respectively (the module only changes the content of the feature map, and does not change its shape).
[0089] The feature map with a height of H and a width of W is input into the dynamic graph structure module to obtain the adjacency matrix R corresponding to the feature map.
[0090] The pseudo code of the dynamic graph structure module is as follows:
[0091]
[0092]
[0093] Furthermore, the correlation of each node in the feature graph is calculated to obtain the correlation matrix. The formula is as follows:
[0094] R=θ(F)φ(F) T
[0095] Where R is the correlation matrix, is the feature map output by the convolutional layer, C is the dimension of the feature map, and W and H are the width and height of the feature map respectively. T Represents the transpose of the matrix X. θ(F) and φ(F) represent the input of the feature map F into two transfer functions with exactly the same structure but different parameters. The transfer function consists of a 1×1 convolution layer, a batch normalization layer, and a ReLU activation function.
[0096] Next, multiply the correlation matrix R by the adjacency matrix A and normalize it using the softmax function to obtain the similarity adjacency matrix. The formula is as follows:
[0097]
[0098] in, is the similarity adjacency matrix, N is the number of nodes in the feature graph, A is the adjacency matrix output by the dynamic graph structure module, and ⊙ represents the Hadamard product of the matrix.
[0099] Then, node feature propagation is performed on the graph structure A, and the formula is as follows:
[0100]
[0101] in, is the feature after feature propagation, It is the feature obtained by matrix transformation of the feature map output by the convolution layer. Through matrix transformation, the propagated features can be converted back into feature maps.
[0102] All the processes of the above dynamic graph structure module and graph convolution feature propagation module are denoted as OGA(F). It is the feature map output by the convolutional layer.
[0103] Furthermore, the residual structure is introduced into the feature propagation process. At the same time, multiple stacking of OGA modules can make the features propagate more fully. The stacking method of the OGA modules with residual structure is as follows:
[0104]
[0105] Where β represents the learnable parameter.
[0106] Furthermore, during the training process, the loss function of the occluded person re-identification network is expressed as:
[0107] L=L ID +L Triplet +εL C
[0108] Among them, L Triplet is the triplet loss, L ID is the ID loss, L C is the Center loss. ε is the balance weight of the Center loss, which is set to 0.1 in this network.
[0109] The L Triplet The expression is as follows:
[0110]
[0111] In the above formula, B is the number of training mini-batch samples. represents the benchmark sample, represents a positive sample of the same category but different from the benchmark sample, represents a negative sample of a different category from the benchmark sample. α represents a set training interval, which is set to 0.2 in the present invention. f(x) is the feature of image x.
[0112] The L ID The expression is as follows:
[0113]
[0114]
[0115] In the above formula, y represents the true label value of the training sample. N represents the number of pedestrian identities in the dataset. i ) represents the network's response to image x i The predicted embedding is: In the present invention, the ε value is a constant, set to 0.1.
[0116] The L C The expression is as follows:
[0117]
[0118] In the above formula, f(x i ) is the image x i features. B is the number of training mini-batch samples. Indicates that the category is y i The center of all features of , that is, all categories y in the mini-batch i The average value of the features of the image.
[0119] The network is trained using the gradient descent algorithm with the default configuration of Adam. The training ends when the loss value reaches the minimum.
[0120] Step S140: After the network is trained to convergence, the test data can be used to test the occluded pedestrian re-identification network based on dynamic graphs and graph convolution. The de-occluded pedestrian image obtained in step S120 is sent to the pedestrian re-identification network for feature extraction to obtain the features of each image. For each query image, sort by feature distance, and the library images with closer distances will be ranked in front. The 10 library images with the closest distances are taken as the query results of the query image. The library images with the same identity label are taken as the correct results matched to the query graph, and the average accuracy of the query image is calculated. The average accuracy of all query images is calculated to obtain the average accuracy mean of the present invention on the data set. Calculate the average accuracy of the library images with the closest feature distance of all query images to obtain the first hit rate.
[0121] Step S150: Calculate the pedestrian re-identification accuracy rate on the occluded pedestrian re-identification dataset Occluded-DukeMTMC according to the obtained classification results.
[0122] Through this implementation, the data set is first divided into two parts: one with a relatively complete human body and one with large occluded pixels (training data A and B, respectively). Then, the image completion model is trained until convergence using training data A and B. The occluded pedestrian re-identification network is trained using training data B. During the test process, the test data is first sent to the image completion model: first sent to the instance segmentation network to obtain the mask corresponding to each test data. The test data and the test image mask are simultaneously sent to the image modeling network for occluded pixel completion. Finally, the de-occluded pedestrian image is sent to the pedestrian re-identification network for feature extraction and prediction to obtain the classification result predicted by the network.
[0123] To further illustrate, assuming that an occluded pedestrian re-identification dataset is classified according to this implementation, a classification result with higher accuracy than most methods will be obtained.
[0124] Detailed description of the invention Results
[0125] This implementation uses the publicly available occluded person re-identification dataset Occluded-DukeMTMC. The details of the dataset are as follows:
[0126] In this dataset, all query images are occluded by various objects (e.g., trees, cars, other people). The training, query, and gallery sets contain 14% / 15% / 10% occluded images, respectively. The training set of Occluded-DukeMTMC contains 15,618 images, covering a total of 702 identities. The test set contains 1,110 identities, including 17,661 gallery images and 2,210 query images. The Occluded-DukeMTMC dataset is the largest and most difficult dataset for the current occluded person re-identification task.
[0127] In order to verify the superiority of this implementation (Ours), this implementation is compared with several existing occluded pedestrian re-identification methods, including BoT, MHSA, OAMN, HG and other methods. The mean average precision (mAP) and the first hit rate (Rank-1) of these methods on the above public datasets will be compared. The specific data comparison is shown in Table 1.
[0128] Table 1 Accuracy of Occluded-DukeMTMC dataset (%)
[0129]
[0130] By comparing the data in the above table, we can clearly see that Ours achieves the best performance and significantly improves the accuracy of occluded pedestrian re-identification. The quantitative results fully demonstrate the superiority of Ours, because Ours can better complete the human key point information and perspective difference information in the occluded image. Ours uses a combination of convolutional neural networks and dynamic graph neural networks to effectively expand the network's receptive field, thereby improving the robustness of occluded pedestrian re-identification data. A large number of experiments show that this method is superior to existing methods.
[0131] This embodiment proposes an occluded person re-identification method based on mask self-supervised occluded pixel reconstruction, which is used to perform pedestrian re-identification tasks on occluded images.
[0132] By training an image completion model consisting of an instance segmentation network and an image modeling network guided by a self-supervised mask, the occluded pedestrian pixels in the image are reconstructed to obtain a de-occluded pedestrian image. Then, an occluded pedestrian re-identification network based on dynamic graphs and graph convolution is used to re-identify the de-occluded pedestrian image. The occluded pedestrian re-identification network uses a dynamic graph structure to effectively expand the receptive field of the convolutional neural network and increase the discriminability and robustness of the feature graph learned. The experimental results on the public dataset Occluded-DukeMTMC show that this implementation has higher accuracy and better superiority than other methods.
[0133] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
Claims
1. A method for re-identifying occluded pedestrians based on mask self-supervised reconstruction of occluded pixels, characterized in that: The method comprises the steps of: Collect training data D, training data E and test data from a surveillance camera device, wherein the training data D includes occluded pedestrian re-identification pictures and instance segmentation-level annotations and pedestrian numbers, the training data E includes pedestrian re-identification pictures with relatively complete human body parts, and the test data only includes original occluded pedestrian re-identification pictures and pedestrian numbers; construct a mask autoencoder fine-tuning image completion model based on mask guidance, wherein the image completion model consists of an instance segmentation network and a self-supervised mask-guided image modeling network, the instance segmentation network is used to segment the pedestrian instance of the input image to obtain the mask of each pedestrian, a random function is used to randomly generate pixel retention scores of different image blocks in the pedestrian mask image, the image modeling network guided by the self-supervised mask is used to reconstruct the image blocks with pixel retention scores less than 60 in the pedestrian image to obtain a de-occluded pedestrian image, and the image completion model is trained to convergence using the training data D and the training data E; Use the completion model to predict the test data: input the test data into the instance segmentation network to obtain the pedestrian mask corresponding to the test data, use the image block function to calculate the pixel retention scores of different image blocks in the pedestrian mask image, use the image modeling network guided by the self-supervised mask to reconstruct the image blocks with pixel retention scores less than 60 in the pedestrian image, and obtain the de-occluded pedestrian image; Construct an occluded pedestrian re-identification network based on dynamic graph and graph convolution, wherein the pedestrian re-identification network is composed of a ResNet-50 network, a dynamic graph structure module and a graph convolution feature propagation module, use the ResNet-50 network to extract feature graphs in pedestrian images, use the dynamic graph structure module to construct a topological graph structure corresponding to the feature graph, use the graph convolution feature propagation module to perform feature propagation on the topological graph structure, and use training data E to train the occluded pedestrian re-identification network until convergence; In the prediction process of the occluded pedestrian re-identification network, the de-occluded pedestrian image is input into the converged pedestrian re-identification model to obtain the features of each pedestrian image. For each query image, the feature distance is sorted from small to large, and the 10 library images with the closest distance are taken as the query results of the query image. The library images with the same identity label are taken as the correct results matched to the query image, and the average accuracy and the first hit rate of the query image are calculated; The training process of the occluded person re-identification network based on dynamic graph and graph convolution is as follows: The pedestrian re-identification network uses a dynamic graph structure module and a graph convolution feature propagation module to assist in propagating features. The dynamic graph structure module establishes different graph structures at multiple positions in the convolutional neural network, that is, the feature graph is converted into a K nearest neighbor graph structure at multiple positions in the convolutional neural network. The dynamic graph structure module inputs a feature graph with a height of H and a width of W, and outputs an adjacency matrix A corresponding to the feature graph. The pseudo code of the dynamic graph structure module is as follows: Then, the correlation of each node in the feature map is calculated to obtain the correlation matrix. The formula is as follows: R=θ(F)φ(F) T Where R is the correlation matrix, is the feature map output by the convolutional layer, C is the dimension of the feature map, W and H are the width and height of the feature map respectively, and X T represents the transpose of the matrix X, θ(F) and φ(F) represent the input of the feature map F into two transfer functions with exactly the same structure but different parameters, respectively. The transfer function consists of a 1×1 convolution layer, a batch normalization layer, and a ReLU activation function; Multiply the correlation matrix R by the adjacency matrix A and normalize it using the softmax function to get the similarity adjacency matrix. The formula is as follows: in, is the similarity adjacency matrix, G is the number of nodes in the feature graph, A is the adjacency matrix output by the dynamic graph structure module, ⊙ represents the Hadamard product of the matrix, and node feature propagation is performed on the graph structure A. The formula is as follows: in, is the feature after feature propagation, It is the feature obtained by matrix transformation of the feature map output by the convolution layer. Through matrix transformation, the propagated features can be converted back into feature maps; The entire process of the above dynamic graph structure module and graph convolution feature propagation module is denoted as OGA(F). It is the feature map output by the convolutional layer. Introducing the residual structure into the feature propagation process, stacking the OGA modules multiple times can make the features propagate more fully. The stacking method of the OGA modules with residual structure is as follows: Where β represents the learnable parameter; During the training process, the loss function expression of the occluded pedestrian re-identification network is: L=L ID +L Triplet +εL C Among them, L Triplet is the triplet loss, L ID is the ID loss, L C is the Center loss, ε is the balance weight of the Center loss, which is set to 0.1 in this network; The L Triplet The expression is as follows: In the above formula, B is the number of training mini-batch samples. represents the benchmark sample, represents a positive sample of the same category but different from the benchmark sample, represents negative samples of different categories from the benchmark samples, α represents the set training interval, which is set to 0.2, and f(x) is the feature of image x; The L ID The expression is as follows: In the above formula, y represents the true label value of the training sample, Z represents the number of pedestrian identities in the data set, and f(x i ) represents the network's response to image x i The predicted embedding, ε value is a constant, set to 0.1; The L C The expression is as follows: In the above formula, f(x i ) is the image x i The feature of is, B is the number of training mini-batch samples, Indicates that the category is y i The center of all features of , that is, all categories y in the mini-batch i The average value of the features of the image.
2. The method for re-identifying occluded pedestrians based on mask self-supervised reconstruction of occluded pixels according to claim 1, characterized in that: The completion model is used to perform de-occlusion processing on the occluded pedestrian image. The completion model training process includes: (1) Using the training data D, the existing instance segmentation network Mask2former is trained until convergence, and an instance segmentation network that can output human body masks in pedestrian images is obtained. The converged instance segmentation network can predict the image X of identity i. i The corresponding pedestrian mask M i , where the original image X i The unoccluded pedestrian pixels in the corresponding pedestrian mask M i The pixels in the image location are white, and the other pixels are black; (2) Using the self-supervised mask-guided image modeling network to reconstruct the occluded pedestrian pixels in the occluded pedestrian image, H and W are the height and width of the image, 3 is the three dimensions of the RGB image, and the image block function is used to convert it into an image block embedding, where the height and width of each image block are P h With P w , for image X i With mask M i , the image block function is for each image X i Perform convolution with a kernel size of P h With P w , and the step length is also P h With P w , the output dimension of each image block is C, and the image is converted into an image block embedding using the image block function and flattened to obtain the following image block embedding: X iP =Patch(X i ,θ) M iP =Random(M i ) Among them, Patch is the image block function, Where C is the number of dimensions, (P h ,P w ) represents the resolution of each image block, is the total number of image patches, θ is a learnable parameter, the Random function calculates the number of image patches according to the input mask image size, and randomly generates the corresponding number of pixel retention scores, M iP Indicates the current image X i The pixel retention scores of all image blocks in the image are from 0 to 105. Image blocks with pixel retention scores less than 60 will be marked as reconstructed blocks. The X corresponding to the marked image blocks iP are discarded and do not enter the encoder part. During the training phase, M iP Generate using random function; (3) The embedded image blocks that have not been discarded are added to the image block position code and then input into the pixel reconstruction encoder. The position code uses the 2D position coding formula as follows: The pos X With pos Y is the horizontal and vertical coordinates of the image block in the original image, and the d model is the dimension of the positional encoding, d model The same as the image block embedding C, i is a positive integer from 0 to 0.5C-1. After each item of the position encoding is calculated, the obtained encoding is arranged as follows to obtain the 2D position encoding: PE(pos X ,0),PE(pos Y ,1),PE(pos X ,2),PE(pos Y ,3)...PE(pos X ,C-2),PE(pos Y ,C-1); The original image block is embedded into the input reconstruction encoder to obtain an intermediate tensor, and the learnable tensor is inserted into the position of the discarded pixel block in the intermediate tensor to obtain the intermediate tensor to be learned. The shape of the learnable tensor is the same as the embedding shape of the replaced image block, which is C represents the number of dimensions of the image block embedding, the intermediate tensor to be learned is input into the decoder to obtain the reconstructed image block embedding, and the reconstructed image block embedding is unpacked to obtain the reconstructed image; The self-supervised mask-guided image modeling network only calculates the loss for image patches with a pixel retention score less than 60, and uses the mean square error as the loss function.
3. The method for re-identifying occluded pedestrians based on mask self-supervised reconstruction of occluded pixels according to claim 1, characterized in that, in the prediction process of the completion model, the pixel retention score M iP The way of obtaining is different from the training process; Send the test data to the converged instance segmentation network to obtain the test image mask M iTest , the test data and the test image mask M iTest The image modeling network is inputted together to obtain a de-occluded pedestrian image. The image modeling network process in the prediction process is as follows: The pedestrian image and the test image mask M iTest Input the image block function together to get the image block embedding and flatten the image block embedding and pixel retention score M iP , pixel retention score M iP Image blocks smaller than 60 will be discarded, the non-discarded image block embeddings are added to the image block position codes, and the embedded images are input into the pixel reconstruction encoder to obtain an intermediate tensor, and the learnable tensor is inserted into the position of the discarded pixel blocks in the intermediate tensor to obtain an intermediate tensor to be learned, and the intermediate tensor to be learned is input into the decoder to obtain the reconstructed image block embeddings, and the reconstructed image block embeddings are unpacked to obtain the reconstructed image; The pixel retention score M in the prediction process iP The method of obtaining is as follows: M iP =Patch_formask(M iTest ,1) M iP Indicates the current image X i The pixel retention score of each image block in the image is from 0 to 105. The image block with a pixel retention score less than 60 will be marked as a reconstructed block. The X corresponding to the marked image block iP is discarded and does not enter the encoder part. Patch_formask is an image block function with the same structure as the Patch function. The difference between them is that the learnable parameter of the convolution kernel in the Patch function is θ, while the parameters in the convolution kernel in the Patch_formask function are not learnable and are fixed to 1. The output dimension of the pixel retention score is 1, that is, each image block corresponds to a pixel retention score. In the Patch_formask function, 1 means that the parameters in the convolution kernel are not learnable and are fixed to 1.
4. The method for re-identifying occluded pedestrians based on mask self-supervised reconstruction of occluded pixels according to claim 1, characterized in that: The prediction process of the occluded pedestrian re-identification network based on dynamic graph and graph convolution is as follows: After all networks are trained to convergence, the test data is sent to the masked autoencoder fine-tuned image completion model based on mask guidance to obtain the de-occluded pedestrian image, and the de-occluded pedestrian image is sent to the occluded pedestrian re-identification network based on dynamic graph and graph convolution to obtain the features of each image. For each query image, it is sorted from small to large according to the feature distance, and the 10 library images with the closest distance are taken as the query result of the query image; The library images with the same identity label are taken as the correct results matched to the query graph, and the average accuracy of the query image is calculated. The average accuracy of all query images is calculated to obtain the average accuracy on the data set. The average accuracy of the library images closest to the feature distance of all query images is calculated to obtain the first hit rate.
Citation Information
Patent Citations
Pedestrian re-recognition method based on body decomposition and significance detection
CN108520226A
Image processing method and image processing device
CN113538273A
Shielding pedestrian re-identification method based on attitude guidance and dynamic feature extraction
CN115909488A
Multi-modal pedestrian re-identification method based on multi-level cross-modal difference harmonic
CN116682144A
Spatiotemporal relationship reasoning for pedestrian intent prediction
US20210103742A1
