Pedestrian attribute recognition model training method and device based on incremental learning

By using training data and pseudo-label prediction and representative sample training from the model cache pool in the pedestrian attribute recognition model, the problem of low accuracy in recognizing existing attributes in incremental learning is solved, and the recognition of new attributes and the accuracy of existing attributes are maintained, thus mitigating the curse of forgetting is achieved.

CN114724174BActive Publication Date: 2025-10-21INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210161681.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-22
Publication Date
2025-10-21
Estimated Expiration
2042-02-22

AI Technical Summary

Technical Problem

Existing pedestrian attribute recognition models have low accuracy in recognizing existing attributes during incremental learning, and cannot effectively alleviate the disaster of forgetting.

Method used

By obtaining training samples for the initial task, representative samples are selected and stored in the training data cache pool, and the trained model is stored in the model cache pool. The cached model is used to predict pseudo-labels for training samples in the new task. The model is trained by combining representative samples in the training data cache pool to ensure that the model maintains the accuracy of recognizing existing attributes while recognizing new attributes.

Benefits of technology

It effectively mitigates the disaster of forgetting, ensures that the model maintains the accuracy of recognizing existing attributes while recognizing new attributes, provides supervisory information about existing attributes, and improves the overall recognition performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114724174B_ABST
    Figure CN114724174B_ABST
Patent Text Reader

Abstract

The application provides a kind of pedestrian attribute recognition model training method and device based on incremental learning, method includes: obtaining pedestrian attribute recognition dataset for incremental learning, determine task learning order;Using the training sample in initial task trains initial pedestrian attribute recognition model;Representative sample in training data cache pool and cache model in model cache pool are updated;Repeat the following steps until all task learning in dataset is completed, obtain pedestrian attribute recognition model;According to cache model in model cache pool, determine prediction model and to-be-trained model;Based on prediction model, all training samples of current task are predicted, and updated current task is obtained;According to representative sample and training sample in updated current task, to-be-trained model is trained, and first target model is obtained.The application effectively improves the existing attribute recognition accuracy of pedestrian attribute recognition model in incremental learning process, and relieves the forgetting disaster problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method and device for training a pedestrian attribute recognition model based on incremental learning. Background Art

[0002] Image recognition technology has continued to advance with the emergence of large-scale labeled datasets and the rapid development of deep learning. Further research is needed to address the problem of forgetting, where attribute recognition models experience a decline in recognition performance for existing attribute categories as they adapt to new ones.

[0003] In the related existing technologies, the forgetting problem caused by the updating process of the recognition model is overcome by combining the regularization-based method and the representative sample-based method.

[0004] However, since the training samples corresponding to the pedestrian attribute recognition model at different update stages often only label some attributes of interest according to actual needs, it is unknown whether the training samples also contain other attributes. When the pedestrian attribute recognition model is trained based on such training samples, the obtained pedestrian attribute recognition model has the problem of low recognition accuracy of existing attributes. Summary of the Invention

[0005] The present invention provides a method and device for training a pedestrian attribute recognition model based on incremental learning, which solves the defect of low recognition accuracy of existing attributes in the pedestrian attribute recognition model in the prior art during the incremental learning process, so as to improve the recognition accuracy of existing attributes in the pedestrian attribute recognition model during the incremental learning process.

[0006] The present invention provides a pedestrian attribute recognition model training method based on incremental learning, comprising:

[0007] Obtaining a pedestrian attribute recognition dataset for incremental learning, selecting an initial task from the dataset, and determining a task learning order; the dataset includes at least two tasks;

[0008] Use the training samples in the initial task to train the initial pedestrian attribute recognition model; select representative samples from the training samples corresponding to the attributes in the initial task and store them in the training data cache pool; store the pedestrian attribute recognition model after initial training in the model cache pool;

[0009] Repeat the following steps to learn the tasks after the initial task in the task learning order until all tasks in the dataset are learned, thereby obtaining a pedestrian attribute recognition model;

[0010] For the current task, read the cache model in the model cache pool, and determine the prediction model that is the same as the cache model according to the parameters of the cache model;

[0011] Determining a model to be trained according to the prediction model;

[0012] Predicting all training samples of the current task based on the prediction model to obtain an updated current task; wherein the updated current task adds pseudo labels about existing attributes to all training samples in the current task; the pseudo labels refer to the probability values ​​of predicting that the current task contains each existing attribute; the existing attributes refer to pedestrian attributes that can be recognized by the prediction model;

[0013] Reading representative samples from the training data cache pool, and training the model to be trained based on the representative samples and all the updated training samples in the current task to obtain a first target model;

[0014] Replace the cache model in the model cache pool with the first target model;

[0015] Based on the training samples corresponding to the attributes of the current task, the representative samples in the training data buffer pool are updated.

[0016] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, each task in the data set includes at least one attribute and at least one training sample, and the training sample is only marked with the attribute corresponding to the task in which the training sample is located; there are no identical attributes and training samples between the tasks.

[0017] According to a method for training a pedestrian attribute recognition model based on incremental learning provided by the present invention, the method of training an initial pedestrian attribute recognition model using training samples in an initial task includes:

[0018] Inputting the training samples in the initial task into the initial pedestrian attribute recognition model, and training the initial pedestrian attribute recognition model by determining the binary cross entropy loss value corresponding to the initial task based on the attribute prediction value, the attribute label value, and the binary cross entropy loss function;

[0019] The initial pedestrian attribute recognition model includes: a feature extraction layer based on a deep convolutional neural network, multiple binary classifiers with the same number of attributes as the current task, and a random dropout layer between the features and the binary classifiers.

[0020] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, determining a model to be trained based on the prediction model includes:

[0021] Determine the total number of attribute types included in the current task as a first number;

[0022] The first number of binary classifiers is added to the network structure of the prediction model to obtain the model to be trained.

[0023] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, the binary cross entropy loss function is formula (1):

[0024]

[0025] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, A t represents the attribute set contained in the t-th task, |A t | represents the number of attributes contained in the t-th task, y ij Indicates D t The attribute label value corresponding to the jth attribute in the i-th sample, Indicates D t The attribute prediction value corresponding to the jth attribute in the i-th sample, w j is the weight of the j-th attribute, Represents the binary cross entropy loss function corresponding to the t-th task.

[0026] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, the attribute weight is calculated using formula (2):

[0027]

[0028] Among them, w j is the weight of the jth attribute, γ j Indicates that the positive samples corresponding to the j attributes are in the D t The ratio in , σ is the temperature parameter, and exp() represents the exponential function with the natural constant e as the base.

[0029] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, predicting all training samples of the current task based on the prediction model to obtain an updated current task includes:

[0030] For the prediction model, setting the random dropout layer to a training mode; the training mode means setting the random dropout layer to an on state;

