Cross-domain pedestrian attribute recognition method and system

By constructing a cross-domain pedestrian attribute recognition evaluation criterion and an unsupervised domain adaptation technique, a cross-domain pedestrian attribute recognition model was established, which solved the problem of distribution differences between different datasets and achieved high-precision cross-domain pedestrian attribute recognition.

CN117058494BActive Publication Date: 2026-02-10UNIV OF SCI & TECH BEIJING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310961613.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-01
Publication Date
2026-02-10
Estimated Expiration
2043-08-01

AI Technical Summary

Technical Problem

Existing pedestrian attribute recognition models can only be trained and tested on the same dataset, which cannot effectively handle the distribution differences between different datasets, resulting in a decline in cross-domain recognition performance.

Method used

An evaluation criterion for cross-domain pedestrian attribute recognition is constructed, and unsupervised domain adaptation technology is incorporated. A cross-domain pedestrian attribute recognition model is established through a feature extractor, attribute classifier, and local domain discriminator, and is trained and tested using source domain and target domain datasets.

Benefits of technology

It achieves high-precision pedestrian attribute recognition across different datasets, accurately measures cross-domain performance, and improves the model's recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117058494B_ABST
    Figure CN117058494B_ABST
Patent Text Reader

Abstract

The application discloses a cross-domain pedestrian attribute recognition method and system, and the method comprises the following steps: constructing an evaluation criterion for cross-domain pedestrian attribute recognition, which is used for corresponding the attribute labels between the source domain data set and the target domain data set which are different in attribute label type and quantity; integrating an unsupervised domain adaptation technology into a pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model; based on the evaluation criterion, training and testing the cross-domain pedestrian attribute recognition model by using the source domain data set and the target domain data set; and realizing cross-domain pedestrian attribute recognition by using the trained cross-domain pedestrian attribute recognition model. By adopting the technical scheme of the application, the performance of the cross-domain pedestrian attribute recognition model can be accurately measured, and then a high-precision cross-domain pedestrian attribute recognition model can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a cross-domain pedestrian attribute recognition method and system. BACKGROUND

[0002] In recent years, pedestrian attribute recognition (PAR) has attracted more and more attention in the field of computer vision. The purpose of PAR is to identify a series of predefined pedestrian attributes from a pedestrian picture, such as glasses, hats, backpacks, gender, etc. These pedestrian attributes can usually assist in improving the accuracy of other tasks, such as pedestrian re-identification, pedestrian retrieval, etc. The dataset of pedestrian attribute recognition is composed of a large number of pedestrian pictures and attribute labels of the pictures. The attribute label of each pedestrian picture is a 0-1 sequence, and 1 indicates that the attribute exists, and 0 indicates that the attribute does not exist. For example, the attribute of "hat", the label of 1 indicates that the pedestrian wears a hat, and the label of 0 indicates that the pedestrian does not wear a hat. Different pedestrian attribute datasets contain different types and quantities of attributes. The three most commonly used pedestrian attribute datasets are PETA, RAP, and PA100k.

[0003] With the continuous development of deep learning, the field of pedestrian attribute recognition has also made great progress by using deep learning. Most pedestrian attribute recognition models regard pedestrian attribute recognition as a multi-label picture classification task. The basic process of training the pedestrian attribute recognition model is as follows: first, input the pedestrian image into the feature extractor to extract the features, and the feature extractor is generally a convolutional neural network (CNN); then input the extracted features into the attribute classifier, which is generally a fully connected layer, and the fully connected layer outputs the recognition probability of each attribute, calculates the loss function, and adjusts the parameters of the feature extractor and the attribute classifier through back propagation to improve the recognition accuracy.

[0004] On the basis of the basic model, the existing methods add various mechanisms to improve the performance of the model. The existing methods can be roughly divided into three categories: attention-based pedestrian attribute recognition, grouping-based pedestrian attribute recognition, and attribute relationship-based pedestrian attribute recognition.

