A SAR image ship target recognition method and system based on improved NanoDet-Plus

By improving the NanoDet-Plus model and combining background scene classification and multi-scale feature fusion, the robustness and adaptability of SAR image ship target recognition in complex marine backgrounds are solved, achieving high-precision ship target recognition and lightweight deployment.

CN120655888BActive Publication Date: 2026-03-31ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing SAR image ship target recognition technology lacks robustness and adaptability in complex marine environments, and suffers from problems such as low detection accuracy, weak model generalization ability, and high resource consumption.

Method used

An improved NanoDet-Plus model is adopted, which is combined with a background scene classification network to classify SAR images. A multi-scale feature fusion mechanism and an auxiliary training module are introduced. The generalized focus loss function is used to optimize model training, adapt to different background scenes, and is suitable for edge computing environments through lightweight design.

Benefits of technology

It improves the accuracy and robustness of ship target identification, reduces the number of model parameters and operational burden, and is suitable for real-time maritime target monitoring and maritime safety supervision in edge computing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655888B_ABST
    Figure CN120655888B_ABST
Patent Text Reader

Abstract

The application discloses a SAR image ship target recognition method and system based on an improved NanoDet-Plus, and belongs to the field of computer vision. The method comprises the following steps: acquiring a SAR image containing a ship target, pre-processing the SAR image, and constructing a data set of labeled labels; constructing a background scene classification network and training the same by using the data set, and simultaneously obtaining a plurality of scene sub-data sets different in background scene based on the labeled data set; constructing a plurality of improved NanoDet-Plus models equal in number to the plurality of scene sub-data sets, each of the models being trained by using a scene sub-data set, and using the trained background scene classification network and the trained NanoDet-Plus models to perform target recognition on a SAR image to be subjected to ship target recognition. The application effectively improves the accuracy and real-time performance of ship target recognition, and has good engineering applicability and popularization value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and deep learning, specifically relating to a method and system for ship target recognition based on SAR images using an improved NanoDet-Plus. Background Technology

[0002] With the increasingly complex global maritime security situation and the continued growth of maritime transport and fishing activities, the importance of high-precision automatic identification technology for ship targets is becoming increasingly prominent in fields such as maritime surveillance, maritime law enforcement, border control, and maritime traffic management. In particular, conducting large-scale maritime target monitoring under all-weather conditions places higher demands on image sensing technology. Synthetic Aperture Radar (SAR), as an active remote sensing method with all-day, all-weather observation capabilities, has been widely used in the monitoring and identification of maritime ship targets. SAR images have advantages such as penetrating clouds and fog and high resolution, making them an important data source for ship detection.

[0003] Traditional SAR image ship recognition methods are mostly based on edge extraction, template matching, morphological analysis and other techniques (LIMH, CHAE D, YOO JH, et al. Template matching-based target recognition algorithm development and verification using SAR images[J]. Journal of the Korea Institute of Military Science and Technology, 2014, 17(3):364-377.), which can achieve basic target recognition in structured and less interference scenarios. However, in complex marine backgrounds, SAR images are often accompanied by speckle noise, low target contrast and strong sea clutter interference. In addition, ship targets have characteristics such as small scale, multiple shapes and high density, which leads to the limitations of traditional methods in terms of robustness, adaptability and detection accuracy. (Zhang Shang, Chen Yifang, Wang Shentao, et al. Improved ship target detection algorithm based on YOLOv5[J]. Electro-Optics and Control, 2023, 30(12):66-72.).

[0004] In recent years, deep learning methods such as convolutional neural networks (CNN) have made significant progress in the field of target detection. Some models, such as YOLO and Faster R-CNN, have been introduced into SAR image ship recognition tasks and have improved recognition accuracy (Zhang Xiaopeng, Xu Zhiyuan, Qu Sheng, et al. Maritime ship recognition algorithm based on improved YOLOv5 deep learning [J]. Journal of Dalian Ocean University, 2022, 37(5): 866-872.). However, these methods still have the following technical problems: (1) The network structure is complex and the number of parameters is large, making it difficult to deploy on resource-constrained edge computing platforms; (2) They lack robustness to complex backgrounds and small targets and are easily affected by noise interference or occlusion; (3) They lack scene perception capabilities and fail to make full use of the environmental semantic features of the image for contextual modeling, resulting in a high false detection and false negative rate; (4) The imbalance of positive and negative samples during training is significant, affecting the model's ability to distinguish dense and small targets. Summary of the Invention

[0005] To address the problems in the prior art, this invention provides a method and system for ship target recognition based on SAR images using an improved NanoDet-Plus.

[0006] The technical solution of the present invention is as follows:

[0007] In a first aspect, the present invention discloses a method for ship target identification based on SAR images using an improved NanoDet-Plus, comprising the following steps:

[0008] SAR images containing ship targets are acquired, preprocessed, and a dataset is constructed. The locations and categories of ship targets and the background scenes of the SAR images are labeled in the dataset. The preprocessed SAR images in the dataset contain various background scenes. A background scene classification network is constructed and trained using the labeled dataset to obtain the trained background scene classification network. The background scene classification network includes sequentially connected convolutional layers, max pooling layers, residual modules, attention mechanisms, global average pooling layers, first fully connected layers, Dropout layers, second fully connected layers, and softmax layers. The function layer; simultaneously, based on the labeled dataset, multiple scene subsets with different background scenes are obtained; multiple improved NanoDet-Plus models are constructed with an equal number of scene subsets, each improved NanoDet-Plus model is trained using one scene subset, resulting in multiple trained NanoDet-Plus models; SAR images for ship target recognition are acquired, the background scene of the SAR image is obtained using the trained background scene classification network, and then the trained NanoDet-Plus model obtained based on the scene subset corresponding to the background scene is used to perform target recognition on the SAR image.

[0009] Secondly, the present invention also discloses a SAR image ship target recognition system based on an improved NanoDet-Plus for implementing the method, comprising:

[0010] The dataset construction module is used to acquire SAR images containing ship targets, preprocess the SAR images and construct the dataset, and annotate the location and category of ship targets in the dataset as well as the background scene of the SAR images; among them, the preprocessed SAR images in the dataset have a variety of background scenes;

[0011] The training module is used to construct a background scene classification network. It trains the network using a labeled dataset to obtain a trained background scene classification network. This network includes sequentially connected convolutional layers, max pooling layers, residual modules, attention mechanisms, global average pooling layers, a first fully connected layer, a Dropout layer, a second fully connected layer, and a softmax function layer. Simultaneously, it obtains multiple scene subsets with different background scenes based on the labeled dataset.

[0012] Furthermore, it is used to construct multiple improved NanoDet-Plus models with an equal number of scene subsets. Each improved NanoDet-Plus model is trained using a scene subset, resulting in multiple trained NanoDet-Plus models.