[0031] For any training sample in the current task, the training sample is input into the prediction model and K forward operations are performed;

[0032] For any one of the existing attributes, the mean of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the pseudo label corresponding to the attribute; and the variance of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the uncertainty of the pseudo label corresponding to the attribute.

[0033] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, the to-be-trained model is trained based on the representative sample and all the training samples of the updated current task to obtain a first target model, including:

[0034] For the representative sample, determine the binary cross entropy loss value corresponding to the representative sample according to the attribute prediction value obtained by the representative sample using the to-be-trained model, the attribute label value corresponding to the representative sample, and the binary cross entropy loss function; and

[0035] For all training samples of the updated current task, determine the binary cross entropy loss value corresponding to the updated current task based on the attribute prediction values ​​obtained by the model to be trained for all training samples, the attribute labeling value corresponding to each of the at least one attribute corresponding to the current task in all training samples, and the binary cross entropy loss function; and determine the first loss value corresponding to the updated training sample based on the pseudo labels in all training samples, the attribute prediction values ​​obtained by the model to be trained for all training samples, and the first loss function;

[0036] The model to be trained is trained according to the binary cross entropy loss value corresponding to the representative sample, the updated binary cross entropy loss value corresponding to the current task, and the first loss value corresponding to the updated training sample to obtain the first target model.

[0037] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, the first loss function is formula (3):

[0038]

[0039] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, represents the set of attributes that have been learned cumulatively from task 1 to task t-1, Indicates the number of attributes in the attribute set. Indicates D t The attribute prediction value of the jth attribute of the i-th sample in, For the The corresponding scaling value, Indicates D t The pseudo label of the jth attribute of the i-th sample in, For the The corresponding scaling value, u ij represents the uncertainty of the pseudo label of the i-th sample about the j-th attribute, Represents the first loss function corresponding to the t-th task; determine and The calculation formulas are formula (4) and formula (5) respectively;

[0040]

[0041]

[0042] Where τ is the temperature coefficient.

[0043] According to a pedestrian attribute recognition model training method based on incremental learning provided by the present invention, the representative samples in the training data cache pool are updated based on the training samples corresponding to the attributes of the current task, including:

[0044] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is less than or equal to M, the training samples are stored in the training data cache pool; wherein M is a positive integer; or

[0045] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is greater than M, the expected cache number of samples corresponding to each attribute is determined using formula (6);

[0046]

[0047] Where t represents the tth task in the task learning sequence; T represents the set of all tasks in the task learning sequence, A t represents the attribute set contained in the t-th task, and a represents U t∈T A t Any attribute in, ρ represents the scale coefficient, n a Indicates the total number of samples with attribute a included in the training samples during the training process of the pedestrian attribute recognition model, m aIndicates the expected number of samples cached corresponding to attribute a.

[0048] The present invention also provides a pedestrian attribute recognition model training device based on incremental learning, comprising:

[0049] An acquisition module is configured to acquire a pedestrian attribute recognition dataset for incremental learning, select an initial task from the dataset, and determine a task learning order; the dataset includes at least two tasks;

[0050] The first processing module is used to train an initial pedestrian attribute recognition model using training samples in the initial task; select representative samples from the training samples corresponding to the attributes in the initial task and store them in a training data buffer pool; and store the pedestrian attribute recognition model after initial training in a model buffer pool;

[0051] A control module is configured to repeatedly perform the following steps to learn tasks subsequent to the initial task in the task learning sequence until all tasks in the data set are learned, thereby obtaining a pedestrian attribute recognition model;

[0052] A first determination module is configured to read a cached model in the model cache pool for a current task, and determine a prediction model identical to the cached model based on parameters of the cached model;

[0053] A second determining module is used to determine a model to be trained based on the prediction model;

[0054] A prediction module is configured to predict all training samples of the current task based on the prediction model to obtain an updated current task; wherein the updated current task is to add pseudo-labels related to existing attributes to all training samples in the current task; the pseudo-labels are the probability values ​​of predicting that the current task contains each existing attribute; the existing attributes are pedestrian attributes that can be recognized by the prediction model;

[0055] A second processing module is configured to read representative samples from the training data cache pool, and train the model to be trained based on the representative samples and all the updated training samples in the current task to obtain a first target model;

[0056] A first updating module, configured to replace the cache model in the model cache pool with the first target model;

[0057] The second updating module is used to update the representative samples in the training data buffer pool based on the training samples corresponding to the attributes of the current task.

[0058] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, each task in the data set includes at least one attribute and at least one training sample, and the training sample only marks the attribute corresponding to the task in which the training sample is located; there are no identical attributes and training samples between the tasks.

[0059] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the first processing module is specifically used to:

[0060] Inputting the training samples in the initial task into the initial pedestrian attribute recognition model, and training the initial pedestrian attribute recognition model by determining the binary cross entropy loss value corresponding to the initial task based on the attribute prediction value, the attribute label value, and the binary cross entropy loss function;

[0061] The initial pedestrian attribute recognition model includes: a feature extraction layer based on a deep convolutional neural network, multiple binary classifiers with the same number of attributes as the current task, and a random dropout layer between the features and the binary classifiers.

[0062] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the second determination module is specifically configured to:

[0063] Determine the total number of attribute types included in the current task as a first number;

[0064] The first number of binary classifiers is added to the network structure of the prediction model to obtain the model to be trained.

[0065] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the binary cross entropy loss function is formula (1):

[0066]

[0067] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, A t represents the attribute set contained in the t-th task, |A t | represents the number of attributes contained in the t-th task, y ij Indicates D t The attribute label value corresponding to the jth attribute in the i-th sample, Indicates D t The attribute prediction value corresponding to the jth attribute in the i-th sample, w jis the weight of the j-th attribute, Represents the binary cross entropy loss function corresponding to the t-th task.

[0068] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the attribute weight is calculated using formula (2):

[0069]

[0070] Among them, w j is the weight of the jth attribute, γ j Indicates that the positive samples corresponding to the j attributes are in the D t The ratio in , σ is the temperature parameter, and exp() represents the exponential function with the natural constant e as the base.

[0071] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the first processing module is specifically used to:

[0072] For the prediction model, setting the random dropout layer to a training mode; the training mode means setting the random dropout layer to an on state;

[0073] For any training sample in the current task, the training sample is input into the prediction model and K forward operations are performed;

[0074] For any one of the existing attributes, the mean of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the pseudo label corresponding to the attribute; and the variance of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the uncertainty of the pseudo label corresponding to the attribute.

[0075] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the second processing module is specifically used to:

[0076] For the representative sample, determine the binary cross entropy loss value corresponding to the representative sample according to the attribute prediction value obtained by the representative sample using the to-be-trained model, the attribute label value corresponding to the representative sample, and the binary cross entropy loss function; and

