A target re-identification model training method, a target re-identification method, and related devices thereof

By extracting global and local features from the target re-identification model and training a classifier, combined with normalization, the model's ability to recognize images taken by different cameras is improved, solving the problem of poor recognition performance of the target re-identification model under environmental factors.

CN116109894BActive Publication Date: 2026-05-15ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2022-12-30
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

The target re-identification model performs poorly under the influence of factors such as changes in target angle and distance, and occlusion in the camera view.

Method used

By utilizing the feature extraction network of the target re-identification model to extract global and local features from sample images, training the classifier and adjusting its parameters, and combining batch normalization and individual pixel normalization, the model's recognition ability is improved.

Benefits of technology

The model's adaptability to images captured by different cameras has been enhanced, improving the accuracy and robustness of target re-identification and reducing interference from environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116109894B_ABST
    Figure CN116109894B_ABST
Patent Text Reader

Abstract

The application discloses a target re-identification model training method, a target re-identification method and related devices thereof. The training method comprises: using a feature extraction network of a target re-identification model to extract features of sample images captured by different cameras to obtain global features and local features of samples in the sample images; using a training set to train at least one classifier included in the target re-identification model to obtain reference balance parameters of each classifier; using a test set and the reference balance parameters to test each trained classifier to obtain test results of each classifier; updating parameters of each classifier based on the test results of each classifier to obtain each target classifier; using each target classifier to identify the global features and the local features of the samples to obtain a first identification result; and adjusting parameters of the feature extraction network and each target classifier based on the first identification result. In this way, the application can improve the identification capability of the target re-identification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of target recognition technology, and in particular to a target re-identification model training method, a target re-identification method, and related apparatus. Background Technology

[0002] Target re-identification has a wide range of applications, such as in security monitoring, where it can accurately locate a specific target in densely populated areas or among multiple cameras, thereby obtaining the target's overall movement trajectory information at different times and locations. However, due to limitations such as changes in the target's angle and distance within the camera's view, as well as occlusion, the effectiveness of target re-identification is relatively poor. Summary of the Invention

[0003] The main technical problem addressed in this application is to provide a target re-identification model training method, a target re-identification method, and related apparatus, which can improve the recognition capability of the target re-identification model.

[0004] To address the aforementioned technical problems, the first aspect of this application provides a method for training a target re-identification model. This method includes: using a feature extraction network of the target re-identification model to extract features from sample images captured by different cameras, obtaining global and local features of the samples in the sample images; training at least one classifier included in the target re-identification model using a training set to obtain reference balance parameters for each classifier; and testing each trained classifier using a test set and the reference balance parameters to obtain test results for each classifier; wherein both the training set and the test set contain global features and at least some local features of the samples, and each classifier corresponds one-to-one with a camera; updating the parameters of each classifier based on the test results of each classifier to obtain each target classifier; using each target classifier to identify the global and local features of the samples to obtain a first identification result for the sample image; and adjusting the parameters of the feature extraction network and each target classifier based on the first identification result.

[0005] To address the aforementioned technical problems, a second aspect of this application provides a target re-identification method. This method includes: acquiring several target images; wherein the target images are captured by different cameras; extracting features from the several target images using a feature extraction network of a target re-identification model to obtain global and local features of the targets in the several target images; and recognizing the global and local features of the targets using each target classifier of the target re-identification model to obtain target recognition results for each of the several target images; wherein the target re-identification model is a target re-identification model trained using the method provided in the first aspect above.

[0006] To address the aforementioned technical problems, a third aspect of this application provides an electronic device comprising a memory and a processor coupled to each other, the memory storing program instructions; the processor executing the program instructions stored in the memory to implement the training method of the target re-identification model provided in the first aspect, or to implement the target re-identification method provided in the second aspect.

[0007] To address the aforementioned technical problems, a fourth aspect of this application provides a computer-readable storage medium for storing program instructions that can be executed to implement the training method of the target re-identification model provided in the first aspect, or to implement the target re-identification method provided in the second aspect.

