YOLOv8 small target detection method based on SENet

By introducing semantic dilution loss and the SENet structure, a small object detection method is constructed, which solves the problems of unstable channel response and scale consistency in YOLOv8 in small object detection, and achieves higher detection accuracy and stability, which is suitable for complex backgrounds and dense small object scenes.

CN120783028BActive Publication Date: 2026-06-02HEBEI UNIV OF ENG

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEBEI UNIV OF ENG
Filing Date
2025-07-04
Publication Date
2026-06-02

Smart Images

  • Figure CN120783028B_ABST
    Figure CN120783028B_ABST
Patent Text Reader

Abstract

The application relates to a small target detection method based on an improved YOLOv8 of an SENet, introduces a semantic dilution loss, measures the dilution degree of small target features in a channel, generates a suppression reverse weight through an SENet structure, suppresses a background redundancy while reserving a high response area, integrates a C2f structure of the YOLOv8 to transfer decoupled features in cross-layer connection, constructs an SENet response migration relationship in a Neck feature pyramid, calculates a weight offset value to judge whether spatial offset of small target response occurs, introduces a position balance loss to perform feature repositioning on a small target area with excessive center of gravity drift, designs a channel response consistency measurement index to measure the consistency of SE responses of small targets between different epochs, extracts SENet channel outputs from an image, and counts the variance of channel response distribution of a target area, weakens or suppresses channels with high variability from a current image detection path, introduces a channel gating mechanism into a detection head, adaptively selects stable channels to participate in prediction, and significantly enhances the feature representation capability of small targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for detecting small targets, specifically a method for detecting small targets based on SENet and improved YOLOv8. Background Technology

[0002] Regarding small target detection methods, the existing Chinese patent CN118552716A, "A Small Target Detection Method Based on Improved YOLOv8," proposes a solution that introduces ATDeNet to replace the original backbone structure of YOLOv8, constructing a deep neural network model more suitable for small target detection. This method, based on the requirements of both detection accuracy and training efficiency, improves the detection performance of small targets and constructs a complete data processing and model training pipeline through a standardized training process, thus addressing to some extent the problem of insufficient detection accuracy of traditional YOLOv8 when facing low resolution, small target size, and dense distribution. However, current methods still have several key shortcomings and technical blind spots in terms of the stability of channel responses, scale consistency, and perceptual control of multi-scale fusion responses for small targets. First, although this scheme replaces YOLOv8's backbone with ATDeNet and improves its feature extraction capabilities, it does not fundamentally introduce a fine-grained channel-level response control mechanism. Its feature flow still relies on convolution stacking and dilated convolution to obtain contextual information, lacking a strategy to focus on the local response of small targets. Since small targets are extremely small in size in the image, their key information is easily buried or ignored in high-level semantic abstraction. Therefore, there is a lack of a mechanism to filter and dynamically adjust important channels in the early stage of feature extraction, which cannot effectively suppress the interference of high-response background channels on small target feature channels, nor does it consider the impact of inter-channel response fluctuations on the stability of small target recognition.

[0003] Secondly, the training method used in this scheme still adopts the traditional data partitioning and whole-image training approach, without introducing modeling of cross-scale response behavior in the small target detection process. Currently, in the YOLOv8 architecture, small targets are prone to response drift during the scale compression process in the Neck module. That is, the response center position, activation channel, and directionality of the same target are inconsistent in feature maps at different scales, which leads to localization errors and response direction disorder in the fusion process. Existing technologies do not provide corresponding inter-scale response migration tracking mechanisms, nor do they propose cross-scale feature consistency alignment methods. As a result, their models are unable to effectively eliminate the semantic incoherence caused by scale switching during feature fusion, especially in dense small target scenarios, where target misjudgment, overlapping detection, or localization deviation are more likely to occur. Furthermore, although this invention replaces the backbone network structure to improve the overall extraction capability, it still fails to address the issue of unstable responses from small targets during the training process. In particular, during multiple training rounds, some small targets may experience frequent fluctuations in channel responses and chaotic attention shifts due to data occlusion, uneven distribution, or sample noise. In traditional training strategies, this phenomenon is mistakenly identified by the model as low-confidence samples and weakened, ultimately leading to missed detections or low-precision identification. This technology does not propose targeted solutions, such as channel response consistency analysis, dynamic labeling of unstable targets, or the introduction of gradient regulation and repair mechanisms. It also lacks the ability to model the response trajectory of small targets across training rounds and cannot adjust subsequent training paths based on historical channel response behavior.

[0004] Furthermore, from the perspective of detection head structure and output control, this scheme still mainly adopts the YOLOv8 Anchor-Free detection head structure. Its core prediction branch does not introduce a response gating mechanism, nor does it dynamically adjust the channel participation based on the personalized features of the target in the image. Therefore, it adopts a uniform feature fusion and output method for all targets in each image, lacking image-level channel cropping or channel confidence adjustment strategies. This results in problems such as low channel utilization and false detection caused by unstable channels during the detection process. When facing large background interference, low contrast scenes, or heterogeneous feature regions, the response of small targets is easily submerged by background noise, resulting in decreased detection accuracy and limited model generalization ability. Summary of the Invention

[0005] The purpose of this invention is to provide a small target detection method based on SENet and improved YOLOv8, thereby addressing some of the drawbacks and shortcomings pointed out in the background art.

[0006] The present invention addresses the aforementioned technical problems by employing the following technical solution: an improved YOLOv8 small target detection method based on SENet, comprising: introducing semantic dilution loss to measure the dilution degree of small target features in the channel; for small target feature channels, generating suppression inverse weights through the SENet structure to retain high-response regions while suppressing background redundancy; and incorporating the C2f structure of YOLOv8 to pass decoupled features in cross-layer connections.

[0007] In the Neck feature pyramid, SENet response migration relationships are constructed; the weight offset values ​​between the current scale and the upper / lower scales are calculated to determine whether the small target response has undergone spatial shift; a positional balance loss is introduced to relocalize the features of small target regions with excessive center of gravity drift.

[0008] Design a channel response consistency metric to measure the consistency of the SE response of small targets across different epochs; if the response of the same target drifts drastically, it is determined to be an unstable target, and response correction is performed through gradient guidance; construct a response consistency loss term to guide the network to converge to a stable small target representation path;