[0005] Attention-based pedestrian attribute recognition is to use attention mechanism on global features, so that it can pay more attention to useful local information and perform attribute recognition in a more fine-grained manner. Different algorithms design various attention mechanisms. Liu X et al. (Liu X, Zhao H, Tian M, et al. HydraPlus-Net: Attentive deep features for pedestrian analysis [C] / / Proceedings of the IEEE international conference on computer vision. 2017: 350-359.) designed a multi-directional attention module. This method gets feature maps from different levels of the network backbone, calculates different levels of attention maps from the feature maps, and then applies these attention maps to all levels of feature maps, not just a single level of feature maps. Because the attention maps from different levels contain different information, the attention maps from higher levels pay more attention to semantic information, while the attention maps from lower levels capture more detailed local information such as edges and textures. This can effectively fuse multi-level features with local attention and better utilize global and local content. Group-based pedestrian attribute recognition groups attributes according to certain rules, such as attributes appearing in the same area as a group, to explore the relationship between attributes. Methods based on recurrent neural networks (RNN) / long short-term memory networks (LSTM) use recurrent neural networks or long short-term memory networks to explore the relationship between attributes. These two methods often appear together, such as after grouping attributes, inputting them into the LSTM network, so both methods are introduced. Ji Z et al. (Ji Z, Zheng W, Pang Y. Deep pedestrian attribute recognition based on LSTM [C] / / 2017 IEEE International Conference on Image Processing (ICIP). IEEE, 2017: 151-155) were inspired by the image caption idea. They randomly connected attribute labels into different sentences and then input the attribute sentences into the LSTM. They treated the attribute recognition problem as an image caption problem and predicted the image caption as the combination of image attributes. Attribute relationship-based pedestrian attribute recognition methods also attempt to explore the relationship between attributes, but do not use recurrent neural networks. Instead, they use the co-occurrence prior between attributes, for example, when identifying a pedestrian with the attributes of "short skirt" or "long hair", the probability of identifying the attribute of "female" will be very high.Han K et al. (Han K, Wang Y, Shu H, et al. Attribute aware pooling for pedestrian attribute recognition[J]. arXivpreprint arXiv:1907.11837,2019) first calculated the occurrence frequency and co-occurrence number of different attributes in the training set images, then calculated the co-occurrence matrix, used the co-occurrence matrix as auxiliary information, calculated the auxiliary estimated probability matrix, and combined the original estimated probability matrix and the auxiliary probability matrix through parameters to obtain the final probability matrix.

[0006] The above pedestrian attribute recognition methods have all improved pedestrian attribute recognition models from different perspectives and achieved remarkable results. However, their research focuses on pedestrian attribute recognition on a single dataset, with both the training and test sets coming from the same dataset, resulting in no distributional differences between the data. When the training and test sets come from different datasets, performance degrades due to distributional differences. For example, StrongBaseline, a pedestrian attribute recognition method from "Rethinking of pedestrian attribute recognition: Realistic datasets with efficient method()", treats pedestrian attribute recognition as a multi-label classification task and is a network that can be trained end-to-end. It mainly consists of two parts: a feature extractor and an image classifier. The feature extractor is composed of a ResNet50 convolutional neural network. Images from the training set are input into ResNet50 to extract image features. These features are then input into a fully connected layer. The number of output nodes in the fully connected layer is the same as the number of pedestrian attributes to be recognized. The output of the fully connected layer is passed through a sigmoid function to obtain the probability of each pedestrian attribute. Then, the loss function is calculated using the predicted attribute probabilities and the true attribute labels in the dataset. Here, the binary cross-entropy loss function is used. During training, the parameters of the feature extractor and classifier are adjusted through backpropagation, and the loss gradually decreases, thus improving the accuracy of pedestrian attribute recognition. However, the StrongBaseline method can only recognize attributes contained in the training set. The training and test sets used are from the same dataset, and there is no distribution difference between the data. It is a single-domain pedestrian attribute recognition. If you want to use the trained StrongBaseline model to recognize attributes in other datasets, the recognition performance will drop significantly due to the distribution differences of the datasets.

[0007] In summary, pedestrian attribute recognition attempts to identify numerous pedestrian attributes from pedestrian images, including gender, glasses, and hats. These attributes can assist tasks such as pedestrian re-identification, pedestrian retrieval, and pedestrian detection. However, since existing methods can only be trained on labeled datasets like PETA, when PAR is used as an adjunct task to pedestrian re-identification, the main task dataset lacks attribute labels. Therefore, models trained on the PAR dataset can only identify attributes from the main task dataset, essentially using the PAR dataset as the training set and the main task data as the test set. However, images with the attribute "backpack" exhibit significant differences in background, lighting, angle, and pixel count across different datasets, resulting in data distribution variations.

[0008] The distribution differences between datasets for different tasks can lead to a decrease in recognition performance. This situation, where the training and test sets come from different datasets, is called cross-domain recognition. The labeled training set is called the source domain, and the unlabeled test set is called the target domain. Currently, a model trained on a pedestrian attribute dataset can only recognize the attributes contained in that dataset. When tested on another dataset, because the number and types of attribute labels in the two datasets are different, the pedestrian attributes output by the model cannot correspond to the real attribute labels, making it impossible to calculate recognition accuracy. Consequently, the cross-domain performance of the model cannot be accurately measured, hindering the successful training of cross-domain pedestrian attribute recognition models. Summary of the Invention

