A small sample detection method based on a visual base model
By generating high-quality candidate boxes using a visual base model and combining dilated grouped convolution and dynamic candidate box selection, the problem of insufficient generalization ability for new category detection and interference from complex backgrounds in small sample detection is solved, achieving high-precision and stable target detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-03
AI Technical Summary
Existing small-sample detection methods lack generalization ability when detecting new categories and are easily affected by complex background interference, which affects detection accuracy and stability.
High-quality candidate boxes are generated through a visual base model. A class projection map is generated by element-wise multiplication of the class prototype vector and the visual feature map. Multi-scale support regions are generated by combining a dilated grouped convolution module and a dynamic candidate box selection strategy. The final class label is determined through feature interaction.
It significantly improves the generalization ability and robustness of new category detection, reduces the dependence on base class pre-trained detectors, and enhances the accuracy and stability of target classification and localization.
Smart Images

Figure CN122116014B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a small sample detection method based on a visual fundamental model. Background Technology
[0002] Few-shot detection aims to detect new categories of objects using a small number of labeled samples. Traditional few-shot detection methods typically pre-train detectors on base class samples and then fine-tune them using a small number of new class samples to achieve the ability to detect new categories. While this approach alleviates the problem of sample scarcity to some extent, its detection performance heavily relies on the detection priors formed by supervised learning from the base class. Therefore, it is prone to insufficient generalization ability when facing new categories that differ significantly from the base class.
[0003] To reduce reliance on prior knowledge of base class detection, visual base models have been introduced into few-sample object detection. Related methods typically first extract features from the query image using the visual base model, then construct a class prototype using a small number of support samples, and obtain class response information through the mapping between the prototype and image features to achieve object detection. Although this type of method can introduce discriminative information for new classes to some extent, it still has shortcomings in candidate region generation, utilization of spatial location information, and cross-scale context modeling, thus affecting the accuracy and stability of new class object detection.
[0004] Therefore, how to improve the quality of candidate regions and enhance the accuracy and stability of target classification and localization under small sample conditions remains a pressing technical problem to be solved in small sample detection. Summary of the Invention
[0005] The main objective of this invention is to provide a few-sample detection method based on a visual base model, which aims to generate high-quality candidate boxes and improve the robustness of target classification and localization, overcoming the problems of existing methods such as strong dependence on base class pre-trained detectors, insufficient generalization ability to new categories, and susceptibility to interference from complex backgrounds.
[0006] To achieve the above objectives, this invention proposes a few-sample detection method based on a visual fundamental model, comprising the following steps:
[0007] S1. Utilize a pre-trained visual baseline model to process the query image. Visual feature maps are obtained by feature extraction. and obtain the corresponding foreground category. prototype vector and background prototype vector ;
[0008] S2, the prototype vector and Broadcast processing is performed separately to align the spatial dimensions with the visual feature map. Consistent with the spatial dimension, and subsequently with the visual feature map. Perform element-wise multiplication to obtain the category. Projected response diagram and background projection response diagram ;
[0009] S3, the projection response map Background projection response map The categories are obtained by splicing and normalizing. Spatial weight and utilize the spatial weights For the visual feature map Perform a transformation to obtain a category constrained by the category response. Conditional feature map Its formula is:
[0010]
[0011] In the formula, The symbol for element-wise multiplication;
[0012] S4. Utilize the dilated grouped convolution module to process the conditional feature map. Feature enhancement is performed to obtain a predicted feature map of the candidate region, and a category is generated based on the predicted feature map of the candidate region using a sliding window method. The predicted bounding box, which has a confidence score;
[0013] S5. Based on a dynamic candidate box selection strategy, the predicted bounding boxes are filtered to obtain a candidate box set, wherein the categories are... Number of candidate boxes retained The sum of the confidence scores of all predicted bounding boxes for that category is used to determine the result.
[0014] S6. During the inference phase, the candidate boxes are scaled according to a preset expansion range to construct multiple support regions. The candidate boxes and their corresponding support regions are then used in the projection response map. Features are extracted to obtain local features and multiple contextual features;
[0015] S7. Perform feature interaction on the local features and the context features to obtain enhanced local features, obtain the candidate box classification results corresponding to each support region based on the enhanced local features, and determine the final category label of the candidate box based on the category with the highest frequency in the classification results corresponding to each support region.
[0016] Preferably, the prototype vector is obtained in step S1. The formula is:
[0017]
[0018] In the formula, Represents the basic model of vision. Indicates category Supports image samples. This indicates the total number of samples in this category.
[0019] Preferably, the category is obtained in step S3. Spatial weight The formula is:
[0020]
[0021] In the formula, This indicates a splicing operation. Indicates a convolutional layer. This represents the normalized activation function.
[0022] Preferably, in step S4, the dilated grouped convolution module is used to process the conditional feature map. The processing includes: processing the conditional feature map The system is divided into four intermediate feature map sets with the same number of channels along the channel dimension, and features are extracted from the four intermediate feature map sets using four dilated convolutional layers with different dilation rates to obtain the corresponding multi-scale feature maps.
[0023] Preferably, the dilation rates of the four dilated convolutional layers are 1, 2, 4 and 8, respectively.
[0024] Preferably, the category in step S5 Number of candidate boxes retained The calculation formula is:
[0025]
[0026] In the formula, Indicates category The predicted bounding boxes are sorted by confidence level from highest to lowest. Each score This is the preset total number of scores to be included in the calculation. This indicates the floor function.
[0027] Preferably, before extracting local features and multiple contextual features in step S6, the method further includes: calculating the projection response map. The mean values of the responses for each category are calculated and sorted. The projected response maps of the top 10 categories with the largest mean values are selected as the projected response maps for the activity categories.
[0028] Preferably, constructing multiple support regions in step S6 includes: from a preset extended range Sampled at uniform intervals within the inner area Expansion coefficient Its formula is:
[0029]
[0030] And according to the expansion coefficient The candidate boxes are scaled to obtain the corresponding support regions.
[0031] Preferably, the feature interaction in step S7 includes:
[0032] First, update the supported region features using the following formula:
[0033]
[0034] Then take the tth The local features after the first round of interaction are concatenated with the supporting region features after the t-th round of interaction, and the local features are updated using the following formula:
[0035]
[0036] In the formula, t represents the number of rounds of feature interaction. This represents the support region features after the t-th round of interaction. Indicates the t-th Features of each supported region after one round of interaction This represents the local features after the t-th round of interaction. Indicates the t-th Local features after one round of interaction and and represent the convolutional layers used to support the updating of region features and local features in the t-th round, respectively.
[0037] Preferably, in step S7, the first... Final category labels for each candidate box The formula for determining it is:
[0038]
[0039] In the formula, For a set of categories, For indicator functions, For the first The candidate box corresponding to the first The predicted categories for each supported region.
[0040] The above technical solution has the following advantages:
[0041] This invention directly predicts candidate boxes using the projected response map of visual features and categories, avoiding the reliance of traditional few-shot object detection methods on pre-trained candidate box generators based on base classes. This effectively improves the model's generalization ability to new categories and reduces training complexity. By using spatial weights to perform residual transformation on the visual feature map to obtain a conditional feature map, the feature extraction network can better focus on regions where the target may appear, thus significantly improving the quality of subsequent candidate box generation. Simultaneously, this invention uses uniformly spaced sampling to generate multiple support regions for candidate boxes and determines the final target category based on the consistency of the prediction results corresponding to multiple support regions. This effectively avoids the problem of unstable target representation under a single context. This multi-scale voting mechanism can filter out misjudgments caused by local occlusion or background interference, making the detection results highly robust in complex environments. Attached Figure Description
[0042] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings, wherein:
[0043] Figure 1 A flowchart of a small sample detection method based on a visual fundamental model provided in an embodiment of the present invention.
[0044] Figure 2 A detailed flowchart of the small sample detection method based on a visual fundamental model provided in this embodiment of the invention. Detailed Implementation
[0045] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0046] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms include and / or encompass are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0047] Example 1
[0048] like Figures 1 to 2As shown, this embodiment provides a few-shot detection method based on a visual basic model. This method aims to improve the accuracy, stability and generalization ability of target detection in few-shot scenarios by introducing a candidate box generation mechanism guided by category response and a cross-scale contextual consistency inference strategy.
[0049] Specifically, the small sample detection method in this embodiment mainly includes the following steps.
[0050] Step S1: Use a pre-trained visual base model to extract features from the query image to obtain a visual feature map and obtain the corresponding foreground category. The prototype vector and the background prototype vector.
[0051] In the specific implementation process, the query image, i.e., the input image, is processed by a pre-trained visual baseline model. The feature extraction network of the visual baseline model can extract visual feature maps containing rich semantic information. The expression of the visual feature map is:
[0052]
[0053] In the formula, Represents the basic model of vision. Indicates a query for images. This represents the extracted visual feature map.
[0054] To achieve small-sample detection, this embodiment requires using a small number of supporting images as references. For each foreground category to be detected... The system retrieves supporting image samples from a pre-built category sample library, extracts features from each sample using a basic visual model, and aggregates these features to construct a category prototype vector. Similarly, a background prototype vector is constructed using a background sample library. The background prototype vector This is the aggregated vector obtained after extracting features from the background samples using a basic visual model. The specific formula for obtaining the prototype vector is:
[0055]
[0056] In the formula, Represents the prototype vector. Indicates category Supports image samples. This represents the total number of samples in that category. In this way, the prototype vector can represent the core semantic features of that category, providing a benchmark for subsequent projected response maps.
[0057] Step S2: Broadcast the prototype vector and background prototype vector separately to make their spatial dimensions consistent with the spatial dimensions of the visual feature map. Then, multiply them element-wise with the visual feature map to obtain the category. The category projection response map and the background projection response map.
[0058] In this step, the system expands the one-dimensional prototype vector spatially using a matrix broadcasting mechanism. Through element-wise multiplication, the category semantics represented by the prototype vector are mapped onto the visual feature map, thereby explicitly activating regions in the image associated with the target category and forming a category projection response map. Similarly, the background projection response map reflects the distribution of background regions in the image.
[0059] Step S3: Combine and normalize the category projection response map with the background projection response map to obtain the category. The spatial weights are used to transform the visual feature map, resulting in a category constrained by the category response. The conditional feature map.
[0060] Specifically, to better suppress background interference and highlight the foreground target, this embodiment performs a concatenation operation along the channel dimension between the category projection response map and the background projection response map. Subsequently, a convolutional layer is used to compress the channels of the concatenated features, and a sigmoid activation function is applied for normalization, thereby generating spatial weights with probabilistic meaning. The formula for obtaining the spatial weights is:
[0061]
[0062] In the formula, Indicates spatial weights, This indicates a splicing operation. Indicates a convolutional layer. For category The projection response diagram, This is the background projection response map.
[0063] After obtaining the spatial weights, they are applied to the original visual feature map to achieve feature transformation constrained by category response. The transformed conditional feature map can better focus on the regions where the target may appear, and its calculation formula is as follows:
[0064]
[0065] In the formula, Represents conditional feature maps. The symbol represents element-wise multiplication. This residual weighting method preserves the original visual features while introducing explicit spatial constraints for specific categories, significantly improving the quality of subsequent candidate box generation.
[0066] Step S4: Use the dilated grouped convolution module to perform feature enhancement on the conditional feature map to obtain the candidate region prediction feature map, and generate the category using a sliding window method based on the candidate region prediction feature map. The predicted bounding box.
[0067] Considering that small-sample targets often exhibit varying scales, this embodiment employs a dilated grouped convolutional module to enhance the network's ability to represent targets at different scales. Specifically, the system divides the conditional feature map along the channel dimension into four intermediate feature map sets with the same number of channels. Subsequently, four dilated convolutional layers with different dilation rates are used to extract features from these four intermediate feature map sets in parallel. In this embodiment, the dilation rates of the four dilated convolutional layers are set to 1, 2, 4, and 8, respectively. Convolutional layers with smaller dilation rates are responsible for capturing local details, while convolutional layers with larger dilation rates utilize a larger receptive field to capture macroscopic structural information. Finally, the feature maps obtained from the four branches are concatenated and fused, and residual connections are performed with the input conditional feature map to obtain the enhanced candidate region prediction feature map.
[0068] Based on the enhanced features, confidence score maps and bounding box offset maps corresponding to each category are generated through convolutional layers. A sliding window is then used to perform dense sampling on the score maps, thereby generating predicted bounding boxes with confidence scores.
[0069] Step S5: Based on the dynamic candidate box selection strategy, filter the predicted bounding boxes to obtain a candidate box set, where the categories are... The number of candidate boxes retained is determined based on the sum of the confidence scores of all predicted bounding boxes for that category.
[0070] Traditional fixed-quantity filtering mechanisms lack flexibility when processing different images. This embodiment employs a dynamic selection strategy, categorizing images... After sorting the predicted bounding boxes by confidence level from high to low, select the top... The scores are summed, and the sum is rounded down to the nearest integer to determine the final number of items retained in that category. The calculation formula is as follows:
[0071]
[0072] In the formula, Indicates the number of candidate boxes to retain. Indicates the first The score of each predicted bounding box. This is a preset constant, for example, 100. In this way, when the image contains many targets or the prediction confidence is high, more bounding boxes are retained; conversely, the number of retained boxes is reduced. The filtered bounding boxes undergo non-maximum suppression to obtain the final set of candidate boxes.
[0073] Step S6: In the inference stage, the candidate boxes are scaled according to the preset expansion interval to construct multiple support regions. Features are extracted on the category projection response map using the candidate boxes and their corresponding support regions to obtain local features and multiple contextual features.
[0074] To further improve the stability of classification and localization, this embodiment not only focuses on the local information of the candidate bounding boxes themselves, but also introduces cross-scale contextual information. Before extracting features, the system first calculates and sorts the mean of the response corresponding to each category in the category projection response map, and selects the projection response maps corresponding to the top 10 categories with the largest mean as the active category projection response maps.
[0075] During the inference phase, the system expands from a pre-defined range. Sampled at uniform intervals within the inner area Expansion coefficient The formula is:
[0076]
[0077] The candidate boxes are scaled based on the expansion factor to obtain the corresponding support regions. For example, when... Take 1.0 and When the value is 2.0, a series of regions of interest expanding from the inside out can be obtained through uniform sampling. Pooling operations are then performed on the activity category projected response map using these regions to obtain local features representing the target itself and multiple contextual features representing the surrounding environment.
[0078] Step S7: Perform feature interaction on local features and context features to obtain enhanced local features. Based on the enhanced local features, obtain the candidate box classification results corresponding to each support region. Determine the final category label of the candidate box based on the category with the highest frequency in the classification results corresponding to each support region.
[0079] The system integrates local features with contextual information at different scales through multiple interactive update operations.
[0080] For each candidate bounding box and its corresponding supporting region, the system performs T rounds of feature interaction. In each round of interaction, the supporting region features are updated first, with the expression: ;
[0081] Next, the current local features are concatenated with the updated supporting region features, and the local features are updated through a dedicated convolutional layer, expressed as follows: .
[0082] In the formula, t represents the number of interaction rounds. This represents the support region features after the t-th round of interaction. Indicates the t-th Features of each supported region after one round of interaction This represents the local features after the t-th round of interaction. Indicates the t-th Local features after one round of interaction and and represent the convolutional layers used to support the updating of region features and local features in the t-th round, respectively.
[0083] Based on the enhanced local features, a linear transformation is used to obtain the predicted category for each support region. Finally, a context consistency criterion is applied for aggregation, that is, the predicted categories of all support regions are counted, and the category with the highest frequency is selected as the final category label for the candidate box. The formula for determining the final category label of each candidate box is:
[0084]
[0085] In the formula, For a set of categories, For indicator functions, For the first The predicted category for each support region. This multi-scale voting mechanism effectively avoids misjudgments caused by cluttered backgrounds in a single receptive field, significantly enhancing the robustness of small-sample detectors in complex environments.
[0086] Example 2
[0087] This embodiment, based on the above embodiments, provides a more detailed explanation of the specific implementation process of feature enhancement using the dilated grouped convolution module. In step S4, the system inputs the conditional feature map constrained by the category response into the feature extraction network. Specifically, convolution is used to transform the channel dimension of the conditional feature map, and then the transformed feature map is divided into four intermediate feature map sets with the same number of channels along the channel dimension.
[0088] Subsequently, the system uses four dilated convolutional layers with different dilation rates to perform parallel feature extraction operations on the four intermediate feature map sets to obtain the corresponding multi-scale feature maps. In this embodiment, the dilation rates of the four dilated convolutional layers are set to 1, 2, 4, and 8, respectively. Due to the use of different dilation rates, the network can extract rich features from local details to global structure through different receptive field ranges without increasing the number of parameters. That is, the branch with a dilation rate of 1 is mainly responsible for capturing the subtle texture and edge information of the target, while the branch with a dilation rate of 8 can perceive the macroscopic spatial relationship between the target and its surrounding environment.
[0089] After parallel feature extraction, the system concatenates the multi-scale feature maps generated by the four branches along the channel dimension, and then uses a 1x1 convolutional layer for channel fusion and dimension restoration. Finally, the fused features are joined with the initial input conditional feature map using a residual connection, i.e., element-wise addition, to obtain the final candidate region prediction feature map. This dilated grouped convolution design significantly enhances the ability of the few-shot detection model to identify targets of different scales in complex backgrounds, laying a solid foundation for generating high-quality predicted bounding boxes.
[0090] Example 3
[0091] This embodiment focuses on the strategy for constructing support regions in step S6, particularly the different processing logics for the training and inference phases. The core purpose of constructing support regions is to assist in robust target classification through multi-scale contextual information.
[0092] During the model training phase, to improve training efficiency and introduce randomness to enhance model robustness, the system employs a random sampling strategy. Specifically, a pre-defined expansion interval, i.e., a distribution interval, is used. ,in Set to 1.0. Set to 2.0. A single random sample is taken from this interval according to a uniform distribution to obtain an expansion coefficient. Its expression is:
[0093]
[0094] Subsequently, based on this expansion factor The length and width of the current candidate box are proportionally expanded while the center position of the candidate box remains unchanged, thus constructing a unique support region. The expression for the support region is as follows:
[0095]
[0096] In the formula, and Indicates the first The center coordinates of the candidate boxes and This indicates the original width and height.
[0097] During the inference phase, to eliminate the uncertainty introduced by single sampling and to utilize multi-scale consistency for final decision-making, the system employs an equally spaced sampling strategy. The system starts from the extended interval... Samples were obtained at fixed, uniform intervals. Expansion coefficient ,in The value can be, for example, 5 or 10. The... The expression for each expansion coefficient is:
[0098]
[0099] According to this Each expansion coefficient expands the candidate box to construct a... Several progressively sized support regions. These support regions can cover everything from compact areas to broad areas containing rich contextual information, providing multi-dimensional observational data for subsequent context-consistent aggregation.
[0100] Example 4
[0101] This embodiment describes in detail the specific implementation process of feature interaction and final decision in step S7. After acquiring local features and multiple contextual features, the system introduces an interactive update module to improve the discriminative power of the features.
[0102] For each candidate box and its corresponding supporting region, the system executes... Wheel feature interaction, where The recommended value is 3. In each round of interaction, the supporting region features are updated first, with the expression:
[0103]
[0104] Next, the current local features are concatenated with the updated supporting region features, and the local features are updated through a dedicated convolutional layer, enabling the local features to absorb semantic information from a broader range. Its expression is:
[0105]
[0106] After feature interaction is completed, a prediction score is obtained based on the enhanced local features using a linear transformation layer. The candidate box in the ... The formula for predicting classification scores under the condition of each support region is:
[0107]
[0108] In the formula, This represents the support region features after the t-th round of interaction. Indicates the t-th Supported region features after one round of interaction This represents the local features after the t-th round of interaction. Indicates the t-th Local features after one round of interaction This represents the convolutional layer used to support region feature updates in round t. This represents the convolutional layer used for local feature updating in round t. This represents the predicted classification score of the nth candidate box under the condition of the mth support region. Represents a linear transformation layer. Let H represent the enhanced local features of the nth candidate box under the condition of the mth support region, where H and W represent the height and width of the feature map, respectively, and x and y represent the spatial location indices on the feature map.
[0109] In the above formula, spatial information is compressed through global average pooling; simultaneously, an integral transform layer is used to perform regression calculations on the enhanced local features to obtain the predicted bounding boxes. In the final decision-making stage, the system follows the context consistency criterion. That is, for the same candidate bounding box, in... If the predicted categories show a high degree of consistency across different contextual scales, the detection result is considered reliable. This is based on systematic statistics. The category that appears most frequently among the predicted categories will be used as the final category label. Subsequently, among all the predicted results belonging to the final category label, the bounding box corresponding to the support region with the highest classification score is found and used as the final predicted bounding box result for that target. This aggregation method, which combines frequency statistics with score maximization, can effectively filter out category jumps caused by local occlusion or background interference, making the detection results more consistent with the logical stability of human vision.
[0110] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium. When the program is executed, it includes the steps described in the above methods. The storage medium is specifically a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, etc.
[0111] In the specific training implementation, this invention uses cross-entropy loss to calculate the classification results and uses [other loss methods] to calculate the bounding box regression results. The loss function is calculated. During the inference phase, the system aggregates the classification results and bounding box regression results corresponding to multiple support regions based on the aforementioned context consistency criterion, thereby determining the most frequently occurring category as the final category label. and in the final category label The bounding box with the highest classification score among the predicted bounding boxes is selected as the final predicted bounding box result. .
[0112] The technical solution provided by this invention directly predicts candidate boxes through the projection response map of visual features and categories, avoiding the dependence of traditional few-shot object detection methods on pre-trained candidate box generators based on base classes. Simultaneously, it utilizes uniformly spaced sampling to generate multiple support regions for candidate boxes, and determines the final target category and bounding box based on the consistency of prediction results corresponding to multiple support regions, effectively avoiding the problem of unstable target representation under a single context. In summary, this invention combines a category response-guided candidate box generation mechanism with a cross-scale context consistency inference strategy, achieving high-quality candidate box generation and robust prediction of targets, thereby improving the accuracy, stability, and generalization ability of few-shot object detection.
[0113] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of protection of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of this invention patent should be determined by the appended claims.
Claims
1. A few-sample detection method based on a visual fundamental model, characterized in that, Includes the following steps: S1. Utilize a pre-trained visual baseline model to process the query image. Visual feature maps are obtained by feature extraction. and obtain the corresponding foreground category. prototype vector and background prototype vector ; S2, the prototype vector and Broadcast processing is performed separately to align the spatial dimensions with the visual feature map. Consistent with the spatial dimension, and subsequently with the visual feature map. Perform element-wise multiplication to obtain category Projected response diagram and background projection response diagram ; S3, Project the response map Background projection response map The categories are obtained by splicing and normalizing. Spatial weight and utilize the spatial weights For the visual feature map Perform a transformation to obtain a category constrained by the category response. Conditional feature map Its formula is: In the formula, The symbol for element-wise multiplication; S4. Utilize the dilated grouped convolution module to process the conditional feature map. Feature enhancement is performed to obtain a predicted feature map of the candidate region, and a category is generated based on the predicted feature map of the candidate region using a sliding window method. The predicted bounding box, which has a confidence score; S5. Based on a dynamic candidate box selection strategy, the predicted bounding boxes are filtered to obtain a candidate box set, wherein the categories are... Number of candidate boxes retained The sum of the confidence scores of all predicted bounding boxes for that category is used to determine the result. S6. During the inference phase, the candidate boxes are scaled according to a preset expansion range to construct multiple support regions. The candidate boxes and their corresponding support regions are then used in the projection response map. Features are extracted to obtain local features and multiple contextual features; S7. Perform feature interaction on the local features and the context features to obtain enhanced local features, obtain the candidate box classification results corresponding to each support region based on the enhanced local features, and determine the final category label of the candidate box based on the category with the highest frequency in the classification results corresponding to each support region.
2. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, In step S1, the prototype vector is obtained. The formula is: In the formula, Represents the basic visual model. Indicate category Supports image samples. This indicates the total number of samples in this category.
3. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, The category is obtained in step S3. Spatial weight The formula is: In the formula, This indicates a splicing operation. Indicates a convolutional layer. This represents the normalized activation function.
4. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, In step S4, the conditional feature map is processed using a dilated grouped convolution module. The processing includes: processing the conditional feature map The system is divided into four intermediate feature map sets with the same number of channels along the channel dimension, and features are extracted from the four intermediate feature map sets using four dilated convolutional layers with different dilation rates to obtain the corresponding multi-scale feature maps.
5. The few-sample detection method based on a visual fundamental model according to claim 4, characterized in that, The dilation rates of the four dilated convolutional layers are 1, 2, 4, and 8, respectively.
6. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, The category in step S5 Number of candidate boxes retained The calculation formula is: In the formula, Indicate category The predicted bounding boxes are sorted by confidence level from highest to lowest. Each score This is the preset total number of scores to be included in the calculation. This indicates the floor function.
7. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, Before extracting local features and multiple contextual features in step S6, the method further includes: calculating the projection response map. The mean values of the responses for each category are calculated and sorted. The projected response maps of the top 10 categories with the largest mean values are selected as the projected response maps for the activity categories.
8. The small sample detection method based on a visual fundamental model according to claim 1, characterized in that, The construction of multiple support regions in step S6 includes: from a preset extended range Sampled at uniform intervals within the inner area Expansion coefficient Its formula is: And according to the expansion coefficient The candidate boxes are scaled to obtain the corresponding support regions.
9. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, The feature interaction in step S7 includes: First, update the supported region features using the following formula: Then take the tth The local features after the first round of interaction are concatenated with the supporting region features after the t-th round of interaction, and the local features are updated using the following formula: In the formula, t represents the number of rounds of feature interaction. This represents the support region features after the t-th round of interaction. Indicates the t-th Features of each supported region after one round of interaction Represents the local features after the t-th round of interaction. Indicates the t-th Local features after one round of interaction and and represent the convolutional layers used to support the updating of region features and local features in the t-th round, respectively.
10. The few-sample detection method based on a visual fundamental model according to claim 1, characterized in that, In step S7, the first Final category labels for each candidate box The formula for determining it is: In the formula, For a set of categories, For indicator functions, For the first The candidate box corresponding to the first The predicted categories for each supported region.