[0009] For each image, the SENet channel output is extracted, and the variance of the channel response distribution in the target region is calculated. Channels with high variability are weakened or suppressed from the current image detection path. The detection head introduces a channel gating mechanism to adaptively select stable channels to participate in prediction.

[0010] Furthermore, the method for calculating the weight offset value between the current scale and the upper / lower scale includes:

[0011] SENet modules are embedded in feature maps of different scales in the Neck structure to extract channel response weights of feature maps at each scale; the SENet channel responses at different scales are aligned in spatial coordinates by upsampling or downsampling.

[0012] Compare the changes in channel response weights between adjacent scales to construct scale response migration relationships; determine the degree of response shift of small target regions at different scales; if the shift exceeds a set threshold, it is determined that the region has spatial drift.

[0013] Compensation operations are performed on small target areas that exhibit drift, including channel enhancement or spatial refocusing.

[0014] Furthermore, the comparison of the channel response weight changes is based on the statistical analysis of the SE channel output of the same image region between two adjacent scales, calculating the directional change trend of its channel weights, and judging whether the small target response has shifted or attenuated based on the trend.

[0015] Furthermore, after determining the spatial drift, a regional weighting strategy is applied to the drift region, and an offset map is constructed to guide the channel weights of the region in subsequent feature fusion to be compensated and strengthened.

[0016] Furthermore, the gradient-guided response correction method includes the following steps:

[0017] S1. For the targets in the training samples, the SENet module embedded in the YOLOv8 network structure is used to extract the channel response weights of each target in each training round.

[0018] S2. Record and compare the channel responses of the same target in multiple training rounds to construct the target channel response trajectory; calculate the channel response consistency index of the target in the time dimension based on the channel response trajectory; if the response fluctuates drastically, the target is determined to be an unstable target.

[0019] S3. For targets deemed unstable, a gradient guidance mechanism is introduced in subsequent training, including strengthening the backpropagation gradient of the response channel, penalizing the weight response of irrelevant channels, and locally adjusting the learning rate of the target.

[0020] Furthermore, the channel response consistency index is based on the change in the activation distribution trend of each channel to the target in multiple training rounds, and is used to measure whether the channel attention is continuous and concentrated, thereby judging whether the target representation path is stable.

[0021] Furthermore, the gradient guidance mechanism includes any one or more of the following:

[0022] Assign greater gradient weights to the target's historical high-response channels;

[0023] Apply suppression weights to channel responses that suddenly increase but are unstable within a short period of time;

[0024] For training samples labeled as unstable targets, a high-frequency or large-step gradient update strategy is implemented.

[0025] Furthermore, the method for weakening or suppressing channels with high variability from the current image detection path includes:

[0026] S1. For each input image, extract the response values ​​of each channel to the target region of the image through the SENet module embedded in the YOLOv8 network structure; for the target region, calculate the response variance or fluctuation amplitude by statistically analyzing the response distribution characteristics of each channel.

[0027] S2. Based on the degree of variation in the channel response, determine the channels with unstable response or poor discriminability within the target area; generate a channel suppression mask for the highly variable channels, the mask being a scaling factor less than 1;

[0028] S3. In the feature input of the YOLOv8 detection head, a mask is injected into the corresponding channel to dynamically suppress the influence of highly variable channels on classification and regression results;

[0029] Specifically, an SENet module is introduced into the YOLOv8 network structure to extract the response intensity of different channels to the target region in each image. The stability of the channel's ability to distinguish small targets is measured by statistically analyzing the response fluctuation characteristics of each channel in the target region. A variability evaluation function is used to establish a mathematical mapping relationship between response fluctuations and channel suppression masks. The evaluation function is a custom nonlinear suppression function with the following form:

[0030]

[0031] in:

[0032] : indicates the first The suppression mask generated by each channel has a value range of 1. The smaller the mask value, the more unstable the response of the channel and the higher the degree of suppression. : Indicates the length of the response time (or spatial range) for observation within the target area of ​​the image for this channel; : Indicates a channel In time or space The standardized response intensity to the target area; : Indicates a channel In position The degree to which the response deviates from the mean is used to reflect local fluctuations in the response; : for channel In position The importance weight of the target region is used to measure the contribution of the region to the detection accuracy; : A positive coefficient used to adjust the degree of penalty for response variability, and to balance the sensitivity to response fluctuations;

[0033] By integrating the local response intensity, spatial weight distribution, and response fluctuation degree using the aforementioned integral suppression function, a dynamic assessment of whether each channel should be weakened is achieved; if a channel experiences severe response fluctuations within the target region, i.e. If the value is large, then It will be significantly compressed, thus effectively suppressing the channel during network forward propagation;

[0034] If a channel responds stably and in the same direction, then its corresponding mask... The value remains close to 1, maintaining its predictive contribution; ultimately, in the YOLOv8 detection head, the mask is... Inject the corresponding channel path to scale the output of the convolutional layer or the feature activation result.

[0035] Furthermore, the suppression mask is generated based on the channel response variance, with a value ranging from 0 to 1. The larger the variance, the smaller the mask value. The mask is applied to the convolution output or activation result of the detection path.

[0036] Furthermore, the calculation of the channel response variance is performed on the labeled target regions in the image; the suppression process is an image-level dynamic operation, with a channel mask generated separately for each image.

[0037] The beneficial effects of this invention are as follows: By finely controlling the channel responses of small target regions through the SENet module, the effective information of the target is enhanced while background redundancy is suppressed, solving the problem that small target features are easily submerged by large targets or complex backgrounds. By constructing multi-scale channel response offset relationships, the system accurately determines whether the response of small targets drifts with scale compression during feature fusion, and makes it more stable in spatial positioning through a position compensation strategy, thereby improving the accuracy of the detection box. By monitoring and trend modeling the target's cross-epoch channel response trajectory, the system effectively identifies targets with unstable responses during training, and combines gradient guidance strategies to correct the attention path, making model learning more stable and accurate.