[0077] For all training samples of the updated current task, determine the binary cross entropy loss value corresponding to the updated current task based on the attribute prediction values ​​obtained by the model to be trained for all training samples, the attribute labeling value corresponding to each of the at least one attribute corresponding to the current task in all training samples, and the binary cross entropy loss function; and determine the first loss value corresponding to the updated training sample based on the pseudo labels in all training samples, the attribute prediction values ​​obtained by the model to be trained for all training samples, and the first loss function;

[0078] The model to be trained is trained according to the binary cross entropy loss value corresponding to the representative sample, the updated binary cross entropy loss value corresponding to the current task, and the first loss value corresponding to the updated training sample to obtain the first target model.

[0079] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the first loss function is formula (3):

[0080]

[0081] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, represents the set of attributes that have been learned cumulatively from task 1 to task t-1, Indicates the number of attributes in the attribute set. Indicates D t The attribute prediction value of the jth attribute of the i-th sample in, For the The corresponding scaling value, Indicates D t The pseudo label of the jth attribute of the i-th sample in, For the The corresponding scaling value, u ij represents the uncertainty of the pseudo label of the i-th sample about the j-th attribute, Represents the first loss function corresponding to the t-th task; determine and The calculation formulas are formula (4) and formula (5) respectively;

[0082]

[0083]

[0084] Where τ is the temperature coefficient.

[0085] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the second updating module is specifically used to:

[0086] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is less than or equal to M, the training samples are stored in the training data cache pool; wherein M is a positive integer; or

[0087] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is greater than M, the expected cache number of samples corresponding to each attribute is determined using formula (6);

[0088]

[0089] Where t represents the tth task in the task learning sequence; T represents the set of all tasks in the task learning sequence, A t represents the attribute set contained in the t-th task, and a represents U t∈T A t Any attribute in, ρ represents the scale coefficient, n a Indicates the total number of samples with attribute a included in the training samples during the training process of the pedestrian attribute recognition model, m a Indicates the expected number of samples cached corresponding to attribute a.

[0090] The present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the pedestrian attribute recognition model training method based on incremental learning as described above are implemented.

[0091] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the pedestrian attribute recognition model training method based on incremental learning as described above are implemented.

[0092] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for training a pedestrian attribute recognition model based on incremental learning.

[0093] The present invention provides a method and device for training a pedestrian attribute recognition model based on incremental learning. The method uses the pedestrian attribute recognition model in the model cache to predict whether the new learning task has existing attributes, thereby pseudo-labeling the new learning task with existing attributes. This allows the new learning task to provide supervisory information about all attributes included in the already learned task. Subsequently, the to-be-trained model is trained based on representative samples in the training data cache and training samples in the new learning task. The first target model obtained after training maintains the accuracy of recognition and prediction of existing attributes while being able to recognize newly added attributes, effectively alleviating the problem of the disaster of forgetting. BRIEF DESCRIPTION OF THE DRAWINGS

[0094] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0095] Figure 1 One of the flow charts of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention;

[0096] Figure 2 The second flowchart of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention;

[0097] Figure 3 The third flowchart of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention;

[0098] Figure 4 The fourth flowchart of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention;

[0099] Figure 5 The fifth flowchart of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention;

[0100] Figure 6 A schematic diagram of the structure of the pedestrian attribute recognition model training device based on incremental learning provided by the present invention;

[0101] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0102] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0103] In order to facilitate understanding of the technical solution of the present invention, the relevant concepts involved in the present invention are first introduced:

[0104] Pedestrian attribute recognition aims to parse pedestrian images into several semantic attributes, such as gender, age, clothing, etc., thereby narrowing the semantic gap between underlying visual features and high-level cognition and improving the machine's understanding of image content.

[0105] Incremental learning means that a learning system can continuously learn new knowledge from new training samples while retaining most of the previously learned knowledge.

[0106] Below, the prior art involved in the present invention, the problems existing in the prior art, and the technical concept of the present invention are described in detail:

[0107] With the emergence of large-scale labeled datasets and the rapid development of deep learning, image recognition technology has continued to advance. Further research is needed to address the problem of forgetting, where attribute recognition models experience a decline in recognition performance for existing attributes as they adapt to new ones.

[0108] In the related existing technologies, the forgetting problem caused by the updating process of the pedestrian attribute recognition model is overcome by combining the regularization-based method and the representative sample-based replay method.

[0109] However, since pedestrian attribute recognition is a multi-label classification problem, during the incremental learning process, the training samples corresponding to different update stages often only have some attributes of interest labeled according to actual needs. It is unknown whether the training samples also contain attributes corresponding to other stages. When the pedestrian attribute recognition model is trained based on such training samples, the obtained pedestrian attribute recognition model has the problem of low recognition accuracy of existing attributes.

[0110] To address the aforementioned issues, the present invention proposes the following technical concept: a pedestrian attribute recognition model is trained using the training samples included in the initial task to obtain a trained pedestrian attribute recognition model. A representative sample from the training samples of the initial task is selected and stored in a training data cache. The trained pedestrian attribute recognition model is then stored in a model cache. The training samples of the initial task are labeled with multiple pedestrian attributes. The pedestrian attribute recognition model then continuously learns to recognize new attributes for the new learning task. It is important to emphasize that the multiple attributes labeled in the new learning task are different from those labeled in the initial task. Since it is unknown whether the training samples in the new learning task possess the attributes present in the initial task, this increases the difficulty of training and limits the ability of existing incremental learning techniques to overcome the forgetting problem. To address this issue, the present invention caches the pedestrian attribute recognition model trained on the previous task and uses it to predict pseudo-labels for the training samples in the new task based on the existing attributes. The model is then used to estimate the uncertainty of the pseudo-labels, thereby providing supervisory information about the existing attributes for the current task training and mitigating the adverse effects of noisy pseudo-labels on the current model training. Afterwards, the pedestrian attribute recognition model is trained based on representative samples in the training data cache pool and training samples in the new learning task. After training, the model can not only recognize the newly added pedestrian attributes, but also maintain the ability to recognize existing attributes, effectively alleviating the problem of forgetting disaster.

[0111] Next, combine Figure 1-Figure 5 The present invention describes a pedestrian attribute recognition model training method based on incremental learning.

[0112] Figure 1 This is a flow chart of a method for training a pedestrian attribute recognition model based on incremental learning provided by the present invention, such as Figure 1 As shown, the pedestrian attribute recognition model training method based on incremental learning includes:

[0113] Step 110: Obtain a pedestrian attribute recognition dataset for incremental learning, select an initial task from the dataset, and determine a task learning order; the dataset includes at least two tasks.

[0114] Optionally, the incremental learning-based pedestrian attribute recognition model training method provided by the present invention can be applied to pedestrian attribute recognition scenarios. The execution entity of the incremental learning-based pedestrian attribute recognition model training method provided by the present invention can be the incremental learning-based pedestrian attribute recognition model training device provided by the present invention, or can be a control module disposed in the incremental learning-based pedestrian attribute recognition model training device for executing the incremental learning-based pedestrian attribute recognition model training method. The control module can be implemented through a combination of software and / or hardware.

