Pedestrian re-identification method and device, storage medium, and terminal

By extracting and integrating the key point relationship features in the image in the pedestrian re-identification method, and using the affinity matrix for prediction, the problem of low recognition accuracy when pedestrians are occluded is solved and the accuracy of pedestrian re-identification is improved.

CN114639116BActive Publication Date: 2024-09-06SHENYANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210164980.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-22
Publication Date
2024-09-06
Estimated Expiration
2042-02-22

AI Technical Summary

Technical Problem

Existing pedestrian re-identification methods have low recognition accuracy when pedestrians are occluded in the image, and the trained STN model has insufficient generalization capabilities, resulting in low recognition accuracy.

Method used

By obtaining the first image of the target pedestrian and the second image of the pedestrian to be identified, the relationship features are extracted and the affinity matrix is ​​used for feature integration, and the similarity is calculated to determine the pedestrian re-identification result. When pedestrians are occluded in the image, predictions are made based on the correlation between key points to improve recognition accuracy.

Benefits of technology

When pedestrians are occluded in the image, the accuracy of pedestrian re-identification is greatly improved through prediction of key point correlations, and is suitable for a wider range of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114639116B
    Figure CN114639116B
Patent Text Reader

Abstract

The present invention discloses a pedestrian re-identification method and device, a storage medium, and a terminal, which relate to the field of computer vision technology, and the main purpose is to solve the problem of low accuracy of existing pedestrian re-identification. It includes: obtaining a first image containing a target pedestrian and a second image containing a pedestrian to be identified; extracting relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image; integrating the first relationship feature and the second relationship feature using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image; respectively calculating the similarity of the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature, and determining the pedestrian re-identification result based on the similarity. It is mainly used for the recognition of pedestrian images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a pedestrian re-identification method and device, a storage medium, and a terminal. Background Art

[0002] Person re-identification (Re-ID), also known as pedestrian re-identification technology, is a technology that uses computer vision technology to identify specific objects in images or videos. This technology combines pedestrian recognition technology with target tracking technology. It extracts features from the image of a given retrieval pedestrian and the video frame or image of the pedestrian to be retrieved, and calculates the similarity based on the extracted features, thereby determining whether the pedestrian to be retrieved is the given retrieval pedestrian. It is widely used in business scenarios such as intelligent video surveillance and intelligent security.

[0003] The existing pedestrian re-identification methods are mainly based on the improved STN (Spatial Transformer Network) model. This method uses the improved STN model to realize pedestrian recognition by performing radial transformation on the image. When the pedestrians in the image are occluded, the recognition process is easily affected by the occlusion, resulting in abnormal output recognition results or low recognition accuracy. In addition, the insufficient generalization ability of the trained STN model also leads to low recognition accuracy. Summary of the invention

[0004] In view of this, the present invention provides a pedestrian re-identification method and device, the main purpose of which is to solve the problem of low recognition accuracy in existing pedestrian re-identification methods when pedestrians are occluded in images.

[0005] According to one aspect of the present invention, a pedestrian re-identification method is provided, comprising:

[0006] Acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified;

[0007] Extracting relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image;

[0008] Performing feature integration on the first relationship feature and the second relationship feature using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image;

[0009] The similarities between the first relationship feature and the second relationship feature, and between the first integrated feature and the second integrated feature are calculated respectively, and a pedestrian re-identification result is determined based on the similarities.

[0010] Furthermore, before integrating the first relationship feature and the second relationship feature using the affinity matrix determined based on the first relationship feature and the second relationship feature, the method further includes:

[0011] Activating the first relationship feature and the second relationship feature using a fully connected layer and a parameter-corrected activation function to obtain a first activation feature and a second activation feature;

[0012] performing graph matching processing on the first activation feature and the second activation feature to obtain an affinity matrix between the first image and the second image;

[0013] The affinity matrix is ​​used to characterize the relationship between the key points of the first image and the key points of the second image.

[0014] Further, the using the affinity matrix determined based on the first relationship feature and the second relationship feature to perform feature integration on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image includes:

[0015] The affinity matrix is ​​used to correct the first relationship feature and the second relationship feature respectively, and the correction result is spliced ​​and integrated with the corresponding relationship feature to obtain a first integrated feature and a second integrated feature.

[0016] Further, the extracting relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image includes:

[0017] Extracting key point graphs of the first image and the second image respectively using the trained person re-identification model, and performing feature extraction based on the key point graphs to obtain first key point features of the first image and second key point features of the second image, wherein the key point graphs are used to display key points of various parts of the pedestrian's body in the image;

[0018] The trained person re-identification model is used to extract relationship features from the first key point features and the second key point features, respectively, to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image.

[0019] Further, the extracting features according to the key point graph to obtain first key point features of the first image and second key point features of the second image includes:

[0020] Extracting global feature maps respectively according to the key point maps, and performing feature extraction according to the global feature maps to obtain first global features of the first image and second global features of the second image, wherein the global feature maps are used to display contour features of pedestrians in the image;

[0021] Perform feature extraction according to the key point map and the global feature map to obtain a first key point feature and a second key point feature;