[0038] Suppression masks are automatically generated based on the channel response variance of the target region, dynamically reducing the influence of highly fluctuating channels and effectively suppressing false detections caused by background noise or abnormal activation. This is particularly suitable for small target recognition in complex scenes. A separate channel suppression strategy is generated for each image, enabling adaptive response adjustment to target-specific features and avoiding a one-size-fits-all approach of fixed channel weighting, thereby improving the model's adaptability to different scenarios. Without significantly increasing network parameters or computational complexity, detection accuracy is improved through structural optimization and response guidance, making it suitable for edge device deployments and real-time detection scenarios. Attached Figure Description

[0039] Figure 1 This is a flowchart of the YOLOv8 small target detection optimization process of the present invention.

[0040] Figure 2 This is a functional relationship diagram of the small target space consistency enhancement mechanism in the YOLOv8 Neck of this invention.

[0041] Figure 3 This is a functional relationship diagram of the small target channel response consistency mechanism of the present invention.

[0042] Figure 4 This is a flowchart of the dynamic suppression and gating process based on channel variability analysis of the present invention.

[0043] Figure 5This is the multi-scale channel response correction process for a small unmanned aerial vehicle (UAV) in Embodiment 1 of the present invention.

[0044] Figure 6 This is the dynamic masking suppression process based on channel response fluctuation statistics in Embodiment 2 of the present invention. Detailed Implementation

[0045] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0046] Combined with appendix Figure 1 This invention improves the small target detection method of YOLOv8 based on SENet. Addressing the issue of semantic weakening of small targets in deep networks, a semantic dilution loss mechanism is introduced. This mechanism measures the dilution degree of small target features in network channels. During training, the channel response changes of small target regions are dynamically modeled. When the response of certain channels to small target regions shows rapid decay or shift in the layers before and after, this loss function reflects and feeds back the network adjustment direction, enhancing the stability and consistency of the semantic path for small targets. Furthermore, based on the SENet structure, a suppressive inverse weight generation method is introduced. Instead of the traditional simple channel enhancement mechanism in the SENet module, inverse channel weights with suppressive properties are generated based on the response features of small targets. These weights can weaken the channel outputs of background redundancy or non-target regions while preserving high-response feature regions, thereby achieving better detection of small target features. To improve the detection accuracy of the model under conditions of dense small targets or complex backgrounds, the suppression features output by the SENet module are embedded into the C2f structure of YOLOv8. The C2f module, as a lightweight cross-layer fusion module in YOLOv8, has the ability to cascade features and skip connections. Using the cross-layer pathway of this structure, the channel features suppressed by SENet can be effectively transferred and decoupled between multiple semantic layers of the backbone network. This allows the small target features to be preserved not only at the current level, but also to maintain their relatively complete spatial and channel expression information during the high-level semantic abstraction process. Finally, the decoupled suppression and enhancement features are transferred to the detection head stage for use by the subsequent small target localization and classification modules. This constructs a YOLOv8 small target detection optimization process that integrates channel suppression control, cross-layer transfer guidance, and dilution loss feedback.

[0047] Combined with appendix Figure 2To address issues such as spatial shift and response ambiguity that easily occur in the feature fusion stage for small targets, a cross-scale migration relationship based on SENet channel responses is constructed in the Neck part of the YOLOv8 network structure, i.e., the feature pyramid fusion structure. This mechanism embeds SENet modules into feature maps at different scales, extracts the channel response weights at each scale, and spatially aligns and compares the channel responses at the same semantic position between high- and low-resolution feature maps according to the scale correspondence between feature maps. Based on this, it further analyzes the shift of the target region at the current scale in terms of channel response relative to the previous and next scales. By comparing the change in the response center of the region at adjacent scales, it identifies whether the target has undergone changes during the feature fusion process. Spatial offset or response drift, where response offset refers to the misalignment or directional shift of the target's channel activation center in feature maps at different scales. If the detected drift exceeds a set threshold, it is determined that the small target has unstable feature propagation in the fusion path. To address this, a positional balance loss mechanism is introduced to measure the offset of the target between multi-scale channel responses and incorporate it into the network optimization objective. This allows the model to actively adjust the weight transmission direction during training, guiding features to refocus on the original target region. By relocating the target's centroid in the offset region, the response error during the inter-scale transmission process is compensated, thereby enhancing the spatial consistency and semantic coherence of small targets in the Neck structure. Ultimately, this effectively improves the detection accuracy and stability of small targets in complex scenes.

[0048] Combined with appendix Figure 3To address the learning instability of small targets during training due to scale sensitivity, weak feature representation, and unstable attention distribution, a channel response consistency measurement mechanism is proposed. This mechanism measures the changes in channel responses generated by the SENet module for the same small target across different training epochs. By recording the SENet channel outputs of the target region in each epoch and analyzing the channel response trajectories of the same target over multiple consecutive epochs, a channel-level historical response vector is constructed and used to measure the continuity and consistency of the target's response. If significant drift or frequent switching of distribution patterns is observed in the activated channels of a target across different training stages, the feature representation path of that target is deemed unstable and marked as an unstable target. For such targets, a gradient guidance mechanism is further introduced to actively intervene in the model's backpropagation during training. The propagation path enhances the gradient feedback of historically high-response channels of the target, guiding the network to adjust towards the channel direction of the target's stable response. Simultaneously, it suppresses interfering channels that suddenly appear in the short term but have inconsistent responses. If necessary, it fine-tunes the learning rate of the target samples locally, thereby achieving response correction for unstable small targets. To achieve end-to-end optimization of this mechanism, a response consistency loss term is constructed. This loss term uses the similarity of the target's channel responses across different epochs as a reference standard and participates in the overall loss function design as an auxiliary supervision signal. During training, the network adjusts the parameter update direction based on the degree of response consistency, thereby promoting the convergence of small target channel responses to a stable and generalizable path. Ultimately, this improves the robustness of small target detection in complex scenarios, reduces the impact of feature drift on model training stability, and significantly enhances small target detection accuracy and training convergence speed.

