Weak supervision object detection method based on region perception and self-adaption during testing

Through the region-aware framework to filter redundant candidate areas and the adaptive framework at test time to adjust the unsupervised contrast learning module, the problem of high computational complexity and highlighting of the most discriminative areas in weakly supervised object detection is solved, achieving more efficient object detection. performance.

CN118570526APending Publication Date: 2024-08-30HARBIN INST OF TECH

Patent Information

Application Number
CN202410639659.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-08-30

Smart Images

  • Figure CN118570526A
    Figure CN118570526A
Patent Text Reader

Abstract

The invention discloses a weak supervision object detection method based on region perception and self-adaption during testing, and belongs to the technical field of object detection in computer vision. The method aims at solving the problems that the calculation complexity is high due to excessive candidate areas in existing weak supervision detection, and detection objects in the areas are incomplete due to the fact that the candidate areas with high classification scores are reserved. Comprising the following steps: obtaining a preliminary complete target candidate region by adopting a region perception framework; obtaining a primary candidate region spatial feature map based on the primary candidate region and an original image feature map; high-dimensional nonlinear features are obtained, and then region embedding is obtained; obtaining a similarity graph in combination with category embedding, and then determining a preliminary complete target candidate region; performing target position prediction by adopting a weak supervision detector to obtain a query area and a key area of a detected target; and the query area and the key area are fused through the unsupervised contrast learning module to obtain an object detection result. The method is used for object detection under the condition that training data annotation information is scarce.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a weakly supervised object detection method based on regional perception and self-adaptation during testing, and belongs to the technical field of object detection in computer vision. Background Art

[0002] Weakly supervised object detection is a method that relies solely on image-level labels to train object detectors, where the image-level labels indicate whether the object to be detected exists in the current image, without marking the specific location of the object to be detected. Current weakly supervised object detection has achieved remarkable success and has been widely used in the fields of specific aircraft model detection and defect detection. However, weakly supervised object detection improves the recall rate by generating thousands of candidate regions, which increases the computational complexity of the algorithm. In addition, weakly supervised object detection usually converts the detection task into a classification task of candidate regions, which leads to the problem of converging to a local optimal solution during the training phase and highlights the most discriminative areas of the object (for example: human faces, dog heads, etc.).

[0003] Based on the above, the limitations of existing weakly supervised object detection methods can be summarized into two aspects: (1) the high computational complexity caused by thousands of candidate regions; (2) the problem of highlighting the most discriminative regions due to the fact that weakly supervised detectors regard the detection task as a classification task.

[0004] A simple solution to the problem of high computational complexity in existing weakly supervised detection is to filter redundant candidate regions and retain candidate regions that contain complete objects. Specifically, crop the candidate regions in the image, input the cropped candidate regions into the trained ResNet50 or visual language large model CLIP, and further calculate the category score of each candidate region, so as to retain candidate regions with high classification scores and delete candidate regions with low scores. However, after experimental exploration, it was found that in the process of directly filtering candidate regions by the above method, high-score regions cannot contain complete objects. Figure 5 The figure shows the classification results of the candidate regions by the trained ResNet50 or the large visual language model CLIP. The above method obtains higher classification scores for regions with obvious features (for example, the head of a horse), and lower classification scores for candidate regions containing complete horses. Summary of the invention

[0005] In view of the problems that too many candidate regions in existing weakly supervised detection result in high computational complexity and retaining candidate regions with high classification scores easily results in incomplete detection of objects in the region, the present invention provides a weakly supervised object detection method based on region perception and self-adaptation during testing.

[0006] The present invention provides a weakly supervised object detection method based on region perception and test-time self-adaptation.

[0007] 1) Using a region-aware framework to obtain preliminary complete target candidate regions: including pre-training a ResNet50 network based on the visual language model CLIP, using the first three layers of the trained ResNet50 network as image encoder 1, and using the fourth layer of the trained ResNet50 network as image encoder 2;

[0008] Image encoder 1 obtains an original image feature map based on the original image; at the same time, multiple primary candidate regions are obtained from the original image; the primary candidate regions are combined with the original image feature map to obtain multiple aligned primary candidate region spatial feature maps; image encoder 2 is then used to obtain high-dimensional nonlinear features of the primary candidate region spatial feature map, and after an attention pooling operation, the global information of the primary candidate region is obtained as region embedding; at the same time, the original image-level label is encoded into a category embedding; a similarity map of the region score representing the primary candidate region is obtained based on the region embedding and the category embedding; a preset score threshold is used to filter the similarity map, and the primary candidate region exceeding the preset score threshold is used as a preliminary complete target candidate region;