[0009] This invention provides a cross-domain pedestrian attribute recognition method and system to solve the technical problem that a model trained on a pedestrian attribute dataset can only recognize the attributes contained in that dataset. When tested on another dataset, the pedestrian attributes output by the model cannot correspond to the real attribute labels because the number and types of attribute labels contained in the two datasets are different. This makes it impossible to calculate the recognition accuracy and accurately measure the cross-domain performance of the model, thus preventing the training of the cross-domain pedestrian attribute recognition model from proceeding smoothly.

[0010] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0011] On the one hand, the present invention provides a cross-domain pedestrian attribute recognition method, including:

[0012] An evaluation criterion for cross-domain pedestrian attribute recognition is constructed to map attribute labels between source domain datasets and target domain datasets with different attribute label types and numbers.

[0013] Unsupervised domain adaptation technology is integrated into the pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model.

[0014] Based on the evaluation criteria, the cross-domain pedestrian attribute recognition model is trained and tested using the source domain dataset and the target domain dataset to obtain a trained cross-domain pedestrian attribute recognition model.

[0015] Cross-domain pedestrian attribute recognition is achieved using a pre-trained cross-domain pedestrian attribute recognition model.

[0016] Furthermore, the evaluation criteria for cross-domain pedestrian attribute recognition include:

[0017] Directly map the same or similar labels in the source domain dataset and the target domain dataset;

[0018] For labels with opposite attributes in the source and target datasets, the labels in the target dataset are inverted to match the labels in the source dataset.

[0019] If an attribute in the source domain dataset can semantically contain multiple attributes in the target domain dataset, then the union of these multiple attribute labels in the target domain dataset is taken and corresponds to the attribute in the source domain dataset.

[0020] Further, the step of training and testing the cross-domain pedestrian attribute recognition model based on the evaluation criteria and using the source domain dataset and the target domain dataset to obtain the trained cross-domain pedestrian attribute recognition model includes:

[0021] The evaluation criteria are used to generate a set of attributes that correspond to each other for the source domain dataset and the target domain dataset; the attribute set is used to calculate the performance of the cross-domain pedestrian attribute recognition model.

[0022] The cross-domain pedestrian attribute recognition model was trained using the source domain dataset;

[0023] The trained cross-domain pedestrian attribute recognition model is tested using the target domain dataset; wherein, during the test, the performance of the cross-domain pedestrian attribute recognition model is calculated based on the attribute set.

[0024] Furthermore, the cross-domain pedestrian attribute recognition model includes: a feature extractor, an attribute classifier, and a local domain discriminator; wherein, a gradient inversion layer is added to the feature extractor and the local domain discriminator.

[0025] Furthermore, the cross-domain pedestrian attribute recognition model uses ResNet50 as a feature extractor to extract image features.

[0026] Furthermore, the cross-domain pedestrian attribute recognition model links a fully connected layer to the last layer of ResNet50. The number of output nodes of the fully connected layer is the same as the number of attributes to be recognized. A sigmoid function is linked after the fully connected layer to form an attribute classifier.

[0027] Furthermore, the local domain discriminator consists of a linear layer; the process by which the local domain discriminator calculates the domain discrimination loss includes:

[0028] We use a human keypoint model trained on the COCO dataset to identify keypoints of pedestrians.

[0029] Six masks are generated based on the key points of the identified pedestrians. The six masks are then applied to the global features, which are then segmented into six local features.

[0030] The six local features are input into the local discriminator to obtain six local discriminant losses; at the same time, the global features before segmentation are input into the local discriminator to obtain the global discriminant loss. The average of the obtained global discriminant loss and the six local discriminant losses is used as the final domain discriminant loss.

[0031] On the other hand, the present invention also provides a cross-domain pedestrian attribute recognition system, comprising:

[0032] The evaluation criteria construction module is used to construct evaluation criteria for cross-domain pedestrian attribute recognition, and to map attribute labels between source domain datasets with different attribute label types and numbers to target domain datasets.

[0033] The model building module is used to integrate unsupervised domain adaptation techniques into the pedestrian attribute recognition model and build a cross-domain pedestrian attribute recognition model.

[0034] The cross-domain pedestrian attribute recognition model training and testing module is used to train and test the cross-domain pedestrian attribute recognition model constructed by the model construction module based on the evaluation criteria constructed by the evaluation criterion construction module, using the source domain dataset and the target domain dataset, to obtain the trained cross-domain pedestrian attribute recognition model.

[0035] The pedestrian attribute recognition module is used to realize cross-domain pedestrian attribute recognition by utilizing the cross-domain pedestrian attribute recognition model trained by the cross-domain pedestrian attribute recognition model training and testing module.

