Generalization method, device and equipment of target detection model and medium

By training the object detection model using pseudo-labels in the target domain, the problem of insufficient applicability and accuracy of deep learning models in unlabeled environments is solved, and the model's rapid generalization and environmental adaptation are achieved.

CN116958525BActive Publication Date: 2026-03-31新奥新智科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Without source domain data, deep learning models cannot improve applicability and accuracy in target domains that are completely unlabeled, resulting in an inability to quickly adapt to dynamic changes in the environment.

Method used

By acquiring unlabeled target domain data, copying the target detection model trained on the source domain, calculating pseudo-labels using the first and second models, and using the pseudo-labels as real labels to train the target detection model until the preset generalization conditions are met, the model can be rapidly generalized and its parameters adjusted.

Benefits of technology

It improves the applicability and accuracy of deep learning models in completely unlabeled target domains, enabling models to quickly adapt to dynamic changes in the environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116958525B_ABST
    Figure CN116958525B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of model generalization, in particular to a generalization method, device and equipment and medium for a target detection model, wherein the method comprises the following steps: acquiring unlabeled target domain data; copying a target detection model trained on a source domain to obtain a first model and a second model; calculating pseudo labels of any data in the target domain data according to the first model and the second model; training the target detection model by taking the pseudo labels as real labels of the any data until a preset generalization condition is met, and obtaining a generalization-completed target detection model. Thus, the problem that in the related art, the applicability and accuracy of a deep learning model cannot be improved on a target domain without any label under the condition that no source domain data is provided, so that the deep learning model cannot quickly adapt to dynamic changes of the environment and the like is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model generalization technology, and in particular to a method, apparatus, device and medium for generalizing a target detection model. Background Technology

[0002] Currently, the main factor contributing to the success of deep learning algorithms lies in their availability of a large number of labeled data samples. Deep learning also requires that its training and testing datasets must satisfy the assumption that they come from the same distribution. Transfer learning, on the other hand, can learn knowledge from labeled information within the source domain, reducing the requirement that training and testing data be from the same distribution in deep learning. This effectively facilitates information sharing and transfer between target domains. By introducing transfer learning into deep learning, a deep transfer learning algorithm has been proposed, addressing the shortcomings of traditional deep learning algorithms. Furthermore, it leverages the advantages of deep learning to learn domain-invariant features in transfer learning, achieving better classification and recognition capabilities than traditional transfer learning.

[0003] In related technologies, since deep transfer learning algorithms transfer data from the source domain to the target domain to perform deep learning and obtain prediction models, changes in the data distribution in the deployment environment will lead to a severe decline in model performance, making it impossible to continue providing services for the application in this scenario; if no source domain data is provided, the deep learning model obtained on the target domain without any labels will result in low model applicability and poor accuracy. Summary of the Invention

[0004] This application provides a generalization method, apparatus, device, and medium for object detection models to solve the problems in related technologies, such as the inability to improve the applicability and accuracy of deep learning models on completely unlabeled target domains without providing source domain data, thus leading to the inability to quickly adapt to dynamic changes in the environment.

[0005] The first aspect of this application provides a method for generalizing an object detection model, comprising the following steps: acquiring unlabeled target domain data; copying the target detection model trained on the source domain to obtain a first model and a second model; calculating pseudo-labels for any data in the target domain data based on the first model and the second model; using the pseudo-labels as the real labels for the arbitrary data to train the target detection model until a preset generalization condition is met, thereby obtaining a generalized target detection model.

[0006] Optionally, calculating the pseudo-label of any data in the target domain data according to the first model and / or the second model includes: sampling arbitrary data from the target domain data; performing multiple data augmentations on the arbitrary data to obtain multiple augmented data; using the first model to perform forward propagation on the multiple augmented data to obtain the class probability of each augmented data; and determining the pseudo-label of the arbitrary data based on the weighted average of the class probabilities.

[0007] Optionally, determining the pseudo-label of the arbitrary data based on the weighted average of the category probabilities includes: identifying the confidence level of the first model at each forward propagation; if the confidence level is greater than a preset threshold, calculating the category probability of the augmented data using the second model, otherwise using the output of the first model as the category probability of the augmented data; and performing a weighted average of the category probabilities of all augmented data to obtain the pseudo-label of the arbitrary data.

