Small sample SAR ship detection system and method based on bimodal characteristic distillation

By using a dual-modal feature distillation network and an improved YOLOv5-tiny detection head, the problem of detecting small samples and weak targets in SAR ship detection is solved, achieving high-precision ship detection with a low false negative rate, which is suitable for real-time applications in embedded devices.

CN121884159APending Publication Date: 2026-04-17SIWEI SHIJING TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SIWEI SHIJING TECH (BEIJING) CO LTD
Filing Date
2025-12-30
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies for SAR ship detection face challenges such as small sample size and lack of features for weak targets, cross-domain feature mismatch, and difficulty in detecting weak targets, resulting in low detection accuracy and high false negative rate.

Method used

A small-sample SAR ship detection method based on dual-modal feature distillation is adopted. Through preprocessing of optical and SAR images, construction of dual-modal feature distillation network, staged training and lightweight optimization, cross-modal feature alignment and weak target feature enhancement are achieved. The improved YOLOv5-tiny detection head is then used for prediction.

Benefits of technology

It significantly improves the detection accuracy of small targets, reduces the false alarm rate and false alarm rate, meets the high-efficiency detection needs in small sample scenarios, and adapts to the real-time requirements of embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884159A_ABST
    Figure CN121884159A_ABST
Patent Text Reader

Abstract

The invention discloses a small sample SAR ship detection system and method based on bimodal characteristic distillation in the technical field of SAR image target detection and remote sensing data processing. The method comprises the following steps: acquiring an optical image and a to-be-detected SAR image; performing size normalization, Gaussian filtering, feature normalization and weak target augmentation processing on the optical image, performing speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation processing on the to-be-detected SAR image, and constructing a bimodal training data set based on the processed optical image and the to-be-detected SAR image; and based on the bimodal training data set, constructing a bimodal feature distillation network comprising a source domain feature extractor, a target domain feature extractor and a modal alignment and structure focusing unit. The method is suitable for offshore maritime affair supervision, ship search and rescue, coast defense monitoring and other scenes requiring high-precision detection of small samples and weak and small targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a small-sample SAR ship detection system and method based on dual-modal feature distillation, belonging to the field of SAR image target detection and remote sensing data processing technology. Background Technology

[0002] SAR ship detection, with its advantages of all-day, all-weather, and high-resolution operation, has become a core technology for maritime safety and coastal defense monitoring. However, in practical applications, existing technologies face the following bottlenecks:

[0003] The combination of small sample size and missing features of weak targets: SAR image acquisition relies on specialized sensors, resulting in high costs per image; ship target annotation requires analysis of electromagnetic scattering characteristics, leading to high costs per high-quality annotation sample. In most scenarios, there are insufficient SAR ship samples available for training, creating a small sample dilemma. Furthermore, small targets such as small fishing boats in SAR images occupy only 3-15 pixels, with extremely limited feature information. Traditional deep learning models (such as ResNet-50 and YOLOv3) suffer severe feature loss after multiple rounds of downsampling, resulting in generally low mAP and a high false negative rate for weak targets. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a small-sample SAR ship detection system and method based on dual-modal feature distillation, which solves problems such as small sample size, cross-domain feature mismatch, and difficulty in detecting weak targets, and achieves SAR ship detection that balances accuracy, efficiency and practicality.

[0005] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0006] In a first aspect, the present invention provides a small-sample SAR ship detection method based on dual-modal feature distillation, comprising:

[0007] Acquire optical images and SAR images to be detected;

[0008] The optical image is processed by size normalization, Gaussian filtering, feature normalization and weak target augmentation. The SAR image to be detected is processed by speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation. A dual-modal training dataset is constructed based on the processed optical image and the SAR image to be detected.

[0009] Based on the aforementioned bimodal training dataset, a bimodal feature distillation network is constructed, comprising a source domain feature extractor, a target domain feature extractor, and a modality alignment and structure focusing unit. The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images. The target domain feature extractor uses an improved MobileNetV3 network integrating a CSP structure to extract electromagnetic scattering features from SAR images to be detected. The modality alignment and structure focusing unit achieves cross-modal feature filtering and matching through a two-stage modality alignment algorithm and enhances ship features through a weak target structure focusing algorithm.

[0010] Based on the aforementioned dual-modal feature distillation network, after training using a phased strategy, the model undergoes channel pruning and INT8 quantization lightweighting to obtain a lightweight detection model.

[0011] The lightweight detection model is loaded, and after preprocessing the SAR image to be detected, its target domain features are extracted. The source domain features are extracted by matching similar optical images and then aligned and focused to obtain distillation features. The target domain features and distillation features are fused and input into the improved YOLOv5-tiny detection head for prediction, and the final ship detection result is output.

[0012] Furthermore, the formula for Gaussian filtering of the optical image is:

[0013]

[0014] In the formula: G(x,y) represents the weight value of the Gaussian filter kernel at (x,y), and x and y are the horizontal and vertical distances of the pixel within the window, respectively. This represents the standard deviation of a Gaussian distribution.

[0015] The formula for feature normalization of the optical image is:

[0016]

[0017] In the formula: This represents the normalized pixel value of the c-th channel. Represents the original pixel value. , These are the minimum and maximum values ​​of the c-th channel, respectively.

[0018] The formula for suppressing speckle noise in the SAR image to be detected is:

[0019]

[0020] In the formula: This represents the pixel values ​​of the SAR image after improved Lee filtering. Represents the original SAR pixel value. Indicates the noise variance. Indicates the local window variance;

[0021] The polarization fusion formula for the SAR image to be detected is:

[0022]

[0023] In the formula: This represents the pixel values ​​of the SAR image after polarization fusion, where HH and HV are the pixel values ​​of the HH and HV channels, respectively, and 1e -6 This represents the learning rate.

[0024] Furthermore, the source domain feature extractor employs an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images, including: the formula for weighting the feature map through the CBAM attention module of the source domain feature extractor is as follows:

[0025]

[0026]

[0027]

[0028] In the formula: Indicates channel attention weights. Let S denote the Sigmoid function, MLP denotes a multilayer perceptron, AvgPool denotes global average pooling, and F denotes the original feature map. Represents spatial attention weights, Conv 7×7 This represents a 7×7 convolution, and MaxPool represents global max pooling. This represents the source domain structure feature map.

