Target re-identification model anti-forgetting training method, target re-identification method and device

By employing multi-round iterative training and weight parameter constraints, the problem of catastrophic forgetting in target re-identification models under different camera scenarios was solved. This approach enabled the model to review historical features while learning new features, thereby improving its resistance to forgetting and its recognition accuracy.

CN115439878BActive Publication Date: 2026-05-08INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INST OF AUTOMATION CHINESE ACAD OF SCI
Filing Date
2022-07-26
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing target re-identification algorithms suffer from catastrophic forgetting problems when training models because of differences in shooting scenes and equipment of different cameras. This causes the model parameters to be biased towards the new data distribution and far away from the old data distribution. Furthermore, the method of modeling each scene one by one is impractical and redundant.

Method used

A multi-round iterative training method is adopted, which trains the initial recognition model by using the sample images of the current round, historical identity labels and identity feature sets. Combined with weight parameter constraints and identity knowledge evolution, it can learn new data while reviewing historical features, thus mitigating catastrophic forgetting.

Benefits of technology

It improves the recognition model's resistance to forgetting, enhances the recognition model's accuracy and performance in new scenarios, and reduces redundant information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115439878B_ABST
    Figure CN115439878B_ABST
Patent Text Reader

Abstract

The application provides a target re-identification model anti-forgetting training method, a target re-identification method and device, wherein the method comprises the following steps: based on a historical identification model, applying sample images of a current round to determine first identity features of the sample images; and based on the first identity features of the sample images, sample identity labels of the current round and a first historical identity feature set, determining a first current identity feature set and historical identity labels of the sample images, training an initial identification model based on the sample images, the historical identity labels of the sample images, the first current identity feature set and the first historical identity feature set to obtain a current identification model, which realizes reviewing historical identity features while learning new identity features during identification model training, thereby being capable of relieving the problem of catastrophic forgetting caused by training an identification model by using new data, and improving the anti-forgetting capability of the identification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a method for training a target re-identification model to resist forgetting, a target re-identification method, and an apparatus. Background Technology

[0002] Target re-identification, or target re-identification, currently focuses primarily on pedestrian and vehicle re-identification. Taking pedestrian re-identification as an example, given an image of a target pedestrian, the task is to retrieve that pedestrian from a sequence of video images captured by various monitoring devices in a non-overlapping video surveillance network.

[0003] Currently, target re-identification algorithms use images captured by various monitoring devices in a video surveillance network as independent sample data when training the model. These sample data are modeled one by one based on the spatial topology of each camera. However, since there are significant differences in the shooting scenes and devices of different cameras, if new data is used directly for training, the model parameters will be biased towards the distribution of new data and away from the distribution of old data. Although this is beneficial for the model to learn new scenes, it will also bring serious catastrophic forgetting problems. It is also impractical to keep a re-identification model for each scene, and this would contain a lot of redundant information. Summary of the Invention

[0004] This invention provides a target re-identification model anti-forgetting training method, target re-identification method and device, to solve the defect of catastrophic forgetting in the prior art when training the model one by one using independent sample data captured by each camera in a video surveillance network.

[0005] This invention provides a method for training a target re-identification model to resist forgetting, comprising:

[0006] Based on historical identification models, determine the initial identification model;

[0007] Based on the historical recognition model, the sample image of the current round is used to determine the first identity feature of the sample image; and based on the first identity feature of the sample image, the sample identity label of the current round, and the first historical identity feature set, the first current identity feature set and the historical identity label of the sample image are determined.

[0008] The initial recognition model is trained based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model;

[0009] Based on the current recognition model, the sample image is applied to determine a second current identity feature set, and based on the second current identity feature set and the first historical identity feature set, a second historical identity feature set is determined.

[0010] The current recognition model is used as the historical recognition model, and the second set of historical identity features is used as the first set of historical identity features for the next training iteration; and the current recognition model obtained after the iteration is used as the target re-recognition model.

[0011] According to the present invention, a method for training a target re-identification model to resist forgetting includes training an initial identification model based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain a current identification model, comprising:

[0012] Based on the initial recognition model, the sample image is applied to determine the second identity feature of the sample image;

[0013] Based on the second identity feature of the sample image and the first current identity feature set, the current loss is determined, and based on the historical identity label of the sample image, the second identity feature of the sample image and the first historical identity feature set, the historical loss is determined.

[0014] Based on the current loss and the historical loss, a joint loss is determined; and the first current identity feature set is updated based on the second identity feature of the sample image and the sample identity label of the sample image.

[0015] Based on the joint loss, the parameters of the initial recognition model are iterated until the joint loss converges, thus obtaining the current recognition model.

[0016] According to the present invention, a method for training a target re-identification model to resist forgetting includes determining a joint loss based on the current loss and the historical loss, comprising:

[0017] Based on the second identity feature of the sample image, the first identity feature of the sample image, and the historical identity label of the sample image, determine the parameter constraint loss;

[0018] The joint loss is determined based on the current loss, the historical loss, and the parameter constraint loss.

[0019] According to the present invention, a method for training a target re-identification model to resist forgetting includes determining a first current identity feature set and a historical identity label of the sample image based on a first identity feature of the sample image, a sample identity label of the current round, and a first historical identity feature set.

[0020] Based on the sample identity label and the first identity feature of the sample image, determine the identity feature corresponding to the sample identity label;

[0021] Based on the sample identity label and the identity features corresponding to the sample identity label, the first current identity feature set is determined;

[0022] Each identity feature in the first current identity feature set is cyclically matched with each identity feature in the first historical identity feature set to obtain identity tag matching pairs and the matching degree of identity tag matching pairs;

[0023] If the matching degree of the identity tag matching pair is less than the preset similarity threshold, then the historical identity tag corresponding to the sample identity tag is the default tag; otherwise, the historical identity tag corresponding to the sample identity tag is determined based on the identity feature matching pair.

[0024] According to the present invention, a method for training a target re-identification model to resist forgetting includes determining a second current identity feature set based on the current identification model and 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, comprising:

[0025] Based on the current recognition model, the sample image is applied to determine the second identity feature of the sample image;

[0026] Based on the sample identity label and the second identity feature of the sample image, determine the mean identity feature corresponding to the sample identity label;

[0027] Based on the sample identity label and the mean identity feature corresponding to the sample identity label, the second current identity feature set is determined;

[0028] The second set of historical identity features is determined based on the second current identity feature set and the first set of historical identity features.

[0029] The present invention also provides a target re-identification method, comprising:

[0030] Identify the image to be recognized;

[0031] The image to be identified is input into the target re-identification model to obtain the identity features output by the target re-identification model, and the identification result is determined based on the identity features;

[0032] The target re-identification model is trained based on the target re-identification model anti-forgetting training method described above.

[0033] The present invention also provides a forgetting-resistant training device for a target re-identification model, comprising:

[0034] The determination module is used to determine the initial recognition model based on the historical recognition model;

[0035] The historical association module is used to determine the first identity feature of the sample image based on the historical recognition model and the sample image of the current round; and to determine the first current identity feature set and the historical identity label of the sample image based on the first identity feature of the sample image, the sample identity label of the current round and the first historical identity feature set.

[0036] The training module is used to train the initial recognition model based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model;

[0037] The update module is used to determine a second current identity feature set based on the current recognition model and the sample image, and to determine a second historical identity feature set based on the second current identity feature set and the first historical identity feature set;

[0038] The iteration module is used to use the current recognition model as the historical recognition model, and to use the second historical identity feature set as the first historical identity feature set for the next round of training iteration; and to use the current recognition model obtained after the iteration as the target re-recognition model.

[0039] The present invention also provides a target re-identification device, comprising:

[0040] The determination module is used to determine the image to be recognized;

[0041] The recognition module inputs the image to be recognized into the target re-recognition model, obtains the identity features output by the target re-recognition model, and determines the recognition result based on the identity features;

[0042] The target re-identification model is trained based on the target re-identification model anti-forgetting training method described above.

[0043] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the target re-identification model anti-forgetting training method or the target re-identification method as described above.

[0044] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target re-identification model anti-forgetting training method or the target re-identification method as described above.

[0045] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the target re-identification model anti-forgetting training method or the target re-identification method as described above.

[0046] The target re-identification model anti-forgetting training method, target re-identification method and device provided by the present invention train the target re-identification model in a multi-round iterative training manner. In each round of training, the initial identification model of the current round is trained by using the sample image of the current round, the historical identity labels of the associated sample images and the historical identity feature set. This realizes that while learning new identity features during the training of the identification model, it also reviews historical identity features, thereby alleviating the problem of catastrophic forgetting caused by applying new data to train the identification model and improving the anti-forgetting ability of the identification model. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0048] Figure 1 This is a flowchart illustrating the anti-forgetting training method for the target re-identification model provided by the present invention;

[0049] Figure 2 This is a flowchart illustrating the current round model anti-forgetting training method provided by the present invention;

[0050] Figure 3 This is a flowchart illustrating the joint loss calculation method provided by the present invention;

[0051] Figure 4 This is a framework diagram of the historical identity tag association of sample images provided by the present invention;

[0052] Figure 5 This is a flowchart illustrating the target re-identification method provided by the present invention;

[0053] Figure 6 This is a framework diagram of the current recognition model anti-forgetting training method for the current round provided by the present invention;

[0054] Figure 7 This is a schematic diagram of the structure of the target re-identification model anti-forgetting training device provided by the present invention;

[0055] Figure 8 This is a schematic diagram of the target re-identification device provided by the present invention.

[0056] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0058] Existing target re-identification algorithm model training mainly includes two types. One is to collect images captured by each camera in the video surveillance network as a sample set for modeling and training the recognition model. However, this training method is limited by privacy protection and storage capacity. The other is to model these sample data one by one based on the spatial topology relationship of each camera. However, since there are significant differences in the shooting scenes and equipment of different cameras, if new data is used directly for training, the model parameters will be biased towards the new data distribution and away from the old data distribution. Although this is beneficial for the model to learn new scenes, it will also bring serious catastrophic forgetting problems. It is also impractical to keep a re-identification model for each scene, and this would contain a lot of redundant information.

[0059] Therefore, how to solve the problem of catastrophic forgetting of recognition models caused by modeling sample data one by one, and thus improve the performance of recognition models, is a technical problem that urgently needs to be solved by those skilled in the art.

[0060] To address the aforementioned technical problems, embodiments of the present invention provide a target re-identification method to prevent forgetting. Figure 1 This is a flowchart illustrating the anti-forgetting training method for the target re-identification model provided by this invention. (Example) Figure 1 As shown, the method includes:

[0061] Step 110: Determine the initial recognition model based on the historical recognition model;

[0062] Specifically, the parameters of the historical recognition model are initialized for the initial recognition model of the current round.

[0063] It should be noted that during the initial training iteration, the parameters of the historical recognition model are used as the initial parameters. In subsequent iterations, the parameters of the historical recognition model can be directly used as the parameters of the current round's initial recognition model. Alternatively, regularization can be used to constrain the weight parameters before initializing the parameters of the current round's initial recognition model. The formal definition of the regularization term is as follows:

[0064]

[0065] In the formula, λ is a hyperparameter, l is the index value of the parameters of the historical recognition model and the initial recognition model, and Ω is... l This represents the importance weight of the corresponding parameter. as well as These are the parameters at the corresponding index positions in the initial recognition model and the historical recognition model, respectively. The parameter importance weights Ω are calculated. l This can be achieved through Elastic Weight Consolidation (EWC), Memory Aware Synapses (MAS), and Synaptic Intelligence (SI) methods, and this embodiment of the invention does not limit this.

[0066] Step 120: Based on the historical recognition model, apply the sample images of the current round to determine the first identity feature of the sample images; and based on the first identity feature of the sample images, the sample identity labels of the current round, and the first historical identity feature set, determine the first current identity feature set and the historical identity labels of the sample images.

[0067] Step 130: Train the initial recognition model based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model;

[0068] Considering that the cause of catastrophic forgetting in recognition models is that training with new data causes the model parameters to be biased towards the distribution of the new data and away from the distribution of the old data, reviewing historical data when training with new data can effectively alleviate the problem of catastrophic forgetting and improve the performance of recognition models.

[0069] Specifically, the sample image of the current round is input into the historical recognition model. The historical recognition model outputs the first identity feature of the sample image. Based on the sample identity label of the current round and the first identity feature of the sample image, a first current identity feature set is determined. The identity features in the first current identity feature set are compared with the identity features in the first historical identity feature set. Based on the comparison result, the historical identity label corresponding to the sample identity label in the first current identity feature set is determined. Based on the sample identity label corresponding to the sample image and the historical identity label corresponding to the sample identity label in the first current identity feature set, the historical identity label of the sample image is determined. Then, the initial recognition model is trained based on the sample image, the historical identity label of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model.