[0115] Optionally, the pedestrian attribute recognition dataset for incremental learning includes at least two tasks. Each task in the dataset includes at least one attribute and at least one training sample. It should be emphasized that there are no identical attributes among the attributes annotated between tasks, and there are no identical training samples between tasks. The training samples are only annotated with the attributes corresponding to the task in which the training samples are located, and it is unknown whether they contain attributes contained in other tasks. It is understandable that each task includes multiple training samples with annotated attributes. The training samples can be pedestrian images.

[0116] Two possible implementations of determining the task sequence are exemplarily introduced below.

[0117] In a possible implementation, the order of tasks is determined based on the number of attributes included in each task. Alternatively, all tasks are sorted from largest to smallest based on the number of attributes included in each task.

[0118] In another possible implementation, the order of tasks is determined based on the number of training samples included in each task. Alternatively, all tasks are sorted from largest to smallest based on the number of training samples included in each task.

[0119] The above two methods are merely exemplary introductions to determining the task sequence. The implementation method for determining the task sequence can be set according to actual needs and is not limited thereto.

[0120] Below, we introduce the pedestrian attribute recognition dataset used for incremental learning with a specific example.

[0121] In this embodiment of the present invention, the pedestrian attribute recognition dataset used for incremental learning includes nine tasks, each with 500 training samples. The attributes of each task are shown in Table 1, where the tasks are assumed to be in the following order: A1, A2, A3, A4, A5, A6, A7, A8, A9, with A1 being the initial task.

[0122] Table 1

[0123]

[0124] As shown in Table 1, the attributes included in Task A1 are: thin body, bald head, sweatshirt, boots, backpack, and carrying things. Similarly, the attributes included in Tasks A2-A9 are shown in Table 1 and will not be explained separately here.

[0125] Step 120: Use the training samples from the initial task to train an initial pedestrian attribute recognition model. Select representative samples from the training samples corresponding to the attributes in the initial task and store them in a training data cache pool. Store the initially trained pedestrian attribute recognition model in a model cache pool.

[0126] Optionally, the initial pedestrian attribute recognition model includes a feature extraction layer based on a deep convolutional neural network, a random dropout layer, and multiple binary classifiers. The number of binary classifiers set in the initial pedestrian attribute recognition model is consistent with the number of attributes included in the initial task.

[0127] Optionally, the initial pedestrian attribute recognition model is trained using the training samples in the initial task to obtain a trained pedestrian attribute recognition model. It should be noted that the trained pedestrian attribute recognition model can be used to recognize the attributes included in the initial task.

[0128] Optionally, the pedestrian attribute recognition model after initial training is stored in a model cache pool.

[0129] Optionally, representative samples are selected from the training samples corresponding to the attributes in the initial task and stored in the training data cache pool.

[0130] Step 130 : For the current task, read the cached model in the model cache pool, and determine a prediction model that is the same as the cached model based on the parameters of the cached model.

[0131] It should be noted that after the pedestrian attribute recognition model is trained using the initial task in steps 110 to 120, the initial task can be called a learned task. Next, according to the task sequence, the next unlearned task after the learned task is set as the current task.

[0132] In this embodiment, the cache model in the model buffer is read and a model identical to the cache model is created based on the parameters of the cache model. The newly created model is called a prediction model.

[0133] Step 140: Determine the model to be trained based on the prediction model.

[0134] In this embodiment, when learning the current task, the model to be trained is determined based on the prediction model.

[0135] Optionally, the total number of attribute types included in the current task is determined as the first number, and the first number of binary classifiers is added to the network structure of the prediction model to obtain a model to be trained.

[0136] Step 150: predict all training samples of the current task based on the prediction model to obtain an updated current task.

[0137] The updated current task adds pseudo-labels for existing attributes to all training samples in the current task. Pseudo-labels are the predicted probabilities of each existing attribute being included in the current task. Existing attributes are the attributes of pedestrians that the prediction model can recognize.

[0138] Optionally, for the current task, attribute prediction is performed on the training samples of the current task according to the prediction model, so that the training samples of the current task are added with pseudo labels about existing attributes, that is, the updated current task.

[0139] Optionally, for any of the existing attributes, the pseudo-label corresponding to that attribute in the training sample has a value range of [0, 1]. That is, the pseudo-label corresponding to that attribute in the training sample can have a value of 0, 1, or any number between 0 and 1. It should be noted that the larger the pseudo-label value for that attribute, the more likely that the training sample contains that attribute. Conversely, the smaller the pseudo-label value for that attribute, the less likely that the training sample contains that attribute.

[0140] Step 160 , read representative samples from the training data cache pool, and train the to-be-trained model based on the representative samples and all updated training samples in the current task to obtain a first target model.

[0141] Based on the above step 150 and the prediction model, pseudo labels about existing attributes are added to all training samples in the current task, that is, supervision information about existing attributes is provided for the current task training.

[0142] Next, representative samples are read from the training data cache pool, and the to-be-trained model is trained based on the representative samples and all the updated training samples in the current task. After the training is completed, the first target model is obtained.

[0143] Step 170: Use the first target model to replace the cache model in the model cache pool.

[0144] Optionally, the cached model in the model cache pool is deleted, and the first target model is stored in the model cache pool. It is understandable that as the models in the model cache pool are continuously updated, the cached models in the model cache pool have relevant knowledge to identify all pedestrian attributes in the learned tasks, thereby providing supervision information about the existing attributes for model training of the current task.

[0145] Step 180: Update the representative samples in the training data buffer pool based on the training samples corresponding to the attributes of the current task.

[0146] Optionally, all training samples or a portion of representative samples in the current task are added to the training data cache pool to update the representative samples in the training data cache pool.

[0147] In step 190 , steps 130 to 180 are repeated to learn the tasks after the initial task in the task learning order until all tasks in the data set are learned, thereby obtaining a pedestrian attribute recognition model.

[0148] In this embodiment, when all tasks in the data set have not been learned completely, steps 130 to 190 are performed in sequence until all tasks in the data set have been learned completely.

[0149] In this embodiment, when all tasks in the dataset have been learned, the pedestrian attribute model training based on incremental learning is completed. In other words, the first target model obtained after the last task in the dataset is learned is the final pedestrian attribute recognition model.

[0150] The present invention provides a method for training a pedestrian attribute recognition model based on incremental learning. The method uses the pedestrian attribute recognition model in the model cache to predict whether a new learning task has existing attributes, thereby pseudo-labeling the new learning task with existing attributes. This allows the new learning task to provide supervisory information about all attributes included in the already learned tasks. Subsequently, the to-be-trained model is trained based on representative samples in the training data cache and training samples from the new learning task. The resulting first target model maintains the accuracy of recognizing existing attributes while being able to recognize newly added attributes, effectively alleviating the problem of the disaster of forgetting.

