Few-sample fine-grained target detection method for SAR (Synthetic Aperture Radar) image

By introducing key point prediction and category feature prototype structure in SAR image detection, the problems of sparse texture, scarce samples and small category differences in target detection in SAR images are solved, and high-precision and stable target detection is achieved.

CN120673032APending Publication Date: 2025-09-19YANGTZE DELTA REGION INST (QUZHOU) UNIV OF ELECTRONIC SCI & TECH OF CHINA
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510740162.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The target detection task in SAR images faces problems such as sparse texture, strong noise, blurred edges, scarce samples, and small category differences, resulting in low detection accuracy and poor model generalization ability. Existing methods lack attention to the discriminative areas inside the target and do not fully utilize the manual key point annotation information.

Method used

A multi-task target detection framework is constructed by integrating the key point guidance mechanism and the category feature prototype structure. The key point prediction task is extended by the ARS-DETR model. Combined with OKS loss optimization, k-means clustering and EMA dynamic update are used to generate category feature prototypes. The L2 norm regularization constraint is imposed under the condition of few samples, and the Euclidean distance measurement mechanism of training-testing prototype is introduced.

Benefits of technology

It improves the model's ability to perceive the internal structure of the target, enhances the detection stability and generalization ability in complex environments, solves the problem of fine-grained recognition of target detection in SAR images, and is suitable for recognition tasks with complex structures and large intra-class variations in remote sensing images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673032A_ABST
    Figure CN120673032A_ABST
Patent Text Reader

Abstract

The invention provides a few-sample fine-grained target detection method for an SAR (Synthetic Aperture Radar) image, and aims to solve the problems of insufficient detection precision and weak generalization ability caused by the problems of sparse texture, large fine-grained difference of target categories, limited labeled samples and the like in the SAR image. According to the method, ARS-DETR is used as a trunk detection model, d key point prediction branches are introduced on the basis of the trunk detection model, and the model is guided to pay attention to a target discriminative region through OKS loss; and meanwhile, a feature prototype set is constructed, class center representation is obtained through confidence screening and k-means clustering, and dynamic updating is performed in combination with an EMA mechanism. In the few-sample training stage, prototype regularization constraint is introduced to keep the feature space stable; in the test stage, through training test prototype distance and classification confidence coefficient weighted fusion, the final discrimination accuracy is improved. The method can effectively improve the structure modeling capability and the few-sample adaptive capability of the target detection task in the SAR image, and is suitable for fine recognition application in a complex remote sensing scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to technical fields such as computer vision, remote sensing image processing, and deep learning, and in particular to a few-sample fine-grained target detection method for SAR images. Background Art

[0002] With the rapid development of deep learning technology, object detection algorithms have been widely used in the field of natural images and have demonstrated good performance in many practical scenarios. However, in synthetic aperture radar (SAR) images, due to the significant differences in imaging principles and data characteristics, object detection tasks still face many difficulties.

[0003] First, SAR images rely on the reflection of radar signals to obtain target information. Due to the scattering characteristics of electromagnetic waves, images often exhibit sparse texture information, strong noise, and blurred edges. These imaging characteristics significantly increase the difficulty of the model in extracting target features, reducing the accuracy and stability of detection.

[0004] Secondly, in actual applications, SAR images are mostly used in non-cooperative scenarios such as military monitoring and disaster assessment. The target acquisition process is subject to objective factors such as imaging timing, regional blockade, and climatic conditions, which makes it difficult to obtain high-quality, labeled sample data, forming a natural limitation of small-sample training.

[0005] Furthermore, the sheer variety of targets in SAR images, with subtle differences between them, further raises the challenge of fine-grained recognition with a small number of samples. Traditional target detection algorithms, which generally rely on large-scale, highly diverse data for training, perform unstably under these extreme data conditions, making it difficult to meet the detection accuracy and fine-grained recognition requirements of the task.

[0006] Previous research on SAR image target detection has attempted to improve detection performance by introducing deep learning models. Common approaches include CNN-based detection frameworks, rotated box detection models, and few-shot meta-learning strategies. These methods have, to a certain extent, alleviated the challenges of variable target poses and strong background interference in SAR images, contributing to improved detection accuracy and adaptability.

[0007] However, these existing methods generally have the following shortcomings: First, most methods only focus on the overall contour features of the target and lack attention to the discriminative areas within the target, resulting in limited ability in fine-grained category distinction; second, when faced with imaging noise unique to SAR images and subtle differences between categories, few-shot learning methods are still prone to overfitting or feature shift, and their generalization ability is insufficient; third, most current models fail to fully utilize the manual key point annotation information in SAR images, and have not formed an effective guidance mechanism to improve the recognition of feature expression.