[0013] The classification module is used to acquire SAR images for ship target identification. It uses a pre-trained background scene classification network to obtain the background scene of the SAR image, and then uses a pre-trained NanoDet-Plus model based on the scene subset corresponding to the background scene to perform target identification on the SAR image.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0015] 1) To address the shortcomings of existing ship target detection methods that fail to adequately consider scene differences in complex marine environments within SAR images, leading to inconsistent performance of detection models under various background conditions, this invention introduces a ResNet-based background scene classification network to classify preprocessed SAR images into scene subsets representing multiple background scenes, such as ports, open sea areas, or nearshore waters. This method effectively improves the training specificity and detection accuracy of the improved NanoDet-Plus model in specific scenarios, enhancing the scene adaptability and generalization ability of ship target recognition methods.

[0016] 2) To address the shortcomings of traditional detection models in handling multi-scale ship targets, particularly poor performance in detecting small targets, this invention optimizes the NanoDet-Plus model. The backbone network of the improved NanoDet-Plus model is an improved YOLOv5-based CSPDarknet-tiny. The improved YOLOv5-based CSPDarknet-tiny replaces the original batch normalization with layer normalization, and replaces the 3×3 convolutional layers in the cross-stage aggregation module of CSPDarknet-tiny with 7×7 depthwise separable convolutional layers. The introduction of the CSPOSA module into the feature pyramid of the improved NanoDet-Plus model reduces the computational complexity of the model while effectively enhancing the detection capability of ship targets with significant scale changes, further improving the improved NanoDet-Plus model's ability to focus on ship target regions and its robustness in recognition.

[0017] 3) To address the issues of imbalanced positive and negative samples, low learning efficiency of difficult samples during training, and unstable model training in SAR image ship detection tasks, this invention employs an Assign Guidance Module (AGM) to assist training. This module shares backbone network features with the detection head and introduces a bottleneck PAFPN module and a depthwise separable convolutional structure to construct an auxiliary detection branch. This auxiliary branch is only activated during the training phase, enabling more effective differentiation between positive and negative samples and label matching, thereby improving the learning efficiency and detection accuracy of the detection head and effectively mitigating false positives and false negatives in the detection of small and dense targets.

[0018] 4) In addition, this invention introduces Generalized Focal Loss in the design of the loss function. By dynamically adjusting the shape of the focal function, the improved NanoDet-Plus model pays more attention to samples that are difficult to classify or locate, thereby improving the detection ability of complex scenes and weak targets, and thus optimizing the training effect and prediction performance of the model as a whole.

[0019] Through the above-mentioned multi-dimensional improvements, this invention not only enhances the accuracy and stability of ship target recognition, but also effectively reduces the number of parameters and the operational burden of the improved NanoDet-Plus model. It is suitable for application scenarios such as real-time maritime target monitoring, maritime safety supervision, and intelligent ship identification in edge computing environments, and has good engineering practicality and promotional value. Attached Figure Description

[0020] Figure 1 This is a flowchart of the ship target identification method based on SAR images of the improved NanoDet-Plus according to the present invention;

[0021] Figure 2 This is a structural diagram of the ship target recognition algorithm model based on SAR images from the improved NanoDet-Plus of the present invention. Detailed Implementation

[0022] The present invention will be further described and illustrated below with reference to specific embodiments. The embodiments described are merely examples of the content of this disclosure and do not limit the scope of the invention. The technical features of each embodiment in the present invention can be combined accordingly, provided that there is no mutual conflict.

[0023] This invention proposes a SAR image ship target recognition method and system based on an improved NanoDet-Plus. This method combines background scene classification with improved multi-scale target detection. It introduces a background scene classification network to perform background perception segmentation of SAR images, and loads corresponding lightweight detection models according to background scene categories, achieving adaptive switching of detection structures and task customization, effectively improving detection accuracy and robustness in complex environments. By introducing an improved NanoDet-Plus detection structure, a multi-scale feature fusion mechanism, an auxiliary training module (AGM), and a generalized focus loss function (GFL), this invention ensures detection accuracy while maintaining lightweight deployment and training stability, significantly improving the insufficient ship target recognition capability of existing technologies in complex SAR scenes. This invention overcomes the problems of low recognition accuracy, weak model generalization ability, and high resource consumption in existing SAR image ship target recognition technologies. By introducing a background scene classification network, a multi-scale feature fusion mechanism, and an auxiliary training structure, this invention effectively improves the accuracy and adaptability of ship target detection while maintaining the lightweight nature of the NanoDet-Plus model.

[0024] like Figure 1 As shown, the present invention provides a ship target identification method based on SAR images from an improved NanoDet-Plus system, comprising the following steps:

[0025] S1: Obtain SAR images containing ship targets, preprocess the SAR images and construct a dataset, and label the location and category of ship targets in the dataset as well as the background scene of the SAR images; the preprocessed SAR images in the dataset have multiple background scenes; the dataset is divided into 80% training set, 10% test set and 10% validation set.

[0026] S2: Construct a background scene classification network. Train the background scene classification network using the labeled dataset to obtain a trained background scene classification network. The background scene classification network includes sequentially connected convolutional layers, max pooling layers, residual modules, attention mechanism modules, global average pooling layers, first fully connected layers, Dropout layers, second fully connected layers, and softmax function layers. Simultaneously, obtain multiple scene subsets with different background scenes based on the labeled dataset. S3: Construct multiple improved NanoDet-Plus models with an equal number of scene subsets. Each improved NanoDet-Plus model is trained using one scene subset to obtain multiple trained NanoDet-Plus models. S4: Obtain the SAR image to be used for ship target recognition. Use the trained background scene classification network to obtain the background scene of the SAR image, and then use the trained NanoDet-Plus model obtained based on the scene subset corresponding to the background scene to perform target recognition on the SAR image.

[0027] Specifically, the NanoDet-Plus model, trained based on the scene subset dataset corresponding to the background scene, is used to perform target recognition on the SAR image to obtain the category of the ship target and the target bounding box of the ship target in the SAR image to be identified. Then, the non-maximum suppression method is used to remove overlapping or redundant target bounding boxes to complete the ship target recognition.

[0028] In a specific embodiment, S1 includes the following steps:

[0029] S1.1: Specifically, acquire synthetic aperture radar (SAR) images containing ship targets. SAR images can be obtained from various image acquisition platforms, including but not limited to satellite remote sensing platforms such as the Gaofen series, Sentinel-1, and RADARSAT, and the acquired SAR image resolution should be less than 10m. Shore-based fixed monitoring equipment, such as visible light cameras or radar imaging equipment installed at docks, seawalls, and coastal defense radar stations, can be used to acquire images of near-shore and port areas. Unmanned aerial vehicle (UAV) platforms, equipped with SAR payloads, can be used to acquire high-resolution SAR images at close range and low altitude. The acquired SAR images should include various typical marine scenes such as ships, sea surface background, and waves, and ensure coverage of typical ship targets at different scales and under different background noise conditions, such as cargo ships, fishing boats, warships, and speedboats.

