Multi-scale concise attention pedestrian re-identification method, system, device and medium
Through the multi-scale concise attention pedestrian re-identification method, the adaptive multi-scale concise attention neural network is used to extract pedestrian image features, which solves the problem of image changes and noise effects in pedestrian re-identification technology, and improves the recognition accuracy and model generalization ability. .
Patent Information
- Application Number
- CN202111283604.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-11-01
AI Technical Summary
Existing pedestrian re-identification technology is difficult to overcome the influence of pedestrian image changes, style changes and noise, resulting in low recognition accuracy, especially in unknown surveillance scenes, which is difficult to generalize.
A multi-scale concise attention pedestrian re-identification method is adopted to extract global and high-level feature information through an adaptive multi-scale concise attention neural network, including a convolution unit, a concise attention unit, an adaptive multi-scale attention unit and a parameter optimization unit, and reduce model complexity and improve recognition accuracy.
It improves the recognition accuracy of the pedestrian re-identification model, enhances the ability to capture subtle differences and contour differences of pedestrians, reduces computing requirements, reduces model complexity, and is suitable for unknown monitoring scenarios.
Smart Images

Figure CN114220067B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pedestrian re-identification, and in particular to a multi-scale concise attention pedestrian re-identification method, system, device and medium. Background Art
[0002] With the vigorous development of smart city construction in my country, the requirements for public safety are also growing. Some public areas such as railway stations, roads, and airports are covered by large-scale video surveillance networks. These networks provide a large amount of video data. It is very inefficient and costly to obtain effective information from these data by manual means, and it is also difficult to ensure real-time performance. Therefore, intelligent video analysis has great development prospects. Its main video analysis technology is to process the information contained in discrete surveillance images, and the specific technology used is pedestrian re-identification technology in image processing. As an important means of intelligent video analysis, pedestrian re-identification technology no longer needs to be manually used to find target pedestrians from a large amount of video data, greatly improving work efficiency; by monitoring pedestrians in video surveillance scenes, warnings for abnormal behaviors or specific pedestrians are issued, providing greater support for public security, which has very important practical significance.
[0003] Person re-identification refers to the task of identifying and retrieving pedestrians from images of pedestrians captured by different surveillance cameras in a surveillance scene with a limited time and space range. The key to the task of person re-identification is how to overcome the rich changes in the content of pedestrian images and extract invariant feature expressions that can describe the identity information of pedestrians. These changes mainly include three aspects: the first is caused by the walking movements of pedestrians and the shooting angle of the surveillance camera, which is called the change of the human body; the second is caused by the environment within the surveillance range and the bias of the surveillance camera, which is called the change of style; the third is caused by abnormal operation of the surveillance camera or malicious attacks, which is called the change of noise. The existing invariant feature learning methods mainly start from the entire pedestrian image, which is easy to ignore the changes of the human body in the image, resulting in the loss of detailed information, and it is difficult to cope with unknown style changes, which limits the ability of the model to be applied to unknown surveillance scenes. In addition, it is easily affected by noise, especially specially designed adversarial noise, which leads to inaccurate recognition results. Summary of the invention
[0004] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0005] To this end, an object of an embodiment of the present invention is to provide a multi-scale concise attention pedestrian re-identification method, which reduces the complexity of the pedestrian re-identification model and improves the recognition accuracy of the pedestrian re-identification model.
[0006] Another object of an embodiment of the present invention is to provide a multi-scale concise attention pedestrian re-identification system.
[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides a multi-scale concise attention pedestrian re-identification method, comprising the following steps:
[0009] Acquire a plurality of preset first pedestrian images, and preprocess the first pedestrian images to obtain a training data set;
[0010] Constructing an adaptive multi-scale concise attention neural network, wherein the adaptive multi-scale concise attention neural network includes a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit, and a parameter optimization unit;
[0011] Inputting the training data set into the adaptive multi-scale concise attention neural network for training to obtain a trained person re-identification model, and then identifying the pedestrian image to be identified through the pedestrian re-identification model;
[0012] Among them, the convolution unit is used to extract the global feature information of the input image, the concise attention unit is used to extract the main attention information based on the global feature information, the adaptive multi-scale attention unit is used to extract the high-level attention information based on the main attention information, the average pooling unit is used to generate a feature vector based on the high-level attention information, and the parameter optimization unit is used to calculate the training loss value based on the classification result of the feature vector and update the parameters of the multi-scale concise attention neural network based on the loss value.
[0013] Furthermore, in one embodiment of the present invention, the convolution unit includes a plurality of convolution layers, and the plurality of convolution layers are used to perform layer-by-layer feature extraction on the input image to obtain global feature information of the input image.
[0014] Furthermore, in one embodiment of the present invention, the concise attention unit includes two first residual blocks, the first residual blocks are constructed based on a concise attention mechanism, the first residual blocks are used to decompose the global feature information into multiple feature points, and determine the attention value of each feature point by weight sharing, and then determine the main attention information based on the feature points and the attention value.
[0015] Furthermore, in one embodiment of the present invention, the adaptive multi-scale attention unit includes four second residual blocks, which are constructed based on an adaptive multi-scale attention mechanism. The second residual blocks are used to adaptively extract image features of the main attention information based on multiple different scales, and then obtain high-level attention information based on the image features.
[0016] Furthermore, in one embodiment of the present invention, the average pooling unit includes a pooling layer, and the pooling layer is used to perform a global average pooling operation on the high-level attention information to obtain multiple feature vectors.
[0017] Further, in one embodiment of the present invention, the step of inputting the training data set into the adaptive multi-scale concise attention neural network for training specifically includes:
[0018] Inputting the training data set into the adaptive multi-scale concise attention neural network to obtain a prediction classification result;
[0019] Determine a training loss value according to the predicted classification result and the label of the training data set;
[0020] Updating the parameters of the adaptive multi-scale concise attention neural network through a back propagation algorithm according to the loss value;
[0021] When the loss value reaches a preset first threshold or the number of iterations reaches a preset second threshold, the training is stopped to obtain the pedestrian re-identification model.
[0022] Furthermore, in one embodiment of the present invention, the loss value is obtained by weighted summation of V variance multi-label loss and cross entropy loss.
[0023] In a second aspect, an embodiment of the present invention proposes a multi-scale concise attention pedestrian re-identification system, comprising:
[0024] A training data set determination module, used to obtain a plurality of preset first pedestrian images, pre-process the first pedestrian images, and obtain a training data set;
[0025] A neural network building module, used to build an adaptive multi-scale concise attention neural network, wherein the adaptive multi-scale concise attention neural network includes a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit, and a parameter optimization unit;
[0026] A model training and recognition module, used for inputting the training data set into the adaptive multi-scale concise attention neural network for training, obtaining a trained pedestrian re-recognition model, and then recognizing the pedestrian image to be recognized through the pedestrian re-recognition model;
[0027] Among them, the convolution unit is used to extract the global feature information of the input image, the concise attention unit is used to extract the main attention information based on the global feature information, the adaptive multi-scale attention unit is used to extract the high-level attention information based on the main attention information, the average pooling unit is used to generate a feature vector based on the high-level attention information, and the parameter optimization unit is used to calculate the training loss value based on the classification result of the feature vector and update the parameters of the multi-scale concise attention neural network based on the loss value.
[0028] In a third aspect, an embodiment of the present invention provides a multi-scale concise attention pedestrian re-identification device, comprising:
[0029] at least one processor;
[0030] at least one memory for storing at least one program;
[0031] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned multi-scale concise attention pedestrian re-identification method.
[0032] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores a program executable by a processor, and the program executable by the processor is used to execute the above-mentioned multi-scale concise attention pedestrian re-identification method when executed by the processor.
[0033] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:
[0034] The embodiment of the present invention uses a concise attention unit to perform a fast response enhancement operation on the global feature information, and can perform the same enhancement calculation on each feature point respectively, and evenly focus on different feature points, so as to obtain more effective main attention information, reduce the calculation requirements of the model, and reduce the complexity of the pedestrian re-identification model; through the adaptive multi-scale attention unit to capture the subtle differences and contour differences between pedestrians, high-level attention information with generalization and differentiation capabilities can be extracted, thereby improving the recognition accuracy of the pedestrian re-identification model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A flowchart of the steps of a multi-scale concise attention pedestrian re-identification method provided by an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the structure of an adaptive multi-scale concise attention neural network provided by an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of the structure of a convolution unit provided in an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of the structure of a concise attention unit provided by an embodiment of the present invention;
[0040] Figure 5 A schematic diagram of the structure of an adaptive multi-scale attention unit provided by an embodiment of the present invention;
[0041] Figure 6 A schematic diagram of the structure of an average pooling unit provided in an embodiment of the present invention;
[0042] Figure 7 A structural block diagram of a multi-scale concise attention pedestrian re-identification system provided by an embodiment of the present invention;
[0043] Figure 8 A structural block diagram of a multi-scale concise attention pedestrian re-identification device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limitations of the present invention. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0045] In the description of the present invention, the meaning of "a plurality" is two or more than two. If there is a description of "a first" or "a second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by those skilled in the art.
[0046] Reference Figure 1The embodiment of the present invention provides a multi-scale concise attention pedestrian re-identification method, which specifically includes the following steps:
[0047] S101, obtaining a plurality of preset first pedestrian images, and preprocessing the first pedestrian images to obtain a training data set;
[0048] S102, constructing an adaptive multi-scale concise attention neural network, the adaptive multi-scale concise attention neural network comprising a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit, and a parameter optimization unit;
[0049] S103, inputting the training data set into an adaptive multi-scale concise attention neural network for training, obtaining a trained person re-identification model, and then identifying the pedestrian image to be identified through the pedestrian re-identification model;
[0050] Among them, the convolution unit is used to extract the global feature information of the input image, the succinct attention unit is used to extract the main attention information based on the global feature information, the adaptive multi-scale attention unit is used to extract the high-level attention information based on the main attention information, the average pooling unit is used to generate a feature vector based on the high-level attention information, and the parameter optimization unit is used to calculate the training loss value based on the classification result of the feature vector and update the parameters of the multi-scale succinct attention neural network based on the loss value.
[0051] like Figure 2 As shown, an embodiment of the present invention proposes an adaptive multi-scale concise attention neural network (SMCAN) for pedestrian re-identification (Re-ID), which consists of a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit and a parameter optimization unit. Different from the existing attention method that obtains attention features in a hierarchical manner, the SMCAN of the embodiment of the present invention is designed to focus on concise attention and multi-scale attention. By adding concise attention units with different kernel sizes, the discriminative representation of the pedestrian image is obtained according to the extracted attention features of different texture sizes.
[0052] The embodiment of the present invention uses a concise attention unit to perform a fast response enhancement operation on the global feature information, and can perform the same enhancement calculation on each feature point respectively, and evenly focus on different feature points, so as to obtain more effective main attention information, reduce the calculation requirements of the model, and reduce the complexity of the pedestrian re-identification model; through the adaptive multi-scale attention unit to capture the subtle differences and contour differences between pedestrians, high-level attention information with generalization and differentiation capabilities can be extracted, thereby improving the recognition accuracy of the pedestrian re-identification model.
[0053] Further as an optional implementation, the convolution unit includes multiple convolution layers, and the multiple convolution layers are used to perform layer-by-layer feature extraction on the input image to obtain global feature information of the input image.
[0054] like Figure 3 The figure shows a schematic diagram of the structure of the convolution unit provided in an embodiment of the present invention. The convolution unit is used for primary image feature extraction. The embodiment of the present invention selects ResNet50 as the basic framework of the neural network. The first layer of ResNet50 is a conv.1 layer with a 7×7 filter. The next layer contains 4 convolution blocks, each of which has 3, 4, 6, and 3 residual blocks. Each residual block has three convolution layers with kernel sizes of 1×1, 3×3, and 1×1, respectively. The convolution unit uses the first three residual blocks of the conv.1 layer, conv.B1 layer, conv.B2 layer, and conv.B3 layer of ResNet50 to extract the primary image features of the pedestrian image. Due to the high noise in the original image, the attention operation cannot obtain global attention information, and it is inappropriate to pay attention to the image directly. Based on the above considerations, main feature extraction is required. In the embodiment of the present invention, the input image size is 384×192×3, and a feature map of 24×12×1024 is obtained through the convolution unit, which is the global feature information of the pedestrian image, and then concise attention is performed.
[0055] Further as an optional implementation, the concise attention unit includes two first residual blocks, the first residual blocks are constructed based on the concise attention mechanism, the first residual blocks are used to decompose the global feature information into multiple feature points, and determine the attention value of each feature point by weight sharing, and then determine the main attention information based on the feature points and the attention values.
[0056] The goal of Concise Attention is to construct an equal attention mechanism from feature point to feature point under the conditions of small parameters and low computational complexity. Unlike the traditional attention mechanism that uses the weight of channel c in the feature map c×h×w as channel attention or the weight of feature map h×w as spatial attention, the concise attention unit of the embodiment of the present invention decomposes the input feature map c×h×w into c feature points, and calculates the attention value of each feature point in a weight sharing manner. The purpose of weight sharing is to make the attention methods between each feature point equal. The embodiment of the present invention uses ordinary convolution to extract features, uses channel convolution to extract feature attention, constructs attention weights, and realizes a concise attention mechanism. The embodiment of the present invention performs convolution calculations by sharing weights, requires fewer convolution calculation parameters, and has low computational complexity.
[0057] like Figure 4The figure shows a schematic diagram of the structure of the concise attention unit provided by an embodiment of the present invention, which uses the 4th residual block and the 5th residual block of the conv.B3 layer in ResNet50 combined with the concise attention mechanism (CA) of an embodiment of the present invention to obtain the concise attention unit. The two residual blocks of the concise attention unit perform basic attention on the feature map and extract the main attention information.
[0058] Further as an optional implementation, the adaptive multi-scale attention unit includes four second residual blocks, which are constructed based on the adaptive multi-scale attention mechanism. The second residual blocks are used to adaptively extract image features of main attention information based on multiple different scales, and then obtain high-level attention information based on the image features.
[0059] Specifically, the Adaptive Multiscale Attention (AMA) mechanism of the embodiment of the present invention is described in detail below. Since the calculation of the concise attention unit is simple, the concise attention unit is used as a convolution block in the adaptive multiscale attention, and the weights of the concise attention units of different degrees are adjusted by adaptive weight adjustment operation. Compared with other similar algorithms, the adaptive multiscale attention of the embodiment of the present invention has the following advantages: first, since the concise attention has a small number of parameters and low computational complexity, it is suitable for convolution calculations of larger kernels, and the large-size kernel increases the perception domain, thereby enhancing the overall perception of the algorithm to the image features, so that AMA can obtain a more generalized object feature representation; secondly, multiple concise attention units of different scales (specifically 3×3, 5×5 and 7×7) are used, and different weights are given to each scale for adaptive attention adjustment. In this way, the adaptive multiscale attention can extract features of different particle sizes, so that the model can adaptively obtain information of different particle images and extract distinguishable features from images of different sizes. In other words, the adaptive multiscale attention unit of the embodiment of the present invention can extract image features with generalization and differentiation capabilities.
[0060] like Figure 5 The figure shows a schematic diagram of the structure of the adaptive multi-scale attention unit provided in an embodiment of the present invention. An adaptive multi-scale attention mechanism is used for the sixth residual block of the conv.B3 layer and the three residual blocks of the conv.B4 layer in ResNet50. Through four times of adaptive multi-scale attention, high-level attention is performed on the feature map, and high-level attention information with generalization and discrimination capabilities is extracted.
[0061] Further as an optional implementation, the average pooling unit includes a pooling layer, and the pooling layer is used to perform a global average pooling operation on the high-level attention information to obtain multiple feature vectors.
[0062] like Figure 6The figure shows a schematic diagram of the structure of the average pooling module (Average Pooling Module, APM) provided by an embodiment of the present invention, which inputs 24×12×2048 feature maps and outputs 6 2048-dimensional feature vectors. First, the average pooling unit performs an average pooling operation on the high-level attention information, evenly cuts the 24×12×2048 feature maps into 6 4×12×2048 feature maps, and then calculates the average value of each channel to obtain 6 1×1×2048 feature maps, and finally extracts the values of the 6 feature maps to obtain the output of 6 2048-dimensional feature vectors.
[0063] As an optional implementation, the step of inputting the training data set into the adaptive multi-scale concise attention neural network for training specifically includes:
[0064] A1. Input the training data set into the adaptive multi-scale concise attention neural network to obtain the predicted classification results;
[0065] A2. Determine the training loss value based on the predicted classification results and the labels of the training data set;
[0066] A3. Update the parameters of the adaptive multi-scale concise attention neural network through the back propagation algorithm according to the loss value;
[0067] A4. When the loss value reaches a preset first threshold or the number of iterations reaches a preset second threshold, the training is stopped to obtain a pedestrian re-identification model.
[0068] In the embodiment of the present invention, after the adaptive multi-scale concise attention neural network is constructed, the training data set can be input into the adaptive multi-scale concise attention neural network for training. Specifically, after the data in the training data set is input into the adaptive multi-scale concise attention neural network, the output prediction classification result can be obtained, and the accuracy of the model prediction can be evaluated according to the prediction classification result and the label of the training data set, so as to update the parameters of the model. For the pedestrian re-identification model, the accuracy of the model prediction result can be measured by the loss function, which is defined on a single training data and is used to measure the prediction error of a training data. Specifically, the loss value of the training data is determined by the label of a single training data and the prediction result of the model for the training data. In actual training, a training data set has a lot of training data, so the cost function is generally used to measure the overall error of the training data set. The cost function is defined on the entire training data set and is used to calculate the average value of the prediction error of all training data, which can better measure the prediction effect of the model. For a general machine learning model, based on the aforementioned cost function, plus the regularization term that measures the complexity of the model, it can be used as the objective function of the training, and the loss value of the entire training data set can be calculated based on the objective function. There are many types of commonly used loss functions, such as 0-1 loss function, square loss function, absolute loss function, logarithmic loss function, cross entropy loss function, etc., which can all be used as loss functions of machine learning models, which will not be elaborated here one by one. In an embodiment of the present invention, any loss function can be selected to determine the loss value of training. Based on the loss value of training, the back propagation algorithm is used to update the parameters of the model, and a trained pedestrian re-identification model can be obtained after several rounds of iteration. The specific number of iterations can be set in advance, or the training is considered to be completed when the test set meets the accuracy requirements.
[0069] Further as an optional implementation, the loss value is obtained by weighted summation of V variance multi-label loss and cross entropy loss.
[0070] Specifically, the loss function is used to calculate the loss value between the predicted value and the true value. Even under the same model, different loss functions will lead to different model performance. Therefore, constructing a loss function that can improve model performance is one of the main contents of deep learning. In the embodiment of the present invention, based on the traditional cross entropy loss (SCEL), the V-variance multi-label loss (PVML) is introduced to obtain the loss function, and the loss function is shown in the following formula.
[0071] Loss = α1·L PVM +α2·L SCE
[0072] Among them, Loss represents the loss value, LPVM V represents the variance multi-label loss, L SCE represents the cross entropy loss, and α1 and α2 are two different hyperparameter weights.
[0073] The V-variance multi-label loss of the embodiment of the present invention mainly uses multiple labels to measure the introduction distance and interval distance between pedestrian feature groups, with the purpose of making the distance within the group as small as possible and the distance between groups as large as possible. The design process of the V-variance multi-label loss is divided into the following three steps:
[0074] (1) Determine the variance distance. Assume that there are m individuals in the database during model training, where m represents the total number of IDs in the batch or the number of categories of training images. Divide the photos of the same person into groups of m people. Label the ID of the i-th person as ID(i), where i = 0, 1, ..., m-1. Let n i represents the total number of images in ID(i), F i:j represents the feature map of the jth image in ID(i), i = 0, 1, ..., m-1, j = 0, 1, ..., n i -1. Let M i is the average value of the feature map in ID(i), which can be expressed as:
[0075]
[0076] Then the intra-group variance distance D of the image feature in ID(i) is i It can be expressed as:
[0077]
[0078] The inter-group variance distance of image features in ID(i) It can be expressed as:
[0079]
[0080] (2) Determine the multi-label. Since the variance distance within the group D(i) and the variance distance between the groups D i Contains multiple different pedestrian IDs, and needs to calculate the loss function corresponding to multi-label classification. The multi-label design is as follows: Let the label corresponding to ID(i) be label F(i). In ID(i), the multi-label of the intra-group distance is a zero vector. The multi-label of the inter-group distance in ID(i) and ID(j) is a vector, and the corresponding number of categories is 1.
[0081] (3) Using the determined multi-labels as classification labels, calculate the multi-class cross entropy loss and obtain the V variance multi-label loss. The relevant formula is as follows:
[0082]
[0083] In addition, the cross entropy loss (SCEL) is the classification loss calculated on the feature map, and its calculation formula is as follows:
[0084]
[0085] The loss function of the present invention is obtained by weighted summation based on the cross entropy loss and the V variance multi-label loss. The cross entropy loss is used to measure the classification loss of the feature map, and the V variance multi-label loss is used to measure the loss of the distance between groups and the distance within the group. The cross entropy loss focuses on calculating the loss of a single feature for each ID, while the V variance multi-label loss focuses on calculating the loss of the distance interval between the entire ID group and the distance within the group. Through the division of labor and complementary combination of these two loss functions, the trend of feature training of the algorithm model is well guided. The embodiment of the present invention increases the diversity of the training loss function and improves the robustness of the pedestrian re-identification model by introducing precise V variance multi-label loss.
[0086] The pedestrian re-identification model trained by the embodiment of the present invention is tested using four datasets, namely, CUHK03, Market-1501, DukeMTMC-reID and MSMT17. The Rank 1 accuracy of the pedestrian re-identification model is shown in Table 1 below.
[0087] CUHK03 Market-1501 DukeMTMC-reID MSMT17 Best data published 87.5% 96.20% 92.5% 76.6% SMCAN(RR) 91.85% 97.47% 93.9% 89.0%
[0088] Table 1
[0089] As can be seen from Table 1, the Rank 1 accuracy of the pedestrian re-identification model of the embodiment of the present invention on CUHK03, Market-1501, DukeMTMC-reID and MSMT17 are 91.85%, 97.47%, 93.90% and 89.00% respectively, which are better than the best data known so far.
[0090] Reference Figure 7 , an embodiment of the present invention provides a multi-scale concise attention pedestrian re-identification system, comprising:
[0091] A training data set determination module is used to obtain a plurality of preset first pedestrian images, pre-process the first pedestrian images, and obtain a training data set;
[0092] A neural network building module, used to build an adaptive multi-scale concise attention neural network, which includes a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit, and a parameter optimization unit;
[0093] The model training and recognition module is used to input the training data set into the adaptive multi-scale concise attention neural network for training, obtain the trained pedestrian re-identification model, and then recognize the pedestrian image to be identified through the pedestrian re-identification model;
[0094] Among them, the convolution unit is used to extract the global feature information of the input image, the succinct attention unit is used to extract the main attention information based on the global feature information, the adaptive multi-scale attention unit is used to extract the high-level attention information based on the main attention information, the average pooling unit is used to generate a feature vector based on the high-level attention information, and the parameter optimization unit is used to calculate the training loss value based on the classification result of the feature vector and update the parameters of the multi-scale succinct attention neural network based on the loss value.
[0095] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0096] Reference Figure 8 The embodiment of the present invention provides a multi-scale concise attention pedestrian re-identification device, comprising:
[0097] at least one processor;
[0098] at least one memory for storing at least one program;
[0099] When the at least one program is executed by the at least one processor, the at least one processor implements the multi-scale concise attention pedestrian re-identification method.
[0100] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0101] An embodiment of the present invention also provides a computer-readable storage medium, which stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to execute the above-mentioned multi-scale concise attention pedestrian re-identification method.
[0102] A computer-readable storage medium of an embodiment of the present invention can execute a multi-scale concise attention pedestrian re-identification method provided by an embodiment of the method of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
[0103] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.
[0104] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0105] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0106] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0107] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0108] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.
[0109] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0110] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0111] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0112] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A multi-scale concise attention pedestrian re-identification method, characterized in that: The following steps are involved: Acquire a plurality of preset first pedestrian images, and preprocess the first pedestrian images to obtain a training data set; Constructing an adaptive multi-scale concise attention neural network, wherein the adaptive multi-scale concise attention neural network includes a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit, and a parameter optimization unit; Inputting the training data set into the adaptive multi-scale concise attention neural network for training to obtain a trained person re-identification model, and then identifying the pedestrian image to be identified through the pedestrian re-identification model; The convolution unit is used to extract global feature information of the input image, the concise attention unit is used to extract main attention information according to the global feature information, the adaptive multi-scale attention unit is used to extract high-level attention information according to the main attention information, the average pooling unit is used to generate a feature vector according to the high-level attention information, and the parameter optimization unit is used to calculate the loss value of the training according to the classification result of the feature vector and update the parameters of the multi-scale concise attention neural network according to the loss value; The concise attention unit includes two first residual blocks, the first residual blocks are constructed based on the concise attention mechanism, and the first residual blocks are used to decompose the global feature information into multiple feature points, and determine the attention value of each feature point by weight sharing, and then determine the main attention information according to the feature points and the attention value; The adaptive multi-scale attention unit includes four second residual blocks, which are constructed based on an adaptive multi-scale attention mechanism. The second residual blocks are used to adaptively extract image features of the main attention information based on multiple different scales, and then obtain high-level attention information based on the image features.
2. The multi-scale concise attention pedestrian re-identification method according to claim 1, characterized in that: The convolution unit includes a plurality of convolution layers, and the plurality of convolution layers are used to perform layer-by-layer feature extraction on an input image to obtain global feature information of the input image.
3. The multi-scale concise attention pedestrian re-identification method according to claim 1, characterized in that: The average pooling unit includes a pooling layer, and the pooling layer is used to perform a global average pooling operation on the high-level attention information to obtain multiple feature vectors.
4. The multi-scale concise attention pedestrian re-identification method according to claim 1, characterized in that: The step of inputting the training data set into the adaptive multi-scale concise attention neural network for training specifically includes: Inputting the training data set into the adaptive multi-scale concise attention neural network to obtain a prediction classification result; Determine a training loss value according to the predicted classification result and the label of the training data set; Updating the parameters of the adaptive multi-scale concise attention neural network through a back propagation algorithm according to the loss value; When the loss value reaches a preset first threshold or the number of iterations reaches a preset second threshold, the training is stopped to obtain the pedestrian re-identification model.
5. The multi-scale concise attention pedestrian re-identification method according to claim 1, characterized in that: The loss value is obtained by weighted summation of V variance multi-label loss and cross entropy loss.
6. A multi-scale concise attention pedestrian re-identification system, used to implement a multi-scale concise attention pedestrian re-identification method as claimed in any one of claims 1 to 5, characterized in that: include: A training data set determination module, used to obtain a plurality of preset first pedestrian images, pre-process the first pedestrian images, and obtain a training data set; A neural network building module, used to build an adaptive multi-scale concise attention neural network, wherein the adaptive multi-scale concise attention neural network includes a convolution unit, a concise attention unit, an adaptive multi-scale attention unit, an average pooling unit, and a parameter optimization unit; A model training and recognition module, used for inputting the training data set into the adaptive multi-scale concise attention neural network for training, obtaining a trained pedestrian re-recognition model, and then recognizing the pedestrian image to be recognized through the pedestrian re-recognition model; Among them, the convolution unit is used to extract the global feature information of the input image, the concise attention unit is used to extract the main attention information based on the global feature information, the adaptive multi-scale attention unit is used to extract the high-level attention information based on the main attention information, the average pooling unit is used to generate a feature vector based on the high-level attention information, and the parameter optimization unit is used to calculate the training loss value based on the classification result of the feature vector and update the parameters of the multi-scale concise attention neural network based on the loss value.
7. A multi-scale concise attention pedestrian re-identification device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a multi-scale concise attention pedestrian re-identification method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to execute a multi-scale concise attention pedestrian re-identification method as described in any one of claims 1 to 5 when executed by the processor.