[0008] Therefore, given the complexity and practical limitations of the task of detecting small-scale, fine-grained targets in SAR images, a detection method that can simultaneously improve feature discrimination and model stability is urgently needed. This method should effectively utilize limited annotated information, enhance the perception of key target areas, and maintain classification accuracy and generalization capabilities under data-scarce conditions, thereby better adapting to application requirements in complex SAR imaging environments. Summary of the Invention

[0009] The present invention proposes a few-sample fine-grained target detection method for SAR images. To address the technical challenges of low recognition accuracy and poor model generalization ability caused by sparse texture, scarce samples, and slight category differences in SAR images, a multi-task target detection framework is constructed that integrates the key point guidance mechanism and the category feature prototype structure.

[0010] The method provided by the present invention takes ARS-DETR as the basic model, expands the key point prediction task on the target detection backbone structure, and introduces the class center feature prototype construction and structural constraint mechanism, thereby improving the model's fine-grained perception ability of targets in SAR images and detection stability under limited sample conditions.

[0011] In order to achieve the above object, the present invention adopts the following technical means:

[0012] The present invention provides a few-sample fine-grained target detection method for SAR images, comprising the following steps:

[0013] Step 1: Data Preparation: Obtain and preprocess the FAIR-CSAR dataset, convert the target rotation box annotations and the nine key point annotations into a unified format, and construct training samples that support multi-task input;

[0014] Step 2: Base class training: Based on the ARS-DETR model, the key point prediction task module is expanded, and the key point supervision signal is used to guide the network to focus on the internal discriminative area of ​​the target, and the OKS loss is used for optimization;

[0015] Step 3: Feature prototype construction: Extract the category center from the high-confidence query features output by the decoder, use the k-means clustering method to obtain the initial feature prototype of each category, and dynamically update the prototype in combination with the exponential moving average (EMA) mechanism;

[0016] Step 4: Few-shot training: Input the training samples in N-way K-shot format, build the prototype set of the current task category, and use the base class prototype set to perform L2 norm regularization constraint on the current task prototype;

[0017] Step 5: Few-sample testing: Build a prototype set based on the test sample, calculate the Euclidean distance between the test prototype and the training prototype, and weightedly fuse the classification confidence with the distance information to generate the final category score.

[0018] In the above scheme, step 1 includes the following sub-steps:

[0019] Step 1.1: Obtain the SL subset of the FAIR-CSAR dataset, which contains PNGImages image files, Annotations target box annotation files, and KeyPoints key point annotation files;

[0020] Step 1.2: Parse the target box annotation in DOTA format, which contains the coordinate values ​​of 8 corner points (x1, y1, x2, y2, ..., x8, y8), the target category label and the difficulty level mark;

[0021] Step 1.3: Parse the KeyPoints annotation file and extract the coordinate information of 9 key points of each target. The key points are composed of 18 numerical values. express;

[0022] Step 1.4: Insert the key point coordinates in order after the 8 corner point coordinates of the target box annotation and before the category label to construct the extended DOTA format annotation data;

[0023] Step 1.5: Pair the extended DOTA format annotation data with the image file to form a training sample that supports multi-task input.

[0024] In the above solution, the key point prediction task module in step 2 includes:

[0025] A fully connected layer is introduced into the decoder output query feature of the ARS-DETR model to predict the two-dimensional coordinates of the nine key points;

[0026] The OKS loss function is used to evaluate the similarity between the predicted key points and the true annotations, and the OKS loss is combined with the classification loss and regression loss to form a multi-task joint optimization objective.

[0027] In the above solution, step 2 includes the following sub-steps:

[0028] Step 2.1: Add a keypoint prediction branch to the decoder output of the ARS-DETR model and map each query feature into an 18-dimensional vector through a fully connected layer. in Represents the normalized coordinates of the i-th predicted key point;

[0029] Step 2.2: Labeling based on target key points Calculate the OKS loss function:

[0030]

[0031] Where: d n is the Euclidean distance between the nth key point prediction and the true value, k n is the specific weight of the key point, s is the target scale parameter, δ(v n >0) is the visibility flag, N kpts The number of key points representing the target;

[0032] Step 2.3: Implement the positive and negative sample judgment rules for each key point: When d i When <τ, it is marked as a positive sample, otherwise it is marked as a negative sample, where τ is the preset threshold;

[0033] Step 2.4: Loss and Classification Loss Positioning loss Perform linear combination to construct the multi-task total loss function:

[0034]

[0035] Among them, λ1, λ2λ3 are preset weight coefficients.

[0036] In the above solution, the feature prototype generation in step (3) includes:

[0037] High-confidence query feature screening: From the query features output by the ARS-DETR decoder, the confidence of each query feature is calculated through the fully connected layer, and a high-confidence subset is screened as candidate features;

[0038] K-means clustering generates initial prototypes: K-means clustering is performed on the high-confidence candidate features, where the number of clusters K is equal to the total number of target categories, and feature prototypes of each category are generated. The clustering process includes:

[0039] Initialization: Randomly select K features as initial cluster centers;

[0040] Assignment: Assign each candidate feature to the cluster center closest to it;

[0041] Update: Recalculate the center of each cluster, that is, the mean of all features, based on the distribution results;

[0042] Iteration: Repeat the assignment and update steps until the cluster centers converge or the preset maximum number of iterations is reached;

[0043] The candidate features are clustered using the k-means clustering algorithm, the number of clusters is set to the total number of target categories, and the initial feature prototype of each category is generated.

[0044] In the above scheme, the dynamic update method in step (3) is:

[0045] After each iteration, a new prototype vector is generated based on the current clustering result;

[0046] Use the EMA method to perform a weighted average of the new prototype and the historical prototype:

[0047]

[0048] Among them, P (t) represents the prototype vector of the tth round, P (t-1) represents the prototype vector of the previous round, is the prototype obtained by the new clustering in this round, and α is the smoothing coefficient of EMA update.

[0049] In the above solution, the few-sample training phase includes:

[0050] Input the training samples in N-way K-shot format, extract high confidence query features through the backbone network and decoder module, and use the k-means clustering method to generate the current task category prototype set P train , and apply the base class prototype set P base The L2 norm regularization constraint of is used to penalize the gap between the current task prototype and the base class prototype. The regularization loss function is defined as:

[0051]

[0052] Where C is the number of categories, Represents the prototype of category C in the current task; Indicates the reference prototype of the category at the base class stage; ||·||2 indicates the L2 norm of the Euclidean distance;

[0053] The regularization loss term Through the weight hyperparameter λ proto The weighted fusion with the classification loss and positioning loss forms a multi-task joint optimization objective. In the above scheme, the few-sample training stage includes:

[0054] Build a collection of test prototypes based on test images Calculate the test prototype and the prototype set generated in the few-shot training phase Euclidean distance between It is defined as:

[0055]

[0056] in, represents the Euclidean distance between the c-th test prototype and the training prototype; ||·||2 represents the Euclidean distance, c∈{1, 2, ..., C} is the index of all tested categories, is the characteristic prototype of the c-th target in the testing phase, It is the c-th feature prototype generated in the few-shot training phase.

[0057] Compare the confidence of the classification branch output with the Euclidean distance Perform weighted fusion to generate the final category score.

[0058] In the above scheme, the final category scoring function S(c) in step 5 is defined as:

[0059]

[0060] Among them, S(c) represents the final category score after fusion, σ cls (c) represents the original confidence of the classification branch output, represents the Euclidean distance between the test prototype and the training prototype, and γ represents the distance attenuation coefficient;

[0061] In the above scheme, the method is implemented based on the mmrotate framework, and the key point branch, feature prototype module and loss function module are all modular structures that can be independently configured and scheduled.

[0062] Because the present invention adopts the above technical means, it has the following beneficial effects:

[0063] 1. By introducing a key point prediction branch into the detection network and combining it with the OKS loss function to construct a multi-task joint optimization objective (see step 2), this paper solves the problem of difficulty in accurately locating the discrimination area in SAR images due to sparse target texture and blurred edges. It effectively improves the model's spatial perception of key internal structures of the target, achieves accurate capture of fine-grained structural information, and enhances the ability to recognize subtle differences between classes. It is suitable for recognition tasks with complex structures and large intra-class variation in remote sensing images.

[0064] 2. The present invention solves the problems of unstable feature expression and severe class center offset under few-sample learning conditions by constructing a set of category prototypes based on high-confidence query features and introducing k-means clustering and EMA dynamic update mechanism (see step 3). It achieves temporal consistency and dynamic adaptive modeling of prototype vectors, and significantly enhances the feature representation stability and structural robustness of the model across tasks and data distributions.

[0065] 3. The present invention applies an L2 norm regularization constraint based on the base class prototype set during the few-shot training phase (see step 4), which solves the problem of feature offset and overfitting of new category prototypes under few-shot conditions. By guiding the current task prototype to move closer to the center of the historical class, structural alignment across task feature spaces is achieved, effectively enhancing the model's generalization ability and classification stability for unseen classes.

[0066] 4. During the testing phase, the present invention introduces the Euclidean distance measurement mechanism between training and testing prototypes and combines it with the weighted confidence information output by the model classification branch (see step 5). This solves the problem that traditional methods, which rely solely on confidence for category discrimination in the presence of complex background interference or image quality degradation, are prone to misjudgment. It also increases the reference weight of structural consistency in the discrimination process, thereby enhancing the accuracy and robustness of the final category judgment result.

[0067] 5. The present invention adopts a modular structural design, integrating the key point prediction module, feature prototype module and regularization loss module into the detection framework in the form of independent sub-modules (see "Implementation Method"), which solves the problems of poor integration and high transplantation cost of existing detection methods, achieves seamless compatibility with mainstream detection frameworks (such as mmrotate), and improves the flexible scheduling capability and deployment efficiency of the method in engineering practice.