[0030] S1.2: In a specific embodiment, preprocessing includes preliminary processing and secondary processing. After data acquisition, the acquired SAR images are first subjected to preliminary processing, which includes steps such as image format conversion and image coordinate alignment to achieve spatial uniformity of the SAR images. Then, to ensure image quality, the images are cleaned, removing images with severe blurring (Laplacian variance V < τ) or high noise (PSNR (peak signal-to-noise ratio) < 25 dB). In this embodiment, based on the characteristics of target detection, the HH polarization channel in the SAR image can be preferentially processed.

[0031] S1.3: Specifically, after the initial processing of the SAR image, a secondary processing step is performed to improve image quality and enhance the model's learning efficiency and robustness. This secondary processing includes image cropping, denoising, enhancement, size normalization, and pixel normalization.

[0032] S1.3.1: Image cropping. To eliminate the interference of large redundant areas (such as sea background) in the image on ship target recognition and to adapt to the model input requirements, the SAR image after preliminary processing is cropped. To quickly generate high-quality training samples, this invention proposes to use classical image processing methods to pre-screen and estimate the target position of the SAR image after preliminary processing. The specific process includes: (1) performing median filtering and histogram thresholding on the SAR image after preliminary processing to extract high reflectivity areas; (2) applying connected component analysis to screen possible target areas and calculating the coordinates of the center point; (3) then cropping a fixed-size (800×800 pixels) image area with the center point as a reference to form the cropped SAR image. For SAR images after preliminary processing without targets or backgrounds, the sliding window method is used to perform equal-size block processing to ensure the diversity of scene samples.

[0033] S1.3.2: Image Denoising. Since cropped SAR images often contain speckle noise and system interference signals, image denoising is necessary to ensure the effectiveness of subsequent feature extraction. This embodiment uses the NLM (Non-Local Mean) filtering algorithm to suppress speckle noise in the cropped SAR image, reducing noise while preserving as much edge features and detail information of the ship target as possible.

[0034] S1.3.3: Image Enhancement. To improve the salience of the target area, image enhancement techniques are used to strengthen the contrast between the ship target and the background scene. This embodiment designs a multi-strategy image enhancement process based on the characteristics of the SAR image after denoising. Specifically:

[0035] For denoised SAR images where the grayscale distribution is concentrated in low-brightness regions, global brightness gain and nonlinear Gamma transformation are used to improve the overall brightness and dynamic range of the denoised SAR image. The specific calculation formula is as follows:

[0036]

[0037] Among them, I in I is the denoised SAR image of the input image whose grayscale distribution is concentrated in the low-brightness region. out The output image is after global brightness gain and nonlinear Gamma transformation; γ is the Gamma transformation coefficient, which is dynamically selected between 0.4 and 0.8 in this embodiment.

[0038] For SAR images with unclear edge contours, the denoised SAR image or the brightness-adjusted SAR image is subjected to Sobel filtering to extract the image gradient, and then fused with the original SAR image (i.e., the corresponding acquired SAR image) to enhance the contour of the ship target; the specific calculation formula is as follows:

[0039] G x =I*K x G y =I*K y ,

[0040] Where I represents the SAR image after denoising or brightness adjustment of the input image with unclear edges; g represents the gradient map; g x This is the gradient plot along the x-axis; g y This is the gradient plot along the y-axis; K x With K y These are the Sobel convolution kernels in the horizontal and vertical directions, respectively.

[0041]

[0042] Finally, the gradient map G is weighted and fused with the original SAR image. The specific calculation formula is as follows:

[0043] I enhanced =α·I+(1-α)·G,α∈[0.5,0.8]

[0044] Among them, I enhanced The output image is obtained by extracting the image gradient through Sobel filtering and fusing it with the original SAR image; α is the weight, which is dynamically selected between 0.5 and 0.8 in this embodiment.

[0045] For regions with insufficient image contrast, CLAHE (Capacity-Limited Adaptive Histogram Equalization) is used to improve the separability of local features. CLAHE divides the denoised SAR image, the brightness-adjusted SAR image, or the edge-enhanced SAR image into multiple small regions (tiles), performs histogram equalization in each small region, and sets a contrast limiting threshold T. clip To prevent uncontrolled noise amplification, each tile is smoothly joined using bilinear interpolation.

[0046] I CLAHE =CLAHE(I′,T clip tileSize)

[0047] Among them, T clip is the contrast limiting factor, which is 2.0 in this embodiment. I′ is the SAR image after denoising, the SAR image after brightness adjustment, or the SAR image after edge enhancement; tileSize is the local window size, which is 8×8 in this embodiment.

[0048] All enhanced SAR images were compared with their corresponding original SAR images for Peak Signal-to-Noise Ratio (PSNR) and Structure Similarity (SSIM) calculations. The optimal version of the SAR image was retained for training. PSNR measures the global pixel error between the enhanced and original SAR images, while SSIM measures the structural fidelity between them. Specifically, the formula for calculating PSNR is:

[0049]

[0050]

[0051] Where I″ is the original SAR image; I″′ is the enhanced SAR image, i and j are the pixel coordinates in the image; m is the total number of pixels in the x-axis direction; n is the total number of pixels in the y-axis direction; I″(i,j) is the gray value of the original SAR image at pixel (i,j), and I″′(i,j) is the gray value of the enhanced SAR image at pixel (i,j); MSE is the mean square error between the enhanced SAR image and the corresponding original SAR image; and a higher PSNR value indicates a smaller difference between the enhanced SAR image and the corresponding original SAR image.

[0052] Specifically, the formula for calculating SSIM is:

[0053]

[0054] Where x is the vectorized result of the original SAR image (local region), y is the vectorized result of the image-enhanced SAR image (same region), and μ x μ is the pixel mean of a local region in the original SAR image. y This represents the average pixel value of a local region in the enhanced SAR image. This represents the pixel variance of a local region in the original SAR image. σ represents the pixel variance of a local region in the enhanced SAR image. xy Let C1 be the covariance between the enhanced SAR image and the corresponding original SAR image, and C2 be a small constant (brightness stabilization term) to avoid a zero denominator. Specifically,

[0055] C1 = (k1·255) 2 C2 = (k2·255) 2

[0056] Where k1 = 0.01 and k2 = 0.03, then C1 = 6.5025 and C2 = 58.5225. This invention combines the above two indicators into a comprehensive evaluation function Q, using a weighted scoring method:

[0057] Q = ω1·PNSR + ω2·SSIM

[0058] In this embodiment, ω1 and ω2 both represent weights, and ω1 = ω2 = 0.5.

[0059] The version with the largest Q-value between the enhanced SAR image and the corresponding original SAR image in each group is selected as the model training sample. That is, if the comprehensive evaluation function of the original SAR image is larger, the original SAR image is used to replace the corresponding enhanced SAR image. This is to ensure that the enhanced image has both structural integrity and pixel consistency to the greatest extent.