[0151] Furthermore, based on the above embodiment, a possible implementation method of using the training samples in the initial task to train the initial pedestrian attribute recognition model in step 120 is exemplarily introduced:

[0152] The training samples in the initial task are input into the initial pedestrian attribute recognition model. The initial pedestrian attribute recognition model is trained by determining the binary cross entropy loss value corresponding to the initial task based on the attribute prediction value, attribute label value and binary cross entropy loss function.

[0153] The initial pedestrian attribute recognition model includes: a feature extraction layer based on a deep convolutional neural network, multiple binary classifiers with the same number of attributes as the current task, and a random dropout layer between the features and the binary classifiers.

[0154] Alternatively, the binary cross entropy loss function can refer to formula (1):

[0155]

[0156] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, A t represents the attribute set contained in the t-th task, |A t | represents the number of attributes contained in the t-th task, y ij Indicates D t The attribute label value corresponding to the jth attribute in the i-th sample, Indicates D t The attribute prediction value corresponding to the jth attribute in the i-th sample, w j is the weight of the j-th attribute, Represents the binary cross entropy loss function corresponding to the t-th task.

[0157] Optionally, the attribute weight is calculated using formula (2):

[0158]

[0159] Among them, w j is the weight of the jth attribute, γ j Indicates that the positive samples corresponding to the j attributes are in the D t The ratio in , σ is the temperature parameter, and exp() represents the exponential function with the natural constant e as the base.

[0160] Optionally, in combination with Figure 2 A possible implementation of step 150 of "predicting all training samples of the current task based on the prediction model to obtain an updated current task" is described below. Figure 2 This is a second flow chart of the method for training a pedestrian attribute recognition model based on incremental learning provided by the present invention. This implementation includes steps 210 to 230.

[0161] like Figure 2 As shown:

[0162] In step 210, for the prediction model, a random dropout layer is set to a training mode. The training mode means that the random dropout layer is set to an on state.

[0163] In step 220 , for any training sample in the current task, the training sample is input into the prediction model and K forward operations are performed.

[0164] In step 230, for any of the existing attributes, the mean of the attribute prediction values ​​of the training samples after K forward operations is determined as the pseudo label corresponding to the attribute. Furthermore, the variance of the attribute prediction values ​​of the training samples after K forward operations is determined as the uncertainty of the pseudo label corresponding to the attribute.

[0165] It can be understood that the smaller the uncertainty of the training sample, the greater the prediction accuracy of the pseudo label; conversely, the greater the uncertainty of the training sample, the lower the prediction accuracy of the pseudo label.

[0166] Optionally, in combination with Figure 3 A possible implementation of step 160 of "training the to-be-trained model based on the representative sample and all the updated training samples in the current task to obtain the first target model" is described below. Figure 3 This is a third flow chart of the incremental learning-based pedestrian attribute recognition model training method provided by the present invention. The implementation method includes steps 310 to 330.

[0167] like Figure 3 As shown:

[0168] Step 310 , for the representative samples, determine the binary cross entropy loss value corresponding to the representative samples according to the attribute prediction value obtained by the representative samples using the to-be-trained model, the attribute label value corresponding to the representative samples, and the binary cross entropy loss function.

[0169] Step 320 determines an updated binary cross entropy loss value corresponding to the current task based on the attribute prediction values ​​obtained for all training samples using the to-be-trained model, the attribute label values ​​corresponding to each of the at least one attribute corresponding to the current task in all training samples, and the binary cross entropy loss function. Furthermore, a first loss value corresponding to the updated training sample is determined based on the pseudo labels in all training samples, the attribute prediction values ​​obtained for all training samples using the to-be-trained model, and the first loss function.

[0170] Step 330 , training the to-be-trained model according to the binary cross entropy loss value corresponding to the representative sample, the updated binary cross entropy loss value corresponding to the current task, and the updated first loss value corresponding to the training sample to obtain a first target model.

[0171] Optionally, the first loss function can refer to formula (3):

[0172]

[0173] Among them, t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t| represents the number of training samples corresponding to the t-th task, represents the set of attributes that have been learned cumulatively from task 1 to task t-1, Indicates the number of attributes in the attribute set. Indicates D t The attribute prediction value of the jth attribute of the i-th sample in, for The corresponding scaling value, Indicates D t The pseudo label of the jth attribute of the i-th sample in, for The corresponding scaling value, u ij represents the uncertainty of the pseudo label of the i-th sample about the j-th attribute, Denotes the first loss function corresponding to the t-th task. and The calculation formulas are formula (4) and formula (5) respectively.

[0174]

[0175]

[0176] Where τ is the temperature coefficient.

[0177] In this embodiment, a first loss function is determined according to the uncertainty of the pseudo-label in the current task, and the to-be-trained model is trained according to the first loss function, which can alleviate the adverse effects of noisy pseudo-labels on the training of the current task model.

[0178] Furthermore, a possible implementation of "updating the representative samples in the training data cache pool based on the training samples corresponding to the attributes of the current task" in step 180 is described:

[0179] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples for the current task is less than or equal to M, the training samples are stored in the training data cache pool. Where M is a positive integer. Or,

[0180] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples of the current task is greater than M, formula (6) is used to determine the expected cache number of samples corresponding to each attribute.

[0181]

[0182] Where t represents the tth task in the task learning sequence. T represents the set of all tasks in the task learning sequence. A trepresents the attribute set contained in the t-th task, and a represents U t∈T A t Any attribute in, ρ represents the scale coefficient, n a Indicates the total number of samples with attribute a included in the existing training samples during the training process of the pedestrian attribute recognition model, m a Indicates the expected number of samples cached corresponding to attribute a.

[0183] Optionally, based on the expected number of samples cached for each attribute, a portion of representative samples is selected from the training samples corresponding to the attributes of the current task and added to the training data cache pool, so that the representative samples in the training data cache pool meet the expected number of samples cached for each attribute. When training the model, representative samples corresponding to existing attributes are used for model training. The representative samples provide supervisory information about the existing attributes for model training, which helps the pedestrian attribute recognition model maintain a high recognition accuracy for the existing attributes.

[0184] The present invention provides a pedestrian attribute recognition model training method based on incremental learning. During the incremental learning process, the pedestrian attribute recognition model in the model cache pool is used to predict the training samples in the current task, so that pseudo labels about existing attributes are added to the training samples of the current task, so that the current task contains supervisory information about the existing attributes. At the same time, the pedestrian attribute recognition model is used to determine the uncertainty of each pseudo label in the training samples in the current task. According to the uncertainty of each pseudo label, the loss function used to train the model is calculated to alleviate the adverse effects of noisy pseudo labels on the training of the current task model. Therefore, the pedestrian attribute recognition model obtained by the method provided by the present invention improves the prediction accuracy of existing attributes and effectively alleviates the problem of forgetting disaster.