[0029] Furthermore, the modality alignment and structure focusing unit achieves cross-modal feature screening and matching through a two-stage modality alignment algorithm, including: in the feature screening stage, the two-stage modality alignment algorithm filters invalid features by calculating the Pearson correlation coefficient, the calculation formula being:

[0030]

[0031] In the formula: The Pearson correlation coefficient between the source domain feature map and the target domain feature map is represented by Cov, where Cov represents the covariance. Represents the source domain feature map. This represents the feature map of the target domain, where Var represents the variance.

[0032] The cosine similarity is calculated for the feature vectors of weak target regions to ensure feature consistency. The calculation formula is as follows:

[0033]

[0034] In the formula: Represents cosine similarity. The source region feature map represents the weak target region. A target domain feature map representing a weak target region.

[0035] Furthermore, based on the aforementioned bimodal feature distillation network, a staged training strategy is adopted, including: the bimodal feature distillation network is trained using a four-loss joint optimization, and the total loss function is the weighted sum of the feature distillation loss, classification loss, bounding box loss, and weak target enhancement loss, calculated as follows:

[0036]

[0037]

[0038]

[0039]

[0040]

[0041] In the formula: Indicates the total loss. Indicates characteristic distillation loss, Represents classification loss. Indicates the bounding box loss. Let H represent the feature map height, W represent the feature map width, C represent the number of channels in the feature map, i and j represent the pixel positions in the height and width directions of the feature map, and k represent the number of channels in the pixel's feature map. This represents the weighting coefficient for weak regions. Represents the distillation characteristic diagram. Let N represent the feature map of the target domain, N represent the total number of samples involved in the loss calculation, and log represent the natural logarithm. For real category labels, To predict probabilities, For weak samples, the weighting factor is , and IoU represents the intersection-union ratio between the predicted and ground truth boxes. This represents the weighting coefficient for weak boxes. Let b be the Euclidean distance from the center point, and b be the predicted bounding box. is the true bounding box, c is the diagonal length of the bounding box, and v is the aspect ratio consistency parameter.

[0042] Furthermore, the fusion of target domain features and distillation features includes:

[0043] The target domain feature map and the distilled feature map are fused element-wise, with additional weighting applied to features in weak target regions. The formula is as follows:

[0044]

[0045] In the formula: To fuse feature maps, For the target domain feature map, This is a distillation characteristic diagram.

[0046] Furthermore, the improved YOLOv5-tiny detection head adds a small-scale detection layer on top of the three detection layers to adapt to the detection of weak targets. It outputs the ship bounding box, class probability, and confidence score through convolution operations, and labels weak targets with weak labels.

[0047] Secondly, the present invention provides a small-sample SAR ship detection system based on dual-modal feature distillation, comprising:

[0048] Image acquisition module: Acquires optical images and SAR images to be detected;

[0049] Preprocessing module: Performs size normalization, Gaussian filtering, feature normalization and weak target augmentation on optical images; performs speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation on SAR images to be detected; and constructs a dual-modal training dataset based on the processed optical images and SAR images to be detected.

[0050] Network Construction Module: Based on the aforementioned bimodal training dataset, a bimodal feature distillation network is constructed, comprising a source domain feature extractor, a target domain feature extractor, and a modality alignment and structure focusing unit. The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images. The target domain feature extractor uses an improved MobileNetV3 network integrating a CSP structure to extract electromagnetic scattering features from SAR images to be detected. The modality alignment and structure focusing unit achieves cross-modal feature filtering and matching through a two-stage modality alignment algorithm and enhances ship features through a weak target structure focusing algorithm.

[0051] Model training module: Based on the bimodal feature distillation network, after training using a phased strategy, the model is subjected to channel pruning and INT8 quantization lightweighting to obtain a lightweight detection model;

[0052] Image detection module: Load the lightweight detection model, preprocess the SAR image to be detected, extract its target domain features, match similar optical images to extract source domain features, and obtain distillation features after alignment and focusing; fuse the target domain features and distillation features, input the improved YOLOv5-tiny detection head for prediction, and output the final ship detection result.

[0053] Thirdly, the present invention provides a small-sample SAR ship detection device based on dual-modal feature distillation, including a processor and a storage medium;

[0054] The storage medium is used to store instructions;

[0055] The processor is configured to operate according to the instructions to perform the steps of the method according to any of the foregoing.

[0056] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0057] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0058] I. This invention effectively alleviates the problem of insufficient small sample and weak target sample: Through targeted preprocessing of optical-SAR dual-modal data and weak target-specific augmentation strategies, such as Mosaic fusion and Copy-Paste enhancement, the sample diversity is significantly improved, the proportion of weak target samples is increased, and sufficient high-quality data support is provided for model training, effectively reducing the false negative rate of weak targets.

[0059] II. This invention overcomes the bottlenecks of cross-domain feature mismatch and loss of weak target features: By using a two-stage modal alignment mechanism, combined with Pearson correlation coefficient and cosine similarity screening, invalid features in optical images are effectively filtered out, solving the problem of cross-domain feature migration mismatch and reducing the false alarm rate under complex sea conditions; at the same time, by using the CBAM attention and template matching weighted mechanism, the weak target feature response is enhanced, and the weak target mAP is improved from the existing technology, significantly improving the detection accuracy of weak targets.

[0060] Third, this invention achieves a balance between efficient training with small sample sizes and lightweight deployment: By employing a pre-training-fine-tuning phased training strategy, it effectively addresses the difficulty of model convergence under small sample conditions, ensuring stable training and reliable detection accuracy. Combined with channel pruning and INT8 quantization techniques, it further compresses the number of model parameters and improves inference speed while ensuring controllable loss of detection accuracy for weak targets. It also possesses good adaptability to embedded devices, meeting the dual requirements of high precision and high real-time performance in practical scenarios such as nearshore maritime supervision and ship search and rescue. Attached Figure Description

[0061] The accompanying drawings, which form part of this specification, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0062] Figure 1 This is a flowchart illustrating the small-sample SAR ship detection method based on dual-modal feature distillation provided in Embodiment 1 of the present invention. Detailed Implementation

[0063] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0064] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.

[0065] Example 1:

[0066] Please see Figure 1 This embodiment proposes a small-sample SAR ship detection method based on dual-modal feature distillation. This scheme achieves high-precision detection of SAR ships in small-sample + weak target scenarios through dual-modal dataset preprocessing and augmentation, dual-modal feature distillation network construction, phased training and lightweight optimization, and detection inference.

