Method, device, terminal equipment and storage medium for pedestrian re-identification

CN115761786BActive Publication Date: 2026-10-09SHENZHEN HEISHIBAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210999551.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2026-10-09
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

[0003]目前,基于卷积神经网络(CNN)的方法在视频行人重识别方法占据了主流,该类方法主要是使用由2D与3D卷积层叠加而成的卷积神经网络来分别提取时间与空间特征,但这类方法很大程度上受限于卷积神经网络的局部性(即有效感受野的大小),进而使行人重识别的结果不够准确

Benefits of technology

[0035] The beneficial effects of this application's embodiments compared to the prior art are as follows: The technical solution of this application acquires a video stream and an image of the target pedestrian, and determines the feature vector of the target pedestrian based on the image of the target pedestrian; the video stream is input into a multi-stage pedestrian re-identification model to obtain the attribute information, identity information, and attribute-identity information of the first pedestrian, and the feature vector of the first pedestrian is determined based on the attribute information, identity information, and attribute-identity information of the first pedestrian; based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, the matching degree between the target pedestrian and each first pedestrian in the video stream is determined, and the first pedestrian corresponding to the maximum matching degree is determined as the identification result for re-identifying the target pedestrian. That is, this application's embodiments can obtain the attribute information, identity information, and attribute-identity information of the first pedestrian through a multi-stage pedestrian re-identification model, and thus determine the feature vector of the first pedestrian. Based on the feature vector of the first pedestrian and the feature vector of the target pedestrian, the target pedestrian can be identified among each first pedestrian, improving the accuracy of the pedestrian re-identification result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761786B_ABST
    Figure CN115761786B_ABST
Patent Text Reader

Abstract

The application belongs to the field of pedestrian re-identification, and particularly relates to a pedestrian re-identification method, device, terminal equipment and storage medium. The method comprises the following steps: acquiring a video stream and an image of a target pedestrian, and determining a feature vector of the target pedestrian according to the image of the target pedestrian; inputting the video stream into a multi-stage pedestrian re-identification model to obtain attribute information, identity information and attribute identity information of a first pedestrian, and determining a feature vector of the first pedestrian; and determining a matching degree between the target pedestrian and each first pedestrian in the video stream according to the feature vector of the target pedestrian and the feature vector of the first pedestrian. That is, the attribute information, identity information and attribute identity information of the first pedestrian can be obtained through the multi-stage pedestrian re-identification model, and then the feature vector of the first pedestrian can be determined. According to the feature vector of the first pedestrian and the feature vector of the target pedestrian, the target pedestrian can be identified among the first pedestrians, and the accuracy of the pedestrian re-identification result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of pedestrian re-identification, and in particular relates to a method, apparatus, terminal equipment and storage medium for pedestrian re-identification. Background Technology

[0002] Pedestrian re-identification is an important application in security monitoring, aiming to match pedestrians found in surveillance footage from different perspectives and at different times.

[0003] Currently, convolutional neural network (CNN)-based methods dominate the video person re-identification method. These methods mainly use convolutional neural networks composed of 2D and 3D convolutional layers to extract temporal and spatial features respectively. However, these methods are largely limited by the locality of convolutional neural networks (i.e. the size of the effective receptive field), which makes the results of person re-identification less accurate. Summary of the Invention

[0004] This application provides a method, apparatus, terminal device, and storage medium for pedestrian re-identification, which can improve the accuracy of pedestrian re-identification results.

[0005] In a first aspect, embodiments of this application provide a method for pedestrian re-identification, including:

[0006] Acquire video streams and images of the target pedestrian, and determine the feature vector of the target pedestrian based on the images of the target pedestrian;

[0007] The video stream is input into a multi-stage pedestrian re-identification model to obtain the attribute information, identity information, and attribute identity information of the first pedestrian in the video stream. Based on the attribute information, identity information, and attribute identity information of the first pedestrian, the feature vector of the first pedestrian is determined.

[0008] Based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, the matching degree between the target pedestrian and each of the first pedestrians in the video stream is determined, and the first pedestrian corresponding to the maximum matching degree among the matching degrees is determined as the recognition result for re-identifying the target pedestrian.

[0009] In one possible implementation of the first aspect, inputting the video stream into the multi-stage person re-identification model includes:

[0010] The video stream is divided into image blocks for each frame, and a first feature vector for each image block is obtained based on the image blocks.

[0011] Using the location encoding module in the multi-stage pedestrian re-identification model, the location information of the image block is added to the first feature vector to obtain the second feature vector of the image block;

[0012] In the multi-stage pedestrian re-identification model, a first category label corresponding to the video stream is determined;

[0013] The second feature vector of the image block and the first category label corresponding to the video stream are input into the multi-stage pedestrian re-identification model.

[0014] The step of inputting the video stream into a multi-stage pedestrian re-identification model to obtain the attribute information, identity information, and attribute-identity information of the first pedestrian, and determining the feature vector of the first pedestrian based on the attribute information, identity information, and attribute-identity information, includes:

[0015] The second feature vector of the image block and the first category label corresponding to the video stream are input into the attribute information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute information of the first pedestrian.

[0016] The third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block are input into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian.

[0017] The third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream are input into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian.

[0018] The first pedestrian's attribute information, identity information, and attribute-identity information are weighted and linked to determine the first pedestrian's feature vector.

[0019] The step of inputting the second feature vector of the image block and the first category label corresponding to the video stream into the attribute information extraction module of the multi-stage pedestrian re-identification model to obtain the attribute information of the first pedestrian includes:

[0020] The second feature vector of the image block and the first category label corresponding to the video stream are input into the first spatiotemporal aggregation layer in the attribute information extraction module to obtain the third feature vector of the image block and the second category label corresponding to each image block. The third feature vector includes the temporal feature vector and the spatial feature vector of the image block.

[0021] The third feature vector is input into the first attribute-related proxy layer in the attribute information extraction module to obtain the attribute information of the first pedestrian in the video stream.

[0022] The step of inputting the third feature vector of the image patch output by the attribute information extraction module and the second category label corresponding to each image patch into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian includes:

[0023] The third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block are input into the second spatiotemporal aggregation layer in the identity information extraction module to obtain the fourth feature vector of the image block and the third category label corresponding to each image block. The fourth feature vector includes the temporal feature vector and the spatial feature vector of the image block.

[0024] The fourth feature vector is input into the first identity-related proxy layer in the identity information extraction module to obtain the identity information of the first pedestrian.

[0025] Specifically, the step of inputting the third feature vector of the image patch output by the attribute information extraction module and the first category label corresponding to the video stream into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian includes:

[0026] The third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream are input into the third spatiotemporal aggregation layer and the second identity-related proxy layer in the attribute identity information extraction module to obtain the attribute identity information of the first pedestrian. The second attribute-related proxy layer and the third attribute-related proxy layer are configured before and after the time aggregation layer in the third spatiotemporal aggregation module.

[0027] Before inputting the second feature vector of the image block and the first category label corresponding to the video stream into the multi-stage person re-identification model, the method further includes:

[0028] Data augmentation is performed on the image blocks by randomly perturbing them.

[0029] Secondly, embodiments of this application provide a pedestrian re-identification device, comprising:

[0030] The acquisition module is used to acquire the video stream and the image of the target pedestrian, and determine the feature vector of the target pedestrian based on the image of the target pedestrian;

[0031] The determination module is used to input the video stream into a multi-stage pedestrian re-identification model to obtain the attribute information, identity information and attribute identity information of the first pedestrian, and determine the feature vector of the first pedestrian based on the attribute information, identity information and attribute identity information of the first pedestrian;

[0032] The matching module is used to determine the matching degree between the target pedestrian and each of the first pedestrians based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, and to determine the first pedestrian corresponding to the maximum matching degree among the matching degrees as the recognition result for re-identifying the target pedestrian.

[0033] Thirdly, embodiments of this application provide a terminal 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 pedestrian re-identification method as described in any of the first aspects.

[0034] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the pedestrian re-identification method as described in any of the first aspects.

[0035] The beneficial effects of this application's embodiments compared to the prior art are as follows: The technical solution of this application acquires a video stream and an image of the target pedestrian, and determines the feature vector of the target pedestrian based on the image of the target pedestrian; the video stream is input into a multi-stage pedestrian re-identification model to obtain the attribute information, identity information, and attribute-identity information of the first pedestrian, and the feature vector of the first pedestrian is determined based on the attribute information, identity information, and attribute-identity information of the first pedestrian; based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, the matching degree between the target pedestrian and each first pedestrian in the video stream is determined, and the first pedestrian corresponding to the maximum matching degree is determined as the identification result for re-identifying the target pedestrian. That is, this application's embodiments can obtain the attribute information, identity information, and attribute-identity information of the first pedestrian through a multi-stage pedestrian re-identification model, and thus determine the feature vector of the first pedestrian. Based on the feature vector of the first pedestrian and the feature vector of the target pedestrian, the target pedestrian can be identified among each first pedestrian, improving the accuracy of the pedestrian re-identification result. Attached Figure Description

[0036] 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.

[0037] Figure 1a This is a network architecture diagram of a multi-stage pedestrian re-identification model provided in one embodiment of this application;

[0038] Figure 1b This is a network architecture diagram of a first spatiotemporal aggregation layer provided in an embodiment of this application;

[0039] Figure 1c This is a network architecture diagram of a first identity proxy layer provided in an embodiment of this application;

[0040] Figure 1d This is a network architecture diagram of a third spatiotemporal aggregation layer provided in an embodiment of this application;

[0041] Figure 2 This is a schematic flowchart of a pedestrian re-identification method provided in an embodiment of this application;

[0042] Figure 3 This is a schematic flowchart illustrating a method for preprocessing a video stream according to an embodiment of this application;

[0043] Figure 4 This is a schematic flowchart illustrating a specific method of S202 provided in an embodiment of this application;

[0044] Figure 5 This is a schematic flowchart illustrating a specific method of S401 provided in an embodiment of this application;

[0045] Figure 6 This is a schematic flowchart illustrating a specific method of S402 provided in an embodiment of this application;

[0046] Figure 7 This is a schematic diagram of the structure of a pedestrian re-identification device provided in an embodiment of this application;

[0047] Figure 8 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0048] 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 can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary detail. In other instances, specific technical details in various embodiments can be referred to mutually, and specific systems not described in one embodiment can be referred to in other embodiments.

[0049] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0050] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0051] References to "embodiments of this application" or "some embodiments" in this specification mean that one or more embodiments of this application include specific features, structures, or characteristics described in connection with that embodiment. Therefore, phrases such as "in other embodiments," "an embodiment of this application," and "other embodiments of this application" appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0052] Furthermore, in the description of this application and the appended claims, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0053] Pedestrian re-identification is an important application in security monitoring, aiming to match pedestrians found in surveillance footage from different perspectives and at different times.

[0054] Currently, convolutional neural network (CNN)-based methods dominate the video person re-identification method. These methods mainly use convolutional neural networks composed of 2D and 3D convolutional layers to extract temporal and spatial features respectively. However, these methods are largely limited by the locality of convolutional neural networks (i.e. the size of the effective receptive field), which makes the results of person re-identification less accurate.

