A multi-modal guided feature enhancement method for few-shot object detection

By employing multimodal guided feature enhancement and offline classification correction, the problems of prototype overfitting and classification confusion in extremely low-sample scenarios are solved, improving the stability and robustness of low-sample target detection and reducing annotation costs.

CN123160931APending Publication Date: 2026-11-24CHONGQING UNIV OF TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611085833.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing few-sample target detection technologies suffer from prototype overfitting, classification confusion, and low prediction confidence in extremely few-sample scenarios. Furthermore, existing diffusion generation methods cannot effectively supplement intra-class diversity, increasing annotation costs or generating noise.

Method used

A multimodal guided feature enhancement method is adopted, which generates diffusion reconstruction samples through text semantics and target mask constraints. Combined with a unified feature extraction network and temperature normalization processing, feature mapping and classification correction are performed to form dual constraints to improve detection stability.

Benefits of technology

It effectively supplements intra-class diversity, reduces prototype overfitting, improves the stability and robustness of classification results, reduces annotation costs, and adapts to detection tasks under extremely low sample conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160931A_ABST
    Figure CN123160931A_ABST
Patent Text Reader

Abstract

This invention discloses a multimodal guided feature enhancement method for few-shot target detection, belonging to the field of computer vision target detection technology. It involves acquiring a support set and a query image, constructing dual constraints by combining textual semantics and target masks to generate expanded samples, extracting features through a unified feature extraction network, enhancing the query image features based on the support sample features, fusing features from the original and reconstructed samples to construct a category fusion prototype, calculating the similarity between the query candidate region features and the prototype, obtaining the prototype confidence distribution after normalization, and then weighted and fused with the detector's native classification probability. Target selection and detection are then performed based on the corrected scores. This invention leverages multimodal constraints to achieve controllable sample generation, enriching category visual representations and mitigating representation bias caused by single samples. Simultaneously, a lightweight offline correction mechanism optimizes classification results, improving the stability and robustness of detection in extremely few-shot scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision target detection technology, and specifically to a few-sample target detection method with multimodal guided feature enhancement. Background Technology

[0002] The rapid development of artificial intelligence and computer vision technologies has led to the widespread application of object detection in fields such as security monitoring, industrial quality inspection, autonomous driving, and remote sensing. Traditional object detection models rely on massive amounts of labeled samples for training. When faced with scenarios where sufficient labeled data is difficult to obtain, such as new detection categories, niche application scenarios, or field monitoring, model performance suffers a significant decline. Few-shot object detection aims to identify and locate new object classes using only a small number of labeled samples, or even just a single labeled sample, and has become a research hotspot in the field of computer vision. In extreme few-shot scenarios such as 1-shot, where the support set contains only a single object instance, the class prototype extracted by the model becomes overly reliant on the appearance, pose, and background features of a single sample, leading to prototype overfitting and a significant reduction in cross-scenario generalization ability. Furthermore, the lack of sample diversity can cause frequent classification confusion, low prediction confidence, false positives, and false negatives during detection, greatly limiting the practical application of few-shot object detection technology. To address the problem of scarce samples, generative models are often used in the industry for data augmentation. Among them, diffusion models, with their powerful image reconstruction and detail generation capabilities, have become the mainstream choice for expanding small sample datasets. However, unconstrained diffusion generation modes can lead to new technical challenges.

[0003] Currently, the academic community has conducted extensive research on few-shot object detection and data augmentation using diffusion models. MetaR-CNN, a classic meta-learning framework included in ICCV 2019, is one of the baseline algorithms in the field of few-shot object detection. This algorithm is based on Faster R-CNN, performing meta-learning based on RoI features, building a dual-branch structure of support and query branches, and relying on class prototypes to complete new class detection. It has been used as a basic framework in many subsequent studies. With the rise of diffusion models, many studies have introduced them into few-shot tasks, attempting to supplement intra-class variations by generating synthetic samples. For example, some studies directly perform unconstrained diffusion generation on the original support images, while others combine simple text prompts to guide sample generation. However, existing academic solutions generally have significant drawbacks. On the one hand, images generated solely through random diffusion are prone to problems such as target position shift, scale distortion, semantic drift, and amplified background noise. This not only fails to effectively supplement valid samples but also introduces interference noise into the prototype learning process, further reducing detection accuracy and localization stability. On the other hand, relying solely on text-guided diffusion lacks spatial constraints, resulting in poor matching between generated samples and original bounding boxes. This necessitates secondary manual annotation, contradicting the design principle of low-annotation-cost techniques for few-shot applications. Furthermore, most existing studies focus only on sample augmentation during the training phase, neglecting the issues of unstable classification scores and inter-class confusion during the inference phase. They have failed to develop an optimization scheme for the entire training and inference process, leaving significant room for improvement in detection performance under extremely few-shot scenarios.