[0049] Combined with appendix Figure 4To address the prediction error caused by unstable responses of certain channels or background interference during small target detection, a dynamic suppression and channel gating mechanism based on channel variability analysis is proposed. This mechanism first extracts the response output of each channel to the labeled target region in each input image using the SENet module embedded in the YOLOv8 backbone or Neck structure. Then, it performs statistical analysis on the distribution of the response values ​​of each channel within the target region and calculates its response variance to evaluate the stability of the channel's response to small targets in the current image. If a channel's response fluctuates drastically within the target region, exhibiting discrete response values, non-concentrated directions, or discontinuous region activation, it is determined to be a high-variability channel, lacking good target discrimination ability. A channel suppression mask is then generated for this channel. This mask acts as a... In subsequent detection paths of the network, the weight of this channel in the YOLOv8 detection head is significantly reduced or downweighted, thereby dynamically weakening its impact on the current image prediction results without changing the overall network structure. In addition, to further enhance the channel selectivity and model adaptability in the detection stage, a channel gating mechanism is introduced into the YOLOv8 detection head. This mechanism filters or weights the channels participating in the classification and regression branch calculations based on the variability evaluation results of each channel, adaptively retaining high-quality channels with stable responses to the current target region, concentrated activation, and consistent direction, while eliminating or reducing the participation of highly variable channels. As a result, the detection head mainly relies on robust feature channels when predicting the location and class of small targets, significantly improving the detection accuracy and anti-interference ability of the model in complex background and dense small target scenes.

[0050] Example 1:

[0051] Combined with appendix Figure 5This embodiment is applied to the task of identifying small drones in urban traffic monitoring images. In this scenario, the background is complex, the target is small, and it is easily confused with tall buildings, trees, and other structures. The input image resolution is 640×640. After Backbone processing, it enters the Neck structure, forming feature maps at three scales: P3 (80×80), P4 (40×40), and P5 (20×20). Lightweight SENet modules are embedded in these three feature maps to extract the channel response weights for each scale. If a detected small drone target is positioned at row 35 and column 45 in the P3 scale feature map, its SENet channel responses at that scale are: C1: 0.82, C2: 0.65, C3: 0.14, etc., reflecting the model's response to... C1 and C2 are highly dependent. In the next scale P4 (40×40), the corresponding position in P3 is transformed into the 17th row and 22nd column using a downsampling position mapping algorithm. At this position, the response values ​​extracted by SENet become C1: 0.48, C2: 0.31, and C3: 0.17. At this point, the responses of channels C1 and C2 are significantly lower than in the previous scale, and their directionality is weaker. Then, the responses of the corresponding positions in the P5 scale are further extracted as C1: 0.15, C2: 0.10, and C3: 0.20. It can be observed that the responses of C1 and C2 as the core recognition channels show a significant decrease in the transmission process from P3 to P5. The attenuation was significant, and the abnormal enhancement of the C3 channel was considered to be a background interference signal. Based on this, the system calculated the channel response change rate between different scales and constructed a scale response migration map. The C1 channel response decreased from 0.82 to 0.15, with a change rate of 81.7%, exceeding the preset threshold of 50%, and was judged as a response drift. At the same time, the target center also shifted spatially, drifting from (35,45) in P3 to (16,21) in P5. The shift amplitude exceeded the spatial stability threshold. According to the drift judgment mechanism, the system activated the space of the target region to perform refocusing processing, including: firstly, refocusing the C1 channel of the target region at the P3 scale. The strategy involves two approaches: first, implementing response enhancement operations on C2, increasing its weight to the maximum value of 0.95, and guiding these key channels to maintain stable channel attention structures in subsequent scales; second, using spatial offset maps to guide the target region in P4 and P5 to regress to the center corresponding to the P3 position, thereby correcting the center of gravity drift caused by scale compression; and finally, transmitting the reconstructed fused features to the detection head to achieve accurate detection of the small UAV. After actual testing, the target position offset pixel error decreased from the original average of 4.6 to 1.2, the channel response stability improved by 25%, and the detection accuracy increased by an average of 7.4 percentage points.

[0052] The target is located at (35, 45) in the P3 scale of the Neck structure. The response intensities of channels C1 and C2 in the SENet module are 0.82 and 0.65, respectively, while at the corresponding positions (17, 22) in the P4 scale, they are 0.48 and 0.31, respectively. Further analysis of the directional change trend of the channel responses is performed, comparing the magnitude of changes in channel weight values ​​and considering the coherence of the change direction, i.e., determining whether the channel response continuously increases, continuously decreases, or undergoes a reverse abrupt change with scale. Channels C1 and C2 continuously decrease between P3 and P4, with a consistent downward direction, thus initially indicating a typical response decay trend. Next, a channel direction consistency measurement method is introduced. The change direction of the channel responses is statistically analyzed sequentially across the three scales from P3 to P5, constructing a change vector sequence, for example, C1 is [decreasing, decreasing], C2 is [decreasing, decreasing], and C3 is [increasing, increasing]. These sequences are matched with the target's stable channel response template. If the matching results show that the channel response trend lacks structural coherence, such as certain key channels showing... If the direction is reversed (e.g., [decreasing, increasing] or [decreasing, sharp increasing]), it can be determined that the target channel response has drifted or is severely affected by disturbances, requiring response correction measures. In the current example, the continuous decreasing direction of channels C1 and C2 indicates significant response attenuation, while the continuous increasing direction of C3 indicates interference from background factors. Based on this, the system identifies C3 as an interfering increasing channel and reduces its participation by masking, decreasing its corresponding weight in the detection head from 0.20 to 0.08. Meanwhile, directional repair and enhancement are performed on channels C1 and C2, i.e., by maintaining the direction. The module guides the target to maintain a slowing or stabilizing downward trend in subsequent scales, ensuring that the target's representation after multi-scale fusion still relies on the stable semantic structure of the C1 and C2 channels. Subsequently, based on this trend analysis structure, the system constructs a response change trend map for each target channel and adds it to the spatial refocusing branch of the detection module. This is used to correct the spatial displacement risk caused by scale changes. For example, if the target's actual detection centroid shifts to (16, 21) in P5, while the original estimate should be (17, 22), this is corrected through channel directional trend correction and feature refocusing. The combined effect of the localization modules ultimately readjusted the target's center of gravity back to a position close to the original center of P3, reducing the positional error from 2.8 pixels to 0.7 pixels, further improving spatial consistency. Real-world data shows that after applying this method, the model's average accuracy for small target detection in complex urban images containing interference factors such as small drones, birds, and power line shadows increased from 87.6% to 92.2%. The spatial relocalization module contributed approximately 2.1% to the accuracy gain, while the channel trend matching module contributed approximately 2.5% to the false detection rate reduction.

