CN-115439878-B - Anti-forgetting training method for target re-identification model, target re-identification method and device
Abstract
The invention provides an anti-forgetting training method for a target re-identification model, an anti-forgetting training method for the target re-identification model and a device, wherein the method comprises the steps of determining a first identity characteristic of a sample image based on a history identification model by applying a sample image of a current round, determining the first current identity characteristic set and a history identity characteristic set of the sample image based on the first identity characteristic of the sample image, a sample identity characteristic set of the current round and the first history identity characteristic set, training an initial identification model based on the sample image, the history identity characteristic set of the sample image, the first current identity characteristic set and the first history identity characteristic set to obtain the current identification model, and realizing the effect of learning new identity characteristics and reviewing the history identity characteristics when training the identification model, thereby being capable of relieving the problem of catastrophic forgetting caused by training the identification model by applying new data and improving the anti-forgetting capacity of the identification model.
Inventors
- XU CHANGSHENG
- YAO HANTAO
Assignees
- 中国科学院自动化研究所
Dates
- Publication Date
- 20260508
- Application Date
- 20220726
Claims (8)
- 1. The forgetting-resistant training method for the target re-identification model is characterized by comprising the following steps of: Determining an initial recognition model based on the historical recognition model; determining a first identity feature of a sample image of a current round based on the history identification model, applying the sample image of the current round, and determining a first current identity feature set and a history identity tag of the sample image based on the first identity feature of the sample image, the sample identity tag of the current round and the first history identity feature set; training the initial recognition model based on the sample image, the historical identity tag of the sample image, the first current identity feature set and the first historical identity feature set to obtain a current recognition model; Determining a second current identity feature set based on the current recognition model, applying the sample image, and determining a second historical identity feature set based on the second current identity feature set and the first historical identity feature set; taking the current recognition model as the historical recognition model, taking a second historical identity characteristic set as the first historical identity characteristic set for the next training iteration, and taking the current recognition model obtained by the iteration completion as a target re-recognition model; Training the initial recognition model based on the sample image, the historical identity tag of the sample image, the first current identity feature set and the first historical identity feature set to obtain a current recognition model, including: based on the initial recognition model, applying the sample image, determining a second identity feature of the sample image; Determining a current loss based on the second identity feature of the sample image and the first current set of identity features, and determining a historical loss based on the historical identity tag of the sample image, the second identity feature of the sample image, and the first set of historical identity features; Determining a joint loss based on the current loss and the historical loss, and updating the first set of current identity features based on a second identity feature of the sample image and a sample identity tag of the sample image; Based on the joint loss, carrying out parameter iteration on the initial recognition model until the joint loss converges to obtain the current recognition model; The determining, based on the first identity feature of the sample image, the sample identity tag of the current round, and the first historical identity feature set, the first current identity feature set and the historical identity tag of the sample image includes: determining an identity characteristic corresponding to the sample identity tag based on the sample identity tag and the first identity characteristic of the sample image; determining the first current identity feature set based on the sample identity tag and the identity feature corresponding to the sample identity tag; Circularly matching each identity feature in the first current identity feature set with each identity feature in the first historical identity feature set to obtain a matching degree of an identity tag matching pair and an identity tag matching pair; If the matching degree of the identity label matching pairs is smaller than a preset similarity threshold, the historical identity label corresponding to the sample identity label is a default label, otherwise, the historical identity label corresponding to the sample identity label is determined based on the identity characteristic matching pairs.
- 2. The method of claim 1, wherein the determining a joint loss based on the current loss and the historical loss comprises: Determining a parameter constraint loss based on the second identity feature of the sample image, the first identity feature of the sample image, and the historical identity tag of the sample image; the joint loss is determined based on the current loss, the historical loss, and the parameter constraint loss.
- 3. The method of claim 1, wherein the applying the sample image based on the current recognition model to determine a second current set of identity features and determining a second set of historical identity features based on the second current set of identity features and the first set of historical identity features comprises: Based on the current identification model, applying the sample image to determine a second identity feature of the sample image; determining a mean identity characteristic corresponding to the sample identity label based on the sample identity label and the second identity characteristic of the sample image; determining the second current identity feature set based on the sample identity tag and the average identity feature corresponding to the sample identity tag; a second set of historical identity features is determined based on the second set of current identity features and the first set of historical identity features.
- 4. A method of target re-identification, comprising: Determining an image to be identified; Inputting the image to be identified into a target re-identification model to obtain identity characteristics output by the target re-identification model, and determining an identification result based on the identity characteristics; The target re-recognition model is trained based on the target re-recognition model anti-forgetting training method according to any one of claims 1 to 3.
- 5. An anti-forgetting training device for a target re-identification model, which is characterized by comprising: the determining module is used for determining an initial recognition model based on the historical recognition model; the system comprises a history association module, a history identification module and a control module, wherein the history association module is used for determining a first identity characteristic of a sample image of a current round based on the history identification model by applying the sample image of the current round, and determining a first current identity characteristic set and a history identity characteristic set of the sample image based on the first identity characteristic of the sample image, the sample identity label of the current round and the first history identity characteristic set; The training module is used for training the initial recognition model based on the sample image, the historical identity tag of the sample image, the first current identity feature set and the first historical identity feature set to obtain a current recognition model; The updating module is used for determining a second current identity characteristic set based on the current identification model by applying the sample image and determining a second historical identity characteristic set based on the second current identity characteristic set and the first historical identity characteristic set; the iteration module is used for taking the current recognition model as the historical recognition model, taking a second historical identity characteristic set as the first historical identity characteristic set for the next training iteration, and taking the current recognition model obtained by the completion of the iteration as a target re-recognition model; the training module is specifically configured to: based on the initial recognition model, applying the sample image, determining a second identity feature of the sample image; Determining a current loss based on the second identity feature of the sample image and the first current set of identity features, and determining a historical loss based on the historical identity tag of the sample image, the second identity feature of the sample image, and the first set of historical identity features; Determining a joint loss based on the current loss and the historical loss, and updating the first set of current identity features based on a second identity feature of the sample image and a sample identity tag of the sample image; Based on the joint loss, carrying out parameter iteration on the initial recognition model until the joint loss converges to obtain the current recognition model; The history association module is specifically configured to: determining an identity characteristic corresponding to the sample identity tag based on the sample identity tag and the first identity characteristic of the sample image; determining the first current identity feature set based on the sample identity tag and the identity feature corresponding to the sample identity tag; Circularly matching each identity feature in the first current identity feature set with each identity feature in the first historical identity feature set to obtain a matching degree of an identity tag matching pair and an identity tag matching pair; If the matching degree of the identity label matching pairs is smaller than a preset similarity threshold, the historical identity label corresponding to the sample identity label is a default label, otherwise, the historical identity label corresponding to the sample identity label is determined based on the identity characteristic matching pairs.
- 6. A target re-recognition apparatus, characterized by comprising: The determining module is used for determining an image to be identified; the identification module inputs the image to be identified into a target re-identification model to obtain identity characteristics output by the target re-identification model, and determines an identification result based on the identity characteristics; The target re-recognition model is trained based on the target re-recognition model anti-forgetting training method according to any one of claims 1 to 3.
- 7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the object re-recognition model anti-forgetting training method according to any of claims 1 to 3 or the object re-recognition method according to claim 4 when executing the program.
- 8. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the object re-recognition model anti-forgetting training method according to any of claims 1 to 3 or the object re-recognition method according to claim 4.
Description
Anti-forgetting training method for target re-identification model, target re-identification method and device Technical Field The invention relates to the technical field of machine vision, in particular to an anti-forgetting training method for a target re-identification model, a target re-identification method and a target re-identification device. Background Target re-recognition, namely target re-recognition, is mainly focused on the fields of pedestrian re-recognition and vehicle re-recognition at present. Taking pedestrian re-identification as an example, a picture of a target pedestrian is given, and the target pedestrian is searched in a video image sequence shot by each monitoring device in the non-overlapping video monitoring network. At present, when a model is trained by a target re-identification algorithm, images shot by monitoring devices in a video monitoring network are used as independent sample data, the sample data are modeled one by one based on the spatial topological relation of each camera, but because of the large difference between shooting scenes of different cameras and the devices, if training is directly carried out by using new data, model parameters are biased to new data distribution and far away from old data distribution, so that although a beneficial model learns the new scenes, a serious catastrophic forgetting problem is brought, and a re-identification model is reserved for each scene, which is unrealistic and contains more redundant information. Disclosure of Invention The invention provides an anti-forgetting training method for a target re-identification model, and a target re-identification method and device, which are used for solving the defect of catastrophic forgetting of the model, which occurs in the prior art when independent sample data shot by each camera in a video monitoring network are trained one by one. The invention provides an anti-forgetting training method for a target re-identification model, which comprises the following steps: Determining an initial recognition model based on the historical recognition model; determining a first identity feature of a sample image of a current round based on the history identification model, applying the sample image of the current round, and determining a first current identity feature set and a history identity tag of the sample image based on the first identity feature of the sample image, the sample identity tag of the current round and the first history identity feature set; training the initial recognition model based on the sample image, the historical identity tag of the sample image, the first current identity feature set and the first historical identity feature set to obtain a current recognition model; Determining a second current identity feature set based on the current recognition model, applying the sample image, and determining a second historical identity feature set based on the second current identity feature set and the first historical identity feature set; and taking the current recognition model as the historical recognition model, taking a second historical identity characteristic set as the first historical identity characteristic set for the next training iteration, and taking the current recognition model obtained by the iteration completion as a target re-recognition model. According to the method for training the target re-identification model to prevent forgetting provided by the invention, the training of the initial identification model based on the sample image, the historical identity tag of the sample image, the first current identity feature set and the first historical identity feature set to obtain the current identification model comprises the following steps: based on the initial recognition model, applying the sample image, determining a second identity feature of the sample image; Determining a current loss based on the second identity feature of the sample image and the first current set of identity features, and determining a historical loss based on the historical identity tag of the sample image, the second identity feature of the sample image, and the first set of historical identity features; Determining a joint loss based on the current loss and the historical loss, and updating the first set of current identity features based on a second identity feature of the sample image and a sample identity tag of the sample image; And carrying out parameter iteration on the initial recognition model based on the joint loss until the joint loss converges to obtain the current recognition model. According to the method for training the target re-recognition model to prevent forgetting, which is provided by the invention, the joint loss is determined based on the current loss and the historical loss, and the method comprises the following steps: Determining a parameter constraint loss based on the second identity feature of the sample image, the first identity feature of the