[0070] It should be noted that the first current identity feature set includes the sample identity label of the current round and the historical identity features corresponding to the sample identity label. The first historical identity feature set includes the historical identity label and the historical identity features corresponding to the historical identity label. When a certain current identity feature in the first current identity feature set does not match any of the historical identity features in the first historical identity feature set, it means that the sample identity label corresponding to the current identity feature is not in the historical identity labels. In this case, the initial model can be trained using the sample image corresponding to the sample identity label without combining it with historical data. Conversely, if the sample identity label corresponding to the current identity feature is in the historical identity labels, the initial model is trained using historical data. This allows the initial recognition model to learn the current round identity features of the sample identity label and review historical identity features when the sample image has historical identity labels, and to learn the current round identity features of the sample identity label when there are no historical identity labels. This can alleviate the catastrophic forgetting caused by training the recognition model with new data. In the initial training iteration, the first set of historical identity features does not exist. That is, the sample images used in the initial training iteration do not have historical identity labels. At this time, the sample images are used directly to train the initial recognition model without reviewing the historical identity features.

[0071] Step 140: Based on the current recognition model, apply sample images to determine the second current identity feature set, and based on the second current identity feature set and the first historical identity feature set, determine the second historical identity feature set;

[0072] Considering that the sample image corresponding to the sample identity label in the current round will bring new identity features or new identity labels and corresponding identity features, in order to obtain the new identity features or new identity features and corresponding identity features in the current round during subsequent iteration training, this embodiment of the invention updates the new identity features or new identity features and corresponding identity features in the current round to the first historical identity feature set for use in subsequent iteration training.

[0073] Specifically, the sample image is input into the current recognition model obtained after the current round of training to obtain the identity features corresponding to the sample image output by the current recognition model. Then, the sample identity label and the identity features corresponding to the sample image are classified and aggregated to obtain the second current identity feature set. Finally, the second current identity feature set and the first historical identity feature set are merged to obtain the second historical identity feature set.

[0074] It should be noted that merging the second current identity feature set and the first historical identity feature set involves first copying the first historical identity feature set to a temporary identity feature set. Then, if a sample identity tag in the second current identity feature set has a historical identity tag, the identity feature corresponding to the sample identity tag is updated to the corresponding part of the temporary identity feature set. If a sample identity tag in the second current identity feature set does not have a historical identity tag, the sample identity tag and its corresponding identity feature are added to the temporary identity feature set, and the temporary identity feature set is then used as the second historical identity feature set. Alternatively, if a sample identity tag in the second current identity feature set has a historical identity tag, the identity feature corresponding to the sample identity tag and the historical identity feature of the historical identity tag corresponding to the historical identity tag in the temporary identity feature set are weighted and merged, and then updated to the corresponding part of the temporary identity feature set. If a sample identity tag in the second current identity feature set does not have a historical identity tag, the sample identity tag and its corresponding identity feature are added to the temporary identity feature set, and the temporary identity feature set is then used as the second historical identity feature set. This embodiment of the invention does not limit this approach.

[0075] Step 150: Use the current recognition model as the historical recognition model, and use the second set of historical identity features as the first set of historical identity features for the next training iteration; and use the current recognition model obtained after the iteration as the target re-recognition model.

[0076] Specifically, the current recognition model obtained in the current round of training is used as the historical recognition model, and the second set of historical identity features obtained in the current round is used as the first set of historical identity features for the next round of training iteration. When all iterations of training are completed, the current recognition model obtained in the last iteration of training is used as the target re-recognition model.

[0077] It should be noted that the number of iteration rounds is determined by the number of cameras in the monitoring system. For example, if there are 6 cameras in the monitoring system, the sample images captured by these 6 cameras will be trained 6 times using the above training method to obtain the target re-identification model.

[0078] The target re-identification model anti-forgetting training method provided in this embodiment of the invention trains the target re-identification model in a multi-round iterative training manner. In each round of training, the initial identification model of the current round is trained by using the sample images of the current round, the historical identity labels of the associated sample images, and the set of historical identity features. This realizes that while learning new identity features during the training of the identification model, it also reviews historical identity features, thereby alleviating the problem of catastrophic forgetting caused by applying new data to train the identification model and improving the anti-forgetting ability of the identification model.

[0079] Based on the above embodiments, Figure 2 This is a flowchart illustrating the current round model anti-forgetting training method provided by the present invention. Figure 2 As shown, step 130 includes:

[0080] Step 131: Based on the initial recognition model, apply the sample images to determine the second identity features of the sample images;

[0081] Step 132: Determine the current loss based on the second identity feature and the first current identity feature set of the sample image, and determine the historical loss based on the historical identity label of the sample image, the second identity feature and the first historical identity feature set of the sample image;

[0082] Step 133: Determine the joint loss based on the current loss and the historical loss; and update the first current identity feature set based on the second identity feature of the sample image and the sample identity label of the sample image;

[0083] Step 134: Based on the joint loss, iterate the parameters of the initial recognition model until the joint loss converges to obtain the current recognition model.

[0084] Specifically, the sample image is first input into the initial recognition model of the current round to obtain the second identity feature of the sample image output by the initial recognition model. Then, according to the first loss function, the second identity feature of the sample image and the first current identity feature set are applied to determine the current loss. At the same time, according to the second loss function, the historical identity label of the sample image, the second identity feature of the sample image and the first historical identity feature set are applied to determine the historical loss. Then, the current loss and the historical loss are weighted to determine the joint loss. Then, the parameters of the initial recognition model are iterated through the joint loss until the joint loss converges to obtain the current recognition model. In each round of parameter iteration, the second identity feature of the sample image is mixed with the identity feature corresponding to the sample identity label of the sample image in the first current identity feature set, and the identity feature corresponding to the sample identity label of the sample image in the first current identity feature set is updated with the mixed identity feature.

[0085] It should be noted that the formula for the first loss function is as follows:

[0086]

[0087] In the formula, is the current loss, i is the index of the sample image in the current round, and j is the index of the sample identity label in the current round. It is the second identity feature of the sample images in the current round. It is the second identity feature of the sample image. The serial number of the sample identity label. It is the sequence number in the first current identity feature set. Corresponding identity characteristics The identity feature corresponding to index j in the first current identity feature set, τ is the temperature parameter, τ is used to represent the distance between identity label classes, L c N is the number of sample images in the current round. c τ is the number of sample identity tags in the current round, preferably τ = 0.05.

