A small target detection method based on lossless feature fusion and focused IoU loss

CN119359991BActive Publication Date: 2026-10-27CHONGQING UNIV OF TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411357896.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2026-10-27
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

[0003]但检测小目标相比常规尺寸目标而言,存在检测精度低的问题,而导致小目标检测困难的根本原因是其分辨率过低,致使其可利用特征少

Benefits of technology

[0059]本发明通过增加小目标检测分支并且结合无损耗特征信息的下采样卷积方法,即多尺度无损特征融合策略,称为MLF,以增强小目标特征信息融合与保留能力;同时为提升SIoU收敛效果与速度并使其适应普通质量样本的损失贡献度,提出了聚焦惩罚项IoU,即FocalP-IoU,并应用于SIoU中,通过设计动态的聚焦于惩罚项的参数,以惩罚项值衡量样本质量,并以此为小目标普通质量样本提供损失贡献度,同时,引入中心点直线距离收敛与修正其角度成本与距离成本收敛方向,以加快对小目标的收敛;通过以上方法,有望缓解小目标检测中存在的问题,并提升小目标检测的性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359991B_ABST
    Figure CN119359991B_ABST
Patent Text Reader

Abstract

The application discloses a small target detection method based on lossless feature fusion and focused IoU loss, and relates to the technical field of target detection.The application increases a small target detection branch and combines a down-sampling convolution method of lossless feature information, namely a multi-scale lossless feature fusion strategy, referred to as MLF, to enhance the small target feature information fusion and retention capability.Meanwhile, in order to improve the SIoU convergence effect and speed and make the loss contribution degree of the SIoU suitable for ordinary quality samples, a focused penalty term IoU, namely FocalP-IoU, is proposed and applied to the SIoU, the parameter of the penalty term is designed to be focused on dynamically, the sample quality is measured by the penalty term value, and the loss contribution degree of the small target ordinary quality sample is provided.Meanwhile, the central point straight line distance convergence is introduced, and the angle cost and distance cost convergence directions are corrected, so that the convergence on the small target is accelerated.Through the above method, it is expected to alleviate the problems existing in the small target detection and improve the performance of the small target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, specifically to a small target detection method based on non-destructive feature fusion and focusing IoU loss. Background Technology

[0002] In recent years, with the further development of deep learning, small object detection has become one of the most important and challenging research directions in computer vision. The task of small object detection is to detect labeled small objects (less than 32×32 pixels) in images or videos. This technology has been widely used in scenarios such as autonomous driving, drone reconnaissance, large-scale surveillance systems, and defect detection.

[0003] However, detecting small targets suffers from lower accuracy compared to targets of regular size. The fundamental reason for the difficulty in detecting small targets is their low resolution, resulting in fewer usable features. Conventional methods struggle to extract effective feature information from small targets, and excessive conventional downsampling convolutions further diminish this feature information. Furthermore, IoU is more sensitive to positional deviations, leading to poor regression performance of the loss function, which is even more pronounced when dealing with smaller micro-targets (less than 16×16 pixels).

[0004] Existing methods for enhancing the feature information of small targets are few and ineffective, or they often address the feature information problem at the cost of using larger models. At the same time, the IoU loss function is more sensitive to the positional deviation of small targets, resulting in a shortage of high-quality samples, which contributes insufficiently to the loss. Mainstream IoU loss function methods pay too little attention to small targets, creating a significant gap in this type of method.

[0005] Therefore, a new solution is needed to address the above problems. Summary of the Invention

[0006] The purpose of this invention is to provide a small target detection method based on lossless feature fusion and focused IoU loss to solve the technical problems mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a small target detection method based on lossless feature fusion and focusing IoU loss, comprising at least the following steps:

[0008] S1: Obtain the small target image dataset and perform data preprocessing on the small target image dataset;

[0009] S2: Improve the Yolov8 network model and design a multiscale lossless feature fusion strategy (MLF) for model training;