[0055] To address the aforementioned deficiencies, the inventive concept of this application is as follows:

[0056] This application embodiment obtains the attribute information, identity information, and attribute-identity information of the first pedestrian through a multi-stage pedestrian re-identification model, and then determines the feature vector of the first pedestrian. Based on the feature vector of the first pedestrian and the feature vector of the target pedestrian, the target pedestrian can be identified among the first pedestrians, thereby improving the accuracy of the pedestrian re-identification results.

[0057] To illustrate the technical solution of this application, specific embodiments are described below.

[0058] Please refer to Figure 1a , Figure 1aThis is a network architecture diagram of a multi-stage pedestrian re-identification model provided in an embodiment of this application. For ease of explanation, only the parts relevant to this application are shown. The network architecture includes: a tokenization module 10, a location information encoding module 20, an attribute information extraction module 30, an identity information extraction module 40, and an attribute and identity information extraction module 50.

[0059] The tokenization module 10 is used to convert a series of non-overlapping image blocks in the input video stream into feature vectors of the image blocks.

[0060] The location information encoding module 20 is used to add the location of each image block to the feature vector of the image block.

[0061] In this embodiment of the application, after the multi-stage pedestrian re-identification model obtains the feature vector of the image block, the tokenization module 10 is also used to randomly initialize a category tag for the video stream and obtain the category tag c corresponding to the video stream. The category tag is used to aggregate global identity information.

[0062] The attribute information extraction module 30 includes eight first spatiotemporal aggregation layers 31 and a first attribute-related proxy layer 32. The attribute information extraction module 30 is used to extract the attribute information of pedestrians in the video stream. Specifically, the first spatiotemporal aggregation layer 31 is used to extract the temporal feature vector and spatial feature vector of image blocks, and the first attribute-related proxy layer 32 is used to extract the attribute information of the first pedestrian in the video stream.

[0063] Please refer to Figure 1b , Figure 1b This is a network architecture diagram of a first spatiotemporal aggregation layer provided in an embodiment of this application, consisting of... Figure 1b It is known that the first spatiotemporal aggregation layer 31 includes a first temporal attention module 310, a first category label broadcasting module 311, a first spatial attention module 312, and a first category label averaging module 313. Specifically, the first temporal attention module 310 is used to extract the temporal feature vectors of image patches. The first category label broadcasting module 311 is used to duplicate a category label for each image patch, obtaining the category label corresponding to each image patch. The first spatial attention module 312 is used to extract the spatial feature vectors of image patches. The first category label averaging module 313 is used to calculate the average value of the category labels corresponding to each image patch, obtaining the average category label corresponding to each image patch.

[0064] The identity information extraction module 40 is used to extract the identity information of pedestrians in the video stream. This module 40 includes a second spatiotemporal aggregation layer 41 and a first identity-related proxy layer 42. The network architecture of the second spatiotemporal aggregation layer 41 is the same as that of the first spatiotemporal aggregation layer 31, and will not be described again here. For the network architecture of the first identity-related proxy layer 42, please refer to [reference needed]. Figure 1c , Figure 1cThis is a network architecture diagram of a first identity proxy layer provided in an embodiment of this application.

[0065] The first identity-related proxy layer 42 includes a linear module 420, a first identity-related proxy module 421, a second identity-related proxy module 422, and a classification module 423. The linear module 420 extracts relatively obvious edge regions from image patches and transforms them into linear relationships for subsequent image processing. The first identity-related proxy module 421 and the second identity-related proxy module 422 are a set of learnable parameter matrices used to find and aggregate discriminative features in the temporal and spatial feature vectors of the image patches. The classification module 423 classifies the discriminative features.

[0066] The attribute identity information extraction module 50 is used to extract the attribute identity information of the first pedestrian in the video stream. This module 50 includes a third spatiotemporal aggregation layer 51 and a second identity-related proxy layer 52. For the network architecture of the third spatiotemporal aggregation layer 51, please refer to [reference needed]. Figure 1d .

[0067] The third spatiotemporal aggregation layer 52 includes a second attribute-related proxy layer 520, a second temporal attention module 521, a third attribute-related proxy layer 522, a second category label broadcasting module 523, a second spatial attention module 524, and a second category label averaging module 525. The second temporal attention module 521 functions the same as the first temporal attention module 310, the second category label broadcasting module 523 functions the same as the first category label broadcasting module 311, the second spatial attention module 524 functions the same as the first spatial attention module 312, and the second category label averaging module 525 functions the same as the first category label averaging module 313; these functions will not be elaborated further here. The second attribute-related proxy layer 520 and the third attribute-related proxy layer 522 assist the second temporal attention module 521 in extracting attribute information from image patches and enable the attribute information to interact and fuse between different frames.

[0068] In this embodiment, the multi-stage pedestrian re-identification model performs a weighted concatenation of the attribute information of the first pedestrian extracted by the attribute information extraction module 30, the identity information of the first pedestrian extracted by the identity information extraction module 40, and the attribute and identity information of the first pedestrian extracted by the attribute and identity information extraction module 50 to obtain the feature vector of the first pedestrian. Based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, the target pedestrian is re-identified.

[0069] In this embodiment of the application, before applying the above model to re-identify the target pedestrian, the model needs to be trained. The multi-stage pedestrian re-identification model can be trained through the following steps:

[0070] First, sample data is selected, with each sample data consisting of an image patch feature vector and a standard analysis result.

[0071] In this application embodiment, sample data can be divided into training samples and test samples, for example, 80% of the sample data can be used as training data and 20% of the sample data can be used as test samples.