[0067] (1) Preprocessing and augmentation of bimodal datasets

[0068] By preprocessing the bimodal dataset to eliminate noise interference and unify the data format, and then specifically augmenting and strengthening weak target samples, the input data is ensured to fit the network structure requirements. The specific operations are as follows:

[0069] 1) Optical Image Processing

[0070] Size normalization: A bilinear interpolation algorithm is used to uniformly resample the optical image to 512×512 pixels. This algorithm avoids the stretching or compression distortion of weak target edges caused by traditional interpolation by weighting the four neighboring pixels around the target pixel (the weight is inversely proportional to the pixel distance). After processing, any random optical image is selected and its size is verified against the input port of the Focus layer to ensure that the pixel dimensions are completely consistent, laying the foundation for subsequent downsampling without information loss.

[0071] Gaussian filtering: To address common interference from clouds and shadows in optical images, a 3×3 Gaussian filter kernel is used for smoothing, with a filter standard deviation set to 0.8. The core formula is:

[0072]

[0073] In the formula: G(x,y) represents the weight value of the Gaussian filter kernel at (x,y), and x and y are the horizontal and vertical distances of the pixel within the window, respectively. This represents the standard deviation of a Gaussian distribution.

[0074] During the filtering process, a Gaussian weighted sum is calculated for each pixel in the image, which effectively suppresses high-frequency noise while preserving low-frequency structural details of small targets such as masts and bows, ensuring that the input image conv1 is free from noise interference.

[0075] Feature Normalization: Due to the significant differences in pixel value distribution across the RGB channels of optical images, model training may be biased towards high-brightness channels. Therefore, a channel-by-channel normalization algorithm is used to map the pixel values ​​of each channel to the [0,1] interval. The formula is as follows:

[0076]

[0077] In the formula: This represents the normalized pixel value of the c-th channel. Represents the original pixel value. , These are the minimum and maximum values ​​of the c-th channel, respectively.

[0078] After normalization, the brightness distribution of the three channels is balanced, avoiding misjudgment of feature importance by the CBAM attention module due to differences in channel brightness, and ensuring fairness in the attention to ship structural features.

[0079] Weak Target Augmentation: To address the issue of low sample proportion of weak targets, four augmentation strategies are designed: ① Rotation augmentation (0°, 90°, 180°, 270°) to cover the appearance features of weak targets under different navigation directions; ② Horizontal / vertical flip augmentation to increase sample diversity without changing the target structure; ③ Mosaic fusion augmentation, randomly selecting four optical images containing weak targets and stitching them together into a 512×512 image at a 1:1:1:1 ratio to enhance the contextual association between weak targets and the background (such as background texture under different sea conditions); ④ HSV color perturbation augmentation, adjusting hue (±10°), saturation (±15%), and brightness (±20%) to simulate the ship appearance under different lighting conditions (such as morning, noon, and evening) to avoid overfitting the model to specific lighting conditions.

[0080] 2) SAR Image Processing

[0081] Speckle noise suppression: SAR images suffer from severe speckle noise due to coherent imaging. An improved Lee filter is used to suppress this noise; the filter formula is as follows:

[0082]

[0083] In the formula: This represents the pixel values ​​of the SAR image after improved Lee filtering. Represents the original SAR pixel value. Indicates the noise variance. Indicates the local window variance;

[0084] Where noise variance The value was set to 0.02. This filter adaptively adjusts the filter intensity by calculating the mean and variance of pixel values ​​within a local window—enhancing the filtering effect in areas of high noise density and reducing the filter intensity in areas scattering weak targets, ensuring that the target's scattering contour is preserved. After processing, the distinction between weak targets and the ocean wave background is significantly enhanced, meeting the polarization feature fusion layer's requirements for input data clarity.

[0085] Polarization fusion: The HH channel of a SAR image focuses on areas of strong scattering from the ship (such as the deck and mast), while the HV channel focuses on areas of weak scattering (such as the sides of the hull). These two channels are complementary. A dual-channel feature map is constructed by calculating the ratio of the scattering intensity of the two channels, using the following formula:

[0086]

[0087] In the formula: This represents the pixel values ​​of the SAR image after polarization fusion, where HH and HV are the pixel values ​​of the HH and HV channels, respectively, and 1e -6 Indicates the learning rate;

[0088] The dimension of the fused feature map perfectly matches the input dimension of the polarization feature fusion layer. After fusion, the grayscale difference between weak targets and the background is enhanced, providing a clear target signal for subsequent feature extraction.

[0089] Band anomaly detection: To eliminate invalid SAR images caused by sensor malfunctions and data transmission errors, three types of anomaly judgment conditions are set: ① (HH channel overexposed, image appears bright white); ② (The HV channel is overexposed, resulting in a grayish-white image); ③ (The HH channel has no effective scattering information, and the image appears uniformly black.) , These represent the maximum and minimum pixel values ​​for the HH channel, respectively. Anomaly detection is performed on all SAR images, invalid images are marked and automatically removed to ensure that the data input to the CSP structure is of high quality and to avoid invalid data interfering with model training.

[0090] Augmentation of weak targets: Considering the single-band characteristics of SAR images, three augmentation strategies were designed: ① Rotation and flip augmentation to ensure consistency in augmentation of dual-modal data; ② Copy-Paste augmentation, cropping weak target regions from the original SAR image and pasting them into a background region with weaker wave clutter to avoid sample imbalance; ③ Gray-scale perturbation augmentation, randomly adjusting pixel values ​​to simulate scattering intensity changes under different sea conditions. After augmentation, the sample size of the SAR dataset was increased, and the number of weak target samples was also expanded.

[0091] (2) Construction of a dual-modal feature distillation network

[0092] The bimodal feature distillation network addresses the issues of cross-domain feature mismatch and loss of weak target features by working collaboratively through source and target domain feature extraction, two-stage modality alignment, focusing on weak target structures, and distillation loss optimization.

[0093] 1) Construction of source domain feature extractor

[0094] The core of the source domain feature extractor (improved ResNet-50 + Focus layer) is to extract ship structural features from optical images and enhance the details of weak targets through the Focus layer and CBAM attention. The specific construction steps are as follows:

[0095] The ResNet-50 architecture has been retained and adjusted as follows: The first four convolutional blocks (conv1-conv4) of the ResNet-50 network have been retained, while the fully connected layers have been removed (to avoid parameter redundancy). Convolutional block conv1 uses a 7×7 kernel to downsample the input feature map (after processing by the focus layer). Convolutional blocks conv2-conv4 are residual blocks, containing 3, 4, and 6 residual units respectively. Each residual unit is connected via a shortcut to prevent gradient vanishing, ultimately outputting the source domain feature map. This architecture ensures that deep networks can learn the subtle structural features of weak targets.

[0096] Focus layer ensemble: A Focus layer is inserted before conv1. Its workflow is as follows: ① Input an optical image, extract one pixel value for every other pixel, generating four sub-images; ② Stitch the four sub-images along the channel dimension to obtain a feature map; ③ Compress the number of channels using convolutional kernels, output the feature map, and then input it into conv1. This process achieves downsampling without information loss, solving the problem of diluted features for weak targets caused by traditional downsampling.

[0097] CBAM attention module optimization: A channel-spatial dual attention module is added after conv4. ① Channel attention module: The feature map is compressed using global average pooling, input into the hidden layer of the neuron, and outputs the importance weights of each channel. The formula is:

[0098]

[0099] In the formula: Indicates channel attention weights. denoted by Sigmoid function, MLP by Multilayer Perceptron, AvgPool by Global Average Pooling, and F by Original Feature Map.

[0100] ① For samples labeled as weak targets, additional weights are added to the MLP output; ② In the spatial attention module, global average pooling and global max pooling are calculated for the channel attention-weighted feature maps, and the concatenation is used to generate a spatial attention weight map, with the formula as follows:

[0101]

[0102] In the formula: Represents spatial attention weights. Represents the Sigmoid function, Conv 7×7 denoted as 7×7 convolution, AvgPool represents global average pooling, F represents the original feature map, and MaxPool represents global max pooling.

[0103] The convolutional kernel weights are pre-trained and initialized for weak target regions to ensure accurate focusing on core structural points; ③ Feature weighted fusion is performed by multiplying the channel attention weights and spatial attention weights onto the original feature map to obtain:

[0104]

[0105] In the formula: F represents the source domain structure feature map, and F represents the original feature map. Indicates channel attention weights. Indicates spatial attention weights;

[0106] The final output is the source domain feature map.

[0107] 2) Construction of target domain feature extractor

[0108] The core of the target domain feature extractor (improved MobileNetV3+CSP structure) is to extract electromagnetic scattering features from SAR images and preserve weak target features through the CSP structure. The specific construction steps are as follows:

[0109] MobileNetV3 Infrastructure: The backbone network is MobileNetV3, which reduces parameter computation through depthwise separable convolutions, adapting to the needs of subsequent embedded deployments. The network structure includes: an initial convolutional layer, a bottleneck residual block (each residual block contains an SE attention module, which enhances the target features through channel weight allocation), and a global average pooling layer. The size of the original output feature map matches the size of the source domain feature map.

[0110] CSP Integration and Feature Preservation: A CSP (Cross Stage Partial) structure is inserted before each bottleneck residual block, dividing the input feature map into two parts (1:1 ratio): ① The first part passes directly, avoiding dilution of weak target features in the residual block; ② The second part is processed by the bottleneck residual block containing depthwise separable convolutions and SE attention to extract depth scattering features. The two feature maps are concatenated along the channel dimension and then fused using convolutional kernels to reduce redundant computation.

[0111] Polarization feature fusion: The preprocessed dual-channel SAR feature map is input into the convolutional layer, with the same dimension as the output feature map of the initial convolutional layer in MobileNetV3. The two feature maps are fused element-wise, and the fused feature map is then input into the subsequent bottleneck residual block. Convolutional kernel weights are pre-trained and optimized for weak target scattering features—the weights of the convolutional kernels in the scattering intensity range of weak targets are increased to further enhance the distinction between weak targets and the background, ultimately outputting a target domain feature map. .

[0112] 3) Two-stage modal alignment implementation

[0113] The core of two-stage mode alignment is to achieve cross-domain alignment between source domain optical features and target domain SAR features, filter out invalid features, and ensure the consistency of weak target features. The specific operation is as follows:

[0114] Phase 1: Dimension Mapping: Source Domain Feature Map The number of channels is 2048, and the target domain feature map is... The number of channels is 1024. To reduce the number of channels in the source domain to 1024, a 1×1 convolution is needed. The formula is:

[0115]

[0116] In the formula: Conv represents the source domain feature map after dimensionality unification. 1×1 Represents a 1×1 convolution. Represents the source domain structure feature map;

[0117] The convolutional kernels are initialized using a He normal distribution, and the activation function is set to ReLU. To avoid distortion of weak target features during dimensionality mapping, L2 regularization constraints (regularization coefficient 1e) are added to the convolutional kernels for the weak target feature channels (determined through pre-training annotations). -4 This ensures that the update magnitude of the channel weights is ≤0.01 / epoch, preserving the integrity of weak target features.

[0118] Phase 2: Invalid Feature Filtering and Weak Target Alignment: ① Invalid Feature Filtering: Calculate and The Pearson correlation coefficient matrix R (dimension 1024×1024) has the following formula:

[0119]

[0120] In the formula: The Pearson correlation coefficient between the source domain feature map and the target domain feature map is represented by Cov, where Cov represents the covariance. Represents the source domain feature map. This represents the feature map of the target domain, where Var represents the variance.

[0121] ① Retain feature channels with correlation coefficients not less than a specified threshold, and filter out invalid features in optical images such as sky and color that have no physical correlation with SAR; ② Alignment of weak target features: For samples labeled as weak targets, determine the weak target region according to the labeled bounding box, and extract... and Calculate the cosine similarity of the feature vectors in this region (the formula is:

[0122]

[0123] In the formula: Represents cosine similarity. The source region feature map represents the weak target region. Target domain feature map representing weak target regions;

[0124] ③ Retain channels with similarity not less than a specified threshold to ensure cross-domain feature consistency for weak targets; ④ Align feature map output: Combining the above two conditions, obtain the aligned source domain feature map. .

[0125] 4) Focus on achieving weak target structures

[0126] The core of focusing on the structure of weak targets is to enhance the characteristics of weak targets through ship structure template matching. The specific operation is as follows:

[0127] Ship structure template library construction: Collect structural feature templates for different types of ships (including small targets), with template sizes ranging from 3×3 to 15×15 pixels. Templates include templates for small fishing boats, unmanned surface vessels, and conventional cargo ships. Each template is generated through manual annotation and feature extraction to ensure that it includes the core structure of the target (such as mast position and hull outline).