[0009] 2) Adopting the test-time adaptive framework to obtain the object detection result: using a weakly supervised detector to predict the target position based on the preliminary complete target candidate area, obtaining the query area and key area of ​​the detection target; the query area and the key area are then fused through the unsupervised contrastive learning module to obtain the object detection result;

[0010] During the training process of the adaptive framework at test time, the network parameters of the weakly supervised detector are modified based on the weakly supervised loss to obtain the final weakly supervised detector; based on the query area of ​​the detection target, the key area of ​​the detection target is determined, and the network parameters of the unsupervised contrastive learning module are optimized according to the query area and the key area;

[0011] During the test fine-tuning process of the adaptive framework at test time, the cosine similarity of the query area and the key area of ​​the detection target obtained by the weakly supervised detector is calculated, and the query area and the key area whose cosine similarity exceeds the similarity threshold are selected to further adjust the network parameters of the unsupervised contrastive learning module to obtain the final unsupervised contrastive learning module; the final weakly supervised detector and the final unsupervised contrastive learning module are used in actual object detection.

[0012] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, a method for obtaining multiple primary candidate regions from an original image is as follows:

[0013] A plurality of primary candidate regions are obtained for the original image based on a selective search method or a multi-scale combined positioning method.

[0014] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the method of encoding the original image-level label into a category embedding is:

[0015] The original image-level labels are used as dynamic prompt information and encoded into category embeddings through a text encoder trained based on the large visual language model CLIP.

[0016] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the feature dimensions of region embedding and category embedding are the same.

[0017] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the key region is determined by:

[0018] The key area is obtained by expanding the query area toward the periphery on the original image, and the expansion ratio is 20% of the corresponding size of the query area in the length direction and the width direction.

[0019] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the preset score threshold is 0.4; the similarity threshold is 0.95.

[0020] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the similarity graph is represented by S region :

[0021]

[0022] In the formula For regional embedding, is the category embedding, d represents the feature dimension, N represents the number of primary candidate regions, and C represents the number of types of detected objects;

[0023]

[0024] Where T represents the text encoder trained based on the large visual language model CLIP, t class represents the original image-level labels.

[0025] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the cosine similarity between the query region and the key region is expressed as S(r,rn):

[0026]

[0027] Where r represents the index of the query region, rn represents the index of the key region corresponding to the query region r, represents the query area corresponding to index r, Indicates the key region corresponding to index rn.

[0028] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, L(r, rn) represents a list of cosine similarity scores of the query region and the key region, ξ represents a similarity threshold, and the list of cosine similarity scores of the query region and the key region exceeding the similarity threshold is expressed as L * (r * ,rn * ):

[0029] L * (r * ,rn * )=L(r,rn)[S(r,rn)>ξ],

[0030] Where r * Indicates the index of the query region whose cosine similarity score exceeds the similarity threshold, rn * Indicates the corresponding r * The index of the key region.

[0031] According to the weakly supervised object detection method based on region perception and test-time adaptation of the present invention, the contrast loss of the unsupervised contrastive learning module is expressed as L al :

[0032]

[0033] In the formula Represents contrastive learning based predict The unsupervised loss is Represents contrastive learning based predict The unsupervised loss is

[0034] It means that the query area determined based on the similarity threshold is selected by the unsupervised contrastive learning model after the first data enhancement.

[0035] The characteristics of the branch of the block are obtained. Indicates that the query area determined based on the similarity threshold is enhanced by the second data

[0036] Features obtained from branch 1 of the unsupervised contrastive learning module;

[0037] It means that the query area determined based on the similarity threshold is selected by the unsupervised contrastive learning model after the first data enhancement.

[0038] The features obtained by branch 2 of the block are, Indicates that the query area determined based on the similarity threshold is enhanced by the second data

[0039] Features obtained from branch 2 of the unsupervised contrastive learning module.

[0040] Beneficial effects of the present invention: In order to solve the problem of high computational complexity of existing methods, the method of the present invention filters redundant candidate regions through a region-aware framework and saves candidate regions containing complete objects, and uses the original image-level labels as dynamic prompts to guide the region-aware framework to align natural language text information and candidate regions containing complete objects, thereby reducing the computational complexity of the training and testing stages.