[0036] Furthermore, the evaluation criteria for cross-domain pedestrian attribute recognition include:

[0037] Directly map the same or similar labels in the source domain dataset and the target domain dataset;

[0038] For labels with opposite attributes in the source and target datasets, the labels in the target dataset are inverted to match the labels in the source dataset.

[0039] If an attribute in the source domain dataset can semantically contain multiple attributes in the target domain dataset, then the union of these multiple attribute labels in the target domain dataset is taken and corresponds to the attribute in the source domain dataset.

[0040] The cross-domain pedestrian attribute recognition model training and testing module is specifically used for:

[0041] The evaluation criteria are used to generate a set of attributes that correspond to each other for the source domain dataset and the target domain dataset; the attribute set is used to calculate the performance of the cross-domain pedestrian attribute recognition model.

[0042] The cross-domain pedestrian attribute recognition model was trained using the source domain dataset;

[0043] The trained cross-domain pedestrian attribute recognition model is tested using the target domain dataset; wherein, during the test, the performance of the cross-domain pedestrian attribute recognition model is calculated based on the attribute set.

[0044] Furthermore, the cross-domain pedestrian attribute recognition model includes: a feature extractor, an attribute classifier, and a local domain discriminator; wherein, a gradient inversion layer is added to the feature extractor and the local domain discriminator;

[0045] The model building module has the following functions:

[0046] ResNet50 was used as the feature extractor to extract image features;

[0047] A fully connected layer is connected to the last layer of ResNet50. The number of output nodes of the fully connected layer is the same as the number of attributes to be identified. A sigmoid function is connected after the fully connected layer to form an attribute classifier.

[0048] The local domain discriminator consists of a linear layer; wherein, the process of calculating the domain discrimination loss by the local domain discriminator includes:

[0049] We use a human keypoint model trained on the COCO dataset to identify keypoints of pedestrians.

[0050] Six masks are generated based on the key points of the identified pedestrians. The six masks are then applied to the global features, which are then segmented into six local features.

[0051] The six local features are input into the local discriminator to obtain six local discriminant losses; at the same time, the global features before segmentation are input into the local discriminator to obtain the global discriminant loss. The average of the obtained global discriminant loss and the six local discriminant losses is used as the final domain discriminant loss.

[0052] In another aspect, the present invention also provides an electronic device comprising a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described method.

[0053] In another aspect, the present invention also provides a computer-readable storage medium storing at least one instruction that is loaded and executed by a processor to implement the above-described method.

[0054] The beneficial effects of the technical solution provided by this invention include at least the following:

[0055] This invention constructs an evaluation criterion for cross-domain pedestrian attribute recognition, which maps attribute labels between source and target domain datasets with different attribute label types and quantities. It integrates unsupervised domain adaptation techniques into the pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model. Based on the evaluation criterion, the cross-domain pedestrian attribute recognition model is trained and tested using both source and target domain datasets. This allows for accurate measurement of the performance of the cross-domain pedestrian attribute recognition model, resulting in a high-precision model. This invention has significant application prospects in the field of cross-domain pedestrian attribute recognition. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 This is a schematic diagram of the execution flow of the cross-domain pedestrian attribute recognition method provided in an embodiment of the present invention;

[0058] Figure 2 This is a framework diagram of the cross-domain pedestrian attribute recognition model provided in an embodiment of the present invention;

[0059] Figure 3 This is a schematic diagram of pedestrian feature segmentation provided in an embodiment of the present invention. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0061] First Embodiment

[0062] To address the problem that a model trained on a pedestrian attribute dataset can only recognize attributes contained in that dataset, and when tested on another dataset, the number and types of attribute labels in the two datasets differ, causing the model's output pedestrian attributes to not correspond to the real attribute labels, making it impossible to calculate recognition accuracy and accurately measure the model's cross-domain performance. This leads to the inability to successfully train a cross-domain pedestrian attribute recognition model. This embodiment provides a cross-domain pedestrian attribute recognition method, which can be implemented by an electronic device, such as a terminal or server. The method first identifies the problem of cross-domain pedestrian attribute recognition and innovatively proposes an evaluation criterion for accurately measuring the performance of cross-domain pedestrian attribute recognition models. Secondly, a cross-domain pedestrian attribute recognition model is created. Specifically, the execution flow of this method is as follows: Figure 1 As shown, it includes the following steps:

[0063] S1, construct evaluation criteria for cross-domain pedestrian attribute recognition, which is used to map attribute labels between source domain datasets and target domain datasets with different attribute label types and numbers;

