A pedestrian re-identification method and device based on pedestrian segmentation
Patent Information
- Application Number
- CN202311418328.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-10-27
AI Technical Summary
[0004]有鉴于此,本申请实施例提供了一种基于行人分割的行人重识别方法、装置、电子设备和存储介质,以解决现有技术在进行行人重识别时准确度不高的问题
[0019]本申请实施例与现有技术相比存在的有益效果至少包括:本申请实施例通过获取目标图片样本集;构建行人重识别模型,行人重识别模型包括行人分割分支和行人特征提取分支;将目标图片输入至行人重识别模型的行人分割分支,获得目标图片的行人分割掩码;将目标图片输入至行人重识别模型的行人特征提取分支,获得目标图片的多尺度特征向量;依据行人分割掩码和多尺度特征向量,获得行人重识别结果。本申请基于行人分割算法,结合分割掩码、高尺度特征、低尺度特征,可以有效去除了环境背景对识别的影响,显著提升行人重识别算法精度。
Smart Images

Figure CN117541977B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method and apparatus for pedestrian re-identification based on pedestrian segmentation. Background Technology
[0002] Pedestrian re-identification is a technology that enables cross-scene and cross-camera retrieval of target pedestrians. This technology can directly retrieve specific pedestrians from surveillance images or videos based on information such as clothing and posture, without relying on clear facial information. Therefore, this technology can improve pedestrian retrieval efficiency and significantly save time and labor costs.
[0003] However, in practical applications, pedestrian re-identification algorithms typically begin by extracting pedestrians from images using object detection algorithms, and then use a pedestrian re-identification model to extract features. These algorithms all suffer from a problem: when the scene is complex, the detected pedestrian bounding boxes often contain a significant amount of background information, which can severely impact the pedestrian re-identification task. Overcoming these technical shortcomings and fully utilizing pedestrian features to improve pedestrian re-identification performance in complex scenes is a crucial technical challenge that needs to be addressed. Summary of the Invention
[0004] In view of this, embodiments of this application provide a pedestrian re-identification method, apparatus, electronic device, and storage medium based on pedestrian segmentation to solve the problem of low accuracy in existing technologies when performing pedestrian re-identification.
[0005] A first aspect of this application provides a pedestrian re-identification method based on pedestrian segmentation, comprising:
[0006] Obtain the target image sample set;
[0007] A pedestrian re-identification model is constructed, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch.
[0008] The target image is input into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image;
[0009] The target image is input into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image;
[0010] Based on the pedestrian segmentation mask and the multi-scale feature vector, the pedestrian re-identification result is obtained.
[0011] A second aspect of this application provides a pedestrian re-identification device based on pedestrian segmentation, comprising:
[0012] The target image sample set acquisition module is configured to acquire a target image sample set;
[0013] The pedestrian re-identification model building module is configured to build a pedestrian re-identification model, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch.
[0014] The pedestrian segmentation mask acquisition module is configured to input the target image into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image;
[0015] The multi-scale feature vector acquisition module is configured to input the target image into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image.
[0016] The pedestrian re-identification result acquisition module is configured to obtain the pedestrian re-identification result based on the pedestrian segmentation mask and the multi-scale feature vector.
[0017] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.
[0018] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0019] The beneficial effects of this application's embodiments compared to existing technologies include at least the following: This application's embodiments acquire a target image sample set; construct a pedestrian re-identification model, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch; input the target image into the pedestrian segmentation branch of the pedestrian re-identification model to obtain a pedestrian segmentation mask for the target image; input the target image into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain a multi-scale feature vector for the target image; and obtain a pedestrian re-identification result based on the pedestrian segmentation mask and the multi-scale feature vector. This application, based on a pedestrian segmentation algorithm and combining segmentation masks, high-scale features, and low-scale features, can effectively remove the influence of environmental background on recognition, significantly improving the accuracy of the pedestrian re-identification algorithm. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is one of the flowcharts of a pedestrian re-identification method based on pedestrian segmentation provided in the embodiments of this application;
[0022] Figure 2 This is the second schematic diagram of a pedestrian re-identification method based on pedestrian segmentation provided in the embodiments of this application;
[0023] Figure 3 This is the third schematic diagram of a pedestrian re-identification method based on pedestrian segmentation provided in the embodiments of this application;
[0024] Figure 4 This is the fourth schematic diagram of a pedestrian re-identification method based on pedestrian segmentation provided in the embodiments of this application;
[0025] Figure 5 This is the fifth schematic diagram of a pedestrian re-identification method based on pedestrian segmentation provided in the embodiments of this application;
[0026] Figure 6 This is the sixth schematic diagram of a pedestrian re-identification method based on pedestrian segmentation provided in the embodiments of this application;
[0027] Figure 7 This is one of the structural schematic diagrams of a pedestrian re-identification device based on pedestrian segmentation provided in the embodiments of this application;
[0028] Figure 8 This is a second schematic diagram of the structure of a pedestrian re-identification device based on pedestrian segmentation provided in the embodiments of this application;
[0029] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0031] The following describes in detail, with reference to the accompanying drawings, a pedestrian re-identification method, apparatus, electronic device, and storage medium based on pedestrian segmentation according to embodiments of this application.
[0032] As described in the background section, pedestrian re-identification is an independent computer vision task. Currently, the main technical challenges of pedestrian re-identification include: (1) Existing pedestrian re-identification datasets are relatively small, and dataset collection is relatively difficult. Commonly used pedestrian re-identification datasets contain tens of thousands of pedestrian images and thousands of pedestrian categories. Compared with mature face recognition datasets, the amount of pedestrian re-identification data is still very small. The main difficulties in collecting public pedestrian re-identification datasets are as follows: shooting or collecting a large number of surveillance videos may involve privacy issues; ensuring that a pedestrian appears in more than two cameras to meet the cross-camera requirement; cutting out pedestrian images from the captured pedestrian videos and manually verifying whether the pedestrian is the same pedestrian. (2) Pedestrian pose is non-rigid, and pedestrians may exist in multiple states during movement. When multiple images of the same pedestrian show different poses, the recognition difficulty will increase significantly. In addition, pedestrian images taken from different perspectives will cause mismatch in pedestrian appearance information, thereby reducing the accuracy of pedestrian re-identification. (3) Pedestrian images have obvious color differences, partial occlusion of pedestrians, and large differences in image resolution. Changes in lighting significantly impact pedestrian images, causing variations in the color of pedestrians' appearance at different times and locations. Pedestrian occlusion is also a common problem; warning signs, cars, trees, and other objects can obstruct pedestrian view, increasing the difficulty of re-identification. Furthermore, the cameras used for data collection may have different resolutions, and the distance of pedestrians from the lens can cause significant differences in the size of pedestrians captured in the video.
[0033] In the early stages of pedestrian re-identification technology research and application, the datasets used for pedestrian re-identification were relatively simple, and pedestrian re-identification methods based on feature representation and distance metrics were mainly used. With the rapid development of deep learning, deep neural networks have been widely used in the field of computer vision, and are now gradually being used to solve the problem of pedestrian re-identification.
[0034] Based on the inventors' review of existing technologies, the biggest challenge of traditional person re-identification methods is designing effective feature representations, a process that relies excessively on human experience. In contrast, deep learning-based person re-identification methods can adapt to problems such as augmented person datasets and complex scenes, and can automatically learn to extract more effective person features, generally achieving better recognition results than traditional methods. Deep learning-based person re-identification technology mainly involves two fundamental technologies: background removal and region segmentation.
[0035] Background removal primarily involves removing background information or using a mask obtained from pedestrian foreground segmentation to guide pedestrian re-identification. Existing techniques include selecting an RGB-mask image containing a foreground mask as input, designing a Mask-Guided Contrastive Attention Model network to learn pedestrian feature representations from the RGB image and the positional information of the pedestrian foreground in the mask image; simultaneously, by narrowing the distance between the foreground and original image features and increasing the distance between the background and original image features, the triplet loss function is improved to suppress the influence of the pedestrian background on the recognition results. Another existing technique designs a dual-branch deep learning network model: the upper branch extracts pedestrian features, and the lower branch segments the pedestrian foreground. The pedestrian foreground segmentation result obtained from the lower branch can guide the upper branch network to more effectively extract pedestrian foreground features, avoiding recognition errors caused by the image background. However, this method has a high computational cost and long training time. For a network framework that utilizes multi-scale human body local masks to guide the attention model, during training, full-body masks, upper-body masks, and lower-body masks are used to guide the attention model to focus on the full-body, upper-body, and lower-body features of pedestrians, respectively. This method can accurately locate important parts of the human body and suppress the influence of the background on the recognition results. A framework based on saliency and semantic analysis information for pedestrian re-identification is also proposed, consisting of two sub-networks: a saliency-guided sub-network for learning salient features in pedestrian images, and a semantic segmentation-guided sub-network for eliminating background information and resolving object occlusion issues.
[0036] For region segmentation, fine-grained local features can be effectively extracted, improving the performance of pedestrian re-identification tasks. Existing techniques include a Part-based Convolutional Baseline network structure that uniformly segments the feature map. This structure divides the feature map obtained from the backbone network into several local feature maps, then performs pooling operations on these local feature maps to obtain several feature vectors. Finally, the feature vectors are compared with the pedestrian's true label to calculate the classification error and then backpropagated. This strategy of segmenting the entire feature map into several local feature maps achieved the best recognition performance at the time. Other existing techniques first utilize dilated convolutions for multi-scale feature extraction, reducing the information loss caused by traditional convolutional feature extraction methods; simultaneously, spatial transformation networks are used to extract features from local body regions, and finally, global and local features are fused. Still other solutions propose fusing global pedestrian information with discriminative multi-granular local information, achieving end-to-end learning without adding extra training steps, while allowing the model to focus on the core information that significantly distinguishes pedestrians.
[0037] Based on the above issues, for practical applications of person re-identification, integrating global and local features is an effective solution to improve the performance of person re-identification tasks. However, the effective fusion of global and local features requires further research, and the fusion effect of low-scale and high-scale features is also a technical problem that needs to be solved. Generally, fusing features of different scales is an important means to improve segmentation performance. Low-level features have higher resolution and contain more location and detail information, but due to fewer convolutions, their semantics are lower and they contain more noise. High-level features have stronger semantic information, but their resolution is very low, and their ability to perceive details is poor.
[0038] To address this, this application proposes a pedestrian re-identification scheme based on pedestrian segmentation. By constructing a pedestrian re-identification model including a pedestrian segmentation branch and a pedestrian feature extraction branch, a pedestrian segmentation mask and a multi-scale feature vector of the target image are obtained. Then, based on the pedestrian segmentation mask and the multi-scale feature vector, the pedestrian re-identification result is obtained. This application, based on a pedestrian segmentation algorithm and combining a segmentation mask, high-scale features, and low-scale features, effectively removes the influence of environmental background on recognition, significantly improving the accuracy of the pedestrian re-identification algorithm.
[0039] like Figure 1 The diagram shown is a flowchart of a pedestrian re-identification method based on pedestrian segmentation according to this application. The method includes:
[0040] S101: Obtain the target image sample set.
[0041] S102: Construct a pedestrian re-identification model, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch. Specifically, as follows: Figure 2 The diagram shown is a structural schematic of the pedestrian re-identification model in this embodiment.
[0042] S103: Input the target image into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image.
[0043] S104: Input the target image into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image.
[0044] S105: Based on the pedestrian segmentation mask and the multi-scale feature vectors mentioned above, obtain the pedestrian re-identification result.
[0045] In some embodiments, the pedestrian segmentation branch is constructed based on a convolutional neural network; and / or, the pedestrian segmentation branch further includes convolutional layers and softmax layers.
[0046] In some embodiments, the target image is input into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image, such as... Figure 3 As shown, it includes:
[0047] S311: Input the target image into the convolutional neural network to obtain the pedestrian target feature vector of the target image; wherein, the convolutional neural network includes a ResNet50 network.
[0048] S312: Input the above pedestrian target feature vector into the convolutional layer for convolution transformation; wherein the convolution kernel size of the above convolutional layer is 1×1.
[0049] S313: Input the pedestrian target feature vector after convolution transformation into the Softmax layer to obtain the pedestrian segmentation mask.
[0050] In some embodiments, the pedestrian feature extraction branch is constructed based on a feature extraction network; and / or, the pedestrian segmentation branch further includes a global average pooling layer and at least two upsampling layers.
[0051] In some embodiments, the multi-scale feature vectors described above include low-scale feature vectors and high-scale feature vectors.
[0052] In some embodiments, the target image is input into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain multi-scale features of the target image, such as... Figure 4 As shown, it includes:
[0053] S411: Input the above target image into the first upsampling layer to obtain the corresponding high-resolution target image.
[0054] S412: Input the above high-resolution target image into the above feature extraction network to obtain the high-resolution image feature vector.
[0055] S413: Input the above high-resolution image feature vector into the second upsampling layer to obtain the above high-scale feature vector.
[0056] S414: Input the high-resolution image feature vector into the global average pooling layer to obtain the low-scale feature vector.
[0057] In some embodiments, the pedestrian re-identification model described above further includes a global average pooling layer and a classification layer.
[0058] In some embodiments, based on the pedestrian segmentation mask and the multi-scale feature vector described above, the pedestrian re-identification result is obtained, such as... Figure 5 As shown, it includes:
[0059] S511: After multiplying the above segmentation mask with the low-scale feature vector, input it into the global average pooling layer, and add the calculation result of the global average pooling layer with the high-scale feature vector to obtain the first fused feature vector.
[0060] S512: Input the first fused feature vector into the classification layer to obtain the above pedestrian re-identification results.
[0061] like Figure 6 The diagram shown illustrates another implementation of a pedestrian re-identification method based on pedestrian segmentation according to this application. The method includes:
[0062] S106: Based on the above pedestrian re-identification results, select the target loss function to iteratively update the model parameters of the above pedestrian re-identification model until the preset iteration termination condition is reached.
[0063] This application's embodiments involve: acquiring a target image sample set; constructing a pedestrian re-identification model, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch; inputting the target image into the pedestrian segmentation branch of the pedestrian re-identification model to obtain a pedestrian segmentation mask for the target image; inputting the target image into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain a multi-scale feature vector for the target image; and obtaining the pedestrian re-identification result based on the pedestrian segmentation mask and the multi-scale feature vector. This application, based on a pedestrian segmentation algorithm and combining segmentation masks, high-scale features, and low-scale features, can effectively remove the influence of environmental background on recognition, significantly improving the accuracy of the pedestrian re-identification algorithm.
[0064] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0065] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the system embodiments of this application, please refer to the method embodiments of this application.
[0066] Figure 7 This is a schematic diagram of a pedestrian re-identification device based on pedestrian segmentation provided in an embodiment of this application. Figure 7 As shown, the pedestrian re-identification device based on pedestrian segmentation includes:
[0067] The target image sample set acquisition module 701 is configured to acquire a target image sample set.
[0068] The pedestrian re-identification model construction module 702 is configured to construct a pedestrian re-identification model, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch.
[0069] The pedestrian segmentation mask acquisition module 703 is configured to input the target image into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image.
[0070] The multi-scale feature vector acquisition module 704 is configured to input the target image into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image.
[0071] The pedestrian re-identification result acquisition module 705 is configured to obtain the pedestrian re-identification result based on the aforementioned pedestrian segmentation mask and the aforementioned multi-scale feature vector.
[0072] Figure 8 This is a schematic diagram illustrating another implementation of a pedestrian re-identification device based on pedestrian segmentation provided in this application. For example... Figure 8 As shown, the pedestrian re-identification device based on pedestrian segmentation also includes:
[0073] The model training module 706 is configured to select a target loss function based on the pedestrian re-identification results, and to iteratively update the model parameters of the pedestrian re-identification model until a preset iteration termination condition is reached.
[0074] It should be understood that the pedestrian re-identification device based on pedestrian segmentation in the embodiments of this specification can also perform... Figures 1 to 6 A method for implementing a pedestrian re-identification device based on pedestrian segmentation is presented, and the implementation of the pedestrian re-identification device based on pedestrian segmentation is described. Figures 1 to 6 The functions of the examples shown will not be repeated here. Furthermore, the sequence numbers of the steps in the above embodiments do not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0075] Figure 9 This is a schematic diagram of the electronic device 9 provided in an embodiment of this application. Figure 9 As shown, the electronic device 9 of this embodiment includes a processor 901, a memory 902, and a computer program 903 stored in the memory 902 and executable on the processor 901. When the processor 901 executes the computer program 903, it implements the steps in the various method embodiments described above. Alternatively, when the processor 901 executes the computer program 903, it implements the functions of each module / unit in the various device embodiments described above.
[0076] Electronic device 9 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 9 may include, but is not limited to, processor 901 and memory 902. Those skilled in the art will understand that... Figure 9This is merely an example of electronic device 9 and does not constitute a limitation on electronic device 9. It may include more or fewer components than shown, or different components.
[0077] The memory 902 can be an internal storage unit of the electronic device 9, such as a hard disk or RAM of the electronic device 9. The memory 902 can also be an external storage device of the electronic device 9, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the electronic device 9. The memory 902 can also include both internal and external storage units of the electronic device 9. The memory 902 is used to store computer programs and other programs and data required by the electronic device.
[0078] Processor 901 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 901 reads the corresponding computer program from non-volatile memory into memory and then executes it, forming a shared resource access control device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0079] Obtain the target image sample set;
[0080] A pedestrian re-identification model is constructed, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch.
[0081] The target image is input into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image.
[0082] The target image is input into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image.
[0083] Based on the pedestrian segmentation mask and the multi-scale feature vectors mentioned above, the pedestrian re-identification results are obtained.
[0084] The above is as described in this instruction manual. Figures 1 to 6The method of the illustrated embodiment can be applied to, or implemented by, processor 901. Processor 901 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0085] Of course, in addition to the software implementation, the electronic devices in the embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0086] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0087] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0088] This specification also provides an embodiment of a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figures 1 to 6 The method of the illustrated embodiment is specifically used to perform the following method:
[0089] Obtain the target image sample set;
[0090] A pedestrian re-identification model is constructed, which includes a pedestrian segmentation branch and a pedestrian feature extraction branch.
[0091] The target image is input into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image.
[0092] The target image is input into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image.
[0093] Based on the pedestrian segmentation mask and the multi-scale feature vectors mentioned above, the pedestrian re-identification results are obtained.
[0094] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
[0095] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0096] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0097] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0098] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0099] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A pedestrian re-identification method based on pedestrian segmentation, characterized in that, include: Obtain the target image sample set; A pedestrian re-identification model is constructed, which includes a pedestrian segmentation branch, a pedestrian feature extraction branch, a global average pooling layer, and a classification layer. The target image is input into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image; The target image is input into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain a multi-scale feature vector of the target image; the multi-scale feature vector includes a low-scale feature vector and a high-scale feature vector. Based on the pedestrian segmentation mask and the multi-scale feature vector, a pedestrian re-identification result is obtained, including: multiplying the pedestrian segmentation mask by the low-scale feature vector and inputting the result into a global average pooling layer, and adding the result of the global average pooling layer to the high-scale feature vector to obtain a first fused feature vector; inputting the first fused feature vector into a classification layer to obtain the pedestrian re-identification result.
2. The method according to claim 1, characterized in that, The pedestrian segmentation branch is constructed based on a convolutional neural network; and / or, the pedestrian segmentation branch further includes convolutional layers and softmax layers.
3. The method according to claim 2, characterized in that, The target image is input into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image, including: The target image is input into the convolutional neural network to obtain the pedestrian target feature vector of the target image; wherein, the convolutional neural network includes a ResNet50 network; The pedestrian target feature vector is input into a convolutional layer for convolution transformation; wherein the kernel size of the convolutional layer is 1×1. The pedestrian target feature vector after convolution transformation is input into the Softmax layer to obtain the pedestrian segmentation mask.
4. The method according to claim 1, characterized in that, The pedestrian feature extraction branch is constructed based on a feature extraction network; and / or, the pedestrian segmentation branch further includes a global average pooling layer and at least two upsampling layers.
5. The method according to claim 4, characterized in that, The target image is input into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain multi-scale features of the target image, including: The target image is input into the first upsampling layer to obtain the corresponding high-resolution target image; The high-resolution target image is input into the feature extraction network to obtain the high-resolution image feature vector; The high-resolution image feature vector is input into the second upsampling layer to obtain the high-scale feature vector. The high-resolution image feature vector is input into the global average pooling layer to obtain the low-scale feature vector.
6. The method according to any one of claims 1 to 5, characterized in that, Also includes: Based on the pedestrian re-identification results, a target loss function is selected to iteratively update the model parameters of the pedestrian re-identification model until a preset iteration termination condition is reached.
7. A pedestrian re-identification device based on pedestrian segmentation, characterized in that, include: The target image sample set acquisition module is configured to acquire a target image sample set; The pedestrian re-identification model building module is configured to build a pedestrian re-identification model, which includes a pedestrian segmentation branch, a pedestrian feature extraction branch, a global average pooling layer, and a classification layer. The pedestrian segmentation mask acquisition module is configured to input the target image into the pedestrian segmentation branch of the pedestrian re-identification model to obtain the pedestrian segmentation mask of the target image; The multi-scale feature vector acquisition module is configured to input the target image into the pedestrian feature extraction branch of the pedestrian re-identification model to obtain the multi-scale feature vector of the target image; the multi-scale feature vector includes low-scale feature vector and high-scale feature vector. The pedestrian re-identification result acquisition module is configured to obtain a pedestrian re-identification result based on the pedestrian segmentation mask and the multi-scale feature vector, including: multiplying the pedestrian segmentation mask by the low-scale feature vector and inputting the result into a global average pooling layer; adding the result of the global average pooling layer to the high-scale feature vector to obtain a first fused feature vector; and inputting the first fused feature vector into a classification layer to obtain the pedestrian re-identification result.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Pedestrian re-identification method and device, electronic equipment and readable storage medium
CN112801008A
Global and local sensing pedestrian re-identification method fusing segmentation information
CN113657355A