[0128] Template matching and weight assignment: Aligning the source domain feature maps IoU (Intersection Area / Union Area) is calculated for each template in the template library. After traversing all templates, the maximum IoU value between each feature region and the template is recorded. ;right The region is assigned a weight coefficient. ;right The region is assigned a weight of 1. This weighted processing outputs a 16×16×1024 distillation feature map. The feature intensity of weak target areas is significantly improved, laying the foundation for accurate identification by subsequent detection heads.

[0129] 5) Implementation of the distillation loss optimization module

[0130] The model is optimized using four losses to ensure that it simultaneously focuses on cross-domain alignment and weak target detection. The specific calculation and optimization steps are as follows:

[0131] Characteristic distillation loss calculation: Calculate the distillation characteristic map With target domain feature map The L2 distance measures cross-domain feature consistency and adds extra weight to the loss value for weak target regions. The formula is as follows:

[0132]

[0133] In the formula: Let H represent the feature distillation loss, W represent the feature map height, C represent the feature map width, i and j represent the pixel positions in the feature map height and width directions, respectively, and k represent the number of channels in the pixel's feature map. This represents the weighting coefficient for weak regions. Represents the distillation characteristic diagram. This represents the feature map of the target domain; where H=16, W=16, C=1024. The values ​​are set to 1.5 for weak regions and 1 for other regions. This loss ensures that the features of the source domain migration accurately match the SAR features of the target domain.

[0134] Classification loss calculation: Cross-entropy loss is used to optimize ship category prediction, with additional weighting for the classification loss of weak target samples. The formula is as follows:

[0135]

[0136] in: Let N represent the classification loss, N represent the total number of samples involved in the loss calculation, and log represent the natural logarithm. For true category labels (one-hot encoded) To predict probabilities, The weighting coefficient for weak samples is 1.2, and for other samples it is 1. This loss solves the problem of weak target categories having weak features and being prone to misclassification.

[0137] Bounding box loss calculation: CIoU loss is used to optimize the bounding box localization accuracy. This loss comprehensively considers IoU, center point distance, and aspect ratio, and additionally weights the regression loss for weak target bounding boxes. The formula is as follows:

[0138]

[0139] in: The bounding box loss is represented by IoU, which represents the intersection-union ratio between the predicted and ground truth boxes. This represents the weighting coefficient for weak boxes. Let b be the Euclidean distance from the center point, and b be the predicted bounding box. is the ground truth bounding box, c is the diagonal length of the bounding box, and v is the aspect ratio consistency parameter. The loss for weak target boxes is weighted by 1.3 to ensure the model focuses on optimizing the localization accuracy of small targets.

[0140] Calculation of weak target enhancement loss: Focal loss is used to address the sample imbalance problem of weak targets. The formula is as follows:

[0141]

[0142] In the formula: This represents the loss for enhancing weak targets, where N represents the total number of samples involved in the loss calculation. To predict probabilities, For weak samples, weighting coefficients For real category labels; where Adjusting the weights of difficult samples ( The larger the value, the more attention is paid to difficult samples. This loss reduces the weight of easily classified, regular samples ( (Approaching 0), it increases the model's attention to weak samples that are difficult to classify, and alleviates the dominant role of regular samples in model training.

[0143] Total loss calculation: The total loss is a weighted sum of four parts, as shown in the formula:

[0144]

[0145] In the formula: Indicates the total loss. Indicates characteristic distillation loss, Represents classification loss. Indicates the bounding box loss. This indicates that the loss is amplified by the target being weak.

[0146] Weight allocation is determined based on validation set tuning. All trainable parameters of the network are updated using gradient descent through backpropagation of the total loss, ensuring the model balances cross-domain alignment and weak target detection performance.

[0147] (3) Phased training and lightweight optimization

[0148] Staged training and lightweight optimization are key processes to ensure model convergence in small-sample scenarios and adaptability to embedded devices. The training process consists of two stages: pre-training and fine-tuning. Lightweight optimization employs channel pruning and INT8 quantization, as detailed below:

[0149] 1) Pre-training phase (source domain - target domain feature alignment)

[0150] The goal of the pre-training phase is to achieve cross-domain alignment between source domain optical features and target domain SAR features, laying the foundation for fine-tuning with small samples. The specific training steps are as follows:

[0151] Training parameter settings: All parameters of the target domain feature extractor (improved MobileNetV3) are fixed (to avoid overfitting of target domain parameters under small sample conditions); only the source domain feature extractor (improved ResNet-50+Focus layer), the two-stage modality alignment module, and the weak target structure focusing module are trained; the input data are optical-SAR image pairs (each image pair contains one optical image and one SAR image of the same type of ship to ensure cross-domain feature correlation); the Adam optimizer is used, and the learning rate is set to 1e. -4 (Adapting to parameter adjustment requirements during pre-training phase), weight decay 1e -5 (To suppress overfitting), the batch size is set to 16 (to balance training efficiency and memory usage), and the training lasts for 50 epochs.

[0152] Training process monitoring: using feature distillation loss Convergence is the core monitoring metric, and training is performed for the first 10 epochs. The initial value rapidly decreased from 0.28 to 0.12 (initial cross-domain feature alignment); after 10-30 epochs, the rate of decrease slowed, decreasing from 0.12 to 0.07 (alignment accuracy gradually improved); after 30-50 epochs... It gradually converges to 0.048 (satisfying) The training objective is ≤0.05. Simultaneously, feature visualization tools are used to observe the distribution of weak target features in the source and target domains, ensuring that the cross-domain feature similarity of weak targets is ≥0.6.

[0153] Pre-trained model saving: After training, the parameters of the source domain feature extractor, the two-stage modality alignment module, and the weak target structure focusing module are saved. The parameters of the target domain feature extractor remain at the initial fixed values, providing an aligned cross-domain feature base for the subsequent fine-tuning stage.

[0154] 2) Fine-tuning phase (convergence with small samples)

[0155] The goal of the fine-tuning phase is to optimize the parameters of the entire network using small sample SAR data to improve the detection accuracy of weak targets. The specific training steps are as follows:

[0156] Training parameter adjustments: Unfreeze all parameters of the target domain feature extractor and perform joint training across the entire network (further fusing source and target domain features); input data is a small-sample SAR training set (original samples + augmented weak target samples); adopt a cosine annealing learning rate strategy, with an initial learning rate set to 1e. -5 (Lower than the pre-training stage to avoid drastic parameter fluctuations), minimum learning rate 1e -7 The learning rate is halved every 5 epochs (to accommodate convergence requirements with small samples); the weight decay remains at 1e. -5 The batch size was reduced to 8 (because the amount of small sample data is small, and a large batch size will lead to gradient instability); for weak target samples, the learning rate was increased by 1.2 times (weak targets are identified by sample labels, and the gradient update magnitude of this type of sample is adjusted separately) to ensure that the features of weak targets can converge fully; training was conducted for 20 epochs.

[0157] Convergence criteria: Training convergence is determined by two indicators: ① Total loss convergence: The total loss value fluctuates by ≤5% over 3 consecutive epochs; ② Test set mAP stability: The overall mAP fluctuation of the test set over 3 consecutive epochs is ≤1%. Simultaneously, it ensures that the mAP of weak targets is ≥70% and the false negative rate is ≤20%, meeting the detection accuracy requirements in small sample scenarios.

[0158] Model fine-tuning evaluation: After training, the model performance was evaluated on the test set, focusing on weak target detection metrics: the mAP of weak targets increased from 48.5% after pre-training to 78.8%, the false negative rate decreased from 35.2% to 12.1%, and the false alarm rate decreased from 18.5% to 8.2%, verifying the significant improvement effect of the fine-tuning stage on the accuracy of weak target detection.

[0159] 3) Lightweight optimization (adapting to embedded deployment)

[0160] Lightweight optimization achieves model parameter compression and inference speed improvement while minimizing accuracy loss through channel pruning and INT8 quantization. The specific optimization steps are as follows:

[0161] Channel pruning operations: ① Channel contribution calculation: Based on the fine-tuned model, calculate the sum of the absolute values ​​of the gradients of each feature channel with respect to the total loss on the validation set (the larger the absolute value of the gradient, the higher the channel contribution), thus measuring the importance of the channel; ② Threshold screening and weak channel protection: Set the channel contribution threshold to 0.1, and remove redundant channels with a contribution <0.1; for weak target feature channels (determined through pre-training annotations, with contributions mostly in the range of 0.08-0.1), set a protection threshold of 0.08, and retain weak channels with a contribution ≥0.08 even if they are below 0.1, to avoid the wrong pruning of weak target feature channels; ③ Model adjustment after pruning: After pruning, delete the convolutional kernels and bias parameters corresponding to redundant channels, readjust the number of input channels in subsequent layers (e.g., if the number of input channels in a convolutional layer is reduced from 1024 to 614, adjust the convolutional kernel dimension accordingly), and perform fine-tuning on the validation set for 1-2 epochs (learning rate 1e). -6 The pruning process recovered the accuracy loss caused by the pruning. After pruning, the model parameters decreased from 28MB to 12MB, the number of channels decreased by 40%, the overall mAP loss was only 1.2%, and the mAP loss for weak targets was 1.8%.

[0162] INT8 Quantization Operation: ① Selection of Quantization Tool and Calibration Set: TensorRT tool is used to perform INT8 quantization on the pruned model, converting the model weights from 32-bit floating-point numbers (FP32) to 8-bit integers (INT8); SAR images containing weak targets are selected as the calibration set (covering different sea states and different types of weak targets) to ensure that the quantization process can accurately fit the feature distribution of weak targets; ② Quantization Error Control: During the quantization process, the quantization error of the weak target feature layer (such as the CSP structure output layer of the target domain feature extractor and the output layer of the weak target structure focusing module) is monitored in real time. By adjusting the calibration algorithm (using KL divergence calibration), the quantization error of the weak target feature layer is controlled to ≤5%, avoiding a significant decrease in the detection accuracy of weak targets; ③ Model Validation after Quantization: After quantization, the model parameters are further compressed to 8MB (28.6% of the original model). Tested on an embedded device, the inference speed is improved from 16fps after pruning to 22fps (a 2.5-fold improvement), the overall mAP loss is ≤3%, and the mAP loss for weak targets is ≤4%, meeting the real-time and accuracy requirements of embedded devices.

[0163] (4) Detection and reasoning

[0164] The detection inference system enables real-time processing and result output of the SAR image to be detected, covering processes such as preprocessing, feature fusion, detection head prediction, and post-processing, providing technical support for nearshore maritime supervision. The specific operation is as follows:

[0165] Input Processing: ① Preprocessing of the SAR image to be detected: The SAR image to be detected is sequentially subjected to 5×5 improved Lee filtering (noise variance 0.02), HH / HV polarization fusion (generating a 512×512×2 feature map), and band anomaly detection (determining whether it is an invalid image); if it is determined to be an invalid image (meeting any anomaly detection condition), the invalid image log (including image and anomaly type) is directly output; if it is a valid image, it is input into the target domain feature extractor (improved MobileNetV3+CSP structure), and a 16×16×1024 target domain feature map is output after feature extraction. ② Source Domain Feature Matching: Randomly select one image of the same type of ship from the source domain optical dataset (prioritize samples containing weak targets, matched by ship category labels), and after size normalization (512×512), 3×3 Gaussian filtering, and RGB channel normalization, input it into the source domain feature extractor (improved ResNet-50+Focus layer). Through a two-stage modality alignment module and a weak target structure focusing module, a 16×16×1024 distilled feature map is generated. This ensures that cross-domain features can effectively assist in target domain detection.

[0166] Feature fusion: combining feature maps from the target domain Distillation characteristic map Element-by-element addition and fusion are performed, with additional weighting applied to features of weak target regions (weighting coefficient 1.2), as shown in the formula. . To fuse the feature maps, the intensity of weak target features is further enhanced in the fused feature map (16×16×1024) (the grayscale difference with the background is increased by 1.5 times), providing clear target feature input for the detection head.