[0072] In this embodiment, the standard analysis result can be the pedestrian type corresponding to each sample data (pedestrian personality can be determined through pedestrian attribute information and identity information). It is understood that the larger the amount of these sample data, the better the training effect on the multi-stage pedestrian re-identification model will be. Therefore, in this embodiment of the invention, as many sample data as possible can be selected.

[0073] Secondly, each training sample is input into the initial multi-stage pedestrian re-identification model to obtain the training analysis results output by the initial multi-stage pedestrian re-identification model.

[0074] Specifically, after selecting training samples, these training samples can be input into the initial multi-stage pedestrian re-identification model to obtain the initial training analysis results of each training sample, that is, to obtain the initial pedestrian type corresponding to the feature vector of each image block. Since the multi-stage pedestrian re-identification model has not been trained yet, there will be a certain deviation and error between the output training analysis results and the standard analysis results.

[0075] Then, the global error of this round of training is calculated based on the training analysis results and the standard analysis results.

[0076] Specifically, after obtaining the training analysis results, the global error of this round of training can be calculated based on the training analysis results and the corresponding standard analysis results, and it can be determined whether the global error meets the preset conditions. Here, the preset conditions can be determined when training a specific subject ability analysis model. For example, the preset condition can be set as the global error being less than a specific threshold. The specific threshold can be a percentage value. The smaller the specific threshold, the more stable the subject ability analysis model obtained after training will be, and the higher the prediction accuracy will be.

[0077] The multi-stage pedestrian re-identification model uses the cross-entropy loss function and the triplet loss function to calculate the global error of this round of training.

[0078] In this embodiment, the cross-entropy loss function and the triplet loss function are used to supervise the outputs of the attribute information extraction module, the identity information extraction module, and the attribute-identity information extraction module, respectively. The cross-entropy loss function L... CE With triplet loss function L Tri The formula is:

[0079]

[0080]

[0081] Among them, y i p represents the one-hot label of training sample i. i Let represent the identity prediction distribution of training sample i, N represent the number of training samples, P represent the number of randomly sampled pedestrian identity identifiers (IDs), K represent the number of randomly sampled pedestrian videos under that ID, and m represent the margin between different categories in the distance metric space. This represents the maximum distance between the anchor with ID i and all pedestrian video samples with ID i in the distance metric space. This represents the minimum distance between the anchor with ID i and all pedestrian video samples with IDs other than i in the distance metric space.

[0082] Then, if the global error does not meet the preset conditions, the model parameters of the multi-stage pedestrian re-identification model are adjusted, and the multi-stage pedestrian re-identification model with the adjusted model parameters is determined as the initial multi-stage pedestrian re-identification model. Then, the process returns to input each training sample into the initial multi-stage pedestrian re-identification model to obtain the training analysis results output by the initial multi-stage pedestrian re-identification model.

[0083] Finally, if the global error meets the preset conditions, the multi-stage pedestrian re-identification model training is considered complete.

[0084] In this embodiment, after training the model using training samples, the model is tested using test samples. The test results are shown in the table below:

[0085] The number 30 in the table corresponds to Figure 1a The attribute information extraction module in Figure 1 is labeled 40, which corresponds to the identity information extraction module in Figure 1, and the attribute identity information extraction module is labeled 50. The first search metric (rank1), the second search metric (rank5), and the third search metric (mAP) are all indicators that measure the model's search capability. Rank1, rank5, and mAP are expressed as percentages.

[0086]

[0087]

[0088] The multi-stage person re-identification model in this application embodiment has a significantly improved search capability compared to the existing deep learning-based video person re-identification model (which mainly uses a convolutional neural network (CNN) composed of stacked 2D and 3D convolutional layers to extract temporal and spatial features respectively). Please refer to the table below:

[0089] Multi-stage pedestrian re-identification model 91.8 97.4 85.3 Deep learning-based video pedestrian re-identification model 88.7 / 86.3

[0090] Because the search capability of the multi-stage pedestrian re-identification model in this embodiment is significantly improved, the pedestrian re-identification results are more accurate.

[0091] Please refer to Figure 2 , Figure 2 This is a schematic flowchart of a pedestrian re-identification method provided in an embodiment of this application. Figure 2 The method in the code can be executed by a terminal device. For example... Figure 2 As shown, the method includes: S201 to S203.

[0092] S201. The terminal device acquires the video stream and the image of the target pedestrian, and determines the feature vector of the target pedestrian based on the image of the target pedestrian.

[0093] The execution subject of this application embodiment is a terminal device, which includes, but is not limited to, devices such as servers, computers, smartphones, and tablet computers.

[0094] In this application embodiment, the target pedestrian refers to specific pedestrians such as missing persons.

[0095] In other embodiments, the image of the target pedestrian is pre-input into the terminal device, and the terminal device can then acquire the image of the target pedestrian.

[0096] In this embodiment of the application, determining the feature vector of the target pedestrian based on the image of the target pedestrian includes: inputting the image of the target pedestrian into a feature extractor to obtain the feature vector of the target pedestrian.

[0097] In other embodiments, determining the feature vector of the target pedestrian includes: acquiring a video of the target pedestrian and determining the feature vector of the target pedestrian based on the video of the target pedestrian.

[0098] In this embodiment, the video stream can be captured by a camera component, which then inputs the captured video stream into a terminal device, allowing the terminal device to acquire the video stream. In some embodiments, pedestrian segments can be automatically detected or manually cropped from the video stream and input into the terminal device, enabling the terminal device to acquire the video stream.

[0099] S202. The terminal device inputs the video stream into the multi-stage pedestrian re-identification model to obtain the attribute information, identity information, and attribute identity information of the first pedestrian in the video stream, and determines the feature vector of the first pedestrian based on the attribute information, identity information, and attribute identity information of the first pedestrian.