[0053] The target UAV was observed and its SENet channel response values ​​were extracted from the three scale feature maps (P3, P4, and P5) in the Neck feature fusion structure. The system identified significant response attenuation and spatial center-of-gravity drift at the P4 and P5 scales through directional response trend analysis and channel response matching. Specifically, the target center was (35, 45) at the P3 scale, but shifted to (16, 21) at the P5 scale, corresponding to a pixel offset distance of 2.8 units, exceeding the set drift tolerance threshold of 2.0. Therefore, the system determined that the target exhibited spatial drift during feature fusion. Subsequently, a region-weighted strategy was introduced for response repair. The core of this strategy is to construct an offset map for the drift region and use... To describe the superposition trend of target position changes and channel response changes across different scales, the construction process first extracts the core perception window based on the high-confidence channel response region at the P3 scale. This window is then marked as a confidence region and mapped to the P4 and P5 scales. Spatial relocalization is performed through upsampling coordinate transformation, and the difference in response decrease and activation intensity at the new location is statistically analyzed. This difference is calculated as a set of weighted compensation factors, forming a weighted field in the offset map. For example, if the response of channel C1 in P3 is 0.82 while it decreases to 0.15 in P5, the compensation factor is recorded as 0.67. Based on this factor, the system will add a compensatory enhancement mechanism at the (16,21) position of channel C1 at the P5 scale, multiplying its activation value by... After compensation, the data is re-normalized and fed into the next level of the fusion path. Simultaneously, if activation leakage occurs around this location (i.e., the response is too strong but not concentrated), the system will perform a weighted smoothing process on the activation values ​​of neighboring regions to prevent misleading downstream detection heads. After completing the offset map construction, this map is further used as a mask in the path weighting of the feature fusion module. Especially in the FPN structure of YOLOv8, during feature upsampling and stitching at each scale, the channel dimension compensation factor provided in the offset map is referenced to dynamically adjust the channel weighting matrix at the stitching position. This allows the model to prioritize strengthening the response at high-confidence locations during feature layer fusion and correct the channel activation imbalance problem in drift regions. After compensation through this weighting strategy, the original P5 scale target... The response of C1 improved from 0.15 to 0.58, and C2 improved from 0.10 to 0.46, approaching its response level in the original feature map of P3. The target prediction box position also shifted from (16,21) to (17,22). The pixel error decreased from 2.8 to 0.6, and the region IoU (Intersection over Union) improved from 0.52 to 0.79 compared to the GT box, effectively enhancing spatial stability. At the same time, the method reduced the channel response of falsely activated regions (such as reflections from wires or leaves in the background) that appeared in P5 from 0.23 to 0.09, suppressing false targets that interfered with the detection results. Finally, a total of 16 detection samples with region-weighted offset maps were introduced into the whole image, of which 81% effectively repaired the response offset of small targets.This strategy resulted in an overall improvement in detection accuracy of 3.9% and a reduction in false positive rate of 1.8%.

[0054] In the YOLOv8 network architecture, the SENet module is embedded into the C2f structure of the Backbone and the Neck feature fusion structure. This is used to extract the channel responses of each small target during the training phase. Let's assume a UAV target is numbered #48 in the training set. In epochs 5, 6, and 7 of consecutive training, its standardized response values ​​on the C1, C2, and C3 channels of the SENet module are [0.81, 0.62, 0.13], [0.40, 0.32, 0.45], and [0.76, 0.55, 0.18], respectively. By calculating the channel response trajectory of this target in the three epochs, it was found that the responses of channels C1 and C2 decreased sharply in the 6th epoch. The value rose again in the 7th round, while channel C3 surged in the 6th round but plummeted in the 7th round. The switching between channels was large and irregular, and the response direction showed a mixed pattern of decreasing-increasing and increasing-decreasing. Based on this, the system judged that the channel response of this target was unstable during training. Using the channel response consistency index (which can be regarded as a weighted combination of the volatility and directional consistency of the response value in consecutive epochs), target #48 was scored 0.34, which is lower than the set threshold of 0.5. Therefore, this target was marked as an unstable target and entered the response correction path. In the subsequent 8th round of training, the system adjusted the training strategy for this target through a gradient guidance mechanism. First, it identified C1 and C2 as the frequencies of target #48 in the historical epochs. For the channels with the highest and strongest average responses, the system increases the backpropagation gradient coefficients of these two channels to 1.5 times the standard value, ensuring that these two main channels receive more attention in parameter updates. Meanwhile, channel C3, due to its large fluctuations and reversed direction, is identified as an irrelevant or unreliable channel, and its gradient contribution is suppressed, retaining only 70% of the original propagation gradient to prevent it from disrupting the optimization direction. Furthermore, due to the unstable response of target #48, its local learning rate in this training round is further increased from the global default of 0.01 to 0.03, only effective in gradient updates for this target, to improve the model's focusing speed on the target's representation path. After introducing the above gradient guidance, target #48... The stability of the SENet channel responses in round 8 was significantly improved, with response values ​​becoming C1: 0.85, C2: 0.63, and C3: 0.19. The channel response consistency index calculated by the system rose to 0.81, recovering to above the stable target standard and maintaining this trend in round 9. Further statistics show that after introducing the gradient guidance mechanism, the model recovered to a stable state for 93 of all unstable targets, accounting for 72.1% of the total unstable samples. The average consistency index of the response trajectory improved from 0.46 in the early training stage to 0.77. In addition, in the final detection result of target #48, its predicted bounding box IoU improved from 0.58 to 0.86, and the class confidence improved from 0.71 to 0.93. This study validated that by guiding the reinforcement feedback of the historical main channel response, while suppressing interfering channels, and introducing a more learning-capable update rate configuration locally, the attention drift problem of small targets in multi-round training can be effectively alleviated, improving the robustness and convergence speed of the detection model in the continuous representation of small targets.