[0022] The method of using the trained person re-identification model to extract relationship features from the first key point features and the second key point features to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image includes:

[0023] Relationship features are extracted according to the first key point feature and the first global feature, and the second key point feature and the second global feature, respectively, to obtain a first relationship feature and a second relationship feature.

[0024] Furthermore, respectively calculating the similarities between the first relationship feature and the second relationship feature, and between the first integrated feature and the second integrated feature, and determining the person re-identification result based on the similarities includes:

[0025] Determining an overall similarity based on a first similarity between the first relationship feature and the second relationship feature, and a second similarity between the first integrated feature and the second integrated feature;

[0026] If the overall similarity is greater than or equal to a preset similarity threshold, determining the pedestrian to be identified as the target pedestrian;

[0027] If the overall similarity is less than a preset similarity threshold, it is determined that the pedestrian to be identified is not the target pedestrian.

[0028] Furthermore, before acquiring the first image containing the target pedestrian and the second image containing the pedestrian to be identified, the method further includes:

[0029] Construct an initial person re-identification network model including a feature extraction network and a feature integration network;

[0030] The initial person re-identification network model is trained using the acquired sample images to obtain a trained person re-identification network model.

[0031] According to another aspect of the present invention, a pedestrian re-identification device is provided, comprising:

[0032] An acquisition module, used to acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified;

[0033] an extraction module, configured to extract relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image;

[0034] an integration module, configured to perform feature integration on the first relationship feature and the second relationship feature by using an affinity matrix determined based on the first relationship feature and the second relationship feature, so as to obtain a first integrated feature of the first image and a second integrated feature of the second image;

[0035] The determination module is used to respectively calculate the similarity between the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature, and determine the pedestrian re-identification result based on the similarity.

[0036] Furthermore, the device also includes:

[0037] an activation module, configured to activate the first relationship feature and the second relationship feature by using a fully connected layer and a parameter-corrected activation function to obtain a first activation feature and a second activation feature;

[0038] A graph matching module, configured to perform graph matching processing on the first activation feature and the second activation feature to obtain an affinity matrix between the first image and the second image;

[0039] The affinity matrix is ​​used to characterize the relationship between the key points of the first image and the key points of the second image.

[0040] Furthermore, the integration module is specifically used to use the affinity matrix to correct the first relationship feature and the second relationship feature respectively, and to splice and integrate the correction results with the corresponding relationship features to obtain the first integrated feature and the second integrated feature.

[0041] Furthermore, the extraction module comprises:

[0042] a first extraction unit, configured to extract key point graphs of the first image and the second image respectively by using the trained person re-identification model, and perform feature extraction according to the key point graphs to obtain first key point features of the first image and second key point features of the second image, wherein the key point graphs are used to display key points of various parts of a person's body in the image;

[0043] The second extraction unit is used to use the trained pedestrian re-identification model to extract relationship features from the first key point features and the second key point features respectively, so as to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image.

[0044] Further, the first extraction unit is specifically used to extract global feature maps according to the key point map, and perform feature extraction according to the global feature map to obtain a first global feature of the first image and a second global feature of the second image, wherein the global feature map is used to display the contour features of pedestrians in the image; and perform feature extraction according to the key point map and the global feature map to obtain a first key point feature and a second key point feature;

[0045] The second extraction unit is specifically configured to extract relationship features according to the first key point feature and the first global feature, and the second key point feature and the second global feature, respectively, to obtain a first relationship feature and a second relationship feature.

[0046] Furthermore, the determining module includes:

[0047] A first determining unit, configured to determine an overall similarity according to a first similarity between the first relationship feature and the second relationship feature, and a second similarity between the first integrated feature and the second integrated feature;

[0048] A second determination unit, configured to determine that the pedestrian to be identified is the target pedestrian if the overall similarity is greater than or equal to a preset similarity threshold;

[0049] The third determination unit is configured to determine that the pedestrian to be identified is not the target pedestrian if the overall similarity is less than a preset similarity threshold.

[0050] Furthermore, the device also includes:

[0051] A construction module is used to construct an initial person re-identification network model including a feature extraction network and a feature integration network;

[0052] The training module is used to train the initial person re-identification network model using the acquired sample images to obtain a trained person re-identification network model.

[0053] According to another aspect of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned pedestrian re-identification method.

[0054] According to another aspect of the present invention, there is provided a terminal, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0055] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned pedestrian re-identification method.

[0056] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0057] The present invention provides a pedestrian re-identification method and device, a storage medium, and a terminal. In an embodiment of the present invention, a first image containing a target pedestrian and a second image containing a pedestrian to be identified are obtained; relationship features are extracted from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature content of the first image and the second image; the first relationship feature and the second relationship feature are feature integrated using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image; the similarities of the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature are respectively calculated, and a pedestrian re-identification result is determined based on the similarities. When a pedestrian is occluded in the image, the key points of the occluded part can be predicted according to the correlation between the key points of the pedestrian in the image, thereby greatly improving the accuracy of pedestrian re-identification when the pedestrian is occluded in the image.

[0058] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0060] Figure 1 A flow chart of a pedestrian re-identification method provided by an embodiment of the present invention is shown;