[0060] S1.3.4: To meet the input size consistency requirement of the background scene classification network, all enhanced SAR images must be uniformly adjusted to a fixed size of 640×640 pixels. Specifically, enhanced SAR images smaller than the target size undergo proportional scaling and edge padding. Enhanced SAR images larger than the target size undergo center cropping and scaling to extract key regions, ensuring that the ship target is within the main field of view.

[0061] S1.3.4: Pixel normalization, performing (I″″(i,j)-μ) on each pixel of the SAR image after size consistency adjustment. I″″ ) / σ I″″The operation is defined as follows: I″″(i,j) represents the grayscale value of the SAR image at pixel (i,j) after size consistency adjustment, and μ... I″″ σ is the pixel mean of the SAR image after size consistency adjustment. I″″ This represents the pixel standard deviation of the SAR image after size consistency adjustment. The pixel values ​​of the pixel-normalized SAR image follow a zero-mean, unit-variance distribution to improve the stability and convergence speed of deep learning model training. The pixel-normalized SAR image is the preprocessed SAR image.

[0062] S1.3.5: Subsequently, a dataset is constructed based on all preprocessed SAR images. The preprocessed SAR images in the dataset are divided into training, validation, and test sets in an 80%:10%:10% ratio. The training set, comprising 80% of the total SAR image data, is used to train the background scene classification network and the improved NanoDet-Plus model, ensuring coverage of various ship types and different sea state backgrounds. The validation set, comprising 10% of the total SAR image data, is used to evaluate the model's generalization ability on unseen data during training. The test set, comprising 10% of the total SAR image data, is used to evaluate the model's performance in the final detection stage. A stratified sampling strategy is adopted during the partitioning process, that is, random partitioning is performed while ensuring that the proportion of each ship category in each subset is relatively consistent, avoiding class imbalance that could bias the training results.

[0063] S1.3.6: Finally, an index file is created to record the image path, the dataset category (training set, validation set, test set), and the corresponding label information for each image. Specifically, for scene classification tasks, the corresponding label is the category of the background scene of the preprocessed SAR image, such as port, open sea, or nearshore sea.

[0064] For ship target detection tasks, the corresponding labels include the ship target's bounding box (target box) and the ship target type; the bounding box refers to the bounding box's coordinates (x, y, y). min y min x max y max (The types of ship targets include cargo ships, fishing boats, or warships).

[0065] Meanwhile, in this embodiment, in order to speed up the data reading speed during the training phase, the preprocessed SAR image and its label are cached in Tensor format for easy batch loading and scheduling.

[0066] In a specific embodiment, S2 includes the following steps:

[0067] This invention addresses the challenges of complex backgrounds and numerous interference factors in SAR images by designing a background scene classification network based on an improved ResNet architecture. The background scene classification network comprises sequentially connected convolutional layers, max pooling layers, residual modules, attention mechanism modules, global average pooling layers, a first fully connected layer, a Dropout layer, a second fully connected layer, and a softmax function layer.

[0068] All input images to the background scene classification network are preprocessed SAR images with a single channel size of 640×640 pixels, and the input tensor shape is (1, 640, 640). In a specific embodiment of the present invention, the goal of this classification task is to classify the preprocessed SAR images into three typical marine scenes: Port, Open Sea, and Coastline. Therefore, the output layer of the background scene classification network is set to have 3 neurons, and the softmax activation function is used to output the probability of each class.

[0069] S2.1: Improved ResNet structure and introduction of attention mechanism. In the design of the background scene classification network architecture, this invention uses ResNet-18 as the backbone network and makes the following structural improvements tailored to the characteristics of preprocessed SAR images:

[0070] (1) The convolutional feature extraction backbone remains unchanged and is used to extract low-level spatial features; specifically, the input layer accepts a grayscale image of size 1×640×640 (i.e., the preprocessed SAR image); the Conv layer performs a 7×7 convolution on it, with 64 output channels and a stride of 2, and the Conv layer outputs a 64×320×320 feature map; MaxPool(Max The pooling (max pooling) layer performs 3×3 max pooling on the 64×320×320 feature map, outputting a 64×160×160 feature map. Next, the residual module receives the 64×160×160 feature map and consists of four sequentially connected residual blocks. The first residual block receives the 64×160×160 feature map and outputs it to the second residual block. The second residual block outputs a 128×80×80 feature map to the third residual block. The third residual block outputs a 256×40×40 feature map to the fourth residual block. The fourth residual block outputs a 512×20×20 feature map. In other words, the output of the residual module is a 512×20×20 feature map. In the ResNet backbone network, intermediate features from different residual blocks (such as the first residual block, the second residual block, and the third residual block) are fused (by upsampling and concatenation), which is a multi-scale feature fusion, enhancing the ResNet model's ability to jointly model fine-grained and global information in images.

[0071] (2) An attention mechanism module (convolutional block attention module, i.e. CBAM module) is introduced after the residual module. The attention mechanism module performs channel weighting and spatial recalibration on the 512×20×20 feature map output by the residual module, guiding the model to focus on the target region and key background features. The attention mechanism module does not change the dimension and number of channels of the feature map, and the output of the attention mechanism module is still a 512×20×20 feature map.

[0072] (3) Next, a global average pooling (GAP) layer is added after the attention mechanism module. The global average pooling layer compresses the 512×20×20 feature map output by the attention mechanism module into a one-dimensional vector with a length of 512.

[0073] (4) After the global average pooling layer, the first fully connected layer, the Dropout layer, the second fully connected layer, and the softmax function layer are sequentially connected. The first fully connected layer receives the 512-dimensional vector output by the global average pooling layer and maps it to a higher-dimensional feature space, that is, outputs a 1024-dimensional vector to the Dropout layer. The Dropout layer randomly discards neurons with p=0.5 to suppress overfitting and outputs a 1024-dimensional vector to the second fully connected layer. The second fully connected layer maps the 1024-dimensional vector to a 3-dimensional vector as the prediction result of the three scene categories and outputs it to the softmax function layer. Finally, the softmax function layer outputs the prediction probability of each category, that is, the softmax function layer outputs a probability distribution vector containing three values, that is, the category of the background scene of the preprocessed SAR image input to the background scene classification network is obtained, and then the preprocessed SAR image is classified based on the category of the background scene.

[0074] S2.2: This invention uses the standard cross-entropy loss function to measure the difference between the background scene classification network's predicted category and the true label. The optimizer uses the Adam algorithm, which has adaptive learning rate adjustment capability, and the initial learning rate is set to 1e-4. During training, batch standardization and dynamic learning rate adjustment are performed on the background scene classification network to improve training stability and convergence speed.

[0075] S2.3: After the background scene classification network is trained, its performance is evaluated using an independent test set. Accuracy, recall, and F1-score are used to measure classification performance, and a confusion matrix is ​​plotted to aid in the analysis of classification confusion. Based on the evaluation results, the background scene classification network structure and training strategy are fine-tuned until convergence.

[0076] S2.4: To enhance the adaptability of the improved NanoDet-Plus model to complex scenes, this invention introduces a generative adversarial network (GAN) to generate diverse training samples and employs a multi-scale feature fusion mechanism to strengthen the representation of details:

[0077] Generative Adversarial Network (GAN) Sample Synthesis: This invention constructs a lightweight GAN specifically for SAR images, consisting of a generator G and a discriminator D. Specifically, the generator G takes a random noise vector z and a target label (i.e., the category of the target's background scene, such as a port, open sea, or nearshore sea) as input, and outputs a pseudo-SAR image (640×640). The discriminator D takes the pseudo-SAR image output by the generator or a pre-processed SAR image from the dataset as input, and outputs the predicted probability (range 0 to 1) of whether the input image is a real SAR image. This is achieved through adversarial loss. adv The GAN network is trained to continuously optimize the generator in order to "deceive" the discriminator, while the discriminator continuously improves its ability to distinguish between real and fake images. This leads to the generator outputting higher quality and more realistic pseudo-SAR images. The specific formula is as follows:

[0078] Loss adv = -[log D(x) + log(1 - D(G(z)))]

[0079] Where x is the preprocessed SAR image in the dataset, i.e. the real SAR image, z is the random noise vector, G(z) is the pseudo SAR image generated by the generator; D(x) is the probability that the discriminator predicts the real SAR image as real (should be close to 1); D(G(z)) is the probability that the discriminator predicts the pseudo SAR image as real (should be close to 0).

[0080] After training, pseudo-SAR images synthesized from the generator G are used to expand the training set and enhance the generalization ability to low-frequency samples and rare backgrounds.

[0081] Finally, the pseudo-SAR image output by generator G is saved in JSON format, which includes the image's unique identifier (filename), the corresponding background scene label, the bounding box of the ship target, and the type of the ship target, facilitating subsequent calls to the improved NanoDet-Plus model and integration of results.

[0082] This invention significantly improves the accuracy and generalization ability of SAR image scene classification while maintaining the model's lightweight nature by structurally introducing attention mechanisms, feature fusion strategies, and adversarial data augmentation methods, providing accurate background priors for subsequent ship target detection models.

[0083] In a specific embodiment, S3 includes the following steps:

[0084] like Figure 2 As shown, based on the preprocessed SAR image background scene classification, this invention further constructs three improved NanoDet-Plus models optimized for three background scene subsets: ports, open sea areas, and nearshore sea areas. The overall structure of the improved NanoDet-Plus model consists of three modules: the backbone network, the feature pyramid, and the head. It also fully integrates the background scene label information output by the background scene classification network in the previous step for subsequent model routing.

[0085] The improved NanoDet-Plus model specifically includes:

[0086] S3.1: Input layer. The input image is a preprocessed single-channel SAR image from a scene subset of 640×640 pixels. During training and inference, each input image is a SAR image whose background scene category is determined by a background scene classification network. The preprocessed SAR image after background scene classification is then input into the improved NanoDet-Plus model for the corresponding background scene for training.

[0087] S3.2: Backbone Design. The backbone network is used to extract multi-level spatial semantic features from the input preprocessed SAR image. The backbone network of this invention is an improved YOLOv5-based CSPDarknet-tiny. The improved YOLOv5-based CSPDarknet-tiny (Cross Stage Partial Darknet-tiny) replaces the original batch normalization with layer normalization, and replaces the 3×3 convolutional layer of the cross-stage partial aggregation module of CSPDarknet-tiny with a 7×7 depthwise separable convolutional layer; the specific improvements are as follows:

[0088] (1) Convolutional Module (Conv) Structure Adjustment: Each basic convolutional module of the improved YOLOv5-based CSPDarknet-tiny consists of three parts: Conv2D (two-dimensional convolution), Layer Normalization, and SiLU activation function (Sigmoid-weighted Linear Unit). Compared with the traditional BatchNorm (batch normalization), LayerNorm is more stable for small batches of SAR images, improving training robustness.

[0089] (2) Adjustment of CSPOSA (Cross-Stage Partial with One-Shot Aggregation): The improved YOLOv5-based CSPDarknet-tiny uses the CSPOSA module to perform segmented residual connections on the feature maps. The CSPOSA module includes convolutional layer F1: 1×1 pointwise convolution is used to compress the number of feature channels and reduce the amount of computation; convolutional layer F7: replacing the original 3×3 convolution kernel, using 7×7 depthwise separable convolution to improve feature representation ability; Concat and then applying 1×1 convolution after Concat for channel dimensionality reduction to enrich representation ability.

[0090] Finally, the backbone network outputs three sets of feature maps of different sizes: one set of feature maps with a size of 80×80×256 (i.e., shallow feature maps); one set of feature maps with a size of 40×40×384 (i.e., middle-layer feature maps); and one set of feature maps with a size of 20×20×512 (i.e., deep-layer feature maps).

[0091] S3.3: The Feature Pyramid (Neck) is a fusion enhancement module based on PAFPN (Path Aggregation Feature Pyramid Network). The Neck is used for cross-scale information fusion to accommodate ship targets of varying scales in SAR images. This invention, based on the PAFPN structure, makes the following optimizations:

[0092] (1) Input: The input to Neck is three sets of feature maps output by the backbone network, namely, the 80×80×256 feature map, the 40×40×384 feature map and the 20×20×512 feature map.

[0093] (2) Feature Extraction Module: First, the feature extraction module performs fast spatial pyramid pooling (SPPF) on the 20×20×512 feature map to introduce different receptive fields to extract multi-scale semantics. To improve efficiency, SPPF uses partial convolution to reduce redundant computation, and the output remains a 20×20×512 feature map.

[0094] (3) Top-down Path Fusion: The 20×20×512 feature map output by the feature extraction module is upsampled to 40×40 and fused with the 40×40×384 feature map output by the backbone network to generate a 40×40×512 feature map. The generated 40×40×512 feature map is further upsampled to 80×80 and then fused with the 80×80×256 feature map output by the backbone network to generate an 80×80×384 feature map.

[0095] (4) Bottom-up enhancement: The generated 80×80×384 feature map is downsampled to 40×40 and then fused with the 40×40×512 feature map to obtain an enhanced 40×40×640 feature map; the 40×40×640 feature map is downsampled to 20×20 and fused with the 20×20×512 feature map output by the feature extraction module to obtain a 20×20×512 feature map.

[0096] (5) The CSPOSA module is reused in Neck. The cross-stage aggregation module takes 80×80×384 feature maps, 40×40×640 feature maps and 20×20×512 feature maps as inputs and outputs 80×80×384 feature maps, 40×40×640 feature maps and 20×20×512 feature maps with enhanced semantic expression, and further refines the multi-scale fusion feature maps.

[0097] (6) Feature Fusion Module: The 80×80×384 feature map, 40×40×640 feature map and 20×20×512 feature map after enhanced semantic expression output by the CSPOSA module are respectively introduced into dual-branch fusion. One branch uses global average pooling to extract semantic information, and the other branch uses 1×1 convolution to extract local structure texture. Specifically, global average pooling is used to extract semantic information from the enhanced semantic representation of the 80×80×384, 40×40×640, and 20×20×512 feature maps, obtaining feature vectors. Simultaneously, a 1×1 convolutional layer extracts the local structural texture of these feature maps, obtaining feature maps. The resulting feature vectors and feature maps are concatenated, and then layer normalization is performed to obtain three sets of fused feature maps: 80×80×384, 40×40×640, and 20×20×512 feature maps. This outputs more representative fused features.

[0098] S3.4: The detection head employs a three-scale detection strategy to output the target location and category. The detection head consists of three sub-headers. The specific structure is as follows:

[0099] The three detection subheads take 80×80×384, 40×40×640, and 20×20×512 feature maps output from the feature pyramid as input, respectively. Each detection subhead includes two consecutive 3×3 convolutional layers with SiLU activation, a fully connected layer, and a Softmax activation layer. All three subheads output the probability distribution of ship target categories and the bounding boxes. Then, the three sets of bounding box coordinate prediction results are concatenated and integrated along the channel dimension to obtain the ship target category and bounding box in the preprocessed SAR image input to the improved NanoDet-Plus model. The fully connected layer is used to map spatial features into a one-dimensional vector for predicting the bounding box category and position offset. The output of the detection head includes a category prediction vector (dimension equal to the number of ship target categories) and bounding box (target box) position (center point coordinates + width and height offset).

[0100] Through the aforementioned improvements, the enhanced NanoDet-Plus model significantly improves its ability to detect ship targets in various background scenarios while maintaining its lightweight design. The scene classification labels output by the background scene classification network can be used as pre-defined information for routing and training parameters of different enhanced NanoDet-Plus models, further improving the overall system's accuracy and stability.

[0101] S3.5: Design of Multi-Object Detection Loss Function. The classification function of an object detection algorithm generally consists of two parts: a classification loss function and a regression loss function. This invention uses the Generalized Focal Loss (GFL) function as the loss function to update the parameters of the improved NanoDet-Plus model. The core idea of ​​GFL is to introduce a focus function β on top of the cross-entropy loss, and adjust the loss weights of samples with low prediction probabilities (i.e., difficult to classify) through a focus factor θ, so that the model automatically focuses on the difficult samples during training. Specifically, the form of the Generalized Focal Loss (GFL Loss) function is as follows:

[0102]

[0103] Where: N represents the total number of preprocessed SAR images input to the improved NanoDet-Plus model; p i is the prediction score of the i-th preprocessed SAR image, i.e., the class probability of ship targets in the preprocessed SAR image; β is the focus function, used to adjust the weights of easy and difficult samples; θ is the focus factor, used to adjust the shape of the focus function.

[0104] Through this mechanism, the improved NanoDet-Plus model training process can dynamically focus on high-difficulty samples, significantly improving detection performance under minority class or occluded target conditions.

[0105] To ensure the convergence efficiency and robustness of the improved NanoDet-Plus model under complex SAR image conditions, the present invention designs the following training strategy:

[0106] The optimizer uses the Adam optimizer for parameter updates and has adaptive learning rate adjustment capabilities. Its initial learning rate is 1×10⁻⁶. -4 The first-order moment estimates the exponential decay rates δ1 = 0.9, δ2 = 0.999, and ε = 1 × 10⁻⁶. -8 A cosine annealing learning rate schedule is employed, maintaining a relatively large learning rate initially and then gradually decreasing it to improve training stability in later stages. The total number of training epochs is 300, with a batch size of 32. Each training epoch includes two phases: training and validation. Training loss and validation metrics are calculated separately to dynamically adjust model parameters. During training, preprocessed SAR images are randomly augmented with translation, scaling, flipping, and rotation to improve the model's generalization ability to complex scenes and small sample sizes. A validation set evaluation is performed every 5 epochs, calculating accuracy, recall, and F1-score, and automatically saving the weights of the best-performing model from the current epoch. Through the systematic integration of these optimization strategies, the improved NanoDet-Plus model is ensured to converge efficiently and learn stably in SAR image target detection tasks, exhibiting good generalization ability and engineering deployment performance.

[0107] S3.6: To improve the accuracy of label assignment and positive / negative sample matching, this invention introduces a Dynamic Label Assignment Guidance Module (AGM) as a parallel auxiliary branch of the detection head during the training phase. The AGM module structure is as follows: The input of the AGM module is the 80×80×384 feature map, 40×40×640 feature map, and 20×20×512 feature map output by the Backbone; then the AGM module copies a PAFPN structure as a bottleneck connection module to fuse multi-scale features; the AGM module connects to a detection sub-head with the same structure as the detection head. Its specific execution logic during training is as follows: the AGM module outputs a predicted bounding box (category + regression) consistent with the structure of the main detection head; the AGM module is used for preliminary sample assignment, generating positive and negative sample partitioning results; the matching results of the AGM module are used as the supervision signal of the main detection branch for loss function calculation; the AGM module is only enabled during the training phase and is automatically discarded during the inference phase, without increasing the inference computation cost.

[0108] like Figure 2 As shown, after training, this invention saves the three improved NanoDet-Plus models trained on three background scenes (port, open sea, and nearshore sea) as optimal weight files and deploys them to a unified inference environment. The inference process is based on the PyTorch deep learning framework and runs on a high-performance computing platform equipped with an NVIDIA RTX 3080 GPU. The inference stage includes two steps: (1) using the trained background scene classification network to identify the background scene of the SAR image (input size: 1×640×640, single-channel grayscale image), and outputting the background scene of the SAR image, which is one of the three types of scenes;

[0109] (2) Load the corresponding trained improved NanoDet-Plus model branch (port model, open sea area model or nearshore sea area model) according to the classification results, and switch the trained improved NanoDet-Plus model to eval() mode to disable the updates of Dropout layer and BatchNorm.

[0110] The inference input image must be a preprocessed SAR image: the size is uniformly 640×640 pixels, the number of channels is 1 (HH polarization), and the pixel values ​​are normalized (subtract the mean and divide by the standard deviation). The input tensor shape is Tensor[1,640,640].

[0111] During inference, the selected, trained, improved NanoDet-Plus model performs a forward propagation operation on each preprocessed SAR image, outputting three types of information: a category probability vector representing the probability that each candidate region belongs to one of C target categories (e.g., cargo ship, warship, fishing boat); bounding box coordinates, with each row representing a candidate box in the format [x_min, y_min, x_max, y_max]; and a target confidence score ranging from [0, 1], indicating the degree of confidence that the candidate box represents a real ship. To remove redundant and overlapping target boxes, Non-Maximum Suppression (NMS) is introduced as a post-processing module during the inference stage. NMS is based on the confidence and IoU overlap of the predicted boxes: for each target category, they are first sorted in descending order of confidence; if the IoU between two boxes exceeds 0.5 (which can be set), only the one with the highest score is retained; and the final list of non-repeating detection results is output.

[0112] The inference results are output in a structured format, with optional formats including JSON or CSV, suitable for subsequent data management and API calls. The output record for each image includes the following fields: unique image ID (image...). idThe bounding box coordinates for each detected target are [x_min, y_min, x_max, y_max]; the corresponding target category label (e.g., "cargo ship", "warship"); and the confidence score (confidence ∈ [0, 1]). Furthermore, the trained improved NanoDet-Plus model supports visually overlaying the detection boxes onto the original SAR image (marked with a red rectangle) for manual review and result verification. Images can be saved as PNGs or directly transferred to the graphical interface display module.

[0113] Through the above reasoning process, this invention realizes a SAR image ship target recognition method based on the improved NanoDet-Plus, which has comprehensive advantages such as multi-model adaptation, structured output, accurate prediction and deployment optimization, and is suitable for actual maritime monitoring and automatic identification mission scenarios.

[0114] This invention also provides a SAR image ship target recognition system based on an improved NanoDet-Plus implementation method, comprising:

[0115] The dataset construction module is used to acquire SAR images containing ship targets, preprocess the SAR images and construct the dataset, and annotate the location and category of ship targets in the dataset as well as the background scene of the SAR images; among them, the preprocessed SAR images in the dataset have a variety of background scenes;

[0116] The training module is used to construct a background scene classification network. It trains the network using a labeled dataset to obtain a trained background scene classification network. This network includes sequentially connected convolutional layers, max pooling layers, residual modules, attention mechanisms, global average pooling layers, a first fully connected layer, a Dropout layer, a second fully connected layer, and a softmax function layer. Simultaneously, it obtains multiple scene subsets with different background scenes based on the labeled dataset.

[0117] Furthermore, it is used to construct multiple improved NanoDet-Plus models with an equal number of scene subsets. Each improved NanoDet-Plus model is trained using a scene subset, resulting in multiple trained NanoDet-Plus models.

[0118] The classification module is used to acquire SAR images for ship target identification. It uses a pre-trained background scene classification network to obtain the background scene of the SAR image, and then uses a pre-trained NanoDet-Plus model based on the scene subset corresponding to the background scene to perform target identification on the SAR image.

[0119] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. Those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. An improved NanoDet-Plus-based SAR image ship target recognition method, characterized in that, The method comprises the following steps: SAR images containing ship targets are acquired, the SAR images are preprocessed, and a data set is constructed, and the positions and categories of the ship targets in the data set and the background scenes of the SAR images are labeled; wherein the preprocessed SAR images in the data set have multiple background scenes; A background scene classification network is constructed, the background scene classification network is trained using the labeled data set, and a trained background scene classification network is obtained; wherein the background scene classification network comprises sequentially connected convolution layers, maximum pooling layers, residual modules, attention mechanism modules, global average pooling layers, first full connection layers, Dropout layers, second full connection layers, and softmax function layers; and multiple scene sub-data sets of different background scenes are obtained based on the labeled data set; Multiple improved NanoDet-Plus models equal in number to the scene sub-data sets are constructed, each improved NanoDet-Plus model is trained using a scene sub-data set, and multiple trained NanoDet-Plus models are obtained; A SAR image to be subjected to ship target recognition is acquired, the background scene of the SAR image is obtained using the trained background scene classification network, and the SAR image is subjected to target recognition using the trained NanoDet-Plus model based on the corresponding scene sub-data set of the background scene; The improved NanoDet-Plus model comprises a backbone network, a feature pyramid, and a detection head, the backbone network is an improved YOLOv5-based CSPDarknet-tiny, the improved YOLOv5-based CSPDarknet-tiny replaces the original batch normalization with layer normalization, and replaces the 3×3 convolution layer of the cross-stage partial aggregation module of the CSPDarknet-tiny with a 7×7 deep separable convolution layer; The feature pyramid comprises a feature extraction module, a cross-stage partial aggregation module, and a feature fusion module; the detection head comprises three detection sub-heads, each detection sub-head comprises two 3×3 convolution layers with SiLU activation functions, a full connection layer, and a Softmax activation function layer connected in sequence.

2. The SAR image ship target recognition method based on the improved NanoDet-Plus according to claim 1, characterized in that, The preprocessing comprises preliminary processing and secondary processing; the preliminary processing comprises first achieving spatial uniformity of the SAR images through image format conversion and image coordinate alignment, and then cleaning the SAR images after spatial uniformity, and removing the SAR images after spatial uniformity that have serious blurring or high noise; wherein the SAR image after spatial uniformity that has serious blurring has a Laplacian variance less than a preset threshold, and the SAR image after spatial uniformity that has high noise has a peak signal-to-noise ratio less than 25 dB.

3. The SAR image ship target recognition method based on the improved NanoDet-Plus according to claim 2, characterized in that, The secondary processing includes image cropping on the SAR image after the preliminary processing to eliminate the interference of the redundant area in the SAR image after the preliminary processing on the ship target recognition, then image denoising on the SAR image after the image cropping, and then image enhancement on the SAR image after the image denoising; next, peak signal-to-noise ratio and structural similarity are calculated on the SAR image after the image enhancement and the corresponding original SAR image, and then a comprehensive evaluation function is obtained by weighting the peak signal-to-noise ratio and the structural similarity respectively, the comprehensive evaluation functions of the SAR image after the image enhancement and the corresponding original SAR image are compared, if the comprehensive evaluation function of the original SAR image is larger, the original SAR image is used to replace the corresponding SAR image after the image enhancement; otherwise, no processing is performed; wherein the original SAR image is the SAR image obtained. The SAR image after the image enhancement is subjected to size consistency adjustment, and finally the SAR image after the size consistency adjustment is subjected to pixel normalization to obtain the SAR image after the preprocessing; wherein the resolution of the obtained SAR image containing the ship target is less than 10 m.

4. The SAR image ship target recognition method based on the improved NanoDet-Plus according to claim 3, characterized in that, The image enhancement includes one or more of improving the overall brightness and dynamic range of the image, enhancing the outline of the ship target in the image, or improving the contrast of the image.

5. The improved NanoDet-Plus-based SAR image ship target recognition method according to claim 1, characterized in that, The convolutional layer of the background scene classification network receives the SAR image after the preprocessing in the data set and outputs a first feature map to the max pooling layer, the max pooling layer performs max pooling on the first feature map and outputs a second feature map to the residual module, the residual module performs multiple times of down-sampling on the second feature map to obtain a third feature map and outputs to the attention mechanism module, the attention mechanism module performs channel weighting and spatial re-scaling on the third feature map and outputs a fourth feature map with unchanged size to the global average pooling layer, the global average pooling layer compresses the fourth feature map into a global feature vector and outputs to the first full connection layer, the first full connection layer maps the global feature vector to a higher dimensional feature space to obtain a first feature vector and outputs to the Dropout layer, the Dropout layer is used to suppress overfitting and output a second feature vector with unchanged dimension to the second full connection layer, the second full connection layer maps the second feature vector to a third feature vector and outputs to the softmax function layer, the dimension of the third feature vector is equal to the number of background scenes of the SAR image after the preprocessing, both are k, and finally the softmax function layer outputs a probability distribution vector containing k values, that is, the class of the background scene of the SAR image after the preprocessing input to the background scene classification network is obtained; wherein the cross-entropy loss function is used as the loss function to update the parameters of the background scene classification network to obtain the trained background scene classification network; wherein the processing object of the convolutional layer of the background scene classification network is the HH polarization channel in the SAR image after the preprocessing. The SAR image after the image enhancement is subjected to size consistency adjustment, and finally the SAR image after the size consistency adjustment is subjected to pixel normalization to obtain the SAR image after the preprocessing; wherein the resolution of the obtained SAR image containing the ship target is less than 10 m. The image enhancement includes one or more of improving the overall brightness and dynamic range of the image, enhancing the outline of the ship target in the image, or improving the contrast of the image.

6. The SAR image ship target recognition method based on the improved NanoDet-Plus according to claim 5, characterized in that, To expand the diversity of SAR images used to train the improved NanoDet-Plus model, a generative adversarial network is also used to generate SAR images; wherein the generator of the generative adversarial network takes a random noise vector and the category of a target background scene as input to generate a pseudo SAR image consistent with the semantics of the target background scene; the discriminator of the generative adversarial network takes the pseudo SAR image output by the generator or the preprocessed SAR image in the data set as input, outputs the prediction probability of whether the input image is a real SAR image, and is trained through an adversarial loss The generative adversarial network is trained; Adversarial loss The formula is: ; wherein, is a pre-processed SAR image, i.e. a real SAR image, from a data set, is a random noise vector, is a pseudo SAR image generated by the generator; is a predicted probability of the real SAR image being real by the discriminator; is a predicted probability of the pseudo SAR image being real by the discriminator.

7. The improved NanoDet-Plus-based SAR image ship target recognition method according to claim 1, characterized in that, The main network takes the preprocessed SAR image in a scene sub-data set as input, and outputs fifth, sixth and seventh feature maps with gradually decreasing sizes to a feature pyramid; the feature extraction module performs fast spatial pyramid pooling processing on the seventh feature map to obtain an eighth feature map with a constant size, wherein the fast spatial pyramid pooling processing uses partial convolution to reduce redundant calculation; then the eighth feature map is up-sampled and fused with the sixth feature map to obtain a ninth feature map, and the ninth feature map is up-sampled and fused with the fifth feature map to obtain a tenth feature map; next, the tenth feature map is down-sampled and fused with the ninth feature map to obtain an eleventh feature map, and the eleventh feature map is down-sampled and fused with the eighth feature map to obtain a twelfth feature map; The cross-stage partial aggregation module takes the tenth, eleventh and twelfth feature maps as input and outputs the tenth, eleventh and twelfth feature maps with enhanced semantic expression to a feature fusion module; the feature fusion module extracts semantic information of the tenth, eleventh and twelfth feature maps with enhanced semantic expression using global average pooling to obtain a fourth feature vector; meanwhile, the feature fusion module also extracts local structure texture of the tenth, eleventh and twelfth feature maps with enhanced semantic expression through a 1x1 convolution layer to obtain a thirteenth feature map, and then the fourth feature vector and the thirteenth feature map are spliced, and after splicing, layer normalization is performed to obtain first, second and third fusion feature maps with gradually decreasing sizes; The three detection sub-heads take the first, second and third fusion feature maps as input, and then each detection sub-head independently outputs the ship target class probability distribution and target box coordinate prediction result at its corresponding scale; then the three groups of target box coordinate prediction results are spliced and integrated into a unified target box set in the channel dimension to obtain the class and target box of the ship target in the preprocessed SAR image input to the improved NanoDet-Plus model.

8. The improved NanoDet-Plus-based SAR image ship target recognition method according to claim 1, characterized in that, The improved NanoDet-Plus model is updated by using a generalized focal loss function as a loss function, and a trained improved NanoDet-Plus model is obtained; and during the training of the improved NanoDet-Plus model, an AGM module is introduced as a parallel auxiliary branch of the detection head to guide the calculation of the loss function; The trained NanoDet-Plus model based on the scene sub-data set corresponding to the background scene is used for target recognition of the SAR image, and the class and target box of the ship target in the SAR image to be recognized are obtained, and the non-maximum suppression method is used to remove overlapping or redundant target boxes to complete ship target recognition.

9. An improved NanoDet-Plus-based SAR image ship target recognition system for implementing the method of claim 1. The method comprises: A dataset construction module is configured to obtain a SAR image containing a ship target, pre-process the SAR image, and construct a dataset, and label the position and category of the ship target in the dataset and the background scene of the SAR image; wherein the pre-processed SAR image in the dataset has multiple background scenes; A training module is configured to construct a background scene classification network, train the background scene classification network using the labeled dataset, and obtain a trained background scene classification network; wherein the background scene classification network comprises sequentially connected convolution layers, max-pooling layers, residual modules, attention mechanism modules, global average pooling layers, first fully connected layers, Dropout layers, second fully connected layers, and softmax function layers; and multiple scene sub-datasets of different background scenes are obtained based on the labeled dataset; and configured to construct multiple improved NanoDet-Plus models equal in number to the scene sub-datasets, each improved NanoDet-Plus model is trained using one scene sub-dataset, and multiple trained NanoDet-Plus models are obtained; the improved NanoDet-Plus model comprises a backbone network, a feature pyramid, and a detection head, the backbone network is an improved YOLOv5-based CSPDarknet-tiny, the improved YOLOv5-based CSPDarknet-tiny replaces the original batch normalization with layer normalization, and replaces the 3×3 convolution layer of the cross-stage partial aggregation module of the CSPDarknet-tiny with a 7×7 depth separable convolution layer; the feature pyramid comprises a feature extraction module, a cross-stage partial aggregation module, and a feature fusion module; the detection head comprises three detection sub-heads, each detection sub-head comprises two 3×3 convolution layers with SiLU activation functions, a fully connected layer, and a Softmax activation function layer connected in sequence; A classification module is configured to obtain a SAR image to be subjected to ship target recognition, obtain the background scene of the SAR image using the trained background scene classification network, and perform target recognition on the SAR image using the trained NanoDet-Plus model based on the corresponding scene sub-dataset of the background scene.

Citation Information

Patent Citations

  • A primary tumor cell segmentation and recognition method and system based on depth learning

    CN109360193A

  • SAR ship target detection method based on background and scale perception

    CN114219997A