[0064] It should be noted that the most commonly used datasets for pedestrian attribute recognition are PETA, RAP, and PA100K, which differ in the type and number of attribute labels. Therefore, they cannot be directly used as source and target domains for cross-domain performance testing. To address this, this embodiment establishes evaluation criteria for cross-domain pedestrian attribute recognition, providing a set of standards that ensure the attribute labels across these datasets correspond to each other, allowing for the calculation of the accuracy of the cross-domain pedestrian attribute model. Specifically, the evaluation criteria for cross-domain pedestrian attribute recognition include:

[0065] 1) Directly map identical or similar labels in the source and target domain datasets;

[0066] For example, if both the source and target datasets contain the attribute "hat," then the label "hat" is selected so that the "hat" labels in the two datasets directly correspond. The similarity of the labels can be calculated using any existing similarity algorithm.

[0067] 2) For labels with opposite attributes in the source and target datasets, invert the labels in the target dataset so that the inverted labels correspond to the labels in the source dataset.

[0068] For example, the "male" label in the source domain dataset and the "female" label in the target domain dataset have opposite meanings. Therefore, it is necessary to invert the "female" label in the target domain dataset so that the inverted label corresponds to the "male" label in the source domain dataset.

[0069] 3) If an attribute in the source domain dataset can semantically contain multiple attributes in the target domain dataset, then take the union of these multiple attribute labels in the target domain dataset and match it with the attribute in the source domain dataset.

[0070] For example, the label in the source domain dataset is "shoes," while the labels in the target domain dataset include "boots" and "cloth shoes." Clearly, "shoes" semantically includes both boots and cloth shoes. Therefore, the union of "boots" and "cloth shoes" in the target domain dataset, {boots, cloth shoes}, corresponds to "shoes" in the source domain dataset. S2, Unsupervised domain adaptation techniques are integrated into the pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model.

[0071] It should be noted that unsupervised domain adaptation (UDA) can address the issue of poor performance of models learned on labeled datasets on unlabeled datasets. Therefore, this embodiment integrates unsupervised domain adaptation (UDA) into a pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model, thereby improving the performance of cross-domain pedestrian attribute recognition. For example... Figure 2 As shown, the cross-domain pedestrian attribute recognition model in this embodiment mainly consists of three parts: a feature extractor, an attribute classifier, and a local domain discriminator.

[0072] 1) Feature Extractor

[0073] For the feature extractor, this embodiment uses ResNet50 as the feature extractor to extract image features. During the training phase, a labeled source domain image from the source domain dataset is used. An unlabeled target image in the target domain dataset The input is fed into the feature extractor to extract features from the source domain image. and target domain image features Where F represents a feature. This represents the i-th image in the source domain dataset s; Let represent the j-th image in the target domain dataset t.

[0074] 2) Attribute classifier

[0075] For the attribute classifier, this embodiment adds a fully connected (FC) layer to the last layer of the ResNet50 array. The number of output nodes of the FC layer is the same as the number of attributes to be identified. A sigmoid function follows the FC layer, forming the attribute classifier. The extracted source domain features are input into the attribute classifier to obtain the predicted probability of each attribute. Here, σ represents the sigmoid function. The classification loss (binary cross-entropy loss) is calculated using the predicted probabilities and the true attribute labels. During training, backpropagation is used to adjust the parameters of the feature extractor and attribute classifier, reducing the classification loss and improving the recognition accuracy of the attribute classifier.

[0076] 3) Local Domain Discriminator

[0077] In typical adversarial UDA methods, a feature extractor extracts features from both the source and target domains. A domain discriminator is then added after the feature extractor to distinguish between the source and target domains. The discriminator strives to differentiate features, while the feature extractor tries to extract sufficiently similar features to confuse the discriminator. This adversarial process ensures that the feature extractor can extract sufficiently similar features, making the discriminator unable to differentiate, thus narrowing the distribution differences between the source and target domains. During training, source and target domain features, along with their domain labels, are simultaneously input into the discriminator. Domain labels are 0-1, where 1 represents the source domain and 0 represents the target domain. The discriminator's output and the domain labels are used to calculate the domain discrimination loss, which is also a binary cross-entropy loss. During training, the parameters of the feature extractor and the discriminator are adjusted to increase the domain discrimination loss, gradually making the discriminator unable to differentiate, and the source and target domain features become increasingly similar. However, this adversarial approach only guarantees global feature similarity, while pedestrian attribute recognition is a multi-label classification task that requires sufficient similarity in local features as well.