[0008] The beneficial effects of this application are as follows: Unlike existing technologies, this application utilizes the feature extraction network of a target re-identification model to extract features from sample images captured by different cameras, obtaining global and local features of the samples in the sample images; it trains at least one classifier included in the target re-identification model using a training set to obtain reference balance parameters for each classifier; and it tests each trained classifier using a test set and the reference balance parameters to obtain test results for each classifier; wherein both the training set and the test set contain global features and at least some local features of the samples, and each classifier corresponds one-to-one with a camera; based on the test results of each classifier, the parameters of each classifier are updated to obtain each target classifier; each target classifier is used to identify the global and local features of the samples to obtain a first identification result for the sample image; based on the first identification result, the parameters of the feature extraction network and each target classifier are adjusted. By setting up multiple classifiers, each corresponding to a camera, and training each classifier, the adaptability of each classifier to image features of different styles is improved. Furthermore, by adjusting the parameters of the feature extraction network and multiple target classifiers, a single classifier can adapt to the features of images captured by its corresponding camera while also having the ability to generalize the features of the target in other scenes, thereby improving the recognition ability of the target re-identification model. Attached Figure Description

[0009] Figure 1 This is a flowchart illustrating the first embodiment of the training method for the target re-identification model provided in this application;

[0010] Figure 2 This is a flowchart illustrating step S12 of the first embodiment of the training method for the target re-identification model provided in this application.

[0011] Figure 3 This is a flowchart illustrating the second embodiment of the training method for the target re-identification model provided in this application;

[0012] Figure 4This is a flowchart illustrating one implementation of the target re-identification method provided in this application;

[0013] Figure 5 This is a schematic diagram of the framework structure of one embodiment of the electronic device provided in this application;

[0014] Figure 6 This is a schematic diagram of a framework of one embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0016] It should be noted that the embodiments of this application contain descriptions involving "first," "second," etc., which are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.

[0017] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0018] Please see Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the training method for the target re-identification model provided in this application. The method includes:

[0019] S11: Use the feature extraction network of the target re-identification model to extract features from sample images captured by different cameras, and obtain the global and local features of the samples in the sample images.

[0020] In one embodiment, the feature extraction network can be any deep neural network, such as the HRNet network, which is mainly used for human pose recognition. Understandably, the feature extraction network can also be other networks, without being specifically limited here.

[0021] In real life, targets (such as pedestrians and vehicles) are moving and can appear in the field of view of different cameras. Therefore, the same target can appear in images taken by different cameras or in multiple images taken by the same camera.

[0022] In one embodiment, the number of sample images can be multiple, and each sample image contains at least one sample, which is the target to be identified. A feature extraction network is used to extract global and local features from each sample image. Global features are all features of the sample, while local features are features of a specific region of the sample. For example, if the sample is a vehicle, the global features are the features of the entire vehicle, and the local features are, for example, the features of the front of the vehicle. By extracting local features, the target re-identification model is trained, enabling the model to classify targets even when they are occluded in the image.

[0023] S12: Train at least one classifier in the target re-identification model using the training set to obtain the reference balance parameters of each classifier; and test each trained classifier using the test set and the reference balance parameters to obtain the test results of each classifier.

[0024] In this system, both the training and test sets contain global features and at least some local features of the samples, and each classifier corresponds one-to-one with a camera. In one specific implementation, the training set includes several first fused features obtained by randomly fusing global features and some local features; the test set includes several second fused features obtained by randomly fusing global features and local features other than some local features. The number of classifiers is the same as the number of cameras, and each camera can be applied to different scenes. Each classifier is connected to a feature extraction network, meaning that the classifiers share the same feature extraction network. By having multiple classifiers share the same feature extraction network, a single camera can adapt to the target features in its own scene while also possessing the ability to generalize the target's features in other scenes. In the target re-identification task, each classifier functions similarly to a clustering algorithm, merging targets with the same features into the same ID. However, since some targets have significant feature differences across different cameras, to ensure that the features of the same target across different cameras can be assigned to one ID, and to avoid incorrectly assigning different targets to the same ID, this application employs a meta-learning approach to solve this problem.