[0100] Specifically, the multi-stage person re-identification model is based on the sequence vector to sequence vector (Transformer) module. It constructs a three-stage model that includes attribute information extraction, identity information extraction, and attribute and identity information extraction. It fully introduces the spatiotemporal context modeling capability of Transformer into the task of video person re-identification, while also having the ability to extract rich and discriminative person information. Ultimately, this improves the accuracy of the model in large-scale person re-identification scenarios.

[0101] Please refer to Figure 3 , Figure 3 This is a schematic flowchart illustrating a method for preprocessing a video stream according to an embodiment of this application. Figure 3 The method in the code can be executed by a terminal device. For example... Figure 3 As shown, the method includes: S301 to S304.

[0102] S301. The terminal device divides each frame of the video stream into image blocks and obtains the first feature vector of the image block based on the image block.

[0103] Specifically, in this embodiment, image segmentation technology can be used to divide each frame of image into image blocks. For example, a video stream contains T frames of image data, each with a resolution of H×W. Non-overlapping segmentation technology is used to divide each frame of image data into image blocks with a resolution of P×P. Dividing each frame of image data into image blocks in this embodiment enhances the applicability of the model and reduces the amount of data and computational pressure in each operation.

[0104] In this embodiment, when obtaining the first feature vector of an image patch, a shared-weight linear projection method is used to transform a series of non-overlapping image patches with a resolution of P×P in the video stream into image patch features composed of T×N d-dimensional vectors. This is the first feature vector of the image patch, where N = (H × W) ÷ P 2 d=3P 2 N is the number of image patches.

[0105] In this embodiment of the application, when the first feature vector of the image block is obtained, data augmentation methods such as random flipping and random cropping can be used to improve the accuracy of the model in improving the pedestrian re-identification results.

[0106] In other embodiments, image patches are augmented using temporal patch shuffling. By introducing appearance noise, motion noise, etc. into the model, the image patch shuffling technique makes the model more robust to appearance and motion changes, and the model can learn more independent and discriminative features, further improving the accuracy of the model's pedestrian re-identification results.

[0107] S302. The terminal device uses the location information encoding module in the multi-stage pedestrian re-identification model to add the location information of the image block into the first feature vector to obtain the second feature vector of the image block.

[0108] Specifically, the location information of the image patch The location information of the image patch is added to the first feature vector, where it can be calculated using the following formula:

[0109]

[0110]

[0111] Where PE represents location information, pos represents location index, i represents dimension index, and d represents dimension.

[0112] In this embodiment of the application, the location information of the image block can be obtained using the above formula. join in The second feature vector of the image patch can then be obtained.

[0113] S303. The terminal device determines the first category label corresponding to the video stream in the multi-stage pedestrian re-identification model.

[0114] Specifically, after the model obtains the second feature vector of the image patch, a d-dimensional class label... Randomly initialized, in this embodiment of the application, c is determined as the first category marker corresponding to the video stream. The first category marker is used to aggregate global identity information.

[0115] S304. The terminal device inputs the second feature vector of the image block and the first category label corresponding to the video stream into the multi-stage pedestrian re-identification model.

[0116] Specifically, for ease of description, the second feature vector of the image block is denoted as X. In this embodiment, X and c are input into a multi-stage pedestrian re-identification model to re-identify pedestrians in the video stream.

[0117] Please refer to Figure 4 , Figure 4 This is a schematic flowchart illustrating a specific method of S202 provided in an embodiment of this application. Figure 4The method in the code can be executed by a terminal device. For example... Figure 4 As shown, the method includes: S401 to S404.

[0118] S401. The terminal device inputs the second feature vector of the image block and the first category label corresponding to the video stream into the attribute information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute information of the first pedestrian.

[0119] Please refer to Figure 5 , Figure 5 This is a schematic flowchart illustrating a specific method of S401 provided in an embodiment of this application. Figure 5 The method in the code can be executed by a terminal device. For example... Figure 5 As shown, the method includes: S501 to S502.

[0120] S501, The terminal device inputs the second feature vector of the image block and the first category label corresponding to the video stream into the first spatiotemporal aggregation layer of the attribute information extraction module to obtain the third feature vector of the image block and the second category label corresponding to each image block.

[0121] Specifically, the third feature vector includes the temporal feature vector and the spatial feature vector of the image patch.

[0122] In this embodiment of the application, when X and c are input into the first spatiotemporal aggregation layer of the attribute information extraction module, the processing procedure of the first spatiotemporal aggregation layer can be represented by the following formula:

[0123] X′=X+α×SA t (LN(X)).

[0124] STA(X,c)=X′,c′=[X′,c]+β×SA s (LN([X′,c])).

[0125] Where X′ represents the third feature vector of the image patch, α and β represent two learnable scalar parameters, and SA t (LN(X)) represents self-attention computation in the time dimension, LN(.) represents layer normalization, STA(X, c) represents the output of the first spatiotemporal aggregation layer, c′ represents the second class label, [.] represents the tensor concatenation operation, SA s (LN(X)) represents self-attention computation in the time dimension.

[0126] In this embodiment, the model performs self-attention calculation in the time dimension using the first temporal attention module in the first spatiotemporal aggregation layer. This self-attention calculation can be performed using SA. t(LN(X)) is used for characterization.

[0127] For example, self-attention is calculated for each image patch in the time dimension, and all the calculation results are tensor-connected. This process can be represented by the following formula:

[0128] SA t (X)=[SA(X 1,: ),…,SA(X t,: ),…,SA(X T,: )).