[0010] S3: Based on the SIoU loss function, an improved focusing mechanism is introduced into SIoU, and a focusing penalty term IoU (Focal P-IoU) loss function is proposed;

[0011] S4: Input the training set image data into the built network, save the trained model, and finally load the model for model validation and real-time inference to obtain the detection results.

[0012] Furthermore, the small target image dataset in step 1 uses the VisDrone-2019, AI-TOD, and Pascal VOC datasets, and is divided into training set, validation set, and test set in ratios of 7:1:2, 4:1:5, and 5:0:5, respectively.

[0013] Furthermore, the data preprocessing of the small target image dataset in step 1 includes at least the following steps: converting the obtained JSON or XML format tags into TXT format tags and performing normalization processing.

[0014] Furthermore, S2 includes at least the following steps:

[0015] First, the input image passes through the feature extraction backbone network, and the size is continuously reduced to 160×160, 80×80, 40×40, 20×20, while the number of channels is continuously increased, forming feature maps of different levels C2, C3, C4, and C5.

[0016] Secondly, FPN performs top-down upsampling, upsampling from a 20×20 feature map to 40×40 and 80×80 feature maps, and then adds an additional upsampling to obtain a 160×160 feature map.

[0017] Subsequently, in the bottom-up downsampling process of the next FPN, feature maps of size 80×80, 40×40, and 20×20 are obtained by downsampling from the 160×160 feature map.

[0018] Next, the feature maps of the corresponding layers C2, C3, C4, and C5 are stitched together. In the network head part, there are detection heads P2, P3, P4, and P5, which are respectively used to detect targets larger than 4×4, 8×8, 16×16, and 32×32.

[0019] The downsampling uses a convolutional method based on Space-to-Depth (SPD), where the feature dimension of the input feature map X is S×S×C. input ;

[0020] Where S×S represents the feature map size, C input Given the number of input channels, this lossless feature extraction method involves slicing each S×S feature map in X with a stride of 2 in both the horizontal and vertical directions, resulting in four groups of S×S feature maps. The feature maps are then concatenated into a set. The feature map is finally reduced in dimension by a 1×1 Conv channel.

[0021] Finally, the newly added small target detection branch and the lossless feature downsampling method of SPD are combined into a multi-scale lossless feature fusion strategy, which enhances the feature information of small targets while reducing the loss of feature information, thereby improving the detection performance of small targets.

[0022] Furthermore, the improvement based on the SIoU loss function in step 3 includes at least the following steps:

[0023] First, SIoU consists of four parts: IoU, angle cost (Λ), distance cost (Δ), and shape cost (Ω). IoU represents the intersection-union ratio of two rectangles, angle cost (Λ) represents the angle cost, distance cost (Δ) represents the distance cost, and shape cost (Ω) represents the shape cost, defined as follows:

[0024]

[0025] Ω represents the shape cost in SIoU, and Δ is specifically defined as follows:

[0026]

[0027] Where γ = 2 - Λ, γ represents 2 minus the angle cost, Λ represents the angle cost used for the angle between convergence frames, and ρ t The ratio of the difference between the x and y coordinates of the center points of the boxes to the height and width of the smallest bounding rectangle is used to converge the distance between the boxes, as shown in the following formula:

[0028]

[0029] Where σ represents the straight-line distance from the center point, d h The difference in the ordinates of the center points is represented by the following formula:

[0030]

[0031] in, The y-coordinate of the center point of the label box, b cyThis represents the y-coordinate of the center point of the prediction box;

[0032] Meanwhile, in the distance cost Δ, ρ t The ratio of the difference between the x and y coordinates of the center points between the boxes to the height and width of the smallest bounding rectangle is calculated using the following formula:

[0033]

[0034] Where ρ x and ρ y Representing ρ t The calculation method in the x and y coordinate directions, The x-coordinate of the center point of the label box, b cx This represents the x-coordinate of the center point of the prediction box. The y-coordinate of the center point of the label box, b cy c represents the y-coordinate of the center point of the prediction box. w c represents the width of the smallest bounding rectangle. h This represents the height of the smallest bounding rectangle;