[0185] Next, combine Figure 4 The pedestrian attribute recognition model training method based on incremental learning proposed in this invention is further described in detail. Figure 4 This is the fourth flow chart of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention.

[0186] like Figure 4 As shown, the pedestrian attribute recognition model training method based on incremental learning includes:

[0187] Step 401: Acquire an initial task, wherein the initial task includes at least one training sample.

[0188] Step 402: Train an initial pedestrian attribute recognition model based on all training samples in the initial task.

[0189] Step 403: After the training is completed, an initial pedestrian attribute recognition model after training is obtained.

[0190] Step 404: Store the trained initial pedestrian attribute recognition model into the model cache pool.

[0191] Step 405: Select representative samples from the initial task and store them in the training data buffer pool.

[0192] Step 406, determine whether there is a new task, if there is no new task, execute step 407, if there is a new task, execute steps 408-413.

[0193] In step 407 , in the absence of a new task, the initial pedestrian attribute recognition model trained based on the initial task is the final pedestrian attribute recognition model.

[0194] Step 408: If there are new tasks, read the cached model from the model cache pool, and determine a prediction model that is the same as the cached model based on the parameters of the cached model. Determine the model to be trained based on the prediction model.

[0195] Step 409 : predicting possible existing attributes of the training samples in the new task according to the prediction model, thereby generating pseudo labels of the existing attributes for the training samples in the new task, that is, obtaining an updated new task.

[0196] Step 410: Read representative samples from the training data buffer pool.

[0197] Step 411 : Train the to-be-trained model based on the representative samples and the training samples in the updated new task to obtain a first target model.

[0198] Step 412: Select representative samples from the training samples in the new task and add them to the training data cache pool.

[0199] In step 413, the model in the model cache is replaced with the first target model. Then, step 406 is executed to determine whether there are new tasks. If there are no new tasks, the first target model is determined as the final pedestrian attribute recognition model. If there are new tasks, steps 408-413 are repeated until all new tasks in the dataset have been learned.

[0200] Based on the above embodiments, Figure 5 Introduce the training process of using the current task to train the model. Figure 5 This is the fifth flow chart of the pedestrian attribute recognition model training method based on incremental learning provided by the present invention.

[0201] like Figure 5 As shown in FIG, the pedestrian attribute recognition model training method based on incremental learning includes the following steps:

[0202] Step 501: Obtain training samples in the current task.

[0203] Step 502: Utilize the prediction model in the model cache pool to predict pseudo labels of existing attributes for the training samples in the current task through multiple forward passes, and evaluate the uncertainty of the pseudo labels.

[0204] Step 503: Output the pseudo labels of the current task training samples with respect to the existing attributes, wherein the current task training samples include attribute annotation values ​​of the newly added attributes and pseudo labels of the existing attributes.

[0205] In step 504 , the to-be-trained model is trained according to the current task with the pseudo-label. The specific training process includes steps 5041 and 5042 .

[0206] Step 5041: Calculate the first loss function L for the current task with respect to the existing attributes based on the pseudo labels of the training samples in the current task and the uncertainty of the pseudo labels and the attribute prediction values ​​of the existing attributes obtained by the current model. P .

[0207] Step 5042: Calculate the binary cross entropy loss function L for the current task on the newly added attribute based on the attribute annotation value of the training sample for the current task and the attribute prediction value for the newly added attribute obtained by the current model. C .

[0208] According to the first loss function L P The calculated first loss value and binary cross entropy loss function L corresponding to the current task C The calculated binary cross entropy loss value corresponding to the current task is used to train the model to be trained.

[0209] It should be noted that the newly added attributes refer to the attributes marked by the original current task itself, while the existing attributes refer to the multiple attributes that can be identified by the prediction model.

[0210] The following describes the pedestrian attribute recognition model training device based on incremental learning provided by the present invention. The pedestrian attribute recognition model training device based on incremental learning described below and the pedestrian attribute recognition model training method based on incremental learning described above can refer to each other.

[0211] The present invention provides a pedestrian attribute recognition model training device based on incremental learning, Figure 6 A schematic diagram of the structure of the pedestrian attribute recognition model training device based on incremental learning provided by the present invention, such as Figure 6As shown, the pedestrian attribute recognition model training device 600 based on incremental learning includes: an acquisition module 601, a first processing module 602, a control module 603, a first determination module 604, a second determination module 605, a prediction module 606, a second processing module 607, a first update module 408 and an extraction module 609; wherein,

[0212] Acquisition module 601 is used to acquire a pedestrian attribute recognition dataset for incremental learning, select an initial task from the dataset, and determine a task learning order; the dataset includes at least two tasks;

[0213] The first processing module 602 is configured to train an initial pedestrian attribute recognition model using training samples in the initial task; select representative samples from the training samples corresponding to the attributes in the initial task and store them in a training data buffer pool; and store the initially trained pedestrian attribute recognition model in a model buffer pool;

[0214] The control module 603 is configured to repeatedly perform the following steps to learn tasks subsequent to the initial task in the task learning sequence until all tasks in the data set are learned, thereby obtaining a pedestrian attribute recognition model;

[0215] A first determining module 604 is configured to read a cached model in the model cache pool for a current task, and determine a prediction model identical to the cached model based on parameters of the cached model;

[0216] A second determining module 605 is used to determine a model to be trained based on the prediction model;

[0217] Prediction module 606 is configured to predict all training samples of the current task based on the prediction model to obtain an updated current task; wherein the updated current task is to add pseudo labels of existing attributes to all training samples in the current task; the pseudo labels are the probability values ​​of predicting that the current task contains each existing attribute; the existing attributes are pedestrian attributes that can be recognized by the prediction model;

[0218] A second processing module 607 is configured to read representative samples from the training data buffer pool, and train the model to be trained based on the representative samples and all the updated training samples in the current task to obtain a first target model;

[0219] A first updating module 608 is configured to replace the cache model in the model cache pool with the first target model;

[0220] The second updating module 609 is configured to update the representative samples in the training data buffer pool based on the training samples corresponding to the attributes of the current task.

[0221] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, each task in the data set includes at least one attribute and at least one training sample, and the training sample only marks the attribute corresponding to the task in which the training sample is located; there are no identical attributes and training samples between the tasks.

[0222] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the first processing module 602 is specifically configured to:

[0223] Inputting the training samples in the initial task into the initial pedestrian attribute recognition model, and training the initial pedestrian attribute recognition model by determining the binary cross entropy loss value corresponding to the initial task based on the attribute prediction value, the attribute label value, and the binary cross entropy loss function;

