Domain adaptive target detection method based on class alignment

Through inter-class separation modules and in-class aggregation modules, the problem of loss of category semantic knowledge in the existing domain adaptive object detection model is solved, the accuracy and generalization performance of cross-domain detection are improved, and the classification feature distinction is achieved. and intra-class consistency.

CN118887384APending Publication Date: 2024-11-01UNIV OF ELECTRONICS SCI & TECH OF CHINA

Patent Information

Application Number
CN202410911676.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing domain adaptive object detection model loses category semantic knowledge in cross-domain detection, resulting in a decrease in detection accuracy and generalization performance, especially when there are large differences in distribution between training and application scenarios.

Method used

Using inter-class separation module and in-class aggregation module, the method of difficult sample mining and minimizing in-class differences is redefined, feature distance is enhanced, inter-class differences and in-class consistency are optimized, and the loss function is optimized to improve the model's acquisition of class semantic information ability.

Benefits of technology

It significantly improves the model's class attribute distinction ability and in-class features at the deep feature level, and improves the accuracy and generalization performance of cross-domain detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887384A_ABST
    Figure CN118887384A_ABST
Patent Text Reader

Abstract

The invention discloses a domain adaptive target detection method based on class alignment. The method aims at solving the problems that intra-class changes of various class features are remarkable and inter-class differences are insufficient in domain self-adaptive target detection. The method mainly comprises the steps that an inter-class separation module is designed, a sampling method of difficult sample mining is adopted, and the difference between classes is enhanced through distance interaction between two fields; and the intra-class aggregation module is used for obtaining the distance between the same-class features in the two fields and the center of the shared class and utilizing an intra-class difference minimization method. A loss function is optimized, and learning of the model on inter-class difference and intra-class compactness is enhanced. Experiments show that the provided method shows significant detection effect improvement under different backgrounds and image qualities. Compared with the prior art, the method has the advantages that the capability of acquiring the category semantic information between the two domains by the model is improved, and the advantages of the method in domain adaptive target detection are verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of domain adaptive target detection in deep learning, and aims to improve the performance of target detection in new domains by adjusting a target detection model to adapt to different data distributions. Background Art

[0002] Object detection plays a very important role in the field of computer vision. Through the trained detection model, the object category and position in the complex scene picture can be accurately predicted and identified. With the development of life, the demand for object detection in practical applications is increasing, which has shown important value in many fields such as face recognition, intelligent security, vehicle recognition and autonomous driving. To achieve these functions, object detection algorithms are indispensable. With the help of object detection algorithms, computers can perceive and understand the world around them, thereby achieving more complex tasks. In recent years, many object detection algorithms based on convolutional neural networks (CNNs) have been proposed, such as R-CNN (region-based convolutional neural network) and Faster R-CNN (faster region-based convolutional neural network). These methods have significantly improved the accuracy and speed of object detection and promoted the rapid development of this field.

[0003] With the evolution of deep learning theory, the detection accuracy and generalization performance of target detection models are constantly improving, but there are still some problems. When facing a new detection task, tens of thousands of labeled data sets are often required for model training. However, due to various factors, it is difficult to obtain a large number of data sets, such as military target scenes and medical scenes. Even if a large amount of training data can be obtained, the training scene and application scene of target detection often have significant differences and do not belong to the same distribution. For example, the training data set scene is a data set under a sunny scene, and the application scene is a data set under a foggy scene. Under such conditions, the detection accuracy and generalization performance of the target detection model will drop sharply.

[0004] The DA (Domain Adaptive Faster R-CNN, DA) model first implemented a domain adaptation architecture for object detection tasks. Based on the Faster R-CNN architecture, DA mainly integrates the following three domain adaptation parts. First, the image-level feature alignment component, based on the deep features extracted from the backbone network, effectively reduces the global distance between the source domain and the target domain in key features such as the overall brightness and hue of the image through the application of GRL. Secondly, the instance-level feature alignment module uses GRL to process the extracted candidate region features after the RPN (Region Proposal Network, RPN) stage, reducing the deviation in local distance information between the source domain and the target domain, and further strengthening the similarity of local object features. Finally, in order to ensure the consistency of image-level and instance-level alignment work, consistency regularization is introduced. This regularizer maintains the coherence and accuracy of the domain adaptation process by making the two levels of discriminators produce the same prediction when recognizing the same object.

[0005] The existing DA method has achieved good results, but its obvious disadvantage is that it rarely considers the more refined category structure in the source domain and target domain data, that is, the distribution of different category features and the same category features in the feature space of a domain data, resulting in the loss of category semantic knowledge in cross-domain target detection. The present invention makes targeted improvements to the model and loss function to improve the model's ability to obtain category semantic information between the two domains. Summary of the invention