[0055] During YOLOv8 training, the response intensity of target #48 on all channels of the SENet module was recorded in each epoch, with particular attention paid to the activation trajectories of channels C1, C2, and C3, which were initially identified as the primary discriminant channels. The response data recorded by the system in training epochs 5 to 9 are as follows: epoch 5: C1=0.81, C2=0.62, C3=0.13; epoch 6: C1=0.40, C2=0.32, C3=0.45; epoch 7: C1=0.76, C2=0.55, C3=0.18; epoch 8: C1=0.85, C2=0.63, C3=0.19. In epoch 9, C1=0.88, C2=0.67, and C3=0.17. Observing this data sequence, it can be seen that C1 and C2 experienced a decrease in epoch 6, but quickly rebounded and maintained a high response in subsequent stages. C3, although it surged in epoch 6, gradually declined afterward, showing unstable changes. Based on the channel response consistency measurement strategy, the system calculates the coherence of the activation trend for each channel. That is, it not only considers whether the response intensity is high, but also pays attention to its central tendency and volatility over time. For example, the average response of channel C1 in 5 training epochs is 0.74, the standard deviation is 0.19, the volatility is 25.7%, and the directional consistency remains consistently upward in 4 / 5 epochs. The system assigns it a high consistency score of 0. 89; Channel C2 has a mean response of 0.56, a standard deviation of 0.14, a volatility of 21.4%, a directional consistency of 3 / 5, and a score of 0.81. While Channel C3's response value approaches 0.45 in some epochs, its directional volatility is extreme, with a mean of 0.22 and a standard deviation as high as 0.12, accounting for over 50% of the total. Therefore, its consistency score is only 0.43. By aggregating the scores of the three channels, the system constructs a channel response concentration trend chart for target #48, using this as the basis for determining whether the target possesses a stable representation path. When the mean of a target's main channel consistency index exceeds 0.75 and the directional change trend is stable (i.e., volatility below 30% for three consecutive epochs), the target is judged to have a stable representation path. Otherwise, it is considered an unstable target and needs to enter the correction mechanism. Target #48 was initially marked as an unstable target due to the discontinuous C1 and C2 responses in the early stages of training, and a gradient guidance mechanism was introduced for correction training. After compensatory training, its channel consistency was significantly improved, and it turned into a stable state after the 9th round. Further statistical analysis of the consistency index of 1032 small targets in the entire dataset revealed that the average channel consistency score of stable targets was 0.82, while that of unstable targets was 0.51. After introducing this mechanism, the small target mAP@0.5 of the YOLOv8 model on the validation set increased from 68.7% to 74.5%, showing stronger feature transfer stability in small target IoU fluctuation control. In addition, the false alarm rate decreased by 3.1%.

[0056] To further optimize the detection bias caused by unstable channel responses of small targets during training, a gradient guidance mechanism is proposed. This mechanism can strengthen the model's learning of stable response channels and weaken the influence of interfering channel weights by guiding the distribution of gradient flow during model training. It also implements targeted gradient update strategies for unstable targets to accelerate convergence. Based on the aforementioned training cycle, the channel response performance of the target in the SENet module is recorded from rounds 10 to 13. In round 10, the response values ​​of the target's main channels C1 and C2 are 0.86 and 0.68, respectively, continuing the previous stable trend. However, in round 11, the response of channel C3 suddenly rises to 0.53, a change of more than 150% compared to the average of 0.21 in previous rounds. This is marked by the system as a short-term surge channel. Based on the judgment criteria that the channel's change direction is inconsistent over the past three rounds and its volatility exceeds a threshold (set to 50%), the system adjusts the gradient update strategy for channel C3 during backpropagation in round 11. The gradient coefficient was set to 0.6, implementing penalized suppression. Meanwhile, for channels C1 and C2, historically high-response and directionally consistent main channels of target #48, their gradient feedback coefficients were increased to 1.7 and 1.5 respectively in this round to enhance their dominant role. This makes the network more inclined to amplify the response capability of the main channels when updating parameters, thus avoiding being misled by short-term interfering channels in the training direction. Furthermore, since target #48 was repeatedly marked as an unstable target in the early stages, a local large-step gradient strategy was applied to it in rounds 11 to 13, adjusting its learning rate in the YOLOv8 optimizer from 0.01 to 0.03, and increasing... The frequency with which it participates in backpropagation (e.g., participating in backpropagation repeatedly once every mini-batch) forms a high-frequency training compression window, aiming to stabilize the representation path of the target in a short time and quickly restore its channel consistency. After the above mechanism, in the 13th round, the C1 and C2 channel responses of the target increased to 0.91 and 0.74 respectively, while C3 decreased to 0.27. The overall directionality tended to stabilize, and the channel consistency index improved from 0.67 in the 10th round to 0.88. The system re-marked its state as a stable target and further detected the mAP@0 of the target in the validation set images. The accuracy rate was improved to 92.1%, a significant improvement compared to 83.5% before correction. In the full training sample, after enabling the gradient guidance mechanism for 327 unstable targets recorded during the training phase, 226 targets recovered to a stable channel response mode within 5 epochs, accounting for 69.1%. Among them, the false alarm rate decreased by 3.6%, and the average training convergence speed improved by 17.4%. This mechanism has a significant optimization effect on small targets with a size of less than 32×32. In engineering tests, it is shown that the model's ability to distinguish targets such as small drones with different flight altitudes, cable debris, and building structure edges in occluded backgrounds is significantly enhanced.

[0057] Example 2:

[0058] Combined with appendix Figure 6 Based on Example 1, by introducing channel response fluctuation statistics and mask generation mechanisms, the SENet module embedded in the YOLOv8 backbone network and Neck module performs channel-level response weighting on the feature map output of each image. The position of the detected target #48 in the current input image, located on the P3 feature layer, is set to (35, 45). The system samples and statistically analyzes the SENet channel responses within a 5×5 pixel block in this region, setting the number of channels to C=3, corresponding to channels C1, C2, and C3. In step S1, the system extracts the normalized response value sequence of each channel within this region. Let's define the responses of channels C1 as [0.78, 0.83, 0.80, 0.77, 0.79], C2 as [0.45, 0.43, 0.76, 0.35, 0.60], and C3 as [0.12, 0.15, 0.09, 0.14, 0.13]. In step S2, the system calculates the response variance for each channel, where C1 has a variance of 0.00052, C2 has 0.0279, and C3 has 0.00046. Since the variance of C2 is much higher than that of other channels, it is initially identified as a high-variability channel and enters the variability function suppression mechanism. Based on the nonlinear channel suppression function:

[0059]

[0060] The definitions and actual value settings for each parameter are as follows:

[0061] There are 5 pixel positions in the sampling window;

[0062] : in position The standardized response, for example, C2 values ​​such as 0.45;

[0063] Regional importance weights are set so that the location center has a higher weight, with a range of 0.6 to 1.0. In this example, it is set to [1.0, 0.9, 0.8, 0.7, 0.6].

[0064] The degree to which the channel response deviates from the mean is calculated based on the standard deviation of the response sequence, with a maximum deviation of 0.4.

[0065] To adjust the coefficient for sensitivity to response fluctuations, a recommended value range is [value range missing]. In this example, a medium sensitivity is used. ;

[0066] Substituting the value of C2, the system calculates its mask. This indicates that the channel response is highly unstable and should be weakened; conversely, the calculated masks for C1 and C3 are respectively... This is a highly stable channel and is retained. In step S3, the system injects this mask value into the detection head channel of YOLOv8, scaling the activation output of this channel during forward propagation. Specifically, the feature output of channel C2 is multiplied by 0.56, while C1 and C3 remain essentially unchanged. After this, it is input into the classification and regression branch network to dynamically suppress unstable channels while retaining the main channel features that are most discriminative for small targets. Furthermore, during batch training, the detection performance of the model for UAV target #48 before and after applying this mechanism is recorded. Yes, the mAP@0.5 improved from 88.2% to 93.4%, the false positive rate decreased from 4.3% to 2.1%, and the position regression IoU improved to 0.81. This demonstrates that the mechanism can effectively reduce channel perturbations caused by background disturbances or transient response fluctuations, while improving the model's response reliability and feature stability in small target detection scenarios. In addition, in the entire test set, a total of 956 channels were identified as high-variability channels and suppressed, with an average channel suppression margin of 34.6%. The small target recall rate improved by 5.7%, and the false positive rate decreased by 3.2%.

[0067] To further enhance the network's ability to control the stability of small target feature channel responses, a channel-level suppression mechanism was constructed. This mechanism generates a suppression mask through dynamic analysis of channel response variance to regulate the contribution weight of unstable channels in the detection path. During the training phase, when the YOLOv8 network processes a 640×640 image, the SENet module is deployed in the C2f structure to extract channel attention information. For the P3 layer feature map (80×80×C), the number of channels is set to C=128, and a 9×9 pixel window centered on the region (35,45) where target #48 is located is sampled. The system first calculates the variance of the response value of each channel within the window. The distribution of the response value of channel 12 is set as [0.83, 0.81, 0.79, 0.85, 0.84, 0.80, 0.82, 0.86, 0.83], with a variance of 0.00046. The response of channel 34 is set as [0.92, 0.41, 0.85, 0.12, 0.60, 0.33, 0.91, 0.49, 0.25], with a variance of 0.0807. The system sets the maximum variance threshold to 0.10 and the minimum variance to 0. A mask value is generated using linear mapping, employing the following rules: Mask value... ,in The variance value. The inhibitory factor has a value range of [value range missing]. In this example, it is set to Therefore, the mask value for the 12th channel can be obtained. The mask value for channel 34 is... This indicates that the latter response is unstable and should be suppressed. In the path input of the YOLOv8 detection head, the system performs a one-to-one multiplication operation on the original features of all channels and their corresponding masks according to the channel dimension to form a suppressed feature map, which is then fed into the convolutional layer for classification and regression prediction operations. This achieves dynamic filtering of unstable response channels. Further statistical analysis on the entire training dataset revealed that during the forward propagation of all small target samples, approximately 24.6% of the channel mask values ​​were below 0.8, and 9.3% of the channels were set to strong suppression (i.e., mask values ​​below 0.5). This mechanism significantly improves the robustness of the model in the selection of feature channels in small target regions. Specifically, for target #48, before the introduction of this mechanism, its predicted bounding box IoU was 0.61 and the confidence level was 0.74. After the introduction, the IoU increased to 0.85, the confidence level increased to 0.92, and the false alarm rate decreased by 1.9%.

[0068] The SENet module integrated into the YOLOv8 network architecture outputs weighted response values ​​in the channel dimension of the feature map during the forward propagation stage of each image. During each training or inference process, the system performs channel response variance statistics only on manually labeled real target regions in the image, thus avoiding interference from background noise regions in variance evaluation and improving the accuracy of small target channel stability recognition. In the 14th training epoch, an image containing three labeled targets was input into the network, including target #48, located at position (36, 44) in the P3 feature map. The SENet module output 128. The response maps of each channel are used to extract a 9×9 region window corresponding to the target area. The response variance of each channel within this window is calculated sequentially. Channel C7's response sequence is set as [0.80, 0.81, 0.83, 0.79, 0.82, 0.80, 0.78, 0.84, 0.79], with a variance of 0.00042. Channel C22's response sequence is set as [0.62, 0.21, 0.94, 0.10, 0.55, 0.68, 0.09, 0.73, 0.36], with a variance of 0.0901. The system constructs the mask value for each channel according to a preset linear suppression strategy, using a rule-based approach. ,in To suppress the sensitivity coefficient, let's set it to 6. Then the mask for C7 is... C22 is Meanwhile, to ensure detection stability, this suppression mechanism performs a mask generation process separately for each image, i.e., image-level dynamic operation. Whenever an image enters the forward inference path, the system calculates the variance of each channel and generates a mask in real time based on the channel response fluctuations of the target region in the image. In the current training batch, the mask distributions triggered by the three targets in this image show significant differences. The average mask of target #48 is 0.93, and the standard deviation of the offset is 0.07, indicating that most of its channel responses are stable and should be retained. On the other hand, the average mask of the edge-occluded drone target #52 is 0.71, with some channels as low as 0.42. The system has effectively weakened its unstable channels. The image-level mask generation mechanism avoids overfitting or oversuppression caused by a uniform mask template, making it particularly suitable for complex environments with interlaced small targets, varying lighting, or partial occlusion. Experimental results show that implementing the image-level dynamic mask generation mechanism on the full dataset improves the average detection confidence by 4.1% and reduces the false alarm rate by 3.5%. In particular, it improves the recall rate by 6.2% in categories with small targets smaller than 24×24 pixels. This method combines image-specific processing with variance calculation based on target regions, significantly improving the adaptability of the SENet channel focus strategy to the differential features of small targets and effectively reducing channel response distortion caused by irrelevant regions.