[0041] In order to solve the problem that the existing weakly supervised object detection methods highlight the most discriminative areas of the object, the method of the present invention introduces an unsupervised contrastive learning module, uses an adaptive method during testing to adjust the parameters of the unsupervised contrastive learning module, and simultaneously queries the similarity between the most discriminative area and the surrounding areas, and merges the areas with high similarity as the complete object area, thereby alleviating the problem that the weakly supervised object detector highlights the most discriminative areas of the object.

[0042] The method of the present invention solves the problems of high computational complexity and highlighting the most discriminative areas in the weakly supervised object detection method, reduces the requirements for hardware resources in the training / testing phase of the weakly supervised detector, and breaks through the limitation that the weakly supervised object detector lacks a positioning module with regression capability. The method of the present invention can be used for the research of practical application scenarios of aircraft detection and defect detection, and to a certain extent promotes the implementation of object detection technology based on artificial intelligence deep learning, which is in line with the development trend of intelligent manufacturing.

[0043] The method of the present invention can be used for object detection in the case where training data annotation information is scarce. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is an overall framework diagram of the weakly supervised object detection method based on region perception and test-time self-adaptation according to the present invention; in the figure, Frozen means freezing, and Tuned means training;

[0045] Figure 2 It is a bar chart comparing the number of primary candidate regions and preliminary complete target candidate regions; the number of candidate regions before refinement in the figure is the primary candidate regions, and the number of candidate regions after refinement is the preliminary complete target candidate regions;

[0046] Figure 3 It is a visualization comparison of the primary candidate region and the preliminary complete target candidate region;

[0047] Figure 4 It is a visual comparison diagram of the preliminary complete target candidate area and the final object detection result in the method of the present invention;

[0048] Figure 5 This is a schematic diagram of the classification results of the candidate regions by the existing trained ResNet50 or visual language model CLIP; the scores from top to bottom in the figure are 0.87, 0.55, 0.65, 0.73, 0.53 and 0.72 respectively. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0051] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.

[0052] Specific implementation method 1. Combination Figure 1 As shown, the present invention provides a weakly supervised object detection method based on region perception and test-time adaptation, which mainly includes two parts: region perception framework and test-time adaptation:

[0053] 1) Using a region-aware framework to obtain preliminary complete target candidate regions: including pre-training a ResNet50 network based on the visual language model CLIP, using the first three layers of the trained ResNet50 network as image encoder 1, and using the fourth layer of the trained ResNet50 network as image encoder 2;

[0054] Image encoder 1 obtains an original image feature map based on the original image; at the same time, multiple primary candidate regions are obtained from the original image; the primary candidate regions are combined with the original image feature map to obtain multiple aligned primary candidate region spatial feature maps; image encoder 2 is then used to obtain high-dimensional nonlinear features of the primary candidate region spatial feature map, and after an attention pooling operation, the global information of the primary candidate region is obtained as region embedding; at the same time, the original image-level label is encoded into a category embedding; a similarity map of the region score representing the primary candidate region is obtained based on the region embedding and the category embedding; a preset score threshold is used to filter the similarity map, and the primary candidate region exceeding the preset score threshold is used as a preliminary complete target candidate region;

[0055] 2) Adopting the test-time adaptive framework to obtain the object detection result: using a weakly supervised detector to predict the target position based on the preliminary complete target candidate area, obtaining the query area and key area of ​​the detection target; the query area and the key area are then fused through the unsupervised contrastive learning module to obtain the object detection result;

[0056] During the training process of the adaptive framework at test time, the network parameters of the weakly supervised detector are modified based on the weakly supervised loss to obtain the final weakly supervised detector; based on the query area of ​​the detection target, the key area of ​​the detection target is determined, and the network parameters of the unsupervised contrastive learning module are optimized according to the query area and the key area;

[0057] During the test fine-tuning process of the adaptive framework at test time, based on the query area and key area of ​​the detection target obtained by the weakly supervised detector, the cosine similarity of the query area and the key area is calculated, and the query area and the key area whose cosine similarity exceeds the similarity threshold are selected to further adjust the network parameters of the unsupervised contrastive learning module to obtain the final unsupervised contrastive learning module; the final weakly supervised detector and the final unsupervised contrastive learning module are used in actual object detection. The final unsupervised contrastive learning module can output a complete object area that incorporates areas with high similarity.