[0088] The formula for the second loss function is as follows:

[0089]

[0090] In the formula, This represents historical loss, where i is the sequence number of the sample image in the current round, j is the sequence number of the sample identity label in the current round, and sgn(y) means that sgn(y) = 0 when y = -1, and sgn(y) = 1 in other cases. It is the second identity feature of the sample images in the current round. It is the sequence number of the historical identity tag of the sample image. It is the serial number in the first set of historical identity characteristics. Corresponding identity characteristics In the first historical identity feature set, the identity feature corresponding to index j, τ is a temperature parameter, τ is used to represent the spacing between identity label classes, L c N is the number of sample images in the current round. h It is the number of historical identity tags, preferably τ = 0.05.

[0091] The formula for mixing the second identity feature of the sample image with the identity feature corresponding to the sample identity label of the sample image in the first current identity feature set is as follows:

[0092]

[0093] In the formula, m is the momentum parameter, preferably m = 0.1.

[0094] Based on the above embodiments, Figure 3 This is a flowchart illustrating the joint loss calculation method provided by the present invention. As shown in the figure, step 133 determines the joint loss based on the current loss and historical losses, including:

[0095] Step 310: Determine the 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 label of the sample image;

[0096] Step 320: Determine the joint loss based on the current loss, historical loss, and parameter constraint loss.

[0097] Considering that most networks are currently sparse and overparameterized, for old tasks, only some parameters are very important to the prediction results, while others are not so easy to change the prediction results. Therefore, in the current round of training, the embodiments of the present invention can constrain the variation of important parameters in the initial model, so as to achieve the purpose of knowledge resistance to forgetting, that is, to continuously learn new features while remembering old knowledge.

[0098] Specifically, based on the third loss calculation function, the first identity feature of the sample image, the second identity feature of the sample image, and the historical identity label of the sample image are applied to determine the parameter constraint loss; and the current loss, historical loss, and parameter constraint loss are weighted to determine the joint loss.

[0099] It should be noted that the formula for the third loss calculation function is as follows:

[0100]

[0101] In the formula, This is the parameter-constrained loss, where i is the index of the sample image in the current round, and L... c Φ is the number of sample images in the current round. c This is the initial recognition model for the current round, Φ h This is a historical recognition model. The meaning of sgn(y) is that when y = -1, sgn(y) = 0; otherwise, sgn(y) = 1. It is the i-th sample image in the sample image set of the current round. yes The serial number of the historical identity label.

[0102] Preferably, the formula for calculating the joint loss is as follows:

[0103]

[0104] In the formula, It is a joint loss. This is the current loss. It is a historical loss. It is parameter constraint loss.

[0105] Based on the above embodiments, step 120 includes:

[0106] Step 121: Based on the sample identity label and the first identity feature of the sample image, determine the identity feature corresponding to the sample identity label;

[0107] Step 122: Determine the first current identity feature set based on the sample identity label and the identity features corresponding to the sample identity label;

[0108] Step 123: Perform cyclic matching between each identity feature in the first current identity feature set and each identity feature in the first historical identity feature set to obtain identity feature matching pairs and the matching degree of identity feature matching pairs;

[0109] Step 124: If the matching degree of the identity feature matching pair is less than the preset similarity threshold, then the historical identity label corresponding to the sample identity label is the default label; otherwise, based on the identity feature matching pair, determine the historical identity label corresponding to the sample identity label.

[0110] Specifically, the sample images are first classified according to their sample identity labels, and the first identity features of each class of sample images are fused. The fused features are then used as the identity features of the sample identity labels corresponding to that class of sample images. Based on the sample identity labels and the identity features corresponding to the sample identity labels, a first current identity feature set is formed. Then, each identity feature in the first current identity feature set is cyclically matched with each feature in the first historical identity feature set. The cyclic matching formula is as follows:

[0111]

[0112] In the formula, (y c ,y h ) represents the identity tag matching pair, y c Let y be the sample identity label in the first current identity feature set. h These are historical identity tags within the first set of historical identity features. It is the first set of current identity features y c Corresponding identity characteristics It is the first set of historical identity features y h Corresponding historical identity characteristics, M h It is the first set of historical identity characteristics, M c Let f be the first set of current identity features, and sim(f;M) represent calculating the cosine similarity between identity feature f and each identity feature in the identity feature set M. express In M h The historical identity label corresponding to the identity feature with the highest similarity is y. h , express exist The sample identity label corresponding to the identity feature with the highest similarity is y. c The matching degree of identity tag matching pairs can be determined by... In M h The maximum similarity can also be determined by... In M h Maximum similarity and exist The maximum similarity is determined by both factors, but this embodiment of the invention does not impose any restrictions on it. When the matching degree of an identity tag matching pair is less than a preset similarity threshold, it indicates that the sample identity tag in the identity tag matching pair does not have a corresponding historical identity tag. In this case, the historical identity tag of the sample identity tag is set as the default tag; otherwise, the historical identity tag of the sample identity tag in the identity tag matching pair is the historical identity tag in the identity tag matching pair. Preferably, the value of the default tag is -1.

[0113] It should be noted that, Figure 4 This is a framework diagram of the historical identity tag association for sample images provided by the present invention. For example... Figure 4 As shown, based on the first set of historical identity features determined by the historical sample images trained in historical iterations, and the identity features of the current round of sample images output by the historical recognition model, the first set of current identity features is determined. The first set of historical identity features and the first set of current identity features are associated with identity knowledge, that is, cyclic matching is performed to obtain the identity feature matching pairs and the matching degree of the identity feature matching pairs.

[0114] Based on the above embodiments, step 140 includes:

[0115] Step 141: Based on the current recognition model, apply the sample image to determine the second identity feature of the sample image;

[0116] Step 142: Based on the sample identity label and the second identity feature of the sample image, determine the mean identity feature corresponding to the sample identity label;

[0117] Step 143: Determine the second current identity feature set based on the sample identity label and the mean identity feature corresponding to the sample identity label;

[0118] Step 144: Determine the second historical identity feature set based on the second current identity feature set and the first historical identity feature set.

[0119] Specifically, the sample images of the current round are input into the current recognition model trained in the current round to obtain the second identity features of the sample images output by the current recognition model. Sample images with the same sample identity label are classified, and the second identity features of the sample images corresponding to each sample identity label are subjected to mean fusion processing to obtain the mean identity features corresponding to each sample identity label. Based on the sample identity label and the mean identity features corresponding to the sample identity label, the second current identity feature set is determined. Then, based on the second current identity feature set and the first historical identity feature set, the second historical identity feature set is determined.