[0006] The present invention uses an inter-class separation module and an intra-class aggregation module to address the problem of significant intra-class changes and insufficient inter-class differences in various category features. The feature distance between the two domains is redefined, and the instance-level relationship between the source domain and the target domain is constructed. The sampling method of selecting samples with higher difficulty is used to strengthen the inter-class differences within the feature distance to maintain the separation of different category features in the two domains, which promotes the model to learn more clearly distinguished category attributes at the deep feature level. At the same time, the distance between the category features in the source domain and the target domain and the shared category center is integrated into the optimization target of the model. By minimizing the intra-class differences, the network can adaptively learn the center point of each category, prompting the category features extracted from the source domain and the target domain to converge to this shared center, so that the model can grasp more compact intra-class feature information.

[0007] The technical solution adopted by the present invention is:

[0008] Step 1: The inter-class separation module adopts the sampling method of difficult sample mining to enhance the difference between categories through distance interaction between two fields, thereby ensuring the separation of features of different categories.

[0009] Step 2: Intra-class aggregation module, by obtaining the distance between similar features and shared category centers in two fields, using the method of minimizing intra-class differences, enhances the consistency of category features and dynamically adjusts the category center parameters.

[0010] Step 3: Optimize the loss function, including the basic detector loss, which is used to evaluate the consistency between the predicted frame and the actual annotation frame; the category center loss, which ensures the accurate update of the category center; and the triplet loss, which further enhances the model's learning of inter-class differences and intra-class compactness.

[0011] Step 4: In order to verify the effectiveness of this method, two groups of experiments are set up in this section, namely, two groups of experiments with different backgrounds (the source domain is the CityScape dataset under sunny scenes, and the target domain is the Foggy CityScape dataset under foggy scenes, hereinafter referred to as C→F) and different image styles and image qualities (the source domain uses the Simil10k dataset with virtual game style and the KITTI dataset shot from different perspectives; the target domain is the CityScape dataset of real life scenes, hereinafter referred to as S→C and K→C). This method is tested on public standard datasets, and quantitative and qualitative analysis is performed with mainstream algorithms from the perspective of experiments. The effectiveness of this method is verified. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 For: Structural diagram of domain adaptive object detection algorithm based on class alignment.

[0013] Figure 2 Schematic diagram of the principle of inter-class separation module

[0014] Figure 3 Schematic diagram of classification sample extraction method

[0015] Figure 4 Schematic diagram of the principle of intra-class aggregation module

[0016] Figure 5 Figure 2: AP and mAP of CADA algorithm (backbone network uses VGG16) and mainstream algorithms under different background environments

[0017] Figure 6 The performance indicators of the CADA algorithm (the backbone network uses VGG16) in ablation experiments using different modules

[0018] Figure 7 Figure 2: Car AP of CADA and mainstream algorithms under different feature alignment scenarios of image styles and image quality DETAILED DESCRIPTION

[0019] The present invention aims to solve the problem that the intra-class variation of various category features in domain adaptive object detection algorithms is significant and the inter-class difference is insufficient, which leads to the poor effect of existing domain adaptive object detection models. FasterR-CNN is selected as the original model, and a domain adaptive object detection algorithm CADA based on class alignment is proposed. The algorithm framework diagram is shown in the attached figure. Figure 1 shown.

[0020] The present invention is further described below in conjunction with the accompanying drawings. The specific method for implementing the present invention comprises the following steps:

[0021] Step 1: Separate modules between classes

[0022] By utilizing the distance difference of features between the source domain and the target domain, and with the help of a sampling method that selects difficult samples, the difference between the target domain and the source domain is continuously increased during the feature distance update process, maintaining the independence of features of different categories in the source domain and the target domain, thereby making the algorithm more capable of class separation after training. In other words, minimize the distance between ROI features of the same category, while increasing the distance between ROI features predicted to be of different categories. Therefore, in each update of the model, for these features that cannot achieve inter-class separation, that is, features with a large distance between features in the same category of the source domain and the target domain, and features with a small distance between features in different categories of the source domain and the target domain, they are taken as penalty terms and included in the loss function to update the data in the model domain. and After feature extraction, RPN and ROI processing, the feature matrix is ​​generated. First, the vector set number of ROI is obtained by mapping the feature matrix. The set of source domain is defined as The set of target domains is defined as Where n s and n t Represent the total number of ROIs generated by the source domain and target domain data through the model. Then, these feature vectors are mapped to the Euclidean space with the help of the mapping function f(·), where d represents the Euclidean space dimension, which can more accurately calculate the distance between the source domain and the target domain ROI feature vector. It is implemented in the network structure through the double fully connected layer after the ROI pooling layer, which is also the number of neurons in the fully connected layer.

