Pedestrian re-identification method and device
Through the instance human analysis network, the human body analysis and preset pixel point coordinates are combined, and the pedestrian instance segmentation matrix is integrated to solve the problem of low accuracy of pedestrian re-identification in the existing technology and achieve high-precision pedestrian re-identification.
Patent Information
- Application Number
- CN202210111463.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-01-29
AI Technical Summary
The existing technology only uses the face information in the image for pedestrian re-identification and fails to fully utilize all the information of the pedestrian image, resulting in accuracy that needs to be improved.
The instance human parsing network is used to obtain the instance feature matrix of the scene image, and combine the human parsing matrix and preset pixel point coordinates to fuse the pedestrian instance segmentation matrix, calculate the similarity between the target object and the scene image, and determine the scene image where the target object is located.
It improves the accuracy of pedestrian re-identification, can analyze the fine-grained parts of the target pedestrian from multi-person images, accurately determine whether the scene image is where the target object is, and achieve high-precision pedestrian re-identification.
Smart Images

Figure CN114495174B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a pedestrian re-identification method and device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] In pedestrian re-identification, it is necessary to find all the activity photos that the target object has participated in through a pedestrian image. In the existing technology, generally only the facial information in the image is used for matching, and all the information of the pedestrian image is not fully utilized. Therefore, the accuracy of pedestrian re-identification needs to be improved. Summary of the invention
[0004] The embodiment of the present invention provides a pedestrian re-identification method for finding scene images in which all target pedestrians appear in a desired scene according to a given target pedestrian. The method comprises:
[0005] After acquiring the scene image, it is input into the instance human body parsing network to obtain the instance feature matrix of the scene image;
[0006] Calculate the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object;
[0007] When the similarity is greater than a similarity threshold, determining that the scene image is a scene image of a scene where a target object is located;
[0008] Among them, the instance human body parsing network obtains a human body parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human body parsing matrix to obtain an instance feature matrix of the scene image.
[0009] The embodiment of the present invention provides a pedestrian re-identification device, which is used to find scene images in which all target pedestrians appear in a required scene according to a given target pedestrian. The device includes:
[0010] An instance feature matrix acquisition module is used to input the acquired scene image into the instance human body parsing network to obtain the instance feature matrix of the scene image;
[0011] A similarity calculation module, used to calculate the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object;
[0012] an identification module, configured to determine that the scene image is a scene image of a scene where a target object is located when the similarity is greater than a similarity threshold;
[0013] Among them, the instance human body parsing network obtains a human body parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human body parsing matrix to obtain an instance feature matrix of the scene image.
[0014] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned pedestrian re-identification method when executing the computer program.
[0015] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned pedestrian re-identification method is implemented.
[0016] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned pedestrian re-identification method is implemented.
[0017] In the embodiment of the present invention, after the scene image is acquired, it is input into the instance human body parsing network to obtain the instance feature matrix of the scene image; the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object is calculated; when the similarity is greater than the similarity threshold, the scene image is determined to be the scene image of the scene where the target object is located; wherein the instance human body parsing network obtains the human body parsing matrix and the pedestrian instance segmentation matrix corresponding to the preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human body parsing matrix to obtain the instance feature matrix of the scene image. Compared with the technical solution of only using the face information in the image for pedestrian re-identification in the prior art, the embodiment of the present invention proposes to use the instance human body parsing network to perform feature vector analysis, that is, to focus on the fine-grained components of the human body and to mark the number of the human body to which it belongs, that is, to analyze the fine-grained components of the human body of the target pedestrian from the multi-person image; in addition, the instance human body parsing network proposed in the embodiment of the present invention also considers the preset pixel point coordinates to obtain an accurate pedestrian instance segmentation matrix, thereby accurately determining whether the input scene image is the scene image of the scene where the target object is located, and achieving high-precision pedestrian re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. 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 creative work. In the drawings:
[0019] Figure 1 Flow chart of a pedestrian re-identification method according to an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of a human body analysis network according to an embodiment of the present invention;
[0021] Figure 3 It is a flow chart of obtaining an instance feature matrix by using an instance human body parsing network in an embodiment of the present invention;
[0022] Figure 4 A flowchart of obtaining a pedestrian instance segmentation matrix in an embodiment of the present invention;
[0023] Figure 5 Schematic diagram of a pedestrian re-identification device according to an embodiment of the present invention;
[0024] Figure 6 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0026] First, the terms involved in the present invention are explained.
[0027] Semantic segmentation: Pixel-level classification of images, that is, labeling the semantic category of each pixel in the image. Segmentation performance will directly affect subsequent image processing tasks.
[0028] Human body analysis: Perform semantic segmentation on pedestrians in the image and analyze them into different semantic components, such as hair, arms, tops, legs and other fine-grained components.
[0029] Human instance segmentation: Segment different human instance regions for multi-person images without paying attention to the internal structure of the human body.
[0030] Instance-based human body parsing: It is a combination of human body parsing and human body instance segmentation. It can not only distinguish different human body instances, but also parse out the fine-grained component information of the human body.
[0031] Person re-identification: Retrieve the target object in all images or videos based on the target object.
[0032] Figure 1 The flowchart of the pedestrian re-identification method according to an embodiment of the present invention includes:
[0033] Step 101, after acquiring the scene image, input it into the instance human body parsing network to obtain the instance feature matrix of the scene image;
[0034] Step 102, calculating the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object;
[0035] Step 103, when the similarity is greater than a similarity threshold, determining that the scene image is a scene image of a scene where a target object is located;
[0036] Among them, the instance human body parsing network obtains a human body parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human body parsing matrix to obtain an instance feature matrix of the scene image.
[0037] In the embodiment of the present invention, compared with the technical solution in the prior art that only uses the facial information in the image to perform pedestrian re-identification, the embodiment of the present invention proposes to use an instance human body parsing network to perform feature vector analysis, that is, it pays attention to the fine-grained components of the human body and marks the number of the human body to which it belongs, that is, the fine-grained components of the human body of the target pedestrian can be analyzed from multi-person images; in addition, the instance human body parsing network proposed in the embodiment of the present invention also considers the preset pixel point coordinates to obtain an accurate pedestrian instance segmentation matrix, thereby accurately determining whether the input scene image is a scene image of the scene where the target object is located, thereby achieving high-precision pedestrian re-identification.
[0038] The inventors found that since in real scenes, images of multiple people often appear, it is often necessary to perform human body analysis by distinguishing different instances. Instance-level human body analysis of multiple people's scene images is a very important task in the fields of autonomous driving, monitoring, human weight recognition, etc. For example, in the case of severe facial occlusion, difficult posture entanglement or low resolution, the fine-grained components of instance-level human body analysis can be used to assist further analysis of the difficult-to-identify areas.
[0039] Human body parsing is the result of directly segmenting fine-grained parts of the human body without distinguishing each instance. Human body instance segmentation distinguishes each human body but does not care about the structure of the human body. Instance-level human body parsing is a synthetic expression of the results of human body parsing and human body instance segmentation. Human body parsing provides information about fine-grained parts of the human body, and human body instance segmentation distinguishes different human body regions. Therefore, for each pixel point in the result of instance-level human body parsing, it is labeled with which type of fine-grained part it belongs to and the number of the human body it belongs to.
[0040] When performing instance segmentation on the human body, the most commonly used method is the Mask R-CNN type. However, when multiple people in an image are entangled or occluded, the entangled or occluded area contains complex multi-person area information, and there is often an error of confusing and classifying them into an instance area. Another common method is to learn an embedding space, in which the feature vectors of pixels of the same class are close, and the feature vectors of pixels of different classes are far away, and then use post-processing to cluster to obtain different instances. This type of method can obtain relatively accurate instance area distinction for severe entanglement or occlusion, but it requires heuristic post-processing for clustering, which is relatively complicated. Therefore, the embodiment of the present invention adopts an instance human body parsing network, and the instance human body parsing network obtains a human body parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and the pedestrian instance segmentation matrix and the human body parsing matrix are fused to obtain an instance feature matrix of the scene image. Since the preset pixel point coordinates are taken into account, an accurate pedestrian instance segmentation matrix is obtained, thereby accurately determining whether the input scene image is a scene image of the scene where the target object is located, and achieving high-precision pedestrian re-identification.
[0041] Figure 2 is a schematic diagram of an example human body analysis network in an embodiment of the present invention, Figure 3 Flowchart of obtaining an instance feature matrix by using an instance human body parsing network in an embodiment of the present invention. In one embodiment, the instance human body parsing network includes an instance convolutional network and a human body parsing network;
[0042] The step of obtaining the instance feature matrix of the scene image by the instance human body parsing network comprises:
[0043] Step 301, obtaining a pedestrian instance segmentation matrix based on preset pixel coordinates and an instance convolutional network;
[0044] Step 302, obtaining a human body parsing matrix based on the scene image and the human body parsing network;
[0045] Step 303: Fuse the pedestrian instance segmentation matrix and the human body analysis matrix to obtain an instance feature matrix of the scene image.
[0046] Figure 4 The flowchart of obtaining a pedestrian instance segmentation matrix in an embodiment of the present invention is shown in FIG. 1 . In one embodiment, the instance human body parsing network further includes a backbone network, a relative coordinate convolution network, and a feature mapping network;
[0047] Based on the preset pixel coordinates and instance convolutional network, the pedestrian instance segmentation matrix is obtained, including:
[0048] Step 401, input the scene image into the backbone network to obtain the backbone feature matrix;
[0049] Step 402, input the preset pixel point coordinates into the relative coordinate convolution network to generate two feature maps;
[0050] Step 403, concatenating the main feature matrix and the two feature maps to obtain a first feature matrix;
[0051] Step 404, based on the preset pixel coordinates, extracting a coordinate feature vector including the preset pixel coordinates from the backbone feature matrix, and inputting the coordinate feature vector into a feature mapping network to obtain a second feature matrix;
[0052] Step 405: Input the first feature matrix and the second feature matrix into the instance convolutional network to obtain a pedestrian instance segmentation matrix.
[0053] In one embodiment, obtaining a human body parsing matrix based on a scene image and a human body parsing network includes:
[0054] The backbone feature matrix obtained based on the scene image is input into the human body parsing network to obtain the human body parsing matrix.
[0055] In one embodiment, the preset pixel point coordinates are obtained based on human body posture high response point information.
[0056] Among them, the high response point information of human posture is obtained through the SimplePose model trained on the COCO dataset.
[0057] In one embodiment, the backbone network adopts a scene analysis network;
[0058] The feature mapping network includes a plurality of fully connected layers;
[0059] The human body parsing network adopts multi-layer convolution, wherein the number of output channels of the last layer of multi-layer convolution corresponds to the number of fine-grained components of human body parsing.
[0060] In one embodiment, the scene analysis network adopts a PSPNet network.
[0061] Among them, for the preset pixel coordinates (x, y), the vector of the coordinate points is taken through linear interpolation to obtain the coordinate feature vector Q(x, y), and then it is sent to the feature mapping network. The feature mapping network maps the vector Q(x, y) to the embedding space, outputs the second feature matrix E(x, y), and then sends it to the instance convolution network, so that the instance convolution network can finally output the instance mask corresponding to the preset coordinate pixel point, that is, the pedestrian instance segmentation matrix. The feature mapping network can extract the second feature matrix corresponding to the preset pixel coordinates, representing the specific expression of the preset pixel point, and help cluster the pedestrian instance pixels. In general, the number of layers of the human body parsing network is determined according to the actual situation. For example, seven layers are used in the embodiment of the present invention.
[0062] In one embodiment, the relative coordinate convolutional network includes a first additional channel and a second additional channel;
[0063] The first additional channel and the second additional channel are generated for preset pixel coordinates, wherein the first additional channel is used for x coordinates and the second additional channel is used for y coordinates;
[0064] The values of the first additional channel and the second additional channel are linearly scaled to [-1, +1], where -1 corresponds to xR or yR, +1 corresponds to x+R or y+R, and R is the hyperparameter radius.
[0065] When the first extra channel is used for x-coordinates, the first row is filled with 0, the second row is filled with 1, the third row is filled with 2, and so on; when the second extra channel is used for y-coordinates, the columns are filled in the same way as the x-coordinates. R is roughly set to the maximum size of the instance object.
[0066] In one embodiment, the instance convolutional network is an adaptive instance standard convolutional network, wherein the expression of adaptive instance standardization in the adaptive instance standard convolutional network is as follows:
[0067]
[0068] Among them, AIN(M,E) is the pedestrian instance segmentation matrix; μ(M) and σ(M) are the mean and variance of the first feature matrix or the previous convolution layer of the current convolution layer of the adaptive instance standard convolution layer network, and μ(E) and σ(E) are the mean and variance of the second feature matrix, respectively.
[0069] If the current convolutional layer is the first layer, then μ(M) and σ(M) are the mean and variance of the first feature matrix respectively. If the current convolutional layer is the convolutional layer after the first layer, then μ(M) and σ(M) are the mean and variance of the previous convolutional layer respectively. This is equivalent to first denormalizing the previous convolutional layer and then normalizing it to the second feature matrix E(x, y) output by the feature mapping network. The second feature vector E(x, y) corresponds to the pixel point of the preset pixel point coordinates, so the instance area corresponding to the preset pixel point can be obtained, that is, the pedestrian instance segmentation matrix.
[0070] In one embodiment, the example human body parsing network uses the following loss function during training:
[0071] L=λ I L I +λ p L P +λ S L S +L F
[0072] L F = -α(1-z) γ log(z)
[0073] Where L is the loss function of the instance human parsing network; z is the instance feature matrix; L I is the instance edge guidance loss; L P and L S are the losses of the human parsing matrix and pedestrian instance segmentation matrix respectively; L F is the loss of the instance feature matrix, α is the weight for adjusting positive and negative samples, α∈[0,1]; γ is the weight for adjusting difficult and easy classification samples, γ≥0; λ P , S and λ I They are the balance parameters of the loss of the human parsing matrix, the loss of the pedestrian instance segmentation matrix, and the instance edge-guided loss.
[0074] In one embodiment, the expression of the example edge guided loss is as follows:
[0075]
[0076] Among them, L I is the instance edge guided loss; R is the window size, C is the number of categories, and N is the batch training size; det(·) is the matrix determinant, ∑ G|Y is the posterior covariance matrix of G given the matrix Y.
[0077] In the above embodiment, the edge information of the human body is first extracted from the pedestrian instance segmentation matrix, and then for each edge information pixel, a square window centered on it is set, and the edge information pixel is corresponded to the human body parsing matrix and the label used for training the instance human body parsing network, and its eigenvalues are extracted respectively to generate two distributions. Finally, the similarity between the two distributions is maximized, so that the local area of the edge information pixel is most similar between the two results, and the human body parsing matrix is more accurate under the guidance of the edge of the pedestrian instance segmentation matrix.
[0078] The extracted square window size is R×R, R is set to 3, and the total number of edge information pixels is N=R×R, which corresponds to Y=[y1,y2,...,y N ], the pixel value in the label G=[g1,g2,...,g N ]. Then maximize the similarity between them as the loss function. In the above formula, when ∑ G|Y When it is a positive definite matrix, log(det(∑ G|Y )) is a concave function, which enables the loss function to be optimized.
[0079] In summary, in the method proposed in the embodiment of the present invention, after the scene image is acquired, it is input into the instance human body parsing network to obtain the instance feature matrix of the scene image; the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object is calculated; when the similarity is greater than the similarity threshold, the scene image is determined to be the scene image of the scene where the target object is located; wherein the instance human body parsing network obtains the human body parsing matrix and the pedestrian instance segmentation matrix corresponding to the preset pixel point coordinates based on the scene image, and the pedestrian instance segmentation matrix and the human body parsing matrix are merged to obtain the instance feature matrix of the scene image. Compared with the technical solution of only using the face information in the image for pedestrian re-identification in the prior art, the embodiment of the present invention proposes to use the instance human body parsing network to perform feature vector analysis, that is, the fine-grained components of the human body are paid attention to and the number of the human body to which it belongs is marked, that is, the fine-grained components of the human body of the target pedestrian can be analyzed from the multi-person image; in addition, the instance human body parsing network proposed in the embodiment of the present invention also considers the preset pixel point coordinates to obtain an accurate pedestrian instance segmentation matrix, thereby accurately determining whether the input scene image is the scene image of the scene where the target object is located, and achieving high-precision pedestrian re-identification. In addition, the embodiment of the present invention uses the human body posture high response point information as the preset pixel point coordinate input information, further improving the accuracy of the instance feature matrix. In addition, the instance human body parsing network proposed in the embodiment of the present invention applies the instance edge guidance loss during training, so that the human body parsing matrix is more accurate under the edge guidance of the pedestrian instance segmentation matrix.
[0080] The present invention also provides a pedestrian re-identification device, as described in the following embodiments. Since the principle of the device to solve the problem is similar to that of the pedestrian re-identification method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0081] Figure 5 This is a schematic diagram of a pedestrian re-identification device according to an embodiment of the present invention, comprising:
[0082] The instance feature matrix acquisition module 501 is used to input the acquired scene image into the instance human body parsing network to obtain the instance feature matrix of the scene image;
[0083] A similarity calculation module 502 is used to calculate the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object;
[0084] An identification module 503, configured to determine that the scene image is a scene image of a scene where a target object is located when the similarity is greater than a similarity threshold;
[0085] Among them, the instance human body parsing network obtains a human body parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human body parsing matrix to obtain an instance feature matrix of the scene image.
[0086] In one embodiment, the example human body parsing network includes an example convolutional network and a human body parsing network;
[0087] The step of obtaining the instance feature matrix of the scene image by the instance human body parsing network comprises:
[0088] Based on the preset pixel coordinates and instance convolutional network, a pedestrian instance segmentation matrix is obtained;
[0089] Based on the scene image and the human body parsing network, a human body parsing matrix is obtained;
[0090] The pedestrian instance segmentation matrix and the human body parsing matrix are fused to obtain the instance feature matrix of the scene image.
[0091] In one embodiment, the example human body parsing network further includes a backbone network, a relative coordinate convolution network, and a feature mapping network;
[0092] Based on the preset pixel coordinates and instance convolutional network, the pedestrian instance segmentation matrix is obtained, including:
[0093] Input the scene image into the backbone network to obtain the backbone feature matrix;
[0094] Input the preset pixel coordinates into the relative coordinate convolution network to generate two feature maps;
[0095] The backbone feature matrix and the two feature maps are concatenated to obtain the first feature matrix;
[0096] Based on the preset pixel point coordinates, a coordinate feature vector including the preset pixel point coordinates is extracted from the backbone feature matrix, and inputted into the feature mapping network to obtain a second feature matrix;
[0097] The first feature matrix and the second feature matrix are input into the instance convolutional network to obtain the pedestrian instance segmentation matrix.
[0098] In one embodiment, obtaining a human body parsing matrix based on a scene image and a human body parsing network includes:
[0099] The backbone feature matrix obtained based on the scene image is input into the human body parsing network to obtain the human body parsing matrix.
[0100] In one embodiment, the preset pixel point coordinates are obtained based on human body posture high response point information.
[0101] In one embodiment, the backbone network adopts a scene analysis network;
[0102] The feature mapping network includes a plurality of fully connected layers;
[0103] The human body parsing network adopts multi-layer convolution, wherein the number of output channels of the last layer of multi-layer convolution corresponds to the number of fine-grained components of human body parsing.
[0104] In one embodiment, the scene analysis network adopts a PSPNet network.
[0105] In one embodiment, the relative coordinate convolutional network includes a first additional channel and a second additional channel;
[0106] The first additional channel and the second additional channel are generated for preset pixel coordinates, wherein the first additional channel is used for x coordinates and the second additional channel is used for y coordinates;
[0107] The values of the first additional channel and the second additional channel are linearly scaled to [-1, +1], where -1 corresponds to xR or yR, +1 corresponds to x+R or y+R, and R is the hyperparameter radius.
[0108] In one embodiment, the instance convolutional network is an adaptive instance standard convolutional network, wherein the expression of adaptive instance standardization in the adaptive instance standard convolutional network is as follows:
[0109]
[0110] Among them, AIN(M,E) is the pedestrian instance segmentation matrix; μ(M) and σ(M) are the mean and variance of the first feature matrix or the previous convolution layer of the current convolution layer of the adaptive instance standard convolution layer network, and μ(E) and σ(E) are the mean and variance of the second feature matrix, respectively.
[0111] In one embodiment, the example human body parsing network uses the following loss function during training:
[0112] L=λ I L I +λ p L P +λ S L S +L F
[0113] L F = -α(1-y) γ log(y)
[0114] Where L is the loss function of the instance human parsing network; y is the instance feature matrix; L I is the instance edge guidance loss; LP and L S are the losses of the human parsing matrix and pedestrian instance segmentation matrix respectively; L F is the loss of the instance feature matrix, α is the weight for adjusting positive and negative samples, α∈[0,1]; γ is the weight for adjusting difficult and easy classification samples, γ≥0; λ P , S and λ I They are the balance parameters of the loss of the human parsing matrix, the loss of the pedestrian instance segmentation matrix, and the instance edge-guided loss.
[0115] In one embodiment, the expression of the example edge guided loss is as follows:
[0116]
[0117] Among them, L I is the instance edge guided loss; R is the window size, C is the number of categories, and N is the batch training size; det(·) is the matrix determinant, ∑ G|Y is the posterior covariance matrix of G given the matrix Y.
[0118] In summary, in the device proposed in the embodiment of the present invention, after the scene image is acquired, it is input into the instance human body parsing network to obtain the instance feature matrix of the scene image; the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object is calculated; when the similarity is greater than the similarity threshold, the scene image is determined to be the scene image of the scene where the target object is located; wherein the instance human body parsing network obtains the human body parsing matrix and the pedestrian instance segmentation matrix corresponding to the preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human body parsing matrix to obtain the instance feature matrix of the scene image. Compared with the technical solution of only using the face information in the image for pedestrian re-identification in the prior art, the embodiment of the present invention proposes to use the instance human body parsing network to perform feature vector analysis, that is, it pays attention to the fine-grained components of the human body and marks the number of the human body to which it belongs, that is, the fine-grained components of the human body of the target pedestrian can be analyzed from the multi-person image; in addition, the instance human body parsing network proposed in the embodiment of the present invention also considers the preset pixel point coordinates to obtain an accurate pedestrian instance segmentation matrix, thereby accurately determining whether the input scene image is the scene image of the scene where the target object is located, and achieving high-precision pedestrian re-identification. In addition, the embodiment of the present invention uses the human body posture high response point information as the preset pixel point coordinate input information, further improving the accuracy of the instance feature matrix. In addition, the instance human body parsing network proposed in the embodiment of the present invention applies the instance edge guidance loss during training, so that the human body parsing matrix is more accurate under the edge guidance of the pedestrian instance segmentation matrix.
[0119] An embodiment of the present invention further provides a computer device, Figure 6 Schematic diagram of a computer device in an embodiment of the present invention. The computer device 600 includes a memory 610, a processor 620, and a computer program 630 stored in the memory 610 and executable on the processor 620. When the processor 620 executes the computer program 630, the above-mentioned pedestrian re-identification method is implemented.
[0120] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned pedestrian re-identification method is implemented.
[0121] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned pedestrian re-identification method is implemented.
[0122] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0124] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0126] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A pedestrian re-identification method, It is characterized in that include: After acquiring the scene image, it is input into the instance human body parsing network to obtain the instance feature matrix of the scene image; Calculate the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object; When the similarity is greater than a similarity threshold, determining that the scene image is a scene image of a scene where a target object is located; The example human parsing network obtains a human parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human parsing matrix to obtain an instance feature matrix of the scene image; The example human body parsing network includes an example convolutional network and a human body parsing network; The step of obtaining the instance feature matrix of the scene image by the instance human body parsing network includes: obtaining a pedestrian instance segmentation matrix based on preset pixel coordinates and the instance convolution network; obtaining a human body parsing matrix based on the scene image and the human body parsing network; fusing the pedestrian instance segmentation matrix and the human body parsing matrix to obtain the instance feature matrix of the scene image; The example human body parsing network also includes a backbone network, a relative coordinate convolution network and a feature mapping network; Based on the preset pixel point coordinates and the instance convolution network, a pedestrian instance segmentation matrix is obtained, including: inputting the scene image into the backbone network to obtain a backbone feature matrix; inputting the preset pixel point coordinates into the relative coordinate convolution network to generate two feature maps; splicing the backbone feature matrix and the two feature maps to obtain a first feature matrix; based on the preset pixel point coordinates, extracting a coordinate feature vector containing the preset pixel point coordinates from the backbone feature matrix, and inputting it into the feature mapping network to obtain a second feature matrix; Input the first feature matrix and the second feature matrix into the instance convolutional network to obtain a pedestrian instance segmentation matrix; Based on the scene image and the human body parsing network, a human body parsing matrix is obtained, including: inputting a backbone feature matrix obtained based on the scene image into the human body parsing network to obtain a human body parsing matrix; The preset pixel point coordinates are obtained based on the human body posture high response point information; The backbone network adopts a scene analysis network; the feature mapping network includes multiple fully connected layers; the human body parsing network adopts multi-layer convolution, wherein the number of output channels of the last layer of multi-layer convolution corresponds to the number of fine-grained components of human body parsing.
2. The method according to claim 1, It is characterized in that The scene analysis network adopts the PSPNet network.
3. The method according to claim 1, It is characterized in that The relative coordinate convolutional network includes a first additional channel and a second additional channel; The first additional channel and the second additional channel are generated for preset pixel coordinates, wherein the first additional channel is used for x coordinates and the second additional channel is used for y coordinates; The values of the first additional channel and the second additional channel are linearly scaled to [-1, +1], where -1 corresponds to xR or yR, +1 corresponds to x+R or y+R, and R is the hyperparameter radius.
4. The method according to claim 1, It is characterized in that The instance convolution network is an adaptive instance standard convolution network, wherein the expression of adaptive instance standardization in the adaptive instance standard convolution network is as follows: Among them, AIN(M,E) is the pedestrian instance segmentation matrix; μ(M) and σ(M) are the mean and variance of the first feature matrix or the previous convolution layer of the current convolution layer of the adaptive instance standard convolution layer network, and μ(E) and σ(E) are the mean and variance of the second feature matrix, respectively.
5. The method according to claim 1, It is characterized in that The example human body parsing network uses the following loss function during training: L=λ I L I +λ p L P +λ S L S +L F L F =-α(1-y) γ log(y) Where L is the loss function of the instance human parsing network; y is the instance feature matrix; L I is the instance edge guidance loss; L P and L S are the losses of the human parsing matrix and pedestrian instance segmentation matrix respectively; L F is the loss of the instance feature matrix, α is the weight for adjusting positive and negative samples, α∈[0,1]; γ is the weight for adjusting difficult and easy classification samples, γ≥0; λ P , S and λ I They are the balance parameters of the loss of the human parsing matrix, the loss of the pedestrian instance segmentation matrix, and the instance edge-guided loss.
6. The method according to claim 5, It is characterized in that The expression of instance edge guided loss is as follows: Among them, L I is the instance edge guided loss; R is the window size, C is the number of categories, and N is the batch training size; det(·) is the matrix determinant, ∑ G|Y is the posterior covariance matrix of G conditioned on the given matrix Y.
7. A pedestrian re-identification device, It is characterized in that include: An instance feature matrix acquisition module is used to input the acquired scene image into the instance human body parsing network to obtain the instance feature matrix of the scene image; A similarity calculation module, used to calculate the similarity between the instance feature matrix of the scene image and the instance feature matrix of the target object; an identification module, configured to determine that the scene image is a scene image of a scene where a target object is located when the similarity is greater than a similarity threshold; The example human parsing network obtains a human parsing matrix and a pedestrian instance segmentation matrix corresponding to preset pixel point coordinates based on the scene image, and fuses the pedestrian instance segmentation matrix and the human parsing matrix to obtain an instance feature matrix of the scene image; The example human body parsing network includes an example convolutional network and a human body parsing network; The step of obtaining the instance feature matrix of the scene image by the instance human body parsing network includes: obtaining a pedestrian instance segmentation matrix based on preset pixel coordinates and the instance convolution network; obtaining a human body parsing matrix based on the scene image and the human body parsing network; fusing the pedestrian instance segmentation matrix and the human body parsing matrix to obtain the instance feature matrix of the scene image; The example human body parsing network also includes a backbone network, a relative coordinate convolution network and a feature mapping network; Based on the preset pixel point coordinates and the instance convolution network, a pedestrian instance segmentation matrix is obtained, including: inputting the scene image into the backbone network to obtain a backbone feature matrix; inputting the preset pixel point coordinates into the relative coordinate convolution network to generate two feature maps; splicing the backbone feature matrix and the two feature maps to obtain a first feature matrix; based on the preset pixel point coordinates, extracting a coordinate feature vector containing the preset pixel point coordinates from the backbone feature matrix, and inputting it into the feature mapping network to obtain a second feature matrix; Input the first feature matrix and the second feature matrix into the instance convolutional network to obtain a pedestrian instance segmentation matrix; Based on the scene image and the human body parsing network, a human body parsing matrix is obtained, including: inputting a backbone feature matrix obtained based on the scene image into the human body parsing network to obtain a human body parsing matrix; The preset pixel point coordinates are obtained based on the human body posture high response point information; The backbone network adopts a scene analysis network; the feature mapping network includes multiple fully connected layers; the human body parsing network adopts multi-layer convolution, wherein the number of output channels of the last layer of multi-layer convolution corresponds to the number of fine-grained components of human body parsing.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
