A pedestrian re-identification method and device
By extracting image perspective and pose features, a virtual pedestrian image dataset is generated using a diffusion model. The pedestrian re-identification model is then trained using wavelet convolution and a multi-scale feature interaction network. This addresses the issues of insufficient modeling of long-distance identity associations and data scarcity, thereby improving the accuracy and stability of pedestrian re-identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI UNIV OF TECH
- Filing Date
- 2026-05-21
- Publication Date
- 2026-07-10
AI Technical Summary
Existing pedestrian re-identification methods are insufficient in modeling long-distance identity associations in complex scenarios, and identity recognition biases are caused by the scarcity and uneven distribution of training data.
By extracting image perspective features, pedestrian posture features, and identity features, virtual pedestrian images are generated using a diffusion model. The dataset is expanded and a convolutional neural network model is trained. Feature reconstruction and enhancement are performed by combining wavelet convolution and multi-scale feature interaction networks to construct a pedestrian re-identification model.
It solves the problems of scarce and unevenly distributed training data, and improves the stability and accuracy of pedestrian re-identification in complex occlusion, blur and compression distortion scenarios. It is suitable for edge devices and real-time monitoring scenarios.
Smart Images

Figure CN122369068A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and specifically to a method and apparatus for pedestrian re-identification. Background Technology
[0002] Person re-identification (ReID) is one of the core tasks in computer vision, aiming to retrieve and match specific pedestrian targets in video sequences spanning different camera perspectives. With the widespread deployment of intelligent surveillance systems, ReID technology has significant application value in finding missing persons, tracking suspects, and analyzing crowd density. Convolutional neural network-based ReID methods have made significant progress in feature extraction and representation learning, becoming the mainstream technology in this field.
[0003] Although existing pedestrian re-identification methods have achieved high accuracy, they still face two prominent problems in complex scenarios. Firstly, there is insufficient modeling of long-distance identity associations during image feature extraction. Existing local feature extraction and multi-granularity fusion structures largely rely on spatial domain convolution operations, lacking stable frequency band division mechanisms and cross-body part relationship modeling mechanisms. While existing technologies have proposed a wavelet convolution method to decompose extracted image features in the frequency domain, thereby improving feature representation in low-resolution and blurred scenes and balancing global structure perception, noise suppression, and detail preservation, current wavelet convolution networks still only use frequency band convolution and local convolution to propagate feature information. They do not utilize frequency band division mechanisms to process sub-band features in different frequency domains, resulting in insufficient modeling of long-distance identity associations between the head and shoulder region, torso region, and shoe region of a pedestrian in the image.
[0004] Secondly, the scarcity and uneven distribution of training data lead to identity recognition bias. Existing publicly available pedestrian image datasets generally suffer from long-tailed distribution, insufficient pose types, and inadequate coverage of viewpoint changes. Although some image augmentation methods can expand and generate samples from pedestrian datasets, if the generated pedestrian images lack the ability to preserve the corresponding identities, or if the coupling between pose changes and identity information is unstable, artifacts, texture misalignment, or identity drift can easily be introduced, thus affecting the recognition accuracy of pedestrian re-identification models in complex occlusion, blurring, and compression distortion scenarios. Summary of the Invention
[0005] In view of this, it is necessary to provide a pedestrian re-identification method and apparatus to solve the problems of insufficient modeling of long-distance identity association during feature extraction in existing pedestrian re-identification methods, and identity recognition bias caused by the scarcity and uneven distribution of training data.
[0006] To address the above problems, this invention provides a pedestrian re-identification method, comprising: For each original pedestrian image in the original pedestrian dataset, image viewpoint features and pedestrian pose features are extracted respectively, and identity features are extracted from the original pedestrian images to obtain identity feature vectors, wherein the original pedestrian images have corresponding pedestrian identity labels; The identity feature vector is reconstructed to obtain identity sequence features, and a diffusion model is called to perform diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image. The virtual pedestrian image has the same pedestrian identity label as the original pedestrian image. The virtual pedestrian images are added to the original pedestrian dataset to obtain an expanded dataset, and a convolutional neural network model is trained based on the expanded dataset to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected in sequence. The wavelet convolution module includes multiple cascaded WSSM modules. The WSSM module includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform of the wavelet convolution network, and a scaling dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform of the wavelet convolution network. The pedestrian re-identification model is invoked to identify the target pedestrian image to be identified, and the pedestrian re-identification result is obtained.
[0007] In one possible implementation, reconstructing the identity feature vector to obtain identity sequence features includes: The identity feature vector is linearly mapped, and the mapped feature vector is transformed back into multiple feature tokens of the same dimension. The feature token is normalized to obtain the identity sequence feature.
[0008] In one possible implementation, the invocation of the diffusion model performs diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image, including: The encoder of the VAE model is invoked to encode the original pedestrian image into latent variables; The latent variables are input into the noise addition module of the diffusion model for noise addition, resulting in a noise vector; The noise vector, the image viewpoint features, the pedestrian pose features, and the identity sequence features are input into the denoising module of the diffusion model for denoising to obtain a denoised vector. The VAE model's decoder is invoked to decode the denoised vector, thereby obtaining a virtual pedestrian image.
[0009] In one possible implementation, training a convolutional neural network model based on the expanded dataset to obtain a person re-identification model includes: The initial image features of the pedestrian image samples in the augmented dataset are extracted by calling the initial feature extraction module of the convolutional neural network model. The initial image features are sequentially input into multiple cascaded WSSM modules in the convolutional neural network model for reconstruction, resulting in reconstructed image features. The downsampling module of the convolutional neural network model is invoked to downsample the reconstructed image features to obtain downsampled features; The downsampled features are pooled at different scales, and the feature vectors obtained at different scales are concatenated to obtain a comprehensive image feature vector. Based on the comprehensive image feature vector, pedestrian image samples, and pedestrian identity labels, a final loss function is constructed, and a convolutional neural network model is trained based on the final loss function to obtain a pedestrian re-identification model.
[0010] In one possible implementation, constructing the final loss function based on the integrated image feature vector, pedestrian image samples, and pedestrian identity labels includes: A label-smoothing cross-entropy loss function is constructed based on the comprehensive image feature vector and pedestrian identity labels. A batch hard sample triplet loss function is constructed based on the original pedestrian image samples and virtual pedestrian image samples with the same pedestrian identity labels in the pedestrian image samples, and a real-virtual identity consistency loss function is constructed based on the feature distance between the original pedestrian image samples and the virtual pedestrian image samples. The final loss function is obtained by weighted summing of the label smooth cross-entropy loss function, the batch hard sample triplet loss function, and the real-virtual identity consistency loss function.
[0011] In one possible implementation, the refactoring process of the WSSM module includes: The initial image features are input into each path branch of the WSSM module, and the initial image features are transformed by the wavelet convolutional network in the wavelet transform processing module to obtain low-frequency structure sub-bands and multiple high-frequency detail sub-bands. Frequency domain features are extracted from the low-frequency structural sub-band and the high-frequency detail sub-band respectively to obtain the corresponding low-frequency sub-band features and high-frequency sub-band features; The low-frequency subband features are scanned in the state space, and the scaled dot product attention network and learnable memory in the wavelet transform processing module are called to retrieve the memory of the scanned feature vectors to obtain the memory vectors. The feature vector and the memory vector are concatenated, and a depthwise separable convolutional network is called to perform inverse mapping on the concatenated feature vector and the low-frequency subband features respectively. The low-frequency subbands obtained by inverse mapping are then concatenated to obtain the low-frequency enhanced subband. The spliced high-frequency detail subbands are locally convolved to obtain local gated response coefficients, and the low-frequency enhancement subbands are globally averaged to obtain global gated response coefficients. The local gated response coefficients and the global gated response coefficients are input into the gated network in the wavelet transform processing module for gated fusion to obtain a gated weight map. The high-frequency detail subband is then modulated based on the gated weight map to obtain the enhanced high-frequency detail subband. Perform inverse wavelet transform on the enhanced high-frequency detail subband and the low-frequency enhancement subband to obtain the transformed image features; The multi-scale feature interaction network of the WSSM module is invoked to perform feature interaction processing on the transformed image features of each path branch, and the features obtained from the interaction processing are concatenated with the initial image features to obtain the reconstructed image features.
[0012] In one possible implementation, the step of calling the pedestrian re-identification model to identify the target pedestrian image to obtain the pedestrian re-identification result includes: The pedestrian re-identification model is invoked to extract target image features from the target pedestrian image to be identified. Based on the features of the target image, the expanded dataset is retrieved to obtain the retrieved pedestrian images; The pedestrian identity label corresponding to the retrieved pedestrian image is used as the pedestrian re-identification result of the target pedestrian image to be identified.
[0013] The present invention also provides a pedestrian re-identification device, comprising: The feature extraction module is used to extract image viewpoint features and pedestrian pose features from each original pedestrian image in the original pedestrian dataset, and to extract identity features from the original pedestrian images to obtain an identity feature vector, wherein the original pedestrian images have corresponding pedestrian identity labels; The diffusion processing module is used to reconstruct the identity feature vector to obtain identity sequence features, and call the diffusion model to perform diffusion processing on the image viewpoint features, the pedestrian pose features and the identity sequence features to obtain a virtual pedestrian image. The virtual pedestrian image has the same pedestrian identity label as the original pedestrian image. The model training module is used to add the virtual pedestrian images to the original pedestrian dataset to obtain an expanded dataset, and train a convolutional neural network model based on the expanded dataset to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected in sequence. The wavelet convolution module includes multiple cascaded WSSM modules. The WSSM module includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform of the wavelet convolution network, and a scaling dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform of the wavelet convolution network. The pedestrian re-identification module is used to call the pedestrian re-identification model to identify the target pedestrian image and obtain the pedestrian re-identification result.
[0014] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a program; the processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the pedestrian re-identification method described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the pedestrian re-identification method described above.
[0016] The beneficial effects of the above implementation are as follows: The pedestrian re-identification method and apparatus provided by this invention, firstly, in terms of dataset expansion, extracts additional identity feature vectors while extracting image viewpoint features and pedestrian pose features, and processes them separately as identity sequence features. These are then used together with the image viewpoint features and pedestrian pose features to generate images through diffusion. This ensures that the image generation process is strongly constrained by identity information. This not only achieves data augmentation through image diffusion generation, solving the problems of scarce and imbalanced training data, but also, through the constraint of image identity information, even when the original pedestrian pose and image viewpoint are significantly changed, the generated image can strictly maintain fine-grained identity features, solving the identity drift problem caused by data augmentation. In terms of feature extraction, memory-enhanced state space modeling is performed based on wavelet convolution. A scaled dot product attention network is constructed to enhance the spatial memory of the low-frequency structural sub-bands of the wavelet transform. This allows the low-frequency structural components of image features to propagate long-distance relationships across different parts. When combined with a gating enhancement mechanism for high-frequency detail sub-bands, it ensures noise suppression while preserving identity-related details such as clothing folds, shoe textures, and backpack straps. This improves the stability and accuracy of pedestrian re-identification in complex occlusion, blurring, and compression distortion scenarios. Furthermore, the wavelet transform processing module enhances global structural perception capabilities with lower computational overhead, making the pedestrian re-identification model more suitable for deployment on edge devices and in real-time monitoring scenarios. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the pedestrian re-identification method provided by the present invention. Figure 2 A schematic diagram illustrating the principle of image diffusion generation provided by this invention; Figure 3 This is a schematic diagram illustrating the training of the pedestrian re-identification model provided by the present invention; Figure 4 A simplified structural diagram of the WSSM module provided by this invention; Figure 5 A schematic diagram illustrating the principle of pedestrian re-identification provided by the present invention; Figure 6 This is a schematic diagram of the pedestrian re-identification device provided by the present invention; Figure 7 A schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0020] In the description of the embodiments of this application, unless otherwise stated, "a plurality of" means two or more.
[0021] In this embodiment of the invention, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, apparatus, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such process, method, product or device.
[0022] The naming or numbering of steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effect can be achieved.
[0023] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0024] The pedestrian re-identification method and apparatus provided by this invention can be applied to scenarios requiring pedestrian re-identification, such as missing persons detection, target person monitoring, and pedestrian density analysis. The executing entity can be various servers, terminals, or remote cloud devices. An original pedestrian dataset is formed by collecting original pedestrian images from the corresponding scenario. Then, the pedestrian re-identification method and apparatus provided by this invention are used to train a pedestrian re-identification model. When pedestrian re-identification is needed, the pedestrian re-identification model is directly invoked to identify the target pedestrian image, obtaining the pedestrian re-identification result, which is then used for judgment in the corresponding scenario.
[0025] The pedestrian re-identification method provided by this invention will be described in detail below.
[0026] Figure 1This is a flowchart illustrating the pedestrian re-identification method provided by the present invention, as shown below. Figure 1 As shown, the pedestrian re-identification method can be implemented by the following steps 101 to 104, which are explained in detail below.
[0027] Step 101: Extract image viewpoint features and pedestrian pose features from each original pedestrian image in the original pedestrian dataset, and extract identity features from the original pedestrian images to obtain identity feature vectors.
[0028] like Figure 2 As shown, a large number of original pedestrian images are first acquired in a specific pedestrian re-identification scenario to form the original pedestrian dataset. Each original pedestrian image has a corresponding pedestrian identity label, which is a one-hot encoded vector used to represent the identity of the pedestrian in the image, such as target person or non-target person. The pedestrian pose features can be obtained by extracting skeleton keypoint maps from the original pedestrian images using a pose encoder, and then encoding them into embeddings to obtain the pedestrian pose features, denoted as . This is used to control the actions and limb postures of the generated pedestrians during image generation. Furthermore, to explicitly control the viewing angle of the generated image, image viewpoint features can be extracted from the original pedestrian image. These image viewpoint features characterize the pedestrian's viewing angle relative to the camera, such as frontal, side, back view, or different yaw angles. Specifically, the viewpoint extracted from the original pedestrian image can be embedded as image viewpoint features using a viewpoint encoder, denoted as... This is used to control the perspective representation of the generated pedestrian in the image during image generation. Identity feature extraction can utilize a pre-trained ReID encoder to extract a high-dimensional identity feature vector from the original pedestrian image, denoted as... This is used to represent the unique identity ID information of pedestrians in an image.
[0029] Step 102: Reconstruct the identity feature vector to obtain the identity sequence features, and call the diffusion model to perform diffusion processing on the image viewpoint features, pedestrian pose features and identity sequence features to obtain the virtual pedestrian image.
[0030] To avoid losing identity information during subsequent image diffusion generation, such as Figure 2 As shown, this embodiment of the invention designs an identity feature redistribution module to reconstruct the extracted identity feature vector into structured sequence features. The identity feature redistribution module can be implemented by introducing an Identity Feature Refinement (IFR) module.
[0031] In one possible implementation, the identity feature vector is reconstructed to obtain the identity sequence features. This can be achieved in the following ways, which will be explained in detail below.
[0032] First, the identity feature vector is linearly mapped, and the mapped feature vector is transformed into multiple feature tokens of the same dimension. Then, the feature tokens are normalized to obtain the identity sequence features.
[0033] Linear mapping can be achieved using fully connected neural networks, with the aim of transforming identity feature vectors. Mapping to a high-dimensional space. The retransformation reorganizes the high-dimensional feature vector into N feature tokens of dimension d. The final normalization process ensures the stability of the feature distribution. The normalized feature tokens are then processed sequentially to form an identity sequence feature, denoted as F, which serves as the identity conditional input to the diffusion model's denoising network. The specific reconstruction process of the identity feature vector can be expressed by the following formula: (1) Where W and b represent the learnable weight matrix and bias term in the linear mapping process, respectively. Represents the feature processing function of the retransformation. This represents the normalization function.
[0034] In this embodiment of the invention, by reconstructing the extracted identity feature vectors, identity sequence features are obtained and used as input for the cross-attention mechanism calculation in the subsequent diffusion model. This provides fine-grained identity constraints for the diffusion-generated image process. This feature retransformation redistribution strategy allows identity information to be injected more evenly and deeply into each generated image pixel region through the cross-attention mechanism.
[0035] like Figure 2As shown, the extracted image viewpoint features, pedestrian pose features, and identity sequence features are input into the diffusion model for diffusion processing. During the diffusion generation process, a variational autoencoder (VAE) model can be used to encode the image and decode the features. In the diffusion model, each feature is jointly used as a constraint to control the process of generating pedestrian images. Image viewpoint features control the perspective of the generated pedestrian in the image, pedestrian pose features control the action form and posture of the generated pedestrian, and identity sequence features strictly constrain the identity consistency of the generated pedestrian. When the denoising module of the diffusion model denoises the noise vector, image viewpoint features, pedestrian pose features, and identity sequence features are jointly introduced to generate denoised latent vectors, which are then decoded to obtain multiple virtual pedestrian images. For example, for each original pedestrian image, the diffusion model generates 8 candidate virtual pedestrian images with different poses and viewpoints, and then uses identity consistency filtering and viewpoint pose coverage filtering to obtain virtual pedestrian images for training. The virtual pedestrian images have the same identity features as the original pedestrian images, only differing in image perspective and pedestrian posture. Thus, data augmentation of the original pedestrian images is achieved without affecting identity information. The selected virtual pedestrian images can then enter the subsequent model training stage.
[0036] In one possible implementation, a diffusion model is invoked to diffuse the image viewpoint features, pedestrian pose features, and identity sequence features to obtain a virtual pedestrian image. This can be achieved in the following ways, which are explained in detail below.
[0037] First, the encoder of the VAE model is called to encode the original pedestrian image into a noise latent variable.
[0038] like Figure 2 As shown, the encoder of the VAE model can map the original pedestrian image to the latent space, and the noise latent variable generated by its encoding is denoted as... , as a reference benchmark for diffusion generation.
[0039] Furthermore, the latent noise variables are input into the denoising module of the diffusion model for denoising, resulting in a noise vector. The diffusion model includes a denoising module and a denoising module, where the denoising module is used for diffusion denoising, specifically using a specific time step t as the latent noise variable. Adding noise, such as Gaussian noise, ultimately generates a noise vector that is entirely noise, denoted as . .
[0040] Next, the noise vector, image viewpoint features, pedestrian pose features, and identity sequence features are input into the denoising module of the diffusion model for denoising to obtain the denoised vector.
[0041] Here, at each time step t, the pedestrian pose features output by the pose encoder are... It will first be compared with the image view features output by the view encoder. and noise vector The vectors are superimposed and used as input to the denoising module, which can be implemented using the U-net model. During the denoising process in the U-net model, the identity sequence features H output by the identity feature redistribution module are directly input into the U-net model. After denoising, the U-net model outputs a denoised vector, denoted as H0. Since the noise generation module generates noise vectors according to time step t, and the denoising module also performs denoising according to time step t, the diffusion generation process of the diffusion module can be expressed as the following formula: (2) in, This represents the latent noise variable output by the noise-adding module at the current time step t. This represents the pedestrian pose features input to the denoising module. This represents the image viewpoint features input to the denoising module. This represents the identity sequence features output by the identity feature redistribution module. This represents the processing function of the noise reduction module. Indicates the current time step The output denoised vector, where T represents the total number of time steps.
[0042] Finally, the VAE model's decoder is called to decode the denoised vector, resulting in a virtual pedestrian image.
[0043] See also Figure 2 The denoised vector output by the denoising module The data is directly input into the VAE model's decoder for decoding. Feature decoding restores the denoised vector into a new pedestrian image. By controlling the parameters of feature decoding, multiple virtual pedestrian images with different viewpoints and poses can be output. Due to the addition of identity feature vectors, the pedestrian identity labels in the multiple virtual pedestrian images generated by diffusion remain consistent with the original pedestrian images, with no identity loss, only differences in viewpoint or pose. Further, an identity consistency score is calculated for the generated virtual pedestrian images to verify their identity consistency. Only virtual pedestrian images whose identity consistency scores meet a preset threshold are used as augmentation samples in the training phase and added to the original pedestrian dataset to obtain the augmented dataset. During addition, selection is based on the distribution of image viewpoints and pedestrian poses to ensure that each original pedestrian image in the augmented dataset corresponds to multiple virtual pedestrian images with different viewpoints, various pedestrian poses, and consistent pedestrian identity labels.
[0044] In this embodiment of the invention, by incorporating extracted image perspective features, pedestrian posture features, and identity sequence features into the image diffusion generation process, the image generation process is strongly constrained by identity information. This achieves data augmentation and expands the dataset while ensuring that the image identity information remains unchanged. Even when pedestrian posture and image perspective are significantly changed, the generated image can strictly maintain fine-grained identity features, thus solving the identity drift problem caused by pedestrian image data augmentation in the prior art.
[0045] Step 103: Add the virtual pedestrian images to the original pedestrian dataset to obtain an expanded dataset, and train a convolutional neural network model based on the expanded dataset to obtain a pedestrian re-identification model.
[0046] like Figure 3 As shown, the virtual pedestrian images generated by the diffusion model are first filtered for identity consistency and viewpoint / pose coverage before being added to the original pedestrian dataset to obtain the augmented dataset. The pedestrian identity labels corresponding to the virtual pedestrian images are still the same as those of the original pedestrian images. Therefore, the pedestrian image samples in the augmented dataset all include the original pedestrian images, virtual pedestrian images, and shared pedestrian identity labels. Based on the pedestrian image samples, a pedestrian re-identification model can be trained for pedestrian re-identification.
[0047] To avoid the negative impact of artifact noise from virtual pedestrian images on model training, this embodiment of the invention introduces a scaling factor and an identity consistency screening threshold to control the quantity contribution and sample quality of virtual pedestrian images. That is, only virtual pedestrian images that meet the identity consistency threshold and have supplementary viewpoint pose distribution are included in the training.
[0048] The pedestrian re-identification model can be designed as a convolutional neural network (CNN) model. This CNN model includes sequentially connected initial feature extraction modules, wavelet convolution modules, and downsampling modules. The wavelet convolution module comprises multiple cascaded wavelet state space modules (WSSMs). The WSSM module includes a dual-path parallel wavelet transform processing module (MT) and a multi-scale feature interaction network. Further, the wavelet transform processing module (MT) includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform, and a scaled dot-product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform.
[0049] When training a convolutional neural network model by augmenting pedestrian image samples and pedestrian identity labels in a dataset, the model extracts image features from the augmented dataset to construct a loss function through forward propagation. This loss function is used to update the parameters of the convolutional neural network model during backpropagation. The final trained convolutional neural network model can then be used as a pedestrian re-identification model.
[0050] In one possible implementation, a convolutional neural network model is trained based on an expanded dataset to obtain a pedestrian re-identification model, which can be achieved in the following way.
[0051] First, the initial feature extraction module of the convolutional neural network model is called to extract the initial image features of pedestrian image samples in the augmented dataset.
[0052] During training, the original pedestrian images and virtual pedestrian images in the pedestrian image samples are mixed and sampled according to the same identity label and then input into the convolutional neural network model, so that the virtual pedestrian images participate in the optimization of model parameters, rather than just being used as auxiliary views for feature fusion during the inference stage.
[0053] like Figure 3 As shown, during the forward propagation of the convolutional neural network model, image features are processed sequentially through the initial feature extraction module, the wavelet convolution module, and the downsampling module. After pedestrian image samples from the augmented dataset are input into the convolutional neural network model, they first enter the initial feature extraction module. This module aims to perform image feature preprocessing, extracting low-level structural information of the image while reducing the spatial dimension of the image.
[0054] Secondly, the initial image features are sequentially input into multiple cascaded WSSM modules of the wavelet convolution module in the convolutional neural network model for reconstruction, to obtain the reconstructed image features.
[0055] After the initial image features are input into the wavelet convolution module of the convolutional neural network model, they directly enter the WSSM module. The wavelet convolution module includes multiple cascaded WSSM modules, each of which includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. In this embodiment of the invention, memory-enhanced state-space modeling is additionally introduced during the wavelet convolution feature extraction process of the WSSM module. The wavelet transform processing module incorporates a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform, and a scaled dot-product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform. This allows the convolutional neural network model to further improve its ability to model long-distance relationships across different parts while utilizing virtual pedestrian images for training data augmentation. The initial image features are processed by wavelet transform processing modules at different scales within the WSSM module to reconstruct the features. Then, the multi-scale feature interaction network is used to achieve the interaction and synthesis of feature information, ultimately yielding the reconstructed image features.
[0056] Next, the downsampling module of the convolutional neural network model is called to downsample the reconstructed image features to obtain downsampled features. The downsampled features are then pooled at different scales, and the feature vectors obtained at different scales are concatenated to obtain a comprehensive image feature vector.
[0057] See also Figure 3 The reconstructed image features output by the wavelet convolution module are further input into the downsampling module for downsampling. Downsampling reduces the feature map size while retaining key feature information. Specifically, the downsampled features output by the downsampling module are subjected to pooling at different scales to obtain 512-dimensional and 256-dimensional feature vectors, respectively. Finally, the features are concatenated to output a 768-dimensional comprehensive image feature vector.
[0058] Finally, a final loss function is constructed based on the comprehensive image feature vector, pedestrian image samples, and pedestrian identity labels, and a convolutional neural network model is trained based on the final loss function to obtain the pedestrian re-identification model.
[0059] Here, this embodiment of the invention employs a multi-branch supervision strategy when training the convolutional neural network model. Specifically, based on the comprehensive image feature vector and the pedestrian identity labels corresponding to the original pedestrian image samples and virtual pedestrian image samples in the pedestrian image samples, label smooth cross-entropy (LSCE) loss, batch hard triplet loss, and real-virtual identity consistency loss are constructed respectively. The three scale branches independently calculate the above losses and then fuse them to obtain the final loss function, thereby enabling the network to learn discriminative features at multiple granular levels. The final loss function is used for backpropagation in the convolutional neural network model. Backpropagation calculates the model's gradient, and the gradient is optimized using a gradient optimization algorithm to adjust the learning rate, thereby updating the weight parameters of each module in the convolutional neural network model.
[0060] Each training epoch consists of one forward propagation process and one backward propagation process. Training ends when the preset epoch threshold is reached or the loss function begins to converge. The trained convolutional neural network model can then be used as a person re-identification model.
[0061] In this embodiment of the invention, a convolutional neural network model is trained using real images, selected virtual pedestrian images, and shared pedestrian identity labels. Unlike the method of leaving the generated images to the recognition stage and then using them as additional views for post-processing fusion, this embodiment of the invention adds virtual pedestrian images to the augmented dataset and participates in the training process of the convolutional neural network model. This allows the pedestrian re-identification model to capture the correct identity information from the training stage while correcting and distinguishing the image perspective and pedestrian posture distribution, thus solving the identity drift problem caused by data augmentation.
[0062] In one possible implementation, the final loss function is constructed based on the comprehensive image feature vector, pedestrian image samples, and pedestrian identity labels. This can be achieved in the following way, as explained in detail below.
[0063] A label smoothing cross-entropy loss function is constructed based on the comprehensive image feature vector and pedestrian identity labels. A batch hard sample triplet loss function is constructed based on the original pedestrian image samples and virtual pedestrian image samples with the same pedestrian identity labels in the pedestrian image samples. Finally, a real-virtual identity consistency loss function is constructed based on the feature distance between the original pedestrian image samples and the virtual pedestrian image samples.
[0064] Here, the construction process of the label-smoothed cross-entropy loss essentially softens the hard labels of the traditional cross-entropy loss. The goal is to prevent the model from being overly certain about a particular identity category during training, thereby improving generalization ability. Specifically, the pedestrian identity labels of the original pedestrian image samples and the virtual pedestrian image samples are first smoothed. Pedestrian identity labels are generally one-hot encoded. The smoothing coefficient transforms the 1s and 0s of the one-hot encoding into probability values, thus smoothing the one-hot encoded vector of the pedestrian identity label into a probability distribution, which serves as the smoothed pedestrian identity label.
[0065] The combined image feature vectors are mapped to the predicted probability distribution of pedestrian identity labels using functions such as softmax. Then, the smoothed pedestrian identity labels and the predicted probability distribution are used to calculate the cross-entropy, resulting in the label-smoothed cross-entropy loss, denoted as... .
[0066] The batch hard sample triplet loss aims to improve the model's discriminative ability by mining positive and negative samples in each training batch. Based on the original pedestrian image samples and virtual pedestrian image samples in each training batch, anchor points and positive and negative samples are distinguished separately. Then, under the same pedestrian identity label, the farthest distance between the positive sample and the anchor point is calculated, thus selecting the hardest positive sample from the real-virtual cross-pose positive samples. For different pedestrian identity labels, the shortest distance between the negative sample and the anchor point is calculated, thus selecting the hardest negative sample from the negative samples. Finally, triples are generated based on the hardest positive and hardest negative samples, thus constructing the batch hard sample triplet loss function, denoted as [missing information - likely a typo]. .
[0067] The real-virtual identity consistency loss aims to train the model to reduce its ability to distinguish between original and virtual pedestrian images when identity labels are consistent. This is achieved by extracting image features from both original and virtual pedestrian image samples with consistent identity labels, and then calculating the feature distance between these features, such as cosine similarity or Euclidean distance. Based on this feature distance, loss functions such as contrastive loss and cosine similarity loss can be constructed as the real-virtual identity consistency loss function.
[0068] In this loss function, the label smoothing cross-entropy loss function serves as the identity loss, the batch hard sample triplet loss function serves as the triplet loss, and the real-virtual identity consistency loss function is used to constrain the distance between the original pedestrian image features and the virtual pedestrian image features under the same identity. The final loss function is calculated using a weighted summation method. Specifically, the three losses are weighted equally, and then the weighted results are summed to obtain the final loss function.
[0069] In this embodiment of the invention, when calculating the final loss function, the identity loss is calculated so that all identity categories participate in the calculation, rather than only the correct identity category contributing to the loss. This forces the pedestrian recognition model to pay attention to more subtle differences between identity categories, preventing overfitting. The batch hard sample triplet loss employs a batch processing hard sample mining strategy to handle difficult positive and negative sample pairs within each mini-batch, improving the model's discriminative ability in the feature space. By automatically selecting the most difficult positive and negative samples in each training batch for optimization, the pedestrian recognition model is forced to learn more discriminative feature representations. The real-virtual identity consistency loss is used to reduce the identity drift risk brought by virtual pedestrian images, making virtual pedestrian images effective cross-pose positive samples during the training phase, thereby improving the pedestrian recognition model's ability to discriminate between different identity categories.
[0070] In one possible implementation, the WSSM module reconstruction process can be achieved in the following way, which is explained in detail below.
[0071] First, the initial image features are input into each path branch of the WSSM module, and then the initial image features are transformed by the wavelet convolutional network in the wavelet transform processing module MT to obtain low-frequency structure subbands and multiple high-frequency detail subbands.
[0072] After the initial image features are input into the WSSM module, they enter two path branches. In each path branch, the initial image features are first decomposed and fused in the multi-frequency domain by the wavelet convolutional network of the wavelet transform processing module MT. In the low-frequency components, memory-enhanced state space modeling is used to obtain cross-regional, long-distance identity structure relationships. In the high-frequency components, gating coefficients are generated based on the low-frequency structural context to extract discriminative texture features and suppress unstructured noise, resulting in multiple complementary frequency band sub-maps, specifically including one low-frequency structural sub-band and three high-frequency detail sub-bands.
[0073] See Figure 4 , Figure 4 The structure of the WSSM module is shown; the WSSM module is actually an improved residual structure. Each cascaded WSSM module in the wavelet convolution module has the same structure, with two path branches: a deep semantic branch and a shallow detail branch. The deep semantic branch includes a three-layer cascaded wavelet transform processing module (MT), while the shallow detail branch includes only one wavelet transform processing module (MT). The multi-scale feature interaction network serves as the interaction module; its input layer receives the outputs of the two path branches, and its output layer connects to the next cascaded WSSM module.
[0074] The initial image features extracted by the initial feature extraction module are input into the WSSM module, and then processed in two separate path branches. First, the initial image features are uniformly processed through a 1×1 convolution, and then they enter the respective wavelet transform processing modules (MT) of their respective branches. In the deep semantic branch, low-frequency state space scanning and inverse wavelet reconstruction are performed multiple times through a three-layer cascaded wavelet transform processing module (MT) to capture long-range global dependencies. In the shallow detail branch, feature processing is performed through a single wavelet transform processing module (MT) to preserve local texture details.
[0075] See also Figure 4 In the wavelet transform processing module MT, the input image features are first subjected to wavelet transform through a wavelet convolutional network to obtain multiple complementary frequency band sub-images. The wavelet convolution is implemented based on the Haar wavelet basis, which is chosen due to its excellent orthogonality and computational efficiency. In the processing flow, the forward transform is first performed, that is, a two-dimensional discrete wavelet transform is performed on the input image features F, which spatially decouples them into a low-frequency structural sub-band and three high-frequency detail sub-bands, as shown below: (3) Where WT represents the processing function of the two-dimensional discrete wavelet transform. , , , These represent four complementary frequency band sub-maps. Among them, This represents the low-frequency structural sub-band, which is the transformed low-frequency approximate component. Its spatial resolution is half that of the input features, and it mainly aggregates the smooth structural background and subject contour information of the image. , , It consists of three high-frequency detail sub-bands, which respectively capture the high-frequency edge gradients and subtle texture features of the image in the horizontal, vertical and diagonal directions.
[0076] Furthermore, frequency domain features are extracted from the low-frequency structural subband and the high-frequency detail subband respectively to obtain the corresponding low-frequency subband features and high-frequency subband features.
[0077] like Figure 4As shown, the wavelet transform processing module MT processes the low-frequency structural subband and high-frequency detail subband separately through low-frequency and high-frequency branches. The scaled dot product attention network is located in the low-frequency branch, while the gated network is located in the high-frequency branch. The four frequency band sub-images obtained by the wavelet transform network are input into the low-frequency and high-frequency branches respectively for 3×3 convolution processing to extract frequency domain features. Specifically, the 3×3 convolution processing involves inputting the frequency band sub-images into two depthwise separable convolutional networks with 3×3 kernels for frequency domain feature extraction, resulting in four corresponding sub-band features, denoted as... , , , The low-frequency structural subband is input into the low-frequency branch for 3×3 convolution processing, while the three high-frequency detail subbands are input into the high-frequency branch for 3×3 convolution processing.
[0078] Depth-separable convolutional networks benefit from the downsampling mechanism built into wavelet transform. Convolution operations targeting low-frequency components can significantly expand the effective receptive field without increasing the physical size of the convolution kernel, thereby enhancing global perception capabilities.
[0079] Next, the low-frequency subband features are scanned in the state space, and the scaled dot product attention network and learnable memory in the wavelet transform processing module are called to retrieve the memory of the scanned feature vectors and obtain the memory vectors. The feature vector and the memory vector are concatenated. A depthwise separable convolutional network is then called to perform inverse mapping on the concatenated feature vector and the low-frequency subband features, respectively. The low-frequency subbands obtained by inverse mapping are then concatenated to obtain the low-frequency enhanced subband.
[0080] In low-frequency branches, low-frequency sub-band characteristics Before being fed into the scaled dot product attention network, the low-frequency subband features are first processed. A state space scan is performed, specifically a two-dimensional selective scan along four directions: top left to bottom right, top right to bottom left, bottom left to top right, and bottom right to top left. For the r-th scan direction, its sequence length is equal to the total number of spatial locations in the low-frequency feature map, and the input vector at position t in this direction is denoted as... Where r represents the direction number and t represents the position index in that direction. To alleviate the problem of information forgetting during long-distance scanning, this embodiment of the invention introduces a learnable memory bank M and uses a scaled dot product attention network for memory retrieval. During attention calculation in memory retrieval, the keys and values in the attention formula are replaced with the memory matrix stored in the learnable memory bank M. and This yields the memory selection weights for each scan position. With memory vector The formula is expressed as follows: (4) in, Indicates by The query vector obtained through linear mapping, and , Represents the dimension of the memory vector. and These represent the memory key matrix and the memory value matrix, respectively, and K represents the number of memory cells. This represents the selection weight of each memory cell at position t. This represents the memory vector injected into the state space recursion. Let T denote the normalization operation function, and let T denote the matrix transpose. and As learnable parameters of the network, they are updated synchronously with the other weights during the training phase, thereby realizing the update of the learnable memory M.
[0081] Furthermore, the memory vector obtained from the above formula (4) Considered as The parallel additional inputs are concatenated to make the expanded input vector of the scaled dot product attention network as follows: And let the corresponding input matrix be written in column blocks as follows Then we have: (5) (6) in, This represents the memory-enhanced hidden state at position t in the r-th scan direction. Represents the memory injection matrix. This represents the output structural feature at position t in the r-th scan direction. Represents the state transition matrix. This represents the input projection matrix. Indicates the output projection matrix. This represents the residual through matrix.
[0082] To compensate for the shortcomings of the state-space module in terms of local two-dimensional structural bias, this embodiment of the invention further introduces a space adapter in the low-frequency branch. The spatial adapter is specifically a multi-branch, depthwise separable convolutional network structure used to supplement local geometric relationships. The scan results from the four directions output by the scaled dot-product attention network are input into the depthwise separable convolutional network, first restored to their corresponding two-dimensional positions through inverse mapping according to their respective scan order, then concatenated along the channel dimension, and finally projected back to the original channel through output projection. Low-frequency sub-band features... It will also be input into the space adapter for inverse mapping, and the mapping result is denoted as The low-frequency subband generated by the inverse mapping of the scanning results is then spliced together with the subband generated by the inverse mapping. The splicing process involves element-wise addition, ultimately yielding a low-frequency enhanced subband, denoted as . .
[0083] On the other hand, the spliced high-frequency detail subbands are locally convolved to obtain local gated response coefficients; the low-frequency enhanced subbands are globally averaged pooled to obtain global gated response coefficients; the local gated response coefficients and global gated response coefficients are input into the gated network in the wavelet transform processing module for gated fusion to obtain a gated weight map, and the high-frequency detail subbands are modulated based on the gated weight map to obtain the enhanced high-frequency detail subbands.
[0084] For high-frequency detail gating, it combines the global structural context provided by low frequencies with the wavelet convolution output of the high-frequency branches. , and A gating map is generated to suppress noisy high-frequency responses and enhance identity-related realistic textures. Specifically, in the high-frequency branch, three high-frequency detail subbands are first stitched together and then processed through local convolution to obtain local gating response coefficients. Then, the low-frequency enhancement subbands output from the low-frequency branch are... The global gating response coefficients are obtained by sequentially applying global average pooling and linear mapping.
[0085] Furthermore, the local and global gated response coefficients are gated and fused using a gating network in the high-frequency branch of the wavelet transform processing module (MT). Before gating fusion, both coefficients are first mapped to the same number of channels as the high-frequency detail subbands using 1×1 convolutions, and then input into the gating network for gating fusion. The gating network adds the two coefficients and normalizes them using the Sigmoid function to obtain a gating weight map. Finally, this gating weight map is used to perform element-wise modulation on each high-frequency detail subband; that is, the weight values at corresponding positions in the gating weight map are used to weight the corresponding subband values in the high-frequency detail subbands, ultimately obtaining the enhanced high-frequency detail subbands, denoted as […]. , and .
[0086] Finally, inverse wavelet transform is performed on the enhanced high-frequency detail subband and the low-frequency enhancement subband to obtain the transformed image features.
[0087] Here, feature reconstruction is achieved through inverse wavelet transform. The enhanced high-frequency detail subband and the low-frequency enhanced subband are input into the inverse wavelet transform (IWT) module for inverse wavelet transform to restore the original resolution and generate the final output feature map Z. This process is described as follows: (7) in, , , These represent the three enhanced high-frequency detail subbands output by the high-frequency branch, i.e., the results of processing the three high-frequency subbands by the gating network. The low-frequency enhanced subband of the low-frequency branch output is represented by IWT, which represents the inverse wavelet transform processing function used to perform a two-dimensional discrete wavelet inverse transform operation, projecting the processed frequency domain features back into the spatial domain. The final output feature map Z maintains the same spatial resolution and channel dimension as the initial image feature F, achieving effective fusion of multi-scale frequency domain features and spatial information. The final output feature map Z is then subjected to two-dimensional batch normalization and activated by the ReLU activation function to obtain the transformed image features.
[0088] In the deep semantic branch of the WSSM module, the transformed image features output by each wavelet transform processing module (MT) are input into the next wavelet transform processing module (MT) for the same processing. The transformed image features output by the third wavelet transform processing module (MT) are then used as the output of this path branch, denoted as... In the shallow detail branch of the WSSM module, the transformed image features output by the wavelet transform processing module MT are directly used as the output of this path branch, denoted as... .in, C represents the channel, and H and W represent the height and width, respectively.
[0089] Finally, the multi-scale feature interaction network of the WSSM module is called to perform feature interaction processing on the transformed image features of each path branch, and the features obtained by interaction processing are concatenated with the initial image features to obtain the reconstructed image features.
[0090] like Figure 4 As shown, since the two parallel path branches within the WSSM module do not share model parameters, an Interaction Module (IM) is designed within the WSSM module to connect the two parallel path branches and facilitate efficient information exchange between multi-scale features. This allows features with different receptive fields to dynamically communicate and enhance each other. The Interaction Module can be implemented through a multi-scale feature interaction network. The multi-scale feature interaction network of the WSSM module directly connects to the output layers of the two path branches, and the outputs of the two path branches... as well as It will be directly input into a multi-scale feature interaction network for feature interaction processing, and finally obtain the reconstructed image features.
[0091] Multi-scale feature interaction networks have designed a variety of different network structures, and therefore there are multiple ways to process features, specifically any one of the following four types of operations, which will be explained one by one below.
[0092] The first type of operation is the None operation. This operation does not perform any feature exchange or parameter calculation, aiming to maintain the independence of the features of the two path branches and directly output the original feature pair. .
[0093] The second type of operation involves swapping the transformed image features of two path branches. To maximize the mixing of information flows, this operation directly swaps the features output by the two path branches, resulting in a pair of swapped features. .
[0094] The third type of operation involves channel-weighted processing of the transformed image features of the two path branches using a multilayer perceptron. This operation introduces a channel attention mechanism into a multi-scale feature interaction network to filter discriminative features. Specifically, a shared multilayer perceptron (MLP) is used to learn the channel weights and weight the original features, as shown in the following expression: (8) in, The transformed image features represent the input, i.e., the outputs of the two path branches. , MLP stands for Multilayer Perceptron, whose parameters are shared between two path branches and used to jointly filter channel importance. This represents the Sigmoid activation function, used to map the output of an MLP to the range of 0 to 1, generating attention weight coefficients. "" indicates element-wise multiplication, which uses the generated attention weight coefficients to weight each channel of the transformed image features. This represents the image features obtained after channel weighting.
[0095] The fourth type of operation involves performing cross-attention calculation on the transformed image features of the two path branches using a cross-attention network. Cross-attention calculation aims to capture long-distance dependencies and semantic relevance across scales. It explicitly calculates the feature relevance between the two path branches using a cross-attention mechanism, as shown in the following expression: (9) Where i takes the value 1 or 2. The transformed image features represent the input, i.e., the outputs of the two path branches. , . This represents the output feature map of the transformed image features from the i-th path branch after cross-attention enhancement. express The reshaped feature map; here, the reshaping operation transforms the input image features. Remodeling Where N is the product of H and W, representing the total number of spatial pixels. T denotes the transpose of the matrix. `<matrix>` represents matrix multiplication, used to calculate the correlation matrix of the output features of two path branches in spatial location; `Mask` represents the attention masking operation, used to transform the correlation matrix into attention distribution probabilities. This represents a learnable scalar parameter used to adaptively adjust the strength of the cross-attention correction to the original features.
[0096] During specific feature processing, the multi-scale feature interaction network adaptively selects one of the feature interaction processing methods based on the network layer depth to perform feature interaction processing on the transformed image features of each path branch. The output of the feature interaction processing is the output of the WSSM module. If the current WSSM module is not the last WSSM module, the output of the feature interaction processing will be input into the next cascaded WSSM module for the same feature processing. If the current WSSM module is the last WSSM module, then according to the feature processing method of the residual module, the output of the feature interaction processing will be concatenated with the initial image features output by the initial feature extraction module to obtain the reconstructed image features.
[0097] In this embodiment of the invention, feature reconstruction is performed through the wavelet transform processing module of the WSSM module. Without increasing the network depth, based on the frequency separation characteristics of wavelet transform, the initial image features are decomposed and fused in multiple frequency domains. Utilizing the downsampling characteristics of the low-frequency subband of the wavelet and the state space scanning mechanism, an exponentially increased effective receptive field is obtained, enabling the pedestrian recognition model to perceive the overall structure of the pedestrian like a Transformer model, thus effectively addressing situations where limbs are occluded or partially missing. Simultaneously, the memory-enhanced state space modeling in the low-frequency branch of the wavelet transform processing module can propagate long-distance identity relationships across body parts, while the gating network in the high-frequency branch can suppress noisy textures and preserve discriminative details such as clothing folds, shoe textures, and backpack straps. Therefore, the WSSM module can enhance global feature perception capabilities while maintaining the efficient feature representation capabilities of wavelet convolutional networks. Compared with traditional visual models, feature extraction is more efficient and robust, and joint modeling of local texture information and global identity structure information can be achieved with less computational resources, effectively reducing model complexity and improving the inference efficiency of the pedestrian re-identification model on edge devices and the recognition accuracy in complex occlusion environments.
[0098] Step 104: Call the pedestrian re-identification model to identify the target pedestrian image and obtain the pedestrian re-identification result.
[0099] After training the pedestrian re-identification model using the training method described in step 103 above, it can be directly used in the inference stage to identify the target pedestrian image in real time. When pedestrian re-identification is required in a real-world scenario, the uploaded target pedestrian image is directly acquired, and the pedestrian re-identification model can process the image to extract the corresponding target image features. Finally, by searching the retrieval database formed by the expanded dataset, the pedestrian re-identification result corresponding to the target pedestrian image is determined based on the pedestrian identity label in the retrieval results.
[0100] In one possible implementation, the pedestrian re-identification model is invoked to identify the target pedestrian image and obtain the pedestrian re-identification result. This can be achieved in the following ways, which are explained in detail below.
[0101] First, the pedestrian re-identification model is invoked to extract the target image features of the target pedestrian image to be identified.
[0102] Here, the target pedestrian image to be identified can be an original pedestrian image from the original pedestrian dataset, or it can be another pedestrian image from outside the expanded dataset.
[0103] like Figure 5 As shown, when re-identifying a target pedestrian image, the pedestrian re-identification model is directly called to extract the target image features of the target pedestrian image to be identified, denoted as... The method for extracting target image features here can refer to the method used in the above embodiments for extracting comprehensive image feature vectors using a convolutional neural network model, which will not be elaborated here.
[0104] Next, based on the target image features, the dataset is expanded to obtain the retrieved pedestrian images.
[0105] Here, the original pedestrian dataset can serve as the initial retrieval database. After obtaining virtual pedestrian images through data augmentation using a diffusion model before or during training, the selected virtual pedestrian images are added to the original pedestrian dataset to obtain an expanded dataset, which serves as the retrieval database. Alternatively, after training, the original pedestrian image features and virtual pedestrian image features of each pedestrian image sample can be stored offline as an identity feature library, which can also serve as the retrieval database.
[0106] In pedestrian re-identification, the extracted target image features are utilized. The system searches this database to find images or features with the same identity information. During the search, a person re-identification model is used to extract the image features of each image in the expanded database, denoted as [features]. Where i represents the i-th image to be retrieved. The method for extracting features from the image to be retrieved can also refer to the method used in the above embodiment for extracting the comprehensive image feature vector using the convolutional neural network model, which will not be elaborated here. Then, the target image features are calculated. Features of the image to be retrieved in the database The similarity can be measured using cosine similarity, and its expression is as follows: (10) in, Represents cosine similarity. and They represent the target image features respectively and features of the image to be retrieved The L2 norm.
[0107] Furthermore, the images to be retrieved are sorted according to their calculated cosine similarity scores, and then the top K images by cosine similarity score and their corresponding pedestrian identity labels are selected. Optionally, the image with the highest cosine similarity score is selected as the retrieved pedestrian image.
[0108] Finally, the pedestrian identity labels corresponding to the retrieved pedestrian images are used as the pedestrian re-identification results for the target pedestrian image. In other words, the pedestrian identity label of the retrieved image with the highest cosine similarity is used as the pedestrian identity label of the target pedestrian image. After retrieving the determined pedestrian image from the database, its corresponding pedestrian identity label becomes the pedestrian re-identification result for the target pedestrian image, indicating that the identity information of the two is consistent, meaning the pedestrian re-identification is successful.
[0109] In this embodiment of the invention, during real-time pedestrian re-identification, target image features of the image of the pedestrian to be identified are extracted to retrieve the expanded retrieval database, thereby searching for similar identities in the expanded sample space. Since the retrieval database is pre-supplemented with virtual pedestrian images or their features generated based on the identity feature redistribution module and filtered for identity consistency, even if the pedestrian in the image of the pedestrian to be identified exhibits rare viewpoints or complex postures, the corresponding identity can still be retrieved. Simultaneously, during the inference stage, the trained pedestrian re-identification model can be directly invoked for feature extraction and retrieval without relying on real-time generation of auxiliary views, thereby reducing inference overhead and improving overall generalization performance.
[0110] In summary, this invention first addresses dataset expansion by extracting identity feature vectors alongside image viewpoint and pedestrian pose features. These vectors are then processed separately into identity sequence features and used together with the image viewpoint and pedestrian pose features for diffusion-generated images. This ensures that the image generation process is strongly constrained by identity information. This not only achieves data augmentation through image diffusion generation, solving the problems of scarce and unevenly distributed training data, but also, through identity information constraints, ensures that even with significant changes to the original pedestrian pose and image viewpoint, the generated image strictly maintains fine-grained identity features, resolving the identity drift problem caused by data augmentation. Regarding feature extraction, memory-enhanced state space modeling is performed based on wavelet convolution. A scaled dot product attention network is constructed to spatially enhance the low-frequency structural subbands of the wavelet transform. This utilizes the low-frequency structural components of image features to propagate long-distance relationships across different parts. Combined with a gating enhancement mechanism for high-frequency detail subbands, this ensures noise suppression while preserving identity-related details such as clothing folds, shoe textures, and backpack straps, thereby improving the stability and accuracy of pedestrian re-identification in complex occlusion, blurring, and compression distortion scenarios. Furthermore, the wavelet transform processing module can enhance global structure perception capabilities with lower computational overhead, making the pedestrian re-identification model more suitable for deployment in edge devices and real-time monitoring scenarios.
[0111] The pedestrian re-identification device provided by the present invention will be described in detail below.
[0112] like Figure 6 As shown, the pedestrian re-identification device specifically includes: a feature extraction module 601, a diffusion processing module 602, a model training module 603, and a pedestrian re-identification module 604.
[0113] Specifically, the feature extraction module 601 is used to extract image viewpoint features and pedestrian pose features from each original pedestrian image in the original pedestrian dataset, and to extract identity features from the original pedestrian images to obtain an identity feature vector, wherein the original pedestrian images have corresponding pedestrian identity labels; the diffusion processing module 602 is used to reconstruct the identity feature vector to obtain identity sequence features, and to call a diffusion model to perform diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image, wherein the identity features of the virtual pedestrian image are consistent with those of the original pedestrian images; the model training module 603 is used to add the virtual pedestrian image to the original pedestrian dataset to obtain an expanded dataset, and to train the model based on the expanded dataset. A convolutional neural network model is trained to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected sequentially. The wavelet convolution module includes multiple cascaded WSSM modules. The WSSM module includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform, and a scaled dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform. A pedestrian re-identification module 604 is used to call the pedestrian re-identification model to identify the target pedestrian image and obtain the pedestrian re-identification result.
[0114] The pedestrian re-identification device provided in the above embodiments can realize the technical solutions described in the above pedestrian re-identification method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above pedestrian re-identification method embodiments, and their technical effects can also be referred to each other. They will not be repeated here.
[0115] like Figure 7 As shown, the present invention also provides an electronic device 700. The electronic device 700 includes a processor 701, a memory 702, and a display 703. Figure 7 Only some components of the electronic device 700 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0116] In some embodiments, memory 702 may be an internal storage unit of electronic device 700, such as a hard disk or memory of electronic device 700. In other embodiments, memory 702 may also be an external storage device of electronic device 700, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 700.
[0117] Furthermore, the memory 702 may include both internal storage units of the electronic device 700 and external storage devices. The memory 702 is used to store application software and various types of data installed on the electronic device 700.
[0118] In some embodiments, processor 701 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 702 or process data, such as the pedestrian re-identification method of the present invention.
[0119] In some embodiments, display 703 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 703 is used to display information from electronic device 700 and to display a visual user interface. Components 701-703 of electronic device 700 communicate with each other via a system bus.
[0120] In some embodiments of the present invention, when the processor 701 executes the computer program in the memory 702, the following steps can be implemented: extracting image viewpoint features and pedestrian pose features for each original pedestrian image in the original pedestrian dataset, and extracting identity features from the original pedestrian images to obtain an identity feature vector, wherein the original pedestrian images have corresponding pedestrian identity labels; reconstructing the identity feature vector to obtain identity sequence features, and calling a diffusion model to perform diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image, wherein the virtual pedestrian image has the same pedestrian identity label as the original pedestrian image; adding the virtual pedestrian image to the original pedestrian dataset to obtain an expanded dataset. A convolutional neural network model is trained based on the expanded dataset to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected in sequence. The wavelet convolution module includes multiple cascaded WSSM modules, each comprising a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform, and a scaled dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform. The pedestrian re-identification model is then used to identify the target pedestrian image to obtain the pedestrian re-identification result.
[0121] It should be understood that when the processor 701 executes the computer program in the memory 702, in addition to the functions described above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.
[0122] Furthermore, the embodiments of the present invention do not specifically limit the type of electronic device 700 mentioned. Electronic device 700 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, electronic device 700 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0123] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the pedestrian re-identification method provided by the above methods. This method includes: extracting image viewpoint features and pedestrian pose features from each original pedestrian image in the original pedestrian dataset, and extracting identity features from the original pedestrian images to obtain an identity feature vector, wherein the original pedestrian images have corresponding pedestrian identity labels; reconstructing the identity feature vector to obtain identity sequence features, and calling a diffusion model to perform diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image, wherein the virtual pedestrian image has the same pedestrian identity label as the original pedestrian image; and adding the virtual pedestrian image to the original pedestrian dataset. An expanded dataset is obtained from the original pedestrian dataset, and a convolutional neural network model is trained based on the expanded dataset to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected in sequence. The wavelet convolution module includes multiple cascaded WSSM modules, each of which includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform, and a scaling dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform. The pedestrian re-identification model is then used to identify the target pedestrian image to obtain the pedestrian re-identification result.
[0124] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0125] The pedestrian re-identification method and apparatus provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A pedestrian re-identification method, characterized in that, include: For each original pedestrian image in the original pedestrian dataset, image viewpoint features and pedestrian pose features are extracted respectively, and identity features are extracted from the original pedestrian images to obtain identity feature vectors, wherein the original pedestrian images have corresponding pedestrian identity labels; The identity feature vector is reconstructed to obtain identity sequence features, and a diffusion model is called to perform diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image. The virtual pedestrian image has the same pedestrian identity label as the original pedestrian image. The virtual pedestrian images are added to the original pedestrian dataset to obtain an expanded dataset, and a convolutional neural network model is trained based on the expanded dataset to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected in sequence. The wavelet convolution module includes multiple cascaded WSSM modules. The WSSM module includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform of the wavelet convolution network, and a scaling dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform of the wavelet convolution network. The pedestrian re-identification model is invoked to identify the target pedestrian image to be identified, and the pedestrian re-identification result is obtained.
2. The pedestrian re-identification method according to claim 1, characterized in that, The process of reconstructing the identity feature vector to obtain identity sequence features includes: The identity feature vector is linearly mapped, and the mapped feature vector is transformed back into multiple feature tokens of the same dimension. The feature token is normalized to obtain the identity sequence feature.
3. The pedestrian re-identification method according to claim 1, characterized in that, The diffusion model is invoked to perform diffusion processing on the image viewpoint features, the pedestrian pose features, and the identity sequence features to obtain a virtual pedestrian image, including: The encoder of the VAE model is invoked to encode the original pedestrian image into latent variables; The latent variables are input into the noise addition module of the diffusion model to add noise, thereby obtaining a noise vector; The noise vector, the image viewpoint features, the pedestrian pose features, and the identity sequence features are input into the denoising module of the diffusion model for denoising to obtain a denoised vector. The VAE model's decoder is invoked to decode the denoised vector, thereby obtaining a virtual pedestrian image.
4. The pedestrian re-identification method according to claim 1, characterized in that, The process of training a convolutional neural network model based on the expanded dataset to obtain a person re-identification model includes: The initial image features of the pedestrian image samples in the augmented dataset are extracted by calling the initial feature extraction module of the convolutional neural network model. The initial image features are sequentially input into multiple cascaded WSSM modules in the convolutional neural network model for reconstruction, resulting in reconstructed image features. The downsampling module of the convolutional neural network model is invoked to downsample the reconstructed image features to obtain downsampled features; The downsampled features are pooled at different scales, and the feature vectors obtained at different scales are concatenated to obtain a comprehensive image feature vector. Based on the comprehensive image feature vector, pedestrian image samples, and pedestrian identity labels, a final loss function is constructed, and a convolutional neural network model is trained based on the final loss function to obtain a pedestrian re-identification model.
5. The pedestrian re-identification method according to claim 4, characterized in that, The construction of the final loss function based on the integrated image feature vector, pedestrian image samples, and pedestrian identity labels includes: A label-smoothing cross-entropy loss function is constructed based on the comprehensive image feature vector and pedestrian identity labels. A batch hard sample triplet loss function is constructed based on the original pedestrian image samples and virtual pedestrian image samples with the same pedestrian identity labels in the pedestrian image samples, and a real-virtual identity consistency loss function is constructed based on the feature distance between the original pedestrian image samples and the virtual pedestrian image samples. The final loss function is obtained by weighted summing of the label smooth cross-entropy loss function, the batch hard sample triplet loss function, and the real-virtual identity consistency loss function.
6. The pedestrian re-identification method according to claim 4, characterized in that, The reconstruction process of the WSSM module includes: The initial image features are input into each path branch of the WSSM module, and the initial image features are transformed by the wavelet convolutional network in the wavelet transform processing module to obtain low-frequency structure sub-bands and multiple high-frequency detail sub-bands. Frequency domain features are extracted from the low-frequency structural sub-band and the high-frequency detail sub-band respectively to obtain the corresponding low-frequency sub-band features and high-frequency sub-band features; The low-frequency subband features are scanned in the state space, and the scaled dot product attention network and learnable memory in the wavelet transform processing module are called to retrieve the memory of the scanned feature vectors to obtain the memory vectors. The feature vector and the memory vector are concatenated, and a depthwise separable convolutional network is called to perform inverse mapping on the concatenated feature vector and the low-frequency subband features respectively. The low-frequency subbands obtained by inverse mapping are then concatenated to obtain the low-frequency enhanced subband. The spliced high-frequency detail subbands are locally convolved to obtain local gated response coefficients, and the low-frequency enhancement subbands are globally averaged to obtain global gated response coefficients. The local gated response coefficients and the global gated response coefficients are input into the gated network in the wavelet transform processing module for gated fusion to obtain a gated weight map. The high-frequency detail subband is then modulated based on the gated weight map to obtain the enhanced high-frequency detail subband. Perform inverse wavelet transform on the enhanced high-frequency detail subband and the low-frequency enhancement subband to obtain the transformed image features; The multi-scale feature interaction network of the WSSM module is invoked to perform feature interaction processing on the transformed image features of each path branch, and the features obtained from the interaction processing are concatenated with the initial image features to obtain the reconstructed image features.
7. The pedestrian re-identification method according to claim 1, characterized in that, The step of calling the pedestrian re-identification model to identify the target pedestrian image and obtaining the pedestrian re-identification result includes: The pedestrian re-identification model is invoked to extract target image features from the target pedestrian image to be identified. Based on the features of the target image, the expanded dataset is retrieved to obtain the retrieved pedestrian images; The pedestrian identity label corresponding to the retrieved pedestrian image is used as the pedestrian re-identification result of the target pedestrian image to be identified.
8. A pedestrian re-identification device, characterized in that, include: The feature extraction module is used to extract image viewpoint features and pedestrian pose features from each original pedestrian image in the original pedestrian dataset, and to extract identity features from the original pedestrian images to obtain an identity feature vector, wherein the original pedestrian images have corresponding pedestrian identity labels; The diffusion processing module is used to reconstruct the identity feature vector to obtain identity sequence features, and call the diffusion model to perform diffusion processing on the image viewpoint features, the pedestrian pose features and the identity sequence features to obtain a virtual pedestrian image. The virtual pedestrian image has the same pedestrian identity label as the original pedestrian image. The model training module is used to add the virtual pedestrian images to the original pedestrian dataset to obtain an expanded dataset, and train a convolutional neural network model based on the expanded dataset to obtain a pedestrian re-identification model. The convolutional neural network model includes an initial feature extraction module, a wavelet convolution module, and a downsampling module connected in sequence. The wavelet convolution module includes multiple cascaded WSSM modules. The WSSM module includes a dual-path parallel wavelet transform processing module and a multi-scale feature interaction network. The wavelet transform processing module includes a wavelet convolution network, a gating network for gating and enhancing the high-frequency detail subbands of the wavelet transform of the wavelet convolution network, and a scaling dot product attention network for spatial memory enhancement of the low-frequency structural subbands of the wavelet transform of the wavelet convolution network. The pedestrian re-identification module is used to call the pedestrian re-identification model to identify the target pedestrian image and obtain the pedestrian re-identification result.
9. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps of the pedestrian re-identification method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the pedestrian re-identification method as described in any one of claims 1 to 7.