[0068] 6. This invention constructs a key point guidance mechanism (see steps 2.1-2.4) by jointly utilizing the additional manual key point annotation information provided in SAR images. This solves the problems of low utilization of annotation information and sparse single-sample supervision signals in traditional methods, effectively improving the information density and supervision strength of training samples, and enhancing model training efficiency and detection performance without increasing annotation costs.

[0069] 7. The present invention introduces a confidence screening strategy in the prototype construction process, and only selects high-quality features for k-means clustering (see step 3). This solves the problem that abnormal samples easily interfere with the prototype learning process, effectively improves the purity and distinguishability of the class center representation, and enhances the model's fault tolerance to noisy samples and overall recognition robustness.

[0070] 8. The present invention solves the problem of limited gradient flow and slow convergence caused by single-task training by implementing a multi-task joint learning mechanism for target detection, key point prediction and prototype construction during the training process. It improves the coordination and optimization efficiency of the overall training process, significantly accelerates the model convergence speed, and is suitable for scenarios with limited computing resources or rapid deployment requirements.

[0071] 9. This paper uses ARS-DETR as the detection backbone model and integrates the Deformable Attention mechanism (see steps 1-2). It solves the problem that traditional horizontal box detection cannot adapt to changes in target posture, and achieves high-precision modeling and detection of targets with significant angle changes in SAR images. It is particularly suitable for remote sensing monitoring tasks that require processing rotating targets and complex postures.

[0072] In summary, the present invention systematically solves the technical difficulties such as texture sparseness, sample scarcity, and large fine-grained differences between classes in SAR images by jointly introducing structural supervision (key points), semantic abstraction (prototypes) and multi-task optimization mechanisms. It significantly improves the structural modeling capability and cross-scenario adaptability of target detection tasks, has excellent engineering scalability and practical application value, and has strong technological advancement and industrial transformation potential. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 This is the overall flow chart of the system in the present invention;

[0074] Figure 2 This is the structure diagram of the multi-task detection model in the present invention (with ARS-DETR as the main trunk), where c n and Represents the classification results and classification loss function, a n , b n and Represents the angle, coordinate information and corresponding regression loss function in the regression process, k n and Represents the results of feature point prediction and OKS loss function;

[0075] Figure 3 A schematic diagram of the characteristic prototype construction in the present invention;

[0076] Figure 4 This is a diagram of the EMA update mechanism in the present invention. DETAILED DESCRIPTION

[0077] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with certain specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions of the present invention are intended to fall within the scope of the claims of the present invention.

[0078] In addition, in order to better illustrate the present invention, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.

[0079] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0080] The data used in this paper is the FAIR-CSAR Complex Image Target Dataset V1.0. This dataset is based on the single-view complex imagery products of the domestically produced Gaofen-3 satellite. It is one of the largest, most granularly annotated, and most informative datasets available in the field of fine-grained target detection in SAR images. This dataset consists of two subsets: the SL subset and the FSI subset.

[0081] The SL subset uses spotlight radar imaging mode, with image data at a nominal resolution of 1 meter, covering approximately 170,000 target instances across 22 target categories. The FSI subset uses fine strip mode with a resolution of 5 meters, containing approximately 170,000 instances across three target categories. This paper uses the SL subset and its three types of annotation data: PNGImages, Annotations, and KeyPoints.

[0082] The target rotation box annotations provided in the FAIR-CSAR dataset use the DOTA format, where each annotation contains the two-dimensional coordinates of the four corner points of the target box (a total of 8 values), followed by the target category label and the difficulty score. For example:

[0083] 959.99910.91979.97907.85997.001019.00977.001022.06General_Cargo_Ship0

[0084] The FAIR-CSAR dataset also includes a KeyPoints annotation file, which provides the coordinates of nine artificial keypoints corresponding to the target. Each keypoint consists of a pair of (x, y) coordinates, for a total of 18 values. This file also contains the coordinates of four points of the target bounding box, which is used for alignment with the DOTA format. An example of a keypoint annotation is shown below:

[0085] <x1> 974< / x1> <y1> 967< / y1>

[0086] <x2> 985< / x2> <y2> 1012< / y2> ...

[0088] <x9> 981< / x9> <y9> 952< / y9>

[0089] In order to achieve a unified format for model training input, this paper extracts the key point coordinates in order and inserts them after the target box coordinates and before the category label based on the original DOTA format annotation, thus constructing an extended DOTA format annotation data. An example of a single annotation after conversion is as follows:

[0090] 959.0979.0997.0977.0910.0907.01019.01022.0974.0967.0985.01012.0968.0926.098 6.0997.0968.0947.0978.0936.0978.0983.0969.0911.0981.0952.0General_Cargo_Ship 0