[0078] To address the aforementioned issues, this embodiment designs a local domain discriminator in the cross-domain pedestrian attribute recognition model to obtain finer-grained local similarity features. In this method, the domain discriminator consists of a linear layer that segments pedestrian features. First, a human keypoint model trained on the COCO dataset is used to identify the pedestrian's keypoints. Six masks are generated based on these keypoints and applied to the global features, such as... Figure 3 As shown, the segmentation yields six local features. These six local features are then input into the domain discriminator to obtain six local domain discrimination losses. Simultaneously, the global features before segmentation are also input into the domain discriminator to obtain the global domain discrimination loss. The seven domain discrimination losses are summed and averaged to obtain the final domain discrimination loss.

[0079] During training, the classification loss should be continuously reduced while the domain discriminant loss should be continuously increased to improve classification accuracy and simultaneously narrow the distance between the source and target domains. To achieve this, this embodiment adds a gradient inversion layer (GRL) to both the feature extractor and the domain discriminator, thus directly reducing the domain discriminant loss to achieve the same training effect.

[0080] S3. Based on the evaluation criteria, the cross-domain pedestrian attribute recognition model is trained and tested using the source domain dataset and the target domain dataset to obtain the trained cross-domain pedestrian attribute recognition model.

[0081] It should be noted that, using the three rules constructed in S1 above, this embodiment can generate a set of attributes that correspond to each other for each source and target domain. Therefore, this embodiment can calculate the performance of the cross-domain pedestrian attribute recognition model on this dataset. The specific operation is as follows:

[0082] 1) Train a cross-domain pedestrian attribute recognition model using images and labels from the source domain dataset;

[0083] 2) Use the trained cross-domain pedestrian attribute recognition model to identify the attributes of the target domain dataset, and the identified attributes are the same as those contained in the source domain dataset;

[0084] 3) Select the attributes recognized by the model and the true attributes of the target domain that meet the above three rules, and calculate the model's recognition accuracy. Specifically, if the attribute labels recognized by the model correspond to the labels in the source domain according to the above evaluation criteria, the model's recognition result is considered accurate.

[0085] In existing PAR methods, the most important metric is mA, a label-based measure of average precision, which averages the positive and negative precision for each attribute. The metric can be calculated as follows:

[0086]

[0087] In the formula, M represents the number of attributes; N represents the number of samples; P i and TP i N represents the number of positive examples and the number of correctly predicted positive examples, respectively. i and TN i These represent the number of negative cases and the number of correctly predicted negative cases, respectively.

[0088] S4 utilizes a trained cross-domain pedestrian attribute recognition model to achieve cross-domain pedestrian attribute recognition.

[0089] To verify the effectiveness of the method of this invention, this embodiment uses three pedestrian attribute recognition datasets: PETA, RAP, and PA100k. The PETA dataset contains 19,000 images from different outdoor scenes, each annotated with 61 binary attributes and 4 multi-valued attributes. Unlike PETA, the RAP dataset consists of 41,585 indoor pedestrian images collected from 26 surveillance cameras, each with 72 fine-grained attributes. The PA100k dataset is larger than both PETA and RAP; the latter contains 100,000 human images from various outdoor scenes and has 26 commonly used attributes.

[0090] The cross-domain pedestrian attribute evaluation index provided by this invention can combine PETA, RAP, and PA100k in pairs. Since the training set of the PETA dataset is much smaller than that of RAP and PA100k, insufficient training data in the source domain will lead to insufficient training of the attribute classifier and affect the recognition accuracy. Therefore, this invention only uses RAP and PA100k as training sets, and PETA as the dataset. This results in four sets of experiments: RAP->PA100k, RAP->PETA, PA100k->PETA, and PA100k->RAP.

[0091] In the experiment, four methods were compared with the method of this invention: ResNet50, StrongBaseline, Attribute Localization Module (AML), and Multi-Scale Spatial Calibration (MSSC). AML is a pedestrian attribute recognition method (Tang C, Sheng L, Zhang Z, et al. Improving pedestrian attribute recognition with weakly-supervised multi-scale attribute-specific localization[C] / / Proceedings of the IEEE / CVF International Conference on Computer Vision.2019:4997-5006.) which proposes a flexible Attribute Localization Module (ALM). This module learns the regional features of each attribute at different levels and adaptively finds the most discriminative region. MSSC (Zhong J, Qiao H, Chen L, et al. Improving pedestrian attribute recognition with multi-scale spatial calibration[C] / / 2021 International Joint Conference on Neural Networks(IJCNN).IEEE,2021:1-8.) is also a pedestrian attribute recognition method. It extracts multi-level features and inputs them into the newly proposed Spatial Calibrated Module (SCM) to realize the interaction between low-level features and high-level features.

[0092] This embodiment obtains the ma index of the method of the present invention through four sets of experiments, and also obtains the ma index of four other comparative methods. The ma indexes of the method of the present invention and existing methods are shown in Table 1. As can be seen from Table 1, the method of the present invention has the highest accuracy in three sets of experiments and the second highest accuracy in one set of experiments.

