Small sample target detection method based on decoupling mechanism and metric learning
By introducing a decoupling mechanism adaptation enhancement module and a hybrid category characterization measurement module in the small sample object detection method, the problem of insufficient field adaptability and feature utilization in small sample object detection is solved, and higher detection accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202510392046.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-01
AI Technical Summary
The existing small sample object detection methods have shortcomings in field adaptability and feature utilization, resulting in limited improvement in model performance, especially in the scenarios of new data distribution adaptability and sample scarcity.
Adaptation strengthening module based on the decoupling mechanism and the hybrid category characterization measurement module are adopted to control the learning information range of different components through feature decoupling and gradient backhaul strategies, combining single-mode positive category characterization vectors and multi-mode negative category characterization vectors to reduce in-class variance and improve the discriminant nature of feature representations.
It significantly improves the accuracy of object detection, enhances the model's adaptability to new data distribution, improves the accuracy of small sample detection, and solves the problems of insufficient field adaptation and insufficient feature utilization.
Smart Images

Figure CN120236065A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of object detection, and particularly relates to a small-sample object detection method based on a decoupling mechanism and metric learning. Background Art
[0002] With the continuous development of deep learning, object detection technology has made remarkable progress in multiple fields. The object detection task is to process data such as pictures and videos, and extract semantic information for localization and classification tasks. It has been widely applied in fields such as autonomous driving, security monitoring, and fault detection. Currently, object detection methods are mainly divided into single-stage methods and two-stage methods. Among them, single-stage detectors transform the object detection problem into a regression task, and directly predict the object bounding box and its corresponding class probability through the backbone network; while two-stage detectors adopt a cascaded detection framework, first using a region generation network to generate a series of candidate regions, and then classifying and regressing the bounding boxes of these regions to achieve more accurate detection.
[0003] However, traditional object detection methods are difficult to adapt to small-sample scenarios. Small-sample object detection refers to the task of object detection with only a very small number of labeled samples. Traditional methods rely on a large amount of training data to learn effective feature representations, but in small-sample scenarios, it is difficult for the model to learn effective patterns from a small number of samples, and it is easy to cause overfitting, resulting in a decrease in detection accuracy.
[0004] To address this challenge, current research can mainly be divided into small-sample object detection methods based on meta-learning and small-sample object detection methods based on transfer learning. Meta-learning-based methods utilize their ability to adaptively learn the best parameters in various tasks, transforming the object detection problem into a series of small-sample detection tasks, so that the model can quickly adapt to new classes with extremely few samples; small-sample object detection methods based on transfer learning learn transferable knowledge from a base class with sufficient samples and transfer it to a new class dataset with scarce samples, thereby achieving high-precision object detection in scarce samples and obtaining better detection performance than meta-learning-based methods.
[0005] Although the above methods can utilize new class knowledge to improve the performance of object detection tasks in small-sample scenarios, in order to retain the general features learned from the base class, the backbone network of the model is usually frozen during training on new classes, which limits the model's adaptability to the data distribution of new classes. In addition, in scenarios with scarce samples, how to maximize the mining of limited effective information to help the model learn the feature patterns of new classes, current methods still have deficiencies. Existing small-sample object detection methods have obvious deficiencies in domain adaptability and feature utilization, resulting in limitations in further improving the model performance. Summary of the Invention
[0006] The object of the present invention is to provide a few-shot object detection method based on decoupling mechanism and metric learning. First, in terms of domain adaptation, an adaptation reinforcement module is proposed, which controls the range of information learned by different components through feature decoupling and gradient backpropagation strategies, avoiding parameter update conflicts among components in domain adaptation. Secondly, a hybrid class representation metric module combining single-mode positive class representation vectors and multi-mode negative class representation vectors is proposed, which obtains more discriminative feature representations by reducing the within-class variance, thus significantly improving the accuracy of object detection, so as to solve the problems of insufficient domain adaptation and insufficient feature utilization in existing methods.
[0007] To solve the above technical problems, the specific technical solutions of the present invention are as follows:
[0008] A few-shot object detection method based on decoupling mechanism and metric learning, comprising the following steps:
[0009] Step 1: Prepare a dataset containing no less than 3000 images and corresponding annotations as the base class dataset; prepare a dataset whose classes have no intersection with the base classes as the few-shot dataset, randomly sample subsets containing different numbers of images from it to simulate the actual scenario in the case of scarcity, and divide the base class dataset and the new class dataset into training set, validation set and test set according to the ratio of 8:1:1 respectively;
[0010] Step 2: Construct a few-shot object detection model, the few-shot object detection model includes a backbone network, a region proposal network and a region of interest pooling layer, an adaptation reinforcement module based on decoupling mechanism, and a detection head composed of a classifier and a regressor. Among them, the image first passes through the backbone network to extract basic features, then generates proposal regions through the region proposal network, and the region of interest pooling layer is used to extract the corresponding features of the candidate regions. Subsequently, the adaptation reinforcement module based on decoupling mechanism maps the extracted features to independent subspaces of each downstream task to enhance the robustness of the adaptation reinforcement model based on decoupling mechanism in each task. Finally, the detection head composed of a classifier and a regressor outputs the detection results;
[0011] Step 3: Use the training set of the base class dataset to train the few-shot object detection model constructed in Step 2 to obtain a base model, and save the weight parameters of the base model; and use the validation set of the base class dataset to evaluate the detection performance of the trained base model; the base model refers to the object detection model trained on the base class dataset;
[0012] Step 4: Initialize all model parameters of the few-shot object detection model except the fully connected layer parameters in the detection head using the weight parameters of the base model, and train the few-shot object detection model using subsets of the few-shot dataset with different numbers of images to simulate different degrees of sample scarcity, obtaining a set of final detection models trained on different subsets of the few-shot dataset;
[0013] Step 5: Load all the trained few-shot object detection models, and evaluate the detection accuracy of the few-shot object detection models using the test set of the new class dataset.
[0014] Furthermore, the dataset in Step 1 uses the PASCAL Visual Object Classes dataset, which is a classic benchmark dataset widely used in tasks such as image classification, object detection, and semantic segmentation. This dataset is initiated and maintained by the PASCAL VOC Challenge, covering 20 common object categories such as people, animals, vehicles, etc. The images in the dataset have a wide range of sources, diverse scenes, objects presented under different scales, angles, and partial occlusions, etc., with a complex background and high detection difficulty.
[0015] Furthermore, the few-shot object detection model described in Step 2 adopts a two-stage object detection framework and selects Faster-RCNN as the object detector; here, the object detector uses ResNet101 as the backbone network to extract basic features; the ResNet-50 network is a network that removes the fully connected layer and the last pooling layer.
[0016] Furthermore, the adaptation reinforcement module based on the decoupling mechanism in the component described in Step 2 helps the model obtain features that can quickly adapt to new class data in two aspects. During the forward propagation process, the adaptation reinforcement module maps the features into two sub-feature spaces of the region proposal network and the detection head respectively, and performs downstream detection tasks in the independent sub-feature spaces respectively to avoid feature conflicts in different functional modules. During the backpropagation, the gradient stopping strategy is adopted for the gradient backpropagated by the region proposal network, while the gradient scaling strategy is adopted for the class-related parameter gradients backpropagated by the detection head.
[0017] Furthermore, the adaptation reinforcement module based on the decoupling mechanism consists of two sets of feature mapping parameters. During the forward propagation, the features obtained by the backbone network are mapped into two sub-feature spaces by the feature mapping parameters of the module through the channel-level soft attention mechanism. Let the input feature extracted by the backbone network be where C, H, and W represent the number of channels, height, and width of the feature respectively, Let \(\mathbb{R}\) denote the real number space and \(\theta\) denote the backbone network parameters. Let the feature mapping function be \(\varPhi(x)\). In the forward propagation, the calculation of the adaptive reinforcement module can be expressed as two linear projection formulas:
[0018] \(\varPhi\) RPN (f θ (x)) = W RPN f θ (x) + b RPN
[0019] \(\varPhi\) RCNN (f θ (x)) = W RCNN f θ (x) + b RCNN
[0020] Among them, \(\varPhi\) RPN and \(\varPhi\) RCNN respectively represent two projection functions that project features onto the region generation network and the detection head. W RPN , W RCNN , b RPN and b RCNN represent projection parameters.
[0021] In the reverse calculation, its calculation formula is:
[0022]
[0023] Among them, \(\lambda\) is a scaling coefficient, representing the contribution weight of class-related parameters in the update of backbone network parameters, represents the gradient value backpropagated by RCNN during the backpropagation process.
[0024] Furthermore, in the component described in step 2, the classifier uses cosine similarity to measure the distance between the embedded feature and the class representation vector. The class representation vector consists of a positive class vector and corresponding multiple negative class vectors. The single-mode positive class representation vector table can accurately depict the core features of each positive class, and the multi-mode negative class representation vector can more accurately depict the background in real-world images, thereby improving the detection accuracy.
[0025] In the above-mentioned hybrid class representation metric module, let the positive class representation matrix R P be written as The negative class representation matrix R N be written as Among them denotes the real number space, D denotes the dimension of the embedding space in metric learning, C denotes the number of positive classes, M denotes the number of modes of the negative class representation vector, P denotes the positive embedding space, and N denotes the negative embedding space. Represents the positive class representation vector of the $i$-th class, Represents the $j$-th pattern of the negative class representation vector of the $i$-th class. $E(x)$ represents the embedded feature in the positive embedding space, and $E$ N (x) represents the embedded feature in the negative embedding space; the distance between the embedded feature and the class representation vector is measured based on the cosine similarity between vectors, and the mathematical formula is:
[0026]
[0027] where $d(E(x), R$ P ) i represents the cosine distance between the embedded feature in the positive embedding space and the $i$-th positive class representation vector, and $d(E$ N (x), R$ N ) i,j represents the cosine distance between the embedded feature in the negative embedding space and the $j$-th pattern of the $i$-th negative class. $E(x)$ T and $E$ N (x)$ T respectively represent the transposes of $E(x)$ and $E$ N (x).
[0028] Furthermore, the classifier in step 2 proposes a set of triplet losses to obtain a more compact feature representation. This set of triplet losses includes three loss functions that measure the distance between the proposed region features and the class representation vectors. Among them, $L$ triplet represents the distance measurement between the proposed region features containing positive samples and the positive and negative class representation vectors, and $L$ neg_triplet represents the distance measurement between the proposed region features containing negative samples and the positive and negative class representation vectors, and $L$ pos_triplet represents the distance measurement between the high-quality proposed region features containing positive samples and the positive and negative class representation vectors. A high-quality proposed region refers to a proposed region whose intersection over union with the true bounding box of the positive sample is greater than 0.7. Its mathematical expression is:
[0029]
[0030] where $N$ pos represents the number of proposed regions containing positive samples in a training batch. Positive samples refer to the target objects in the image that belong to the dataset classes. $N$ neg represents the number of proposed regions containing negative samples in a training batch. Negative samples refer to all objects and background regions in the image that do not belong to the dataset classes. $N$ hv_pos represents the number of high-quality proposed regions of positive samples in a training batch. $y$ k represents the true label of the $k$-th proposed region, and $y$ k_matchedDenote the positive sample category with the largest intersection over union (IoU) with the k-th proposed region. Denote the category representation vector corresponding to the true category of the target object in the k-th proposed region containing positive samples. Denote the category representation vector corresponding to the object with the largest IoU with the k-th proposed region containing negative samples, δ margin , δ neg_margin , δ hv_margin Denote the margin constants in the triplet loss function respectively.
[0031] A few-shot object detection method based on decoupling mechanism and metric learning of the present invention has the following advantages: Through the adaptation reinforcement module based on the decoupling mechanism and the hybrid category representation metric module that combines the single-mode positive category representation vector and the multi-mode negative category representation vector, it effectively solves the problems of insufficient use of new class data and insufficient feature utilization in existing few-shot detection methods, obtains features with a more compact and more robust intra-class distribution, and achieves good few-shot detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 Is the flowchart of the method of the present invention;
[0033] Figure 2 Is the overall architecture diagram of the present invention;
[0034] Figure 3 Is the adaptation reinforcement module of the present invention;
[0035] Figure 4 Is the hybrid category representation metric module of the present invention;
[0036] Figure 5 is a comparison diagram of the detection effects of the method of the present invention and the baseline method.
[0037] Figure 5(a) is a schematic diagram of the detection effect of the baseline model of the present invention;
[0038] Figure 5(b) is a schematic diagram of the detection effect of the method of the present invention; DETAILED DESCRIPTION OF THE INVENTION
[0039] To better understand the purpose, structure and function of the present invention, the following further describes in detail a few-shot object detection method based on decoupling mechanism and metric learning of the present invention with reference to the drawings.
[0040] First, in order to enable the model to better adapt to the new class data pattern while preserving the base class information during the fine-tuning stage, an adaptation enhancement module based on a decoupling mechanism is proposed. This module can adjust the degree and category of knowledge transfer of new class information in the backbone network on the basis of unfreezing the backbone network, thus effectively promoting the model's migration ability and helping it adapt to new classes. Second, in order to make more full use of features, a hybrid class representation metric module is proposed. By calculating the cosine distances between the positive class representation vectors of single-modal and the negative class representation vectors of multi-modal, and combining the cross-entropy classification loss and the triplet loss function, the feature representation is further optimized, enabling the model to generate more compact and discriminative feature representations.
[0041] Figure 1 This is the flowchart of a few-shot object detection method based on decoupling mechanism and metric learning of the present invention; Figure 2 This is the overall architecture diagram of the model of the present invention. The specific steps are as follows:
[0042] Step 1: Prepare a dataset containing a large number of samples and corresponding annotations as the base class dataset; prepare a dataset whose categories have no intersection with the base classes as the few-shot dataset, and randomly sample different numbers of subsets from it to simulate the actual scenario of new classes in the case of scarce samples; the few-shot dataset is the PASCAL Visual Object Classes dataset, which is a classic benchmark dataset widely used in tasks such as image classification, object detection, and semantic segmentation. This dataset is initiated and maintained by the PASCAL VOC challenge, covering 20 common object categories such as people, animals, vehicles, etc. The images in the dataset come from a wide range of sources, with diverse scenes. The objects are presented under different scales, angles, and partial occlusions, etc., and the background is complex, making it difficult to detect. In the few-shot scenario, select the data of 15 categories in the PASCAL VOC dataset as the base class dataset, and use the remaining 5 categories of data as the new class dataset. Then randomly select 1, 2, 3, 5, and 10 images from the new class dataset respectively to form sub-datasets to simulate the few-shot dataset.
[0043] Step 2: Construct a few-shot object detection model. The few-shot object detection model mainly includes a backbone network, a region proposal network, a region of interest pooling layer, an adaptation enhancement module based on a decoupling mechanism, and a detection head composed of a classifier and a regressor. Among them, the image first passes through the backbone network to extract basic features, then the region proposal network generates proposal regions, and the region of interest pooling layer is used to extract the corresponding features of the candidate regions. Subsequently, the adaptation enhancement module based on the decoupling mechanism maps the extracted features to independent subspaces of each downstream task to enhance the robustness of the adaptation enhancement model in each task. Finally, the detection head composed of the classifier and the regressor outputs the detection results.
[0044] The adaptation enhancement module based on the decoupling mechanism, as Figure 3 shown, helps the model obtain features that can quickly adapt to new class data in two aspects. During the forward propagation process, the adaptation enhancement module maps the backbone network features to two sub-feature spaces of the region proposal network and the detection head respectively through two projection calculations, and performs downstream detection tasks separately in the independent sub-feature spaces to avoid feature conflicts in different functional modules. In the backpropagation, the gradient stopping strategy is adopted for the gradient backpropagated by the region proposal network, that is, its gradient is not backpropagated, while the gradient scaling strategy is adopted for the class-related parameter gradient backpropagated by the detection head. Specifically, the adaptation enhancement module consists of two sets of feature mapping parameters. During the forward propagation, the features obtained by the backbone network are mapped to two sub-feature spaces by the feature mapping parameters of the module through the channel-level soft attention mechanism. Let the input feature extracted by the backbone network be where C, H, and W represent the number of channels, height, and width of the feature respectively, represents the real number field, θ represents the backbone network parameters; let the feature mapping function be Φ(x). During the forward propagation, its calculation formula is:
[0045] Φ RPN (f θ (x)) = W RPN f θ (x) + b RPN
[0046] Φ RCNN (f θ (x)) = W RCNN f θ (x) + b RCNN
[0047] where Φ RPN and Φ RCNN are two projection functions that project the features to the region proposal network and the detection head respectively, and W RPN , W RCNN , b RPN and b RCNN represent the projection parameters.
[0048] In the reverse calculation, its calculation formula is:
[0049]
[0050] where λ is the scaling coefficient in the gradient scaling strategy, representing the contribution weight of the class-related parameters to the update of the backbone network parameters.
[0051] The classifier includes a mixed-class representation metric module, as Figure 4As shown. The classifier uses cosine similarity to measure the distance between the embedded features and the class representation vectors, where the class representation vectors consist of positive class vectors and corresponding multiple negative class vectors. The positive class representation vector table of the single mode can accurately depict the core features of each positive class, and the negative class representation vectors of the multi-mode can more accurately depict the background in real-world images, thereby improving the detection accuracy.
[0052] In the above-mentioned hybrid class representation metric module, let the positive class representation matrix R P be written as The negative class representation matrix R N be written as where represents the real number space, D represents the dimension of the embedding space in metric learning, C represents the number of positive classes, M represents the number of modes of the negative class representation vectors, P represents the positive embedding space, N represents the negative embedding space, represents the positive class representation vector of the i-th class, represents the j-th mode of the i-th negative class representation vector, E(x) represents the embedded feature in the positive embedding space, and E n (x) represents the embedded feature in the negative embedding space; the distance between the embedded feature and the class representation vector is measured based on the cosine similarity between vectors, and the mathematical formula is:
[0053]
[0054] where d(E(x),R P ) i represents the cosine distance between the embedded feature in the positive embedding space and the i-th positive class representation vector, and d(E N (x),R N ) i,j represents the cosine distance between the embedded feature in the negative embedding space and the j-th mode of the i-th negative class, and E(x) T and E N (x) T represent the transposes of E(x) and E N (x), respectively.
[0055] Furthermore, the classifier in step 2 proposes a set of triplet losses to obtain a more compact feature representation. This set of triplet losses includes three loss functions that measure the distance between the proposed region features and the class representation vectors, where L triplet represents the distance metric between the proposed region features containing positive samples and the positive and negative class representation vectors, and L neg_triplet represents the distance metric between the proposed region features containing negative samples and the positive and negative class representation vectors, and Lpos_triplet Denote the distance metric between the high-quality proposal region features containing all positive samples and the positive and negative class representation vectors. A high-quality proposal region refers to a proposal region with an intersection over union (IoU) greater than 0.7 with the ground truth bounding box of the positive sample. Its mathematical expression is:
[0056]
[0057] where N pos denotes the number of proposal regions containing positive samples in a training batch. A positive sample refers to the target object belonging to the dataset category in the image. N neg denotes the number of proposal regions containing negative samples in a training batch. A negative sample refers to all objects and background regions in the image that do not belong to the dataset category. N hv_pos denotes the number of high-quality proposal regions of all positive samples in a training batch. y k denotes the ground truth label of the k-th proposal region. y k_matched denotes the positive sample category with the largest IoU with the k-th proposal region. denotes the class representation vector corresponding to the ground truth class of the target object in the k-th proposal region containing a positive sample. denotes the class representation vector corresponding to the object with the largest IoU with the k-th proposal region containing a negative sample. δ margin , δ neg_margin , δ hv_margin respectively denote the margin constants in the triplet loss function.
[0058] Step 3: Train the above object detection model using the training set and validation set of the base class dataset, obtain the base model and save its parameters.
[0059] Step 4: Fine-tune the base model using different subsets of the new class dataset, respectively simulate the few-shot conditions in the new class, and fine-tune the base model on the few-shot datasets containing 1, 2, 3, 5, 10 small samples to obtain a set of final detection models. Step 5: Load the trained few-shot object detection model and evaluate the detection accuracy of the model using the test set. As shown in Figure 5, compared with the baseline method TFA, the present invention achieves better detection performance in the few-shot object detection task.
[0060] It will be understood that the present invention is described by way of some embodiments, and those skilled in the art will know that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the present invention. Additionally, under the teaching of the present invention, these features and embodiments can be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the scope protected by the present invention.
Claims
1. A small sample target detection method based on decoupling mechanism and metric learning, characterized in that: The following steps are involved: Step 1: Prepare a data set containing no less than 3,000 images and corresponding annotations as a base class data set; Prepare a dataset with no intersection between the category and the base category as a small sample dataset, randomly sample and generate subsets containing different numbers of images to simulate the actual scene in this scarce situation, and divide the base category dataset and the new category dataset into training set, validation set and test set in a ratio of 8:1:1 respectively; Step 2, construct a small sample target detection model, which includes a backbone network, a region generation network and a region of interest pooling layer, an adaptive reinforcement module based on a decoupling mechanism, and a detection head composed of a classifier and a regressor, wherein the image first passes through the backbone network to extract basic features, and then generates a proposed region through the region generation network, and the region of interest pooling layer is used to extract the corresponding features of the candidate region. Subsequently, the adaptive reinforcement module based on the decoupling mechanism maps the extracted features to the independent subspaces of each downstream task to enhance the robustness of the adaptive reinforcement model based on the decoupling mechanism in each task. Finally, the detection head composed of the classifier and the regressor outputs the detection result; Step 3: Use the training set of the base class data set to train the small sample target detection model constructed in step 2 to obtain the base model and save the weight parameters of the base model; use the validation set of the base class data set to evaluate the detection performance of the base model; Step 4: Use the weight parameters of the base model to initialize all model parameters of the small sample target detection model except the parameters of the fully connected layer in the detection head, and use the small sample data set containing subsets of different numbers of images to train the small sample target detection model, respectively simulating different degrees of sample scarcity, and obtain a set of final detection models trained on different small sample data set subsets; Step 5: Load all trained small sample target detection models and use the test set of the new class dataset to evaluate the detection accuracy of the small sample target detection model.
2. The small sample target detection method based on decoupling mechanism and metric learning according to claim 1 is characterized in that: The small sample target detection model described in step 2 is Faster-RCNN; the backbone network is the ResNet-101 network; the ResNet-101 network is a network with the fully connected layer and the last pooling layer removed.
3. The small sample target detection method based on decoupling mechanism and metric learning according to claim 1 is characterized in that: The adaptive enhancement module based on the decoupling mechanism in step 2 helps the target detection model to obtain features that can quickly adapt to new types of data in two aspects; in the forward propagation process, the adaptive enhancement module maps the features to the two sub-feature spaces of the region generation network and the detection head respectively, extracting more robust features for both; in the back propagation, the gradient stopping strategy is adopted for the gradient returned by the region generation network, while the gradient scaling strategy is adopted for the class-related parameter gradient returned by the detection head.
4. The small sample target detection method based on decoupling mechanism and metric learning according to claim 3 is characterized in that: The adaptive enhancement module based on the decoupling mechanism is composed of two groups of feature mapping parameters.
5. The small sample target detection method based on decoupling mechanism and metric learning according to claim 1 is characterized in that: Step 2 adopts a hybrid category representation measurement module that combines a single-mode positive category representation vector and a multi-mode negative category representation vector, and uses cosine similarity to measure the distance between the embedded feature and the category representation vector, where the category representation vector is composed of a positive category vector and corresponding multiple negative category vectors. The single-mode positive category representation vector characterizes the core features of each positive category, and the multi-mode negative category representation vector characterizes the background in the real-world image.
6. The small sample target detection method based on decoupling mechanism and metric learning according to claim 5 is characterized in that: Assume that the positive category representation matrix R P Written Negative category representation matrix R N Written in represents the real number space, D represents the dimension of the embedding space in metric learning, C represents the number of positive categories, M represents the number of patterns of negative category representation vectors, P represents the positive embedding space, and N represents the negative embedding space. represents the positive category representation vector of the i-th category, represents the jth mode of the i-th negative category representation vector, E(x) represents the embedding feature in the positive embedding space, and E N (x) represents the embedded features in the negative embedding space; The distance between the embedding feature and the category representation vector is measured based on the cosine similarity between the vectors, and the mathematical formula is: Where, d(E(x),R P ) i represents the cosine distance between the embedding feature in the positive embedding space and the i-th positive category representation vector, d(E N (x),R N ) i,j represents the cosine distance between the embedded feature in the negative embedding space and the jth pattern of the i-th negative category, E(x) T and E N (x) T They represent E(x) and E N The transpose of (x).
7. The small sample target detection method based on decoupling mechanism and metric learning according to claim 6 is characterized in that: The classifier in step 2 proposes a set of triplet losses to obtain a more compact feature representation. The set of triplet losses includes three loss functions that measure the distance between the proposed region features and the category representation vector, where L triplet Represents the distance metric between all the proposed region features containing positive samples and the positive and negative category representation vectors, L neg_triplet Represents the distance metric between the proposed region features containing all negative samples and the positive and negative category representation vectors, L pos_triplet It represents the distance metric between all high-quality proposed region features containing positive samples and the positive and negative category representation vectors. A high-quality proposed region refers to a proposed region whose intersection-over-union ratio with the true annotation box of the positive sample is greater than 0.
7. Its mathematical expression is: Among them, N pos N represents the number of all proposed regions containing positive samples in a training batch. Positive samples refer to target objects in the image that belong to the dataset category. neg Represents the number of all proposed regions containing negative samples in a training batch. Negative samples refer to all objects and background regions in the image that do not belong to the dataset category. N hv_pos Represents the number of high-quality proposal regions for all positive samples in a training batch, y k represents the true label of the k-th proposed region, y k_match ed represents the positive sample category with the largest intersection-over-intersection ratio with the k-th proposed region, Represents the category representation vector corresponding to the true category of the target object in the k-th proposal region containing the positive sample, represents the category representation vector corresponding to the object with the largest intersection-over-unit ratio with the k-th proposed region containing negative samples, δ margin , δ neg_margin , δ hv_margin They represent the margin constants in the triplet loss function respectively.
8. The small sample target detection method based on decoupling mechanism and metric learning according to claim 1 is characterized in that: The dataset in step 1 uses the PASCAL Visual Object Classes dataset.