[0025] Batch normalization and instance normalization are two commonly used normalization methods. Batch normalization ensures the consistency of data distribution, making features within the same domain closely distributed. Its drawback is that it makes it difficult to integrate features from other domains. Instance normalization, on the other hand, has the opposite advantage: it can eliminate the style of individual domains but struggles to distinguish between different domains. Here, a domain represents the target; features belonging to the same ID belong to the same domain. This application combines batch normalization and instance normalization, training balanced parameters through meta-learning to achieve a balance between the two normalization methods and improve the model's generalization ability.

[0026] In one embodiment, to improve the generalization ability of the feature extraction network in each classifier, the training process of each classifier is treated as an independent training task, and the feature extraction network is added for end-to-end training to improve the discrimination ability in different environments. For each classifier, training is performed using a training set. Specifically, the first sample features of the training samples in the training set are obtained. The first sample features are at least one of the global features, local features, or fused features of the samples. A first loss and a second loss are determined based on a first distance between the first sample features and a first positive sample feature, and a second distance between the first sample features and a first negative sample feature. The first positive sample feature and the first sample feature belong to the same training sample, while the first negative sample feature and the first sample feature belong to different training samples. A third loss is determined based on the similarity between the first sample feature and the mean of the first sample features. The mean of the first sample features is the average value of the first sample features belonging to the same training sample. The parameters of the classifier are adjusted using the sum of the first loss, the second loss, and the third loss to obtain reference balance parameters.

[0027] After determining the reference balance parameter, the loss and gradient are calculated using the test set and the reference balance parameter to obtain the test results. The test results can be the loss based on the test distance difference, which is the difference between the distance between the sample features and positive sample features of the test sample and the distance between the sample features and negative sample features of the test sample.

[0028] S13: Based on the test results of each classifier, update the parameters of each classifier to obtain each target classifier.

[0029] In one implementation, the test result is the loss obtained based on the test distance difference. Then, based on the classifier's test result and its initial balance parameters, a target balance parameter is determined. Replacing the initial balance parameter with the target balance parameter yields the target classifier. Specifically, the partial derivative of the loss obtained based on the test distance difference can be multiplied by a first preset parameter to obtain a first value. The first preset parameter is the learning rate, which in one implementation can be set to 0.001. Subtracting the first value from the initial balance parameter yields the target balance parameter. The target balance parameter can be calculated using the following formula.

[0030]