[0093] Table 1. MA index of the method of the present invention and existing methods

[0094]

[0095] In summary, this embodiment provides a cross-domain pedestrian attribute recognition method. This method constructs an evaluation criterion for cross-domain pedestrian attribute recognition, which maps attribute labels between source and target domain datasets with different attribute label types and quantities. It integrates unsupervised domain adaptation technology into the pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model. Based on the evaluation criterion, the cross-domain pedestrian attribute recognition model is trained and tested using both the source and target domain datasets. This allows for accurate measurement of the performance of the cross-domain pedestrian attribute recognition model, resulting in a high-precision model. This method has significant application prospects in the field of cross-domain pedestrian attribute recognition.

[0096] Second Embodiment

[0097] This embodiment provides a cross-domain pedestrian attribute recognition system, which includes the following modules:

[0098] The evaluation criteria construction module is used to construct evaluation criteria for cross-domain pedestrian attribute recognition, and to map attribute labels between source domain datasets with different attribute label types and numbers to target domain datasets.

[0099] The model building module is used to integrate unsupervised domain adaptation techniques into the pedestrian attribute recognition model and build a cross-domain pedestrian attribute recognition model.

[0100] The cross-domain pedestrian attribute recognition model training and testing module is used to train and test the cross-domain pedestrian attribute recognition model constructed by the model building module based on the evaluation criteria constructed by the evaluation criterion construction module, using the source domain dataset and the target domain dataset, to obtain the trained cross-domain pedestrian attribute recognition model.

[0101] The pedestrian attribute recognition module is used to realize cross-domain pedestrian attribute recognition by utilizing the cross-domain pedestrian attribute recognition model trained by the cross-domain pedestrian attribute recognition model training and testing module.

[0102] The cross-domain pedestrian attribute recognition system of this embodiment corresponds to the cross-domain pedestrian attribute recognition method of the first embodiment described above; wherein, the functions implemented by each functional module in the cross-domain pedestrian attribute recognition system correspond one-to-one with the process steps in the cross-domain pedestrian attribute recognition method described above; therefore, it will not be described again here.

[0103] Third Embodiment

[0104] This embodiment provides an electronic device, which includes a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the method of the first embodiment.

[0105] The electronic device can vary considerably depending on its configuration or performance, and may include one or more processors (central processing units, CPUs) and one or more memories, wherein the memories store at least one instruction that is loaded by the processor and executed in accordance with the above method.

[0106] Fourth embodiment

[0107] This embodiment provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the method of the first embodiment described above. The computer-readable storage medium may be a ROM, random access memory, CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc. The instruction stored therein can be loaded and executed by a processor in a terminal.

[0108] Furthermore, it should be noted that the present invention can be provided as a method, apparatus, or computer program product. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.

[0109] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0110] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0111] It should also be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0112] Finally, it should be noted that the above description represents a preferred embodiment of the present invention. It should be pointed out that although preferred embodiments have been described, those skilled in the art, once they understand the basic inventive concept of the present invention, can make various improvements and modifications without departing from the principles described herein. These improvements and modifications should also be considered within the scope of protection of the present invention. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.

Claims

1. A method for cross-domain pedestrian attribute recognition, characterized in that, include: An evaluation criterion for cross-domain pedestrian attribute recognition is constructed to map attribute labels between source domain datasets and target domain datasets with different attribute label types and numbers. Unsupervised domain adaptation technology is integrated into the pedestrian attribute recognition model to construct a cross-domain pedestrian attribute recognition model. Based on the evaluation criteria, the cross-domain pedestrian attribute recognition model is trained and tested using the source domain dataset and the target domain dataset to obtain a trained cross-domain pedestrian attribute recognition model. Cross-domain pedestrian attribute recognition is achieved using a pre-trained cross-domain pedestrian attribute recognition model. Evaluation criteria for cross-domain pedestrian attribute recognition include: Directly map the same or similar labels in the source domain dataset and the target domain dataset; For labels with opposite attributes in the source and target datasets, the labels in the target dataset are inverted to match the labels in the source dataset. If an attribute in the source domain dataset can semantically contain multiple attributes in the target domain dataset, then the union of these multiple attribute labels in the target domain dataset is taken and corresponds to the attribute in the source domain dataset. The cross-domain pedestrian attribute recognition model includes a feature extractor, an attribute classifier, and a local domain discriminator. A gradient inversion layer is incorporated into both the feature extractor and the local domain discriminator. The model uses ResNet50 as the feature extractor to extract image features. The last layer of the ResNet50 is connected to a fully connected layer, the output nodes of which are equal to the number of attributes to be recognized. A sigmoid function is then connected after the fully connected layer to form the attribute classifier. The local domain discriminator consists of a linear layer. The local domain discriminator computes the domain... The discriminative loss process includes: identifying pedestrian keypoints using a human keypoint model trained on the COCO dataset; generating six masks based on the identified pedestrian keypoints; applying the generated six masks to the global features to segment the global features into six local features; inputting the six local features into a local discriminator to obtain six local discriminative losses; simultaneously, inputting the global features before segmentation into the local discriminator to obtain the global discriminative loss; and using the average of the obtained global discriminative loss and the six local discriminative losses as the final domain discriminative loss.