[0061] Figure 2 A schematic diagram of key points of a pedestrian's body provided by an embodiment of the present invention is shown;

[0062] Figure 3 A flow chart of another pedestrian re-identification method provided by an embodiment of the present invention is shown;

[0063] Figure 4 A schematic diagram of a dynamic graph convolution layer structure provided by an embodiment of the present invention is shown;

[0064] Figure 5 A flow chart of another pedestrian re-identification method provided by an embodiment of the present invention is shown;

[0065] Figure 6 A schematic diagram of a feature integration network structure provided by an embodiment of the present invention is shown;

[0066] Figure 7 A block diagram of a pedestrian re-identification device provided by an embodiment of the present invention is shown;

[0067] Figure 8 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0068] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0069] For a pedestrian re-identification method based on an improved STN (Spatial Transformer Network) model, the method uses the improved STN model to realize pedestrian recognition by performing radial transformation on the image. When the pedestrian in the image is occluded, the recognition process is easily affected by the occlusion, resulting in abnormal output recognition results or low recognition accuracy. In addition, the trained STN model has insufficient generalization ability, which also leads to low recognition accuracy. An embodiment of the present invention provides a pedestrian re-identification method, such as Figure 1 As shown, the method includes:

[0070] 101. Acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified.

[0071] In an embodiment of the present invention, the target pedestrian in the first image is the target search object that needs to be identified for pedestrian re-identification, and the pedestrian to be identified in the second image is the object to be determined that needs to be identified based on the pedestrian re-identification technology to determine whether it is the target pedestrian, that is, the image of the target pedestrian is used as the reference object for identification and search, and the target pedestrian is identified from all images of the pedestrians to be identified, wherein the first image is a pre-given image, and the second image can be an image in the form of a picture in a gallery, or can be an image set obtained by extracting video frames containing pedestrians in a video. Identifying the target pedestrian from the gallery and the video based on the target pedestrian's features in the given image can make pedestrian re-identification applicable to a wider range of application scenarios.

[0072] 102. Extract relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image.

[0073] In the embodiment of the present invention, in order to obtain the characteristic information of the target pedestrian and the pedestrian to be identified in the first image and the second image, as shown in FIG. Figure 2 As shown, features are extracted from each key point of the pedestrian, which is each joint point of the pedestrian in the image, such as the head, nose, left and right shoulders, left and right elbows, left and right knees, etc., and based on the number of associated nodes of each key point, such as the associated nodes of the head node are the nose, left shoulder, right shoulder, left waist, and right waist, the associated nodes of the right elbow node are the right shoulder and right hand nodes, and the degree of association between each key point, such as the degree of association between the head and the left and right shoulders is higher than the degree of association between the head and the left and right waists, the association relationship between each key point, i.e., the relationship feature, is determined.

[0074] It should be noted that by extracting the key points of pedestrians in the image and determining the relationship characteristics between the key points based on the number of associated nodes of each key point and the degree of association between the key points, the connection between the isolated joint points in the human body is effectively established. When the pedestrians in the image are occluded, the key points of the occluded parts can be predicted through the relationship characteristics between the key points, thereby improving the accuracy of pedestrian re-identification when the pedestrians in the image are occluded.

[0075] 103. Perform feature integration on the first relationship feature and the second relationship feature using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image.

[0076] In an embodiment of the present invention, in order to further improve the accuracy of predicting the key points of the occluded parts of the pedestrian, the adjacency matrix, i.e., the affinity matrix, between the key points in the first image and the key points in the second image is determined according to the relationship characteristics of the key points in the first image and the second image, and then the relationship characteristics between the key points in the first image and the second image are respectively corrected using the affinity matrix to obtain integrated features corresponding to the first image and the second image respectively, wherein the affinity matrix can reflect the association relationship between the key points in the first image and their adjacent key points in the second image, for example, the knee node A1 of the pedestrian in the first image is associated with the knee node A2 of the pedestrian in the second image and the waist node B2 and the foot node C2 associated with the knee node A2, and the adjacency matrix of the A1 node corresponding to each joint point in the second image is determined by calculating the distance between the A1 node and the A2, B2, and C2 nodes respectively.

[0077] It should be noted that since the affinity matrix not only includes the association relationship between the corresponding key points in the first image and the second image, such as the association relationship between the left knee node in the first image and the corresponding left knee node in the second image, it also includes the association relationship between the key points and the associated key points of their corresponding key points, such as the association relationship between the left knee node in the first image and the left waist node and the left foot node in the second image, therefore, using the affinity matrix to correct the relationship features between the key points of pedestrians in each image can effectively improve the accuracy of the relationship features between the key points, thereby achieving accurate prediction of the key points of the occluded parts of pedestrians in the image, and thereby improving the accuracy of pedestrian re-identification.

[0078] 104. Calculate similarities between the first relationship feature and the second relationship feature, and between the first integrated feature and the second integrated feature, respectively, and determine a person re-identification result based on the similarities.