[0035] And in DIOU R DIoU It is a central distance convergence method, R DIoU It is expressed as the ratio of the straight-line distance between the center points of the two frames to the length of the diagonal of the smallest bounding rectangle, as shown in the following formula:

[0036]

[0037] Where ρ 2 (b,b gt ) represents the square of the straight-line distance between the center points of the two boxes, and b represents the center point of the predicted box. gt c represents the center point of the label box. 2 This represents the square of the length of the diagonal of the circumscribed rectangle;

[0038] To further improve the convergence performance of distance cost in SIoU for small target detection, R0 DIou We introduce distance cost as a convergence method for the distance between the center points, as shown in the following formula:

[0039] γ=2-Λ

[0040]

[0041] Where Δ is the distance cost, Λ is the angle cost, γ is 2 minus the angle cost, and ρ z ρ represents the straight-line distance between the center points. z In and b cx , and b cy , and c w 2 and c h 2 All of these have been explained above.

[0042] Furthermore, step 3, introducing an improved focusing mechanism in SIoU, includes at least the following steps:

[0043] First, the static focusing mechanism of EIoU is based on IoU. γ As a weighting factor in the loss function, it is used to focus on high-quality samples with high IoU values ​​with the Ground Truth bounding box, as shown in the following formula:

[0044] L Foacal-EioU =IoU γ L EIoU

[0045] Among them, IoU γ This indicates that IoU is expressed with respect to γ, where γ represents a static parameter, L EIoU Indicates EIoU loss.

[0046] Secondly, the focusing mechanism will be introduced into SIoU as follows:

[0047] L Fpcal-SIoU =IoU γ L SIoU

[0048] Among them, IoU γ This indicates that IoU is expressed with respect to γ, where γ represents a dynamic parameter, L SIoU Indicates SIoU loss.

[0049] Furthermore, γ is modified to be the penalty term value, γ = angle cost - 2 or γ = -distance cost. Based on this, a focus penalty term IoU loss is proposed and called FocalP-IoU. This dynamic parameter form gives the SIoU loss function dynamic weighting, which is used to give less attention to high-quality samples in small targets, thereby focusing on samples of average quality in small targets.

[0050] Furthermore, the convergence gradient directions of angle cost and distance cost in the modified SIoU include at least the following steps:

[0051] First, angle cost, as a key part of distance cost, first converges the angle cost to flatten the two boxes to a horizontal or vertical state, while the distance cost converges the distance between the center points of the two boxes.

[0052] Secondly, during the actual SIoU convergence process, the distance cost continuously decreases, while the angle cost does not decrease accordingly. That is, the distance between the center points of the two boxes continuously shrinks, but the angle remains at 45 degrees, which cannot achieve the goal of flattening the two boxes to a horizontal or vertical state.

[0053] Therefore, the angle cost is improved to converge in the same direction as the distance cost, and γ in the distance cost is modified to γ ​​= Λ. 2 +1, and this does not change the original range of γ in distance cost, γ∈[1,2], as shown below:

[0054] γ=Λ 2 +1

[0055] Where Δ is the distance cost, Λ 2 ρ is the square of the angle cost, γ is the square of the angle cost plus one, and ρ is the square of the angle cost. t It is the ratio of the difference between the horizontal and vertical coordinates of the center point between the boxes to the height and width of the smallest bounding rectangle, and its calculation method is as described above.

[0056] Furthermore, step 4 includes at least the following steps:

[0057] The input training set is processed by an improved YOLOv8n network model for feature extraction and fusion, and the head output is detected. After training is completed, the optimal weight model is saved, the weight model is loaded, and the input is used to test the accuracy of the validation or test set.

[0058] Compared with the prior art, the beneficial effects of the present invention are:

[0059] This invention enhances the fusion and preservation of small target feature information by adding a small target detection branch and combining it with a lossless feature information downsampling convolution method, namely a multi-scale lossless feature fusion strategy called MLF. Simultaneously, to improve the convergence effect and speed of SIoU and adapt it to the loss contribution of ordinary quality samples, a focus penalty term IoU, namely FocalP-IoU, is proposed and applied to SIoU. By designing dynamically focused parameters for the penalty term, the penalty term value measures the sample quality and provides a loss contribution for ordinary quality samples of small targets. Furthermore, it introduces convergence of the center point's linear distance and corrects the convergence direction of its angular cost and distance cost to accelerate convergence for small targets. Through these methods, it is expected to alleviate the problems existing in small target detection and improve its performance. Attached Figure Description

[0060] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is a flowchart illustrating a specific embodiment of the small target detection method of the present invention;

[0062] Figure 2 This is a schematic diagram of a non-destructive feature downsampling method according to a specific embodiment of the present invention;

[0063] Figure 3 This is a diagram of the improved YOLOv8 multi-scale lossless feature network structure according to a specific embodiment of the present invention.

[0064] Figure 4 Introducing R into SIoU as a specific embodiment of the present invention DIoU Improved distance cost diagram;

[0065] Figure 5 (a) is a graph showing the relationship between IoU and angle cost during SIoU convergence in a specific embodiment of the present invention;

[0066] Figure 5 (b) is a graph showing the relationship between IoU and distance cost during SIoU convergence in a specific embodiment of the present invention;

[0067] Figure 6 (a) is a graph showing the relationship between angle cost and distance cost before the improvement of the convergence direction in SIoU according to a specific embodiment of the present invention;

[0068] Figure 6 (b) is a graph showing the relationship between angle cost and distance cost after the convergence direction is improved in SIoU according to a specific embodiment of the present invention.

[0069] Figure 7 (a) is a diagram showing the convergence relationship between angle cost and distance cost in SIoU before the convergence direction improvement in a specific embodiment of the present invention;

[0070] Figure 7 (b) is a diagram showing the convergence relationship between angle cost and distance cost in SIoU after the convergence direction is improved in a specific embodiment of the present invention. Detailed Implementation

[0071] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0072] Reference Figures 1 to 7 A small target detection method based on lossless feature fusion and focusing IoU loss, wherein, Figure 1 The flowchart illustrating the small target detection method provided by a specific embodiment of the present invention is shown below, and the specific steps are as follows:

[0073] Training phase

[0074] A small target detection method based on lossless feature fusion and focusing IoU loss includes the following steps:

[0075] Step 1: Obtain small object detection datasets, including VisDrone-2019, AI-TOD, and PascalVOC datasets, and divide them into training, validation, and test sets in ratios of 7:1:2, 4:1:5, and 5:0:5, respectively; at the same time, convert the obtained JSON or XML format labels to TXT format labels and perform normalization processing.

[0076] Step 2: Improve the YOLOv8n network model by designing a multi-scale lossless feature fusion strategy for model training. The specific steps are as follows:

[0077] First, the input image passes through the feature extraction backbone network, and the size is continuously reduced to 160×160, 80×80, 40×40, 20×20, while the number of channels is continuously increased, forming feature maps of different levels C2, C3, C4, and C5.

[0078] Secondly, FPN performs top-down upsampling, upsampling from a 20×20 feature map to 40×40 and 80×80 feature maps, and then adds an additional upsampling to obtain a 160×160 feature map.

[0079] Subsequently, in the bottom-up downsampling process of the next FPN, feature maps of size 80×80, 40×40, and 20×20 are obtained by downsampling from the 160×160 feature map.

[0080] Next, the feature maps of the corresponding layers C2, C3, C4, and C5 are stitched together. In the network head part, there are detection heads P2, P3, P4, and P5, which are respectively used to detect targets larger than 4×4, 8×8, 16×16, and 32×32.