[0224] The initial pedestrian attribute recognition model includes: a feature extraction layer based on a deep convolutional neural network, multiple binary classifiers with the same number of attributes as the current task, and a random dropout layer between the features and the binary classifiers.

[0225] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the second determination module 605 is specifically configured to:

[0226] Determine the total number of attribute types included in the current task as a first number;

[0227] The first number of binary classifiers is added to the network structure of the prediction model to obtain the model to be trained.

[0228] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the binary cross entropy loss function is formula (1):

[0229]

[0230] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, A t represents the attribute set contained in the t-th task, |A t | represents the number of attributes contained in the t-th task, y ij Indicates D t The attribute label value corresponding to the jth attribute in the i-th sample, Indicates D t The attribute prediction value corresponding to the jth attribute in the i-th sample, wj is the weight of the j-th attribute, Represents the binary cross entropy loss function corresponding to the t-th task.

[0231] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the attribute weight is calculated using formula (2):

[0232]

[0233] Among them, w j is the weight of the jth attribute, γ j Indicates that the positive samples corresponding to the j attributes are in the D t The ratio in , σ is the temperature parameter, and exp() represents the exponential function with the natural constant e as the base.

[0234] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the first processing module 602 is specifically configured to:

[0235] For the prediction model, setting the random dropout layer to a training mode; the training mode means setting the random dropout layer to an on state;

[0236] For any training sample in the current task, the training sample is input into the prediction model and K forward operations are performed;

[0237] For any one of the existing attributes, the mean of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the pseudo label corresponding to the attribute; and the variance of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the uncertainty of the pseudo label corresponding to the attribute.

[0238] According to the pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the second processing module 607 is specifically configured to:

[0239] For the representative sample, determine the binary cross entropy loss value corresponding to the representative sample according to the attribute prediction value obtained by the representative sample using the to-be-trained model, the attribute label value corresponding to the representative sample, and the binary cross entropy loss function; and

[0240] For all training samples of the updated current task, determine the binary cross entropy loss value corresponding to the updated current task based on the attribute prediction values ​​obtained by the model to be trained for all training samples, the attribute labeling value corresponding to each of the at least one attribute corresponding to the current task in all training samples, and the binary cross entropy loss function; and determine the first loss value corresponding to the updated training sample based on the pseudo labels in all training samples, the attribute prediction values ​​obtained by the model to be trained for all training samples, and the first loss function;

[0241] The model to be trained is trained according to the binary cross entropy loss value corresponding to the representative sample, the updated binary cross entropy loss value corresponding to the current task, and the first loss value corresponding to the updated training sample to obtain the first target model.

[0242] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the first loss function is formula (3):

[0243]

[0244] Where t represents the tth task in the task learning sequence, D t represents the training sample set corresponding to the t-th task, |D t | represents the number of training samples corresponding to the t-th task, represents the set of attributes that have been learned cumulatively from task 1 to task t-1, Indicates the number of attributes in the attribute set. Indicates D t The attribute prediction value of the jth attribute of the i-th sample in, For the The corresponding scaling value, Indicates D t The pseudo label of the jth attribute of the i-th sample in, For the The corresponding scaling value, u ij represents the uncertainty of the pseudo label of the i-th sample about the j-th attribute, Represents the first loss function corresponding to the t-th task; determine and The calculation formulas are formula (4) and formula (5) respectively;

[0245]

[0246]

[0247] Where τ is the temperature coefficient.

[0248] According to a pedestrian attribute recognition model training device based on incremental learning provided by the present invention, the second updating module 609 is specifically configured to:

[0249] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is less than or equal to M, the training samples are stored in the training data cache pool; wherein M is a positive integer; or

[0250] When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is greater than M, the expected cache number of samples corresponding to each attribute is determined using formula (6);

[0251]

[0252] Where t represents the tth task in the task learning sequence; T represents the set of all tasks in the task learning sequence, A t represents the attribute set contained in the t-th task, and a represents U t∈T A t Any attribute in, ρ represents the scale coefficient, n a Indicates the total number of samples with attribute a included in the training samples during the training process of the pedestrian attribute recognition model, m a Indicates the expected number of samples cached corresponding to attribute a.

[0253] The present invention provides a pedestrian attribute recognition model training device based on incremental learning. It uses the pedestrian attribute recognition model in the model cache pool to predict whether the new learning task has existing attributes, thereby pseudo-labeling the new learning task with existing attributes. This allows the new learning task to provide supervisory information about all attributes included in the already learned tasks. Afterwards, the to-be-trained model is trained based on representative samples in the training data cache pool and training samples in the new learning task. The first target model obtained after training can recognize the newly added attributes while maintaining the recognition accuracy of the existing attributes, thus effectively alleviating the problem of forgetting disaster.

[0254] The pedestrian attribute recognition model training device based on incremental learning provided by the present invention can achieve Figures 1 to 5 The various processes implemented by the method embodiment achieve the same technical effect and are not described here again to avoid repetition.

[0255] Optionally, the present invention provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the various processes of the above-mentioned embodiment of the pedestrian attribute recognition model training method based on incremental learning are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be described here.

[0256] Figure 7 A schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 7 As shown, the electronic device 700 may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the pedestrian attribute recognition model training method based on incremental learning provided by the above methods.

[0257] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. 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 and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0258] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the pedestrian attribute recognition model training method based on incremental learning provided by the above methods.

[0259] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the pedestrian attribute recognition model training method based on incremental learning provided by the above methods.

[0260] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0261] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0262] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A pedestrian attribute recognition model training method based on incremental learning, characterized in that: include: Obtain a pedestrian attribute recognition dataset for incremental learning, select an initial task from the dataset, and determine the task learning order; The dataset includes at least two tasks; Use the training samples from the initial task to train the initial pedestrian attribute recognition model; Select representative samples from the training samples corresponding to the attributes in the initial task and store them in the training data cache pool; The pedestrian attribute recognition model after initial training is stored in the model cache pool; Repeat the following steps to learn the tasks after the initial task in the task learning order until all tasks in the dataset are learned, thereby obtaining a pedestrian attribute recognition model; For the current task, read the cache model in the model cache pool, and determine the prediction model that is the same as the cache model according to the parameters of the cache model; Determining a model to be trained according to the prediction model; Predicting all training samples of the current task based on the prediction model to obtain an updated current task; wherein the updated current task adds pseudo labels about existing attributes to all training samples in the current task; the pseudo labels refer to the probability values ​​of predicting that the current task contains each existing attribute; the existing attributes refer to pedestrian attributes that can be recognized by the prediction model; Reading representative samples from the training data cache pool, and training the model to be trained based on the representative samples and all the updated training samples in the current task to obtain a first target model; Replace the cache model in the model cache pool with the first target model; Based on the training samples corresponding to the attributes of the current task, the representative samples in the training data buffer pool are updated.

2. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 1, characterized in that: Each task in the data set includes at least one attribute and at least one training sample, and the training sample is only marked with the attribute corresponding to the task in which the training sample is located; there are no identical attributes and training samples between the tasks.

3. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 1, characterized in that: The method of using the training samples in the initial task to train the initial pedestrian attribute recognition model includes: Inputting the training samples in the initial task into the initial pedestrian attribute recognition model, and training the initial pedestrian attribute recognition model by determining the binary cross entropy loss value corresponding to the initial task based on the attribute prediction value, the attribute label value, and the binary cross entropy loss function; The initial pedestrian attribute recognition model includes: a feature extraction layer based on a deep convolutional neural network, multiple binary classifiers with the same number of attributes as the current task, and a random dropout layer between the features and the binary classifiers.

4. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 3, characterized in that: Determining a model to be trained based on the prediction model includes: Determine the total number of attribute types included in the current task as a first number; The first number of binary classifiers is added to the network structure of the prediction model to obtain the model to be trained.

5. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 4, characterized in that: The binary cross entropy loss function is formula (1): (1) Wherein, t represents the tth task in the task learning sequence, represents the training sample set corresponding to the t-th task, represents the number of training samples corresponding to the t-th task, Represents the attribute set contained in the t-th task, Indicates the number of attributes contained in the t-th task, express The attribute label value corresponding to the jth attribute in the i-th sample, express The attribute prediction value corresponding to the j-th attribute in the i-th sample, is the weight of the j-th attribute, Represents the binary cross entropy loss function corresponding to the t-th task.

6. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 5, characterized in that: The weight of the attribute is calculated using formula (2): (2) in, is the weight of the j-th attribute, Indicates that the positive samples corresponding to the j attributes are in the The ratio in is the temperature parameter, and exp( ) represents the exponential function with the natural constant e as the base.

7. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 3, characterized in that: The predicting all training samples of the current task based on the prediction model to obtain an updated current task includes: For the prediction model, setting the random dropout layer to a training mode; the training mode means setting the random dropout layer to an on state; For any training sample in the current task, the training sample is input into the prediction model and K forward operations are performed; For any one of the existing attributes, the mean of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the pseudo label corresponding to the attribute; and the variance of the attribute prediction values ​​corresponding to the training samples after the K forward operations is determined as the uncertainty of the pseudo label corresponding to the attribute.

8. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 7, characterized in that: The step of training the model to be trained based on the representative sample and all the updated training samples in the current task to obtain a first target model includes: For the representative sample, determine the binary cross entropy loss value corresponding to the representative sample according to the attribute prediction value obtained by the representative sample using the to-be-trained model, the attribute label value corresponding to the representative sample, and the binary cross entropy loss function; and For all training samples of the updated current task, determine the binary cross entropy loss value corresponding to the updated current task based on the attribute prediction values ​​obtained by the model to be trained for all training samples, the attribute labeling value corresponding to each of the at least one attribute corresponding to the current task in all training samples, and the binary cross entropy loss function; and determine the first loss value corresponding to the updated training sample based on the pseudo labels in all training samples, the attribute prediction values ​​obtained by the model to be trained for all training samples, and the first loss function; The model to be trained is trained according to the binary cross entropy loss value corresponding to the representative sample, the updated binary cross entropy loss value corresponding to the current task, and the first loss value corresponding to the updated training sample to obtain the first target model.

9. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 8, characterized in that: The first loss function is formula (3): (3) Wherein, t represents the tth task in the task learning sequence, represents the training sample set corresponding to the t-th task, represents the number of training samples corresponding to the t-th task, represents the set of attributes that have been learned cumulatively from task 1 to task t-1, Indicates the number of attributes in the attribute set. express Middle The first sample The attribute prediction value of each attribute, For the The corresponding scaling value, express Middle The first sample Pseudo-labels for attributes, For the The corresponding scaling value, represents the uncertainty of the pseudo label of the i-th sample about the j-th attribute, Represents the first loss function corresponding to the t-th task; determine and The calculation formulas are formula (4) and formula (5) respectively; (4) (5) in, is the temperature coefficient.

10. The method for training a pedestrian attribute recognition model based on incremental learning according to claim 1, characterized in that: The updating of representative samples in the training data cache pool based on the training samples corresponding to the attributes of the current task includes: When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is less than or equal to M, the training samples are stored in the training data cache pool; wherein M is a positive integer; or When the capacity of the training data cache pool is M and the sum of the number of cached training samples in the training data cache pool and the number of training samples is greater than M, the expected cache number of samples corresponding to each of the attributes is determined using formula (6); (6) Wherein, t represents the tth task in the task learning sequence; T represents the set of all tasks in the task learning sequence, Represents the attribute set contained in the t-th task, a represents Any attribute in represents the scale coefficient, represents the total number of samples with attribute a included in the existing training samples during the training process of the pedestrian attribute recognition model. Indicates the expected number of samples cached corresponding to attribute a.

11. A pedestrian attribute recognition model training device based on incremental learning, characterized in that: include: The acquisition module is used to obtain a pedestrian attribute recognition dataset for incremental learning, select an initial task from the dataset, and determine the task learning order; The dataset includes at least two tasks; A first processing module is used to train an initial pedestrian attribute recognition model using training samples in the initial task; Select representative samples from the training samples corresponding to the attributes in the initial task and store them in the training data cache pool; The pedestrian attribute recognition model after initial training is stored in the model cache pool; A control module is configured to repeatedly perform the following steps to learn tasks subsequent to the initial task in the task learning sequence until all tasks in the data set are learned, thereby obtaining a pedestrian attribute recognition model; A first determination module is configured to read a cached model in the model cache pool for a current task, and determine a prediction model identical to the cached model based on parameters of the cached model; A second determining module is used to determine a model to be trained based on the prediction model; A prediction module is configured to predict all training samples of the current task based on the prediction model to obtain an updated current task; wherein the updated current task is to add pseudo-labels related to existing attributes to all training samples in the current task; the pseudo-labels are the probability values ​​of predicting that the current task contains each existing attribute; the existing attributes are pedestrian attributes that can be recognized by the prediction model; A second processing module is configured to read representative samples from the training data cache pool, and train the model to be trained based on the representative samples and all the updated training samples in the current task to obtain a first target model; A first updating module, configured to replace the cache model in the model cache pool with the first target model; The second updating module is used to update the representative samples in the training data buffer pool based on the training samples corresponding to the attributes of the current task.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the pedestrian attribute recognition model training method based on incremental learning as described in any one of claims 1 to 10 are implemented.

13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the pedestrian attribute recognition model training method based on incremental learning as described in any one of claims 1 to 10 are implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the pedestrian attribute recognition model training method based on incremental learning as described in any one of claims 1 to 10 are implemented.