[0004] Several patented technologies for few-shot object detection have also been proposed in China. Among them, Chinese patent CN117036897A discloses a few-shot object detection method based on Meta R-CNN, which adopts the classic Meta R-CNN method. The R-CNN dual-branch architecture, by optimizing the candidate region selection logic and feature fusion method, improves the detection capability in common few-shot scenarios to a certain extent and is adaptable to various general visual detection scenarios. This patent improves the feature extraction and matching process based on the original meta-learning paradigm, eliminating the need for additional complex network structures and offering lightweight and easy deployment. However, this technology has significant shortcomings in extremely few-shot scenarios such as 1-shot: First, it does not introduce generative data augmentation methods, relying entirely on the original few supporting samples to construct category prototypes. This fails to address the core issues of insufficient intra-class diversity and prototype overfitting caused by single samples. When sample poses and backgrounds are specific, the model's generalization ability drops sharply. Second, the patent does not set up a dedicated classification correction mechanism, relying solely on the detector's native classification head output during the inference stage. This easily leads to classification errors and confidence fluctuations between categories with low feature discriminative power. Third, the scheme does not incorporate multimodal information for auxiliary modeling and cannot utilize external prior knowledge such as textual semantics to strengthen category representation. Performance bottlenecks are prominent in scenarios with extremely scarce sample information, making it difficult to meet high-precision detection requirements.

[0005] In summary, existing academic research and related domestic patents either fail to achieve precise constraints on the diffusion generation process, resulting in a large number of invalid synthetic samples and increased annotation costs, or they only perform local optimizations on the basic detection framework, failing to simultaneously address sample augmentation during the training phase and score calibration during the inference phase. Neither approach can completely solve a series of problems such as prototype overfitting, classification confusion, and low prediction confidence in scenarios with extremely few samples. Summary of the Invention

[0006] To address the aforementioned technical problems, this application discloses a multimodal guided feature enhancement method for few-shot target detection, comprising the following execution steps:

[0007] S1. Collect the support set images and query images for the few-sample detection task, construct the dual-constraint multimodal guiding conditions composed of text semantics and target mask, call the diffusion model to perform local controllable reconstruction of the support set images, and generate expanded and reconstructed support samples;

[0008] S2. A unified feature extraction network is used to extract the depth features of the original support samples, reconstructed support samples, and candidate regions of the query image, and the query image features are enhanced by the feature enhancement mapping process based on the features of all support samples.

[0009] S3. Integrate the original support sample features and reconstructed support sample features to calculate the fusion prototype vector for each category, and obtain the matching similarity between the query candidate region features and the fusion prototype vector;

[0010] S4. Perform temperature-scale normalization on the similarity to obtain the prototype confidence distribution, and simultaneously obtain the classification probability distribution output by the detector's native classification head;

[0011] S5. The weighted fusion of the prototype confidence distribution and the detector's original classification probability distribution yields the corrected classification score. Based on the corrected score, valid target boxes are selected to complete the detection of targets with few samples.

[0012] Preferably, the process of constructing text semantic guidance conditions in S1 is as follows:

[0013] Read the target category identifier corresponding to a single supporting sample The WordNet database is retrieved to obtain the category-specific definition text. ,satisfy ;

[0014] Fixed format prompt template With the explanatory text Inputting the same text into a large language model generates refined semantic prompt text that adapts to the input format of the diffusion model. ,satisfy .

[0015] Preferably, in S1, target mask constraints are constructed and diffusion image reconstruction is performed, with the original supporting image denoted as... Generate a binary target mask based on the image bounding box. The pixel value inside the mask is 1, and the background pixel value is 0;

[0016] Diffusion Reconstruction Image Calculation formula: ;

[0017] In the formula This represents the element-wise multiplication operation of tensors. For the forward sampling operation of the diffusion model, image content reconstruction is performed only in the target area covered by the mask, while the background area retains the original image pixels completely.

[0018] Preferably, the unified feature extraction network in S2 is denoted as... For query images Global feature extraction ;

[0019] Support features are extracted image by image from all original and reconstructed support images. The set of all support features for a single category is denoted as . ;

[0020] Set learnable scaling weights Dimensional adaptation projection matrix Feature channel dimension Query Enhancement Features Calculation formula: .

[0021] Preferably, in S3, the initial prototype vector corresponding to the original support sample of a single class is calculated first. The formula is: The number of original support samples for a single category is , No. Class 1 Zhang's original supporting image is .

[0022] Preferably, in S3, the fused and reconstructed sample features are used to obtain the final category fusion prototype vector. The formula is: The number of reconstructed samples generated from a single original supporting image is , No. Class 1 Zhang Yuantu corresponds to the first Zhang reconstructed image is .

[0023] Preferably, in S3, the query image is extracted. Regional features of candidate boxes The formula is: ,in This represents the RoIAlign region alignment sampling operation; the original image being queried is... , No. The coordinates of the candidate boxes are ;

[0024] Calculate candidate region features and the first Cosine similarity of class fusion prototype vectors The formula is: .

[0025] Preferably, in step S4, a normalized softmax operation with a temperature coefficient is performed on the cosine similarity, and the prototype confidence score is output. The formula is: ;

[0026] In the formula This is the temperature scale coefficient. This is the set of all target categories to be identified in this detection task.

[0027] Preferably, the detector's native classification head output in S4 is the first... The original predicted logits vector of each candidate box. The native classification probability of the detector is obtained by standard softmax operation. Calculation formula: .

[0028] Preferably, S5 sets the fusion weighting coefficient. The final corrected classification score is obtained by weighted fusion of the prototype confidence score and the detector's native classification probability. Calculation formula: ;according to The numerical value is used to perform non-maximum suppression and target category determination on all candidate boxes, and the detection results are output.

[0029] Compared with the prior art, the technical solution of this application has the following technical effects:

[0030] This invention uses a dual-constraint guided diffusion model to reconstruct images by combining textual semantics with target masks, accurately limiting the areas of image change and content semantics. The entire generation process only performs reasonable transformations on the appearance details and morphology of the target ontology, while the background region remains unchanged. The generated samples can directly use the original annotation information without additional manual annotation work. This approach effectively expands the intra-class diversity of supported samples, enriches the visual representation corresponding to the category, weakens the representation bias caused by single sample features from the source, allows the model to learn a more comprehensive distribution of target features, and improves the expressive ability of category prototypes.

[0031] This invention employs a unified feature extraction network to extract various image features and enhances the query image features based on supporting sample features. The feature enhancement process uses learnable parameters and a weight matrix to perform feature mapping and fusion, strengthening the correlation between query features and category features. The enhanced query features possess stronger feature representation capabilities, better adapting to the feature matching logic of few-shot detection tasks, and simultaneously optimizing the discriminability and correlation between features.

[0032] This invention integrates features from original and reconstructed samples to construct a category fusion prototype. An independent confidence evaluation system is established based on the similarity between the prototype and candidate region features. After similarity normalization using a temperature coefficient, the prototype confidence distribution is obtained. This distribution is then weighted and fused with the detector's native classification probability to achieve lightweight calibration of the classification results. This correction method operates during the inference phase, eliminating the need to retrain the original network. The module is pluggable and can be smoothly embedded into various detection frameworks, continuously optimizing the stability of the classification output.

[0033] This invention combines two main modules: multimodal guided feature enhancement and offline classification correction, which are applied to the model training and inference phases, respectively. During training, sufficient intra-class sample variants are added to alleviate prototype overfitting; during inference, classification scores are corrected to reduce class confusion. These two stages work synergistically to optimize performance. The entire solution does not increase network model parameters, and the overall computational cost remains reasonable. While ensuring a simple and efficient detection process, it comprehensively improves the stability and robustness of few-sample target detection.

[0034] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings.

[0035] The above and other objects, advantages and features of this application will become more apparent to those skilled in the art from the following detailed description of specific embodiments in conjunction with the accompanying drawings. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0037] Based on the description of the figures and their corresponding technical content in the document, the titles of the figures are as follows:

[0038] Figure 1 This is a flowchart illustrating the overall process of a multimodal guided feature enhancement method for few-sample target detection according to the present invention.

[0039] Figure 2 This is a schematic diagram of the overall architecture of the multimodal guided feature enhancement and offline correction detection network of the present invention;

[0040] Figure 3 This is a comparison chart of detection accuracy and sample generation effect corresponding to different diffusion sampling steps in this invention;

[0041] Figure 4 This is a line graph comparing the detection accuracy of this invention with various mainstream few-shot detection algorithms for different categories.

[0042] Figure 5The image shows the effect of the five types of target augmentation and reconstruction support samples generated by the multimodal diffusion model of this invention;

[0043] Figure 6 This is a visualization of the results of target bounding box detection and recognition of five types of test images using the method of the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. In the following description, specific details such as specific configurations and components are provided merely to help fully understand the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. In addition, for clarity and brevity, descriptions of known functions and structures are omitted in the embodiments.

[0045] It should be understood that the phrase "an embodiment" or "this embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "an embodiment" or "this embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0046] Furthermore, reference numerals and / or letters may be repeated in different examples within this application. Such repetition is for the purpose of simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed.

[0047] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" in this article describes another type of relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " in this article generally indicates that the related objects before and after it are in an "or" relationship.

[0048] In this article, the term "at least one" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.

[0049] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion.

[0050] Example 1

[0051] This embodiment mainly describes a multimodal guided feature enhancement method for few-sample target detection, such as... Figure 1 As shown, the execution steps are as follows:

[0052] S1. Collect the support set images and query images for the few-sample detection task, construct the dual-constraint multimodal guiding conditions composed of text semantics and target mask, call the diffusion model to perform local controllable reconstruction of the support set images, and generate expanded and reconstructed support samples;

[0053] S2. A unified feature extraction network is used to extract the depth features of the original support samples, reconstructed support samples, and candidate regions of the query image, and the query image features are enhanced by the feature enhancement mapping process based on the features of all support samples.

[0054] S3. Integrate the original support sample features and reconstructed support sample features to calculate the fusion prototype vector for each category, and obtain the matching similarity between the query candidate region features and the fusion prototype vector;

[0055] S4. Perform temperature-scale normalization on the similarity to obtain the prototype confidence distribution, and simultaneously obtain the classification probability distribution output by the detector's native classification head;

[0056] S5. The weighted fusion of the prototype confidence distribution and the detector's original classification probability distribution yields the corrected classification score. Based on the corrected score, valid target boxes are selected to complete the detection of targets with few samples.

[0057] Furthermore, this application's method is built upon the classic Meta R-CNN framework, still employing a two-branch paradigm of support and query branches to complete the new class detection task. By introducing semantic priors as conditional references, this application further addresses more extreme few-shot scenarios, focusing on the insufficient intra-class variation information caused by the extreme scarcity of support samples under 1-shot extreme conditions. In this scenario, class representations are often easily influenced by the local appearance features of a single sample, occlusions, and background interference, causing the model to learn discrimination patterns with significant sample specificity during the adaptation phase. As a result, the model's generalization ability in cross-scene testing tends to decline, classification score stability is insufficient, and false positives and false negatives are more likely to occur.