[0058] This implementation method filters the candidate regions that the existing weakly supervised methods rely on from a novel perspective, uses a region-aware framework to filter redundant candidate regions and saves candidate regions containing complete objects, and designs a dynamic prompt to guide the region-aware framework to align natural language text information and candidate regions, thereby reducing the computational complexity of the training and testing stages; in order to further alleviate the problem of the existing weakly supervised object detector highlighting the most discriminative region, the similarity between the most discriminative region and the surrounding region is queried, and the region with high similarity is merged as the complete object region. Based on this, the parameters of the unsupervised contrastive learning module are adjusted using a test-time adaptive method in the test stage, further alleviating the problem of the weakly supervised object detection method highlighting the most discriminative region of the object. This is of great significance for improving object detection performance.

[0059] Figure 1 The region-aware framework is used to align natural language text information and candidate regions, filter out redundant candidate regions, and save candidate regions containing complete objects; the test-time adaptive framework adaptively adjusts the parameters of the unsupervised contrastive learning module during testing.

[0060] In the region perception framework, this implementation decouples the ResNet50 network trained based on the large visual language model CLIP, and uses its first three layers and the fourth layer as feature extractors. Thousands of primary candidate region sets can be obtained from the original image. where bn Represents the nth primary candidate region. The main idea of ​​the region-aware framework is to refine the thousands of primary candidate regions mentioned above and retain the preliminary complete target candidate regions containing complete objects; the original image is input into the first three layers of ResNet50 to extract feature maps, and the region of interest alignment (ROI Align) operation is used to map the feature maps of the thousands of candidate regions mentioned above into spatial feature maps. The spatial feature maps contain the information of each primary candidate region, and the high-dimensional nonlinear features of the spatial feature maps of each region are extracted using the fourth layer of ResNet50. Finally, the global information of each primary candidate region is obtained using the attention pooling operation. According to the above-mentioned decoupled ResNet50, the region of interest pooling operation, and the attention pooling operation, this embodiment can obtain the global information representation of each primary candidate region. Compared with the traditional method of using a trained classifier to classify the cropped candidate region, this embodiment can retain the spatial position information of the candidate region. At the same time, in the region perception framework, Figure 1 The image-level labels shown in the figure, such as people, motorcycles, and background, are regarded as dynamic cues, focusing on the natural language information of the image-level labels; while the traditional weakly supervised detector only regards the image-level labels as supervisory signals and ignores the natural language information of the image-level labels. Since different input images contain different objects to be detected, the image-level labels are always changing dynamically. The dynamic cues are input to the text encoder trained based on the visual language model CLIP, and the dynamic cues are further encoded into category embeddings. based on and A similarity graph S representing the region score of each primary candidate region can be obtained region .

[0061] In this embodiment, combined with Figure 1 As shown, the method of obtaining multiple primary candidate regions from the original image is:

[0062] A plurality of primary candidate regions are obtained for the original image based on a selective search method or a multi-scale combined positioning method.

[0063] Furthermore, the method to encode the original image-level labels into category embeddings is:

[0064] The original image-level labels are used as dynamic prompt information and encoded into category embeddings through a text encoder trained based on the large visual language model CLIP.

[0065] In this implementation, the feature dimensions of region embedding and category embedding are the same.

[0066] As an example, the key area is determined as follows:

[0067] The key area is obtained by expanding the query area toward the periphery on the original image, and the expansion ratio is 20% of the corresponding size of the query area in the length direction and the width direction.

[0068] As an example, the preset score threshold is 0.4; the similarity threshold is 0.95.

[0069] Based on the similarity graph, a score threshold of 0.4 is used to filter out redundant candidate regions, and candidate regions containing complete objects are saved as preliminary complete target candidate regions to reduce computational complexity.

[0070] In this embodiment, the preliminary complete target candidate region is input into the weak supervision detector as the refined candidate region, such as Figure 2 The figure shows a bar chart comparing the number of primary candidate regions and preliminary complete target candidate regions. The weakly supervised detector predicts the location of the object to be detected in the input image and regards it as the query region. The surrounding area is cropped as the key region at a ratio of 20% of the width and height of the query region, and the cosine similarity between the query region and the key region is calculated. A low similarity score indicates that the query region and the key region do not need to be further fused, and the query region is already a complete object region. Therefore, a similarity threshold of 0.95 is set to screen out highly similar regions. The query region and the key region with high similarity are further used to optimize the parameters of the unsupervised contrastive learning module in the test phase, which improves the problem of the weakly supervised object detector highlighting the most discriminative object region, and further improves the detection performance of the weakly supervised detector.