[0008] Optionally, the network parameters of the second model are fixed.

[0009] Optionally, training the target detection model using the pseudo-label as the real label of the arbitrary data includes: training the target detection model using the arbitrary data; calculating the training loss based on the output of the target detection model and the real label; updating the network parameters of the target detection model through backpropagation based on the training loss; and updating the network parameters of the first model using the updated network parameters of the target detection model.

[0010] Optionally, updating the network parameters of the first model using the updated network parameters of the target detection model includes: calculating the exponential moving average of the updated network parameters of the target detection model; and updating the network parameters of the first model based on the exponential moving average.

[0011] Optionally, the target domain data and the source domain data do not follow the same distribution.

[0012] A second aspect of this application provides a generalization apparatus for an object detection model, comprising: an acquisition module for acquiring unlabeled target domain data; a copying module for copying a target detection model trained on a source domain to obtain a first model and a second model; and a calculation module for calculating pseudo-labels for any data in the target domain data based on the first model and the second model, and using the pseudo-labels as the real labels for the arbitrary data to train the object detection model until a preset generalization condition is met, thereby obtaining a generalized object detection model.

[0013] Optionally, the calculation module is further configured to: sample arbitrary data from the target domain data; perform multiple data augmentations on the arbitrary data to obtain multiple augmented data; perform forward propagation on the multiple augmented data using the first model to obtain the class probability of each augmented data; and determine the pseudo label of the arbitrary data based on the weighted average of the class probabilities.

[0014] Optionally, the calculation module is further configured to: identify the confidence level of the first model at each forward propagation; if the confidence level is greater than a preset threshold, calculate the class probability of the augmented data using the second model; otherwise, use the output of the first model as the class probability of the augmented data; and perform a weighted average of the class probabilities of all augmented data to obtain the pseudo label of the arbitrary data.

[0015] Optionally, the network parameters of the second model are fixed.

[0016] Optionally, the calculation module is further configured to: train the object detection model using the arbitrary data; calculate the training loss based on the output of the object detection model and the real label; update the network parameters of the object detection model through backpropagation based on the training loss, and update the network parameters of the first model using the updated network parameters of the object detection model.

[0017] Optionally, the calculation module is further configured to: calculate the exponential moving average of the network parameters of the updated target detection model; and update the network parameters of the first model based on the exponential moving average.

[0018] Optionally, the target domain data and the source domain data do not follow the same distribution.

[0019] A third aspect of this application 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 generalization method of the target detection model as described in the above embodiments.

[0020] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement a generalization method for a target detection model as described in the above embodiments.

[0021] Therefore, this application has at least the following beneficial effects:

[0022] This application embodiment can input target data in the target domain into a model trained in the source domain to obtain the class probabilities of multiple target data, generate pseudo-labels for the corresponding target data based on the class probabilities, and update the parameters of the target model based on all pseudo-labels. Thus, the model can achieve rapid generalization based on pseudo-labels, and the parameters of the existing network can be readjusted through entropy regularization, so that the model can quickly adapt to the dynamic changes of the environment.

[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0025] Figure 1 This is a flowchart of a generalization method for a target detection model provided according to an embodiment of this application;

[0026] Figure 2 This is an example diagram illustrating the rapid generalization of a pseudo-label-based deep learning model according to embodiments of this application;

[0027] Figure 3 This is a schematic diagram of the experimental results for various scenarios under the open flame dataset provided in the embodiments of this application;

[0028] Figure 4 This is a schematic diagram of a generalization device for a target detection model provided according to an embodiment of this application;

[0029] Figure 5 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0030] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0031] The following description, with reference to the accompanying drawings, describes a generalization method, apparatus, electronic device, and storage medium for an object detection model according to embodiments of this application. Addressing the problems mentioned in the background art, such as the inability to improve the applicability and accuracy of deep learning models in unlabeled target domains without source domain data, leading to an inability to quickly adapt to dynamic environmental changes, this application provides a generalization method for an object detection model. In this method, target data from the target domain is input into a model trained on the source domain to obtain class probabilities for multiple target data. Pseudo-labels are generated based on these class probabilities, and the parameters of the target model are updated based on all pseudo-labels. This allows for rapid model generalization based on the pseudo-labels, and the parameters of the existing network can be readjusted through entropy regularization, enabling the model to quickly adapt to dynamic environmental changes. Therefore, this solves the problems in the related art, such as the inability to improve the applicability and accuracy of deep learning models in unlabeled target domains without source domain data, leading to an inability to quickly adapt to dynamic environmental changes.