[0129] The self-attention calculation for each image patch in the time dimension can be performed using the following formula:

[0130] Q,K,V=XW q XW k XW v .

[0131]

[0132] Where Q, K, and V represent matrices, with matrix Q representing the image patch to be queried, matrix K representing key information within the image patch, matrix V representing additional information within the image patch, and matrix W... q W k W v Let d represent the learnable parameter matrix, where d represents the dimension.

[0133] In this embodiment, the model performs self-attention computation in the spatial dimension using the first spatial attention module in the first spatiotemporal aggregation layer. This self-attention computation can be performed using SA. s (LN([X′,c])) is used for characterization.

[0134] For example, performing self-attention computation on each image patch in the spatial dimension and then tensor-connecting all the computation results can be represented by the following formula:

[0135] SA s (X)=[SA(X ,:1 ),…,SA(X ,:s ),…,SA(X ,:T )).

[0136] The method for calculating self-attention for each image patch in the spatial dimension is the same as the method for calculating self-attention for each image patch in the temporal dimension, and will not be described again here.

[0137] S502, The terminal device inputs the third feature vector into the first attribute-related proxy layer in the attribute information extraction module to obtain the attribute information of the first pedestrian in the video stream.

[0138] Specifically, the terminal device inputs the third feature vector X′ into the first attribute-related proxy layer in the attribute information extraction module to obtain the attribute information of the first pedestrian in the video stream.

[0139] The first attribute-related proxy layer is based on the self-attention module SA(.). For example, given the input is a 2-d matrix spatiotemporal image patch feature transformed from a 3-d tensor X. and

[0140] X′=[X 0,0 ,X 0,1 ,…,X 0,N ,X 1,0 ,X 1,1 ,…,X T,N ].

[0141] The specific calculation of the first attribute-related proxy layer AAP(.) is as follows:

[0142] Q,K,V=P q ,X′W k ,X′W b .

[0143]

[0144] in, Let N be a set of learnable agents, i.e., a parameter matrix, with the number of agents N. a This parameter determines the richness of the extracted attributes. It can be manually set according to the actual application scenario, offering high flexibility, and is typically much smaller than T×N. The output of AAP is P. q The dimensions are the same. During training, the set of attributes represents identity information, at which point the AAP output is reshaped into a single vector. The pedestrians are then predicted using a linear classification layer.

[0145] S402, The terminal device inputs the third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian.

[0146] Please refer to Figure 6 , Figure 6 This is a schematic flowchart illustrating a specific method of S402 provided in an embodiment of this application. Figure 6 The method in the code can be executed by a terminal device. For example... Figure 6 As shown, the method includes: S601 to S602.

[0147] S601, The terminal device inputs the third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block into the second spatiotemporal aggregation layer in the identity information extraction module to obtain the fourth feature vector of the image block and the third category label corresponding to each image block.

[0148] Specifically, the fourth feature vector includes the temporal feature vector and the spatial feature vector of the image patch.

[0149] In this embodiment of the application, X′ and c′ obtained in S501 are input into the second spatiotemporal aggregation layer in the identity information extraction module to obtain the fourth feature vector X″ of the image block and the third category label c″ corresponding to each image block. The processing process of the first spatiotemporal aggregation layer is the same as that of the first spatiotemporal aggregation layer and will not be described again here.

[0150] S602, The terminal device inputs the fourth feature vector into the first identity-related proxy layer in the identity information extraction module to obtain the identity information of the first pedestrian.

[0151] Specifically, the terminal device inputs the fourth feature vector X″ into the first identity-related proxy layer in the identity information extraction module to obtain the identity information of the first pedestrian.

[0152] This first identity-related proxy layer is based on the self-attention module SA(.). For example, given the input is a 2-d matrix spatiotemporal image patch feature transformed from a 3-d tensor X. and

[0153] X″=[X 0,0 ,X 0,1 ,…,X 0,N ,X 1,0 ,X 1,1 ,…,X T,N ].

[0154] The specific calculation of the first identity-related proxy layer IAP(.) is as follows:

[0155] Q,K,V=X″W q ,P k ,P v ,

[0156]

[0157] Among them, P k P0 is a set of learnable surrogates, i.e., parameter matrices, used to find and aggregate discriminative features in the spatiotemporal image patch feature vectors. Since P k ,P v The required number of agents is much smaller than T×N, and IAP can aggregate spatiotemporally global discriminative features more efficiently than the traditional Transformer.

[0158] S403. The terminal device inputs the third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian.

[0159] Specifically, the third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream are input into the third spatiotemporal aggregation layer and the second identity-related proxy layer in the attribute identity information extraction module to obtain the attribute identity information of the first pedestrian.

[0160] In this embodiment, X′ obtained in S501 and c obtained in S303 are input into the third spatiotemporal aggregation layer and the second identity-related proxy layer in the attribute identity information extraction module to obtain the attribute identity information of the first pedestrian. In this embodiment, the randomly initialized c is used as input in order to eliminate the prior knowledge obtained when extracting attribute information in the attribute information extraction module, so as to better generate the attribute-identity representation of the pedestrian.

[0161] The difference between the processing procedures of the third spatiotemporal aggregation layer and the first spatiotemporal aggregation layer lies in:

[0162] The third spatiotemporal aggregation module has a second attribute-related proxy layer and a third attribute-related proxy layer configured before and after the time aggregation layer. These layers help the second temporal attention module extract attribute information from image patches and enable the attribute information to interact and fuse between different frames.

[0163] The processing procedure for the second identity-related proxy layer is the same as that for the first identity-related proxy layer, and will not be repeated here.