[0071] It is worth noting that the image encoder and text encoder in the region-aware framework are frozen and do not participate in back-propagation and gradient updates.

[0072] In this embodiment, the similarity graph is represented by S region :

[0073]

[0074] In the formula For regional embedding, is the category embedding, d represents the feature dimension, N represents the number of primary candidate regions, and C represents the number of types of detected objects;

[0075]

[0076] Where T represents the text encoder trained based on the large visual language model CLIP, t class represents the original image-level labels.

[0077] In test-time adaptation, it is necessary to determine whether the query region is the most discriminative region. The cosine similarity between the query region and the key region is expressed as S(r,rn):

[0078]

[0079] Where r represents the index of the query region, rn represents the index of the key region corresponding to the query region r, represents the query area corresponding to index r, Indicates the key region corresponding to index rn.

[0080] Let L(r, rn) represent the list of cosine similarity scores of the query region and the key region, ξ represents the similarity threshold, then the list of cosine similarity scores of the query region and the key region exceeding the similarity threshold is represented as L * (r * ,rn * ):

[0081] L * (r * ,rn * )=L(r,rn)[S(r,rn)>ξ],

[0082] Where r * Indicates the index of the query region whose cosine similarity score exceeds the similarity threshold, rn * Indicates the corresponding r * The index of the key region.

[0083] This implementation sets a similarity threshold to determine whether the query area is the most discriminative area. If the cosine similarity exceeds the similarity threshold, the current query area is considered to be the most discriminative area. When it is the most discriminative area, the unsupervised contrastive learning module is optimized using a test-time adaptive method based on the corresponding query area during the test phase. Figure 1 As shown, the overall framework loss includes the weakly supervised detector loss L based on the weakly supervised example wsod Compared with unsupervised learning loss L al The weakly supervised detector loss L wsod Supervise existing weakly supervised object detectors in the overall framework. Contrastive loss L al Optimize the unsupervised contrastive learning module. It is worth noting that during the training process, the weakly supervised detector loss L wsod Compared with unsupervised learning loss L al Optimize the entire framework and only compare the learning loss L during testing al Optimize the entire framework and further optimize the parameters of the unsupervised contrastive learning module. According to the similarity threshold, the most discriminative region can be found, and the contrastive learning loss L can be further calculated.al Optimize the entire network framework, and the contrast loss of the unsupervised contrastive learning module is expressed as L al :

[0084]

[0085] In the formula Represents contrastive learning based predict The unsupervised loss is Represents contrastive learning based predict The unsupervised loss is

[0086] It represents the features obtained by the first branch of the unsupervised contrastive learning module after the query area determined based on the similarity threshold has been enhanced by the first data. It represents the features obtained by the branch 1 of the unsupervised contrastive learning module after the query area determined based on the similarity threshold is enhanced by the second data;

[0087] It means that the query area determined based on the similarity threshold is selected by the unsupervised contrastive learning model after the first data enhancement.

[0088] The features obtained by branch 2 of the block are, It represents the features obtained by the second branch of the unsupervised contrastive learning module after the query area determined based on the similarity threshold undergoes the second data enhancement.

[0089] The model can be trained using the VOC2007 and VOC2012 datasets. VOC2007 contains 9963 images and there are 20 categories of objects to be detected. There are 5011 training samples in the dataset to train the model in this embodiment, and 4952 test images are used to evaluate the accuracy of the model. The VOC2012 dataset contains 22531 images and there are 20 categories of objects to be detected. There are 11540 training samples in the dataset for training the model in this embodiment, and 10991 test images are used to evaluate the accuracy of the model. The experimental results follow the official evaluation indicators, that is, the accuracy mAP of the model is evaluated on the test set, the correct positioning performance CorLoc of the model is evaluated on the training set, and the computational complexity GFLOPs of the model is evaluated on the test set.