[0081] The downsampling module uses SPD-based convolution instead of conventional downsampling methods, where SPD stands for Space to Depth. Figure 2 As shown, the feature dimensions of the input feature map X are S×S×C input Where S×S represents the feature map size, C input Given the number of input channels, this lossless feature extraction method involves slicing each S×S feature map in X with a stride of 2 in both the horizontal and vertical directions, resulting in four groups of S×S feature maps. The feature maps are then concatenated into a set. The feature map is finally reduced in dimension by a 1×1 Conv channel.

[0082] Finally, the newly added small target detection branch and the lossless feature downsampling method of SPD are combined into a multi-scale lossless feature fusion strategy. This enhances the feature information of small targets while reducing the loss of feature information, thereby improving the detection performance of small targets. The improved network structure diagram is shown below. Figure 3 As shown.

[0083] Step 3: SIoU consists of four parts: IoU, angle cost (Λ), distance cost (Δ), and shape cost (Ω). IoU represents the intersection-union ratio of the two rectangles, angle cost (Λ) represents the angle cost, distance cost (Δ) represents the distance cost, and shape cost (Ω) represents the shape cost, defined as follows:

[0084]

[0085] Ω represents the shape cost in SIoU, and Δ is specifically defined as follows:

[0086]

[0087] Where γ = 2 - Λ, γ represents 2 minus the angle cost, Λ represents the angle cost used for the angle between convergence frames, and ρ t The ratio of the difference between the x and y coordinates of the center points of the boxes to the height and width of the smallest bounding rectangle is used to converge the distance between the boxes, as shown in the following formula:

[0088]

[0089] Where σ represents the straight-line distance from the center point, d h The difference in the ordinates of the center points is represented by the following formula:

[0090]

[0091] in, The y-coordinate of the center point of the label box, b cy This represents the y-coordinate of the center point of the prediction box;

[0092] Meanwhile, in the distance cost Δ, ρ t The ratio of the difference between the x and y coordinates of the center points between the boxes to the height and width of the smallest bounding rectangle is calculated using the following formula:

[0093]

[0094] Where ρ x and ρ y Representing ρ t The calculation method in the x and y coordinate directions, The x-coordinate of the center point of the label box, b cx This represents the x-coordinate of the center point of the prediction box. The y-coordinate of the center point of the label box, b cy c represents the y-coordinate of the center point of the prediction box. w c represents the width of the smallest bounding rectangle. h This represents the height of the smallest bounding rectangle;

[0095] And in DIOU R DIoU It is a central distance convergence method, R DIoU It is expressed as the ratio of the straight-line distance between the center points of the two frames to the length of the diagonal of the smallest bounding rectangle, as shown in the following formula:

[0096]

[0097] Where ρ 2 (b,b gt ) represents the square of the straight-line distance between the center points of the two boxes, and b represents the center point of the predicted box. gt c represents the center point of the label box. 2 This represents the square of the length of the diagonal of the circumscribed rectangle;

[0098] First, to further improve the convergence performance of distance cost in SIoU for small target detection, such as... Figure 4 As shown, R DIoU We introduce distance cost, which is modified from the original horizontal and vertical coordinate distance components between center points to the straight-line distance between center points. This is used as a convergence method for distance cost, as shown in the following formula:

[0099]

[0100] Where Δ is the distance cost, Λ is the angle cost, γ is 2 minus the angle cost, and ρ zρ represents the straight-line distance between the center points. z In and b cx , and b cy , and c w 2 and c h 2 All of these have been explained above;

[0101] Secondly, the static focusing mechanism of EIoU is based on IoU. γ As a weighting factor in the loss function, it is used to focus on high-quality samples with high IoU values ​​with the Ground Truth bounding box, as shown in the following formula:

[0102] L Focal-EIoU =IoU γ L EIoU

[0103] Among them, IoU γ This indicates that IoU is expressed with respect to γ, where γ represents a static parameter, L EIoU Indicates EIoU loss.

[0104] The focusing mechanism is introduced into SIoU as follows:

[0105] L Focal-SIoU =IoU γ L SIoU