[0023] In order to clearly determine the relationship between the two domains, the distance between different feature matrices is calculated. The detailed process is as follows Figure 2 As shown, the feature vector of the source domain is used and the characteristic quantity of the target domain Project the feature matrix into the feature space, determine the distance of the feature matrix in the Euclidean space, and use these distance values ​​to construct a distance matrix representing the distance between the source domain and the target domain. The calculation formula is shown below.

[0024]

[0025] In order to adjust the distance difference of ROI vectors between the source domain and the target domain, the feature vectors of the same category are guaranteed to be Compare different category vector pairs The difference between the two fields is smaller. In the process of model training, distance constraints are added. The constraints are shown in the following formula. and They respectively express the distances between feature vector pairs of the same category and different categories, and α is the matching coefficient, which is used to adjust the difference between the feature vector pairs of the region of interest in the source domain and the feature vector pairs of the region of interest in the target domain.

[0026]

[0027] The purpose of this module is to reduce the distance between feature vectors to a greater extent. However, before blindly reducing the distance between feature vectors, the following issues need to be considered first: The distance between them is very large, and the eigenvector The distance between them is very small and does not meet the above constraints. Naturally, the constraint function fails to work. In order to solve the above problem, each feature vector is equipped with a corresponding positive sample and a negative sample for distance constraint calculation. At the same time, this condition is used as a constraint item as a parameter for model update, and then the model is optimized during the training process. Figure 3 shown.

[0028] Through the above analysis, we can understand that the main function of the classification sample extraction method is to reduce the inter-class distance of the same category in the source domain and the target domain and expand the inter-class distance of different categories in the source domain and the target domain. It can be seen that the loss function of this module is As shown in the following formula.

[0029]

[0030] This module can effectively reduce the distance between the features of the regions of interest in the two domains within the same category, and at the same time expand the distance between the features of the regions of interest in the two domains in different categories, thereby preventing the misalignment between features of different categories to a certain extent. Nevertheless, after being processed by the algorithm of this module, the aggregation of similar features in the source domain and the target domain in the Euclidean space cannot be fully realized, and it may still lead to obvious differences between similar features, resulting in the loss of category information, which will interfere with the performance of the model. Therefore, the method of intra-class aggregation is introduced in step 2 to solve the above problem.

[0031] Step 2: The intra-category clustering module (IC) calculates the distance between the category features of the two domains and the shared category center, and uses the method of dynamically constraining these distances to reduce the difference in information of the internal features of the same category. The algorithm can automatically find the category center, and the category feature information extracted from the source domain and the target domain gradually approaches the shared category center, making the algorithm more capable of intra-category aggregation after training. In the process of updating the model parameters, the distance difference between the feature vector and its category center is continuously reduced, thereby achieving the aggregation of category features. The principle diagram of the intra-category aggregation module is shown in the figure below. Figure 4 shown.

[0032] In the process of updating model parameters, the ROI feature vectors in the two domains are moved closer to the shared category center of the same category to which the feature vectors belong. The feature vectors do not need to move closer to the class center of different categories to achieve effective distinction of category features. Therefore, it is necessary to know the class center to which the feature vectors belong. The method is as follows: Use the source domain ROI feature vector set R s and the set of predicted categories obtained by its classifier Get the ROI feature vector in each source domain dataset sample The category feature center p k In order to preserve the distance matrix Each ROI feature vector in the source domain and the corresponding category feature center p k The distance information between them is used to construct a category labeling matrix of the same dimension based on the distance information. See the following formula. When the feature vector center p of a target in the data set sample k Represented categories and source domain ROI feature vectors Prediction category When consistent, in the category label matrix The elements at the same position in are set to 1, otherwise they are set to 0, in this way, the feature centers of the same type as each source domain ROI feature vector are screened out.

[0033]

[0034] After the data is input into the model, the updating process of the model parameters is basically the same. Based on the above ideas, the feature vector set and prediction category set of the target domain dataset samples are R t and The distance matrix and mask matrix are and See the formula.

[0035]

[0036] Since the distance matrix Contains the distance information between the feature vector of the target in the dataset sample and the feature center of its own category, while the category label matrix contains the distance information between the feature vector and the feature center of different classes to which it belongs, so the distance matrix and the class label matrix The fusion is performed to filter out the distance information between the feature vector and the feature center of different categories to which it belongs, and at the same time, a continuously updated strategy is used to update the distance information between the feature vector and the feature center of the category to which it belongs.