[0058] While maintaining the original process of introducing semantic priors as conditional references, this application introduces lightweight functional modules from the perspectives of feature information supplementation and classification decision stability. The aim is to improve the model's adaptability to extremely low sample conditions with minimal structural changes, and enhance the robustness and overall performance of new class detection.

[0059] As shown in Figure 2, the method in this application mainly consists of two modules. The first part is the Multimodal Guided Feature Enhancement (MGFE) module. This module uses multimodal priors to supplement the support set with richer and semantically consistent representation information, thereby expanding the coverage of intra-class variations and reducing the representation bias caused by single samples, thus providing a more generalizable class representation foundation for subsequent detection processes. The second part is the Offline Classification Corrector (OCC). This module performs consistency calibration on the query branch classification output based on the class representation obtained by support branch aggregation, and corrects the classification score through a fusion mechanism to reduce the risk of class confusion and high-confidence misjudgment, making the prediction confidence distribution more stable and reliable.

[0060] In summary, this application employs a combined strategy of multimodal guided enhancement and offline classification correction to specifically address the issues of insufficient information and unstable decision-making under extremely limited sample conditions. This approach not only improves the generalization ability of new class representations but also enhances the stability and robustness of detection results.

[0061] Furthermore, in the extreme single-sample setting of few-shot object detection, each class contains only one support sample, resulting in a near-absence of intra-class diversity. This makes the class prototypes estimated from the support set prone to overfitting to the local appearance, pose, or background interference of a single sample, thus weakening the generalization ability to variations in the query image distribution. Diffusion models have strong image generation capabilities and can usually generate new sample variants without additional training for downstream detection tasks, making them an effective means of expanding the support set and supplementing intra-class variation information. However, in real-world detection scenarios, directly using diffusion-generated results for few-shot detection often introduces additional noise. On one hand, the stability of the generated results is limited; the consistency between the target appearance details and the category semantics may fluctuate, leading to unstable quality of generated samples. On the other hand, the target position and scale may shift during the generation process, making the original bounding boxes and target regions inaccurate. Re-annotating these generated samples increases additional manual costs, which is inconsistent with the low annotation cost goal emphasized in few-shot settings.

[0062] To alleviate the aforementioned problems, this application proposes a refined diffusion enhancement strategy, employing a joint design of semantic fine-grained constraints and target mask position constraints to perform multimodal guided feature enhancement (MGFE). The goal of this strategy is to generate new support samples that can directly reuse the original bounding boxes without increasing the cost of manual annotation, and to naturally integrate them into the existing prototype learning and detection framework to supplement intra-class variation information and improve overall detection performance. Specifically, for a support image, firstly, based on its corresponding category name... Retrieve more specific category definitions from external knowledge bases:

[0063]

[0064] WordNet is an open-source database that allows users to retrieve relevant definitions by name. Then, based on a specific template, LLM is used for semantic rewriting, resulting in semantics more suitable for the diffusion model.

[0065]

[0066] The `template` is a predefined, generic cue word template (e.g., the definition of `{class_name}` is rewritten as a natural, concise cue to make it suitable for the diffusion model and include more realistic details. It guides the model to generate an image containing a single, realistic `{class_name}`, whose description is clear and authentic. Only the final cue is output, with a maximum of 30 characters. Definition: `{definition}`). A binary mask is then constructed from the bounding box (bbox) of that class. Where m=1 represents the target region to be edited, and m=0 represents that the background remains unchanged. The process of reconstructing a new sample using the diffusion model can then be represented as:

[0067]

[0068] in For element-wise multiplication, For the original image, For diffusion operation, This is the reconstructed image. The explicit constraint only changes within the masked area, fundamentally suppressing target drift and background perturbation. This allows the original bounding boxes to be directly reused in most cases, thus avoiding additional annotation costs. Simultaneously, semantic cues... It provides richer class-related information, offering more specific diffusion targets for the diffusion model. Subsequently, the reconstructed support set is used to enhance the query features:

[0069]

[0070]

[0071] in For feature extractor, For the number of categories, For learnable parameters, This is a shared weight matrix.

[0072] In summary, the refined diffusion enhancement method proposed in this application improves the usability and effectiveness of generated samples by combining semantic constraints and mask constraints. Semantic constraints ensure that the generated results maintain semantic consistency with the target category and enhance the rationality and transferability of appearance detail changes. Mask constraints limit the variation region during the generation process, stabilize the target spatial location, and keep the background region as unchanged as possible, enabling the generated samples to directly reuse the original annotation information without additional manual annotation or secondary training. By introducing these enhanced samples into the subsequent feature learning and detection process, the method effectively alleviates the prototype overfitting problem caused by a single sample in 1-shot scenarios, improves intra-class variation coverage, and further enhances the overall detection performance of the model.

[0073] Furthermore, this application includes an Offline Classification Corrector (OCC), primarily designed to alleviate classification confusion and low confidence issues that commonly occur in few-shot detection tasks, while also making fuller use of intra-class variation information provided by reconstructed support samples. This module does not alter the original detector's network structure or training process; it only corrects the class scores output by the detector during the inference phase. Specifically, the module first constructs class prototypes using the support set and its reconstructed samples and caches them offline. Then, it calculates the similarity between candidate region features and each class prototype to obtain a normalized score, which is then fused with the detector's classification head output to obtain a more stable and reliable final class prediction result. This method requires no additional training and can be plugged into existing detection frameworks to reduce class confusion and false detection problems.