[0069] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for detecting small targets in YOLOv8 based on SENet, characterized in that... Includes the following steps: A semantic dilution loss is introduced to measure the dilution of small target features in network channels. During training, the channel response changes of small target regions are dynamically modeled. When the response of certain channels to small target regions decays or shifts rapidly in the layers before and after, this loss function reflects and feeds back the network adjustment direction. For small target feature channels, the SENet structure generates suppression inverse weights to retain high response regions while suppressing background redundancy. The C2f structure of YOLOv8 is incorporated to pass decoupled features in cross-layer connections. In the Neck feature pyramid, construct the SENet response migration relationship; calculate the weight offset value between the current scale and the upper / lower scale to determine whether the small target response has undergone spatial shift; A positional balance loss is introduced to measure the degree of target offset between multi-scale channel responses and incorporate it into the network optimization objective. This allows the model to actively adjust the weight transfer direction during training, guiding features to refocus on the original target region. By relocating the target centroid in the offset region, the response error during the inter-scale transfer process is compensated. Design a channel response consistency metric to measure the consistency of the SE response of small targets across different epochs; if the response of the same target drifts drastically, it is determined to be an unstable target, and response correction is performed through gradient guidance; construct a response consistency loss term to guide the network to converge to a stable small target representation path; For each image, the SENet channel output is extracted, and the variance of the channel response distribution in the target region is calculated. Channels with high variability are weakened or suppressed from the current image detection path. The detection head introduces a channel gating mechanism to adaptively select stable channels to participate in the prediction. The detection head performs target classification and localization regression on the features of the stable channel, and outputs the detection results of small targets.

2. The method for detecting small targets based on SENet and improved YOLOv8 according to claim 1, characterized in that... The method for calculating the weight offset between the current scale and the previous / lower scale includes: SENet modules are embedded in feature maps of different scales in the Neck structure to extract channel response weights of feature maps at each scale; the SENet channel responses at different scales are aligned in spatial coordinates by upsampling or downsampling. Compare the changes in channel response weights between adjacent scales to construct scale response migration relationships; determine the degree of response shift of small target regions at different scales; if the shift exceeds a set threshold, it is determined that the region has spatial drift. Compensation operations are performed on small target areas that exhibit drift, including channel enhancement or spatial refocusing.

3. The method for detecting small targets based on SENet-improved YOLOv8 according to claim 2, characterized in that... The comparison of channel response weight changes is based on the statistical analysis of the SE channel output of the same image region between two adjacent scales, calculating the directional change trend of its channel weights, and judging whether the small target response has shifted or attenuated based on the trend.

4. The method for detecting small targets based on SENet-improved YOLOv8 according to claim 3, characterized in that... After determining the spatial drift, a regional weighting strategy is applied to the drift region, and an offset map is constructed to guide the channel weights of the region in subsequent feature fusion to be compensated and strengthened.

5. The method for detecting small targets based on SENet and improved YOLOv8 according to claim 1, characterized in that... The gradient-guided response correction method includes the following steps: S1. For the targets in the training samples, the SENet module embedded in the YOLOv8 network structure is used to extract the channel response weights of each target in each training round. S2. Record and compare the channel responses of the same target in multiple training rounds to construct the target channel response trajectory; calculate the channel response consistency index of the target in the time dimension based on the channel response trajectory; if the response fluctuates drastically, the target is determined to be an unstable target. S3. For targets deemed unstable, a gradient guidance mechanism is introduced in subsequent training, including strengthening the backpropagation gradient of the response channel, penalizing the weight response of irrelevant channels, and locally adjusting the learning rate of the target.

6. The method for detecting small targets based on SENet and improved YOLOv8 according to claim 5, characterized in that... The channel response consistency index is based on the change in the activation distribution trend of each channel to the target in multiple training rounds. It is used to measure whether the channel attention is continuous and concentrated, and thus to determine whether the target representation path is stable.

7. The method for detecting small targets based on SENet-improved YOLOv8 according to claim 6, characterized in that... The gradient guidance mechanism includes one or more of the following: Assign greater gradient weights to the target's historical high-response channels; Apply suppression weights to channel responses that suddenly increase but are unstable within a short period of time; For training samples labeled as unstable targets, a high-frequency or large-step gradient update strategy is implemented.

8. The method for detecting small targets based on SENet-improved YOLOv8 according to claim 1, characterized in that... The method for weakening or suppressing channels with high variability from the current image detection path includes: S1. For each input image, extract the response values ​​of each channel to the target region of the image through the SENet module embedded in the YOLOv8 network structure; for the target region, calculate the response variance or fluctuation amplitude by statistically analyzing the response distribution characteristics of each channel. S2. Based on the degree of variation in the channel response, determine the channels with unstable or poor discriminative response within the target area; generate a channel suppression mask for the channels with high variation, wherein the mask is a scaling factor less than 1; S3. In the feature input of the YOLOv8 detection head, a mask is injected into the corresponding channel to dynamically suppress the influence of channels with high variability on classification and regression results.

9. The method for detecting small targets based on SENet-improved YOLOv8 according to claim 8, characterized in that... The suppression mask is generated based on the channel response variance, with a value ranging from 0 to 1. The larger the variance, the smaller the mask value. The mask is applied to the convolution output or activation result of the detection path.

10. The method for detecting small targets based on SENet-improved YOLOv8 according to claim 9, characterized in that... The calculation of the channel response variance is performed on the labeled target regions in the image; the suppression process is an image-level dynamic operation, with a channel mask generated separately for each image.