[0032] Specifically, Figure 1 This is a flowchart illustrating a generalization method for a target detection model provided in an embodiment of this application.

[0033] like Figure 1 As shown, the generalization method of this target detection model includes the following steps:

[0034] In step S101, unlabeled target domain data is obtained.

[0035] The target domain can represent the domain in which the test sample is located, and can be unlabeled or have only a few labels, without specific limitations.

[0036] It is understood that the embodiments of this application obtain unlabeled target domain data in order to facilitate the subsequent calculation of pseudo-labels for any data in the target domain data.

[0037] In step S102, the target detection model trained on the source domain is copied to obtain the first model and the second model.

[0038] The source domain can represent a different domain from the test sample, but it has rich supervisory information and is not specifically limited.

[0039] In this model, the target domain data and the source domain data do not follow the same distribution, and the network parameters of the second model are fixed.

[0040] The first model can be a teacher model, and the second model can be an initial source domain model with fixed parameters, without specific limitations. The following embodiments all use the teacher model f. t Source domain model f o To elaborate.

[0041] It is understood that, in the embodiments of this application, the target detection model trained on the source domain is copied to obtain the first model and the second model, so as to facilitate the subsequent calculation of pseudo-labels for any data in the target domain data based on the first model and the second model.

[0042] In step S103, pseudo-labels are calculated for any data in the target domain data based on the first model and the second model. The pseudo-labels are then used as the real labels for the arbitrary data to train the target detection model until a preset generalization condition is met, at which point a generalized target detection model is obtained.

[0043] Among them, pseudo-labels can be approximate labels obtained based on labeled data, without specific limitations.

[0044] Among them, the preset generalization conditions can be that the trained object detection model has strong generalization ability, high accuracy of the test dataset, and can quickly adapt to dynamic changes in the environment. These conditions can be set according to the actual situation and are not specifically limited.

[0045] It is understood that, in the embodiments of this application, pseudo-labels are calculated for any data in the target domain data based on the first model and the second model. The pseudo-labels are used as real labels to train the target detection model until the generalization condition is met, and a generalized target detection model is obtained. This can improve the applicability and accuracy of deep learning models in target domains that have no labels, thereby enabling the model to quickly adapt to dynamic changes in the environment.

[0046] In this embodiment of the application, the step of calculating the pseudo-label of any data in the target domain data according to the first model and / or the second model includes: sampling arbitrary data from the target domain data; performing multiple data augmentations on the arbitrary data to obtain multiple augmented data; using the first model to perform forward propagation on the multiple augmented data to obtain the class probability of each augmented data; and determining the pseudo-label of the arbitrary data based on the weighted average of the class probabilities.

[0047] Forward propagation can be a process where a sample vector is input into a deep learning model, and the elements of the sample vector are weighted and summed at each hidden layer and nonlinearly activated, and finally a prediction vector is output by the output layer. No specific limitations are imposed.

[0048] It is understood that in this application embodiment, arbitrary data is sampled from the target domain data and augmented multiple times. The augmented data is forward-propagated using the first model to obtain the class probability of the augmented data. The pseudo-label of the arbitrary data is determined based on the weighted average of the class probabilities, so as to facilitate the subsequent training of the target detection model using the pseudo-label.

[0049] It should be noted that the purpose of performing multiple data augmentations on the aforementioned arbitrary data is: (1) to avoid overfitting. When the dataset has certain obvious features, such as the images in the dataset being taken in the same scene, the Cutout method and style transfer transformation and other related methods can prevent the model from learning information unrelated to the target; (2) to improve the robustness of the model and reduce the model's sensitivity to images. When the training data are in a relatively ideal state, it is easy to make mistakes in some special situations, such as occlusion, brightness, blur, etc. Adding noise, masking and other methods to the training data can improve the robustness of the model; (3) to increase the training data and improve the model's generalization ability; (4) to avoid sample imbalance. In industrial defect detection and medical disease identification, there is a high risk of extreme imbalance between positive and negative samples. By performing some data augmentation methods on a small number of samples, the proportion of sample imbalance can be reduced.