[0090] In the region-aware framework, the threshold for filtering redundant candidate regions is set to 0.4, and in the test-time adaptation, the similarity threshold between the query region and the key region is set to 0.95. Above this threshold, the query region is considered to be the most discriminative region, so as to optimize the parameters of the weakly supervised object detector in the test phase. OD-WSCL and OICR are selected as baseline models. For fair comparison, the optimizer and learning rate used in training the baseline model and the unsupervised contrastive learning module it contains adopt the initial paradigm. Specifically, the AdamW optimizer is used, the initial learning rate is 0.00015, the weight decay is 0.000001, and the batch size is set to 8. The warmwp strategy is used in the first 30 epochs of the unsupervised contrastive learning module, and the learning rate conforms to the cosine decay rule. The code of this method is based on PyTorch and trained using 8 RTX6000 GPUs.

[0091] It has been verified that the method of the present invention breaks through the problem that the existing weakly supervised object detector relies on thousands of candidate regions to improve the recall rate, which leads to increased computational complexity. At the same time, it overcomes the disadvantage that the weakly supervised object detector converts the detection task into a classification task, converges to a local optimal solution during the training process, and highlights the region of optimal discrimination of the object to be detected. This proves that the method of the present invention can reduce the computational complexity of the original weakly supervised object detector, mine the complete object region, and improve the detection performance of the weakly supervised object detector.

[0092] The method of the present invention improves the problems of high computational complexity and highlighting the most discriminative areas in traditional weakly supervised object detectors. The complete object area is obtained by fusing areas with high similarity, and the parameters of the unsupervised contrastive learning module are adaptively optimized during the test phase, further improving the problem of highlighting the most discriminative areas in weakly supervised object detectors.

[0093] Next, the model of the present invention is trained and tested on the common VOC2007 and VOC2012 datasets to verify the effectiveness of the method proposed in the present invention, and the visualization results on the VOC2007 and VOC2012 test sets are shown.

[0094] (1) Effectiveness analysis of the region awareness framework and the adaptive method during testing:

[0095] The effectiveness of the region-aware framework and the test-time adaptive method is demonstrated on the general dataset VOC2012. Compared with the baseline model OD-WSCL, as can be observed in Table 1, the detection performance mAP of the region-aware framework is improved by 0.7% (from 54.3% to 55.0%). Combined with the designed dynamic prompt region-aware framework, the retained high-quality candidate regions are concentrated in the complete object area, further improving the detection performance. At the same time, on this basis, the test-time adaptive method is introduced, and the detection performance is improved by 0.3% (from 55.0% to 55.3%). The test-time adaptive method improves the problem of weakly supervised object detectors highlighting the most discriminative areas, further improving the detection performance. This proves the effectiveness of the region-aware framework and test-time adaptation proposed in the present invention.

[0096] Table 1. Effectiveness analysis of region awareness framework and test-time adaptive methods

[0097]

[0098] (2) Comparison between the proposed method and the baseline model on the VOC2012 test set:

[0099] In order to further verify the effectiveness of the method of the present invention, OD-WSCL and OICR are used as baseline models, and the method proposed by the present invention is experimented on the VOC2012 dataset. The results are shown in Table 2. According to the region perception and test-time adaptive methods proposed by the present invention, 55.3% and 54.9% mAP are obtained respectively, which are 1.0% and 4.7% higher than the baseline model. At the same time, the method of the present invention calculates GFLOPs for the first 100 images of VOC2012. According to the last column of Table 2, the GFLOPs of the baseline model are 760.34 and 362.28. After filtering the redundant candidate regions by the region perception framework, the computational complexity of the baseline model is reduced to 597.28 and 303.15 respectively, reducing the computational complexity by about 20%, further proving the effectiveness and universality of the method of the present invention on multiple baseline models.

[0100] Table 2 Comparison of the proposed method and the baseline model on the VOC2012 test set

[0101]

[0102] (3) Accuracy comparison on the VOC2012 test set:

[0103] Table 3 shows the comparison data under the VOC2012 test set, and various methods are evaluated using mAP, a standard evaluation index in the field of weakly supervised object detection. From the comparison data, it can be seen that the object detection method based on region perception and test-time adaptation proposed by the method of the present invention obtains 55.3% mAP, which is the highest accuracy compared with other weakly supervised object detectors, and improves 1.0% mAP compared with the most advanced weakly supervised object detectors.

[0104] Table 3 Accuracy comparison on the VOC2012 test set

[0105]