[0079] In an embodiment of the present invention, in order to more accurately calculate the similarity between the target pedestrian and the pedestrian to be identified, the first similarity is determined based on the first relationship feature between the key points of the target pedestrian and the second relationship feature between the key points of the pedestrian to be identified, and the second similarity is determined based on the first integrated feature and the second integrated feature, that is, the correction and integration result of the first relationship feature and the second relationship feature. The final integrated similarity is obtained by fusing the first similarity and the second similarity, and the overall similarity is used as the basis for determining the pedestrian re-identification result to determine the pedestrian re-identification result. For example, if the overall similarity is greater than or equal to the preset similarity threshold, the pedestrian to be identified is determined to be the target pedestrian. If the overall similarity is less than the preset similarity threshold, the pedestrian to be identified is determined to be a non-target pedestrian.

[0080] It should be noted that, by determining the overall similarity based on the first similarity determined by the key point relationship features of the pedestrians in each image and the second similarity determined by the integrated features obtained after integration using the affinity matrix, the judgment of pedestrian re-identification can take into account the correlation between the key points of the target pedestrian image and the pedestrian image to be identified while considering the intrinsic correlation of the key points in each pedestrian image, thereby effectively improving the accuracy of pedestrian re-identification, especially the accuracy of pedestrian re-identification when there is occlusion in the pedestrian image.

[0081] In one embodiment of the present invention, for further explanation and limitation, before step 101 acquires the first image including the target pedestrian and the second image including the pedestrian to be identified, the method further includes:

[0082] Construct an initial person re-identification network model including a feature extraction network and a feature integration network.

[0083] The initial person re-identification network model is trained using the acquired sample images to obtain a trained person re-identification network model.

[0084] In the embodiment of the present invention, due to the pedestrian re-identification process, it is necessary to extract global features (pedestrian contour features) and key point features from the images of the target pedestrian and the pedestrian to be identified, and process and calculate the extracted feature information to obtain the similarity between the target pedestrian and the pedestrian to be identified. Therefore, it is necessary to construct an initial pedestrian re-identification network model, and use a loss function to train the initial pedestrian re-identification network model to obtain a trained pedestrian re-identification network model. Among them, the feature extraction network of the initial pedestrian re-identification network model includes a first feature extraction network and a second feature extraction network. The first feature extraction network is used to extract the global features and key point features of pedestrians in the image to obtain key point features and global features, and train them using a classifier and a ternary loss. The loss function formula is:

[0085]

[0086] Among them, β k represents the confidence of the Kth key point, β k =max(m k [k])∈[0,1], and the β of the global feature map k+1 =1,v k S represents the key point feature, L cls () represents the classifier loss, L tri () represents ternary loss, is predicted by the classifier Abilities that fall within the scope of their true identity, is a pair of positive samples from the same identity The distance between is a pair of positive and negative samples from different identities The distance between them, for different key point features, the parameters between classifiers are not shared; the second feature extraction network is used to extract the features of the association relationship between the key points of pedestrians in the image to obtain the relationship features, and the classifier and ternary loss are used for training. The loss function formula is: The feature integration network is used to integrate the relationship features and calculate the similarity between the first integrated feature and the second integrated feature, that is, the integrated feature similarity. The corresponding loss function formula is:

[0087] in, To integrate feature similarity.

[0088] It should be noted that the first feature extraction network includes an Openpose (human pose recognition) model for extracting key points of pedestrians in images, and an IBN-Net50 (IBN: Instance-batch normalization) network model for extracting contour features of pedestrians in images. Since IBN-Net50 is a structure combining 32 IN layers and 32 BN layers, IN can ensure that the features will not change with the color and style of the image when extracting features. For example, when the model is trained, pedestrian image samples in hospital and school scenes are input. When the scene of the pedestrian image is converted to a courier delivery scene, the feature extraction ability will not decrease. BN can retain the relevant information between features during the normalization process, so that the network model can perform multi-perspective learning and make the multi-perspective learning results mutually constrained. Therefore, the trained pedestrian re-identification network model has a strong generalization ability, so that the trained pedestrian re-identification network model can be applied to a wider range of application scenarios.

[0089] It should be noted that the activation function selected in the feature integration network is the parameter correction activation function (PRelu: Parametric Rectified Linear Unit). By using the corrected activation function with parameters, it can still have good model convergence ability in training with higher complexity, thereby greatly improving the training efficiency of the initial pedestrian re-identification network model.

[0090] In an embodiment of the present invention, for further explanation and limitation, as Figure 3 As shown, step 102 extracts relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, including:

[0091] 1021. Use the trained person re-identification model to extract key point maps of the first image and the second image respectively, and perform feature extraction based on the key point maps to obtain first key point features of the first image and second key point features of the second image.

[0092] 1022. Use the trained person re-identification model to extract relationship features from the first key point features and the second key point features respectively, to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image.

[0093] In one embodiment of the present invention, for further explanation and limitation, step 1021 performs feature extraction according to the key point map to obtain a first key point feature of the first image and a second key point feature of the second image, including: extracting a global feature map according to the key point map, and performing feature extraction according to the global feature map to obtain a first global feature of the first image and a second global feature of the second image, wherein the global feature map is used to display the contour features of pedestrians in the image, and feature extraction is performed according to the key point map and the global feature map to obtain a first key point feature and a second key point feature; step 1022 uses the trained pedestrian re-identification model to perform relationship feature extraction on the first key point feature and the second key point feature, respectively, to obtain a first relationship feature and a second relationship feature for characterizing the relationship between key points in the image, including: performing relationship feature extraction on the first key point feature and the first global feature, and on the second key point feature and the second global feature, respectively, to obtain a first relationship feature and a second relationship feature.

