Small sample SAR target identification method based on supervised comparative learning
By adopting a supervised contrast learning method in SAR target recognition, combined with global-local contrast loss and attention module, the dependence and feature quality problems of deep learning methods on a large number of labeled samples is solved, and better transferable feature learning and Performance improvement.
Patent Information
- Application Number
- CN202411293919.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-31
AI Technical Summary
Existing deep learning methods require a large number of labeled samples for training in SAR target recognition, and the standard cross-entropy loss used in the pre-training stage affects the quality of the features, and more transferable features cannot be learned.
Using a small sample SAR target recognition method based on supervised contrast learning, combined with global-local contrast loss and attention module, a comparison learning pre-training framework is constructed, and positive and negative samples are constructed using label information, and the comparison learning loss calculation is calculated by local scales. Spatial feature similarity, and an attention mechanism is used to calculate spatial attention weights as auxiliary pre-training targets.
While maintaining visual similarity, the learned representations are easier to transfer to SAR images, obtaining better transferable features, improving the performance of SAR small sample target recognition, and especially showing the most advanced on the MSTAR dataset performance.
Smart Images

Figure CN119229257A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of target recognition, in particular to a small sample SAR target recognition method based on supervised contrast learning. Background Art
[0002] Synthetic aperture radar plays an important role in agriculture, geological exploration, disaster prevention, national defense and security due to its ability to obtain sensor information that is not affected by weather and climate. SAR image classification aims to automatically label samples as a semantic category and is a basic task in the field of automatic target recognition of SAR images. With the great success of deep learning in the field of computer vision, deep neural networks (DNNs) have been introduced into the field of SAR target recognition, mainly including ship recognition and aircraft recognition. At present, a variety of deep learning methods for SAR target recognition have been developed, especially CNN-based deep networks have produced excellent classification accuracy.
[0003] However, since DNN methods are generally data-driven, they require a large number of labeled samples to train the network, which cannot be met in many practical applications. Therefore, it is of great significance to explore new methods for learning knowledge with limited labeled samples. In recent years, small-sample learning has received increasing attention, with the goal of training a model that can recognize new categories with a small amount of labeled data. FSL methods mainly include metric learning, meta-learning, and transfer learning. Among them, SAR small-sample recognition based on transfer learning has a natural advantage, because more and more studies have shown that pre-training on a large number of optical images can achieve rapid adaptability in the SAR image testing phase. These methods all use an extremely simple transfer learning baseline, that is, first pre-training the model using the standard cross entropy (CE) loss, then freezing the parameters and training a linear classifier on the meta-test set. Although the use of CE loss in the pre-training stage is promising, it affects the quality of the learned representation, because the model can only obtain the necessary knowledge to solve the classification task of the seen category during training, and cannot learn more transferable features.
[0004] To this end, those skilled in the art have proposed a small sample SAR target recognition method based on supervised contrastive learning. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a small sample SAR target recognition method based on supervised contrastive learning to solve the problems mentioned in the background technology.
[0006] A small-sample SAR target recognition method based on supervised contrastive learning includes a global-local supervised contrastive learning loss for SAR image classification, wherein the local contrastive loss is combined with an attention module to construct a global-local contrastive learning pre-training framework, capture the discriminative features available outside the meta-training set, and use label information to construct positive and negative samples. At the same time, the local scale contrastive learning loss is used as another auxiliary objective, and the spatial feature z is used to obtain the local scale contrastive learning loss. s Calculate the similarity between given sample pairs and use the attention mechanism to calculate the spatial attention weights so that the features and Alignment and vice versa, then measure the one-to-one spatial similarity and finally calculate the SC loss.
[0007] Preferably, in form, let f φ As an embedding model, it maps the input x to the spatial feature z s ∈R HW×d , and then perform average pooling to obtain the global feature z g ∈R d , and then use the projection head p to map it to a low-dimensional space, that is, f = p(z g )∈R d′ , so that the global similarity function sim g Represented as a pair of projected global features f i and f j The cosine similarity between them is the dot product between the l2 normalized features.
[0008] Preferably, by combining the meta-training set D new N pairs of images and labels are extracted from the batch, and each sample in the batch is enhanced to obtain 2N data points. The contrast loss based on the global scale is calculated as:
[0009]
[0010] Among them, 1 cond ∈{0,1} is an indicator function, if cond satisfies, its value is 1; N yi are with the same label y i is the total number of images; τ is a scalar temperature parameter.
[0011] Preferably, let h v 、h q and h k Represent the value, query and key projection heads respectively, and transform the spatial feature z s As input, it outputs the value v of the d′-dimensional feature, the query q and the key k, that is, v,q,k∈R HW×d′ , given a pair of spatial features and The alignment value of i relative to j is denoted by v i|j , the specific calculation method is:
[0012]
[0013] And, using the key k j and query q i Calculate v j|i , align the value of j with i.
[0014] Preferably, given a pair of values v i and v j , together with the two aligned versions v of the above attention mechanism combination i|j and v j|i , and use The eigenvector representing the spatial position r∈[1,HW], for each value at the spatial position r Perform the l2 normalization step and then calculate the total spatial similarity between a pair of spatial features for:
[0015]
[0016] Spatial contrastive learning uses the spatial similarity function sim defined in formula (3) s , and similar to the global contrast loss in formula (4), the local contrast loss is calculated as:
[0017]
[0018] According to the contrast objectives in formula (1) and formula (4), the pre-training objectives take different forms, making the pre-training objective L T is the sum of CE and SC losses, where λ CE and λ SC As a scaling weight, used to control each item
[0019] Contribution: L T =λ CE L CE +λ SC L SC +λ GC L GC (5)
[0020] By using the GC loss in formula (4) as an additional pre-training target for the CE loss, we can push the embedding model f φ Learn the visual similarity between samples of the same category and obtain embedding results.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] 1. The present invention uses contrastive representation learning as an auxiliary goal in the pre-training stage. In this process, not only the input is mapped to a fixed target, but also the features are optimized to pull semantically similar samples together in the embedding space and push dissimilar samples apart. This allows discriminative representations to be generated between different samples while keeping the visual similarity unchanged, making it easier to transfer the learned representations to SAR images.
[0023] 2. The present invention uses contrastive learning as an auxiliary pre-training target for SAR small sample target recognition to learn more transferable features.
[0024] 3. This paper proposes a novel supervised contrast loss function, which includes a global-local contrast loss based on the classic CE loss. The local contrast loss adopts an attention-based alignment mechanism to perform spatial comparison of features, thereby further promoting category-independent discrimination patterns. Experiments were conducted on the standard dataset MSTAR of SAR images to demonstrate the effectiveness of the proposed method and achieve state-of-the-art performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of the global-local supervision contrast loss principle of the present invention;
[0026] Figure 2 This is the accuracy graph of the pre-training validation set (mini-ImageNet validation set) of the present invention;
[0027] Figure 3 It is a weight coefficient analysis diagram of the present invention. DETAILED DESCRIPTION
[0028] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0029] As attached Figure 1 As shown:
[0030] Embodiment: The present invention provides a small sample SAR target recognition method based on supervised contrastive learning, including a global-local supervised contrastive learning loss for SAR image classification, wherein the local contrastive loss is combined with an attention module to improve the efficiency of the feature extractor, construct a global-local contrastive learning pre-training framework, capture the discriminant features available outside the meta-training set, thereby facilitating the recognition of unseen categories in the test phase, and constructing positive and negative samples using label information, while taking the local scale contrastive learning loss as another auxiliary target, and using the spatial feature z s Calculate the similarity between given sample pairs and use the attention mechanism to calculate the spatial attention weights so that the features and Alignment and vice versa, then measure the one-to-one spatial similarity and finally calculate the SC loss.
[0031] In form, let f φ As an embedding model, it maps the input x to the spatial feature z s ∈R HW×d , and then perform average pooling to obtain the global feature z g ∈R d , and then use the projection head p to map it to a low-dimensional space, that is, f = p(z g )∈R d′ , so that the global similarity function sim g Represented as a pair of projected global features f i and f j The cosine similarity between them is the dot product between the l2 normalized features.
[0032] By combining the meta-training set D new N pairs of images and labels are extracted from the batch, and each sample in the batch is enhanced to obtain 2N data points. The contrast loss based on the global scale is calculated as:
[0033]
[0034] Among them, 1 cond ∈{0,1} is an indicator function, if cond satisfies, its value is 1; N yi are with the same label y i is the total number of images; τ is a scalar temperature parameter.
[0035] Let h v 、h q and h k Represent the value, query and key projection heads respectively, and transform the spatial feature z s As input, it outputs the value v of the d′-dimensional feature, the query q and the key k, that is, v,q,k∈R HW×d′ , given a pair of spatial features and The alignment value of i relative to j is denoted by v i|j , the specific calculation method is:
[0036]
[0037] And, using the key k j and query q i Calculate v j|i , align the value of j with i.
[0038] Given a pair of values v i and vj , together with the two aligned versions v of the above attention mechanism combination i|j and v j|i , and use The eigenvector representing the spatial position r∈[1,HW], for each value at the spatial position r Perform the l2 normalization step and then calculate the total spatial similarity between a pair of spatial features for:
[0039]
[0040] Spatial contrastive learning uses the spatial similarity function sim defined in formula (3) s , and similar to the global contrast loss in formula (4), the local contrast loss is calculated as:
[0041]
[0042] According to the contrast objectives in formula (1) and formula (4), the pre-training objectives take different forms, making the pre-training objective L T is the sum of CE and SC losses, where λ CE and λ SC As a scaling weight, used to control each item
[0043] Contribution: L T =λ CE L CE +λ SC L SC +λ GC L GC (5)
[0044] By using the GC loss in formula (4) as an additional pre-training target for the CE loss, we can push the embedding model f φ Learn the visual similarity between samples of the same category and obtain embedding results.
[0045] Experimental example: as attached Figure 2-3 As shown:
[0046] For the embedding model f φ , using ResNet-18 composed of 4 residual blocks, with Drop block as regularizer, outputting 640-dimensional features (i.e. d = 640). For the detection head and attention module, an MLP with one hidden layer and a ReLU nonlinearity similar to SimCLR is used, outputting 80-dimensional features (i.e. d′ = 80). SGD is used in the optimization process, with momentum of 0.9 and weight decay of 5×10 -4, the learning rate is 5×10-2, and the batch size is 64. For the loss function, the temperature parameters τ and τ' are set to 0.1, and the weight λ is scaled CE , SC and λ GC Set to 1.0, 0.3, and 0.3 respectively.
[0047] During meta-training, for a given batch of 2N augmented samples, the first N samples are obtained using the standard augmentation method, i.e., random cropping, color jittering, and random horizontal flipping. The remaining N samples are augmented using the SimCLR type, i.e., random adjustment cropping, color jittering, random horizontal flipping, and random grayscale conversion.
[0048] During the meta-testing process, several N-way K-shot test classification tasks are drawn from categories not seen in the meta-test set, where N is the number of categories and K is the number of training samples for each category. The model is evaluated on 600 randomly sampled tasks, and the average accuracy and 95% confidence interval are reported.
[0049] In the experiment, mini-Imagenet is used as the source domain dataset, and the target domain dataset in the meta-test phase is constructed based on MSTAR. MSTAR includes 10 types of military vehicles, which are collected at two shooting angles (azimuth angles from 0° to 360°). Table 1 lists the detailed data description of MSTAR under SOC, including the serial number, the number of samples in the training set and the test set. All experiments are carried out under SOC conditions. The samples of 17° are the training set, and the samples of 15° are the test set.
[0050] In order to study the effect of contrast loss as an auxiliary target, the accuracy of the mini-ImagaNet validation set in the pre-training stage is recorded. The results are shown in Figure 2 It is found that the performance of using auxiliary contrast loss is significantly improved compared with using only CE loss. This also shows that the traditional CE loss will limit the model to focus on the simplest features (such as texture structure) and often ignore complex prediction features (such as semantic information), while the global-local contrast loss allows the model to learn a wider range of features.
[0051] The proposed method is then compared with classic small sample learning methods such as ProtoNet and cross-domain small sample methods such as URL. The ResNet-18 pre-trained on mini-ImageNet is uniformly used as the backbone network. Since ProtoNet uses the Euclidean distance metric for classification, the same distance metric is used for classification in all ablation experiments. Experiments are conducted on the MSTAR dataset, and the results are shown in Table 1.
[0052] Table 1 Comparison with other (cross-domain) small sample methods
[0053]
[0054] It can be seen that the method of the present invention still improves the performance of ProtoNet, which performs better in the classical method, by 1% and 5% respectively under the 5-way 1-shot and 5-way 5-shot experimental settings. SUR selectively reorganizes the features extracted from the optical source domain, which cannot achieve good results in the target domain of SAR images with completely different imaging mechanisms. URL and TSA only use the standard CE loss as the standard in the pre-training stage, but the former learns from multiple source domains and then distills a universal feature extractor for cross-domain classification, while the latter adds a backbone network adaptation module on the basis of the former. Although it overcomes the cross-domain adaptation problem well, both are limited to not learning features with strong generalization in the pre-training stage. The global-local scale contrast learning loss proposed in the present invention further improves the performance of the backbone network obtained in the pre-training stage, which is 1% higher than the performance of the TSA method.
[0055] Ablation studies:
[0056] The performance obtained using various loss functions,the results are shown in Table 2.
[0057] Table 2 Ablation experiment
[0058]
[0059] It is found that when using auxiliary contrast loss, the global contrast loss has very limited help in improving the model effect, while the local contrast loss has better benefits, which highlights the effectiveness of using spatial features, and the use of global and local losses at the same time can bring more obvious advantages. In addition, the model's ability to extract features in the field of optical images does not conflict with that in the field of SAR images. The higher the pre-training verification accuracy, the better the effect can be obtained in the meta-learning stage. This proves that although SAR images are converted from complex information returned by radar echoes, they have the same effect and function as optical images in terms of visual features.
[0060] In the loss function proposed in the embodiment, the global-local contrast learning weight determines its proportion in the final loss, and the result is as follows: Figure 3 The horizontal axis represents the fixed CE =1, different λ SC , GC The influence of the backbone network pre-trained by the weight coefficient on the small sample classification stage, when λ SC , GCThe model has the best performance when it is equal to 0.3, but as the weight of contrast loss in the final loss increases, the model performance is further limited. The reason is that these two types of contrast loss are auxiliary training targets of supervised CE loss, and their role cannot completely replace CE loss. Otherwise, the model's focus area is too scattered, which is not conducive to feature extraction.
[0061] Through the proposed global-local pre-training contrast loss for small-sample SAR target recognition, the model focuses on more discriminative semantic information so as to learn more features that can be transferred to SAR images from optical images. A large number of experiments have shown that the proposed global-local contrast loss and CE loss can complement each other and provide good transferable features for small-sample SAR image classification tasks, which has better performance than traditional small-sample or cross-domain small-sample learning methods; it has been proved that the proposed method has achieved a high classification accuracy in the field of SAR images under limited sample conditions, confirming the importance of learning good transferable features for small-sample learning of SAR images.
[0062] Additionally, in order to provide a concise description of exemplary embodiments, all features of an actual embodiment (ie, those features that are not relevant to the best mode presently contemplated for carrying out the invention or those that are not relevant to implementing the invention) may not be described.
[0063] It will be appreciated that in the development of any actual implementation, as in any engineering or design project, numerous implementation-specific decisions may be made. Such a development effort may be complex and time-consuming, but will be a routine task of design, fabrication, and production for those of ordinary skill having the benefit of this disclosure without undue experimentation.
[0064] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A small sample SAR target recognition method based on supervised contrastive learning, characterized by: It includes a global-local supervised contrastive learning loss for SAR image classification, in which the local contrastive loss is combined with the attention module to construct a global-local contrastive learning pre-training framework, capture the discriminative features available outside the meta-training set, and use label information to construct positive and negative samples. At the same time, the local scale contrastive learning loss is used as another auxiliary target to use the spatial feature z s Calculate the similarity between given sample pairs and use the attention mechanism to calculate the spatial attention weights so that the features and Alignment and vice versa, then measure the one-to-one spatial similarity and finally calculate the SC loss.
2. The small sample SAR target recognition method based on supervised contrastive learning as claimed in claim 1, characterized in that: In form, let f φ As an embedding model, it maps the input x to the spatial feature z s ∈R HW×d , and then perform average pooling to obtain the global feature z g ∈R d , and then use the projection head p to map it to a low-dimensional space, that is, f = p(z g )∈R d′ , so that the global similarity function sim g Represented as a pair of projected global features f i and f j The cosine similarity between them is the dot product between the l2 normalized features.
3. The small sample SAR target recognition method based on supervised contrastive learning as claimed in claim 2, characterized in that: By combining the meta-training set D new N pairs of images and labels are extracted from the batch, and each sample in the batch is enhanced to obtain 2N data points. The contrast loss based on the global scale is calculated as: Among them, 1 cond ∈{0,1} is an indicator function whose value is 1 if cond satisfies; are with the same label y i is the total number of images; τ is a scalar temperature parameter.
4. The small sample SAR target recognition method based on supervised contrastive learning as claimed in claim 3, characterized in that: Let h v 、h q and h k Represent the value, query and key projection heads respectively, and transform the spatial feature z s As input, it outputs the value v of the d′-dimensional feature, the query q and the key k, that is, v,q,k∈R HW×d′ , given a pair of spatial features and The alignment value of i relative to j is denoted by v i|j , the specific calculation method is: And, using the key k j and query q i Calculate v j|i , align the value of j with i.
5. The small sample SAR target recognition method based on supervised contrastive learning as claimed in claim 4, characterized in that: Given a pair of values v i and v j , together with the two aligned versions v of the above attention mechanism combination i|j and v j|i , and use The eigenvector representing the spatial position r∈[1,HW], for each value at the spatial position r Perform the l2 normalization step and then calculate the total spatial similarity between a pair of spatial features for: Spatial contrastive learning uses the spatial similarity function sim defined in formula (3) s , and similar to the global contrast loss in formula (4), the local contrast loss is calculated as: According to the contrast objectives in formula (1) and formula (4), the pre-training objectives take different forms, making the pre-training objective L T is the sum of CE and SC losses, where λ CE and λ SC As scaling weights, used to control the contribution of each term: L T =λ CE L CE +λ SC L SC +λ GC L GC (5) By using the GC loss in formula (4) as an additional pre-training target for the CE loss, we can push the embedding model f φ Learn the visual similarity between samples of the same category and obtain embedding results.
Citation Information
Cited By
Few-sample bearing fault migration diagnosis method based on multi-working-condition supervised comparative learning
CN121256224A
Method for bearing fault migration diagnosis with few samples based on multi-condition supervised contrast learning
CN121256224B