[0037] By guiding the feature vector to move closer to the center of the category to which it belongs, the degree of intra-category aggregation in the same category is enhanced. The loss generated by this process is called intra-class aggregation loss, and the loss function is recorded as The loss function of the source domain is denoted as As shown in the following formula, the loss function of the target domain is recorded as As shown in the following formula, since the sources of the loss are the source domain and the target domain, the total intra-class aggregation loss function is shown in the following formula. Since this loss function reflects the distance between the feature vector of the target in the dataset sample and the feature center of the same category, it is also called the center category loss.

[0038]

[0039] Since the number of different target categories in the dataset samples used by the model in the parameter update process varies greatly, the feature centers of all categories in the dataset samples will continue to change as the model continuously updates the parameters. For the above reasons, the model parameters are updated in small batches, and combined with the algorithm proposed above, the category feature centers of the targets in the dataset samples are updated in a targeted manner, which means that during the current model parameter update process, the feature center of a certain category will only be updated if the target in the dataset sample contains a certain category. When the number of updates is set to t, the two-domain data {x s ,x t}, the category feature center corresponding to the data is p k . It can be seen that the relationship between the number of updates and the category feature center is shown in the following formula, μ t When updating the model parameters, the step size of the weight adjustment is It is the learning rate of a specific update phase during the model parameter update process.

[0040] Step 3: Loss function design

[0041] The loss function of each module in this method is explained below. This method is based on the improvement of the Faster R-CNN model. In the field of domain adaptation, the Faster R-CNN model is generally combined with a certain number of image-level domain classifiers and a certain number of instance-level domain classifiers, which enable the detection model to better adapt to new data sets, thereby better improving the detection performance of the model. For the algorithm proposed in this method, three image-level domain classifiers and one instance-level domain classifier are used.

[0042] Image-level domain classifiers often use binary cross entropy loss to quantify whether the domain classification result is correct. The loss function in this article is as follows.

[0043]

[0044] The instance-level domain classifier usually divides a region or an object in the image and determines whether the object or the region comes from the target domain or the source domain. The loss function in this article is as follows.

[0045]

[0046] To summarize, the loss function of our benchmark detector is shown below.

[0047]

[0048] When the CADA algorithm proposed in this method only adds the intra-class aggregation module, its loss function As shown below.

[0049]

[0050] When the CADA algorithm proposed in this method only adds the inter-class separation module, its loss function As shown below.

[0051]

[0052] When the CADA algorithm proposed in this method adds the intra-class aggregation and inter-class separation modules, its loss function As shown in the following formula.

[0053]

[0054] Step 4: Train and test the proposed method and mainstream algorithms on commonly used public datasets

[0055] In order to verify the effectiveness of this method, two groups of experiments are set up in this section, namely, two groups of experiments with different backgrounds (the source domain is the CityScape dataset under sunny scenes, and the target domain is the Foggy CityScape dataset under foggy scenes, hereinafter referred to as C→F) and different image styles and image qualities (the source domain uses the Simil10k dataset with a virtual game style and the KITTI dataset shot from different perspectives; the target domain is the CityScape dataset of real-life scenes, hereinafter referred to as S→C and K→C). This method is tested on public standard datasets, and quantitative and qualitative analysis is conducted compared with mainstream algorithms from the experimental perspective.

[0056] (1) Comparative experiments on different target AP and mAP indicators between this method and the CADA algorithm

[0057] The AP and mAP of the CADA method proposed in this method and the comparison method in different background environments (C→F) are as follows: Figure 5 shown.

[0058] The AP and mAP indicators of different categories of targets of the CADA method proposed in this method are improved by 6.7% compared with the DA algorithm and 1.4% compared with the MAF algorithm, which proves the effectiveness of the method designed in this paper.

[0059] In addition, compared with the MFDA algorithm, the CADA algorithm can more effectively solve the problem of detecting targets of different sizes, and the AP and mAP indicators of targets of different categories are also improved. This is because the CADA algorithm pays more attention to the differences between classes and is easier to learn the category structure information in the foreground area.

[0060] (2) Ablation experiment on the impact of each module on the CADA algorithm model

[0061] The CADA algorithm performs ablation experiments using different modules. The performance indicators of the CADA algorithm when using different modules for ablation experiments are as follows: Figure 6 As shown. Experiments show that the CADA algorithm that uses the inter-class separation module has a 1.0% improvement in mAP compared to the CADA* algorithm that does not use the inter-class separation module; the CADA algorithm that uses the intra-class aggregation module has a 1.1% improvement in mAP compared to the CADA** algorithm that does not use the inter-class separation module. The two modules have basically the same impact on the overall algorithm, mainly because inter-class separation and intra-class aggregation have the same impact on reducing inter-domain differences. When the two modules are used together, the algorithm mAP is improved to a certain extent, which further shows that the two modules designed by this method are effective in reducing inter-domain differences.