[0050] Specifically, common data augmentation methods can include geometric transformations and pixel transformations. Geometric transformation methods mainly include flipping, rotating, cropping, scaling, translating, and dithering. In certain specific tasks, when using these methods, it is necessary to change the main label data. For example, if flipping is used in object detection, the ground truth bounding box needs to be adjusted accordingly. Pixel transformation methods include adding salt and pepper noise, Gaussian noise, applying Gaussian blur, adjusting HSV contrast, adjusting brightness and saturation, histogram equalization, and adjusting white balance.

[0051] In this embodiment of the application, determining the pseudo-label of the arbitrary data based on the weighted average of the category probabilities includes: identifying the confidence level of the first model at each forward propagation; if the confidence level is greater than a preset threshold, calculating the category probability of the augmented data using the second model, otherwise using the output of the first model as the category probability of the augmented data; and performing a weighted average of the category probabilities of all augmented data to obtain the pseudo-label of the arbitrary data.

[0052] The preset threshold can be calibrated according to the actual situation without being specifically limited.

[0053] It is understood that, in this embodiment of the application, the class probability of the augmented data is determined based on the confidence of the first model at each forward propagation. When the confidence is greater than a preset threshold, the class probability of the augmented data is calculated using the second model. Otherwise, the output of the first model is used as the class probability of the augmented data, and a weighted average is performed on the class probabilities of all the augmented data to obtain a pseudo label for any data, so as to facilitate the subsequent training of the target detection model using the pseudo label.

[0054] In this embodiment of the application, training the target detection model using the pseudo-label as the real label of the arbitrary data includes: training the target detection model using the arbitrary data; calculating the training loss based on the output of the target detection model and the real label; updating the network parameters of the target detection model through backpropagation based on the training loss; and updating the network parameters of the first model using the updated network parameters of the target detection model.

[0055] Backpropagation can be used when there is an error between the input and output of a deep learning model. In this case, the error between the estimated value and the actual value is calculated, and the error is propagated back from the output layer to the hidden layer until it reaches the input layer. No specific limitation is made.

[0056] It is understood that the embodiments of this application use arbitrary data to train the object detection model, calculate the training loss based on the output results and the real labels, and update the network parameters of the object detection model through backpropagation based on the training loss. The network parameters of the first model are then updated using the updated network parameters of the object detection model, making the network parameters more accurate, thereby reducing the time required for training the model and enhancing the accuracy of the processing.

[0057] In this embodiment of the application, updating the network parameters of the first model using the updated network parameters of the target detection model includes: calculating the exponential moving average of the updated network parameters of the target detection model; and updating the network parameters of the first model based on the exponential moving average.

[0058] Wherein, the exponential moving average can be φ t =αφ t-1 +(1-α)θ t Where α represents the update rate, taking values ​​[0, 1], and θ t φ represents the updated parameters of the trained model. t-1 This represents the model parameters obtained in the previous training round.

[0059] It is understood that the embodiments of this application calculate the exponential moving average of the network parameters of the updated target detection model, and update the network parameters of the first model accordingly, thereby reducing the time required for training the model and enhancing the accuracy of the processing.

[0060] According to the generalization method of the target detection model proposed in this application, unlabeled target domain data is obtained, and the target detection model trained on the source domain is copied to obtain a first model and a second model. Pseudo-labels are calculated for any data in the target domain data based on the first and second models. These pseudo-labels are then used as real labels to train the target detection model until the generalization condition is met, resulting in a fully generalized target detection model. This method can improve the applicability and accuracy of deep learning models in completely unlabeled target domains, thereby enabling the model to quickly adapt to dynamic changes in the environment. Therefore, it solves the problem in related technologies where, without source domain data, the applicability and accuracy of deep learning models cannot be improved in completely unlabeled target domains, leading to an inability to quickly adapt to dynamic changes in the environment.

[0061] The following will combine Figure 2 The generalization method for the object detection model is explained in detail, and the specific steps are as follows:

[0062] Step 1: Given a pre-trained model in the source domain, duplicate the model twice, using one copy as the teacher model f. t A fixed set of parameters is used as the initial model f. o .

[0063] Step 2: Given a series of unlabeled target domain data X that do not follow the same distribution as the source domain data.

