Knowledge distillation-based lightweight SAR image multi-type target detection method and device, equipment and medium
By improving the YOLOv8 model based on knowledge distillation, combining feature extraction and attention mechanisms, it solves the problems of detection accuracy and speed in SAR image target detection, and achieves a more efficient lightweight model, especially in complex scenes. Small target detection effect.
Patent Information
- Application Number
- CN202410509647.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-08-27
AI Technical Summary
The SAR image target detection algorithm based on deep learning has room for improvement in terms of detection speed and accuracy. Especially when faced with complex coherent noise and nearshore background interference, lightweight models are prone to missed detections and false detections, and the detection accuracy is not high.
A method based on knowledge distillation is used to make lightweight improvements to the YOLOv8 model. By constructing a knowledge distillation framework for the teacher network and student network, the teacher model is used to guide student model learning, and the detection of the model is improved by combining PConv, SPPELAN, MLCA and EMA attention mechanisms. Accuracy.
Without increasing the amount of parameters and calculations, the detection accuracy is improved, especially the small target detection effect in the nearshore scene of SAR images, and the overall detection performance of the model is improved.
Smart Images

Figure CN118552846A
Abstract
Description
Technical Field
[0001] The present application relates to a lightweight SAR image multi-type target detection method based on knowledge distillation and its device, equipment and medium, belonging to the field of image processing technology. Background Art
[0002] Synthetic Aperture Radar (SAR) is an active microwave remote sensing sensor that uses an antenna to move at a constant speed along the trajectory of a long linear array and radiate coherent signals, and performs coherent processing on the echoes received at different positions to obtain high-resolution imaging. Compared with traditional optical sensors, SAR is not restricted by factors such as light intensity and weather when imaging or detecting, and has the advantages of all-weather and all-day. SAR imaging technology makes up for the defect that optical imaging technology cannot map the surface at night and in bad weather conditions. SAR has been widely used in civil and military fields, such as disaster monitoring and decision support, marine monitoring, resource detection, mapping, and monitoring and management of crops and forest resources. With the continuous development of high-resolution SAR imaging technology, there are a large number of SAR images that can be used for target detection. At the same time, with the development of deep learning, the performance of SAR image target detection has been greatly improved. At present, the SAR image target detection algorithm based on deep learning still has a lot of room for improvement in detection speed and detection accuracy.
[0003] Object detection algorithms based on deep learning are mainly divided into two categories: one is the two-stage object detection algorithm represented by the regional convolutional neural network (R-CNN) and Faster R-CNN, and the other is the single-stage object detection algorithm represented by YOLO, SSD, Retina-Net, etc. The two-stage algorithm uses the region proposal network to distinguish the foreground and background, and then classifies the object and predicts the position. Although this type of algorithm has high detection accuracy, the detection efficiency is low. The single-stage algorithm does not need to generate candidate regions and simplifies the object detection problem into a regression problem. It is better than the two-stage algorithm in detection speed.
[0004] Since small targets occupy fewer pixels in SAR images and the images often contain a lot of background clutter, this undoubtedly brings great difficulties to SAR image target detection. Faced with these complex coherent noises and near-shore background interference, lightweight detection models are often prone to missed detections and false detections, and the detection accuracy is not high. Summary of the invention
[0005] To solve the above technical problems, the embodiments of the present application respectively provide a lightweight SAR image multi-type target detection method and apparatus, equipment, and medium based on knowledge distillation, which uses a teacher model to guide the student model so that the student network learns the effective knowledge of the teacher network, thereby improving the detection accuracy of the lightweight model to a certain extent.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, a lightweight SAR image multi-type target detection method based on knowledge distillation is provided, the method comprising:
[0008] The YOLOv8 model is lightweight and improved by using the characteristics of SAR image targets;
[0009] The improved YOLOv8 model is scaled to obtain two scales of models, namely a complex scale model and a lightweight scale model. The complex scale model is used as the teacher network and the lightweight scale model is used as the student network to build a knowledge distillation framework.
[0010] In response to the acquired SAR image data set, the knowledge distillation framework is trained to obtain a lightweight SAR image detection model, and the lightweight SAR image detection model is used to identify multiple categories of targets in the SAR image.
[0011] Furthermore, the characteristics of SAR image targets are used to make lightweight improvements to the YOLOv8 model, including:
[0012] In the C2f module of the backbone feature extraction network of the YOLOv8 model, PConv is introduced to replace the conventional Conv, and the point-by-point convolution PWConv is further attached to Pconv;
[0013] Reconstruct the spatial pyramid pooling module of the YOLOv8 model, introduce SPPELAN and combine it with the lightweight MLCA attention mechanism to replace the SPPF module in the YOLOv8 model;
[0014] An upsampling layer is added to the feature fusion part of the YOLOv8 model to use the feature map of the P2 scale for prediction. The YOLOv8 model includes a C2f module, and the RepVGGDW and EMA attention mechanisms are combined and integrated into the C2f module. RepVGGDW is used to structurally reparameterize the depth-separable convolutional layer to eliminate the computational and memory costs associated with jump connections during inference.
[0015] Furthermore, the distillation loss of the knowledge distillation framework is expressed as:
[0016]
[0017] Where T and S represent the teacher network and the student network respectively, y T and S They represent the activation map of the teacher network and the activation map of the student network respectively, c is the channel index, and Represent the activation maps of the corresponding channels of the teacher network and the student network, It is used to convert activation values into probability distribution as follows:
[0018]
[0019] Where i is the spatial index, W, H are the width and height of the feature map, T is a hyperparameter, exp is an exponential function with the natural constant e as the base, and y c,i is the activation value of the indexed pixel, The difference between the channel distributions used to evaluate the teacher network and the student network is shown below:
[0020]
[0021] Where C is the number of channels.
[0022] Furthermore, the categories of the targets include ships, oil tanks, and bridges.
[0023] Furthermore, in response to the acquired SAR image data set, the knowledge distillation framework is trained to obtain a lightweight SAR image detection model, and the lightweight SAR image detection model is used to identify multiple categories of targets in the SAR image, specifically including:
[0024] Inputting images in the SAR image data set into the teacher network model for pre-training to obtain a teacher model weight file;
[0025] The student network model is distilled and learned on the SAR image dataset based on the teacher model weight file, the training parameters are set and the parameters in the student network model are iteratively updated based on the optimizer to obtain the weight parameter file, and a lightweight SAR image detection model is constructed according to the weight parameter file.
[0026] Furthermore, the loss function L of the student network model in the distillation learning process based on the teacher model weight file on the SAR image dataset is Shape-IoU The calculation formula is as follows:
[0027]
[0028]
[0029]
[0030]
[0031]
[0032] L Shape-IoU =1-IoU+distance shape +0.5×Ω shape
[0033] Where IoU represents the intersection over union ratio between the predicted box and the true box, scale is the scaling factor, which is related to the proportion of the target in the dataset, and w gt and h gt represents the width and height of the real bounding box, (x c ,y c ) is the coordinate of the center point of the prediction box, is the coordinate of the center point of the real box, c represents the diagonal distance of the minimum bounding box between the predicted box and the real box, B represents the area occupied by the predicted box, and B gt represents the area occupied by the real box, ww and hh are the weight coefficients in the horizontal and vertical directions respectively, and distance shape represents the center point distance loss, Ω shape represents the bounding box shape loss, ω t It means calculating the difference in width between the two boxes and the ratio of their maximum widths (same for height) and adding ww and hh metrics respectively.
[0034] Furthermore, the method further comprises:
[0035] The performance of the lightweight SAR image detection model is evaluated using the set evaluation objectives. The evaluation indicators include precision, recall, and average precision (mAP). The calculation formula is as follows:
[0036]
[0037]
[0038]
[0039]
[0040] Among them, TP is the number of positive classes predicted as positive classes, FP is the number of negative classes predicted as positive classes, FN is the number of positive classes predicted as negative classes, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, P ... i is the average accuracy of the indexed category.
[0041] According to one aspect of an embodiment of the present application, a lightweight SAR image multi-type target detection device based on knowledge distillation is provided, comprising:
[0042] A model improvement unit, configured to perform lightweight improvements on the YOLOv8 model using the characteristics of the SAR image target;
[0043] The framework construction unit is configured to scale the improved YOLOv8 model to obtain two scale models, namely, a complex scale model and a lightweight scale model, and use the complex scale model as the teacher network and the lightweight scale model as the student network to construct a knowledge distillation framework;
[0044] The target recognition unit is configured to train the knowledge distillation framework in response to the acquired SAR image data set to obtain a lightweight SAR image detection model, and use the lightweight SAR image detection model to recognize multiple categories of targets in the SAR image.
[0045] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the controller implements the above-mentioned lightweight SAR image multi-type target detection method based on knowledge distillation.
[0046] According to one aspect of an embodiment of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned lightweight SAR image multi-type target detection method based on knowledge distillation.
[0047] According to one aspect of the embodiments of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned lightweight SAR image multi-type target detection method based on knowledge distillation.
[0048] The technical solution provided in the embodiments of the present application has at least the following advantages:
[0049] The present invention is based on the lightweight improvement of the YOLOv8 model. The improved model has fewer parameters and calculation amount. At the same time, combined with channel-based knowledge distillation learning, the detection accuracy is further improved without increasing the number of parameters and calculation amount. In addition, the present invention also has a good detection effect on small targets in nearshore scenes of SAR images with a small number of parameters.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0052] Figure 1 is a flowchart of a lightweight SAR image multi-type target detection method based on knowledge distillation shown in an exemplary embodiment of the present application;
[0053] Figure 2 is an improved YOLOv8 network structure diagram shown in an exemplary embodiment of the present application;
[0054] Figure 3 is a C2f_PConv module structure diagram shown in an exemplary embodiment of the present application;
[0055] Figure 4 is a structural diagram of the MLCA attention mechanism shown in an exemplary embodiment of the present application;
[0056] Figure 5 is a structural diagram of the SPPELAN_MLCA module shown in an exemplary embodiment of the present application;
[0057] Figure 6 is a structural diagram of the EMA attention mechanism shown in an exemplary embodiment of the present application;
[0058] Figure 7 is a C2f_RepVGGDW_EMA module structure diagram shown in an exemplary embodiment of the present application;
[0059] Figure 8 It is a schematic diagram of the structure of a lightweight SAR image multi-type target detection device based on knowledge distillation, shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0060] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0061] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0062] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0063] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0064] See also Figure 1 , Figure 1 FIG. 1 is a flowchart of a method for detecting multiple types of targets in lightweight SAR images based on knowledge distillation, as shown in an exemplary embodiment of the present application. Figure 1 As shown, the method at least includes steps S100 to S300, which are described in detail as follows:
[0065] Step S100, using the characteristics of the SAR image target to perform lightweight improvement on the YOLOv8 model;
[0066] It should be noted that the YOLOv8 model described in this article is an existing model, which is another SOTA model in the YOLO series Q, updated relative to YOLOv5, and its specific structure is not detailed in this embodiment.
[0067] In some embodiments, the step S100 performs lightweight improvements on the YOLOv8 model. Figure 2As shown in the figure, the improved target detection network includes a backbone feature extraction module (Backbone), a feature fusion module (Neck), and a target prediction module (Head) connected from left to right. The specific implementation steps are as follows:
[0068] One is to replace the Conv in the residual structure of the C2f module of the backbone feature extraction network of the model with PConv. In order to fully and effectively utilize the information from all channels, point-by-point convolution PWConv is further applied afterwards. The improved C2f_PConv module is as follows Figure 3 This module effectively reduces the number of parameters and computations of the original backbone network. The effective receptive field of the combination of PConv and PWConv on the input feature map looks like a T-shaped Conv, which pays more attention to the information at the center.
[0069] The second is to reconstruct the spatial pyramid pooling module of the model. The SPP structure is to pass the input in parallel through multiple MaxPool layers of different sizes, and then further fuse them, which can solve the multi-scale problem to a certain extent. The present invention combines the SPP and ELAN network architectures into the SPPELAN module, uses three 5×5 kernel maximum pooling to complete the pooling fusion in a serial and parallel manner, and adds a lightweight MLCA attention mechanism before all pooling outputs are fused. The structure of MLCA is as follows Figure 4 As shown in Figure 2. MLCA considers both channel information and spatial information, and combines local information and global information to improve the expression effect of the network. The attention mechanism has very few parameters. Introducing this mechanism in spatial pyramid pooling can more effectively capture multi-scale context information without increasing the number of parameters and calculations, thereby improving the accuracy of target detection. The improved SPPELAN_MLCA module is shown in Figure 2. Figure 5 shown.
[0070] The third is to improve the feature fusion part of the model. The original model sends the feature maps of P3, P4, and P5 scales to the detection head for target prediction. In view of the problem that small near-shore targets are easily missed in SAR images, the present invention adds an upsampling layer on the original basis, and performs feature fusion on the feature maps that are downsampled 4 times so that the feature maps of P2 scale are also used for prediction, thereby improving the detection accuracy of small targets. The P2, P3, P4, and P5 feature maps are 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original images, respectively. There is a large amount of background interference in SAR images of complex near-shore scenes. Not all areas contribute to the detection task. Only areas related to the three types of targets, namely ships, oil tanks, and bridges, need to be paid attention to. Therefore, the present invention introduces the EMA attention mechanism in the C2f module of the feature fusion part of the model. EMA reshapes some channels into batch dimensions, and groups the channel dimensions into multiple sub-features, so that the spatial semantic features are evenly distributed in each feature group, thereby retaining the information on each channel and reducing computational overhead. The structure of EMA is as follows Figure 6 As shown. Inspired by the Repvit backbone network, the present invention uses RepVGGDW to improve the residual structure of the C2f module in the feature fusion part, further lightweighting the model. The improved C2f_RepVGGDW_EMA module structure is shown in Figure 7 The C2f_RepVGGDW_EMA module based on the EMA attention mechanism enhances the attention to the target features of SAR images at different scales, and effectively reduces the impact of complex near-shore scenes on the detection of ships, oil tanks, and bridges.
[0071] In step S200, the improved YOLOv8 model is scaled to obtain two scales of models, namely, a complex scale model and a lightweight scale model. The complex scale model is used as the teacher network and the lightweight scale model is used as the student network to construct a knowledge distillation framework.
[0072] In some embodiments, the specific implementation of step S200 is as follows:
[0073] The improved YOLOv8 model obtained in step S100 is scaled, and the complex-scale model is used as the teacher network, and the lightweight-scale model is used as the student network. The channel-based knowledge distillation method based on intermediate features is used to construct a distillation learning framework. The present invention performs channel alignment on the four different levels of feature maps output in the feature fusion part of the student model and the teacher model according to the size of the feature map to perform distillation learning. If the number of channels between the teacher and the student does not match, the number of channels of the student network is upsampled using a 1×1 convolutional layer. The channel-based knowledge distillation method first converts the activation of the channel into a probability distribution and then uses the KL divergence to measure the difference. The distillation loss of this method can be expressed in general form as:
[0074]
[0075] The teacher network and the student network are represented as T and S respectively, y T and S They represent the activation map of the teacher network and the activation map of the student network respectively, c is the channel index, and Represent the activation maps of the corresponding channels of the teacher network and the student network, It is used to convert activation values into probability distribution as follows:
[0076]
[0077] Where c is the channel index, i is the spatial index, W, H are the width and height of the feature map, and y c,i is the activation value of the indexed pixel, T is a hyperparameter (temperature), if a larger T is used, the probability becomes softer, which means focusing on a wider spatial area of each channel. The difference between the channel distributions used to evaluate the teacher network and the student network is shown below:
[0078]
[0079] Where C is the number of channels, the distillation loss KL divergence is an asymmetric measure. It can be seen from the above formula that if Very large, minimizing losses Will Close, if Very small, then The proportion of loss is small, and KL divergence is not used much. Will Therefore, the student network tends to produce similar activation distributions in foreground saliency, while the activations corresponding to background regions of the teacher network have less impact on learning. This asymmetry is beneficial for distillation learning of dense prediction tasks.
[0080] Step S300: In response to the acquired SAR image data set, the knowledge distillation framework is trained to obtain a lightweight SAR image detection model, and the lightweight SAR image detection model is used to identify multiple categories of targets in the SAR image.
[0081] In some embodiments, step S300 may be implemented through the following steps S301 and S302.
[0082] Step S301: The dataset used in the embodiment of the present invention is a new dataset consisting of small targets selected from the large-scale multi-class SAR target detection dataset MSAR-1.0, named Tiny-MSAR, including three types of targets: ships, oil tanks, and bridges, with a total of 16,933 images. The selected dataset is randomly divided into a training set, a validation set, and a test set in a ratio of 6:2:2, where the images in the training set are used to train the initial target detection network, the validation set is used to perform a preliminary evaluation of the performance of the initial target detection network and adjust the parameters and structure of the model accordingly, and the test set is used to perform a final evaluation and comparison of the model performance.
[0083] Step S302: Pre-train the teacher network model in step 2 on the data set to obtain the required teacher model weight file, and then perform distillation learning training on the student network model based on the teacher weight on the data set, wherein the training environment used in the embodiment of the present invention is Windows 10, the graphics card model is NVIDIA GEFORCE RTX4070 (12GB), and the operating environment is built based on the Pytorch2.0.0 framework. Further, the required parameters are set, and the training parameters include epoch (number of iterations), batchsize (number of images in each batch), lr (learning rate), momentum (momentum parameter), feature_loss_ratio (distillation coefficient ratio), etc. Among them, epoch is 300, batchsize is 16, lr is 0.01, momentum is 0.937, and feature_loss_ratio is 0.4. Use the SGD optimizer to iteratively update the student network model parameters.
[0084] In some embodiments, for the training of the student network model, the present invention uses the Shape-IoU loss function to replace the CIoU loss function used in the original YOLOv8 network to calculate the coordinate loss of the prediction box. Existing bounding box regression methods usually consider the geometric relationship between the real box and the prediction box, and use the relative position and shape of the bounding box to calculate the loss, while ignoring the influence of inherent attributes such as the shape and scale of the bounding box on the bounding box regression. The Shape-IoU method can calculate the loss by focusing on the shape and scale of the bounding box itself, thereby making the bounding box regression more accurate.
[0085] Shape-IoU loss function L Shape-IoU The calculation formula is as follows:
[0086]
[0087]
[0088]
[0089]
[0090]
[0091] L Shape-IoU =1-IoU+distance shape +0.5×Ω shape
[0092] Where IoU represents the intersection over union ratio between the predicted box and the true box, scale is the scaling factor, which is related to the proportion of the target in the dataset, and w gt and h gt represents the width and height of the real bounding box, (x c ,y c ) is the coordinate of the center point of the prediction box, is the coordinate of the center point of the real box, c represents the diagonal distance of the minimum bounding box between the predicted box and the real box, B represents the area occupied by the predicted box, and B gt represents the area occupied by the real box, ww and hh are the weight coefficients in the horizontal and vertical directions respectively, and distance shape represents the center point distance loss, Ω shape represents the bounding box shape loss, ω t It means calculating the difference in width between the two boxes and the ratio of their maximum widths (same for height) and adding ww and hh metrics respectively.
[0093] In some embodiments, after step S302, the following step S303 is further included:
[0094] Step S303: After the network model training is completed, the parameter weights with the best effect in the training process are used to identify three types of targets, namely ships, oil tanks, and bridges, on the test set divided by the SAR image data set used to evaluate the model performance.
[0095] The model performance is mainly evaluated from two aspects: detection accuracy and model complexity. Model complexity includes model size and number of parameters, while the evaluation indicators of detection accuracy include precision, recall and mean average precision (mAP).
[0096] TP is the number of positive classes predicted as positive classes, FP is the number of negative classes predicted as positive classes, and FN is the number of positive classes predicted as negative classes. The calculation formulas for precision, recall, and mean average precision (mAP) can be obtained:
[0097]
[0098]
[0099]
[0100]
[0101] Among them, TP is the number of positive classes predicted as positive classes, FP is the number of negative classes predicted as positive classes, FN is the number of positive classes predicted as negative classes, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, P ... i is the average accuracy of the indexed category.
[0102] Based on the same SAR image dataset, the original YOLOv8 model (scale selection YOLOv8n) and the method of the present invention (YOLOv8 improvement + distillation) are trained, and the target objects are set as ships, oil tanks, and bridges. The trained target detection network is evaluated as above, so as to obtain the results shown in Table 1.
[0103] Table 1 Comparative experimental results
[0104]
[0105] As shown in Table 1, the detection effect of the method of the present invention is better than that of YOLOv8n. The overall mAP@0.5 index of the three types of targets, ship, oil tank, and bridge, is improved from 0.894 to 0.912, an increase of 1.8%; the mAP@0.5 index of oil tank is improved by 8.3%, the mAP@0.5 index of ship is improved by 0.2%, and the mAP@0.5 index of bridge is reduced by 3%, and the model size is reduced from 5.99MB to 4.63MB, and the number of parameters is reduced from 3006233 to 2156038. Although the detection effect of the method of the present invention on the bridge is slightly reduced, the improvement of the detection effect on the ship and oil tank and the overall detection effect of the three types of targets, coupled with the lighter model, can make up for this defect well.
[0106] The experimental results show that the proposed method has certain advantages over the original YOLOv8, has better detection effects on multiple categories of SAR image targets, and has certain practical value.
[0107] Another aspect of the present application also provides a lightweight SAR image multi-type target detection device based on knowledge distillation, such as Figure 8As shown, the device 800 includes:
[0108] The model improvement unit 801 is configured to perform lightweight improvement on the YOLOv8 model by utilizing the characteristics of the SAR image target;
[0109] The framework construction unit 802 is configured to scale the improved YOLOv8 model to obtain two scale models, namely, a complex scale model and a lightweight scale model, and use the complex scale model as a teacher network and the lightweight scale model as a student network to construct a knowledge distillation framework;
[0110] The target recognition unit 803 is configured to train the knowledge distillation framework in response to the acquired SAR image data set to obtain a lightweight SAR image detection model, and use the lightweight SAR image detection model to recognize multiple categories of targets in the SAR image.
[0111] In another embodiment, the model improvement unit is further configured to
[0112] In the C2f module of the backbone feature extraction network of the YOLOv8 model, PConv is introduced to replace the conventional Conv, and the point-by-point convolution PWConv is further attached to Pconv;
[0113] Reconstruct the spatial pyramid pooling module of the YOLOv8 model, introduce SPPELAN and combine it with the lightweight MLCA attention mechanism to replace the SPPF module in the YOLOv8 model;
[0114] An upsampling layer is added to the feature fusion part of the YOLOv8 model to use the feature map of the P2 scale for prediction. The YOLOv8 model includes a C2f module, and the RepVGGDW and EMA attention mechanisms are combined and integrated into the C2f module. RepVGGDW is used to structurally reparameterize the depth-separable convolutional layer to eliminate the computational and memory costs associated with jump connections during inference.
[0115] In another embodiment, the distillation loss of the knowledge distillation framework is expressed as:
[0116]
[0117] Where T and S represent the teacher network and the student network respectively, y T and S They represent the activation map of the teacher network and the activation map of the student network respectively, c is the channel index, and Represent the activation maps of the corresponding channels of the teacher network and the student network, It is used to convert activation values into probability distribution as follows:
[0118]
[0119] Where i is the spatial index, W, H are the width and height of the feature map, T is a hyperparameter, exp is an exponential function with the natural constant e as the base, and y c,i is the activation value of the indexed pixel, The difference between the channel distributions used to evaluate the teacher network and the student network is shown below:
[0120]
[0121] Where C is the number of channels.
[0122] In another embodiment, the categories of the targets include ships, oil tanks, and bridges.
[0123] In another embodiment, the target identification unit is further configured to:
[0124] Inputting images in the SAR image data set into the teacher network model for pre-training to obtain a teacher model weight file;
[0125] The student network model is distilled and learned on the SAR image dataset based on the teacher model weight file, the training parameters are set and the parameters in the student network model are iteratively updated based on the optimizer to obtain the weight parameter file, and a lightweight SAR image detection model is constructed according to the weight parameter file.
[0126] In another embodiment, the loss function L of the student network model in the distillation learning process based on the teacher model weight file on the SAR image dataset is Shape-IoU The calculation formula is as follows:
[0127]
[0128]
[0129]
[0130]
[0131]
[0132] L Shape-IoU =1-IoU+distance shape +0.5×Ω shape
[0133] Where IoU represents the intersection over union ratio between the predicted box and the true box, scale is the scaling factor, which is related to the proportion of the target in the dataset, and w gt and h gt represents the width and height of the real bounding box, (x c ,y c ) is the coordinate of the center point of the prediction box, is the coordinate of the center point of the real box, c represents the diagonal distance of the minimum bounding box between the predicted box and the real box, B represents the area occupied by the predicted box, and B gt represents the area occupied by the real box, ww and hh are the weight coefficients in the horizontal and vertical directions respectively, and distance shape represents the center point distance loss, Ω shape represents the bounding box shape loss, ω t It means calculating the difference in width between the two boxes and the ratio of their maximum widths (same for height) and adding ww and hh metrics respectively.
[0134] In another embodiment, the target identification unit is further configured to:
[0135] The performance of the lightweight SAR image detection model is evaluated using the set evaluation objectives. The evaluation indicators include precision, recall, and average precision (mAP). The calculation formula is as follows:
[0136]
[0137]
[0138]
[0139]
[0140] Among them, TP is the number of positive classes predicted as positive classes, FP is the number of negative classes predicted as positive classes, FN is the number of positive classes predicted as negative classes, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, P ... i is the average accuracy of the indexed category.
[0141] It should be noted that the lightweight SAR image multi-type target detection device based on knowledge distillation provided in the above embodiment and the lightweight SAR image multi-type target detection method based on knowledge distillation provided in the aforementioned embodiment belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0142] Another aspect of the present application also provides an electronic device, including: a controller; a memory for storing one or more programs, which, when executed by the controller, performs the lightweight SAR image multi-type target detection based on knowledge distillation in the above-mentioned embodiments.
[0143] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0144] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0145] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0147] Another aspect of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the lightweight SAR image multi-type target detection method based on knowledge distillation as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0148] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the lightweight SAR image multi-type target detection method based on knowledge distillation provided in the above-mentioned various embodiments.
[0149] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0150] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0151] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A lightweight SAR image multi-type target detection method based on knowledge distillation, characterized in that: The method comprises: The YOLOv8 model is lightweight and improved by using the characteristics of SAR image targets; The improved YOLOv8 model is scaled to obtain two scales of models, namely a complex scale model and a lightweight scale model. The complex scale model is used as the teacher network and the lightweight scale model is used as the student network to build a knowledge distillation framework. In response to the acquired SAR image data set, the knowledge distillation framework is trained to obtain a lightweight SAR image detection model, and the lightweight SAR image detection model is used to identify multiple categories of targets in the SAR image.
2. The lightweight SAR image multi-type target detection method based on knowledge distillation according to claim 1 is characterized in that: The YOLOv8 model is lightweight and improved by using the characteristics of SAR image targets, including: In the C2f module of the backbone feature extraction network of the YOLOv8 model, PConv is introduced to replace the conventional Conv, and the point-by-point convolution PWConv is further attached to Pconv; Reconstruct the spatial pyramid pooling module of the YOLOv8 model, introduce SPPELAN and combine it with the lightweight MLCA attention mechanism to replace the SPPF module in the YOLOv8 model; An upsampling layer is added to the feature fusion part of the YOLOv8 model to use the feature map of the P2 scale for prediction. The YOLOv8 model includes a C2f module, and the RepVGGDW and EMA attention mechanisms are combined and integrated into the C2f module. RepVGGDW is used to structurally reparameterize the depth-separable convolutional layer to eliminate the computational and memory costs associated with jump connections during inference.
3. The lightweight SAR image multi-type target detection method based on knowledge distillation according to claim 1 is characterized in that: The distillation loss of the knowledge distillation framework is expressed as: Where T and S represent the teacher network and the student network respectively, y T and S They represent the activation map of the teacher network and the activation map of the student network respectively, c is the channel index, and Represent the activation maps of the corresponding channels of the teacher network and the student network respectively, It is used to convert activation values into probability distribution as follows: Where i is the spatial index, W, H are the width and height of the feature map, T is a hyperparameter, exp is an exponential function with the natural constant e as the base, and y c,i is the activation value of the indexed pixel, The difference between the channel distributions used to evaluate the teacher network and the student network is shown below: Where C is the number of channels.
4. The lightweight SAR image multi-type target detection method based on knowledge distillation according to claim 1 is characterized in that: The categories of targets include ships, oil tanks, and bridges.
5. The lightweight SAR image multi-type target detection method based on knowledge distillation according to claim 1 is characterized in that: In response to the acquired SAR image data set, the knowledge distillation framework is trained to obtain a lightweight SAR image detection model, and the lightweight SAR image detection model is used to identify multiple categories of targets in the SAR image, specifically including: Inputting images in the SAR image data set into the teacher network model for pre-training to obtain a teacher model weight file; The student network model is distilled and learned on the SAR image dataset based on the teacher model weight file, the training parameters are set and the parameters in the student network model are iteratively updated based on the optimizer to obtain the weight parameter file, and a lightweight SAR image detection model is constructed according to the weight parameter file.
6. The lightweight SAR image multi-type target detection method based on knowledge distillation according to claim 4 is characterized in that: The loss function L of the student network model in the distillation learning process based on the teacher model weight file on the SAR image dataset Shape-IoU The calculation formula is as follows: L Shape-IoU =1-IoU+distance shape +0.5×Ω shape Where IoU represents the intersection over union ratio between the predicted box and the true box, scale is the scaling factor, which is related to the proportion of the target in the dataset, and w gt and h gt represents the width and height of the real bounding box, (x c ,y c ) is the coordinate of the center point of the prediction box, is the coordinate of the center point of the real box, c represents the diagonal distance of the minimum bounding box between the predicted box and the real box, B represents the area occupied by the predicted box, and B gt represents the area occupied by the real box, ww and hh are the weight coefficients in the horizontal and vertical directions respectively, and distance shape represents the center point distance loss, Ω shape represents the bounding box shape loss, ω t It means calculating the difference between the widths of the two boxes and the ratio of their maximum widths and adding the ww and hh metrics respectively.
7. The lightweight SAR image multi-type target detection method based on knowledge distillation according to claim 4 is characterized in that: The method further comprises: The performance of the lightweight SAR image detection model is evaluated using the set evaluation objectives. The evaluation indicators include precision, recall, and average precision (mAP). The calculation formula is as follows: Among them, TP is the number of positive classes predicted as positive classes, FP is the number of negative classes predicted as positive classes, FN is the number of positive classes predicted as negative classes, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, n is the number of target categories, i is the category index, AP is the average accuracy, P(R) is the precision and recall curve, P ... i is the average accuracy of the indexed category.
8. A lightweight SAR image multi-type target detection device based on knowledge distillation, characterized in that: include: A model improvement unit, configured to perform lightweight improvements on the YOLOv8 model using the characteristics of the SAR image target; The framework construction unit is configured to scale the improved YOLOv8 model to obtain two scale models, namely, a complex scale model and a lightweight scale model, and use the complex scale model as the teacher network and the lightweight scale model as the student network to construct a knowledge distillation framework; The target recognition unit is configured to train the knowledge distillation framework in response to the acquired SAR image data set to obtain a lightweight SAR image detection model, and use the lightweight SAR image detection model to recognize multiple categories of targets in the SAR image.
9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by the controller, enables the controller to implement the lightweight SAR image multi-type target detection method based on knowledge distillation as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the lightweight SAR image multi-type target detection method based on knowledge distillation as described in any one of claims 1 to 7.
Citation Information
Cited By
Indoor fire detection and automatic fire extinguishing method and system based on deep learning
CN118762330A
Deep learning tree lodging identification method and device, electronic equipment and program product
CN119360141A
Tree fall identification method, device, electronic device and program product based on deep learning
CN119360141B
Small target detection method and system based on feature fusion
CN119418037A
Tile product surface defect detection method based on SAPC-Net network
CN119887727A