[0094] In the embodiment of the present invention, in order to obtain the features of the target pedestrian and the pedestrian to be identified, the feature extraction network of the trained pedestrian re-identification network model is used to extract features from the first image and the second image respectively. Taking the first image as an example, the feature extraction process specifically includes:

[0095] 1) Using the Open pose (human posture recognition) model in the first feature extraction network to extract the key point map in the first image, and denoising the key point map through the softmax function to obtain the denoised key point map, denoted as m k ; Use the IBN-Net50 network model in the first feature extraction network to extract global features from the key point map to obtain the first global feature map, expressed as m ibn ; By denoising the key point map m k and pedestrian contour feature map m ibn Perform outer product and global average pooling operations to obtain the first key point feature, expressed as V l S , the formula is:

[0096] For the first global feature map m ibn Perform a global average pooling operation to obtain the first global feature, expressed as The formula is: Among them, K represents the number of key points, v k ∈R c , c generally refers to the number of model channels.

[0097] 2) Input the first key point feature and the first global feature into the second feature extraction network, such as Figure 4 As shown, the second feature extraction network is a dynamic graph convolution layer. In the dynamic graph convolution layer, the difference between the key point feature of the kth key point in the first key point feature and the first global feature is obtained by difference, abs (absolute positioning), gn (normalization operation: group normalization) and fc (fully connected layer) processing, and the edge weights (relationship weights) and neighbor matrix A of all key points in the graph network are dynamically updated according to the difference to obtain the adjacent matrix A adp , and then according to the key point feature of the kth key point in the first key point feature, the first global feature and the adjacent matrix A adp , perform convolution operations, element addition, concatenation operations, etc., and obtain the first relationship feature, denoted as V1 R , the formula is: Among them, f() corresponds to the fully connected layer fc in the dynamic graph convolution layer, f1() and f2() correspond to the fully connected layers fc1 and fc2 in the dynamic graph convolution layer respectively, and fc1 and fc2 are two fully connected layers whose parameters are not shared. According to the above formulas (4) to (6), the second relationship feature of the second image can be obtained in the same way The present invention will not be described in detail here.

[0098] It should be noted that after obtaining the key point features and global features of the pedestrians in the image, the key points are used as nodes in the graph neural network. Through the dynamic graph convolution layer, the difference between the features of each key point of the pedestrian and the global features of the pedestrian (pedestrian contour features) is used to dynamically update the edge values ​​of all nodes in the graph network to obtain the adjacent matrix. The relationship features are determined based on the adjacent matrix, which can accurately establish the correlation relationship between the key points of the pedestrians in the image, thereby achieving accurate prediction of the key points of the occluded parts of the pedestrians.

[0099] In an embodiment of the present invention, for further explanation and limitation, as Figure 5As shown, before integrating the first relationship feature and the second relationship feature using the affinity matrix determined based on the first relationship feature and the second relationship feature in step 103, the method further includes:

[0100] 201. Activate the first relationship feature and the second relationship feature using a fully connected layer and a parameter-corrected activation function to obtain a first activation feature and a second activation feature.

[0101] 202. Perform graph matching processing on the first activation feature and the second activation feature to obtain an affinity matrix between the first image and the second image.

[0102] In the embodiment of the present invention, although the key points of the occluded part can be predicted according to the relationship features between the key points of the pedestrian in the image, when the occluded part is large, that is, multiple key points are occluded, the ability to predict the key points of the occluded part according to the relationship features will be limited, that is, it is difficult to accurately predict the occluded key points that are far away from the known key points. Therefore, it is necessary to establish the association relationship between the key points in the two images, that is, the affinity matrix, based on the relationship features of the key points in a single image. Figure 6 As shown, the feature integration network has two inputs, each of which is first activated through a fully connected layer and a parameter corrected activation function (PRelu) layer, and the activation processing results corresponding to the two inputs jointly obtain an affinity matrix S, that is, the relationship feature of the first image (first relationship feature) and the relationship feature of the second image (second relationship feature) are used as inputs of the feature integration network, and the first activation feature corresponding to the first relationship feature and the second activation feature corresponding to the first relationship feature are obtained through activation processing respectively, and the first activation feature and the second activation feature are subjected to graph matching operation to obtain the affinity matrix S common to the first image and the second image.

[0103] It should be noted that the affinity matrix constructed based on the relationship features of the first image and the relationship features of the second image can characterize the association between each key point of the first image and each key point of the second image. By using the affinity matrix to correct the first relationship features and the second relationship features, the image can predict the occluded key points in its own image with the help of the key points in another image, thereby achieving accurate recognition of the occluded parts of pedestrians in the image.