[0091] This annotation format integrates the rotation box coordinates and key point information in the same row, ensuring data organization consistency. This facilitates model sharing of inputs in target detection and key point prediction tasks, simplifies subsequent data preprocessing, and improves training efficiency.

[0092] In the present invention, ARS-DETR (Adaptive Rotated Set-based Deformable DETR) is adopted as the backbone structure of target detection. The model is based on the classic DETR (Detection Transformer) and Deformable DETR architecture design, and has made key improvements for the task of rotation target detection. By introducing the rotation box parameter modeling mechanism and the adaptive rotation decoder, ARS-DETR can directly predict the five-dimensional rotation bounding box (x, y, w, h, θ) containing angle information without relying on non-maximum suppression (NMS) in post-processing, thereby achieving efficient and accurate end-to-end rotation target detection. The model integrates the Deformable Attention module, which can aggregate and locate multi-scale image features, and has strong posture adaptability and structural stability. The overall implementation of ARS-DETR is based on the open source framework mmrotate, which has good modular expansion capabilities and provides a flexible implementation basis for the multi-task target detection method proposed in this invention.

[0093] Based on this structure, in order to realize multi-task joint learning of target detection and key point prediction, the specific model structure is as follows Figure 2 As shown in the figure, the present invention introduces a key point branch and loss calculation module into the original detection framework. The specific steps are as follows:

[0094] 1. Construction of the key point data reading module. During the data preprocessing stage, this paper extends the LoadAnnotations class defined in the mmdetection framework that mmrotate relies on. By adding the parameter with_keypoints = True, the nine key point coordinates corresponding to each target instance are synchronously read during the data loading process, parsed into a standard tensor format, and added to the gt_keypoints field of the training sample. This completes the loading and preprocessing of key point information and ensures that the model can synchronously obtain key point supervision signals during training.

[0095] 2. Multi-task detection head and loss function design. In the detection network structure, the present invention adds a key point prediction branch in the dense_heads (detection head module) of ARS-DETR. This branch is used to regress the two-dimensional coordinates of nine key points (a total of 18-dimensional vectors) by appending a set of independent fully connected layers (FC Layers) after each decoder outputs the query feature. The output of the key point prediction module is paired with the ground truth key point label, and the OKS (Object Keypoint Similarity) loss function commonly used in human posture estimation tasks is used as the optimization target. The formula is as follows:

[0096]

[0097] in:

[0098] L kpts represents the loss function of the key point prediction task, d n is the Euclidean distance between the nth key point prediction and the true value, k n is the specific weight of the key point. In human posture detection, different key points have different weights due to their different detection difficulties and importance to the overall task; however, in this invention, given the large number of target categories, all key point weights are set to fixed values, s is the scale of the target, δ(v n >0) is a visibility flag, which indicates whether the key point participates in the loss calculation. For the convenience of practical application, all the marked key points in the present invention are set to be visible (ie, all are included in the loss calculation).

[0099] This method independently determines positive and negative samples for each keypoint. Specifically, for each keypoint, if the Euclidean distance between its predicted and true location is less than a preset threshold, it is considered a positive sample and included in the loss calculation; otherwise, it is considered a negative sample and not included in the loss calculation. This approach provides a more detailed reflection of the prediction accuracy of each keypoint, preventing a single outlier from excessively impacting the overall loss.

[0100] The OKS loss essentially measures the spatial distance between predicted keypoints and true keypoints, normalizing them based on object size and keypoint visibility. This loss function effectively guides the model to focus on structural regions of the object, thereby improving the discriminability and robustness of feature learning. The keypoint prediction loss, along with the existing classification and localization losses, constitutes the total multi-task loss, achieving unified end-to-end optimization.

[0101] The base class feature prototype construction in the present invention includes two processes: feature prototype generation and dynamic update. The specific steps are as follows:

[0102] 1. Feature prototype generation. The present invention adds a prototype module under the models directory of mmrotate to extract the query features output by the decoder. Since the quality of the 300 query features generated by default varies, the confidence of each query feature is first calculated through the fully connected layer, and the high-confidence parts are screened out as candidates. Subsequently, the k-means clustering algorithm is used to cluster these high-confidence query features, thereby generating independent feature prototypes for each category. K-means clustering is a classic unsupervised clustering algorithm. Its core idea is to divide all input features into K clusters so that the distance between the features in each cluster and its cluster center (i.e., the prototype) is minimized. The specific process is as follows:

[0103] Initialization: randomly select K features as initial cluster centers; Assign: assign each feature to be clustered to the cluster center closest to it. Update: recalculate the center of each cluster (i.e., the mean of all features assigned to that cluster) based on the assignment results; Iteration: repeat steps 2 and 3 until the cluster centers converge or the maximum number of iterations is reached. The number of clusters K in this invention is set to the target number of categories, 22, to ensure that each category can generate independent and representative feature prototypes.