2. The cross-domain pedestrian attribute recognition method as described in claim 1, characterized in that, The process of training and testing the cross-domain pedestrian attribute recognition model based on the evaluation criteria, using source domain datasets and target domain datasets, to obtain a trained cross-domain pedestrian attribute recognition model includes: The evaluation criteria are used to generate a set of attributes that correspond to each other for the source domain dataset and the target domain dataset; the attribute set is used to calculate the performance of the cross-domain pedestrian attribute recognition model. The cross-domain pedestrian attribute recognition model was trained using the source domain dataset; The trained cross-domain pedestrian attribute recognition model is tested using the target domain dataset; wherein, during the test, the performance of the cross-domain pedestrian attribute recognition model is calculated based on the attribute set.

3. A cross-domain pedestrian attribute recognition system, characterized in that, include: The evaluation criteria construction module is used to construct evaluation criteria for cross-domain pedestrian attribute recognition, and to map attribute labels between source domain datasets with different attribute label types and numbers to target domain datasets. The model building module is used to integrate unsupervised domain adaptation techniques into the pedestrian attribute recognition model and build a cross-domain pedestrian attribute recognition model. The cross-domain pedestrian attribute recognition model training and testing module is used to train and test the cross-domain pedestrian attribute recognition model constructed by the model construction module based on the evaluation criteria constructed by the evaluation criterion construction module, using the source domain dataset and the target domain dataset, to obtain the trained cross-domain pedestrian attribute recognition model. The pedestrian attribute recognition module is used to realize cross-domain pedestrian attribute recognition using the cross-domain pedestrian attribute recognition model trained by the cross-domain pedestrian attribute recognition model training and testing module; Evaluation criteria for cross-domain pedestrian attribute recognition include: Directly map the same or similar labels in the source domain dataset and the target domain dataset; For labels with opposite attributes in the source and target datasets, the labels in the target dataset are inverted to match the labels in the source dataset. If an attribute in the source domain dataset can semantically contain multiple attributes in the target domain dataset, then the union of these multiple attribute labels in the target domain dataset is taken and corresponds to the attribute in the source domain dataset. The cross-domain pedestrian attribute recognition model includes a feature extractor, an attribute classifier, and a local domain discriminator. A gradient inversion layer is incorporated into both the feature extractor and the local domain discriminator. The model building module is configured to: use ResNet50 as the feature extractor to extract image features; connect a fully connected layer to the last layer of the ResNet50, with the output nodes of the fully connected layer matching the number of attributes to be recognized; and connect a sigmoid function after the fully connected layer to form the attribute classifier; and use a linear layer to form the local domain discriminator. The process of calculating the domain discrimination loss includes: identifying pedestrian keypoints using a human keypoint model trained on the COCO dataset; generating six masks based on the identified pedestrian keypoints; applying the six masks to the global features to segment the global features into six local features; inputting the six local features into a local domain discriminator to obtain six local domain discrimination losses; simultaneously, inputting the global features before segmentation into the local domain discriminator to obtain the global domain discrimination loss; and using the average of the obtained global domain discrimination loss and the six local domain discrimination losses as the final domain discrimination loss.

4. The cross-domain pedestrian attribute recognition system as described in claim 3, characterized in that, The cross-domain pedestrian attribute recognition model training and testing module is specifically used for: The evaluation criteria are used to generate a set of attributes that correspond to each other for the source domain dataset and the target domain dataset; the attribute set is used to calculate the performance of the cross-domain pedestrian attribute recognition model. The cross-domain pedestrian attribute recognition model was trained using the source domain dataset; The trained cross-domain pedestrian attribute recognition model is tested using the target domain dataset; wherein, during the test, the performance of the cross-domain pedestrian attribute recognition model is calculated based on the attribute set.

Citation Information

Patent Citations

  • Unsupervised image classification model training method and device and electronic equipment

    CN111832605A

  • Cross-domain pedestrian re-identification method based on deep learning

    CN114882531A