[0031] Where, θ p Let θ be the target equilibrium parameter. p1 Let L be the initial equilibrium parameter, β be the first preset parameter, and L be the initial equilibrium parameter. tr (X T ;θ' p θ' is the loss obtained based on the test distance difference. p For reference equilibrium parameters, X T This represents the test samples in the test set.

[0032] S14: Use each target classifier to identify the global and local features of the sample to obtain the first recognition result of the sample image.

[0033] In one implementation, the test set and training set are combined to form a full dataset. Each target classifier is used to identify the global and local features of each sample in the full dataset, resulting in a first identification result for several sample images. The first identification result may be the ID of the sample in the sample image.

[0034] S15: Based on the first recognition result, adjust the parameters of the feature extraction network and each target classifier.

[0035] Specifically, the parameters of the feature extraction network and all target classifiers can be fine-tuned using the test set and training set. Each sample image in the test set and training set can be labeled with a first annotation result, which can be the ID of the sample in that sample image. Based on the difference between the first recognition result obtained by each target classifier and the first annotation result of the sample image, a fourth loss for each target classifier is obtained, which can be the cross-entropy loss. The fourth losses of all classifiers are summed to obtain a second total loss. The parameters of the feature extraction network and each target classifier are adjusted using the second total loss.

[0036] The above method utilizes the feature extraction network of the target re-identification model to extract features from sample images captured by different cameras, obtaining the global and local features of the samples in the sample images; it trains at least one classifier included in the target re-identification model using a training set to obtain reference balance parameters for each classifier; and it tests each trained classifier using a test set and the reference balance parameters to obtain the test results for each classifier; wherein both the training set and the test set contain the global features and at least some local features of the samples, and the classifiers correspond one-to-one with the cameras; based on the test results of each classifier, the parameters of each classifier are updated to obtain each target classifier; each target classifier is used to identify the global and local features of the samples to obtain the first recognition result of the sample image; based on the first recognition result, the parameters of the feature extraction network and each target classifier are adjusted. By setting up multiple classifiers, each corresponding to a camera, and training each classifier, the adaptability of each classifier to image features of different styles is improved. Furthermore, by adjusting the parameters of the feature extraction network and multiple target classifiers, a single classifier can adapt to the features of images captured by its corresponding camera while also having the ability to generalize the features of the target in other scenes, thereby improving the recognition ability of the target re-identification model.

[0037] Please see Figure 2 , Figure 2 This is a flowchart illustrating step S12 of the first embodiment of the training method for the target re-identification model provided in this application. The method involves training at least one classifier included in the target re-identification model using a training set to obtain reference balance parameters for each classifier; and then testing each trained classifier using a test set and the reference balance parameters to obtain the test results for each classifier, which may include:

[0038] S121: Obtain the first sample feature of the training samples in the training set.

[0039] In one embodiment, the first sample feature is at least one of the global features, local features, or fused features of the training sample.

[0040] S122: Determine the first loss and the second loss based on the first distance between the first sample feature and the first positive sample feature, and the second distance between the first sample feature and the first negative sample feature.

[0041] In this context, the first positive sample feature and the first sample feature belong to the same training sample, i.e., the same ID, while the first negative sample feature and the first sample feature belong to different training samples. Understandably, the first positive sample feature and the first negative sample feature can be randomly obtained.

[0042] In one embodiment, a first difference between the first distance and the second distance can be calculated, and the first difference and a second preset parameter can be summed to obtain a second value; wherein, the second preset parameter is a hyperparameter, and in a specific embodiment, the hyperparameter can be set to 0.2. Understandably, the user can adjust the second preset parameter as needed. Since the loss is generally a positive number, it can be determined whether the second value is greater than zero. If the second value is greater than zero, the second value is used as the first distance difference corresponding to the training sample; if the second value is less than zero, zero is used as the first distance difference corresponding to the training sample. The first loss is obtained by averaging the first distance differences corresponding to each training sample in the training set. Specifically, the calculation method of the first loss can refer to the following formula.

[0043]

[0044] Among them, L tr (X S ;θ) is the first loss, The first sample feature of the training samples, Features of the first positive sample The first negative sample feature is α, the second preset parameter is d(·,·), and N is the Euclidean distance. S This represents the number of training samples in a batch, i.e., the number of training samples in a single batch.

[0045] In one embodiment, a second difference between the second distance and the first distance is calculated, and a third value is obtained using the second difference and an exponential function; the third value and a third preset parameter are summed to obtain a fourth value; the fourth value and a logarithmic function are used to obtain the second distance difference corresponding to the training samples; the average of the second distance differences corresponding to each training sample in the training set is calculated to obtain the second loss. Specifically, the calculation method of the second loss can refer to the following formula.

[0046]

[0047] Among them, L shuf (X S ;θ) is the second loss, The first sample feature of the training samples, Features of the first positive sample The first negative sample feature is represented by 1, and the third preset parameter is N. S d is the number of training samples in the batch, and d(·,·) is the Euclidean distance.

[0048] S123: Determine the third loss based on the similarity between the first sample features and the mean of the first sample features.

[0049] In one implementation, the third similarity is cosine similarity, and the mean of the first sample features is the average of the first sample features belonging to the same training sample. Specifically, the third loss can be obtained using the following formula.

[0050]

[0051] Among them, L scat (X S ;θ) is the third loss, K is the number of samples in a batch, i.e., the number of regions in a batch, N S The number of training samples in a batch. Features of the first sample The mean of the features of the first sample.

[0052] S124: Adjust the classifier parameters using the sum of the first loss, second loss, and third loss, and obtain the reference balance parameters.

[0053] In one embodiment, after obtaining the first loss, second loss, and third loss, the sum of the first loss, second loss, and third loss is calculated to obtain the first total loss; the parameters of the classifier are then adjusted using the first total loss. In a specific embodiment, the parameters of the classifier also include an initial balancing parameter, which can be obtained after pre-training the classifier. A reference balancing parameter is obtained based on the initial balancing parameter and the first total loss. The product of the partial derivative of the first total loss and a first preset parameter is used as a fifth value. The reference balancing parameter is obtained by subtracting the fifth value from the initial balancing parameter. Here, the first preset parameter is the learning rate, which can be set to 0.001. After obtaining the reference balancing parameter, the initial balancing parameter of the classifier is not updated using the reference balancing parameter. Instead, the reference balancing parameter is saved as an empirical value for use when testing the classifier.

[0054] In this embodiment, the first loss is the triplet loss. To bias the balancing parameters towards batch normalization, this triplet loss is introduced to reduce the distance between sample features within a domain. The closer a sample feature is to a positive sample feature, the smaller the first loss. The second loss is used to reduce the distance between sample features in different domains. The closer a sample feature is to a negative sample feature, the smaller the second loss. By introducing this loss, the distance between domains is reduced, and style normalization is achieved. The third loss is used to separate sample features within the same domain. The smaller the similarity between a sample feature and its mean, the smaller the third loss value, thus achieving the separation of sample features within the same domain. Understandably, in this embodiment, the closer each loss value is to 0, the better the classification performance of the classifier.

[0055] This implementation optimizes the training of the balancing parameters to obtain reference balancing parameters. This allows the normalization layer to combine the advantages of batch normalization and single-pixel normalization, thereby improving the classifier's adaptability to different styles and environmental factors. Furthermore, by performing domain generalization on the classifiers in a single branch and then integrating and training all classifiers based on parameter fine-tuning, the discriminative power of features in each camera can be effectively improved. This reduces the interference of complex environments such as overexposure and occlusion, as well as camera angle differences, on the target, ensuring robustness while enhancing the domain generalization between multiple classifiers and improving the cross-camera target re-identification capability of the target re-identification model.

[0056] Please see Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of the training method for the target re-identification model provided in this application. The method includes:

[0057] S31: Use the feature extraction network of the target re-identification model to extract features from sample images captured by different cameras, and obtain the global and local features of the samples in the sample images.

[0058] S32: Pre-train the feature extraction network and at least one classifier using a pre-training set.

[0059] In one implementation, if the feature extraction network and classifier in the target re-identification model do not have the ability to extract and classify features, then the feature extraction network and classifier can be pre-trained to enable them to have the corresponding capabilities.

[0060] Specifically, a feature extraction network and a classifier are combined to obtain multiple target re-identification sub-models; that is, each target re-identification sub-model contains a feature extraction network and a classifier. For each target re-identification sub-model, the global and local features of the pre-training samples in the pre-training set are identified to obtain a second identification result of the pre-training sample image. Based on the difference between the second identification result and the second annotation result of the pre-training sample image, a fifth loss is obtained. The fifth loss can specifically be the cross-entropy loss, and the second annotation result can be the ID to which the pre-training sample in the pre-training sample image belongs. The sixth loss is determined based on the third distance between the second sample feature and the second positive sample feature of the pre-training samples, and the fourth distance between the second sample feature and the second negative sample feature. The second positive sample feature and the second sample feature belong to the same pre-training sample, while the second negative sample feature and the second sample feature belong to different pre-training samples. Specifically, the sum of the difference between the third and fourth distances and the second preset parameter is calculated. The maximum value between the sum of the difference between the third and fourth distances and the second preset parameter and zero is selected as the distance difference corresponding to the pre-training sample. The sixth loss is obtained by averaging the distance differences corresponding to all pre-training samples in the pre-training set. The parameters of the target re-identification sub-model are adjusted based on the sum of the fifth and sixth losses.

[0061] In this embodiment, the calculation method for the sixth loss is the same as that for the first loss. For details, please refer to the calculation method for the first loss, which will not be repeated here.

[0062] In one implementation, the pre-training set can be the training set, and the pre-training samples can be training samples from the training set. In this case, the sixth loss can be the same as the first loss. It is understood that in other implementations, the pre-training set may also be different from the training set.

[0063] S33: Train each pre-trained classifier using the training set to obtain the reference balance parameters for each classifier; and test each trained classifier using the test set and the reference balance parameters to obtain the test results for each classifier.

[0064] S34: Based on the test results of each classifier, update the parameters of each classifier to obtain each target classifier.

[0065] S35: Use each target classifier to identify the global and local features of the sample to obtain the first recognition result of the sample image.

[0066] S36: Based on the first recognition result, adjust the parameters of the pre-trained feature extraction network and each target classifier.

[0067] The specific implementation methods of steps S31, S33-S36 are the same as steps S11-S15 of the first implementation method of the target re-identification model training method provided in this application, and will not be repeated here.

[0068] Please see Figure 4 , Figure 4 This is a flowchart illustrating an embodiment of the target re-identification method provided in this application. The method includes:

[0069] S41: Acquire several target images.

[0070] The target images are captured by different cameras. Each target image may contain at least one target, and the same target may appear in different target images.

[0071] S42: Use the feature extraction network of the target re-identification model to extract features from several target images to obtain the global and local features of the targets in the several target images.

[0072] S43: Using the target re-identification model, each target classifier identifies the global and local features of the target, and obtains the target recognition results for several target images.

[0073] The target re-identification model is a target re-identification model trained using the training method described above.

[0074] In one embodiment, each target classifier corresponds to a camera. Each target classifier can identify the global and local features of each target in the target image captured by the corresponding camera, obtaining the recognition result for each feature. The recognition result can represent the ID of the target to which the feature belongs. By using the target recognition results obtained from each target classifier, information belonging to the same ID can be obtained.

[0075] Please see Figure 5 , Figure 5 This is a schematic diagram of the framework structure of one embodiment of the electronic device provided in this application.

[0076] The electronic device 50 includes a memory 51 and a processor 52 coupled to each other. The memory 51 stores program instructions, and the processor 52 executes the program instructions stored in the memory 51 to implement the steps of any of the above-described text recognition model training method implementations, or to implement the steps of the above-described text recognition method implementations. In a specific implementation scenario, the electronic device 50 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 50 may also include mobile devices such as laptops and tablets, which are not limited here.

[0077] Specifically, processor 52 controls itself and memory 51 to implement the steps of any of the above-described method embodiments. Processor 52 may also be referred to as a CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 52 may be implemented using integrated circuit chips.

[0078] Please see Figure 6 , Figure 6 This is a schematic diagram of a framework of one embodiment of the computer-readable storage medium provided in this application.

[0079] The computer-readable storage medium 60 stores program instructions 61, which, when executed by a processor, are used to implement the steps of any of the above-described text recognition model training method implementations, or to implement the steps of the above-described text recognition method implementations.

[0080] The computer-readable storage medium 60 may specifically be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or a medium capable of storing computer programs. Alternatively, it may be a server storing the computer program, which can send the stored computer program to other devices for execution or can also execute the stored computer program itself.

[0081] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0082] The above are merely embodiments of this application and do not limit the scope of this patent application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A training method for a target re-identification model, characterized in that, include: The feature extraction network of the target re-identification model is used to extract features from sample images captured by different cameras to obtain the global and local features of the samples in the sample images; The target re-identification model is trained using a training set to obtain reference balance parameters for each classifier. The trained classifiers are then tested using a test set and the reference balancing parameters to obtain test results for each classifier. Both the training set and the test set contain global features and at least some local features of the samples. Each classifier corresponds one-to-one with a camera. The training set includes a first fused feature obtained by randomly fusing the global features and some of the local features. The test set includes a second fused feature obtained by randomly fusing the global features and local features other than some of the local features. The test result is a loss based on the test distance difference, which is the difference between the distance between the sample features and positive sample features of the test sample and the distance between the sample features and negative sample features of the test sample. Based on the test results of each classifier, the parameters of each classifier are updated to obtain each target classifier, including: for each classifier, determining the target balance parameter based on the test results of the classifier and the initial balance parameter of the classifier; replacing the initial balance parameter with the target balance parameter to obtain the target classifier; The global and local features of the sample are identified using the target classifiers to obtain the first recognition result of the sample image; Based on the first recognition result, the parameters of the feature extraction network and each of the target classifiers are adjusted.