[0064] Step 3, taking a single image as an example (can be done in batches), for the t-th update operation:

[0065] (a) Sample an image x from X;

[0066] (b) Perform n data augmentations on x;

[0067] (c) The teacher model is used to perform forward propagation on the enhanced n images to obtain the class probabilities f of the n target domain data. t (x);

[0068] (d) Take a weighted average of the n probabilities and use it as the pseudo-label for x.

[0069] i. If the network output has a high confidence level (probability greater than a certain threshold), then the output of the initial model is taken as the probability of the enhanced image;

[0070] ii. If the value is low, then the output of the teacher model is taken as the class probability;

[0071] iii. Average the probabilities of steps i and ii and use them as the pseudo-label for x.

[0072] (e) Update the pre-trained model

[0073] i. Using the pseudo-labels obtained in the previous step as the real labels for the image, calculate the output f of the trained model with respect to x. θ Cross-entropy loss of (x);

[0074] ii. Backpropagation to update the parameters θ of the trained model. t .

[0075] (f) Exponential moving average teacher update model f t Parameters:

[0076] φ t =αφ t-1 +(1-α)θ t

[0077] Step 4: Repeat step 3 for all images in the target domain. Finally, as shown... Figure 3 As shown, experiments were conducted on various scenarios under the open flame dataset: the pollution situation was divided into 5 severity levels and 15 pollution types. The experimental results are shown in Table 1 and Table 2. Table 1 shows the accuracy changes after adaptation under different pollution levels, and Table 2 shows the accuracy changes after adaptation for different types of pollution.

[0078] Table 1. Accuracy variation after Adaptation under different levels of contamination.

[0079] pollution level Accuracy change after one epoch 5 8.43523 4 7.122206 3 7.383118 2 7.034765 1 4.38333

[0080] Table 2. Accuracy Changes After Adaptation for Different Types of Contamination

[0081]

[0082]

[0083] Based on the above results, the dynamic change process is as follows: random sampling is performed for 75 pollution conditions under the open flame dataset without releasing the goods, and the model is adapted once every epoch. Then the adapted model is placed into the new target domain for continuous adaptation, as shown in Table 3. Table 3 is the accuracy change table during the dynamic change process.

[0084] Table 3. Accuracy Changes During Dynamic Transformation

[0085] Condition Number average value promote 42 11.83 decline 33 -2.89

[0086] Next, the generalization apparatus for the target detection model proposed according to the embodiments of this application is described with reference to the accompanying drawings.

[0087] Figure 4 This is a block diagram of the generalization device for the target detection model in an embodiment of this application.

[0088] like Figure 4 As shown, the generalization device 10 of the target detection model includes: an acquisition module 100, a copying module 200, and a calculation module 300.

[0089] The acquisition module 100 is used to acquire unlabeled target domain data; the copying module 200 is used to copy the target detection model trained on the source domain to obtain a first model and a second model; the calculation module 300 is used to calculate the pseudo label of any data in the target domain data according to the first model and the second model, and use the pseudo label as the real label of the arbitrary data to train the target detection model until the preset generalization condition is met, and then obtain the generalized target detection model.

[0090] In this embodiment of the application, the calculation module is further configured to: sample arbitrary data from the target domain data; perform multiple data augmentations on the arbitrary data to obtain multiple augmented data; use the first model to perform forward propagation on the multiple augmented data to obtain the class probability of each augmented data; and determine the pseudo label of the arbitrary data based on the weighted average of the class probabilities.

[0091] In this embodiment of the application, the calculation module is further configured to: identify the confidence level of the first model at each forward propagation; if the confidence level is greater than a preset threshold, calculate the class probability of the augmented data using the second model, otherwise use the output of the first model as the class probability of the augmented data; and perform a weighted average of the class probabilities of all augmented data to obtain the pseudo label of the arbitrary data.

[0092] In this embodiment of the application, the network parameters of the second model are fixed.

[0093] In this embodiment, the calculation module is further configured to: train the target detection model using the arbitrary data; calculate the training loss based on the output of the target detection model and the real label; update the network parameters of the target detection model through backpropagation based on the training loss, and update the network parameters of the first model using the updated network parameters of the target detection model.