[0104] In one embodiment of the present invention, for further explanation and limitation, step 103 uses an affinity matrix determined based on the first relationship feature and the second relationship feature to perform feature integration on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image, including: using the affinity matrix to respectively correct the first relationship feature and the second relationship feature, and splicing and integrating the correction results with the corresponding relationship features to obtain a first integrated feature and a second integrated feature.

[0105] In the embodiment of the present invention, in order to more accurately identify the pedestrian occluded part in the image, the first relationship feature and the second relationship feature are input into the feature integration network to perform feature integration processing. Specifically, the constructed affinity matrix is ​​used to perform convolution operations on the activation features based on the first relationship feature and the second relationship feature, and the convolution results are spliced ​​with the corresponding activation features, activation processing and element addition are performed, that is, the convolution result of the first activation feature and the affinity matrix is ​​spliced ​​with the first activation feature, and the splicing result after passing through the fully connected layer and the parameter-corrected activation function is element-added with the first activation feature to obtain the first integrated feature, which is expressed as V1. c , the formula is: The convolution result of the second activation feature and the affinity matrix is ​​concatenated with the second activation feature, and the concatenation result after the full connection layer and the parameter correction activation function is element-wise added to the first activation feature to obtain the second integrated feature, denoted as V2 c , the formula is:

[0106] It should be noted that by constructing an affinity matrix, using the affinity matrix to correct the activation features of the first relationship feature and the second relationship feature, and splicing and integrating the correction results, the obtained integrated relationship features can contain richer and more accurate correlation features between key points, thereby achieving accurate prediction of the key points of the occluded parts and accurate identification of the occluded parts, thereby greatly improving the accuracy of pedestrian re-identification when pedestrians are occluded in the image.

[0107] In one embodiment of the present invention, for further explanation and limitation, step 104 respectively calculates the similarity between the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature, and determines the pedestrian re-identification result based on the similarity, including:

[0108] The overall similarity is determined according to a first similarity between the first relationship feature and the second relationship feature, and a second similarity between the first integration feature and the second integration feature.

[0109] If the overall similarity is greater than or equal to a preset similarity threshold, the pedestrian to be identified is determined to be the target pedestrian.

[0110] If the overall similarity is less than a preset similarity threshold, it is determined that the pedestrian to be identified is not the target pedestrian.

[0111] In the embodiment of the present invention, in order to determine whether the pedestrian to be identified is the target pedestrian to be searched, it is necessary to calculate the similarity between the target pedestrian image (first image) and the pedestrian image to be identified (second image), and obtain the result of pedestrian re-identification based on a preset similarity threshold. Specifically, according to the first relationship feature and the second relationship feature, the cosine similarity algorithm is used to calculate the relationship feature similarity, that is, the first similarity, which is expressed as The formula is: According to the first integrated feature and the second integrated feature, the integrated feature similarity, i.e., the second similarity, is calculated using the sigmoid activation function, which is expressed as: The formula is: Then, the overall similarity is calculated based on the first similarity and the second similarity, expressed as s, and the formula is: According to the comparison result between the preset similarity threshold and the overall recognition degree, the pedestrian re-identification result is generated. For example, the preset similarity threshold is 90%. If the similarity between the pedestrian to be identified and the target pedestrian image is greater than or equal to 90%, then a recognition result that the pedestrian to be identified is the target pedestrian is generated. If the similarity between the pedestrian to be identified and the target pedestrian image is less than 90%, then a recognition result that the pedestrian to be identified is a non-target pedestrian is generated. Among them, the preset similarity threshold can be customized according to the actual application scenario and needs. The calculation of the similarity can use a cosine similarity algorithm, a Euclidean distance or other similarity algorithm, which is not specifically limited in the embodiments of the present invention.

[0112] The present invention provides a pedestrian re-identification method and device, a storage medium, and a terminal. In an embodiment of the present invention, a first image containing a target pedestrian and a second image containing a pedestrian to be identified are obtained; relationship features are extracted from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature content of the first image and the second image; the first relationship feature and the second relationship feature are feature integrated using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image; the similarities of the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature are respectively calculated, and a pedestrian re-identification result is determined based on the similarities. When a pedestrian is occluded in the image, the key points of the occluded part can be predicted according to the correlation between the key points of the pedestrian in the image, thereby greatly improving the accuracy of pedestrian re-identification when the pedestrian is occluded in the image.

[0113] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a pedestrian re-identification device, such as Figure 7 As shown, the device comprises:

[0114] An acquisition module 31 is used to acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified;

[0115] An extraction module 32 is used to extract relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image;

[0116] An integration module 33, configured to perform feature integration on the first relationship feature and the second relationship feature by using an affinity matrix determined based on the first relationship feature and the second relationship feature, so as to obtain a first integrated feature of the first image and a second integrated feature of the second image;

[0117] The determination module 34 is used to respectively calculate the similarity between the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature, and determine the pedestrian re-identification result based on the similarity.

[0118] Furthermore, the device also includes:

[0119] an activation module, configured to activate the first relationship feature and the second relationship feature by using a fully connected layer and a parameter-corrected activation function to obtain a first activation feature and a second activation feature;