[0106] Among them, IoU γ This indicates that IoU is expressed with respect to γ, where γ represents a dynamic parameter, L SIoU Indicates SIoU loss.

[0107] The penalty term γ is then modified to γ ​​= angle cost - 2 or γ = -distance cost. Since the loss function is converging, the penalty term should decrease as IoU increases; however, the penalty term may fluctuate locally and increase. The relationship between IoU and the changes in angle cost and distance cost (1 grid represents 10 pixels) is as follows: Figure 5 As shown in (a) and (b), using IoU alone to evaluate sample quality cannot fully realize the effect of the focal mechanism. However, using the penalty term value as the focusing parameter of IoU can better evaluate the quality of small target samples and give the loss function the corresponding contribution weight. This dynamic parameter gives the loss function dynamic weighting, which is used to give less attention to high-quality samples and thus focus on samples of ordinary quality.

[0108] Then, the angle cost, as a key part of the distance cost, first converges the angle cost to flatten the two boxes to a horizontal or vertical state. At the same time, the distance cost converges the distance between the center points of the two boxes. However, in the actual SIoU convergence process, the distance cost continuously decreases, but the angle cost does not decrease accordingly. That is, the distance between the center points of the two boxes continuously shrinks, but the angle is still 45 degrees, which cannot achieve the goal of flattening the two boxes to a horizontal or vertical state.

[0109] Therefore, the angle cost is improved to converge in the same direction as the distance cost, such as... Figure 6 In the diagram (a) and (b), the angle cost is shown to converge relative to the distance cost before and after the improvement. The γ in the distance cost is modified to γ ​​= Λ 2 +1, and this does not change the original range of γ in distance cost, γ∈[1,2], as shown below:

[0110] γ=Λ 2 +1

[0111] After modification, the convergence curve of angle cost is synchronized with that of distance cost, as shown below. Figure 7 (a) and (b) represent the situation before and after the improvement.

[0112] Step 4: Input the training set and perform feature extraction and feature fusion on the improved YOLOv8n network model. Detect the head output. After training is complete, save the optimal weight model, load the weight model, and input it into the validation set or test set for accuracy testing.

[0113] Verification phase

[0114] A small object detection method based on lossless feature fusion and focused IoU loss is presented. To verify the effectiveness of the algorithm, comparative experiments were conducted using the VisDrone2019 and AI-TOD datasets. All experiments were performed on the PyTorch framework, with YOLOv8n as the baseline model. The model parameters included a network depth factor of 0.33, a network width factor of 0.25, and a maximum number of channels of 1024. The hyperparameters were set to the default values ​​for YOLOv8n, with an initial learning rate of 0.01, an SGD optimizer, a weight decay of 0.0005, and a momentum of 0.937. The batch size was 8 and the training epochs were 300 on the VisDrone2019 dataset, while the batch size was 4 and the training epochs were 1500 on the AI-TOD dataset. The experimental results are shown in Tables 1 and 2.

[0115] Table 1 shows the experimental results on VisDrone 2019-val.

[0116]

[0117] Table 2 shows the experimental results on AITOD-test.

[0118]

[0119] Comparative experiments using YOLOv8n as the baseline model revealed significant improvements across multiple metrics. Subsequent comparative experiments on the two datasets above, against several mainstream methods, also yielded competitive results, all achieving high AP scores. t and AP vt The best results were obtained on the finger. This shows that the method can effectively improve the detection performance for small targets.

[0120] We designed ablation experiments to verify the individual contributions of MLF and FocalP-IoU methods, and to demonstrate their greater improvement when used together. The experimental design used YOLOv8n as a baseline, and each ablation experiment was conducted without changing any hyperparameters. The results are shown in Table 3.

[0121] Table 3 shows the ablation experimental results on VisDrone 2019-val.

[0122]