[0164] S404. The terminal device performs a weighted concatenation of the first pedestrian's attribute information, identity information, and attribute-identity information to determine the first pedestrian's feature vector.

[0165] In this embodiment, different weights are pre-assigned to the attribute information, identity information, and attribute identity information of the first pedestrian. The attribute information, identity information, and attribute identity information of the first pedestrian are then weighted and connected according to the weights, and the weighted connection result is determined as the feature vector of the first pedestrian.

[0166] S203. The terminal device determines the matching degree between the target pedestrian and each first pedestrian in the video stream based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, and determines the first pedestrian corresponding to the maximum matching degree among the matching degrees as the recognition result for re-identifying the target pedestrian.

[0167] In this embodiment of the application, distance calculation methods, such as Euclidean distance, Mahalanobis distance, and cosine distance, can be used to calculate the distance between the feature vector of the target pedestrian and the feature vector of the first pedestrian. The calculation result is determined as the matching degree between the target pedestrian and each first pedestrian in the video stream, and the first pedestrian corresponding to the maximum matching degree is determined as the recognition result of re-identifying the target pedestrian.

[0168] In summary, the technical solution of this application involves acquiring a video stream and an image of the target pedestrian, and determining the feature vector of the target pedestrian based on the image. The video stream is then input into a multi-stage pedestrian re-identification model to obtain the attribute information, identity information, and attribute-identity information of the first pedestrian in the video stream. Based on this information, the feature vector of the first pedestrian is determined. The matching degree between the target pedestrian and each first pedestrian in the video stream is determined based on the feature vectors of the target pedestrian and the first pedestrians. The first pedestrian with the highest matching degree is then identified as the result of the re-identification of the target pedestrian. In other words, this embodiment of the application can obtain the attribute information, identity information, and attribute-identity information of the first pedestrian through a multi-stage pedestrian re-identification model, thereby determining the feature vector of the first pedestrian. Based on the feature vectors of the first pedestrian and the target pedestrian, the target pedestrian can be identified among the first pedestrians, improving the accuracy of the pedestrian re-identification results.

[0169] It should be understood that the sequence number of each step in the above embodiments does 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.

[0170] Please refer to Figure 7 , Figure 7 This is a schematic diagram of a pedestrian re-identification device provided in an embodiment of this application. The device includes:

[0171] The acquisition module 71 is used to acquire the video stream and the image of the target pedestrian, and determine the feature vector of the target pedestrian based on the image of the target pedestrian;

[0172] The determination module 72 is used to input the video stream into the multi-stage pedestrian re-identification model to obtain the attribute information, identity information and attribute identity information of the first pedestrian in the video stream, and to determine the feature vector of the first pedestrian based on the attribute information, identity information and attribute identity information of the first pedestrian.

[0173] The matching module 73 is used to determine the matching degree between the target pedestrian and each first pedestrian in the video stream based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, and to determine the first pedestrian corresponding to the maximum matching degree among the matching degrees as the recognition result of re-identifying the target pedestrian.

[0174] The determining module 72 is further used to divide each frame image in the video stream into image blocks, and obtain the first feature vector of the image block based on the image block;

[0175] By using the location encoding module in the multi-stage pedestrian re-identification model, the location information of the image block is added to the first feature vector to obtain the second feature vector of the image block;

[0176] In a multi-stage pedestrian re-identification model, the first category label corresponding to the video stream is determined;

[0177] The second feature vector of the image block and the first category label corresponding to the video stream are input into the multi-stage pedestrian re-identification model.

[0178] The determining module 72 is also used to input the second feature vector of the image block and the first category label corresponding to the video stream into the attribute information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute information of the first pedestrian.

[0179] The third feature vector of the image patch output by the attribute information extraction module and the second category label corresponding to each image patch are input into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian.

[0180] The third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream are input into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian.

[0181] The attribute information, identity information, and attribute-identity information of the first person are weighted and linked to determine the feature vector of the first person.

[0182] The determining module 72 is further used to input the second feature vector of the image block and the first category label corresponding to the video stream into the first spatiotemporal aggregation layer of the attribute information extraction module to obtain the third feature vector of the image block and the second category label corresponding to each image block. The third feature vector includes the temporal feature vector and the spatial feature vector of the image block.

[0183] The third feature vector is input into the first attribute-related proxy layer in the attribute information extraction module to obtain the attribute information of the first pedestrian in the video stream.

[0184] The determining module 72 is also used to input the third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block into the second spatiotemporal aggregation layer in the identity information extraction module to obtain the fourth feature vector of the image block and the third category label corresponding to each image block. The fourth feature vector includes the temporal feature vector and the spatial feature vector of the image block.

[0185] The fourth feature vector is input into the first identity-related proxy layer in the identity information extraction module to obtain the identity information of the first pedestrian.

[0186] The determining module 72 is further used to input the third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream into the third spatiotemporal aggregation layer and the second identity-related proxy layer in the attribute identity information extraction module to obtain the attribute identity information of the first pedestrian. The second attribute-related proxy layer and the third attribute-related proxy layer are configured before and after the time aggregation layer in the third spatiotemporal aggregation module.

[0187] The determination module 72 is also used to perform data augmentation on the image block by randomly perturbing the image block.

[0188] 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 merely 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. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0189] like Figure 8 As shown, this application embodiment also provides a terminal device 200, including a memory 21, a processor 22, and a computer program 23 stored in the memory 21 and executable on the processor 22. When the processor 22 executes the computer program 23, it implements the pedestrian re-identification method of the above embodiments.

[0190] The processor 22 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. The general-purpose processor can be a microprocessor or any conventional processor.