[0104] In this paper, the number of clusters, K, is set to the total number of target classes (e.g., 22 in the FAIR-CSAR dataset) to ensure that each class of target has an independent and representative prototype vector. This prototype serves as the central representation of the class in the feature space, helping to improve the model's ability to distinguish class features and express structure.

[0105] 2. Dynamic Update: To further enhance the stability and generalization capabilities of feature prototypes, this paper uses an EMA (Exponential Moving Average) dynamic update strategy to continuously optimize the prototype. EMA is a commonly used online statistical technique that achieves smooth and dynamic updates by taking a weighted average of historical prototypes and the current newly generated prototype. The specific update formula is as follows:

[0106]

[0107] Among them, P (t) represents the prototype vector of the tth round, P (t-1) represents the prototype vector of the previous round, is the prototype obtained by the new clustering in this round, and α is the smoothing coefficient of EMA update.

[0108] This method effectively suppresses the interference of occasional anomalous features on prototype updates, making the prototype more representative and temporally consistent. Through EMA's dynamic adjustment mechanism, the prototype can adaptively reflect the category structure in the feature space that evolves during training, improving the model's ability to model long-term distribution trends.

[0109] 3. Integration of training scheduling and auxiliary modules. To ensure efficient operation and stable scheduling of the feature prototype module during training, the present invention adds an auxiliary module under the core directory of mmrotate to manage hook registration, optimizer parameter scheduling, and model synchronization mechanism during the prototype update process.

[0110] Define custom training hooks (such as PrototypeUpdateHook) in core / hooks / to dynamically update and save the prototype set after each iteration;

[0111] Adjust the learning rate strategy of the prototype branch in core / optimizer / to decouple it from the main detection task and prevent prototype learning from perturbing the backbone network.

[0112] In the training configuration file, the prototype module is included in the scheduling system so that it is automatically enabled, frozen, or updated during the specified training phase;

[0113] All modules have controllable parameter definitions through configuration files (such as configs / ), which improves project flexibility and maintainability.

[0114] This structural design enables the prototype construction module to be decoupled from the backbone detection network, with good system integration and experimental controllability, providing stable semantic support for subsequent few-sample adaptation tasks.

[0115] In summary, the present invention continuously generates high-quality category feature prototypes by combining confidence screening, k-means clustering and EMA dynamic updating, effectively improving the discriminability and stability of feature expression during model training, and providing clear and controllable feature structure support for subsequent target detection tasks.

[0116] The specific steps of regularization constraints in the present invention are as follows:

[0117] 1. In-task prototype generation. During the few-shot training phase, the model receives training samples constructed in an N-way, K-shot format to construct feature representations for the current task category. These few-shot images are used to extract query features through the backbone network and decoder module. The confidence filtering mechanism in step 3 is then applied to obtain a subset of high-confidence features.

[0118] The feature subset is input into the k-means clustering module to generate the feature center of each training category, forming the few-sample prototype set under the current training task, denoted as P train This prototype represents the category structure under a small number of samples, and may be unstable and spatially offset due to limited data.

[0119] 2. Prototype regularization constraint mechanism: To prevent the few-sample prototype from offsetting or overfitting in the feature space, the present invention introduces a stable prototype set P generated in the base class stage. base As a structural reference, the distance constraint method is used to train Regularization is performed. This regularization process does not interfere with the backbone detection process and is only applied in the prototype space after clustering is completed. The regularization loss function is defined as:

[0120]

[0121] Where C is the number of categories, Represents the prototype of category C in the current task; represents the reference prototype of the category at the base class stage; ||·||2 represents the Euclidean distance (L2 norm). This loss term serves as an auxiliary regularization term, added to the multi-task training objective function and optimized jointly with the classification loss and localization loss. Its purpose is to constrain the category center in the case of few samples, guiding the model to maintain the original feature distribution structure and reducing the risk of feature shift caused by a sudden decrease in the number of samples.

[0122] 3. Regularization weight is adjusted in the training strategy. To ensure the adaptability of the prototype constraint to the main detection task, the present invention sets the regularization term weight hyperparameter λ proto , used to control the influence of this constraint on the total training loss. The weight can be adjusted dynamically based on the training stage or validation set performance.

[0123] In addition, the present invention supports two regularized scheduling strategies:

[0124] Fully enabled: Prototype constraints are applied throughout the entire few-shot training phase to enforce structural consistency.

[0125] Stage-based: Prototype constraints are added only in the early training stage and automatically frozen in the later stage to enhance convergence flexibility.

[0126] This regularization mechanism helps the model maintain the discriminability of the feature space under very few sample conditions through structural guidance, distance constraints, and loss coupling, effectively alleviating overfitting and improving the stability and generalization ability of the detection results.