[0062] (3) Different image styles and quality

[0063] To further verify the effectiveness of this method, two groups of experiments were set up in the test model on image style (the source domain uses the Sim10k dataset, and the target domain uses the CityScape dataset, S→C) and image quality (the source domain uses the KITTI dataset, and the target domain uses the CityScape dataset, (K→C)). For a more intuitive representation, the car AP indicator was selected as the category for effect comparison. Figure 7 Analysis shows that when VGG16 is used as the backbone network of the CADA algorithm, the car-type AP index is improved by 5.0% compared with the DA algorithm in scenarios with different image styles (S→C), and the car-type AP index is improved by 3.4% compared with the DA algorithm in scenarios with different image qualities (K→C); the car-type AP index is improved by 1.7% compared with the MAF algorithm in scenarios with different image styles (S→C), and the car-type AP index is improved by 0.6% compared with the MAF algorithm in scenarios with different image qualities (K→C). This shows that the detection performance of the proposed algorithm is improved in scenarios with different image styles and qualities, and the domain adaptation performance of the model is good.

[0064] In summary, this method addresses some of the current problems of the DA algorithm: less consideration of the more sophisticated category structure in the source domain and target domain data, that is, the distribution of different category features and the same category features of a domain data in the feature space, resulting in the loss of category semantic knowledge in cross-domain target detection.

[0065] A domain adaptive object detection method based on category alignment is proposed to improve the model's ability to obtain category semantic information between two domains. An inter-class separation module is designed to maximize the difference between categories in different fields and ensure the distinguishability of features of different categories. At the same time, an intra-class clustering module is designed to reduce the difference within the same category features and make them move closer to the shared category. Finally, a loss function consisting of detection loss, center category loss and triple loss is designed.

[0066] Finally, relevant training and testing are carried out under three different scene data sets, and the proposed method is compared and analyzed with typical algorithms such as DA. The experimental results show that the detection performance of the proposed CADA method in different scenes has been further improved.

Claims

1. A domain adaptive object detection method based on class alignment, characterized in that: The following steps are involved: Step 1: The inter-class separation module uses a sampling method for difficult sample mining to enhance the difference between categories through distance interaction between two fields, thereby ensuring the separation of features of different categories; Step 2: Intra-class aggregation module, by obtaining the distance between similar features and shared category centers in two fields, using the method of minimizing intra-class differences, enhances the consistency of category features, and dynamically adjusts the category center parameters; Step 3: Optimize the loss function, including the basic detector loss, which is used to evaluate the consistency between the predicted frame and the actual annotation frame; the category center loss, which ensures the accurate update of the category center; and the triplet loss, which further enhances the model's learning of inter-class differences and intra-class compactness; Step 4: In order to verify the effectiveness of this method, two groups of experiments are set up in this section, one with different backgrounds and different image styles and image qualities. This method is tested on a public standard dataset, and quantitative and qualitative analysis is performed with mainstream algorithms from an experimental perspective.

2. The method according to claim 1, characterized in that: The inter-class separation module in step 1 utilizes the distance difference between the features of the source domain and the target domain, and with the help of a sampling method that selects difficult samples, it continuously increases the difference between the target domain and the source domain during the feature distance update process, maintains the independence of different categories of features in the source domain and the target domain, and thus makes the algorithm more capable of inter-class separation after training.

3. The method according to claim 1, characterized in that: The intra-class aggregation module in step 2 calculates the distance between the category features of the two domains and the shared category center, and uses the method of continuously and dynamically constraining these distances to reduce the information differences of the internal features of the same category, so that the algorithm can automatically find the category center. At the same time, the category feature information extracted from the source domain and the target domain gradually approaches the shared category center, making the algorithm more capable of intra-class aggregation after training. In the process of updating the model parameters, the distance difference between the feature vector and its category center is continuously reduced, thereby realizing the aggregation of category features.

4. The method according to claim 1, characterized in that: In step 3, a loss function consisting of detection loss, center category loss, and triplet loss is designed to better improve the detection performance of the model.

Citation Information

Patent Citations

  • Class regularization method and system for domain adaptive target detection

    CN114386527A

  • Domain adaptive target detection method and system based on foreground-category perception alignment

    CN114821152A

Cited By

  • Electronic information quality management and control system for intelligent clinical nursing

    CN119170180A