[0120] It should be noted that, based on the second current identity feature set and the first historical identity feature set, the second historical identity feature set can be determined by first storing the first historical identity feature set into a temporary identity feature set, then comparing the similarity between the identity features in the second current identity feature set and the identity features in the temporary identity feature set. When the maximum similarity is greater than a preset threshold, the identity features in the second current identity feature set for which the similarity is calculated are fused with the identity features in the temporary identity feature set. Otherwise, the identity features in the second current identity feature set for which the maximum similarity is calculated and the sample identity label are directly added to the temporary identity feature set. Finally, the temporary identity feature set is used as the second historical identity feature set for subsequent iterations of training.

[0121] Figure 5 This is a flowchart illustrating the target re-identification method provided by the present invention. For example... Figure 5 As shown, the method includes:

[0122] Step 510: Determine the image to be recognized;

[0123] It should be noted that the image to be identified can be a picture taken by a camera in a video surveillance network, or it can be other pictures containing identity information, such as a license plate photo or a person photo. This embodiment of the invention does not limit this.

[0124] Step 520: Input the image to be recognized into the target re-recognition model to obtain the identity features output by the target re-recognition model, and determine the recognition result based on the identity features;

[0125] The target re-identification model is trained based on the target re-identification model anti-forgetting training method provided in any of the above embodiments.

[0126] Specifically, the initial recognition model is trained according to the target re-identification model anti-forgetting training method provided in any of the above embodiments to obtain the target re-identification model. The image to be identified is input into the target re-identification model to obtain the identity features corresponding to the image to be identified output by the target re-identification model. Then, based on the identity features, the mapping relationship between the identity features and the identity label (category) is applied to determine the identity label corresponding to the image to be identified, i.e., the recognition result.

[0127] The target re-identification method provided in this embodiment of the invention generally applies the target re-identification model trained by the anti-forgetting training method provided in any of the above embodiments to identify the image to be identified and obtain the identification result. Since the target identification model training method can alleviate the problem of catastrophic forgetting, the target identification model obtained after training can better identify the images to be identified captured by each camera device in the monitoring network, thereby improving the performance of the target re-identification model and thus improving the identification accuracy of the target re-identification model.

[0128] Figure 6 This is a framework diagram of the current recognition model anti-forgetting training method provided by the present invention. For example... Figure 6 As shown, the method includes: applying weight parameter constraints and combining identity knowledge evolution to perform incremental training of the model to obtain a target re-identification model.

[0129] Specifically, the weight parameter constraint considers that if the variation of important parameters of the historical recognition model can be constrained during the current training round, the current recognition model trained in the current round can achieve the goal of resisting learning forgetting, that is, it can continuously learn new knowledge while remembering old knowledge. Regularization is an important method of weight parameter constraint, which has the advantages of not requiring additional storage space and not increasing model parameters. This embodiment of the invention introduces a more reasonable regularization constraint for the incremental target re-recognition model, that is, increasing the constraint weights on important parameters of the historical recognition model to limit the variation of these parameters. During the current training round, the remaining parameters are mainly used to learn new knowledge. The formal definition of the regularization term is as follows:

[0130]

[0131] Where λ is a hyperparameter representing the importance of the current training task, l is the index value of the parameters of the historical recognition model and the initial recognition model, and Ω l This represents the importance weight of the corresponding parameter. as well as These are the parameters at the corresponding index positions in the initial recognition model and the historical recognition model, respectively. The parameter importance weights Ω are calculated. l This can be achieved through Elastic Weight Consolidation (EWC), Memory Aware Synapses (MAS), and Synaptic Intelligence (SI) methods.

[0132] Identity knowledge evolution includes: identity knowledge association, identity knowledge distillation, and identity knowledge expansion.

[0133] Firstly, identity knowledge association is crucial. In a single camera scene, identity information is easily obtained through target trajectory modeling. Therefore, when constructing the sample images for the current round, the identity label y of the sample can be introduced. c Furthermore, considering that when a target passes through a surveillance network, its trajectory often crosses multiple cameras, for example, a target may be simultaneously captured by the c-th camera and a previously captured image from a camera h, i.e., the set D of sample images captured by the current camera c. c The set of sample images D taken by historical camera h h There is some overlap in the target identities, namely D c and D h Each of the sample images will contain a certain number of images. and For the same sample identity label y, if it can be associated with D c and D h The target identity features in D c Images in Mark one in D h The identity labels of samples that have appeared before the same target can provide a simple review of the identity features of historical samples. Therefore, the setting of the sample image set D of the monitoring network can be adjusted as follows: a historical identity label y is added to the set of sample images other than the set D1 used in the first iteration of training. h The improved sample image set for the current round in Sample image representing the current round In D c The corresponding sample identity label, and Then it corresponds to D h Historical identity tags under the name, utilizing The information provided allows the initial recognition model to review old knowledge while learning new knowledge through the sharing of identity features.

[0134] During the anti-forgetting training process, because the target image data acquired by each camera is processed independently and in a distributed manner, D h Historical identity tags under y h Since it cannot be directly and explicitly obtained, this embodiment of the invention uses cyclic matching to perform identity association, thereby processing D... c At time, it can be in D h Find the sample image that matches the current round. Corresponding historical identity tags Consider D h N h The individual N d The first set of historical identity features of dimensional For D c Applying historical identification model Φ h We obtain the first identity feature of the sample images in each current round. Since the set of sample images in a single camera scene has already been labeled with sample identity tags, we can perform an average pooling operation on the identity features of samples belonging to the same identity ID, and thus obtain D. c N d The first current identity feature set of the dimension After obtaining M c and M h Subsequently, identity knowledge association will use cyclic matching to mine the matching relationships between identity feature labels. If M c China represents y c The sample identity features and M h China represents y h If two identity features satisfy the following formula, they are said to satisfy a cyclic matching relationship. Thus, the found (y) c ,y h A pair is called a matching pair.

[0135]

[0136] In the cyclic matching expression, sim(f; M) represents calculating the cosine similarity between identity feature f and each identity feature in the identity feature set M. Vectors with higher matching degrees have higher cosine similarities. h Finding a matching vector in D indicates that in D c A new sample identity label has appeared, and its y is set. h =-1 to indicate distinction. And find D through loop matching. c and D h Shared identity information between them, thus enabling D c Determine historical identity tags y h , construct It is worth emphasizing that identity knowledge association does not require access to D. h Instead, it only requires analyzing the first historical identity feature set m. h The cyclic matching operation, compared with the original sample image set, has the advantages of lower dimensionality and no privacy issues in the identity feature set. It extracts y from identity knowledge association. c and y h After receiving the information, the subsequent training steps in the current round will enable adaptation to new knowledge and review of old knowledge.