[0127] The specific steps of measurement in the present invention are as follows:

[0128] 1. Prototype construction in the test phase. In the test phase, the model receives the test image under the current task and constructs the prototype set of the test phase according to the method in step 3, which is recorded as P test ;

[0129] 2. The distance between prototypes is used to measure the distance between each category prototype generated in the test phase. Compared with the prototype set constructed in the few-shot training phase Perform one-to-one Euclidean distance calculation. The metric function is defined as follows:

[0130]

[0131] in, represents the Euclidean distance between the c-th test prototype and the training prototype; ||·||2 represents the Euclidean distance (L2 norm). c∈{1, 2, ..., C} is the index of all categories to be tested.

[0132] 3. Auxiliary discrimination mechanism. To improve the accuracy and stability of category determination in target detection tasks, the present invention introduces a weighted fusion mechanism based on feature prototype distance during the testing phase. This mechanism fuses the original confidence output by the model classification branch with the prototype distance of the corresponding category of the current test sample as the basis for the final category score. Specifically, for each candidate category c, the final category scoring function is defined as follows:

[0133]

[0134] Among them, S(c) represents the final category score after fusion, σ cls (c) represents the original confidence of the classification branch output, represents the Euclidean distance between the test prototype and the training prototype, and γ represents the distance attenuation coefficient

[0135] This scoring function maintains the model's original classification output capabilities while further incorporating consistency signals from the prototype structure to weightedly modify the scores of each category. Categories with smaller distances receive higher final scores, while scores for categories farther from the training prototype are attenuated, thereby improving the model's robustness and false positive suppression capabilities under low-sample conditions. This auxiliary mechanism requires no modifications to the original detection structure and only adjusts scores at the output stage, making it easy to integrate and suitable for object recognition scenarios in complex backgrounds.

[0136] To verify the effectiveness of the method of the present invention, model training and algorithm testing were completed in the following software and hardware environment:

[0137] Hardware environment: CPU uses AMD Ryzen Threadripper PRO 5975WX, 32 cores, main frequency 3.60GHz; GPU uses NVIDIA GeForce RTX 4090×5;

[0138] Operating system: Linux;

[0139] Python environment: Python 3.10.13;

[0140] Deep learning framework: PyTorch 1.13.1, CUDA 11.7.99;

[0141] OpenMMLab dependent component versions:

[0142] MMCV-full: 1.7.1;

[0143] MMDetection: ≥ 2.19.0;

[0144] MMRotate:0.1.0;

[0145] Compiler version: GCC version meets the standard ≥ 5.

[0146] In the above environment, the few-shot target detection method proposed in this invention that integrates key point guidance and feature prototype modeling is implemented based on the ARS-DETR framework, and completes the complete training and inference process by modularly expanding the mmrotate structure (including key point branches, prototype modules and regularization constraint strategies).

[0147] The above is only a preferred embodiment of the present invention. It should be pointed out that ordinary technicians in this technical field can make several improvements and modifications without departing from the concept of the present invention. These improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A few-shot fine-grained target detection method for SAR images, characterized in that: The following steps are included: Step 1: Data Preparation: Obtain and preprocess the FAIR-CSAR dataset, convert the target rotation box annotations and the nine key point annotations into a unified format, and construct training samples that support multi-task input; Step 2: Base class training: Based on the ARS-DETR model, the key point prediction task module is expanded, and the key point supervision signal is used to guide the network to focus on the internal discriminative area of ​​the target, and the OKS loss is used for optimization; Step 3: Feature prototype construction: Extract the category center from the high-confidence query features output by the decoder, use the k-means clustering method to obtain the initial feature prototype of each category, and dynamically update the prototype in combination with the exponential moving average (EMA) mechanism; Step 4: Few-shot training: Input the training samples in N-way K-shot format, build the prototype set of the current task category, and use the base class prototype set to perform L2 norm regularization constraint on the current task prototype; Step 5: Few-sample testing: Build a prototype set based on the test sample, calculate the Euclidean distance between the test prototype and the training prototype, and weightedly fuse the classification confidence with the distance information to generate the final category score.

2. The method according to claim 1, characterized in that Step 1 contains the following sub-steps: Step 1.1: Obtain the SL subset of the FAIR-CSAR dataset, which contains PNGImages image files, Annotations target box annotation files, and KeyPoints key point annotation files; Step 1.2: Parse the target box annotation in DOTA format, which contains the coordinate values ​​of 8 corner points (x1, y1, x2, y2, ..., x8, y8), the target category label and the difficulty level mark; Step 1.3: Parse the KeyPoints annotation file and extract the coordinate information of 9 key points of each target. The key points are composed of 18 numerical values. express; Step 1.4: Insert the key point coordinates in order after the 8 corner point coordinates of the target box annotation and before the category label to construct the extended DOTA format annotation data; Step 1.5: Pair the extended DOTA format annotation data with the image file to form a training sample that supports multi-task input.

