Progressive granularity pedestrian retrieval method and device
By extracting features at three levels: global, component and pixel, it solves the problem of insufficient pedestrian feature discriminability in existing pedestrian retrieval methods, achieves more refined pedestrian identity recognition, and improves the performance of pedestrian retrieval.
Patent Information
- Application Number
- CN202410490805.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-04-23
AI Technical Summary
Due to factors such as occlusion, shooting angle, and lighting changes, existing pedestrian retrieval methods have insufficient discriminability of pedestrian features, making it difficult to effectively identify occluded or partially occluded pedestrians.
The progressive granularity pedestrian retrieval method is used to extract features at three levels: global, component, and pixel to provide rich identity identification information, including global granularity features, component granularity features, and pixel granularity features, which are used to train pedestrian retrieval network models and improve pedestrian Retrieval performance.
It effectively improves the performance of pedestrian retrieval, especially in occlusion situations, it can achieve more precise feature description and identification, and improve the accuracy of pedestrian identification.
Smart Images

Figure CN118587734A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic information technology, and in particular to a progressive granularity pedestrian retrieval method and device. Background Art
[0002] Pedestrian retrieval (Pedestrian Re-ID) technology aims to identify the identity of a target pedestrian from multiple different camera views. This technology has great potential in many fields such as intelligent video surveillance, intelligent security, behavior analysis and human-computer interaction, and has attracted increasing attention in recent years. Pedestrian retrieval is very challenging due to factors such as background clutter, partial occlusion, shooting angle, lighting and body posture changes.
[0003] Existing pedestrian retrieval methods mainly extract the features of pedestrian images and perform retrieval by calculating the distance between features. However, in reality, pedestrians are often blocked by objects such as cars and suitcases, which results in the loss of some of the human body features and insufficient identity identification information provided by the features. For example, the occlusion problem will cause the pedestrian's legs in the image to be complex, which may be a complete leg or only a part, and the existing leg features are difficult to describe this situation, so the pedestrian features are not discriminative enough. Summary of the invention
[0004] The present invention provides a progressive granularity pedestrian retrieval method and device to solve the defect of insufficient identification of pedestrian features in the prior art. The present invention provides rich identity identification information by extracting progressive granularity features at three levels: global, component and pixel, and can effectively improve the performance of pedestrian retrieval.
[0005] The present invention provides a progressive granularity pedestrian retrieval method, comprising: determining a feature map of a training sample; the training sample is a pedestrian sample in a training set; classifying pixel features of the feature map to obtain a probability map; performing progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; training a pedestrian retrieval network model according to the progressive granularity pedestrian retrieval features, repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features and training the model until the number of training rounds for the training set reaches a preset number of rounds, thereby obtaining a trained pedestrian retrieval network model; performing progressive granularity pedestrian retrieval according to a preset pedestrian retrieval algorithm based on the trained pedestrian retrieval network model.
[0006] According to a progressive granularity pedestrian retrieval method provided by the present invention, determining the feature map of the training sample includes: inputting the training sample into the pedestrian retrieval network model to obtain the feature map of the training sample.
[0007] According to a progressive granularity pedestrian retrieval method provided by the present invention, the pixel features of the feature map are classified to obtain a probability map, including: inputting the training sample into a human foreground segmentation network to obtain a foreground pseudo-label; based on the foreground pseudo-label, performing K-means clustering on the pixel features belonging to the foreground on the feature map to determine the pixel pseudo-label; using the foreground pseudo-label and the pixel pseudo-label to train the pixel feature classification network, repeatedly and iteratively executing the foreground segmentation network step, the clustering step and the network training step until the foreground pseudo-label and the pixel pseudo-label are determined in the training set to obtain a trained pixel feature classification network; inputting the feature map into the trained pixel feature classification network to obtain a foreground probability map and a component probability map.
[0008] According to a progressive granularity pedestrian retrieval method provided by the present invention, progressive granularity feature extraction is performed based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features, including: taking a set of pixel features belonging to the foreground on the feature map as the pixel granularity feature; weighted averaging the pixel features on the feature map by the component probability map to obtain the component granularity feature; weighted averaging the pixel features on the feature map by the foreground probability map to obtain the global granularity feature.
[0009] According to a progressive granularity pedestrian retrieval method provided by the present invention, the pedestrian retrieval network model is trained according to the progressive granularity pedestrian retrieval features to obtain the trained pedestrian retrieval network model, including: determining the classification loss function and the global granularity feature similarity of the global granularity feature according to the global granularity feature; determining the classification loss function and the component granularity feature similarity of the component granularity feature according to the component granularity feature; determining the pixel granularity feature similarity according to the pixel granularity feature; determining the triplet loss function based on the global granularity feature similarity, the component granularity feature similarity and the pixel granularity feature similarity; training the pedestrian retrieval network model based on the classification loss function of the global granularity feature, the classification loss function of the component granularity feature and the triplet loss function to obtain the trained pedestrian retrieval network model.
[0010] According to a progressive granularity pedestrian retrieval method provided by the present invention, progressive granularity pedestrian retrieval is performed based on the trained pedestrian retrieval network model and a preset pedestrian retrieval algorithm, including: based on the global granularity feature similarity between the image to be retrieved and all the images in the sample set, selecting images whose global granularity feature similarity is greater than a preset global similarity threshold as first-level images; based on the component granularity feature similarity between the image to be retrieved and the first-level images, selecting images whose component granularity feature similarity is greater than a preset component similarity threshold as second-level images; based on the pixel granularity feature similarity between the image to be retrieved and the second-level images, selecting images whose pixel granularity feature similarity is greater than a preset pixel similarity threshold as progressive granularity pedestrian retrieval images.
[0011] The present invention also provides a progressive granularity pedestrian retrieval device, comprising: a feature map determination module, used to determine the feature map of a training sample; the training sample is a pedestrian sample in a training set; a feature classification module, used to classify the pixel features of the feature map to obtain a probability map; a feature extraction module, used to perform progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; a model training module, used to train a pedestrian retrieval network model according to the progressive granularity pedestrian retrieval features, repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features and training the model until the number of training rounds for the training set reaches a preset number of rounds, thereby obtaining a trained pedestrian retrieval network model; a pedestrian retrieval module, used to perform progressive granularity pedestrian retrieval based on the trained pedestrian retrieval network model according to a preset pedestrian retrieval algorithm.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the progressive granularity pedestrian retrieval method as described above is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the progressive granularity pedestrian retrieval method as described above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the progressive granularity pedestrian retrieval method as described above is implemented.
[0015] The present invention provides a progressive granularity pedestrian retrieval method and device, the method comprising: determining a feature map of a training sample; classifying pixel features of the feature map to obtain a probability map; extracting progressive granularity features based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; training a pedestrian retrieval network model according to the progressive granularity pedestrian retrieval features to obtain a trained pedestrian retrieval network model; performing progressive granularity pedestrian retrieval according to a preset pedestrian retrieval algorithm based on the trained pedestrian retrieval network model. The present invention provides rich identity authentication information by extracting progressive granularity features at three levels: global, component and pixel, and can effectively improve the performance of pedestrian retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flowchart of a progressive granularity pedestrian retrieval method provided by the present invention;
[0018] Figure 2 This is one of the principle schematic diagrams of a progressive granularity pedestrian retrieval method provided by the present invention;
[0019] Figure 3 This is the second principle schematic diagram of a progressive granularity pedestrian retrieval method provided by the present invention;
[0020] Figure 4 It is a structural schematic diagram of a progressive granularity pedestrian retrieval device provided by the present invention;
[0021] Figure 5 It is a structural schematic diagram of another progressive granularity pedestrian retrieval device provided by the present invention;
[0022] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] Pedestrians are an important target with important information value. Identifying pedestrians, retrieving target pedestrians at a specific time and place, and understanding the movement trajectory of target pedestrians are of great significance to public security, new retail and other fields.
[0025] Existing pedestrian retrieval (pedestrian re-identification technology) methods all extract features from pedestrian images and perform retrieval by calculating the distance between features. From the perspective of features, features can be divided into manually designed features and deep learning features. At present, the performance of deep features far exceeds that of manually designed features, and the performance of deep component features is better than that of deep global features. However, component features are usually coarse-grained features such as the head, upper body, and legs, which cannot handle finer-grained comparisons, and the discriminability provided by component features is insufficient.
[0026] Please refer to Figure 1 , Figure 1 A schematic flow chart of a progressive granularity pedestrian retrieval method provided by the present invention.
[0027] Please refer to Figure 2 , Figure 2 This is one of the principle schematic diagrams of a progressive granularity pedestrian retrieval method provided by the present invention.
[0028] Please refer to Figure 3 , Figure 3 The second schematic diagram of the principle of a progressive granularity pedestrian retrieval method provided by the present invention.
[0029] Please refer to Figure 4 , Figure 4 A schematic structural diagram of a progressive granularity pedestrian retrieval device provided by the present invention.
[0030] In order to solve the technical problems existing in the prior art, the present invention provides a progressive granularity pedestrian retrieval method, comprising:
[0031] 101: Determine a feature map of a training sample; the training sample is a pedestrian sample in a training set;
[0032] 102: Classify the pixel features of the feature map to obtain a probability map;
[0033] 103: Extract progressive granularity features based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features;
[0034] 104: training the pedestrian retrieval network model according to the progressive granularity pedestrian retrieval features, and repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features, and training the model until the number of training rounds for the training set reaches a preset number, thereby obtaining a trained pedestrian retrieval network model;
[0035] 105:Based on the trained pedestrian retrieval network model, progressive granularity pedestrian retrieval is performed according to the preset pedestrian retrieval algorithm.
[0036] Inspired by the top-down visual cognition mechanism of human beings, the present invention provides a progressive granularity pedestrian retrieval method, including a pedestrian retrieval network model training stage and a pedestrian retrieval network model pedestrian retrieval stage. In the pedestrian retrieval network model training stage, the pedestrian convolution module is first used to determine the feature map of the training sample; then the pixel feature classification module classifies each pixel feature in the feature map to obtain a probability map; then the progressive granularity feature extraction module extracts global granularity features, component granularity features and pixel granularity features based on the feature map and the probability map, and repeatedly iterates for pedestrian retrieval network model training until all pictures in the training set have been trained for a preset round, and a trained pedestrian retrieval network model is obtained. Finally, based on the trained pedestrian retrieval network model, progressive granularity pedestrian retrieval is performed according to a preset pedestrian retrieval algorithm. In addition, in the process of pedestrian retrieval network model training, foreground pseudo labels and pixel pseudo labels can be repeatedly set for all pedestrians and all pictures in the training set, and this cycle process and the cycle process of training the pedestrian retrieval network model with progressive granularity features can be alternately iterated until a preset round is reached.
[0037] In summary, the method of the present invention can provide rich identity authentication information by extracting three hierarchical features from coarse-grained to fine-grained, namely global, component and pixel features. In particular, the features at the pixel granularity can achieve a more detailed description and make up for the shortcomings of the component granularity features.
[0038] Based on the above embodiments:
[0039] According to a progressive granularity pedestrian retrieval method provided by the present invention, determining a feature map of a training sample includes: inputting the training sample into a pedestrian retrieval network model to obtain a feature map of the training sample.
[0040] In order to obtain the feature map of the training sample, in this embodiment, firstly, the sample selection module selects appropriate training samples from the training set for the pedestrian retrieval network model training. For example, when determining the foreground pseudo-label and the pixel pseudo-label, the pedestrian identities in the training data are selected in sequence, and all images belonging to the same identity are selected each time. For the feature map acquisition step, p pedestrians can be randomly selected from the training data in each training batch, and m images are selected for each pedestrian. Then, the training samples are input into the deep convolutional neural network through the pedestrian convolution module to obtain the feature map. The deep convolutional neural network can be obtained by training the pedestrian retrieval (pedestrian re-identification) data with identity labels.
[0041] As a preferred embodiment, the pixel features of the feature map are classified to obtain a probability map, including: inputting the training sample into a human foreground segmentation network to obtain a foreground pseudo-label; based on the foreground pseudo-label, performing K-means clustering on the pixel features belonging to the foreground on the feature map to determine the pixel pseudo-label; using the foreground pseudo-label and the pixel pseudo-label to train the pixel feature classification network, repeatedly iterating the steps of foreground segmentation network, clustering and network training until the foreground pseudo-label and the pixel pseudo-label are determined for the training set, and obtaining a trained pixel feature classification network; inputting the feature map into the trained pixel feature classification network to obtain a foreground probability map and a component probability map.
[0042] In order to obtain the probability map, in this embodiment, the training samples are first input into the human foreground segmentation network through the pedestrian foreground segmentation module, and the selected samples are segmented into the pedestrian foreground area to obtain the foreground pseudo-label indicating the foreground area. The pedestrian foreground segmentation network is trained on additional data and can be used directly. Then, based on the foreground pseudo-label obtained by the pedestrian foreground segmentation module, the pixel pseudo-label module collects the pixel features belonging to the foreground on the feature map of all images of a pedestrian in the training data, and then performs K-means clustering to form K clusters corresponding to K predefined components. The spatial position center of the pixel features in each cluster on the feature map is calculated respectively, and they are sorted from top to bottom in the vertical direction, and numbered from 1 to K in sequence as the pixel pseudo-label indicating the component to which the foreground belongs. Afterwards, each pixel feature on the feature map is classified by the pixel feature classification module, and the probability of each pixel feature on the feature map belonging to the foreground and each component is identified to form a foreground probability map and a component probability map. The pixel feature classification module can be obtained by training the foreground pseudo-label obtained by the pedestrian foreground segmentation module and the pixel pseudo-label obtained by the pixel pseudo-label module.
[0043] As a preferred embodiment, progressive granularity feature extraction is performed based on feature maps and probability maps to obtain progressive granularity pedestrian retrieval features, including: taking a set of pixel features belonging to the foreground on the feature map as pixel granularity features; weighting the pixel features on the feature map with the component probability map to obtain component granularity features; and weighting the pixel features on the feature map with the foreground probability map to obtain global granularity features.
[0044] In order to obtain progressive granularity pedestrian retrieval features, in this embodiment, a progressive granularity feature extraction module is used to extract global granularity features, component granularity features, and pixel granularity features based on feature maps and probability maps, and used for classification training.
[0045] Specifically, for a pedestrian image, the extracted feature map is Where h and w represent the height and width of the feature map space, respectively, and d represents the dimension of the feature. The pixel feature classification module classifies each pixel feature on the feature map to obtain the foreground probability map: The component probability plot is Where K is the number of components.
[0046] For a pedestrian image, its pixel granularity feature is a set of pixel features belonging to the foreground on the feature map:
[0047] f pixel ={X(i,j)|F(i,j)>δ,i=1,2…,h,j=1,2,…,w}
[0048] Among them, f pixel is the pixel granularity feature, δ is a hyperparameter that can be adjusted according to the actual scene and data; i is the high index of the feature map, and j is the wide index of the feature map.
[0049] For a pedestrian image, the component granularity feature is obtained by weighted averaging the pixel features on the component probability map. There are K components in a picture, corresponding to K component features. Specifically, the component granularity feature belonging to the kth component is for:
[0050]
[0051] For a pedestrian image, the global granularity feature is obtained by weighted averaging the pixel features on the feature map of the foreground probability map. The global granularity feature f g for:
[0052]
[0053] As a preferred embodiment, a pedestrian retrieval network model is trained according to progressive granularity pedestrian retrieval features to obtain a trained pedestrian retrieval network model, including: determining a classification loss function of global granularity features and global granularity feature similarity according to global granularity features; determining a classification loss function of component granularity features and component granularity feature similarity according to component granularity features; determining pixel granularity feature similarity according to pixel granularity features; determining a triplet loss function based on global granularity feature similarity, component granularity feature similarity and pixel granularity feature similarity; training the pedestrian retrieval network model based on the classification loss function of global granularity features, the classification loss function of component granularity features and the triplet loss function to obtain a trained pedestrian retrieval network model.
[0054] Considering that the existing pedestrian retrieval methods usually calculate the Euclidean distance between features when performing feature comparison, when the pedestrian is partially occluded, feature misalignment is prone to occur. For example, when calculating the distance between a complete full-body pedestrian image and an occluded half-body pedestrian image, full-body pedestrian features and half-body pedestrian features are often used for comparison, resulting in feature misalignment. For another example, when comparing complete leg features with partial leg features, feature misalignment also occurs, which directly affects the retrieval performance. In order to solve the technical problems existing in the prior art, in this embodiment, a pedestrian retrieval network model is trained based on progressive granularity features through a progressive granularity retrieval module. Based on the feature alignment-based distance calculation method, when calculating similarity, the corresponding global / component / pixel feature similarity is considered, which solves the problem of feature misalignment in the case of occlusion and effectively improves the performance of pedestrian retrieval.
[0055] Specifically, for image m and image n, all progressive granularity features are first L2 normalized.
[0056] The global granular feature similarity between image m and image n is calculated as follows:
[0057]
[0058] Among them, s g is the global granular feature similarity, is the global granularity feature of image m, is the global granularity feature of image n.
[0059] When calculating the similarity of component granularity features, only the pedestrian components that are visible in both images are considered, and the similarity between the corresponding components in the two images is calculated. Finally, the similarity of component granularity is obtained through weighted average. For the kth component, its visible probability is When calculating the component granularity similarity between image m and image n, the calculation formula is as follows:
[0060]
[0061] Among them, s part is the similarity of component granularity features, represents the kth component feature of image m, q is the index of the component, is the visible probability of the kth component of image m, is the visible probability of the kth component of image n, is the component granularity feature of the kth component in image m, is the component granularity feature of the kth component in image n. It can be seen that when this formula calculates the similarity of component granularity features, only when the same component appears in two images will it make a greater contribution to the final component granularity feature similarity; when a component does not appear in an image, the component granularity feature similarity of the component will not be considered, thus achieving the alignment of component granularity features.
[0062] When calculating the similarity of pixel-level features, it is necessary to find the corresponding pixels between two pixel feature sets. The present invention models the process of finding corresponding pixels as an optimal transmission problem. Assume that the foreground pixel set of image m is There are N1 pixel features, denoted as The set of foreground pixels of image n There are N2 pixel features, denoted as gather and collection Optimal transmission strategy between It is obtained by optimizing the following problems:
[0063]
[0064]
[0065]
[0066] π ij ≥0,i=1,2,…,N1,j=1,2,…,N2
[0067] in, After obtaining the optimal transmission strategy, the calculation formula for the pixel granularity feature similarity between image m and image n is as follows:
[0068]
[0069] During training, for an image m, extract the global granularity features Then Input into the identity classifier to get the classification probability C is the number of pedestrians in the training set. Assuming that the identity label of image m is t, the classification loss function of the global granularity feature is,
[0070]
[0071] For image m, extract component granularity features for it at the same time k=1,2,…,K. Similar to the calculation method of the classification loss function of the global granularity feature, the classification loss function is calculated for each component feature and recorded as k=1,2,…,K.
[0072] The classification loss function of image m is,
[0073]
[0074] In addition to the classification loss, the triplet loss function is also used during training to optimize the pedestrian retrieval network model. Assuming that image m and image n have the same identity, and image u and image m have different identities, the triplet loss function is calculated as follows:
[0075]
[0076] Among them, s g (m,u) is the similarity of the global granularity features of image m and image u, s g (m,n) is the similarity of the global granularity features between image m and image n, ρ g It is a hyperparameter set for the similarity of global granularity features, and its value ranges from 0.2 to 0.5; s part (m,u) is the similarity of the component granularity features of image m and image u, s part (m,n) is the similarity of the component granularity features between image m and image n, ρ part It is a hyperparameter set for the similarity of component granularity features, and its value ranges from 0.2 to 0.5; s pixel (m,u) is the similarity of the pixel granularity features of image m and image u, s pixel (n,b) is the similarity of the pixel granularity features between image n and image n, ρ pixel It is a hyperparameter set for the similarity of pixel-size features, with a value between 0.2 and 0.5. During the final training, both the classification loss function and the triplet loss function are used to optimize the pedestrian retrieval network model, namely:
[0077]
[0078] As a preferred embodiment, based on a trained pedestrian retrieval network model, progressive granularity pedestrian retrieval is performed according to a preset pedestrian retrieval algorithm, including: based on the global granularity feature similarity between the image to be retrieved and all images in the sample set, selecting images whose global granularity feature similarity is greater than a preset global similarity threshold as first-level images; based on the component granularity feature similarity between the image to be retrieved and the first-level image, selecting images whose component granularity feature similarity is greater than a preset component similarity threshold as second-level images; based on the pixel granularity feature similarity between the image to be retrieved and the second-level image, selecting images whose pixel granularity feature similarity is greater than a preset pixel similarity threshold as progressive granularity pedestrian retrieval images.
[0079] In order to further balance the performance and efficiency of pedestrian retrieval, in this embodiment, first, the sample selection module selects the pedestrian images to be retrieved and the pedestrian images in the sample set; then the pedestrian convolution module extracts the feature map for the selected samples; then the pixel feature classification module classifies each pixel feature in the feature map to obtain a probability map; the multi-granularity feature extraction module extracts progressive granularity features for each pedestrian image based on the obtained feature map and probability map: global granularity features, component granularity features and pixel granularity features; finally, the progressive granularity retrieval module performs pedestrian retrieval based on the obtained progressive granularity features.
[0080] Specifically, firstly, the global granularity feature similarity between the image to be retrieved and all the images in the sample set is calculated, and then sorted, and the M1 images in the sample set with the highest similarity (first-level images) are selected; then the component granularity feature similarity between the image to be retrieved and the selected M1 images is calculated, and then sorted, and the M2 (M2≤M1) images with the highest similarity (second-level images) are selected; finally, the pixel granularity feature similarity between the image to be retrieved and the selected M2 images is calculated, and then sorted, as the final retrieval result (progressive granularity pedestrian retrieval image). The present invention is based on a retrieval algorithm of progressive granularity, and through a step-by-step retrieval method from coarse granularity to fine granularity, the scope of retrieval images in the image library is gradually narrowed, and the performance and efficiency of the retrieval are effectively balanced.
[0081] The progressive granularity pedestrian retrieval device provided by the present invention is described below. The progressive granularity pedestrian retrieval device described below and the progressive granularity pedestrian retrieval method described above can be referenced to each other.
[0082] Please refer to Figure 5 , Figure 5 A schematic structural diagram of another progressive granularity pedestrian retrieval device provided by the present invention.
[0083] The present invention also provides a progressive granularity pedestrian retrieval device, comprising: a feature map determination module 1, used to determine the feature map of a training sample; the training sample is all samples of the same pedestrian in a training set; a feature classification module 2, used to classify the pixel features of the feature map to obtain a probability map; a feature extraction module 3, used to perform progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; a model training module 4, used to train a pedestrian retrieval network model based on the progressive granularity pedestrian retrieval features, repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features and training the model until the training rounds for the training set reach a preset round, thereby obtaining a trained pedestrian retrieval network model; a pedestrian retrieval module 5, used to perform progressive granularity pedestrian retrieval based on the trained pedestrian retrieval network model according to a preset pedestrian retrieval algorithm.
[0084] Figure 6 An example of a structural diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor (processor) 601, a communication interface (Communications Interface) 602, a memory (memory) 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604. The processor 601 can call the logic instructions in the memory 603 to execute a progressive granularity pedestrian retrieval method, which includes: determining a feature map of a training sample; the training sample is all samples of the same pedestrian in a training set; classifying the pixel features of the feature map to obtain a probability map; performing progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; training a pedestrian retrieval network model based on the progressive granularity pedestrian retrieval features, and repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features and training the model until the number of training rounds for the training set reaches a preset number of rounds, thereby obtaining a trained pedestrian retrieval network model; performing progressive granularity pedestrian retrieval based on the trained pedestrian retrieval network model according to a preset pedestrian retrieval algorithm.
[0085] In addition, the logic instructions in the above-mentioned memory 603 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the progressive granularity pedestrian retrieval method provided by the above methods, which method includes: determining a feature map of a training sample; the training sample is all samples of the same pedestrian in a training set; classifying the pixel features of the feature map to obtain a probability map; performing progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; training a pedestrian retrieval network model based on the progressive granularity pedestrian retrieval features, and repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features and training the model until the number of training rounds for the training set reaches a preset number of rounds to obtain a trained pedestrian retrieval network model; based on the trained pedestrian retrieval network model, performing progressive granularity pedestrian retrieval according to a preset pedestrian retrieval algorithm.
[0087] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the progressive granularity pedestrian retrieval method provided by the above-mentioned methods, the method comprising: determining a feature map of a training sample; the training sample is all samples of the same pedestrian in a training set; classifying pixel features of the feature map to obtain a probability map; performing progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; training a pedestrian retrieval network model based on the progressive granularity pedestrian retrieval features, repeatedly and iteratively executing the steps of determining the feature map, classifying the features, extracting the features and training the model until the number of training rounds for the training set reaches a preset number of rounds, thereby obtaining a trained pedestrian retrieval network model; performing progressive granularity pedestrian retrieval based on the trained pedestrian retrieval network model according to a preset pedestrian retrieval algorithm.
[0088] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A progressive granularity pedestrian retrieval method, characterized in that: include: Determine a feature map of the training sample; The training samples are pedestrian samples in the training set; Classifying pixel features of the feature map to obtain a probability map; Based on the feature map and the probability map, progressive granularity feature extraction is performed to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; The pedestrian retrieval network model is trained according to the progressive granularity pedestrian retrieval features, and the steps of determining the feature map, classifying the features, extracting the features, and training the model are repeatedly and iteratively performed until the training rounds of the training set reach a preset round, thereby obtaining a trained pedestrian retrieval network model; Based on the trained pedestrian retrieval network model, progressive granularity pedestrian retrieval is performed according to a preset pedestrian retrieval algorithm.
2. The progressive granularity pedestrian retrieval method according to claim 1, characterized in that: The step of determining a feature graph of a training sample comprises: The training sample is input into the pedestrian retrieval network model to obtain a feature map of the training sample.
3. The progressive granularity pedestrian retrieval method according to claim 1, characterized in that: The step of classifying the pixel features of the feature map to obtain a probability map includes: Inputting the training sample into a human foreground segmentation network to obtain a foreground pseudo label; Based on the foreground pseudo-label, K-means clustering is performed on the pixel features belonging to the foreground on the feature map to determine the pixel pseudo-label; The pixel feature classification network is trained using the foreground pseudo-label and the pixel pseudo-label, and the foreground segmentation network step, the clustering step, and the network training step are repeatedly and iteratively executed until the foreground pseudo-label and the pixel pseudo-label are determined for the training set, thereby obtaining a trained pixel feature classification network; The feature map is input into the trained pixel feature classification network to obtain a foreground probability map and a component probability map.
4. The progressive granularity pedestrian retrieval method according to claim 3, characterized in that: The step of extracting progressive granularity features based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features includes: Taking a set of pixel features belonging to the foreground on the feature map as the pixel granularity feature; The component probability map is weighted averaged with pixel features on the feature map to obtain the component granularity feature; The pixel features on the feature map are weighted averaged by the foreground probability map to obtain the global granularity feature.
5. The progressive granularity pedestrian retrieval method according to claim 4, characterized in that: The step of training the pedestrian retrieval network model according to the progressive granularity pedestrian retrieval features to obtain a trained pedestrian retrieval network model includes: Determine a classification loss function of the global granularity feature and a global granularity feature similarity according to the global granularity feature; Determine a classification loss function of the component granularity feature and a component granularity feature similarity according to the component granularity feature; Determining pixel granularity feature similarity according to the pixel granularity feature; Determining a triplet loss function based on the global granularity feature similarity, the component granularity feature similarity, and the pixel granularity feature similarity; The pedestrian retrieval network model is trained based on the classification loss function of the global granularity feature, the classification loss function of the component granularity feature and the triplet loss function to obtain the trained pedestrian retrieval network model.
6. The progressive granularity pedestrian retrieval method according to claim 5, characterized in that: The method of performing progressive granularity pedestrian retrieval based on the trained pedestrian retrieval network model and according to a preset pedestrian retrieval algorithm includes: According to the global granularity feature similarity between the image to be retrieved and all the images in the sample set, an image whose global granularity feature similarity is greater than a preset global similarity threshold is selected as a first-level image; According to the similarity of the component granularity features between the image to be retrieved and the first-level image, an image whose component granularity feature similarity is greater than a preset component similarity threshold is selected as a second-level image; According to the pixel granularity feature similarity between the image to be retrieved and the second-level image, an image whose pixel granularity feature similarity is greater than a preset pixel similarity threshold is selected as a progressive granularity pedestrian retrieval image.
7. A progressive granularity pedestrian retrieval device, characterized in that: include: A feature map determination module, used to determine the feature map of the training sample; The training samples are pedestrian samples in the training set; A feature classification module, used to classify the pixel features of the feature map to obtain a probability map; A feature extraction module, used for performing progressive granularity feature extraction based on the feature map and the probability map to obtain progressive granularity pedestrian retrieval features; the progressive granularity pedestrian retrieval features include global granularity features, component granularity features and pixel granularity features; A model training module is used to train a pedestrian retrieval network model according to the progressive granularity pedestrian retrieval features, repeatedly and iteratively execute the steps of determining the feature map, classifying the features, extracting the features and training the model until the training rounds of the training set reach a preset round, thereby obtaining a trained pedestrian retrieval network model; The pedestrian retrieval module is used to perform progressive granularity pedestrian retrieval based on the trained pedestrian retrieval network model and according to a preset pedestrian retrieval algorithm.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the progressive granularity pedestrian retrieval method as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the progressive granularity pedestrian retrieval method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the progressive granularity pedestrian retrieval method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
A cross-domain pedestrian retrieval method based on heterogeneous pseudo-label learning
CN114937289A
Cross-camera group detection method based on cyclic conditional random field
CN115909198A
Living body target detection method with mixed precision and training method of living body detection model
CN116469177A
Cross-modal pedestrian re-identification method and device based on fine-grained features
CN116524542A
Pedestrian re-identification method and system based on dual-granularity three-mode attitude measurement learning
CN116959098A
