A static blasting fragment detection method based on YOLO-FD network
By improving the structure and loss function of the YOLOv8 network, the YOLO-FD network can effectively detect static explosion fragments in complex backgrounds, solving the problems of false detection and missed detection from the perspective of UAVs, and achieving high-precision and efficient fragment detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN TECH UNIV
- Filing Date
- 2026-03-13
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies for detecting static explosive fragments, especially from the perspective of drones, suffer from false detections and missed detections. In particular, they lack detection accuracy in complex background environments and are difficult to effectively extract features of small targets.
The YOLO-FD network is adopted, and the CMUNEXt module is introduced into the backbone part of the YOLOv8 network, and the DyHeadV4 detection head is introduced into the head part. The Inner-DIoU loss function is used for training to improve the network's global information extraction capability and detection performance.
It improves the accuracy and speed of static fragment detection, reduces the probability of false detection and missed detection, and enhances detection efficiency and robustness.
Smart Images

Figure CN122336591A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of range testing technology and relates to static explosion damage testing of ammunition at the range, specifically to a static explosion fragment detection method based on YOLO-FD network. Background Technology
[0002] Currently, the main method for detecting static explosion fragments against a ground background involves manually recording fragment locations, calculating and statistically analyzing fragment distribution, and then analyzing the warhead's destructive power and damage range. Static explosion power experiments are now routine. As the final damaging unit in various munitions and missiles attacking enemy targets, the warhead's destructive power is a concentrated reflection of the weapon system's combat performance and a core issue of concern for weapon development and application departments. Existing manual static explosion fragment statistics methods suffer from low testing efficiency, poor accuracy, difficulty in obtaining key data, and difficulty in reproducing test results.
[0003] As an important direction for fragment parameter measurement, static explosion fragment detection methods based on the earth background and deep learning are currently attracting attention and are beginning to be applied in range tests to obtain relevant information and parameters of fragments, which are ultimately used for data analysis.
[0004] However, when dealing with large-scale, multi-scale small fragment targets and similar objects in images, target detection faces significant challenges in terms of accuracy. Images acquired by drones often contain a large amount of indistinguishable background information and numerous densely distributed small fragment targets. These fragment targets occupy a very small number of pixels in the image, making feature extraction from small image regions a very challenging operation, which can easily lead to false detections, misdetections, and recognition failures.
[0005] In the prior art, the application with application number "202511117138.4" discloses "A Small Target Detection Method for Warhead Fragments Based on FSOD-YOLOv8". This method replaces the C2f module with the C3k2 module on the basis of the YOLOv8n network and introduces Wasserstein Distance Loss as the loss function during training to realize the construction of the FSOD-YOLOv8 network. The application with application number "202510494908.0" discloses "A Small Target Detection Method for UAV Perspective Based on MRPCD-YOLOV8S". This method replaces the C2f module with the RGCSP module to achieve lightweighting, introduces the feature fusion modules MSAFM and CACM to extract small target features, replaces the ordinary convolution of the backbone network with RFCAConv convolution, removes the p5 detection layer and detection head, introduces the p2 detection head, and replaces the original detection head with a dynamic detection head to realize the construction of the MRPCD-YOLOV8S network.
[0006] Although the above algorithms can improve detection accuracy and speed and enhance lightweighting to a certain extent, they have the following problems for small targets such as static explosive fragments: (1) When the target to be detected occupies a relatively small proportion in the image, it is still not conducive to the network to extract information; (2) In a more complex background environment, the extraction of target features will interfere with the algorithm, thereby increasing the probability of false detection and false detection.
[0007] Designing a new method for detecting static explosive fragments to improve detection accuracy and overcome problems such as missed detection and false detection of static explosive fragments from the perspective of UAVs is an urgent problem to be solved. Summary of the Invention
[0008] This invention proposes a static explosion fragment detection method based on the YOLO-FD network to address the problem of increased false detection and false negative rates in existing technologies when the fragments occupy a relatively small proportion of the image and are in complex background environments.
[0009] To achieve the above objectives, this invention provides a static explosion fragment detection method based on a YOLO-FD network, comprising the following steps:
[0010] Step 1: Construct a static explosion fragment image dataset to obtain a training set, a validation set, and a test set;
[0011] Step 2: Construct and improve the YOLO-FD neural network model and train it:
[0012] (2.1) Constructing the YOLOv8 network model:
[0013] In the Backbone section, the C2f module is used instead of the C3 module in YOLOv5;
[0014] The Neck section uses a PAN structure with the 1×1 downsampling layer removed;
[0015] The Head section adopts a decoupled head, switches to the Anchor-Free method, and uses VFL Loss, DFL Loss, and CIOU Loss as loss functions;
[0016] (2.2) Constructing a YOLO-FD network based on the YOLOv8s network:
[0017] In the Backbone section, the CMUNEXt module is introduced to replace the C2f module used in step 2.1;
[0018] The constructed DyHeadV4 detection head is introduced in the Head section;
[0019] (2.3) Training the YOLO-FD network model:
[0020] Choose Inner-DIoU as the loss function during training;
[0021] Step 3: Input the acquired fragment images into the trained YOLO-FD network model, and output fragment images containing fragment detection boxes.
[0022] Furthermore, in step 2.2 above, the CMUNEXt module is introduced in the Backbone section to replace the original C2f module. This module performs one depthwise convolution and two pointwise convolutions on the input data: first, a large kernel depthwise convolution operation is used, with the number of groups equal to the number of channels, to extract global information for each channel, followed by a residual connection; then, two pointwise convolutions are performed, and the hidden dimension between the two pointwise convolutional layers is set to be four times wider than the input dimension to mix spatial and channel information.
[0023] Furthermore, the method for constructing the DyHeadV4 detection head in step 2.2 above is to integrate the DCNv4 operator into the DyHead detection head to construct the DyHeadV4 detection head.
[0024] Furthermore, the method for constructing the loss function in step 2.3 above is as follows:
[0025] By fusing DIoU and Inner-IoU, an Inner-DIoU loss function is proposed to improve the original YOLO-FD model training process, further enhancing the convergence speed and reliability of the network during training, and improving the model's detection performance.
[0026] Compared with the prior art, the advantages of the present invention are:
[0027] 1) In terms of neural network design, the YOLO-FD network is proposed. Based on the YOLOv8 network, the CMUNEXt module is introduced to replace the C2f module in the original network backbone. Through reasonable design, the lightweight nature is maintained and the ability of the convolutional network to extract global information is enhanced.
[0028] 2) The DCNv4 operator is integrated into the DyHead detection head to construct the DyHeadV4 detection head. The DyHeadV4 detection head is introduced to replace the Detect module in the original network Head, which speeds up the processing speed of target features during detection and enhances the network's detection performance for small targets.
[0029] 3) In terms of neural network training, the loss function is adjusted to Inner-DIoU, which improves the stability of network training and enhances the robustness of the network.
[0030] 4) The method of this invention first introduces the CMUNEXt module into the YOLOv8 network to replace the C2f module in the original network backbone, and further integrates the DCNv4 operator into the DyHead detection head to construct the DyHeadV4 detection head, thereby enhancing the detection performance of small targets. Then, during the network training phase, the loss function is adjusted to Inner-DIoU, and images acquired by a visible light camera mounted on a UAV are fed into the designed YOLO-FD network to detect fragments. This method is highly accurate and fast. It can effectively improve measurement efficiency, reduce the risk factor, and specifically solve the problem of missed and false detections of static explosive fragments from the perspective of UAVs. Attached Figure Description
[0031] Figure 1 This is a diagram of the improved neural network structure of the present invention;
[0032] Figure 2 Here is a diagram of the CMUneXt module structure;
[0033] Figure 3 This is a diagram showing the overall structure of the DyHeadV4 detection head;
[0034] Figure 4 This is a diagram showing the operational structure of the DCNv4 operator in the DyHeadV4 detection head;
[0035] Figure 5 This is a schematic diagram of DIoU in the Inner-DIoU loss function;
[0036] Figure 6 This is a schematic diagram of Inner-IoU in the Inner-DIoU loss function;
[0037] Figure 7 This is a graph of the loss function during training.
[0038] Figure 8 This is an image of a fragment containing a fragment detection bounding box. Detailed Implementation
[0039] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0040] This method includes the following steps: 1) Using a drone to collect fragment images against a ground background, constructing a static explosion fragment image dataset; 2) Proposing a YOLO-FD neural network model, and training the improved network model using the dataset; 3) Inputting the test set images from the dataset into the trained neural network, and outputting fragment images containing fragment detection boxes. See also... Figure 1This invention introduces the CMUNEXt module to replace the C2f module in the Backbone section; introduces the constructed DyHeadV4 detection head to replace the Detect module in the Head section; and selects Inner-DIoU as the loss function during training.
[0041] Example 1: This invention provides a static explosion fragment detection method based on a YOLO-FD network, specifically including the following steps:
[0042] Step 1: Construct a static explosion fragment image dataset:
[0043] (1.1) First, use a drone to photograph the fragments against the background of the ground to collect fragment images. Use Labelimg software to annotate the simulated fragment targets in the images and obtain a JSON format annotation file. After obtaining the JSON format annotation file, in order to facilitate subsequent training, convert the JSON format label file into a TXT format YOLO annotation file.
[0044] (1.2) The images and annotation files in the dataset are divided into training set, validation set, and test set in a ratio of 8:1:1. Among them, train is the training set, val is the validation set, and test is the test set, which includes images and labels respectively. images are images of simulated static explosion fragments, and labels are the annotation files of the corresponding simulated static explosion fragment images in the images folder.
[0045] Step 2: Build and train the YOLO-FD network model:
[0046] (2.1) Constructing the YOLOv8 network model:
[0047] This network model is built using the YOLOv8 network as the baseline model. In the YOLOv8 network, the backbone part borrows the idea of the CSP module, replacing the C3 module in YOLOv5 with the C2f module to achieve further weight reduction. At the same time, it retains the SPPF module in YOLOv5, which greatly improves the model performance. The neck part continues to use the PAN idea, but compared with YOLOv5, YOLOv8 removes the 1×1 downsampling layer. In the head part, YOLOv8 chooses a decoupled head to separate classification and detection, and also changes from Anchor-Based to Anchor-Free. The loss function calculation uses VFL Loss as the classification loss and DFL Loss + CIoU Loss as the regression loss.
[0048] YOLOv8 offers network models of different sizes (n / s / m / l / x), with differences mainly in model size, network structure, computational cost, accuracy, and inference speed. Based on comprehensive considerations, this invention selects YOLOv8s as the base network, and then improves and trains it upon it.
[0049] (2.2) Improve and construct the YOLO-FD network model, including the following two simultaneous improvement steps:
[0050] (1) In order to extract spatial and positional information of long distances in the image, the CMUNEXt module is introduced in the Backbone section to replace the original C2f module.
[0051] like Figure 2 As shown, this module employs large-kernel depthwise separable convolutions to extract global information and reduce parameters. Through reasonable design, it maintains a lightweight architecture, solving the problem of the difficulty in extracting global information in convolutional networks. This module performs one depthwise convolution and two pointwise convolutions on the input data: first, a large-kernel depthwise convolution operation with the number of groups equal to the number of channels is used to extract global information for each channel, followed by a residual connection; then, two pointwise convolutions are performed, with an inverted bottleneck design between these two pointwise convolution layers—that is, the hidden dimension between the two pointwise convolutional layers is set to be four times wider than the input dimension—to mix spatial and channel information. Therefore, adding the CMUneXt module to the backbone of the YOLOv8s model enhances the YOLOv8s model's ability to extract global information, more accurately and effectively detecting small fragment targets that may be partially occluded by the environment.
[0052] (2) The DCNv4 operator is integrated into the DyHead detection head to construct the DyHeadV4 detection head, and the DyHeadV4 detection head is introduced into the Head part to replace the original Detect module. The DyHead detection head is essentially a scale attention module π. L Spatial Attention Module π S Task Attention Module π C Modules composed of superpositions, such as Figure 3 As shown, when the DyHead module is added to the Head part of the YOLOv8s model, it is essentially based on the properties of the network, where the DyHead module is superimposed and then inserted into the network.
[0053] In the general case, given a feature tensor F∈R L×S×C The general formula for applying the self-attention mechanism is shown in Equation 1:
[0054] (1)
[0055] Here, π(x) is an attention function. A general solution for this attention function is implemented using fully connected layers. However, due to the high dimensionality of the feature tensor, directly learning an attention function across all dimensions is computationally prohibitive.
[0056] Therefore, the Dyhead module transforms the attention function into three sequentially ordered attention mechanisms, each focusing on only one aspect:
[0057] (2)
[0058] The Dyhead module first introduced the scale attention module π. L Features at different scales are dynamically fused based on semantic importance:
[0059] (3)
[0060] Here, f(x) is a linear function approximated by a 1×1 convolutional layer, while σ(x) = max(0, min(1, (x+1) / 2)) is a hard-sigmoid function.
[0061] Then the spatial attention module π was introduced. S It is used to focus on distinguishable regions that coexist consistently between spatial location and features.
[0062] Considering the high dimensionality in space, we decompose this module into two steps:
[0063] First, deformable convolutional sparse attention learning is used.
[0064] Then, features across levels are aggregated in the same spatial location:
[0065] (4)
[0066] Where K is the number of sparse sampling locations, p k +∆p k It is caused by the self-learning space offset ∆p k Focusing on the shift position of a distinct region, ∆m k It is position p k The self-learning importance scalar at F. Both are learned from the input features at the median level of F.
[0067] Finally, the task attention module π was introduced. C This enables joint learning and generalization of different object representations. Finally, we deployed a task-aware attention mechanism. This mechanism can dynamically switch between various functional channels to support different detection tasks.
[0068] (5)
[0069] Since the three attention mechanisms mentioned above are applied sequentially, formulas can be nested multiple times, thereby effectively managing multiple π... L π S π C Stacked together.
[0070] Replace the convolutions in the DyHead module with the DCNv4 operator, which is designed for a wide range of vision applications, such as... Figure 4 As shown, DCNv4 has two important enhancements compared to its predecessor DCNv3: 1) removing softmax normalization in spatial aggregation to enhance its dynamism and expressiveness; 2) optimizing memory access to minimize redundant operations, thereby speeding up the process. These improvements significantly accelerate convergence and greatly improve processing speed; DCNv4's forward processing speed is more than three times that of DCNv3.
[0071] (2.3) Training the YOLO-FD network model:
[0072] Inner-DIoU is introduced as the loss function during training. By fusing DIoU and Inner-IoU, the Inner-DIoU loss function is proposed, which improves the original YOLO-FD model training process, further enhancing the convergence speed and reliability of the network during training, and improving the model's detection performance.
[0073] To directly minimize the normalized distance between the predicted bounding box and the ground truth bounding box, and to achieve faster convergence and more accurate and faster regression, the DIoU loss function is introduced to achieve the above two objectives.
[0074] Minimizing the standardized distance between the center points of the two bounding boxes, the penalty term can be defined as:
[0075] (6)
[0076] Where b and b gt Represent b and b gt The center point is denoted by ρ(x), which is the Euclidean distance, and c is the diagonal length of the minimum bounding box covering the two boxes. The DIoU loss function is defined as follows:
[0077] (7)
[0078] like Figure 5 As shown, the penalty term of the DIoU loss directly minimizes the distance between the two center points, while the purpose of the GIoU loss is to reduce C−B∪B. gt The area of B, where C is the area covering B and B'.gt The smallest box. Figure 5 The normalized distance between the inner center points can be directly minimized. c is the diagonal length of the minimum bounding box covering both diagrams, and d = ρ(b, b...). gt ) is the distance between the center points of the two diagrams.
[0079] To accelerate the convergence of the loss function, a fusion of Inner-IoU and DIoU is proposed, introducing the Inner-DIoU loss function. This method uses a scaling factor to control the generation of auxiliary boxes at different scales for loss calculation. Applying it to existing IoU-based loss functions yields faster and more efficient regression results. Inner-IoU is defined as follows:
[0080] (8)
[0081] in, This represents the x-coordinate of the left boundary of the true bounding box. This represents the x-coordinate of the right boundary of the true bounding box. This represents the y-coordinate of the upper boundary of the true bounding box. This represents the y-coordinate of the lower boundary of the true bounding box. This represents the x-coordinate of the left boundary of the prediction box. This represents the x-coordinate of the right boundary of the prediction box. This represents the y-coordinate of the upper boundary of the prediction box. This represents the y-coordinate of the lower boundary of the prediction box. Represents the center coordinates of the true bounding box and the inner bounding box, (x c ,y c ) represents the coordinates of the center point of the prediction box and its inner bounding box, w gt and h gt represents the width and height of the ground truth bounding box, w and h represent the width and height of the predicted bounding box, ratio represents the scaling factor, which ranges from [0.5, 1.5]. The auxiliary box is a box generated by scaling down or enlarging the ground truth bounding box and the predicted bounding box according to the ratio. inter represents the area of the intersection region between the predicted bounding box and the auxiliary box, and union represents the area of the union region between the predicted bounding box and the auxiliary box. B gt B , These represent the ground truth bounding box, the predicted bounding box, the ground truth bounding box helper box, and the predicted bounding box helper box, respectively. Figure 6 As shown. Figure 6 middle, and These represent the width and height of the actual bounding box and the auxiliary bounding box, respectively. and These represent the width and height of the prediction box auxiliary box, respectively.
[0082] The Inner-IoU loss function inherits some characteristics from the IoU loss function and also has its own unique features. Similar to the IoU loss function, the Inner-IoU loss function has a range of [0,1]. Since the only difference between the auxiliary box and the actual box is scale, the Inner-IoU curve is similar to the IoU curve. Compared to the IoU loss function, when the scale factor is less than 1 and the auxiliary box size is smaller than the actual box, its effective regression range is smaller than that of the IoU loss function, but the absolute value of its gradient is greater than the gradient obtained by the IoU loss function, which can accelerate the convergence of high-IoU samples. Conversely, when the scale factor is greater than 1, the larger-scale auxiliary box expands the effective regression range and brings some benefit to the regression of low-IoU samples.
[0083] The improved YOLO-FD network is trained using the training set from the dataset in step 1 until the loss function converges. The training is then completed, and the optimal network weight values are obtained by preliminary verification of relevant metrics using the test set.
[0084] The hyperparameters used during training were as follows: epochs = 200, batch size = 16, imgsz = 640, learner = Adam, lr0 = 0.001, lrf = 0.01. The loss function curve obtained during training is shown in Figure 7, which clearly shows the process of the loss function converging to near zero.
[0085] Step 3: Use the validation set of the dataset from Step 1 to validate the performance of the improved YOLO-FD network.
[0086] Images of static explosion fragments against the ground background were collected from the air above the static explosion site using a visible light camera mounted on a drone. Under the same experimental dataset, experimental conditions, and parameters, the detection results and performance indicators of the YOLO-FD network in Example 1 and the original YOLOv8s network were compared to verify the advantage of the YOLO-FD network in static explosion fragment detection accuracy.
[0087] The dataset obtained in step 1 of Example 1 was used to train the YOLO-FD network of the present invention and the original YOLOv8s network, respectively. The hyperparameter settings during training were the same as in step (2.3).
[0088] The test set of the dataset in step 1 is used to input the YOLO-FD network and the original YOLOv8s network respectively. Precision, recall, and mAP@50 are used as network evaluation metrics to evaluate and compare the network performance.
[0089] (9)
[0090] (10)
[0091] Where TP represents the number of correctly identified positive samples, FN represents the number of misclassified or unidentified positive samples, and FP represents the number of negative samples misidentified as targets. For each class, a PR curve can be plotted based on recall and precision. The area between this curve and the coordinate axis is the AP value. mAP is the average value obtained by averaging the AP of all classes. Therefore, the mAP value comprehensively considers the model's precision and recall, and can be combined with each other to more comprehensively evaluate the model's performance.
[0092] Analyze the training results:
[0093] The acquired fragment images are input into the trained, improved YOLO-FD network model, and the output is a fragment image containing fragment detection boxes, as shown below. Figure 8 As shown, all the fragments in the image have been accurately detected.
[0094] Precision, recall, and mAP@50 were used as network evaluation metrics to compare the performance of the two networks. Table 1 shows the training results of the comparative experiment between the YOLO-FD network and the original YOLOv8s network. Compared with the original YOLOv8s network, the proposed YOLO-FD network improves precision by 5.5%, recall by 9.7%, and mAP@50 by 6.4%, making it suitable for the static fragment detection task in the environment of this invention.
[0095] Table 1 Comparative Experiment Training Results
[0096] Test Network Precision (P) Recall rate (R) mAP@50 YOLOv8s 0.793 0.678 0.798 YOLO-FD 0.848 0.775 0.862
[0097] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A method for detecting static explosion fragments based on YOLO-FD networks, characterized in that: Includes the following steps: Step 1: Construct a static explosion fragment image dataset to obtain a training set, a validation set, and a test set; Step 2: Construct and improve the YOLO-FD neural network model for training: (2.1) Constructing the YOLOv8 network model: In the Backbone section, the C2f module is used instead of the C3 module in YOLOv5; The Neck section uses a PAN structure with the 1×1 downsampling layer removed; The Head section adopts a decoupled head, switches to the Anchor-Free method, and uses VFL Loss, DFL Loss, and CIOULoss as loss functions; (2.2) Constructing a YOLO-FD network based on the YOLOv8s network: In the Backbone section, the CMUNEXt module is introduced to replace the C2f module used in step (2.1); The constructed DyHeadV4 detection head is introduced in the Head section; (2.3) Training the YOLO-FD network model: Choose Inner-DIoU as the loss function during training; Step 3: Input the acquired fragment images into the trained YOLO-FD network model, and output fragment images containing fragment detection boxes.
2. The static explosion fragment detection method based on YOLO-FD network according to claim 1, characterized in that: In step (2.2), the CMUNEXt module is introduced in the Backbone section to replace the original C2f module. This module performs one depthwise convolution and two pointwise convolutions on the input data: first, a large kernel depthwise convolution operation is used, with the number of groups equal to the number of channels, to extract global information for each channel, followed by a residual connection; then, two pointwise convolutions are performed, and the hidden dimension between the two pointwise convolution layers is set to be four times wider than the input dimension, to mix spatial and channel information.
3. The static explosion fragment detection method based on YOLO-FD network according to claim 1, characterized in that: The method for constructing the DyHeadV4 detection head in step (2.2) is to integrate the DCNv4 operator into the DyHead detection head to construct the DyHeadV4 detection head.
4. The static explosion fragment detection method based on YOLO-FD network according to claim 1, characterized in that: The method for constructing the loss function in step (2.3) is as follows: By fusing DIoU and Inner-IoU, an Inner-DIoU loss function is proposed to improve the training process of the original YOLO-FD model.