Multi-resolution collaborative pedestrian recognition method and related equipment
Through multi-feature weighted fusion technology, the features of low-resolution and high-resolution images are extracted and fused, which solves the problem of resolution mismatch of pedestrian images and improves the accuracy and stability of pedestrian identification.
Patent Information
- Application Number
- CN202111435587.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When solving the problem of pedestrian image resolution mismatch, the existing technology ignores the information of low-resolution images, and the images restored after image super-resolution have different discriminative features in different scale spaces, which affects the recognition effect.
Using a multi-feature weighted fusion method, the features of low-resolution and high-resolution images are extracted through a convolutional neural network, and weights are learned in the attention module to perform adaptive fusion calculations and generate fusion features to achieve pedestrian identification.
It gives full play to the recognition value of images with different resolutions, improves pedestrian recognition capabilities in resolution mismatch environments, and ensures the accurate expression of image features at any resolution.
Smart Images

Figure CN114120200B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video analysis technology, and in particular to a multi-resolution collaborative pedestrian recognition method and related equipment. Background Art
[0002] In real-world application scenarios, due to the randomness of pedestrian movement, the distance between pedestrians and cameras varies, resulting in different resolutions of pedestrian images captured by cameras. Given a pedestrian image of arbitrary resolution, the task of finding pedestrian images with the same identity as the retrieval image from a retrieval library containing images of arbitrary resolution is defined as cross-resolution pedestrian retrieval. Since the distance between the object of interest and the camera is affected by the location of the monitoring point, the image resolution obtained at each monitoring point is also different. Direct comparison will seriously affect the recognition effect, making cross-resolution pedestrian recognition extremely challenging.
[0003] There are currently two methods to solve the problem of pedestrian recognition under resolution mismatch: First, the idea of feature alignment is adopted, hoping to learn the common features of high-resolution and low-resolution images of pedestrians, train feature extractors, and aim to learn invariant feature expressions under variable resolutions. However, this type of method ignores the fact that low-resolution images themselves contain less information. Since low-resolution images themselves lack some fine-grained expressions, the method of learning multi-resolution shared features will also lose some important fine-grained identity information. Second, with the help of image super-resolution, low-resolution images are super-divided into high-scale images, and then image matching is unified in a high-scale environment. However, there are two problems with this type of method: First, image super-resolution is to improve the visual effect of the image rather than to improve the performance of pedestrian re-identification. The direct cascade of super-resolution modules and re-identification modules has poor compatibility. There are errors in the super-resolution process. The greater the degree of super-resolution, the greater the error; second, these methods only use high-resolution images synthesized from low-resolution images, and unify all images into a high-scale space. However, when unified into different scale spaces, the noise of the images restored after image super-resolution is also different, which will lead to different retrieval results. In other words, the reconstructed images in different scale spaces contain different image discriminant features. Traditional methods only focus on the features of high-scale space images and ignore the recognition value of images in other scale spaces. Summary of the invention
[0004] The main purpose of the present invention is to propose a multi-resolution collaborative pedestrian recognition method and related equipment based on the phenomenon that images with different contents in real scenes have different recognition values in different scale spaces. The method aims to calculate the optimal weight combination by adopting a multi-feature weighted fusion method, give full play to the recognition value of images with different resolutions, and use the images before and after reconstruction to jointly generate discriminant features to solve the pedestrian recognition problem in the prior art caused by the resolution mismatch of pedestrian images in actual monitoring scenes due to the change in the distance between pedestrians and cameras, realize the accurate expression of image features of arbitrary resolution, and improve the pedestrian recognition ability in a resolution mismatch environment.
[0005] In a first aspect, the present invention provides a multi-resolution collaborative pedestrian recognition method, the multi-resolution collaborative pedestrian recognition method comprising the following steps:
[0006] Step 1: Image preprocessing stage:
[0007] Inputting the images in the training set into the initial pedestrian recognition model, downsampling the images to obtain target low-resolution images, and then super-resolution processing the target low-resolution images to obtain target high-resolution images;
[0008] Step 2: Image feature extraction stage:
[0009] Inputting the target low-resolution image and the target high-resolution image into the same convolutional neural network model to obtain their deep features, and extracting a first image feature corresponding to the target low-resolution image and a second image feature corresponding to the target high-resolution image;
[0010] Step 3: Weighted fusion calculation stage:
[0011] Inputting the first image feature and the second image feature into an attention module for weight learning to obtain a first weight corresponding to the first image feature and a second weight corresponding to the second image feature, and performing adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain a fusion feature;
[0012] Step 4: Identification result output stage:
[0013] The fused features are subjected to dimensionality reduction processing to obtain the fused features after dimensionality reduction, similarity sorting is performed based on the fused features after dimensionality reduction, and after the similarity sorting result is obtained, a fully connected layer is used to predict the corresponding pedestrian ID to complete pedestrian recognition.
[0014] Optionally, the step of performing adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain the fused feature includes:
[0015] Substitute the first weight, the second weight, the first image feature, and the second image feature into a fusion feature calculation formula to obtain a fusion feature, wherein the fusion feature calculation formula is:
[0016] f=f l × l +f h × h
[0017] Among them, f is the fusion feature, f l is the first image feature, f h is the second image feature; subscript l represents the target low-resolution image, and subscript h represents the target high-resolution image; w l is the first weight, w h is the second weight.
[0018] Optionally, a super-resolution loss is generated during the super-resolution processing, and the super-resolution loss is calculated as follows:
[0019]
[0020] Among them, l sr (I i ) represents the super-resolution loss, ⊙ represents the element-by-element multiplication in the vector, and M is the sum of the image Masks of the same size, represents the input image in the training set, represents the target high-resolution image after super-resolution processing;
[0021] The weight loss is generated during the weight learning process, and the weight loss is calculated as follows:
[0022]
[0023] Among them, l w is the weight loss, w l is the first weight corresponding to the first image feature, w h is the second weight corresponding to the second image feature; r is the scale factor, which is the ratio of the input image size to the normalized size in the training set;
[0024] The classification loss is generated in the process of predicting the corresponding pedestrian ID, wherein the classification loss is calculated as follows:
[0025]
[0026] p=softmax(Wf+b)
[0027] Among them, l cls is the classification loss, B is the number of images processed in the batch during pedestrian recognition, p is the probability that the input fusion feature corresponds to the true value of the pedestrian ID, f is the fusion feature, and W and b are trainable parameters;
[0028] After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained. In the training process, according to the super-resolution loss l sr , the weight loss l w And the classification loss l cls , calculate the overall loss function; back-propagate the overall loss calculated by the overall loss function to the pedestrian recognition model to be trained, retrain the pedestrian recognition model to be trained, and obtain the pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations, wherein the overall loss function is calculated as follows:
[0029] l total =λ1l sr +λ2l w +λ3l cls
[0030] Among them, l total is the overall loss function, λ1 corresponds to the weight parameter of super-resolution loss, λ2 corresponds to the weight parameter of weight loss, and λ3 corresponds to the weight parameter of classification loss.
[0031] Optionally, a rank-n hit rate is used as an evaluation indicator of the trained pedestrian recognition model, which represents the probability that the correct pedestrian ID is included in the first n results ranked by feature similarity.
[0032] In a second aspect, the present invention further provides a multi-resolution collaborative pedestrian recognition device, the multi-resolution collaborative pedestrian recognition device comprising:
[0033] An image preprocessing module is used to input the images in the training set into the initial pedestrian recognition model, perform downsampling on the images to obtain target low-resolution images, and then perform super-resolution processing on the target low-resolution images to obtain target high-resolution images;
[0034] An image feature extraction module, used to input the target low-resolution image and the target high-resolution image into a convolutional neural network model, and extract a first image feature corresponding to the target low-resolution image and a second image feature corresponding to the target high-resolution image;
[0035] a calculation module, configured to input the first image feature and the second image feature into an attention module for weight learning, obtain a first weight corresponding to the first image feature and a second weight corresponding to the second image feature, and perform adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain a fusion feature;
[0036] The output module is used to reduce the dimension of the fused features to obtain the reduced-dimensional fused features, perform similarity sorting based on the reduced-dimensional fused features, and use a fully connected layer to predict the corresponding pedestrian ID after obtaining the similarity sorting result to complete pedestrian recognition.
[0037] Optionally, the computing module is used to:
[0038] Substitute the first weight, the second weight, the first image feature, and the second image feature into a fusion feature calculation formula to obtain a fusion feature, wherein the fusion feature calculation formula is:
[0039] f=f l × l +f h × h
[0040] Among them, f is the fusion feature, f l is the first image feature, f h is the second image feature; subscript l represents the target low-resolution image, and subscript h represents the target high-resolution image; w l is the first weight, w h is the second weight.
[0041] Optionally, a super-resolution loss is generated during the super-resolution processing, and the super-resolution loss is calculated as follows:
[0042]
[0043] Among them, l sr (I i ) represents the super-resolution loss, ⊙ represents the element-by-element multiplication in the vector, and M is the sum of the image Masks of the same size, represents the input image in the training set, represents the target high-resolution image after super-resolution processing;
[0044] The weight loss is generated during the weight learning process, and the weight loss is calculated as follows:
[0045]
[0046] Among them, lw is the weight loss, w l is the first weight corresponding to the first image feature, w h is the second weight corresponding to the second image feature; r is the scale factor, which is the ratio of the input image size to the normalized size in the training set;
[0047] The classification loss is generated in the process of predicting the corresponding pedestrian ID, wherein the classification loss is calculated as follows:
[0048]
[0049] p=softmax(Wf+b)
[0050] Among them, l cls is the classification loss, B is the number of images processed in the batch during pedestrian recognition, p is the probability that the input fusion feature belongs to the true value of the corresponding pedestrian ID, f is the fusion feature, and W and b are trainable parameters;
[0051] After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained. In the training process, according to the super-resolution loss l sr , the weight loss l w And the classification loss l cls , calculate the overall loss function; back-propagate the overall loss calculated by the overall loss function to the pedestrian recognition model to be trained, retrain the pedestrian recognition model to be trained, and obtain the pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations. The overall loss function is calculated as follows:
[0052] l total =λ1l sr +λ2l w +λ3l cls
[0053] Among them, l total is the overall loss function, λ1 corresponds to the weight parameter of super-resolution loss, λ2 corresponds to the weight parameter of weight loss, and λ3 corresponds to the weight parameter of classification loss.
[0054] Optionally, a rank-n hit rate is used as an evaluation indicator of the trained pedestrian recognition model, which represents the probability that the correct pedestrian ID is included in the first n results ranked by feature similarity.
[0055] In the third aspect, the present invention also provides a multi-resolution collaborative pedestrian recognition device, which includes a processor, a memory, and a multi-resolution collaborative pedestrian recognition program stored in the memory and executable by the processor, wherein when the multi-resolution collaborative pedestrian recognition program is executed by the processor, the steps of the multi-resolution collaborative pedestrian recognition method described above are implemented.
[0056] In a fourth aspect, the present invention also provides a readable storage medium, on which a multi-resolution collaborative pedestrian recognition program is stored, wherein when the multi-resolution collaborative pedestrian recognition program is executed by a processor, the steps of the multi-resolution collaborative pedestrian recognition method as described above are implemented.
[0057] The present invention provides a multi-resolution collaborative pedestrian recognition method and related equipment to solve the problem of pedestrian image resolution mismatch caused by the change in the distance between the pedestrian and the camera in the actual monitoring scene. The multi-resolution collaborative pedestrian recognition method specifically includes: Step 1: Image preprocessing stage: input the image in the training set into the initial pedestrian recognition model, downsample the image to obtain a target low-resolution image, and then perform super-resolution processing on the target low-resolution image to obtain a target high-resolution image; Step 2: Image feature extraction stage: input the target low-resolution image and the target high-resolution image into the same convolutional neural network model to obtain their deep features, and extract the first image corresponding to the target low-resolution image Features, and the second image features corresponding to the target high-resolution image; Step 3: Weighted fusion calculation stage: input the first image feature and the second image feature into the attention module for weight learning, obtain the first weight corresponding to the first image feature and the second weight corresponding to the second image feature, and based on the first weight and the second weight, adaptively fuse the first image feature and the second image feature to obtain the fusion feature; Step 4: Recognition result output stage: reduce the dimension of the fusion feature to obtain the fusion feature after dimension reduction, perform similarity sorting based on the fusion feature after dimension reduction, and use a fully connected layer to predict the corresponding pedestrian ID after obtaining the result of the similarity sorting to complete pedestrian recognition. In view of the problem that the recognition value of images in different scale spaces is different, the present invention proposes a multi-resolution image collaborative recognition model, which uses the images before and after reconstruction to jointly generate discriminant features; adopts a multi-feature weighted fusion method to calculate the optimal weight combination to achieve accurate expression of image features of any resolution. By calculating the feature fusion of multi-resolution images in the present invention, the recognition value of images with different resolutions is fully utilized, and the pedestrian recognition capability in a resolution mismatch environment is improved, so as to solve the problem of pedestrian image resolution mismatch caused by the change in the distance between pedestrians and cameras in actual monitoring scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 A schematic diagram of the hardware structure of a multi-resolution collaborative pedestrian recognition device involved in an embodiment of the present invention;
[0059] Figure 2 A flowchart of an embodiment of a multi-resolution collaborative pedestrian recognition method of the present invention;
[0060] Figure 3 A schematic diagram of the working principle of an embodiment of a multi-resolution collaborative pedestrian recognition method of the present invention;
[0061] Figure 4 Schematic diagram of functional modules of an embodiment of a multi-resolution collaborative pedestrian recognition device of the present invention.
[0062] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0063] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0064] In a first aspect, an embodiment of the present invention provides a multi-resolution collaborative pedestrian recognition device.
[0065] Reference Figure 1 , Figure 1 The hardware structure diagram of the multi-resolution collaborative pedestrian recognition device involved in the embodiment of the present invention. In the embodiment of the present invention, the multi-resolution collaborative pedestrian recognition device may include a processor 1001 (such as a central processing unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a wireless fidelity WIreless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM), or a stable memory (non-volatile memory), such as a disk storage, and the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art will understand that Figure 1 The hardware structure shown in the figure does not constitute a limitation of the present invention, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0066] Continue to refer to Figure 1 , Figure 1 The memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a multi-resolution collaborative pedestrian recognition program. The processor 1001 may call the multi-resolution collaborative pedestrian recognition program stored in the memory 1005 and execute the multi-resolution collaborative pedestrian recognition method provided by the embodiment of the present invention.
[0067] In a second aspect, an embodiment of the present invention provides a multi-resolution collaborative pedestrian recognition method.
[0068] Reference Figure 2 , Figure 2 4 is a flow chart of an embodiment of a multi-resolution collaborative pedestrian recognition method of the present invention.
[0069] In an embodiment of the multi-resolution collaborative pedestrian recognition method of the present invention, the multi-resolution collaborative pedestrian recognition method includes:
[0070] Step 1: Image preprocessing stage:
[0071] Inputting the images in the training set into the initial pedestrian recognition model, downsampling the images to obtain target low-resolution images, and then super-resolution processing the target low-resolution images to obtain target high-resolution images;
[0072] Step 2: Image feature extraction stage:
[0073] Inputting the target low-resolution image and the target high-resolution image into the same convolutional neural network model to obtain their deep features, and extracting a first image feature corresponding to the target low-resolution image and a second image feature corresponding to the target high-resolution image;
[0074] Step 3: Weighted fusion calculation stage:
[0075] Inputting the first image feature and the second image feature into an attention module for weight learning to obtain a first weight corresponding to the first image feature and a second weight corresponding to the second image feature, and performing adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain a fusion feature;
[0076] Step 4: Identification result output stage:
[0077] The fused features are subjected to dimensionality reduction processing to obtain the fused features after dimensionality reduction, similarity sorting is performed based on the fused features after dimensionality reduction, and after the similarity sorting result is obtained, a fully connected layer is used to predict the corresponding pedestrian ID to complete pedestrian recognition.
[0078] Further, in one embodiment, the step of adaptively fusing the first image feature and the second image feature based on the first weight and the second weight to obtain the fused feature includes:
[0079] Substitute the first weight, the second weight, the first image feature, and the second image feature into a fusion feature calculation formula to obtain a fusion feature, wherein the fusion feature calculation formula is:
[0080] f=f l × l +f h × h
[0081] Among them, f is the fusion feature, f l is the first image feature, f h is the second image feature; subscript l represents the target low-resolution image, and subscript h represents the target high-resolution image; w l is the first weight, w h is the second weight.
[0082] Furthermore, in one embodiment, a super-resolution loss is generated during the super-resolution processing, and the super-resolution loss is calculated as follows:
[0083]
[0084] Among them, l sr (I i ) represents the super-resolution loss, ⊙ represents the element-by-element multiplication in the vector, and M is the sum of the image Masks of the same size, represents the input image in the training set, represents the target high-resolution image after super-resolution processing;
[0085] The weight loss is generated during the weight learning process, and the weight loss is calculated as follows:
[0086]
[0087] Among them, l w is the weight loss, w l is the first weight corresponding to the first image feature, w his the second weight corresponding to the second image feature; r is the scale factor, which is the ratio of the input image size to the normalized size in the training set;
[0088] The classification loss is generated in the process of predicting the corresponding pedestrian ID, wherein the classification loss is calculated as follows:
[0089]
[0090] p=softmax(Wf+b)
[0091] Among them, l cls is the classification loss, B is the number of images processed in the batch during pedestrian recognition, p is the probability that the input fusion feature corresponds to the true value of the pedestrian ID, f is the fusion feature, and W and b are trainable parameters;
[0092] After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained. In the training process, according to the super-resolution loss l sr , the weight loss l w And the classification loss l cls , calculate the overall loss function; back-propagate the overall loss calculated by the overall loss function to the pedestrian recognition model to be trained, retrain the pedestrian recognition model to be trained, and obtain the pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations, wherein the overall loss function is calculated as follows:
[0093] l total =λ1l sr +λ2l w +λ3l cls
[0094] Among them, l total is the overall loss function, λ1 corresponds to the weight parameter of super-resolution loss, λ2 corresponds to the weight parameter of weight loss, and λ3 corresponds to the weight parameter of classification loss.
[0095] Furthermore, in one embodiment, the rank-n hit rate is used as an evaluation indicator of the trained pedestrian recognition model, which represents the probability that the correct pedestrian ID is included in the first n results ranked by the feature similarity.
[0096] In this embodiment, the pedestrian image in the data set to be identified is input into the initial pedestrian recognition model. After the input pedestrian image passes through the pedestrian recognition model, the corresponding pedestrian identification number predicted by the model is obtained. The step of obtaining the pedestrian identification number corresponding to the input image based on the initial pedestrian recognition model includes: inputting the image in the training set into the initial pedestrian recognition model, downsampling the image to obtain a target low-resolution image. Then the target low-resolution image is subjected to super-resolution processing to obtain a target high-resolution image. The obtained target low-resolution image and the obtained target high-resolution image are both input into the same convolutional neural network model to obtain their deep features, and the first image feature corresponding to the target low-resolution image and the second image feature corresponding to the target high-resolution image are extracted. The obtained first image feature and the obtained second image feature are input into the attention module for weight learning, and the first weight corresponding to the first image feature and the second weight corresponding to the second image feature are obtained. Based on the first weight and the second weight, the first image feature and the second image feature are adaptively fused and calculated to obtain a fused feature. The obtained fusion features are subjected to dimension reduction processing to obtain the fusion features after dimension reduction, and similarity sorting is performed based on the fusion features after dimension reduction. After obtaining the result of the similarity sorting, a fully connected layer is used to predict the corresponding pedestrian ID to complete pedestrian recognition. In the process of super-resolution processing, super-resolution loss is generated, weight loss is generated in the process of weight learning, and classification loss is generated in the process of predicting the corresponding pedestrian ID. After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained. In the training process, the overall loss function is calculated according to the super-resolution loss, weight loss and classification loss; the overall loss calculated by the overall loss function is back-propagated to the pedestrian recognition model to be trained, and the pedestrian recognition model to be trained is retrained to obtain a pedestrian recognition model with updated parameters, until the number of training reaches the preset number of iterations, and the trained pedestrian recognition model is obtained. After the trained pedestrian recognition model is obtained, the rank-n hit rate is used as the evaluation index of the trained pedestrian recognition model, which indicates the probability that the correct pedestrian ID is included in the first n results of the feature similarity sorting.
[0097] Specifically, python3.6 is used as the experimental platform, and the public datasets MLR-Market1501 and MLR-DukeMTMC-reID are used for training and testing. The MLR-Market1501 dataset is constructed based on the Market1501 dataset. The Market1501 dataset contains a total of 1501 pedestrians captured by 6 cameras. Among them, 12,936 images of 751 pedestrians are used as training sets, and another 19,732 images of 750 pedestrians are used as test sets. The MLR-DukeMTMC-reID dataset is constructed based on the DukeMTMC-reID dataset. The original dataset contains a total of 1,812 pedestrians, of which 408 pedestrians only appear under one camera, so only 36,411 images of another 1,404 pedestrians are used for testing in this embodiment. Among them, images of 702 pedestrians are used as training sets, and images of another 702 pedestrians are used as test sets. Since the image scales of the original Market1501 dataset and the MLR-DukeMTMC-reID dataset are unified, it is impossible to directly evaluate the multi-resolution image feature fusion calculation method. Therefore, for each image in the test set and training set corresponding to the original Market1501 dataset and the MLR-DukeMTMC-reID dataset, a downsampling ratio is randomly selected from {2,3,4}, and the scale of the original image is reduced according to the downsampling ratio. Multi-resolution image test and training datasets are constructed to evaluate the performance of the pedestrian recognition model corresponding to the pedestrian recognition method proposed in this invention.
[0098] Reference Figure 3 , Figure 3The working principle diagram of an embodiment of the multi-resolution collaborative pedestrian recognition method of the present invention is shown in FIG. Images of arbitrary resolutions with different scales in the training set are input into the pedestrian recognition model, wherein the input high-scale image is downsampled by a preset multiple to obtain a low-scale image. Taking the downsampling with a preset multiple of 4 as an example, each image in a 4*4 window of the original input high-scale image is converted into 1 pixel, and the value of this pixel is the mean value of all pixels in the 4*4 window of the original high-scale image. The original input high-scale image is downsampled to obtain a low-scale image, and super-resolution processing is performed to obtain a high-scale image after super-resolution processing. There is a pixel loss between the high-scale image after super-resolution processing and the high-scale image of the original input. Taking the FFSR model for super-resolution processing as an example, the structure of the model is based on an autoencoder. The target low-resolution image is first downsampled by convolution with a step size of 2, and then convolution with a step size of 1 is performed to extract features. A skip layer structure is used in the deconvolution stage to retain the details of the original input high-scale image in the training set and enhance the high-scale image after super-resolution processing. The model focuses on the foreground to suppress the influence of the cluttered background on the recognition result, resulting in super-resolution loss. The super-resolution loss l sr (I i ) is calculated as: Among them, ⊙ represents the element-by-element multiplication in the vector, M is the mask with the same size as the original high-scale image, represents the original high-scale image, Represents a high-scale image after super-resolution processing.
[0099] The low-scale image and the high-scale image obtained by super-resolution processing of the low-scale image are input into the same convolutional neural network model for feature extraction to obtain the corresponding deep features. Taking the ResNet50 model as an example, the 512-dimensional deep feature f corresponding to the input low-scale image is extracted. l , and the 512-dimensional deep feature f corresponding to the input high-scale image h . The depth feature f l And the deep feature f h Input into the attention module for weight learning and calculate the deep feature f l The corresponding weight w l , deep feature f h The corresponding weight w h After that, the corresponding weights are used to adjust the depth feature f l With the deep feature f h Perform adaptive weighted fusion to obtain fusion features. The calculation method of f fusion features is: f = f l × l +f h × hAmong them, the attention module is generally composed of a global pooling layer and two fully connected layers. When the resolution of the original high-scale input image is low, the deep feature f l The corresponding weight w l Higher, deep features f h The corresponding weight w h On the contrary, when the resolution of the original high-scale input image is high, the depth feature f l The corresponding weight w l Lower, deep features f h The corresponding weight w h Higher. Weight loss is generated in the process of weight learning, and the weight loss l w The calculation method is: Among them, w h is the depth feature f h The corresponding weight, w l is the depth feature f l The corresponding weight, r is the scale factor, which is the ratio of the size of the original high-scale image input in the training set to the normalized size. For example, when the normalized scale is 256×128, the scale factor corresponding to an original high-scale image of 128×64 is 0.5.
[0100] The obtained fusion feature f is subjected to dimensionality reduction processing through a global pooling layer and a fully connected layer to obtain a 512×1×1 tensor as the fusion feature after dimensionality reduction. Similarity sorting is performed based on the fusion feature after dimensionality reduction. After the similarity sorting result is obtained, a fully connected layer is used to predict the corresponding pedestrian ID, realize the mapping from feature space to label space, and complete pedestrian recognition. The pedestrian classification and recognition of the present invention belongs to a multi-category classification problem. At the same time, there is only one correct answer for the label output for an image feature. Taking the Softmax function as an example, the probability that the input image feature corresponds to the output label as the true value is p=softmax(Wf+b), f is the fusion feature, and W and b are trainable parameters. In the process of pedestrian recognition based on the fusion feature after dimensionality reduction, classification loss will be generated. Here, the classification loss uses the cross entropy loss function, and the classification loss l cls The calculation method is: Among them, B is the number of images processed in batches during pedestrian recognition, and p is the probability that the input fusion feature belongs to the true value of the corresponding pedestrian identification number.
[0101] During the training process, according to the super-resolution loss l generated in the previous training process sr , weight loss l w And the classification loss l cls, and the overall loss function is calculated. The overall loss is calculated based on the overall loss function, and then back-propagated to the pedestrian recognition model trained this time. The pedestrian recognition model trained this time is retrained to obtain a pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations, the training ends, and the trained pedestrian recognition model is obtained. Among them, the overall loss function l total The calculation method is: total =λ1l sr +λ2l w +λ3l cls , where λ1 corresponds to the super-resolution loss l sr The weight parameter, λ2 corresponds to the weight loss l w The weight parameter, λ3 corresponds to the classification loss l cls The weight parameter of .
[0102] At the same time, the rank-n hit rate is used as the evaluation index of the trained pedestrian recognition model, which indicates the probability that the correct pedestrian ID is included in the first n results sorted by feature similarity. Taking the pedestrian image test set containing N=15 images, corresponding to 3 types of pedestrian IDs, as an example, even the images corresponding to the same pedestrian ID in this test set are different. Any given image 1 corresponding to pedestrian ID1 is input into the trained model for query, and the ID numbers of the 5 images closest to the query image 1 are found in the test set. If the closest matching result found is [ID1, ID2, ID1, ID1, ID1], the probability of the first n matching results being the same as the input image ID number is used as the recognition hit rate. When n=1, the value of rank-1 is 1, and the hit rate is 100%; when n=5, the value of rank-5 is 0.8, and the hit rate is 80%.
[0103] In this embodiment, the multi-resolution collaborative pedestrian recognition method specifically includes: Step 1: Image preprocessing stage: input the image in the training set into the initial pedestrian recognition model, downsample the image to obtain a target low-resolution image, and then perform super-resolution processing on the target low-resolution image to obtain a target high-resolution image; Step 2: Image feature extraction stage: input the target low-resolution image and the target high-resolution image into the same convolutional neural network model to obtain their deep features, and extract the first image feature corresponding to the target low-resolution image and the second image feature corresponding to the target high-resolution image; Step 3: Add Weight fusion calculation stage: input the first image feature and the second image feature into the attention module for weight learning, obtain the first weight corresponding to the first image feature and the second weight corresponding to the second image feature, and based on the first weight and the second weight, perform adaptive fusion calculation on the first image feature and the second image feature to obtain the fusion feature; Step 4: Recognition result output stage: perform dimensionality reduction processing on the fusion feature to obtain the fusion feature after dimensionality reduction, perform similarity sorting based on the fusion feature after dimensionality reduction, and use a fully connected layer to predict the corresponding pedestrian ID after obtaining the result of the similarity sorting to complete pedestrian recognition. In view of the problem that the recognition value of images of different scales is different, the present invention proposes a multi-resolution image collaborative recognition model, and uses the images before and after reconstruction to jointly generate discriminant features; adopts a multi-feature weighted fusion method to calculate the optimal weight combination to achieve accurate expression of image features of any resolution. Through the feature fusion calculation of multi-resolution images of the present invention, the recognition value of images of different resolutions is fully utilized, and the pedestrian recognition ability in a resolution mismatch environment is improved, so as to solve the problem of pedestrian image resolution mismatch caused by the change in the distance between pedestrians and cameras in actual monitoring scenes.
[0104] In a third aspect, an embodiment of the present invention further provides a multi-resolution collaborative pedestrian recognition device.
[0105] Reference Figure 4 , a schematic diagram of functional modules of an embodiment of a multi-resolution collaborative pedestrian recognition device.
[0106] In this embodiment, the multi-resolution collaborative pedestrian recognition device includes:
[0107] The image preprocessing module 10 is used to input the images in the training set into the initial pedestrian recognition model, perform downsampling processing on the images to obtain target low-resolution images, and then perform super-resolution processing on the target low-resolution images to obtain target high-resolution images;
[0108] An image feature extraction module 20, configured to input the target low-resolution image and the target high-resolution image into a convolutional neural network model, and extract a first image feature corresponding to the target low-resolution image and a second image feature corresponding to the target high-resolution image;
[0109] A calculation module 30, configured to input the first image feature and the second image feature into an attention module for weight learning, obtain a first weight corresponding to the first image feature and a second weight corresponding to the second image feature, and perform adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain a fusion feature;
[0110] The output module 40 is used to perform dimensionality reduction processing on the fused features to obtain the reduced-dimensional fused features, perform similarity sorting based on the reduced-dimensional fused features, and use a fully connected layer to predict the corresponding pedestrian ID after obtaining the similarity sorting result to complete pedestrian recognition.
[0111] Furthermore, in one embodiment, the calculation module 30 is used to:
[0112] Substitute the first weight, the second weight, the first image feature, and the second image feature into a fusion feature calculation formula to obtain a fusion feature, wherein the fusion feature calculation formula is:
[0113] f=f l × l +f h × h
[0114] Among them, f is the fusion feature, f l is the first image feature, f h is the second image feature; subscript l represents the target low-resolution image, and subscript h represents the target high-resolution image; w l is the first weight, w h is the second weight.
[0115] Furthermore, in one embodiment, a super-resolution loss is generated during the super-resolution processing, and the super-resolution loss is calculated as follows:
[0116]
[0117] Among them, l sr (I i ) represents the super-resolution loss, ⊙ represents the element-by-element multiplication in the vector, and M is the sum of the image Masks of the same size, represents the input image in the training set, represents the target high-resolution image after super-resolution processing;
[0118] The weight loss is generated during the weight learning process, and the weight loss is calculated as follows:
[0119]
[0120] Among them, l w is the weight loss, w l is the first weight corresponding to the first image feature, w h is the second weight corresponding to the second image feature; r is the scale factor, which is the ratio of the input image size to the normalized size in the training set;
[0121] The classification loss is generated in the process of predicting the corresponding pedestrian ID, wherein the classification loss is calculated as follows:
[0122]
[0123] p=softmax(Wf+b)
[0124] Among them, l cls is the classification loss, B is the number of images processed in the batch during pedestrian recognition, p is the probability that the input fusion feature belongs to the true value of the corresponding pedestrian ID, f is the fusion feature, and W and b are trainable parameters;
[0125] After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained. In the training process, according to the super-resolution loss l sr , the weight loss l w And the classification loss l cls , calculate the overall loss function; back-propagate the overall loss calculated by the overall loss function to the pedestrian recognition model to be trained, retrain the pedestrian recognition model to be trained, and obtain the pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations. The overall loss function is calculated as follows:
[0126] l total =λ1l sr +λ2l w +λ3l cls
[0127] Among them, l total is the overall loss function, λ1 corresponds to the weight parameter of super-resolution loss, λ2 corresponds to the weight parameter of weight loss, and λ3 corresponds to the weight parameter of classification loss.
[0128] Furthermore, in one embodiment, the rank-n hit rate is used as an evaluation indicator of the trained pedestrian recognition model, which represents the probability that the correct pedestrian ID is included in the first n results ranked by the feature similarity.
[0129] Among them, the functional implementation of each module in the above-mentioned multi-resolution collaborative pedestrian recognition device corresponds to the various steps in the above-mentioned multi-resolution collaborative pedestrian recognition method embodiment, and its functions and implementation processes will not be repeated here one by one.
[0130] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium.
[0131] The readable storage medium of the present invention stores a multi-resolution collaborative pedestrian recognition program, wherein when the multi-resolution collaborative pedestrian recognition program is executed by a processor, the steps of the multi-resolution collaborative pedestrian recognition method as described above are implemented.
[0132] Among them, the method implemented when the multi-resolution collaborative pedestrian recognition program is executed can refer to the various embodiments of the multi-resolution collaborative pedestrian recognition method of the present invention, and will not be repeated here.
[0133] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0134] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present invention.
[0136] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A multi-resolution collaborative pedestrian recognition method, characterized in that: The multi-resolution collaborative pedestrian recognition method comprises the following steps: Step 1: Image preprocessing stage: Inputting the images in the training set into the initial pedestrian recognition model, downsampling the images to obtain target low-resolution images, and then super-resolution processing the target low-resolution images to obtain target high-resolution images; Step 2: Image feature extraction stage: Inputting the target low-resolution image and the target high-resolution image into the same convolutional neural network model to obtain their deep features, and extracting a first image feature corresponding to the target low-resolution image and a second image feature corresponding to the target high-resolution image; Step 3: Weighted fusion calculation stage: Inputting the first image feature and the second image feature into an attention module for weight learning to obtain a first weight corresponding to the first image feature and a second weight corresponding to the second image feature, and performing adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain a fusion feature; Step 4: Identification result output stage: The fused features are subjected to dimensionality reduction processing to obtain the fused features after dimensionality reduction, similarity sorting is performed based on the fused features after dimensionality reduction, and after the similarity sorting result is obtained, a fully connected layer is used to predict the corresponding pedestrian ID to complete pedestrian recognition.
2. The multi-resolution collaborative pedestrian recognition method according to claim 1, characterized in that: The step of adaptively fusing the first image feature and the second image feature based on the first weight and the second weight to obtain a fused feature comprises: Substitute the first weight, the second weight, the first image feature, and the second image feature into a fusion feature calculation formula to obtain a fusion feature, wherein the fusion feature calculation formula is: f=f l ×w l +f h ×w h Among them, f is the fusion feature, f l is the first image feature, f h is the second image feature; subscript l represents the target low-resolution image, and subscript h represents the target high-resolution image; w l is the first weight, w h is the second weight.
3. The multi-resolution collaborative pedestrian recognition method according to claim 1, characterized in that: Super-resolution loss is generated during the super-resolution processing, and the super-resolution loss is calculated as follows: Among them, l sr (I i ) represents the super-resolution loss, ⊙ represents the element-by-element multiplication in the vector, and M is the sum of the image Masks of the same size, represents the input image in the training set, represents the target high-resolution image after super-resolution processing; The weight loss is generated during the weight learning process, and the weight loss is calculated as follows: Among them, l w is the weight loss, w l is the first weight corresponding to the first image feature, w h is the second weight corresponding to the second image feature; r is the scale factor, which is the ratio of the input image size to the normalized size in the training set; The classification loss is generated in the process of predicting the corresponding pedestrian ID, wherein the classification loss is calculated as follows: p=softmax(Wf+b) Among them, l cls is the classification loss, B is the number of images processed in the batch during pedestrian recognition, p is the probability that the input fusion feature corresponds to the true value of the pedestrian ID, f is the fusion feature, and W and b are trainable parameters; After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained, wherein during the training process, according to the super-resolution loss l sr , the weight loss l w And the classification loss l cls , calculate the overall loss function; back-propagate the overall loss calculated by the overall loss function to the pedestrian recognition model to be trained, retrain the pedestrian recognition model to be trained, and obtain the pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations, wherein the overall loss function is calculated as follows: l total =λ1l sr +λ2l w +λ3l cls Among them, l total is the overall loss function, λ1 corresponds to the weight parameter of super-resolution loss, λ2 corresponds to the weight parameter of weight loss, and λ3 corresponds to the weight parameter of classification loss.
4. The multi-resolution collaborative pedestrian recognition method according to claim 3, characterized in that: The rank-n hit rate is used as an evaluation index of the trained pedestrian recognition model, which represents the probability that the correct pedestrian ID is included in the first n results ranked by feature similarity.
5. A multi-resolution collaborative pedestrian recognition device, characterized in that: The multi-resolution collaborative pedestrian recognition device comprises: An image preprocessing module is used to input the images in the training set into the initial pedestrian recognition model, perform downsampling on the images to obtain target low-resolution images, and then perform super-resolution processing on the target low-resolution images to obtain target high-resolution images; An image feature extraction module, used to input the target low-resolution image and the target high-resolution image into a convolutional neural network model, and extract a first image feature corresponding to the target low-resolution image and a second image feature corresponding to the target high-resolution image; a calculation module, configured to input the first image feature and the second image feature into an attention module for weight learning, obtain a first weight corresponding to the first image feature and a second weight corresponding to the second image feature, and perform adaptive fusion calculation on the first image feature and the second image feature based on the first weight and the second weight to obtain a fusion feature; The output module is used to reduce the dimension of the fused features to obtain the reduced-dimensional fused features, perform similarity sorting based on the reduced-dimensional fused features, and use a fully connected layer to predict the corresponding pedestrian ID after obtaining the similarity sorting result to complete pedestrian recognition.
6. The multi-resolution collaborative pedestrian recognition device according to claim 5, characterized in that: The computing module is used for: Substitute the first weight, the second weight, the first image feature, and the second image feature into a fusion feature calculation formula to obtain a fusion feature, wherein the fusion feature calculation formula is: f=f l ×w l +f h ×w h Among them, f is the fusion feature, f l is the first image feature, f h is the second image feature; subscript l represents the target low-resolution image, and subscript h represents the target high-resolution image; w l is the first weight, w h is the second weight.
7. The multi-resolution collaborative pedestrian recognition device according to claim 5, characterized in that: Super-resolution loss is generated during the super-resolution processing, and the super-resolution loss is calculated as follows: Among them, l sr (I i ) represents the super-resolution loss, ⊙ represents the element-by-element multiplication in the vector, and M is the sum of the image Masks of the same size, represents the input image in the training set, represents the target high-resolution image after super-resolution processing; The weight loss is generated during the weight learning process, and the weight loss is calculated as follows: Among them, l w is the weight loss, w l is the first weight corresponding to the first image feature, w h is the second weight corresponding to the second image feature; r is the scale factor, which is the ratio of the input image size to the normalized size in the training set; The classification loss is generated in the process of predicting the corresponding pedestrian ID, wherein the classification loss is calculated as follows: p=softmax(Wf+b) Among them, l cls is the classification loss, B is the number of images processed in the batch during pedestrian recognition, p is the probability that the input fusion feature belongs to the true value of the corresponding pedestrian ID, f is the fusion feature, and W and b are trainable parameters; After the initial pedestrian recognition model is trained for a preset number of iterations, a trained pedestrian recognition model is obtained, wherein during the training process, according to the super-resolution loss l sr , the weight loss l w And the classification loss l cls , calculate the overall loss function; back-propagate the overall loss calculated by the overall loss function to the pedestrian recognition model to be trained, retrain the pedestrian recognition model to be trained, and obtain the pedestrian recognition model with updated parameters, until the number of training times reaches the preset number of iterations. The overall loss function is calculated as follows: l total =λ1l sr +λ2l w +λ3l cls Among them, l total is the overall loss function, λ1 corresponds to the weight parameter of super-resolution loss, λ2 corresponds to the weight parameter of weight loss, and λ3 corresponds to the weight parameter of classification loss.
8. The multi-resolution collaborative pedestrian recognition device according to claim 5, characterized in that: The rank-n hit rate is used as an evaluation index of the trained pedestrian recognition model, which represents the probability that the correct pedestrian ID is included in the first n results ranked by feature similarity.
9. A multi-resolution collaborative pedestrian recognition device, characterized in that: The multi-resolution collaborative pedestrian recognition device includes a processor, a memory, and a multi-resolution collaborative pedestrian recognition program stored in the memory and executable by the processor, wherein when the multi-resolution collaborative pedestrian recognition program is executed by the processor, the steps of the multi-resolution collaborative pedestrian recognition method as described in any one of claims 1 to 4 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a multi-resolution collaborative pedestrian recognition program, wherein when the multi-resolution collaborative pedestrian recognition program is executed by a processor, the steps of the multi-resolution collaborative pedestrian recognition method as described in any one of claims 1 to 4 are implemented.