[0137] Secondly, identity knowledge distillation is used to determine the historical recognition model Φ. h and in obtaining Afterwards, identity knowledge distillation was performed using y.c and y h To adapt to new data distributions and review historical knowledge, given sample images from the current round. and Φ h The parameters are initialized using weight parameters to define the initial recognition model Φ for the current round. c and through Φ c Extract Second identity characteristics Based on the first current identity feature set M c The ClusterNCE loss function is as follows:

[0138]

[0139] In the formula, is the current loss, i is the index of the sample image in the current round, and j is the index of the sample identity label in the current round. It is the first set of current identity features. It is the second identity feature of the sample images in the current round. It is the second identity feature of the sample image. The sample identity label number, τ is the temperature parameter, τ is used to represent the spacing between identity label classes, L c N is the number of sample images in the current round. c This represents the number of sample identity labels in the current round. Inspired by the clustercontrast method's update of the in-memory dictionary during model training, identity knowledge distillation also applies to M... c The update was performed as shown in the following formula, where the momentum parameter m = 0.1 controls the proportion of old and new features during the update process.

[0140]

[0141] At the same time, identity knowledge distillation also utilizes M h and historical identity tags The ClusterNCE loss is calculated to train the model, thereby enabling the review of old knowledge.

[0142]

[0143] The meaning of sgn(y) is that when y = -1, sgn(y) = 0, and in other cases, sgn(y) = 1. That is, if in M c and M h If no matching identity is found, then this loss term will not exist; therefore, identity knowledge distillation only needs to utilize... Learning new knowledge. This invention further proposes the knowledge distillation loss shown in the following formula. It is used to extract from the old model Φ h New model for refining Φ c The process can enhance the memory of old knowledge.

[0144]

[0145] In the formula, This is the parameter-constrained loss, where i is the index of the sample image in the current round, and L... c Φ is the number of sample images in the current round. c This is the initial recognition model for the current round, Φ h This is a historical recognition model. The meaning of sgn(y) is that when y = -1, sgn(y) = 0; otherwise, sgn(y) = 1. It is the sequence number of the historical identity tag of the sample image. This is the sample image for the current round.

[0146] The identity knowledge distillation method sums the loss functions derived above to obtain the joint loss function. as follows:

[0147]

[0148] Finally, there's the expansion of identity knowledge, when in the current round of D... c After training is completed, a new model Φ will be obtained. c Using the new model Φ c Extract D c The identity features of all sample images are analyzed, and the identity features corresponding to samples with the same identity label are averaged and grouped into one class, thus obtaining the second current identity feature set M. c Next, identity knowledge expansion will be carried out on M in the following manner. h To be updated and expanded.

[0149] If the second current identity feature set M c The sample identity label of a certain sample image in the sample is y. c In M h The middle can match a certain y h If the corresponding identity characteristics are the same, then the following formula can be used for M. h An update is performed, where λ = 0.25 can be used to balance the weights between the old and new data.

[0150]

[0151] If in M h If no matching historical identity features can be found, then the features are directly... Insert into M h The update has been completed in China and Israel.

[0152]

[0153] After the update is complete, the resulting M h This will be used for subsequent camera iterations and training, and will also require the current recognition model Φ. c Φ, as the historical recognition model for the next round of iteration training h This completes the final step in expanding identity knowledge.

[0154] To evaluate the recognition performance of the target re-identification model trained according to the embodiments of the present invention, the Market-CL dataset was obtained by improving the Market-1501 dataset, and research experiments were conducted on this improved dataset. Table 1 shows the experimental results of the embodiments of the present invention and other methods on the Market-CL dataset. It can be seen that the target re-identification model obtained by incremental training in the embodiments of the present invention has a significant effect on improving the accuracy of incremental target re-identification. When the IKE algorithm is combined with the SI algorithm, it can even achieve prediction results close to the theoretical upper limit.

[0155]

[0156] Table 1

[0157] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any transformations or substitutions that can be conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of the present invention.

[0158] The following describes the target re-identification model anti-forgetting training device and the target re-identification device provided by the present invention. The target re-identification model anti-forgetting training device described below and the target re-identification model anti-forgetting training method described above can be referred to in correspondence with each other, and the target re-identification device and the target re-identification method described above can be referred to in correspondence with each other.

[0159] Figure 7 This is a schematic diagram of the anti-forgetting training device for the target re-identification model provided by the present invention. Figure 7 As shown, the device includes: a determination module 710, a history association module 720, a training module 730, an update module 740, and an iteration module 750.

[0160] in,

[0161] The determination module 710 is used to determine the initial recognition model based on the historical recognition model;

[0162] The historical association module 720 is used to determine the first identity feature of the sample image based on the historical recognition model and the sample image of the current round; and to determine the first current identity feature set and the historical identity label of the sample image based on the first identity feature of the sample image, the sample identity label of the current round and the first historical identity feature set.

[0163] Training module 730 is used to train the initial recognition model based on sample images, historical identity labels of sample images, a first current identity feature set, and a first historical identity feature set to obtain the current recognition model;

[0164] The update module 740 is used to determine a second current identity feature set based on the current recognition model and by applying sample images, and to determine a second historical identity feature set based on the second current identity feature set and the first historical identity feature set.

[0165] The iteration module 750 is used to use the current recognition model as the historical recognition model and the second historical identity feature set as the first historical identity feature set for the next round of training iteration; and to use the current recognition model obtained after the iteration as the target re-recognition model.

[0166] The target re-identification model anti-forgetting training device provided in this embodiment of the invention includes: a determination module for determining an initial identification model based on a historical identification model; a historical association module for determining a first identity feature of a sample image based on the historical identification model and applying the sample image of the current round; and determining a first current identity feature set and a historical identity label of the sample image based on the first identity feature of the sample image, the sample identity label of the current round, and a first historical identity feature set; a training module for training the initial identification model based on the sample image, the historical identity label of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current identification model; and an update module. The system is used to determine a second current identity feature set based on the current recognition model and sample images, and to determine a second historical identity feature set based on the second current identity feature set and the first historical identity feature set. The iteration module is used to use the current recognition model as the historical recognition model and the second historical identity feature set as the first historical identity feature set for the next round of training iteration. The current recognition model obtained after the iteration is used as the target re-recognition model. This realizes that while learning new identity features during the training of the recognition model, historical identity features are reviewed at the same time. This can alleviate the problem of catastrophic forgetting caused by applying new data to train the recognition model and improve the recognition model's resistance to forgetting.