[0106] (4) Comparison of correct positioning performance on the VOC2012 training set:

[0107] Table 4 shows the comparison data under the VOC2012 training set, and the standard evaluation index CorLoc in the field of weakly supervised object detection is used to evaluate each method. From the comparison data, it can be seen that the object detection method based on regional perception and test-time adaptation proposed in the present invention obtains 71.7% CorLoc, which exceeds the baseline model OD-WSCL detector by 0.5% CorLoc. Compared with other weakly supervised object detectors, competitive results are achieved, because the existing weakly supervised object detector can be used as the baseline model of the present invention. When the present invention is based on a more advanced baseline model, it can further obtain better CorLoc results.

[0108] Table 4 Comparison of correct positioning performance on the VOC2012 training set

[0109]

[0110] (5) Comparison of accuracy on the VOC2007 test set and correct positioning performance on the training set:

[0111] Table 5 shows the comparative data under the VOC2007 dataset. It can be seen from the comparative data that the object detection method based on region perception and test-time adaptation proposed in the present invention achieved 58.3% mAP, which is the highest accuracy compared with other weakly supervised object detectors, and improved by 0.5% mAP compared with the most advanced weakly supervised object detectors. At the same time, the method of the present invention achieved 69.3% CorLoc, exceeding the baseline model OD-WSCL detector by 0.2% CorLoc. Compared with other weakly supervised object detectors, competitive results have been achieved, because the existing weakly supervised object detectors can be used as the baseline model of the present invention, so when the present invention is based on a more advanced baseline model, it can further obtain better CorLoc results. Therefore, the effectiveness of the present method is further demonstrated on the VOC2007 dataset.

[0112] Table 5 Comparison of accuracy on the VOC2007 test set and correct positioning performance on the training set

[0113]

[0114] (6) Visualization results:

[0115] Figure 3 The visualization comparison of the primary candidate regions and the preliminary complete target candidate regions is shown; the first column is the primary candidate regions obtained based on selective search, and the second column is the preliminary complete target candidate regions. It can be seen that the region perception framework successfully filters out redundant candidate regions and preserves the candidate regions containing complete objects. Figure 2 As shown, the number of preliminary complete target candidate regions is reduced by 20% relative to the number of primary candidate regions, reducing the computational complexity of the weakly supervised object detector. Figure 4 A visual comparison chart of the preliminary complete target candidate region and the final object detection results is shown. The first and third rows show the detection results of the baseline model, and the second and fourth rows show the detection results of the method proposed in the present invention. In the second row, it can be observed that the method of the present invention filters out the most discriminative regions (incomplete object regions), such as partial regions of cat heads, human heads, and ships. Thanks to the region-aware framework and dynamic prompts, the method of the present invention fully understands the natural language information of the image-level labels and further preserves the regions containing complete objects. In the fourth row, it can be observed that the detection results contain complete objects or most of the complete objects. According to the region-aware framework and the test-time adaptive method, the present invention preserves high-quality candidate regions and finds missing object regions compared to the baseline model.

[0116] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. It should therefore be understood that many modifications may be made to the exemplary embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that the various dependent claims and features described herein may be combined in a manner different from that described in the original claims. It should also be understood that the features described in conjunction with a single embodiment may be used in other described embodiments.

Claims

1. A weakly supervised object detection method based on region perception and test-time adaptation, characterized in that: 1) Using a region-aware framework to obtain preliminary complete target candidate regions: including pre-training a ResNet50 network based on the visual language model CLIP, using the first three layers of the trained ResNet50 network as image encoder 1, and using the fourth layer of the trained ResNet50 network as image encoder 2; Image encoder 1 obtains an original image feature map based on the original image; at the same time, obtains multiple primary candidate regions from the original image; combines the primary candidate regions with the original image feature map to obtain multiple aligned primary candidate region spatial feature maps; Then, the image encoder 2 is used to obtain the high-dimensional nonlinear features of the spatial feature map of the primary candidate region. After the attention pooling operation, the global information of the primary candidate region is obtained as the region embedding. At the same time, the original image-level label is encoded into the category embedding. Based on the region embedding and the category embedding, a similarity map representing the region score of the primary candidate region is obtained. The similarity graph is filtered using a preset score threshold, and the primary candidate regions exceeding the preset score threshold are used as preliminary complete target candidate regions; 2) Adopting the test-time adaptive framework to obtain the object detection results: including using a weakly supervised detector to predict the target position based on the preliminary complete target candidate area, and obtaining the query area and key area of ​​the detection target; The query area and the key area are then fused through the unsupervised contrastive learning module to obtain the object detection result; During the training process of the adaptive framework at test time, the network parameters of the weakly supervised detector are modified based on the weakly supervised loss to obtain the final weakly supervised detector; based on the query area of ​​the detection target, the key area of ​​the detection target is determined, and the network parameters of the unsupervised contrastive learning module are optimized according to the query area and the key area; During the test fine-tuning process of the adaptive framework at test time, the cosine similarity of the query area and the key area of ​​the detection target obtained by the weakly supervised detector is calculated, and the query area and the key area whose cosine similarity exceeds the similarity threshold are selected to further adjust the network parameters of the unsupervised contrastive learning module to obtain the final unsupervised contrastive learning module; the final weakly supervised detector and the final unsupervised contrastive learning module are used in actual object detection.

2. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 1, characterized in that: The method of obtaining multiple primary candidate regions from the original image is: A plurality of primary candidate regions are obtained for the original image based on a selective search method or a multi-scale combined positioning method.

3. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 2, characterized in that: The method to encode the original image-level labels into category embeddings is: The original image-level labels are used as dynamic prompt information and encoded into category embeddings through a text encoder trained based on the large visual language model CLIP.

4. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 3, characterized in that: The feature dimensions of region embedding and category embedding are the same.

5. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 4, characterized in that: The key area is determined as follows: The key area is obtained by expanding the query area toward the periphery on the original image, and the expansion ratio is 20% of the corresponding size of the query area in the length direction and the width direction.

6. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 5, characterized in that: The preset score threshold is 0.4; the similarity threshold is 0.

95.

7. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 6, characterized in that: The similarity graph is represented by S region : In the formula For regional embedding, is the category embedding, d represents the feature dimension, N represents the number of primary candidate regions, and C represents the number of types of detected objects; Where T represents the text encoder trained based on the large visual language model CLIP, t class represents the original image-level labels.

8. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 7, characterized in that: The cosine similarity between the query region and the key region is denoted as S(r,rn): Where r represents the index of the query region, rn represents the index of the key region corresponding to the query region r, represents the query area corresponding to index r, Indicates the key region corresponding to index rn.

9. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 8, characterized in that: Let L(r, rn) represent the list of cosine similarity scores of the query region and the key region, ξ represents the similarity threshold, then the list of cosine similarity scores of the query region and the key region exceeding the similarity threshold is represented as L * (r * ,rn * ): L * (r * ,rn * )=L(r,rn)[S(r,rn)>ξ], Where r * Indicates the index of the query region whose cosine similarity score exceeds the similarity threshold, rn * Indicates the corresponding r * The index of the key region.

10. The method for weakly supervised object detection based on region perception and test-time adaptation according to claim 9, characterized in that: The contrastive loss of the unsupervised contrastive learning module is denoted as L al : In the formula Represents contrastive learning based predict The unsupervised loss is Represents contrastive learning based predict The unsupervised loss is It represents the features obtained by the first branch of the unsupervised contrastive learning module after the query area determined based on the similarity threshold has been enhanced by the first data. It represents the features obtained by the branch 1 of the unsupervised contrastive learning module after the query area determined based on the similarity threshold is enhanced by the second data; It represents the features obtained by the second branch of the unsupervised contrastive learning module after the query area determined based on the similarity threshold has been enhanced by the first data. It represents the features obtained by the second branch of the unsupervised contrastive learning module after the query area determined based on the similarity threshold undergoes the second data enhancement.

Citation Information

Patent Citations

  • Target detection method based on weak supervised learning and occlusion perception

    CN110348437A

  • Weak supervision object detection method based on surrounding area perception and association

    CN115439688A

  • Weakly-supervised sound event detection method and system based on adaptive hierarchical pooling

    GB202307040D0

  • Person re-identification method combining reverse attention and multi-scale deep supervision

    US20210232813A1

Cited By

  • Self-adaptive enhanced weak supervision Hash retrieval method and self-adaptive enhanced weak supervision Hash retrieval system

    CN119441522A

  • Active learning method for obtaining function based on uncertainty and diversity

    CN119723202A

  • Active learning method based on uncertainty and diversity acquisition function

    CN119723202B