2. The method according to claim 1, characterized in that, The step of training at least one classifier in the target re-identification model using a training set to obtain reference balance parameters for each classifier includes: For each classifier, the first sample feature of the training samples in the training set is obtained. The first sample feature is at least one of the global feature, the local feature, or the fusion feature of the sample. A first loss and a second loss are determined based on a first distance between the first sample feature and the first positive sample feature, and a second distance between the first sample feature and the first negative sample feature; wherein the first positive sample feature and the first sample feature belong to the same training sample, and the first negative sample feature and the first sample feature belong to different training samples; A third loss is determined based on the similarity between the first sample feature and the mean of the first sample feature; wherein the mean of the first sample feature is the average value of the first sample features belonging to the same training sample; The parameters of the classifier are adjusted by using the sum of the first loss, the second loss, and the third loss, and the reference balance parameters are obtained.

3. The method according to claim 2, characterized in that, The determination of the first loss and the second loss based on the first distance between the first sample feature and the first positive sample feature, and the second distance between the first sample feature and the first negative sample feature, includes: Calculate the first difference between the first distance and the second distance, and sum the first difference with the second preset parameter to obtain a second value; and calculate the second difference between the second distance and the first distance, and use the second difference and an exponential function to obtain a third value; In response to the second value being greater than zero, the second value is used as the first distance difference corresponding to the training sample; In response to the second value being less than zero, zero is taken as the first distance difference corresponding to the training sample; The first loss is obtained by averaging the first distance differences corresponding to each training sample in the training set. The fourth value is obtained by summing the third value and the third preset parameter; Using the fourth numerical value and the logarithmic function, the second distance difference corresponding to the training sample is obtained; The second loss is obtained by averaging the second distance differences corresponding to each training sample in the training set.