[0167] Based on any of the above embodiments, the training module 730 includes:

[0168] The second identity feature determination submodule is used to determine the second identity feature of the sample image based on the initial recognition model and by applying the sample image.

[0169] The loss determination submodule is used to determine the current loss based on the second identity feature and the first current identity feature set of the sample image, and to determine the historical loss based on the historical identity label of the sample image, the second identity feature and the first historical identity feature set of the sample image;

[0170] The joint loss determination submodule is used to determine the joint loss based on the current loss and the historical loss; and to update the first current identity feature set based on the second identity feature of the sample image and the sample identity label of the sample image;

[0171] The training submodule is used to iterate the parameters of the initial recognition model based on the joint loss until the joint loss converges, thus obtaining the current recognition model.

[0172] Based on any of the above embodiments, the joint loss determination submodule includes:

[0173] The parameter constraint loss calculation submodule is used to determine the 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 label of the sample image.

[0174] The joint loss calculation submodule is used to determine the joint loss based on the current loss, historical loss, and parameter constraint loss.

[0175] Based on any of the above embodiments, the historical association module 720 includes:

[0176] The mapping submodule is used to determine the identity features corresponding to the sample identity labels based on the sample identity labels and the first identity features of the sample image;

[0177] The identity set determination submodule is used to determine the first current identity feature set based on the sample identity label and the identity features corresponding to the sample identity label;

[0178] The loop matching submodule is used to perform loop matching between each identity feature in the first current identity feature set and each identity feature in the first historical identity feature set to obtain identity tag matching pairs and the matching degree of identity tag matching pairs.

[0179] The historical label determination submodule is used to determine the historical label corresponding to the sample identity label as the default label if the matching degree of the identity label matching pair is less than a preset similarity threshold; otherwise, it determines the historical identity label corresponding to the sample identity label based on the identity feature matching pair.

[0180] Based on any of the above embodiments, the update module 740 includes:

[0181] The second feature determination submodule is used to determine the second identity features of the sample image based on the current recognition model and by applying the sample image.

[0182] The mean feature determination submodule is used to determine the mean identity feature corresponding to the sample identity label based on the sample identity label and the second identity feature of the sample image;

[0183] The second identity set determination submodule is used to determine the second current identity feature set based on the sample identity label and the mean identity feature corresponding to the sample identity label;

[0184] The second historical set determination submodule is used to determine the second historical identity feature set based on the second current identity feature set and the first historical identity feature set.

[0185] Figure 8 This is a schematic diagram of the target re-identification device provided by the present invention. Figure 8 As shown, the device includes a determination module 810 and an identification module 820.

[0186] in,

[0187] The determination module 810 is used to determine the image to be recognized;

[0188] The recognition module 820 inputs the image to be recognized into the target re-recognition model, obtains the identity features output by the target re-recognition model, and determines the recognition result based on the identity features;

[0189] The target re-identification model is trained based on the target re-identification model anti-forgetting training method provided in any of the above embodiments.

[0190] The target re-identification device provided in this embodiment of the invention includes a determination module for determining the image to be identified; and an identification module for inputting the image to be identified into the target re-identification model to obtain the identity features output by the target re-identification model, and determining the identification result based on the identity features. The target re-identification model is trained based on the anti-forgetting training method of the target re-identification model provided in any of the above embodiments, which enables the trained target identification model to better identify the images to be identified captured by each camera device in the monitoring network, thereby improving the performance of the target re-identification model and thus improving the identification accuracy of the target re-identification model.

[0191] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a target re-identification model anti-forgetting training method or a target re-identification method. The target re-identification model anti-forgetting training method includes: determining an initial identification model based on a historical identification model; determining a first identity feature of a sample image by applying the current round of sample images based on the historical identification model; determining a first current identity feature set and a historical identity label of the sample image based on the first identity feature of the sample image, the current round of sample identity labels, and a first historical identity feature set; training the initial identification model based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain a current identification model; determining a second current identity feature set by applying sample images based on the current identification model, and determining a second historical identity feature set based on the second current identity feature set and the first historical identity feature set; using the current identification model as a historical identification model and the second historical identity feature set as a first historical identity feature set for the next round of training iterations; and using the current identification model obtained after the iterations as the target re-identification model. The target re-identification method includes: determining the image to be identified; inputting the image to be identified into the target re-identification model to obtain the identity features output by the target re-identification model, and determining the identification result based on the identity features; the target re-identification model is trained based on the target re-identification model anti-forgetting training method provided in any of the above embodiments.

[0192] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0193] On the other hand, the present invention also provides a computer program product, which includes a computer program that 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 target re-identification model anti-forgetting training method or the target re-identification method provided by the above methods. The target re-identification model anti-forgetting training method includes: determining an initial identification model based on a historical identification model; determining a first identity feature of a sample image based on the historical identification model and applying the sample image of the current round; determining a first current identity feature set and a historical identity label of the sample image based on the first identity feature of the sample image, the sample identity label of the current round, and the first historical identity feature set; training the initial identification model based on the sample image, the historical identity label of the sample image, the first current identity feature set, and the first historical identity feature set to obtain a current identification model; determining a second current identity feature set based on the current identification model and 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; using the current identification model as a historical identification model and the second historical identity feature set as a first historical identity feature set for the next round of training iteration; and using the current identification model obtained after iteration as a target re-identification model. The target re-identification method includes: determining the image to be identified; inputting the image to be identified into the target re-identification model to obtain the identity features output by the target re-identification model, and determining the identification result based on the identity features; the target re-identification model is trained based on the target re-identification model anti-forgetting training method provided in any of the above embodiments.