[0120] A graph matching module, configured to perform graph matching processing on the first activation feature and the second activation feature to obtain an affinity matrix between the first image and the second image;

[0121] The affinity matrix is ​​used to characterize the relationship between the key points of the first image and the key points of the second image.

[0122] Furthermore, the integration module is specifically used to use the affinity matrix to correct the first relationship feature and the second relationship feature respectively, and to splice and integrate the correction results with the corresponding relationship features to obtain the first integrated feature and the second integrated feature.

[0123] Furthermore, the extraction module comprises:

[0124] a first extraction unit, configured to extract key point graphs of the first image and the second image respectively by using the trained person re-identification model, and perform feature extraction according to the key point graphs to obtain first key point features of the first image and second key point features of the second image, wherein the key point graphs are used to display key points of various parts of a person's body in the image;

[0125] The second extraction unit is used to use the trained pedestrian re-identification model to extract relationship features from the first key point features and the second key point features respectively, so as to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image.

[0126] Further, the first extraction unit is specifically used to extract global feature maps according to the key point map, and perform feature extraction according to the global feature map to obtain a first global feature of the first image and a second global feature of the second image, wherein the global feature map is used to display the contour features of pedestrians in the image; and perform feature extraction according to the key point map and the global feature map to obtain a first key point feature and a second key point feature;

[0127] The second extraction unit is specifically configured to extract relationship features according to the first key point feature and the first global feature, and the second key point feature and the second global feature, respectively, to obtain a first relationship feature and a second relationship feature.

[0128] Furthermore, the determination module includes:

[0129] A first determining unit, configured to determine an overall similarity according to a first similarity between the first relationship feature and the second relationship feature, and a second similarity between the first integrated feature and the second integrated feature;

[0130] A second determination unit, configured to determine that the pedestrian to be identified is the target pedestrian if the overall similarity is greater than or equal to a preset similarity threshold;

[0131] The third determination unit is configured to determine that the pedestrian to be identified is not the target pedestrian if the overall similarity is less than a preset similarity threshold.

[0132] Furthermore, the device also includes:

[0133] A construction module is used to construct an initial person re-identification network model including a feature extraction network and a feature integration network;

[0134] The training module is used to train the initial person re-identification network model using the acquired sample images to obtain a trained person re-identification network model.

[0135] The present invention provides a pedestrian re-identification device. In an embodiment of the present invention, a first image including a target pedestrian and a second image including a pedestrian to be identified are obtained; relationship features are extracted from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image; the first relationship feature and the second relationship feature are feature integrated using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image; similarities between the first relationship feature and the second relationship feature, and between the first integrated feature and the second integrated feature are calculated respectively, and a pedestrian re-identification result is determined based on the similarity. When a pedestrian is occluded in the image, the key points of the occluded part can be predicted according to the correlation between the key points of the pedestrian in the image, thereby greatly improving the accuracy of pedestrian re-identification when the pedestrian is occluded in the image.

[0136] According to an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the pedestrian re-identification method in any of the above method embodiments.

[0137] Figure 8 A schematic diagram of the structure of a terminal provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.

[0138] like Figure 8 As shown, the terminal may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .

[0139] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .

[0140] The communication interface 504 is used to communicate with other devices such as clients or other servers.

[0141] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned pedestrian re-identification method embodiment.

[0142] Specifically, the program 510 may include program codes, which include computer operation instructions.

[0143] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0144] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0145] The program 510 may be specifically configured to enable the processor 502 to perform the following operations:

[0146] Acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified;

[0147] Extracting relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image;

[0148] Performing feature integration on the first relationship feature and the second relationship feature using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image;

[0149] The similarities between the first relationship feature and the second relationship feature, and between the first integrated feature and the second integrated feature are calculated respectively, and a pedestrian re-identification result is determined based on the similarities.

[0150] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0151] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A pedestrian re-identification method, characterized in that: include: Acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified; Extracting relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image; Performing feature integration on the first relationship feature and the second relationship feature using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image; respectively calculating similarities between the first relationship feature and the second relationship feature, and between the first integrated feature and the second integrated feature, and determining a person re-identification result based on the similarities; Before acquiring the first image containing the target pedestrian and the second image containing the pedestrian to be identified, the method further includes: Construct an initial person re-identification network model including a feature extraction network and a feature integration network; Using the acquired sample images to train the initial person re-identification network model to obtain a trained person re-identification network model; The feature extraction network of the initial pedestrian re-identification network model includes a first feature extraction network and a second feature extraction network. The first feature extraction network is used to extract the global features and key point features of pedestrians in the image to obtain key point features and global features. The classifier and ternary loss are used for training. The loss function formula is: in, represents the confidence of the Kth key point, , and the global feature map , represents key point features, represents the classifier loss, represents the ternary loss, is predicted by the classifier Abilities that fall within the scope of their true identity, is a pair of positive samples from the same identity The distance between is a pair of positive and negative samples from different identities The distance between them, for different key point features, the parameters between classifiers are not shared; the second feature extraction network is used to extract the features of the association relationship between the key points of pedestrians in the image to obtain the relationship features, and the classifier and ternary loss are used for training. The loss function formula is: , the feature integration network is used to integrate the relationship features and calculate the similarity between the first integrated feature and the second integrated feature, that is, the integrated feature similarity. The corresponding loss function formula is: ,in, To integrate feature similarity.