4. The method according to claim 1, characterized in that, The step of adjusting the parameters of the feature extraction network and each of the classifiers based on the first recognition result includes: Based on the difference between the first recognition result obtained by each of the target classifiers and the first annotation result of the sample image, the fourth loss of each of the target classifiers is obtained; The second total loss is obtained by summing the fourth losses of each of the target classifiers. Based on the second total loss, the parameters of the feature extraction network and each of the classifiers are adjusted.

5. The method according to claim 1, characterized in that, Before training at least one classifier included in the target re-identification model using the training set to obtain reference balance parameters for each classifier, the method further includes: The feature extraction network and the at least one classifier are pre-trained using a pre-training set; The step of training at least one classifier in the target re-identification model using a training set to obtain reference balance parameters for each classifier includes: The pre-trained classifiers are trained using the training set to obtain the reference balance parameters of each classifier. The step of adjusting the parameters of the feature extraction network and each of the target classifiers based on the first recognition result includes: Based on the first recognition result, the parameters of the pre-trained feature extraction network and each of the target classifiers are adjusted.

6. The method according to claim 5, characterized in that, The pre-training of the feature extraction network and the at least one classifier using a pre-training set includes: The feature extraction network and the classifier are combined respectively to obtain at least one target re-identification sub-model; For each of the target re-identification sub-models, the global and local features of the pre-training samples in the pre-training set are identified using the target re-identification sub-model to obtain the second identification result of the pre-training sample image; Based on the difference between the second recognition result and the second annotation result of the pre-trained sample image, a fifth loss is obtained; The sixth loss is determined based on the third distance between the second sample feature and the second positive sample feature of the pre-trained sample, and the fourth distance between the second sample feature and the second negative sample feature; wherein the second positive sample feature and the second sample feature belong to the same pre-trained sample, and the second negative sample feature and the second sample feature belong to different pre-trained samples. The parameters of the target re-identification sub-model are adjusted using the fifth loss and the sixth loss.

7. A target re-identification method, characterized in that, The method includes: Acquire several target images; wherein the target images are captured by different cameras; The feature extraction network of the target re-identification model is used to extract features from several target images to obtain global and local features of the targets in the several target images; The global and local features of the target are identified by each target classifier of the target re-identification model to obtain the target identification results of several target images; wherein, the target re-identification model is a target re-identification model trained by the method described in any one of claims 1-6.

8. An electronic device, characterized in that, Electronic devices include interconnected memory and processor. The memory stores program instructions; The processor is used to execute program instructions stored in the memory to implement the training method of the target re-identification model according to any one of claims 1-6, or to implement the target re-identification method according to claim 7.

9. A computer-readable storage medium, characterized in that, A computer-readable storage medium is used to store program instructions that can be executed to implement the training method of the target re-identification model according to any one of claims 1-6, or to implement the target re-identification method according to claim 7.