[0123] Compared to the baseline, using MLF can improve accuracy in AP. 50 With AP 50:95 There were increases of 2.1% and 1.5% respectively, and the AP of the small target was achieved. s AP t AP vt The metrics showed improvements of 2.9%, 3.2%, and 1.5% respectively, indicating that MLF can enhance and preserve the feature information of small targets. Although the improvement after applying the FocalP-IoU loss function was small, it could play a greater role when combined with the MLF method.

[0124] With the combined effect of the two methods, in AP 50:95 They achieved improvements of 3.3% and 2.2% respectively, and in the small target AP s AP t AP vt The metrics showed improvements of 3.1%, 3.5%, and 1.7% respectively, indicating that the proposed method can achieve higher performance in small target detection.

[0125] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A small target detection method based on lossless feature fusion and focusing IoU loss, characterized in that: At least the following steps are included: S1: Obtain the small target image dataset and perform data preprocessing on the small target image dataset; S2: Improve the Yolov8 network model and design a multi-scale lossless feature fusion strategy for model training; S3: Based on the SIoU loss function, an improved focusing mechanism is introduced into SIoU, and the FocalP-IoU loss function is proposed; Step 3, which involves improvements based on the SIoU loss function, includes at least the following steps: First, SIoU is composed of IoU and angle cost( ), distance cost ) and shape cost ( It consists of four parts, where IoU represents the intersection-union ratio of two rectangles, and angle cost( ) represents angle cost, distance cost ) represents distance cost, shape cost( () represents shape cost, which is defined as follows: Among them This is expressed as the shape cost in SIoU, while for The specific definitions are as follows: in = , This is expressed as 2 minus the angle cost. Indicates angular cost, used for the angle between convergent frames. This is the ratio of the difference between the x and y coordinates of the center points of the boxes to the height and width of the smallest bounding rectangle, used to converge the distance between the boxes. As shown in the formula below: in This represents the straight-line distance from the center point. The difference in the ordinates of the center points is represented by the following formula: in, This represents the y-coordinate of the center point of the label box. This represents the y-coordinate of the center point of the prediction box; At the same time, in terms of distance cost In The ratio of the difference between the x and y coordinates of the center points between the boxes to the height and width of the smallest bounding rectangle is calculated using the following formula: in and They represent The calculation method in the x and y coordinate directions, This represents the x-coordinate of the center point of the label box. This represents the x-coordinate of the center point of the prediction box. This represents the y-coordinate of the center point of the label box. This represents the y-coordinate of the center point of the prediction box. This represents the width of the smallest bounding rectangle. This represents the height of the smallest bounding rectangle; And in DIOU It is a central distance convergence method. It is expressed as the ratio of the straight-line distance between the center points of the two frames to the length of the diagonal of the smallest bounding rectangle, as shown in the following formula: in This represents the square of the straight-line distance between the center points of the two frames. Indicates the center point of the prediction box. Indicates the center point of the label box. This represents the square of the length of the diagonal of the circumscribed rectangle; To further improve the convergence performance of distance cost in SIoU for small target detection, We introduce distance cost as a convergence method for the distance between the center points, as shown in the following formula: in Similarly, distance cost For angle cost, The value is 2 minus the angle cost. This represents the straight-line distance from the center point. In and , and ,as well as and All of these have been explained above; S4: Input the training set image data into the built network, save the trained model, and finally load the model for model validation and real-time inference to obtain the detection results.

2. The small target detection method based on lossless feature fusion and focusing IoU loss according to claim 1, characterized in that: The small target image dataset in step 1 uses the VisDrone-2019, AI-TOD, and Pascal VOC datasets, and is divided into training, validation, and test sets in ratios of 7:1:2, 4:1:5, and 5:0:5, respectively.

3. The small target detection method based on lossless feature fusion and focusing IoU loss according to claim 2, characterized in that: The data preprocessing of the small target image dataset in step 1 includes at least the following steps: converting the obtained JSON or XML format tags into TXT format tags and performing normalization processing.

4. The small target detection method based on lossless feature fusion and focusing IoU loss according to claim 1, characterized in that: S2 includes at least the following steps: First, the input image passes through the feature extraction backbone network, and the size is continuously reduced to 160×160, 80×80, 40×40, 20×20, while the number of channels is continuously increased, forming feature maps of different levels C2, C3, C4, and C5. Secondly, FPN performs top-down upsampling, upsampling from a 20×20 feature map to 40×40 and 80×80 feature maps, and then adds an additional upsampling to obtain a 160×160 feature map. Subsequently, in the bottom-up downsampling process of the next FPN, feature maps of size 80×80, 40×40, and 20×20 are obtained by downsampling from the 160×160 feature map. Next, the feature maps of the corresponding layers C2, C3, C4, and C5 are stitched together. In the network head part, there are detection heads P2, P3, P4, and P5, which are respectively used to detect targets larger than 4×4, 8×8, 16×16, and 32×32. The downsampling uses a convolutional method based on Space-to-Depth (SPD), where SPD represents the space-to-depth feature dimension of the input feature map X. ; in Indicates the feature map size. Given the number of input channels, this lossless feature extraction method is suitable for... Each of the following sizes is The feature map is sampled in both horizontal and vertical directions with a step size of 2, resulting in four groups of size. The feature maps are then concatenated into a set. The feature map of 4 is finally passed through Conv channel dimensionality reduction to ; Finally, the newly added small target detection branch and the lossless feature downsampling method of SPD are combined into a multi-scale lossless feature fusion strategy, which enhances the feature information of small targets while reducing the loss of feature information, thereby improving the detection performance of small targets.

5. The small target detection method based on lossless feature fusion and focusing IoU loss according to claim 1, characterized in that: Step 3, which introduces an improved focusing mechanism in SIoU, includes at least the following steps: First, EIoU's static focusing mechanism is based on As a weighting factor in the loss function, it is used to focus on high-quality samples with high IoU values ​​with the Ground Truth bounding box, as shown in the following formula: in, Indicate IoU For index, Represented as static parameters, Indicates EIoU loss. Secondly, the focusing mechanism will be introduced into SIoU as follows: in, Indicate IoU For index, Represented as dynamic parameters, Indicates SIoU loss. And Change to penalty value. or Based on this, a focus penalty term IoU loss, called FocalP-IoU, is proposed. This dynamic parameter gives the SIoU loss function dynamic weighting, which is used to give less attention to high-quality samples in small targets, thereby focusing on samples of average quality in small targets.

6. The small target detection method based on lossless feature fusion and focusing IoU loss according to claim 5, characterized in that: The convergence gradient directions of angle cost and distance cost in the modified SIoU include at least the following steps: First, angle cost, as a key part of distance cost, first converges the angle cost to flatten the two boxes to a horizontal or vertical state, while the distance cost converges the distance between the center points of the two boxes. Secondly, during the actual SIoU convergence process, the distance cost continuously decreases, while the angle cost does not decrease accordingly. That is, the distance between the center points of the two boxes continuously shrinks, but the angle remains at 45 degrees, which cannot achieve the goal of flattening the two boxes to a horizontal or vertical state. Therefore, the angle cost is improved to converge in the same direction as the distance cost, and the distance cost is... Modified to And this does not change the original distance cost. The range of values ​​for , As shown below: in For distance cost, The square of the angle cost. It can be expressed as the square of the angle cost plus one. It is the ratio of the difference between the horizontal and vertical coordinates of the center point between the boxes to the height and width of the smallest bounding rectangle, and its calculation method is as described above.

7. The small target detection method based on lossless feature fusion and focusing IoU loss according to claim 1, characterized in that: Step 4 includes at least the following steps: The input training set is processed by an improved YOLOv8n network model for feature extraction and fusion, and the head output is detected. After training is completed, the optimal weight model is saved, the weight model is loaded, and the input is used to test the accuracy of the validation or test set.

Citation Information

Patent Citations

  • Small target detection method for images acquired by unmanned aerial vehicle based on improved YOLOv8 algorithm

    CN118628939A