Data enhancement method and system for SAR image ship detection based on adversarial examples
By introducing an improved FGSM algorithm with adversarial perturbations and regularization terms in SAR image ship detection, combined with the square loss function, the problems of difficulty in balancing robustness and accuracy and over-fitting in the existing technology are solved, and the detection efficiency is significantly improved. Accuracy, especially on small data sets.
Patent Information
- Application Number
- CN202311526414.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-11-16
AI Technical Summary
Existing SAR image ship detection data enhancement methods have difficulties in balancing robustness and accuracy when adapting to the needs of deep learning models, and can easily lead to overfitting, especially when the data set is small. Poor adaptability.
Adopting a data enhancement method based on adversarial examples, by improving the FGSM algorithm, introducing adversarial perturbation and regularization terms, using random initialization and cyclic learning rate, combined with the square loss function, optimizing model parameters to generate adversarial samples and improving the robustness of the model and generalization ability.
Significantly improves the generalization and robustness of the detection algorithm, reduces the risk of over-fitting, and improves the detection accuracy by 17% and 26% respectively on SSDD and LS-SSDD-v1.0, which performs better than traditional methods. outstanding.
Smart Images

Figure CN117437509B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data enhancement, and in particular to a method and system for enhancing SAR image ship detection data based on adversarial examples. Background Art
[0002] Synthetic Aperture Radar (SAR) is an all-weather sensor that is widely used in remote sensing and earth observation. Finding ships from SAR images is an important application, and researchers have proposed many research topics. Traditional methods mainly rely on the Constant False Alarm Rate (CFAR) detection algorithm. First, the distribution of pixels is modeled, and parameters and thresholds are calculated based on the input. Then, target pixels and non-target pixels are output based on the threshold. In essence, CFAR-based methods are unsupervised segmentation methods in machine learning. The performance of this method is far from the supervised object detection methods used in computer vision, which has been demonstrated in recent studies.
[0003] With the increase in data volume, the improvement in computing power, the maturity of learning algorithms and the enrichment of application scenarios, neural networks have ushered in another revival and renamed deep learning. Deep learning has an end-to-end advantage over traditional algorithms, and it has shown great advantages in the field of computer vision. Instead of combining individually debugged parts into a system, it assembles the entire system together and trains it. With the rise of this craze, deep learning has been widely used in many fields. Due to the huge advantages of deep learning, researchers began to seek inspiration from it. Since the emergence of SSDD in 2017, a large number of related algorithms have been proposed.
[0004] The application of deep learning in SAR ship detection has been able to flourish mainly because of the datasets available, such as HRSID and LS-SSDD-v1.0. But compared to the datasets used in computer vision, such as PASCAL VOC and MSCOCO, the above datasets are quite small. For example, the HRSID dataset has a total of 5604 samples, while MSCOCO has 328,000 samples. Object detection algorithms borrowed from computer vision will face the problem of overfitting. To alleviate this problem, a large number of data augmentation methods are used in this field.
[0005] Data enhancement methods can generate diversified images through cropping or manipulation, which can improve the generalization ability of detection algorithms. However, the adaptability of the currently proposed data enhancement methods in SAR ship detection is not very good. These methods are not invented from the perspective of deep learning models, but based on the experience of researchers. In order to solve this problem, the present invention proposes a SAR ship detection data enhancement method based on adversarial samples.
[0006] Generally, deep learning models have strong feature extraction capabilities and are vulnerable to some adversarial attacks. It has been reported that adding tiny, imperceptible perturbations to the input can cause the model to output incorrect predictions. The present invention considers that the generated adversarial examples can also be used as a new data augmentation method. And the performance of deep learning models can be improved by adding adversarial examples to the training set.
[0007] Adversarial training means adding interference to the input image and then training it on the deep learning model. It can produce highly realistic adversarial samples, thereby improving the algorithm's ability to detect unseen samples. FGSM and PGD are commonly used adversarial training methods in this field. The main difference between them is that the internal maximization method is selected. Although PGD has better training effect, it has the problem of high training cost. Summary of the invention
[0008] In order to solve the above problems, the present invention proposes a SAR image ship detection data enhancement method based on adversarial examples, which aims to solve the problems existing in the prior art while maintaining a good balance between robustness and accuracy, and reducing the risk of robustness and catastrophic overfitting.
[0009] In order to achieve the above technical objectives, the present application provides a SAR image ship detection data enhancement method based on adversarial examples, comprising the following steps:
[0010] Set the disturbance range, obtain adversarial perturbation, update the model parameters of the adversarial training algorithm FGSM through the optimization algorithm, and generate an improved FGSM algorithm;
[0011] Collect SAR image ship detection data, and enhance the data by performing adversarial training through the improved FGSM algorithm;
[0012] Random initialization, regularization, square loss and cyclic learning rate are used to optimize the model, which is an algorithm model for ship detection through SAR image ship detection data.
[0013] Preferably, in the process of obtaining the adversarial perturbation, the adversarial perturbation is expressed as:
[0014]
[0015] x adv =max(min(x adv ,ε),-ε)
[0016] Where η is a random uniform distribution in the interval [-ε, ε], ε is the perturbation range, α is the step size, and f θ is a deep learning model, y i represents the model prediction input, xi represents input, L represents loss function, represents the gradient of the adversarial perturbation.
[0017] Preferably, in the process of updating the model parameters, the model parameters are expressed as:
[0018]
[0019] in, represents the gradient of θ.
[0020] Preferably, in the process of updating the model parameters, a strong penalty term is introduced in each iteration to prevent overly aggressive updates.
[0021] Preferably, during the iterative update process, the (t+1)th iterative update process is:
[0022] θ t+1 =argmin θ f(θ)+λR(θ,θ t )
[0023] Among them, R(θ,θ t ) is a strong regularization term λ represents the regularization factor.
[0024] Preferably, in the process of processing the data, the enhanced data is one-hot encoded based on the standard square loss of the one-hot encoded label vector.
[0025] Preferably, in the process of obtaining the standard square loss, the standard square loss is expressed as:
[0026]
[0027] Among them, y hot represents the label vector, and f(x) represents the model output.
[0028] The present invention discloses a SAR image ship detection data enhancement system based on adversarial examples, comprising:
[0029] A data acquisition module, used to obtain the ship detection data of the SAR image to be enhanced;
[0030] The data enhancement module is used to enhance the SAR image ship detection data by improving the FGSM algorithm, perform one-hot encoding on the enhanced data, and perform model training, wherein the disturbance range is set, adversarial disturbance is obtained, and the model parameters of the adversarial training algorithm FGSM are updated through the optimization algorithm to generate an improved FGSM algorithm.
[0031] Preferably, the data enhancement module is also used to prevent overly aggressive updates by introducing a strong penalty term in each iteration during the process of updating the model parameters.
[0032] Preferably, the data enhancement module is further used to perform one-hot encoding on the data after data enhancement based on the standard square loss of the one-hot encoded label vector during the data enhancement process.
[0033] The present invention discloses the following technical effects:
[0034] The present invention improves the generalization and robustness of the detection algorithm by introducing adversarial training, while maintaining a good balance between robustness and accuracy and reducing the risk of catastrophic overfitting; compared with traditional data augmentation methods, the method proposed in the present invention improves SSDD and LS-SSDD-v1.0 by 17% and 26% respectively. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 is a flow chart of the data enhancement method of the present invention;
[0037] Figure 2 is an example of the HRSID described in the embodiment of the present invention;
[0038] Figure 3 is an example diagram of LS-SSDD-v1 according to an embodiment of the present invention;
[0039] Figure 4 It is the detection result of the method described in the embodiment of the present invention in HRSID. DETAILED DESCRIPTION
[0040] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0041] The SAR ship detection algorithm based on deep learning has the risk of overfitting due to insufficient SAR images. Some data enhancement methods based on operations such as cropping have been applied in this regard, but they have little advantage over built-in methods. In order to improve the accuracy and robustness of the detection algorithm, the present invention proposes an improved FGSM method. In view of the problems existing in FGSM, the optimization process is improved to improve the robustness of the algorithm; random initialization is used instead of zero initialization to improve the convergence speed of the model; regularization method is used to prevent excessive update of model parameters between adjacent steps; square loss is used to improve the accuracy of the adversarial model; cyclic learning rate is used to effectively avoid the risk of overfitting. Experiments have been carried out on multiple detection algorithms and data sets. Compared with traditional data enhancement methods, they have great advantages; the method proposed in the present invention specifically includes the following processes:
[0042] Adversarial training is an important way to improve the robustness of neural networks. During adversarial training, some small perturbations are mixed into the samples, and the neural network will adapt to such changes, thus becoming robust to adversarial samples, which can play a role in data enhancement.
[0043]
[0044] Where ε represents the interference at the input, S represents the range of interference, and x+ε represents the generated adversarial sample. The purpose of internal optimization is to maximize the loss function L(θ, x+ε, y), which attempts to make the model output an incorrect prediction. The purpose of external optimization is to minimize the loss function L(θ, x+ε, y) so that the model outputs the correct prediction result. After multiple iterations, the model is more robust to interference, ε is limited by a constant, and an optimizer (such as SGD) is used to update the parameter θ.
[0045] The focus of adversarial training is to find suitable perturbations to make the model more robust. Many approximate methods for solving perturbations have been proposed, among which the representative methods are FGSM and PGD. The main difference between them is the choice of internal maximization method to generate adversarial perturbations. PGD is a multi-iteration method that takes a small step at a time and projects the perturbation into a specified range in each iteration. Although PGD is simple and effective, it has the problem of low computational efficiency. FGSM only performs one iteration, but there are two problems: one is the slow training speed, and the other is the reduced accuracy of the model for normal samples. In order to alleviate the above problems, the present invention improves FGSM.
[0046] First, the perturbation is randomly initialized. Assuming the given perturbation range ε, η is a random uniform distribution in the interval [-ε, ε], and the calculation formula is:
[0047] η=umiform(-ε,ε)
[0048] x adv For adversarial perturbations, the calculation method is as follows:
[0049]
[0050] Where α is the step size, f θ It is a deep learning model.
[0051] x adv =max(min(x adv ,ε),-ε)
[0052] Finally, the model parameters are updated using an optimization algorithm, such as SGD.
[0053]
[0054] Compared to zero initialization, random initialization makes adversarial training converge faster, and only a few iterations are enough to produce reliable results.
[0055] To prevent overly aggressive updates, a strong penalty term is introduced in each iteration so that the model is updated only within a small neighborhood of the previous iteration. Specifically, at the (t+1)th iteration, the following formula is used for optimization:
[0056] θ t+1 = arg min θ f(θ)+λR(θ,θ t )
[0057] in When λ is large enough, R(θ,θ t ) is a strong regularization term that avoids θ t+1 Too much escape from previous iteration θ.
[0058] The difficulty in minimizing the loss comes from saddle points, not bad local minima. Saddle points have a small gradient, which slows down the learning process. Increasing the learning rate allows traversal of saddle points faster, but the learning rate cannot be infinite. Therefore, a cyclic learning rate is used here, where the learning rate increases linearly from zero to the maximum learning rate and then returns to zero, which is a cyclic change. The cyclic scheduling of the learning rate can greatly reduce the number of cycles required to train deep networks. Using cyclic learning rates can converge to the baseline accuracy in tens of cycles instead of hundreds of cycles.
[0059] In order to optimize the loss function, it is important to choose an appropriate loss function. The cross entropy loss function is generally used as a training loss and attack target function. Classifiers trained with this loss may have insufficient robustness and overfitting problems. Training with squared loss can produce results equal to or better than cross entropy, which helps achieve good robustness against adversarial examples. The standard squared loss for a one-hot encoded label vector is:
[0060]
[0061] The label vector is encoded using one-hot encoding and is represented as y hot SGD is used as the basic optimizer, momentum is set to 0.9, and weight decay is 5×10 -4 , set the maximum learning rate of the cycle learning rate to 0.2 and the number of epochs to 200.
[0062] Example 1: The method proposed in the present invention was tested, including the following process:
[0063] 1. Experimental environment setting:
[0064] The experiment was conducted on Ubuntu system, Intel(R) Core(TM) i9-10900K processor, GeForceRTX3080GPU, and Pytorch framework. Faster R-CNN, YOLOV3, RetinaNet, and CenterNet were selected as basic algorithms. Two public datasets, HRSID and LS-SSDD-v1.0, were used to evaluate the performance of the proposed method. Eight traditional data enhancement methods were compared with the method proposed in this invention, which are cutout, randomerase, mixup, cutmix, augmix, gridmask, mosic, and copy / paste. The experiment used AP50 as the evaluation indicator.
[0065] Generally speaking, deep learning-based detection algorithms have some built-in data enhancement methods, which play a positive role in improving the generalization ability of the model. For example, resizing and random flipping are used in FasterR-CNN, YOLOV3, CenterNet and RetinaNet, and photo metric distortion is also used in YOLOV3. The performance of the built-in method is the benchmark of the proposed method, as shown in Table 1. In Table 1, FR, RN, Y3, CN and AVE represent Faster R-CNN, RetinaNet, YOLOV3, CenterNet and average precision, respectively.
[0066] Table 1
[0067] Datasets FR RN Y3 CN AVE HRSID 0.80 0.65 0.80 0.81 0.77 LS-SSDD-v1.0 0.66 0.55 0.51 0.40 0.53
[0068] 2. Performance testing on different data sets:
[0069] HRSID has 5604 high-resolution SAR images of 800×800 pixels, which can meet the needs of practical GPU training. In HRSID, most ships are small and sparse. Examples of HRSID are as follows: Figure 2 The results of different data augmentation methods and detection algorithms on HRSID are shown in Table 2, where DAM refers to the data augmentation method.
[0070] Table 2
[0071]
[0072] For traditional data augmentation methods, 32 experiments were conducted. Compared with the built-in methods, there were 14 increases in accuracy, with an average AP increase of 7.7%, 16 decreases in accuracy, with an average decrease of 9.6%, and 2 methods remained unchanged. The average AP50 of the 32 combinations is 0.75. The average of the built-in data augmentation methods in Table 1 is 0.77. The results show that traditional data augmentation methods generally reduce the performance of the detection algorithm compared to the built-in data augmentation methods. Only specific combinations of detection algorithms and data augmentation methods can improve performance, for example, RetinaNet with mixup can improve the performance of HRSID from 65% to 84% (an increase of 19%).
[0073] Compared with the ordinary capabilities of traditional data enhancement methods, the adversarial training-based method proposed in this paper can achieve huge improvements in all detection algorithms. For example, its AP50 on HRSID is 0.95, 0.89, 0.92 and 0.91, respectively, with an average of 0.9, which is much higher than the traditional method (0.75). Compared with the built-in method and the traditional method, the detection rate is improved by 0.15 and 0.17.
[0074] Through these experiments, the present invention can find that the proposed adversarial training is effective on different HRSID detection algorithms, and the performance improvement is huge.
[0075] LS-SSDD-v1.0 consists of 15 Sentinel-1SAR images of size 24000×16000 pixels. Each image is directly divided into 600 sub-images of 800×800 pixels. The dataset contains 6015 ships. Examples of LS-SSDD-v1 are as follows: Figure 3 The results of different data augmentation methods and detection algorithms on LS-SSDD-V1.0 are shown in Table 3, where DAM refers to the data augmentation method.
[0076] Table 3
[0077]
[0078]
[0079] For traditional data augmentation methods, 32 experiments were conducted. Compared with the built-in methods, there were 10 boost methods with an average increase of 9.6% and 22 drops with an average decrease of 9.4%. The average AP50 of the 32 combinations was 0.50. The average of the built-in data augmentation methods in Table 1 is 0.53. This shows that traditional data augmentation methods reduce the overall performance of the detection algorithm. Only specific combinations of detection algorithms and data augmentation methods can improve performance. For example, YOLOV3 using Augmix can improve the performance of LS-SSDD-V1.0 from 51% to 75% (an increase of 24%).
[0080] Compared with the ordinary capabilities of traditional data enhancement methods, the adversarial training-based method proposed in this invention can achieve huge improvements in all detection algorithms. For example, its AP50 on LS-SSDD-V1.0 is 0.75, 0.79, 0.82 and 0.69, with an average of 0.76, which is much higher than the traditional method (0.50), and is improved by 0.23 and 0.26 respectively compared with the built-in method and the traditional method.
[0081] Through these experiments, we find that the proposed adversarial training is effective on different detection algorithms trained on LS-SSDD-V1.0.
[0082] From the above experiments, the present invention can also find that for general methods, the performance of LS-SSDD-v1.0 is quite poor. This is because the LS-SSDD-v1.0 dataset has a large number of small ships and difficult samples that are difficult to detect. However, the proposed adversarial training can adapt to this situation. These improvements are based on this dataset because it produces many disturbing samples, making the detection algorithm robust to difficult samples in LS-SSDD-V1.0.
[0083] 3. Ablation experiment:
[0084] The improved adversarial training proposed in the present invention can improve the performance to a great extent. In order to explore its mechanism of action, the present invention conducted some ablation experiments, and the results are shown in Table 4.
[0085] On HRSID and LS-SSDD-v1.0, the AP50 averages of traditional data augmentation methods are 0.75 and 0.50, respectively, while the AP50 averages of the plain adversarial training method (FGSM) are 0.80 and 0.62, respectively. After adding random initialization, although the AP50 remains unchanged, the convergence speed is significantly faster than zero initialization. After adding regularization, the AP50 on HRSID and LS-SSDD-v1.0 is improved from 0.81 and 0.62 to 0.84 and 0.67, respectively, because it can prevent aggressive updates. On HRSID and LS-SSDD-v1.0, the AP50 is improved from 0.84 and 0.67 to 0.89 and 0.70, respectively. It can achieve a good balance between adversarial accuracy and natural accuracy. By increasing the cyclic learning rate, AP50 is improved from 0.89 and 0.70 to 0.92 and 0.76 on HRSID and LS-SSDD-v1.0, respectively, because it can effectively reduce the risk of robust overfitting.
[0086] Table 4
[0087] Methods Tra FGSM +Ran +Reg +Squ +Cyc HRSID 0.75 0.80 0.81 0.84 0.89 0.92 LS-SSDD-v1.0 0.50 0.62 0.62 0.67 0.70 0.76
[0088] 4. Test results
[0089] Figure 4 The present invention can find that through the improved adversarial training method, such as Figure 4 As shown, in most cases, small-sized vessels can be successfully detected. Here, near-shore vessels with complex backgrounds can also be detected, and it can distinguish interference from the background.
[0090] The data enhancement method based on adversarial examples and fast gradient optimization method proposed in this paper generates adversarial samples by maximizing the loss function through internal optimization, and updates the model parameters by minimizing the training loss through external optimization. It can improve the robustness of deep learning models and improve generalization ability. Random initialization is used instead of zero initialization to improve the convergence speed of the model. Regularization is used to prevent excessive updating of model parameters between adjacent steps; square loss is used to improve the accuracy of the adversarial model; and cyclic learning rate is used to effectively avoid the risk of overfitting. Experimental results on 4 detection algorithms and 2 public datasets show the good performance of this method. Compared with traditional data enhancement methods, the proposed method improves 17% and 26% on SSDD and LS-SSDD-v1.0, respectively.
[0091] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. Data enhancement method for SAR image ship detection based on adversarial examples, It is characterized in that The following steps are involved: Set the disturbance range, obtain adversarial perturbation, update the model parameters of the adversarial training algorithm FGSM through the optimization algorithm, and generate an improved FGSM algorithm; Collect SAR image ship detection data, perform adversarial training through the improved FGSM algorithm, and enhance the data; The model is optimized using random initialization, regularization, squared loss, and cyclic learning rate; In the process of obtaining the adversarial perturbation, the adversarial perturbation is expressed as: x adv =max(min(x adv ,e),-e) Where η is a random uniform distribution in the interval [-ε, ε), ε is the perturbation range, α is the step size, and f θ is a deep learning model, y i represents the model prediction input, x i represents input, L represents loss function, represents the gradient of the adversarial perturbation; In the process of updating the model parameters, the model parameters are expressed as: in, represents the gradient of θ; In the process of updating the model parameters, a strong penalty term is introduced in each iteration to prevent overly aggressive updates; During the iterative update process, the (t+1)th iterative update process is: i t+1 =argmin θ f(θ)+λR(θ,θ t ) Among them, R(θ,θ t ) is a strong regularization term λ represents the regularization factor; In the process of processing the data, the enhanced data is one-hot encoded based on the standard square loss of the one-hot encoded label vector.
2. According to the SAR image ship detection data enhancement method based on adversarial examples in claim 1, Features: In the process of obtaining the standard square loss, the standard square loss is expressed as: Among them, y hot represents the label vector, and f(x) represents the model output.