[0074] Let the first The support set of the class is ,in Indicates the first The class of One supporting image, This represents the bounding box of the corresponding target instance in the image. Let be the number of supporting samples for this category. Let the feature extractor be denoted as . In classic prototyping, a class prototype is typically defined as the mean of the features that support the class's samples.

[0075]

[0076] In scenarios with extremely few samples The sample is highly sensitive to the appearance and imaging conditions of a single sample, and the estimated variance of the class center increases significantly. Therefore, the reconstructed support samples generated in the previous section are used as a basis for further analysis. (Each supporting sample generation) (one), construct a new support set Furthermore, a weighted approach is used to fuse the original prototype and the enhanced prototype to reduce the risk of overfitting.

[0077]

[0078] The above Initialization is performed only before inference, and similarity calculation and score fusion are performed with query features afterward, thus featuring offline, lightweight and pluggable characteristics.

[0079] For query images The detector generates a set of candidate boxes. and using the same feature extractor as the supporting branch. Obtain the RoI representation for each candidate region. (Note: The original text contains some formatting errors and inconsistencies. A Operation is Then the first The features of each candidate region can be written as:

[0080]

[0081] Because it supports sharing the same feature extractor between the image and the query image. ,so and Those within the same feature space and with consistent dimensions can be directly measured for similarity. This application uses cosine similarity to calculate the similarity between RoIs and prototypes of each category:

[0082]

[0083] The similarity is then normalized along the category dimension to obtain the prototype-based category confidence distribution (prototype score):

[0084]

[0085] in The temperature coefficient is set to 0.07 in this application, and C is the set of categories involved in the discrimination. On the other hand, the detector's original classification head... RoI output logits The classification probability for category c is:

[0086]

[0087] The offline classification corrector uses a weighted fusion of the two scores to correct the original class prediction:

[0088]

[0089] in As a hyperparameter, this application sets it to 0.5. Ultimately, it is... The category scores are used for thresholding and NMS. Through this process, the reconstructed support samples are not only used to improve intra-class diversity and representation coverage, but also to provide a stable supplementary signal for RoI classification in the form of prototype metrics. This improves the classification reliability and overall robustness of few-shot detection on new classes without introducing additional training and manual annotation.

[0090] This embodiment generates diverse extended support samples based on text semantics and target mask constraints, enriching the distribution of category visual features and weakening single-sample prototype bias. The feature enhancement stage brings the query features and category features closer together. The prototype constructed by fusing original and reconstructed features has a complete representation range. After temperature-normalized prototype confidence and detector score weighted correction, the classification output is stable. The entire module can be directly embedded into the basic detection framework without adding any additional network parameters. The overall detection operation is stable and adaptable to single-sample and extremely low-sample detection conditions.

[0091] Example 2 details the evaluation of this application on two major few-shot object detection benchmarks, PASCAL VOC and MS COCO, to verify the effectiveness and reproducibility of the proposed method under extremely few-shot conditions. Both datasets follow the domain-standard Base / Novel partitioning method and use data partitioning and annotation files consistent with mainstream methods. On PASCAL VOC, the 20 categories are divided into 15 base classes and 5 new classes, and evaluated using the commonly used three-group partitioning. Training uses VOC2007+2012 train / val, and testing is performed on VOC2007 test, reporting the new class mAP (IoU=0.5). On MS COCO, standard few-shot partitioning is used for training and testing, with the new class mAP (IoU=0.5:0.95) as the primary evaluation metric.

[0092] This application's method is implemented based on the MMDetection framework, and the overall training and inference process follows its standard detector configuration and engineering specifications. The backbone network uses ResNet-101 pre-trained on ImageNet to fully utilize the general visual representation capabilities gained from large-scale classification pre-training, and performs end-to-end detection task adaptation on this basis. For input preprocessing, the query image is scaled proportionally to align its short side to 800 pixels and its long side to no more than 1333 pixels (i.e., a maximum resolution of approximately 1333×800), thereby controlling memory overhead and computational cost while ensuring discernible target details. For support branches, labeled instances are cropped from support images and uniformly adjusted to 224×224 pixels to match the typical input scale of the backbone network during ImageNet pre-training, reducing the impact of scale shift on feature extraction stability and facilitating consistent support representations across different datasets and categories.

[0093] Training was performed on two NVIDIA RTX 3090 GPUs, using SGD as the optimizer, with a total batch size of 8 to balance training stability and hardware resource constraints. During the base class training phase, 30,000 and 165,000 iterations were performed on the VOC and COCO datasets, respectively, to fully learn the general detection capabilities and class-independent candidate region modeling capabilities of the base classes. The initial learning rate was set to 0.005, and it was decayed by a factor of 0.1 at the 17,000th (VOC) and 92,000th (COCO) iterations to promote later convergence and improve the stability of parameter estimation. During the new class fine-tuning phase, to avoid overfitting due to excessive gradient updates under limited sample conditions, the learning rate was further reduced to 0.001, allowing for a more conservative step size to quickly adapt to the new classes. Except for the above key settings, all other hyperparameters (such as sampling strategy, loss weights, training configuration, and inference threshold) were consistent with the publicly available settings of Meta R-CNN to ensure fairness in the comparison and reproducibility of the experimental results.

[0094] A multimodal guided feature enhancement module is introduced during the few-shot fine-tuning stage to make fuller use of reconstructed support samples and improve intra-class diversity. This module performs reconstruction enhancement every 100 epochs during fine-tuning to control the impact of random fluctuations caused by diffusion on training stability. This feature enhancement module is not enabled during the testing phase to avoid introducing inference uncertainty caused by random generation. In contrast, the offline classification corrector is only enabled during the testing phase. It requires no additional training, directly calculating a normalized prototype score based on the similarity between each class's support prototype and RoI features. This score is then weighted and fused with the class score output by the detector's original classification head to serve as the final classification score in post-processing, thus achieving lightweight correction of classification bias in few-shot scenarios.

[0095] Experimental results on the MS COCO dataset are shown in Table 1. Compared with previously proposed methods, the MGFE proposed in this application achieves mAP of 20.2% and 22.4% in 10-shot and 30-shot settings, respectively.

[0096] Table 1. Comparison of mAP of the proposed method with other methods on the MS COCO dataset.

[0097] The method achieved optimal performance under 10-shot conditions and second-best performance under 30-shot conditions, demonstrating strong overall competitiveness.

[0098] The experimental results show that the proposed method can continuously bring effective gains under different supervision scales, verifying the synergistic effectiveness of the generative enhancement and classification correction design, and demonstrating the stability of the method under extremely few samples and relatively sufficient samples. The experimental results of PASCAL VOC are shown in Table 2. The proposed method has stable overall performance under three splits and different shot settings, and has achieved optimal or suboptimal results multiple times, demonstrating strong overall competitiveness.

[0099] Table 2 compares the mAP of our proposed method with other methods on the PASCAL VOC dataset.

[0100] Further analysis revealed that the proposed method achieved positive improvements in most settings, indicating that its performance improvement is not dependent on individual class divisions but exhibits good consistency across different task divisions. The gains are mainly concentrated in the low-sample range, with an average improvement of approximately 4.2% across three splits of a 1-shot, demonstrating that the method can more effectively improve detection performance under extremely low-sample conditions where single-sample bias is more significant. As the number of shots increases, the performance improvement gradually converges, with slight fluctuations in individual settings, but overall maintaining a stable advantage. This also reflects that the gain space of the method decreases as supervisory information becomes more abundant. Overall, these results validate the effectiveness and stability of the proposed method in low-sample target detection, demonstrating particularly significant application value in low-sample scenarios.

[0101] To evaluate the effectiveness of each module in this application, ablation experiments were uniformly performed on a PASCAL VOC split 1, and the new class of mAP50 results were reported at five supervised scales: 1 / 2 / 3 / 5 / 10-shot. This setup covers different ranges from extremely low sample sizes to relatively sufficient sample sizes, allowing for a clearer observation of the stability of the gain of each module and its main effective range.

[0102] The ablation results are shown in Table 3. Both MGFE and OCC can bring stable positive improvement, but their effects have different focuses.

[0103] Table 3 Ablation Comparison between Different Modules

[0104] MGFE shows a more significant gain, primarily concentrated in the low-shot range, indicating its ability to more effectively supplement intra-class variation information and alleviate single-sample fitting problems when samples are extremely limited. OCC's improvement is relatively moderate, but its overall trend is stable, mainly reflecting its posterior correction effect on classification results. It enhances the reliability and ranking stability of new class classification scores and is more valuable under low-shot conditions. Furthermore, when both are used together, the model's overall performance reaches its optimal level, especially with a more significant improvement in low-shot settings, demonstrating a good complementarity between feature-level information supplementation and score-level classification correction.

[0105] To explore suitable values ​​for the number of steps in diffusion reconstruction and analyze its impact on enhancing sample usability and final detection performance, this application conducted experiments on the number of diffusion steps S under a 1-shot setting, as shown in Figure 3. The results show that as the number of diffusion steps increases, the overall model performance exhibits a trend of first increasing and then decreasing, reaching its optimal value near a moderately large number of steps. This phenomenon indicates that the number of diffusion steps directly affects the balance between generation diversity and annotation reusability. When the number of steps is small, insufficient denoising iterations result in generated images that are relatively close to the original image, making it difficult to provide sufficient intra-class variation supplementation, thus limiting performance improvement. As the number of steps increases, the texture and appearance details of the target region are more fully reconstructed, introducing more effective variation information while maintaining basic consistency in category semantics, thereby better alleviating sample-specific fitting in low-shot scenarios and improving detection performance. When the number of steps continues to increase, random perturbations gradually accumulate during the iteration process, making the target's local structure and identity features more prone to over-rewriting, reducing the consistency between the generated results and the original annotations, leading to convergence and a slight decrease in performance gain.

[0106] The visualization results are consistent with the trends described above. As the number of diffusion steps increases, the variations in pose, texture, and lighting of the generated samples gradually intensify, and the sample diversity continuously improves. However, at larger diffusion steps, the changes in the target appearance increase significantly, and controlled reconstruction gradually shifts towards over-redrawing, increasing the risk of incomplete matching between category semantic shift and annotation. Combining the performance curves and visualization phenomena, it can be seen that choosing a moderately large number of diffusion steps is more beneficial in balancing the diversity of generated samples with annotation consistency, thus achieving more stable performance improvements in extremely low-sample scenarios.

[0107] To determine a reasonable value for the number of supported sample reconstructions, T, this application conducted comparative experiments on VOC split 1 with different T settings, as shown in Table 4:

[0108] Table 4 Comparison of Experimental Support for Sample Reconstruction Quantity

[0109] The results show that model performance initially increases and then decreases with increasing T, indicating that there is an optimal range for the number of reconstructed samples; too few or too many samples will affect the final result. Specifically, when T increases from a small value to a medium size, the overall performance improves across all shot settings, with more significant gains in low-sample scenarios. This suggests that moderately increasing the number of reconstructed samples can effectively supplement intra-class variation information, reduce single-sample bias, and improve the stability of class representation. As T continues to increase to higher values, performance declines across multiple settings, indicating that too many reconstructed samples can lead to accumulated noise and distribution perturbations. Furthermore, they may weaken the constraint effect of the original support samples during prototype fusion, thus affecting the stability of subsequent similarity matching and classification.

[0110] Considering the accuracy and stability under different shooting conditions, this application ultimately sets T to 5 as the default configuration to achieve a more reasonable balance between intra-class diversity gain and generation noise risk, while avoiding unnecessary generation overhead and inference computation burden, thereby making more efficient use of computing resources.

[0111] Figure 4 shows the AP50 comparison results of different methods for VOC split 1 in the 1-shot setting on five new classes: bird, bus, cow, motorbike, and sofa, and provides the average performance for the five classes. Overall, the MGFE method in this application achieves the best average across classes, significantly outperforming Meta R-CNN and FPD, indicating that this method can stably improve the detection performance of new classes under extremely low supervision. Further analysis of the class-by-class results shows that this method performs better overall across all classes with less fluctuation, and its advantage is not concentrated in a single class but is reflected in multiple new classes. The improvement is particularly significant in classes such as sofa and cow, where the baseline methods score relatively low. This indicates that this method can more effectively alleviate the class representation bias and classification instability caused by insufficient sample representativeness in the 1-shot scenario, thereby improving the overall stability of the model.

[0112] Table 5 is used to verify the generality of the method in this application. The experiment integrates the method in this application into the few-shot detection frameworks of three meta-learning paradigms: Meta R-CNN, FPD, and Meta DETR, respectively, in a plug-in manner, and compares the new class mAP50 under the 1 / 2 / 3 / 510-shot settings of VOC split 1.

[0113] Table 5 Comparison of experiments using other methods combined with the method presented in this paper

[0114] The results show that all three baselines achieved stable improvements across all shot settings after incorporating the proposed method, indicating that the method is independent of specific detector head structures or training paradigms and maintains good compatibility with different frameworks while delivering consistent gains. Specifically, Meta R-CNN improved performance by 4.8%, 3.5%, 2.1%, 2.1%, and 1.5% at 1, 2, 3, 5, and 10 shots, respectively. FPD improved by 4.8%, 3.6%, 2.6%, 0.7%, and 0.5%, respectively. Meta DETR improved by 3.6%, 4.3%, 2.1%, 1.8%, and 0.7%, respectively. It can be seen that the gains are mainly concentrated in the low-shot range, especially under 1-shot and 2-shot conditions. As the number of shots increases, the improvement gradually converges but remains positive overall. These results demonstrate that the proposed method has a strong compensatory effect on insufficient intra-class variation and representation instability and classification bias caused by sample specificity under extremely low sample conditions. It also verifies its good cross-framework transferability and engineering reusability.

[0115] Figure 5 shows a visual comparison of the reconstructed samples. The left column represents the original supporting images, the middle column represents the generated results using the default semantic cue "a photo of {class}", and the right column represents the generated results using the multimodal guided diffusion strategy of this application. The comparison shows that the default semantic cue, due to its weaker constraint information, is more prone to semantic instability and detail distortion. For example, in the "bird" category, the target's body shape and feather color are randomly rewritten and the local structure is incomplete; in the "cow" category, unnatural color and texture shifts occur; the "motorbike" category exhibits a clear cartoonish tendency with lost local details; and the "sofa" category introduces insufficient variation. In contrast, the reconstructed samples generated by the method of this application are more stable in terms of geometric structure, local texture, and identifiable details. The wing shape and feather layers of birds are clearer, the proportions of the bus windows and body are closer to the real form, the cow's stripes and surface texture are more natural, the motorcycle's wheel structure is more complete, and the "sofa" is more diverse. The results show that fine-grained semantic constraints can effectively improve the semantic consistency and appearance diversity of generated samples, thereby improving the usability and discriminability of reconstructed samples, and providing a higher quality representation basis for supplementing intra-class variation information under extremely low sample conditions.

[0116] Figure 6 shows the visualization results of novel class detection using VOC split 1 in a 1-shot setting. Overall, in the extremely unsupervised scene, the model maintains relatively stable detection quality despite complex backgrounds, scale variations, and significant differences in imaging conditions. The predicted bounding boxes and the target objects generally have a high degree of overlap, and most examples provide relatively reliable confidence outputs. This indicates that the method still possesses good novel class discrimination and localization capabilities even with only a single supporting sample. Its detection results do not rely solely on direct memorization of the appearance details of a single sample but can form a more generalized category representation to a certain extent. Meanwhile, the detection performance in different scenarios is generally consistent in the visualization results, indicating that the method has a certain robustness to scene changes and interference factors in extremely low-sample settings. In summary, these visualization results are consistent with the experimental conclusions above, further validating that this method can improve the overall performance of the model in low-sample scenarios.

[0117] This embodiment validates the method through systematic experiments on the PASCAL VOC and MS COCO datasets, and fully analyzes its effectiveness through ablation experiments, hyperparameter analysis, and visualization. Experimental results show that the method exhibits stable gains under different settings, with its advantages mainly reflected in the low-sample range. Furthermore, it achieves consistent improvements in integration experiments across different few-sample detection frameworks, indicating good cross-framework transferability. Overall, this application, based on the synergistic design of multimodal guided feature enhancement and offline classification correction, effectively alleviates the problems of insufficient information and unstable decision-making under extremely low-sample conditions, providing a more robust and engineering-feasible improvement scheme for the application of few-sample object detection in complex scenarios.

[0118] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any changes, modifications, substitutions, integrations, and parameter changes made to these embodiments within the spirit and principles of the present invention, without departing from the principles and spirit of the present invention, through conventional substitutions or to achieve the same function, fall within the scope of protection of the present invention.

Claims

1. A method for detecting targets with few samples using multimodal guided feature enhancement, characterized in that, The execution steps include the following: S1. Collect the support set images and query images for the few-sample detection task, construct the dual-constraint multimodal guiding conditions composed of text semantics and target mask, call the diffusion model to perform local controllable reconstruction of the support set images, and generate expanded and reconstructed support samples; S2. A unified feature extraction network is used to extract the depth features of the original support samples, reconstructed support samples, and candidate regions of the query image, and the query image features are enhanced by the feature enhancement mapping process based on the features of all support samples. S3. Integrate the original support sample features and reconstructed support sample features to calculate the fusion prototype vector for each category, and obtain the matching similarity between the query candidate region features and the fusion prototype vector; S4. Perform temperature-scale normalization on the similarity to obtain the prototype confidence distribution, and simultaneously obtain the classification probability distribution output by the detector's native classification head; S5. The weighted fusion of the prototype confidence distribution and the detector's original classification probability distribution yields the corrected classification score. Based on the corrected score, valid target boxes are selected to complete the detection of targets with few samples.

2. The multimodal guided feature enhancement method for few-sample target detection according to claim 1, characterized in that, The process of constructing text semantic guidance conditions in S1 is as follows: Read the target category identifier corresponding to a single supporting sample The WordNet database is retrieved to obtain the category-specific definition text. ,satisfy ; Fixed format prompt template With the explanatory text Inputting the same text into a large language model generates refined semantic prompt text that adapts to the input format of the diffusion model. ,satisfy .

3. The method for detecting few targets using multimodal guided feature enhancement according to claim 2, characterized in that, In S1, target mask constraints are constructed and diffusion image reconstruction is performed. The original support image is denoted as... Generate a binary target mask based on the image bounding box. The pixel value inside the mask is 1, and the background pixel value is 0; Diffusion Reconstruction Image Calculation formula: ; In the formula This represents the element-wise multiplication operation of tensors. For the forward sampling operation of the diffusion model, image content reconstruction is performed only in the target area covered by the mask, while the background area retains the original image pixels completely.

4. The multimodal guided feature enhancement method for few-sample target detection according to claim 3, characterized in that, The unified feature extraction network in S2 is denoted as For query images Global feature extraction ; Support features are extracted image by image from all original and reconstructed support images. The set of all support features for a single category is denoted as . ; Set learnable scaling weights Dimensional adaptation projection matrix Feature channel dimension Query Enhancement Features Calculation formula: .

5. The multimodal guided feature enhancement method for few-sample target detection according to claim 4, characterized in that, In S3, the initial prototype vector corresponding to the original support sample of a single class is calculated first. The formula is: The number of original support samples for a single category is , No. Class 1 Zhang's original supporting image is .

6. The method for detecting few targets using multimodal guided feature enhancement according to claim 5, characterized in that, In S3, the fusion and reconstruction of sample features yields the final category fusion prototype vector. The formula is: The number of reconstructed samples generated from a single original supporting image is , No. Class 1 Zhang Yuantu corresponds to the first Zhang reconstructed image is .

7. The multimodal guided feature enhancement method for few-sample target detection according to claim 6, characterized in that, Extracting the query image from S3 Regional features of candidate boxes The formula is: ,in This represents the RoIAlign region alignment sampling operation; the original image being queried is... , No. The coordinates of the candidate boxes are ; Calculate candidate region features and the first Cosine similarity of class fusion prototype vectors The formula is: .

8. The multimodal guided feature enhancement method for few-sample target detection according to claim 7, characterized in that, In S4, a normalized softmax operation with a temperature coefficient is performed on the cosine similarity, and the prototype confidence score is output. The formula is: ; In the formula This is a temperature scale coefficient. This is the set of all target categories to be identified in this detection task.

9. A method for detecting few targets using multimodal guided feature enhancement according to claim 8, characterized in that, The native classification head output of the detector in S4 is the first... The original predicted logits vector of each candidate box The native classification probability of the detector is obtained by standard softmax operation. Calculation formula: .

10. A method for detecting few targets using multimodal guided feature enhancement according to claim 9, characterized in that, S5 Set the fusion weighting coefficient The final corrected classification score is obtained by weighted fusion of the prototype confidence score and the detector's native classification probability. Calculation formula: ;according to The numerical value is used to perform non-maximum suppression and target category determination on all candidate boxes, and the detection results are output.

Citation Information

Patent Citations

  • Meta RCNN-based few-sample target detection method

    CN117036897A