[0094] In this embodiment of the application, the calculation module is further configured to: calculate the exponential moving average of the network parameters of the updated target detection model; and update the network parameters of the first model according to the exponential moving average.

[0095] In this embodiment of the application, the target domain data and the source domain data do not follow the same distribution.

[0096] It should be noted that the explanation of the generalization method embodiment for the target detection model described above also applies to the generalization device of the target detection model in this embodiment, and will not be repeated here.

[0097] The generalization apparatus for the target detection model proposed in this application acquires unlabeled target domain data, copies the target detection model trained on the source domain to obtain a first model and a second model, calculates pseudo-labels for any data in the target domain data based on the first and second models, and uses the pseudo-labels as real labels to train the target detection model until the generalization condition is met, resulting in a generalized target detection model. This improves the applicability and accuracy of deep learning models on completely unlabeled target domains, enabling the model to quickly adapt to dynamic changes in the environment. Therefore, it solves the problem in related technologies where, without source domain data, the applicability and accuracy of deep learning models cannot be improved on completely unlabeled target domains, leading to an inability to quickly adapt to dynamic changes in the environment.

[0098] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:

[0099] The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0100] When the processor 502 executes the program, it implements the generalization method of the target detection model provided in the above embodiments.

[0101] Furthermore, electronic devices also include:

[0102] Communication interface 503 is used for communication between memory 501 and processor 502.

[0103] The memory 501 is used to store computer programs that can run on the processor 502.

[0104] The memory 501 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0105] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0106] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0107] Processor 502 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of this application.

[0108] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the generalization method of the target detection model as described above.

[0109] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0110] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0111] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0112] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0113] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

Claims

1. A generalization method of an object detection model, characterized in that, The method comprises the following steps: obtaining target domain images without labels; copying a target detection model trained on a source domain to obtain a first model and a second model; calculating pseudo labels of any image in the target domain images according to the first model and the second model, training the target detection model by taking the pseudo labels as real labels of the any image, and obtaining a target detection model with generalization completed when a preset generalization condition is met; the step of calculating the pseudo labels of the any image in the target domain images according to the first model and the second model comprises: sampling any image from the target domain images; performing image enhancement on the any image multiple times to obtain multiple enhanced images; performing forward propagation on the multiple enhanced images by using the first model to obtain class probabilities of each enhanced image, and determining the pseudo labels of the any image based on a weighted average of the class probabilities; the step of determining the pseudo labels of the any image based on the weighted average of the class probabilities comprises: identifying a confidence of the first model at each time of forward propagation; if the confidence is greater than a preset threshold, calculating the class probabilities of the enhanced image by using the second model, otherwise taking the output of the first model as the class probabilities of the enhanced image; performing weighted average on the class probabilities of all enhanced images to obtain the pseudo labels of the any image.

2. The generalization method of the target detection model according to claim 1, wherein, The network parameters of the second model are fixed.

3. The generalization method of the target detection model according to claim 1, wherein, the step of training the target detection model by taking the pseudo labels as the real labels of the any image comprises: training the target detection model by using the any image; calculating a training loss according to an output result of the target detection model and the real labels; updating network parameters of the target detection model through back propagation according to the training loss, and updating network parameters of the first model through the updated network parameters of the target detection model.

4. The generalization method of the target detection model according to claim 3, characterized in that, the step of updating the network parameters of the first model through the updated network parameters of the target detection model comprises: calculating an exponential moving average of the updated network parameters of the target detection model; updating the network parameters of the first model according to the exponential moving average.

5. The method of claim 1, wherein, The target domain images and the source domain images do not conform to the same distribution.

6. A generalization device of an object detection model, realizing the generalization method of the object detection model according to any one of claims 1-5, characterized in that, comprises: an obtaining module configured to obtain target domain images without labels; a copying module configured to copy a target detection model trained on a source domain to obtain a first model and a second model; a calculating module configured to calculate pseudo labels of any image in the target domain images according to the first model and the second model, train the target detection model by taking the pseudo labels as real labels of the any image, and obtain a target detection model with generalization completed when a preset generalization condition is met.

7. An electronic device, comprising: comprises: 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 generalization method of the target detection model according to any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the generalization method of the target detection model according to any one of claims 1-5.

Citation Information

Patent Citations

  • Domain adaptive behavior recognition system and method based on data enhancement and pseudo tag

    CN114638995A