[0191] The memory 21 can be an internal storage unit of the terminal device 200. The memory 21 can also be an external storage device of the terminal device 200, such as a plug-in hard drive, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal device 200. Furthermore, the memory 21 can include both internal and external storage units of the terminal device 200. The memory 21 is used to store computer programs and other programs and data required by the terminal device 200. The memory 21 can also be used to temporarily store data that has been output or will be output.

[0192] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the pedestrian re-identification method of the above embodiments.

[0193] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the pedestrian re-identification method described in the above embodiments.

[0194] If the integrated 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 of this application can 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 includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable storage media cannot be electrical carrier signals or telecommunication signals.

[0195] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0196] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0197] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0198] 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 method for pedestrian re-identification, characterized in that, include: Acquire video streams and images of the target pedestrian, and determine the feature vector of the target pedestrian based on the images of the target pedestrian; The video stream is divided into image blocks for each frame, and a first feature vector for each image block is obtained based on the image blocks. Using the location encoding module in the multi-stage pedestrian re-identification model, the location information of the image block is added to the first feature vector to obtain the second feature vector of the image block; In the multi-stage pedestrian re-identification model, a first category label corresponding to the video stream is determined; The second feature vector of the image block and the first category label corresponding to the video stream are input into the first spatiotemporal aggregation layer in the attribute information extraction module to obtain the third feature vector of the image block and the second category label corresponding to each image block. The third feature vector includes the temporal feature vector and the spatial feature vector of the image block. The third feature vector is input into the first attribute-related proxy layer in the attribute information extraction module to obtain the attribute information of the first pedestrian in the video stream. The first attribute-related proxy layer is used to extract the attribute information of the first pedestrian in the video stream. The third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block are input into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian. The third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream are input into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian. The first pedestrian's attribute information, identity information, and attribute-identity information are weighted and concatenated to determine the first pedestrian's feature vector; Based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, the matching degree between the target pedestrian and each of the first pedestrians in the video stream is determined, and the first pedestrian corresponding to the maximum matching degree among the matching degrees is determined as the recognition result for re-identifying the target pedestrian.

2. The method according to claim 1, characterized in that, The step of inputting the third feature vector of the image patch output by the attribute information extraction module and the second category label corresponding to each image patch into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian includes: The third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block are input into the second spatiotemporal aggregation layer in the identity information extraction module to obtain the fourth feature vector of the image block and the third category label corresponding to each image block. The fourth feature vector includes the temporal feature vector and the spatial feature vector of the image block. The fourth feature vector is input into the first identity-related proxy layer in the identity information extraction module to obtain the identity information of the first pedestrian. The first identity-related proxy layer is used to extract the identity information of the first pedestrian.

3. The method according to claim 1, characterized in that, The third feature vector of the image patch output by the attribute information extraction module and the first category label corresponding to the video stream are input into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian, including: The third feature vector of the image patch output by the attribute information extraction module and the first category label corresponding to the video stream are input into the third spatiotemporal aggregation layer and the second identity-related proxy layer in the attribute identity information extraction module to obtain the attribute identity information of the first pedestrian. The second attribute-related proxy layer and the third attribute-related proxy layer are configured before and after the time aggregation layer in the third spatiotemporal aggregation layer. The second attribute-related proxy layer and the third attribute-related proxy layer are used to help the third spatiotemporal aggregation layer extract attribute information from the image patch and enable attribute information to interact and fuse between different frames. The second identity-related proxy layer is used to extract the identity information of the first pedestrian.

4. The method according to claim 1, characterized in that, Before inputting the second feature vector of the image patch and the first category label corresponding to the video stream into the multi-stage person re-identification model, the method further includes: Data augmentation is performed on the image blocks by randomly perturbing them.

5. A pedestrian re-identification device, characterized in that, include: The acquisition module is used to acquire the video stream and the image of the target pedestrian, and determine the feature vector of the target pedestrian based on the image of the target pedestrian; The determination module is used to divide each frame of the video stream into image blocks, and obtain a first feature vector of the image block based on the image block; using the position encoding module in the multi-stage person re-identification model, the position information of the image block is added to the first feature vector to obtain a second feature vector of the image block; a first category label corresponding to the video stream is determined in the multi-stage person re-identification model; the second feature vector of the image block and the first category label corresponding to the video stream are input into the first spatiotemporal aggregation layer in the attribute information extraction module to obtain a third feature vector of the image block and a second category label corresponding to each image block, wherein the third feature vector includes the temporal feature vector and spatial feature vector of the image block; the third feature vector is input into the attribute information extraction module. The first attribute-related proxy layer in the block obtains the attribute information of the first pedestrian in the video stream. The first attribute-related proxy layer is used to extract the attribute information of the first pedestrian in the video stream. The third feature vector of the image block output by the attribute information extraction module and the second category label corresponding to each image block are input into the identity information extraction module in the multi-stage pedestrian re-identification model to obtain the identity information of the first pedestrian. The third feature vector of the image block output by the attribute information extraction module and the first category label corresponding to the video stream are input into the attribute identity information extraction module in the multi-stage pedestrian re-identification model to obtain the attribute identity information of the first pedestrian. The attribute information of the first pedestrian, the identity information, and the attribute identity information are weighted and concatenated to determine the feature vector of the first pedestrian. The matching module is used to determine the matching degree between the target pedestrian and each of the first pedestrians based on the feature vector of the target pedestrian and the feature vector of the first pedestrian, and to determine the first pedestrian corresponding to the maximum matching degree among the matching degrees as the recognition result for re-identifying the target pedestrian.

6. A terminal device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the pedestrian re-identification method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the pedestrian re-identification method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Video pedestrian re-identification method

    CN114202739A