[0194] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the target re-identification model anti-forgetting training method or the target re-identification method provided by the above methods. The target re-identification model anti-forgetting training method includes: determining an initial identification model based on a historical identification model; determining a first identity feature of a sample image based on the historical identification model and applying the sample image of the current round; determining a first current identity feature set and a historical identity label of the sample image based on the first identity feature of the sample image, the sample identity label of the current round, and a first historical identity feature set; training the initial identification model based on the sample image, the historical identity label of the sample image, the first current identity feature set, and the first historical identity feature set to obtain a current identification model; determining a second current identity feature set based on the current identification model and 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; using the current identification model as a historical identification model and the second historical identity feature set as a first historical identity feature set for the next round of training iteration; and using the current identification model obtained after the iteration as the target re-identification model. The target re-identification method includes: determining the image to be identified; inputting the image to be identified into the target re-identification model to obtain the identity features output by the target re-identification model, and determining the identification result based on the identity features; the target re-identification model is trained based on the target re-identification model anti-forgetting training method provided in any of the above embodiments.

[0195] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0196] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for training a target re-identification model to resist forgetting, characterized in that, include: Based on historical identification models, determine the initial identification model; Based on the historical recognition model, the first identity feature of the sample image is determined by applying the sample image of the current round; Based on the first identity feature of the sample image, the sample identity label of the current round, and the first historical identity feature set, the first current identity feature set and the historical identity label of the sample image are determined. The initial recognition model is trained based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model; Based on the current recognition model, the sample image is applied to determine a second current identity feature set, and based on the second current identity feature set and the first historical identity feature set, a second historical identity feature set is determined. The current recognition model is used as the historical recognition model, and the second set of historical identity features is used as the first set of historical identity features for the next training iteration; The current recognition model obtained after iteration is used as the target re-recognition model; The process of training the initial recognition model based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model includes: Based on the initial recognition model, the sample image is applied to determine the second identity feature of the sample image; Based on the second identity feature of the sample image and the first current identity feature set, the current loss is determined, and based on the historical identity label of the sample image, the second identity feature of the sample image and the first historical identity feature set, the historical loss is determined. Based on the current loss and the historical loss, a joint loss is determined; and the first current identity feature set is updated based on the second identity feature of the sample image and the sample identity label of the sample image. Based on the joint loss, the parameters of the initial recognition model are iterated until the joint loss converges to obtain the current recognition model; The step of determining the first current identity feature set and the historical identity label of the sample image based on the first identity feature of the sample image, the sample identity label of the current round, and the first historical identity feature set includes: Based on the sample identity label and the first identity feature of the sample image, determine the identity feature corresponding to the sample identity label; Based on the sample identity label and the identity features corresponding to the sample identity label, the first current identity feature set is determined; Each identity feature in the first current identity feature set is cyclically matched with each identity feature in the first historical identity feature set to obtain identity tag matching pairs and the matching degree of identity tag matching pairs; If the matching degree of the identity tag matching pair is less than the preset similarity threshold, then the historical identity tag corresponding to the sample identity tag is the default tag; otherwise, the historical identity tag corresponding to the sample identity tag is determined based on the identity feature matching pair.

2. The anti-forgetting training method for the target re-identification model according to claim 1, characterized in that, The determination of joint loss based on the current loss and the historical loss includes: Based on the second identity feature of the sample image, the first identity feature of the sample image, and the historical identity label of the sample image, determine the parameter constraint loss; The joint loss is determined based on the current loss, the historical loss, and the parameter constraint loss.

3. The anti-forgetting training method for the target re-identification model according to claim 1, characterized in that, The step of determining a second current identity feature set based on the current recognition model and 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, includes: Based on the current recognition model, the sample image is applied to determine the second identity feature of the sample image; Based on the sample identity label and the second identity feature of the sample image, determine the mean identity feature corresponding to the sample identity label; Based on the sample identity label and the mean identity feature corresponding to the sample identity label, the second current identity feature set is determined; The second set of historical identity features is determined based on the second current identity feature set and the first set of historical identity features.

4. A target re-identification method, characterized in that, include: Identify the image to be recognized; The image to be identified is input into the target re-identification model to obtain the identity features output by the target re-identification model, and the identification result is determined based on the identity features; The target re-identification model is trained based on the target re-identification model anti-forgetting training method according to any one of claims 1 to 3.

5. A forgetting-resistant training device for a target re-identification model, characterized in that, include: The determination module is used to determine the initial recognition model based on the historical recognition model; The historical association module is used to determine the first identity feature of the sample image based on the historical recognition model and the sample image of the current round. Based on the first identity feature of the sample image, the sample identity label of the current round, and the first historical identity feature set, the first current identity feature set and the historical identity label of the sample image are determined. The training module is used to train the initial recognition model based on the sample image, the historical identity labels of the sample image, the first current identity feature set, and the first historical identity feature set to obtain the current recognition model; The update module is used to determine a second current identity feature set based on the current recognition model and the sample image, and to determine a second historical identity feature set based on the second current identity feature set and the first historical identity feature set; An iteration module is used to use the current recognition model as the historical recognition model, and to use the second historical identity feature set as the first historical identity feature set for the next round of training iteration; and to use the current recognition model obtained after the iteration as the target re-recognition model; The training module is specifically used for: Based on the initial recognition model, the sample image is applied to determine the second identity feature of the sample image; Based on the second identity feature of the sample image and the first current identity feature set, the current loss is determined, and based on the historical identity label of the sample image, the second identity feature of the sample image and the first historical identity feature set, the historical loss is determined. Based on the current loss and the historical loss, a joint loss is determined; and the first current identity feature set is updated based on the second identity feature of the sample image and the sample identity label of the sample image. Based on the joint loss, the parameters of the initial recognition model are iterated until the joint loss converges to obtain the current recognition model; The historical association module is specifically used for: Based on the sample identity label and the first identity feature of the sample image, determine the identity feature corresponding to the sample identity label; Based on the sample identity label and the identity features corresponding to the sample identity label, the first current identity feature set is determined; Each identity feature in the first current identity feature set is cyclically matched with each identity feature in the first historical identity feature set to obtain identity tag matching pairs and the matching degree of identity tag matching pairs; If the matching degree of the identity tag matching pair is less than the preset similarity threshold, then the historical identity tag corresponding to the sample identity tag is the default tag; otherwise, the historical identity tag corresponding to the sample identity tag is determined based on the identity feature matching pair.

6. A target re-identification device, characterized in that, include: The determination module is used to determine the image to be recognized; The recognition module inputs the image to be recognized into the target re-recognition model, obtains the identity features output by the target re-recognition model, and determines the recognition result based on the identity features; The target re-identification model is trained based on the target re-identification 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 in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the anti-forgetting training method for the target re-identification model as described in any one of claims 1 to 3, or implements the target re-identification method as described in claim 4.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the target re-identification model anti-forgetting training method as described in any one of claims 1 to 3, or implements the target re-identification method as described in claim 4.