[0167] Detection Head Prediction: An improved YOLOv5-tiny detection head is adopted. This head is lightweight and fast. In addition to the traditional three detection layers (output feature map sizes of 8×8, 16×16, and 32×32), a new small-scale detection layer is added (output feature map size 32×32, corresponding to the original image's 16×16 pixel region), specifically adapted for weak target detection. The detection head outputs the ship's bounding box (x1, y1, x2, y2), class probability, and confidence score through convolutional operations. Simultaneously, weak targets are labeled with weak tags (determined by target pixel size; <15×15 pixels are labeled).

[0168] Post-processing: ① NMS: The NMS algorithm is used to filter overlapping detection boxes. The NMS threshold for regular targets is set to 0.4 (to avoid false filtering of overlapping boxes for regular targets). For weak targets, the NMS threshold is reduced to 0.35 (because weak targets are small in size, the overlap rate is easily too high, and an excessively high threshold will lead to false filtering of overlapping weak targets); ② Confidence screening: The confidence score threshold for regular targets is set to 0.4, and the confidence score threshold for weak targets is reduced to 0.35 (because weak targets have weak features, the confidence is generally low, and an excessively high threshold will lead to missed detections); ③ Result screening: Valid detection results that pass the NMS and confidence screening are retained, and invalid boxes (such as confidence < threshold, bounding boxes outside the image range) are removed.

[0169] Through the implementation of the above-mentioned entire process, this invention achieves high-precision, low-missibility, and real-time detection of SAR ships in scenarios with small samples and weak targets, solving the core bottlenecks of existing technologies and providing efficient and reliable technical solutions for business scenarios such as nearshore maritime supervision, ship search and rescue, and coastal defense monitoring.

[0170] Example 2:

[0171] The small-sample SAR ship detection system based on dual-modal feature distillation can realize the small-sample SAR ship detection method based on dual-modal feature distillation described in Example 1. It includes: achieving operational applications through the collaborative work of a data preprocessing and augmentation module, a dual-modal feature distillation module, a small-sample model training module, and a detection inference module. The specific application process is as follows:

[0172] Data preprocessing and augmentation module: Receives dual-modal data (optical + SAR), performs preprocessing and augmentation, outputs high-quality training data to the few-sample model training module, and feeds back anomaly detection results to the detection inference module.

[0173] The bimodal feature distillation module provides network architecture support for the few-shot model training module and feature extraction and alignment functions for the detection and inference module.

[0174] The small sample model training module performs phased training and lightweight optimization based on preprocessed bimodal data, and outputs the lightweight model to the detection and inference module.

[0175] Detection and inference module: Receives the SAR image to be detected, loads a lightweight model to perform inference, and transmits the detection results to the result display module via TCP / IP protocol (delay <1s). Supports breakpoint resumption (if the network is interrupted, the transmission of unfinished data can continue after reconnection).

[0176] Example 3:

[0177] This invention also provides a small-sample SAR ship detection device based on dual-modal feature distillation, which can realize the small-sample SAR ship detection method based on dual-modal feature distillation described in Embodiment 1, including a processor and a storage medium;

[0178] The storage medium is used to store instructions;

[0179] The processor is configured to operate according to the instructions to perform the steps of the following method:

[0180] Acquire optical images and SAR images to be detected;

[0181] The optical image is processed by size normalization, Gaussian filtering, feature normalization and weak target augmentation. The SAR image to be detected is processed by speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation. A dual-modal training dataset is constructed based on the processed optical image and the SAR image to be detected.

[0182] Based on the aforementioned bimodal training dataset, a bimodal feature distillation network is constructed, comprising a source domain feature extractor, a target domain feature extractor, and a modality alignment and structure focusing unit. The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images. The target domain feature extractor uses an improved MobileNetV3 network integrating a CSP structure to extract electromagnetic scattering features from SAR images to be detected. The modality alignment and structure focusing unit achieves cross-modal feature filtering and matching through a two-stage modality alignment algorithm and enhances ship features through a weak target structure focusing algorithm.

[0183] Based on the aforementioned dual-modal feature distillation network, after training using a phased strategy, the model undergoes channel pruning and INT8 quantization lightweighting to obtain a lightweight detection model.

[0184] The lightweight detection model is loaded, and after preprocessing the SAR image to be detected, its target domain features are extracted. The source domain features are extracted by matching similar optical images and then aligned and focused to obtain distillation features. The target domain features and distillation features are fused and input into the improved YOLOv5-tiny detection head for prediction, and the final ship detection result is output.

[0185] Example 4:

[0186] This invention also provides a computer-readable storage medium that implements the small-sample SAR ship detection method based on dual-modal feature distillation described in Embodiment 1. The medium stores a computer program that, when executed by a processor, performs the steps of the following method:

[0187] Acquire optical images and SAR images to be detected;

[0188] The optical image is processed by size normalization, Gaussian filtering, feature normalization and weak target augmentation. The SAR image to be detected is processed by speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation. A dual-modal training dataset is constructed based on the processed optical image and the SAR image to be detected.

[0189] Based on the aforementioned bimodal training dataset, a bimodal feature distillation network is constructed, comprising a source domain feature extractor, a target domain feature extractor, and a modality alignment and structure focusing unit. The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images. The target domain feature extractor uses an improved MobileNetV3 network integrating a CSP structure to extract electromagnetic scattering features from SAR images to be detected. The modality alignment and structure focusing unit achieves cross-modal feature filtering and matching through a two-stage modality alignment algorithm and enhances ship features through a weak target structure focusing algorithm.

[0190] Based on the aforementioned dual-modal feature distillation network, after training using a phased strategy, the model undergoes channel pruning and INT8 quantization lightweighting to obtain a lightweight detection model.

[0191] The lightweight detection model is loaded, and after preprocessing the SAR image to be detected, its target domain features are extracted. The source domain features are extracted by matching similar optical images and then aligned and focused to obtain distillation features. The target domain features and distillation features are fused and input into the improved YOLOv5-tiny detection head for prediction, and the final ship detection result is output.

[0192] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative and not exhaustive. All modifications within the scope of this invention or its equivalents are included in this invention.

[0193] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0194] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0195] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0196] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A small-sample SAR ship detection method based on dual-modal feature distillation, characterized by: include: Acquire optical images and SAR images to be detected; The optical image is processed by size normalization, Gaussian filtering, feature normalization and weak target augmentation. The SAR image to be detected is processed by speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation. A dual-modal training dataset is constructed based on the processed optical image and the SAR image to be detected. Based on the aforementioned bimodal training dataset, a bimodal feature distillation network is constructed, comprising a source domain feature extractor, a target domain feature extractor, and a modality alignment and structure focusing unit. The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images. The target domain feature extractor uses an improved MobileNetV3 network integrating a CSP structure to extract electromagnetic scattering features from SAR images to be detected. The modality alignment and structure focusing unit achieves cross-modal feature filtering and matching through a two-stage modality alignment algorithm and enhances ship features through a weak target structure focusing algorithm. Based on the aforementioned dual-modal feature distillation network, after training using a phased strategy, the model undergoes channel pruning and INT8 quantization lightweighting to obtain a lightweight detection model. The lightweight detection model is loaded, and after preprocessing the SAR image to be detected, its target domain features are extracted. The source domain features are extracted by matching similar optical images and then aligned and focused to obtain distillation features. The target domain features and distillation features are fused and input into the improved YOLOv5-tiny detection head for prediction, and the final ship detection result is output.