2. The method according to claim 1, characterized in that: Before integrating the first relationship feature and the second relationship feature using the affinity matrix determined based on the first relationship feature and the second relationship feature, the method further includes: Activating the first relationship feature and the second relationship feature using a fully connected layer and a parameter-corrected activation function to obtain a first activation feature and a second activation feature; performing graph matching processing on the first activation feature and the second activation feature to obtain an affinity matrix between the first image and the second image; The affinity matrix is ​​used to characterize the relationship between the key points of the first image and the key points of the second image.

3. The method according to claim 1 or 2, characterized in that: The step of integrating the first relationship feature and the second relationship feature by using an affinity matrix determined based on the first relationship feature and the second relationship feature to obtain a first integrated feature of the first image and a second integrated feature of the second image includes: The affinity matrix is ​​used to correct the first relationship feature and the second relationship feature respectively, and the correction result is spliced ​​and integrated with the corresponding relationship feature to obtain a first integrated feature and a second integrated feature.

4. The method according to claim 1, characterized in that The extracting the relationship features of the first image and the second image to obtain the first relationship feature of the first image and the second relationship feature of the second image includes: Extracting key point graphs of the first image and the second image respectively using the trained person re-identification model, and performing feature extraction based on the key point graphs to obtain first key point features of the first image and second key point features of the second image, wherein the key point graphs are used to display key points of various parts of the pedestrian's body in the image; The trained person re-identification model is used to extract relationship features from the first key point features and the second key point features, respectively, to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image.

5. The method according to claim 4, characterized in that The step of extracting features according to the key point graph to obtain first key point features of the first image and second key point features of the second image includes: Extracting global feature maps respectively according to the key point maps, and performing feature extraction according to the global feature maps to obtain first global features of the first image and second global features of the second image, wherein the global feature maps are used to display contour features of pedestrians in the image; Perform feature extraction according to the key point map and the global feature map to obtain a first key point feature and a second key point feature; The method of using the trained person re-identification model to extract relationship features from the first key point features and the second key point features to obtain first relationship features and second relationship features for characterizing the relationship between key points in the image includes: Relationship features are extracted according to the first key point feature and the first global feature, and the second key point feature and the second global feature, respectively, to obtain a first relationship feature and a second relationship feature.

6. The method according to claim 1, characterized in that The respectively calculating the similarity between the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature, and determining the pedestrian re-identification result based on the similarity, includes: Determining an overall similarity based on a first similarity between the first relationship feature and the second relationship feature, and a second similarity between the first integrated feature and the second integrated feature; If the overall similarity is greater than or equal to a preset similarity threshold, determining the pedestrian to be identified as the target pedestrian; If the overall similarity is less than a preset similarity threshold, it is determined that the pedestrian to be identified is not the target pedestrian.

7. A pedestrian re-identification device, characterized in that: include: An acquisition module is used to acquire a first image containing a target pedestrian and a second image containing a pedestrian to be identified. Before acquiring the first image containing the target pedestrian and the second image containing the pedestrian to be identified, the module further includes: Construct an initial person re-identification network model including a feature extraction network and a feature integration network; Using the acquired sample images to train the initial person re-identification network model to obtain a trained person re-identification network model; The feature extraction network of the initial pedestrian re-identification network model includes a first feature extraction network and a second feature extraction network. The first feature extraction network is used to extract the global features and key point features of pedestrians in the image to obtain key point features and global features. The classifier and ternary loss are used for training. The loss function formula is: in, represents the confidence of the Kth key point, , and the global feature map , represents key point features, represents the classifier loss, represents the ternary loss, is predicted by the classifier Abilities that fall within the scope of their true identity, is a pair of positive samples from the same identity The distance between is a pair of positive and negative samples from different identities The distance between them, for different key point features, the parameters between classifiers are not shared; the second feature extraction network is used to extract the features of the association relationship between the key points of pedestrians in the image to obtain the relationship features, and the classifier and ternary loss are used for training. The loss function formula is: , the feature integration network is used to integrate the relationship features and calculate the similarity between the first integrated feature and the second integrated feature, that is, the integrated feature similarity. The corresponding loss function formula is: ,in, To integrate feature similarity; an extraction module, configured to extract relationship features from the first image and the second image to obtain a first relationship feature of the first image and a second relationship feature of the second image, wherein the first relationship feature and the second relationship feature are extracted based on key point feature contents of the first image and the second image; an integration module, configured to perform feature integration on the first relationship feature and the second relationship feature by using an affinity matrix determined based on the first relationship feature and the second relationship feature, so as to obtain a first integrated feature of the first image and a second integrated feature of the second image; The determination module is used to respectively calculate the similarity between the first relationship feature and the second relationship feature, and the first integrated feature and the second integrated feature, and determine the pedestrian re-identification result based on the similarity.

8. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the pedestrian re-identification method according to any one of claims 1 to 6.

9. A terminal, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the pedestrian re-identification method according to any one of claims 1-6.