3. The method according to claim 1, characterized in that The key point prediction task module in step 2 includes: A fully connected layer is introduced into the decoder output query feature of the ARS-DETR model to predict the two-dimensional coordinates of the nine key points; The OKS loss function is used to evaluate the similarity between the predicted key points and the true annotations, and the OKS loss is combined with the classification loss and regression loss to form a multi-task joint optimization objective.

4. The method according to claim 2, characterized in that Step 2 contains the following sub-steps: Step 2.1: Add a keypoint prediction branch to the decoder output of the ARS-DETR model and map each query feature into an 18-dimensional vector through a fully connected layer. in Represents the normalized coordinates of the i-th predicted key point; Step 2.2: Labeling based on target key points Calculate the OKS loss function: Where: d n is the Euclidean distance between the nth key point prediction and the true value, k n is the specific weight of the key point, s is the target scale parameter, δ(v n >0) is the visibility flag, N kpts The number of key points representing the target; Step 2.3: Implement the positive and negative sample judgment rules for each key point: When d i When <τ, it is marked as a positive sample, otherwise it is marked as a negative sample, where τ is the preset threshold; Step 2.4: Loss and Classification Loss Positioning loss Perform linear combination to construct the multi-task total loss function: Among them, λ1, λ2λ3 are preset weight coefficients.

5. The method according to claim 1, wherein The feature prototype generation in step (3) includes: High-confidence query feature screening: From the query features output by the ARS-DETR decoder, the confidence of each query feature is calculated through the fully connected layer, and a high-confidence subset is screened as candidate features; K-means clustering generates initial prototypes: K-means clustering is performed on the high-confidence candidate features, where the number of clusters K is equal to the total number of target categories, and feature prototypes of each category are generated. The clustering process includes: Initialization: Randomly select K features as initial cluster centers; Assignment: Assign each candidate feature to the cluster center closest to it; Update: Recalculate the center of each cluster, that is, the mean of all features, based on the distribution results; Iteration: Repeat the assignment and update steps until the cluster centers converge or the preset maximum number of iterations is reached; The candidate features are clustered using the k-means clustering algorithm, the number of clusters is set to the total number of target categories, and the initial feature prototype of each category is generated.

6. The method according to claim 1, characterized in that The dynamic update method in step (3) is: After each round of training, a new prototype is generated based on the current clustering results And update the prototype using the exponential moving average (EMA) formula: Among them, P (t) represents the prototype vector of the tth round, P (t-1) represents the prototype vector of the previous round, is the prototype obtained by the new clustering in this round, and α is the smoothing coefficient of EMA update.

7. The method according to claim 1, characterized in that The few-shot training phase includes: Input the training samples in N-way K-shot format, extract high confidence query features through the backbone network and decoder module, and use the k-means clustering method to generate the prototype set of the current task category. Where c∈{1, 2,…, C} is the category index; Applying a base class prototype collection The L2 norm regularization constraint of is used to penalize the gap between the current task prototype and the base class prototype. The regularization loss function is defined as: Where C is the number of categories, Represents the prototype of category C in the current task; Indicates the reference prototype of the category at the base class stage; ||·||2 indicates the L2 norm of the Euclidean distance; The regularization loss term Through the weight hyperparameter λ proto It is weightedly fused with the classification loss and positioning loss to form a multi-task joint optimization objective.

8. The method according to claim 1, characterized in that The few-shot training phase includes: Build a collection of test prototypes based on test images Calculate the test prototype and the prototype set generated in the few-shot training phase Euclidean distance between It is defined as: in, represents the Euclidean distance between the c-th test prototype and the training prototype; ||·||2 represents the Euclidean distance, c∈{1, 2, ..., C} is the index of all categories to be tested, is the characteristic prototype of the c-th target in the testing phase, The c-th feature prototype generated in the few-shot training phase. Compare the confidence of the classification branch output with the Euclidean distance Perform weighted fusion to generate the final category score.

9. The method according to claim 1, characterized in that The final category scoring function S(c) in step 5 is defined as: Among them, S(c) represents the final category score after fusion, σ cls (c) represents the original confidence of the classification branch output, represents the Euclidean distance between the test prototype and the training prototype, and γ represents the distance attenuation coefficient.

Citation Information

Cited By

  • Large model continuous learning method based on multi-granularity knowledge migration and related device

    CN121480740A

  • Large-scale continuous learning methods and related devices based on multi-granularity knowledge transfer

    CN121480740B

  • Virtual reality rehabilitation training method and system based on action comparison feedback

    CN122091085A

  • A Virtual Reality Rehabilitation Training Method and System Based on Motion Comparison Feedback

    CN122091085B

  • Target detection method and system with inter-class ordered constraint

    CN122115834A