2. The small-sample SAR ship detection method based on dual-modal feature distillation according to claim 1, characterized in that, The formula for Gaussian filtering of the optical image is: ; In the formula: G(x,y) represents the weight value of the Gaussian filter kernel at (x,y), and x and y are the horizontal and vertical distances of the pixel within the window, respectively. This represents the standard deviation of a Gaussian distribution. The formula for feature normalization of the optical image is: ; In the formula: This represents the normalized pixel value of the c-th channel. Represents the original pixel value. , These are the minimum and maximum values ​​of the c-th channel, respectively. The formula for suppressing speckle noise in the SAR image to be detected is: ; In the formula: This represents the pixel values ​​of the SAR image after improved Lee filtering. Represents the original SAR pixel value. Indicates the noise variance. Indicates the local window variance; The polarization fusion formula for the SAR image to be detected is: ; In the formula: This represents the pixel values ​​of the SAR image after polarization fusion, where HH and HV are the pixel values ​​of the HH and HV channels, respectively, and 1e -6 This represents the learning rate.

3. The small-sample SAR ship detection method based on dual-modal feature distillation according to claim 1, characterized in that, The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images, including: weighting the feature map through the CBAM attention module of the source domain feature extractor, using the following formula: ; ; ; In the formula: Indicates channel attention weights. Let S denote the Sigmoid function, MLP denotes a multilayer perceptron, AvgPool denotes global average pooling, and F denotes the original feature map. Represents spatial attention weights, Conv 7×7 This represents a 7×7 convolution, and MaxPool represents global max pooling. This represents the source domain structure feature map.

4. The small-sample SAR ship detection method based on dual-modal feature distillation according to claim 1, characterized in that, The modality alignment and structure focusing unit achieves cross-modal feature screening and matching through a two-stage modality alignment algorithm, including: in the feature screening stage, the two-stage modality alignment algorithm filters invalid features by calculating the Pearson correlation coefficient, the calculation formula being: ; In the formula: The Pearson correlation coefficient between the source domain feature map and the target domain feature map is represented by Cov, where Cov represents the covariance. Represents the source domain feature map. This represents the feature map of the target domain, where Var represents the variance. The cosine similarity is calculated for the feature vectors of weak target regions to ensure feature consistency. The calculation formula is as follows: ; In the formula: Represents cosine similarity. The source region feature map represents the weak target region. A target domain feature map representing a weak target region.

5. The small-sample SAR ship detection method based on dual-modal feature distillation according to claim 1, characterized in that, Based on the aforementioned bimodal feature distillation network, a phased training strategy is employed, including: the bimodal feature distillation network is trained using a four-loss joint optimization method, where the total loss function is a weighted sum of the feature distillation loss, classification loss, bounding box loss, and weak target enhancement loss, calculated as follows: ; ; ; ; ; In the formula: Indicates the total loss. Indicates characteristic distillation loss, Represents classification loss, Indicates the bounding box loss. Let H represent the feature map height, W represent the feature map width, C represent the number of channels in the feature map, i and j represent the positions of the pixels in the height and width directions of the feature map, and k represent the number of channels in the feature map of the pixel. This represents the weighting coefficient for weak regions. Represents the distillation characteristic diagram. Let N represent the feature map of the target domain, N represent the total number of samples involved in the loss calculation, and log represent the natural logarithm. For real category labels, To predict probabilities, For weak samples, the weighting factor is , and IoU represents the intersection-union ratio between the predicted and ground truth boxes. This represents the weighting coefficient for weak boxes. Let b be the Euclidean distance from the center point, and b be the predicted bounding box. is the true bounding box, c is the diagonal length of the bounding box, and v is the aspect ratio consistency parameter.

6. The small-sample SAR ship detection method based on dual-modal feature distillation according to claim 1, characterized in that, The process of fusing target domain features with distillation features includes: The target domain feature map and the distilled feature map are fused element-wise, with additional weighting applied to features in weak target regions. The formula is as follows: ; In the formula: To fuse feature maps, For the target domain feature map, This is a distillation characteristic diagram.

7. The small-sample SAR ship detection method based on dual-modal feature distillation according to claim 1, characterized in that, The improved YOLOv5-tiny detection head adds a small-scale detection layer on top of the three detection layers to adapt to the detection of small targets. It outputs the ship bounding box, class probability, and confidence score through convolution operations, and labels small targets with weak labels.

8. A small-sample SAR ship detection system based on dual-modal feature distillation, characterized in that: include: Image acquisition module: Acquires optical images and SAR images to be detected; Preprocessing module: Performs size normalization, Gaussian filtering, feature normalization and weak target augmentation on optical images; performs speckle noise suppression, polarization fusion, band anomaly detection and weak target augmentation on SAR images to be detected; and constructs a dual-modal training dataset based on the processed optical images and SAR images to be detected. Network Construction Module: Based on the aforementioned bimodal training dataset, a bimodal feature distillation network is constructed, comprising a source domain feature extractor, a target domain feature extractor, and a modality alignment and structure focusing unit. The source domain feature extractor uses an improved ResNet-50 network integrating a Focus layer and a CBAM attention module to extract structural features from optical images. The target domain feature extractor uses an improved MobileNetV3 network integrating a CSP structure to extract electromagnetic scattering features from SAR images to be detected. The modality alignment and structure focusing unit achieves cross-modal feature filtering and matching through a two-stage modality alignment algorithm and enhances ship features through a weak target structure focusing algorithm. Model training module: Based on the bimodal feature distillation network, after training using a phased strategy, the model is subjected to channel pruning and INT8 quantization lightweighting to obtain a lightweight detection model; Image detection module: Load the lightweight detection model, preprocess the SAR image to be detected, extract its target domain features, match similar optical images to extract source domain features, and obtain distillation features after alignment and focusing; fuse the target domain features and distillation features, input the improved YOLOv5-tiny detection head for prediction, and output the final ship detection result.

9. A small-sample SAR ship detection device based on dual-modal feature distillation, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 7.