Small target detection method and device

By introducing a feature causal decoupling and fusion module into the object detection model, and combining dynamic attention and adaptive loss function, the generalization ability and accuracy problems of small object detection models in complex scenarios are solved, achieving more efficient causal feature extraction and fusion, and improving detection performance.

CN122135157APending Publication Date: 2026-06-02BEIJING SHENZHOU EVERBRIGHT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING SHENZHOU EVERBRIGHT TECH CO LTD
Filing Date
2026-02-11
Publication Date
2026-06-02

Smart Images

  • Figure CN122135157A_ABST
    Figure CN122135157A_ABST
Patent Text Reader

Abstract

This application relates to the field of artificial intelligence technology, and provides a method and apparatus for small target detection. The method includes: acquiring an image to be detected containing small targets; inputting the image to be detected into an improved target detection model to obtain a small target detection result; wherein the backbone network of the improved target detection model includes a feature-causal decoupling module and a causal feature fusion module; the feature-causal decoupling module is used to causally decouple the input features of the image to be detected to separate causal features; the causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features; the small target detection result is generated based on the enhanced fused causal features. The small target detection method and apparatus provided in this application, through the feature-causal decoupling module and the causal feature fusion module, can achieve automated and lightweight causal feature learning and fusion, thereby improving the generalization ability and accuracy stability of small target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for small target detection. Background Technology

[0002] Small object detection is a significant challenge in the field of computer vision, with widespread applications in remote sensing, autonomous driving, and industrial inspection. Because small objects have a small pixel count, sparse features, and are easily affected by background interference, general object detection models often suffer from missed detections and inaccurate localization.

[0003] Existing improvement methods mainly enhance detail perception by increasing feature map resolution and introducing attention mechanisms, but they are essentially still learning the statistical correlations between data, making them susceptible to spurious associations caused by background, lighting, etc., resulting in insufficient generalization ability of object detection models. To improve generalization, recent studies have attempted to introduce causal inference and separate features by constructing explicit causal object detection models.

[0004] However, such methods heavily rely on manually defined causal graphs and the intervention process is computationally complex, making it difficult to embed them into efficient end-to-end detection frameworks. Summary of the Invention

[0005] This application provides a small target detection method and apparatus to solve the technical problem in the prior art that the causal and non-causal components in image features cannot be effectively separated, resulting in weak generalization ability and unstable detection accuracy of the target detection model in complex scenes. It realizes automated and lightweight causal feature learning and fusion, thereby improving the generalization ability and accuracy stability of small target detection.

[0006] In a first aspect, this application provides a method for detecting small targets, comprising the following steps: Acquire the image to be detected that contains small targets; The image to be detected is input into the improved target detection model to obtain the small target detection results output by the improved target detection model. The improved target detection model's backbone network includes a feature-causal decoupling module and a causal feature fusion module. The feature-causal decoupling module is used to decouple the input features of the image to be detected causally to separate causal features. The causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features. The small target detection result is generated based on the enhanced fused causal features.

[0007] In one embodiment, the feature causal decoupling module is used to perform causal decoupling on the input features of the image to be detected to separate causal features, including: The input features of the image to be detected are transformed in the frequency domain to obtain the corresponding frequency domain features, which include phase components and amplitude components. The phase component is kept constant, and the amplitude component is subjected to bilinear interpolation to obtain the frequency domain characteristics after the intervention. Construct a feature correlation matrix based on the frequency domain characteristics and the frequency domain characteristics after intervention; The feature correlation matrix is ​​used to separate causal features from non-causal features.

[0008] In yet another embodiment, the causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features, including: Alignment processing is performed on causal features from different network layers. The alignment process includes channel adjustment of lower-level causal features and upsampling of higher-level causal features to ensure that the lower-level and higher-level causal features are consistent in terms of channel number and spatial resolution. By using a dynamic attention mechanism, the aligned low-level causal features and high-level causal features are adaptively weighted and fused to obtain dynamic fused features. The dynamic fused features are residually connected with the corresponding static features extracted from the backbone network to output enhanced fused causal features.

[0009] In yet another embodiment, the improved target detection model further includes a multi-scale feature fusion module; the multi-scale feature fusion module is used to receive and integrate enhanced fused causal features and output multi-scale fused features.

[0010] In another embodiment, the improved target detection model further includes a detection head; the detection head is used to perform position regression and category recognition processing on multi-scale fused features and output small target detection results; the detection head is optimized and trained using an adaptive easy-sampling weighted IoU loss function.

[0011] In yet another embodiment, the improved object detection model uses the YOLO object detection model as the baseline network architecture.

[0012] Secondly, embodiments of this application provide a small target detection device, comprising: The acquisition module is used to acquire images to be detected that contain small targets; The detection module is used to input the image to be detected into the improved target detection model and obtain the small target detection results output by the improved target detection model; The improved target detection model's backbone network includes a feature-causal decoupling module and a causal feature fusion module. The feature-causal decoupling module is used to decouple the input features of the image to be detected causally to separate causal features. The causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features. The small target detection result is generated based on the enhanced fused causal features.

[0013] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the steps of the small target detection method of the first aspect.

[0014] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the small target detection method of the first aspect.

[0015] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the small target detection method of the first aspect.

[0016] The small target detection method and apparatus provided in this application achieve automated and lightweight causal feature learning and fusion by setting a feature-causal decoupling module and a causal feature fusion module in the backbone network of the target detection model. The feature-causal decoupling module can separate causal features strongly correlated with small target detection from the input features; the causal feature fusion module dynamically and adaptively fuses the separated causal features to obtain enhanced fused causal features, thereby improving the recognition accuracy of small target features. This, in turn, improves the generalization ability and accuracy stability of small target detection. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the structure of the improved target detection model provided in the embodiments of this application.

[0019] Figure 2 This is a flowchart illustrating the small target detection method provided in an embodiment of this application.

[0020] Figure 3 This is a flowchart illustrating the feature causal decoupling module provided in an embodiment of this application.

[0021] Figure 4 This is a flowchart illustrating the causal feature fusion module provided in an embodiment of this application.

[0022] Figure 5 This is a flowchart illustrating the improved target detection model training and testing method provided in the embodiments of this application.

[0023] Figure 6This is a schematic diagram of the small target detection device provided in an embodiment of this application.

[0024] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] The following is combined with Figures 1 to 7 The small target detection method provided in the embodiments of this application will be described in detail.

[0027] Figure 1 This is a schematic diagram of an improved target detection model provided in an embodiment of this application. The target detection model 100 is an improvement on the YOLO architecture as the baseline network architecture, and mainly includes: a backbone network 110, a multi-scale feature fusion module 120, and a detection head 130.

[0028] The YOLO architecture can be either YOLOv8 or YOLOv11; this application does not impose any specific restrictions on it.

[0029] It should be noted that the core improvements in this application are focused on the backbone network 110.

[0030] The backbone network 110 is used to extract multi-level features from the input image. Based on the traditional backbone network, this application embeds two key modules: a feature causal decoupling module 111 and a causal feature fusion module 112.

[0031] The original features extracted by the backbone network 110 are first processed by the feature causal decoupling module 111 to obtain causal features.

[0032] Furthermore, the backbone network 110 outputs causal features at multiple levels (such as shallow, medium, and deep layers). These causal features from different levels are fed into the causal feature fusion module 112 for dynamic adaptive fusion processing to obtain enhanced fused causal features.

[0033] The enhanced causal features obtained through the backbone network 110 at multiple levels are then fed into the multi-scale feature fusion module 120. This multi-scale feature fusion module 120 can employ a Feature Pyramid Network (FPN) or Path Aggregation Network (PAN) structure to fuse the enhanced features at different scales from top to bottom and from bottom to top, ultimately outputting a set of multi-scale fused features with rich semantic and detailed information.

[0034] Furthermore, the multi-scale feature fusion module 120 sends the multi-scale fused features into the detection head 130.

[0035] The detection head 130 receives multi-scale fused features and performs bounding box regression and category classification tasks in parallel, ultimately outputting small target detection results. Specifically, the bounding box regression task is used to accurately predict the location coordinates of small targets, while the category classification task is used to accurately identify the category information of small targets.

[0036] It should be noted that, in order to optimize small target training, the detection head 130 in this application adopts an adaptive hard-easy sample weighted loss function (AHEL).

[0037] Traditional IoU loss treats all samples equally. However, in small object detection scenarios, difficult samples (such as predicted boxes with small IoU to the ground truth boxes, often corresponding to small or occluded objects) coexist with easy samples (predicted boxes with large IoU), and difficult samples are more critical to improving the performance of object detection models. To enable the object detection model to adaptively focus on regression samples of varying difficulty during training, this application reconstructs the basic IoU loss.

[0038] Specifically, let the original value between the predicted bounding box and the ground truth bounding box be IoU. The AHEL loss reconstructs the IoU using a linear interval mapping function defined by a lower threshold d and an upper threshold u, obtaining an adaptive IoU value for loss calculation. AHEL The calculation formula is as follows: in, This represents the adaptive IoU value, where d and u are both adjustable hyperparameters with a value range of [0,1]. IoU represents the original value.

[0039] Furthermore, the loss function value L of the adaptive difficulty-weighted IoU loss is... AHEL Satisfy the following formula: in, This represents the value of the loss function.

[0040] The adaptive difficulty-weighted IoU loss function maps the original IoU values ​​to a new attention space.

[0041] when When a sample is identified as an extremely difficult sample or a negative sample, its... Setting it to 0 corresponds to a maximum loss of 1, prompting the object detection model to correct these seriously erroneous predictions.

[0042] when When it is determined to be an easy sample, its When set to 1, the corresponding loss is 0. During training, the contribution of these samples is reduced, avoiding overfitting of the target detection model to the learned simple cases.

[0043] when At that time, samples deemed to be of medium or high difficulty requiring close attention were... The loss value is linearly related to the original value and is between 0 and 1. The target detection model will provide corresponding gradient feedback according to its difficulty.

[0044] By adjusting the values ​​of d and u, the difficulty range of samples that the object detection model needs to focus on can be flexibly defined. For example, in small object detection tasks, the IoU between the initial predicted bounding box and the ground truth bounding box is usually low due to the difficulty in locating small objects. In this case, lower values ​​of d (e.g., 0.1) and u (e.g., 0.5) can be set, so that a large number of predicted bounding boxes containing small objects with IoU between 0.1 and 0.5 are included in the key learning range, obtaining significant gradient updates, thus forcing the object detection model to work harder to learn how to accurately locate small objects. In contrast, the loss contribution of background or large, easily detectable targets (which usually have high IoU) is suppressed.

[0045] The target detection method provided in this application effectively removes interfering features irrelevant to the target's essence by introducing a feature causal decoupling module, extracting robust causal features and significantly improving the model's generalization ability and detection robustness in complex and variable scenarios. Furthermore, the causal feature fusion module utilizes a dynamic attention mechanism to achieve adaptive weighted fusion of multi-scale features, and combined with residual connections, greatly enhances the representation of the details and semantic information required for small targets. The detection head employs an adaptive easy-sampling weighted loss function, which, by reconstructing the loss calculation method, makes the training process more focused on difficult samples (especially small targets), effectively alleviating the sample imbalance problem and directly improving localization and classification accuracy. The overall solution is based on the mainstream YOLO architecture, and its modular design facilitates integration and deployment, making it highly practical.

[0046] Figure 2 This is a flowchart illustrating the small target detection method provided in the embodiments of this application, as shown below. Figure 2 As shown, the method includes the following: Step 201: Obtain the image to be detected containing small targets.

[0047] Small targets typically refer to targets whose pixel area ratio in an image is less than a certain threshold (e.g., 0.5% to 1%) or whose absolute size is less than a preset pixel value.

[0048] For example, small targets can be vehicles or ships in remote sensing images, cells or microcalcification clusters in medical images, pedestrians at a distance in traffic monitoring scenes, and small insects in natural images, etc., without specific restrictions.

[0049] Specifically, images containing small targets can be captured directly by image acquisition devices (such as cameras, remote sensing satellites, microscope cameras, etc.) or read from storage media.

[0050] Step 202: Input the image to be detected into the improved target detection model to obtain the small target detection result; wherein, the backbone network of the improved target detection model includes a feature causal decoupling module and a causal feature fusion module; the feature causal decoupling module is used to decouple the input features of the image to be detected causally to separate causal features; the causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features; the small target detection result is generated based on the enhanced fused causal features.

[0051] Specifically, such as Figure 1 As shown, the image to be detected is input into the improved object detection model. This improved object detection model first performs convolution, normalization, and activation operations through its backbone network to perform basic feature extraction and obtain the input features of the image to be detected.

[0052] The input features are then processed sequentially through two core modules embedded in the backbone network.

[0053] First, the input features are fed into the feature causal decoupling module. This module performs frequency domain transformation, intervention, and analysis on the input features to separate causal features from the initial features that are strongly correlated with the target's essential attributes and robust to false interference. It also suppresses or removes non-causal features related to non-essential factors, thus obtaining multi-scale causal features.

[0054] Subsequently, the multi-scale causal features separated from different network layers are input into the causal feature fusion module. The causal feature fusion module first aligns the causal features of different layers in terms of spatial and channel dimensions, and then calculates adaptive weights through a dynamic attention mechanism to perform weighted fusion of features from different layers, generating dynamic fused features.

[0055] Finally, the residual connections are combined with the corresponding original hierarchical features to output enhanced fused causal features.

[0056] Subsequently, the enhanced causal features output from each level of the backbone network are fed into the multi-scale feature fusion module of the object detection model. This module fuses and refines the enhanced features at different resolutions through top-down and bottom-up paths, ultimately outputting a set of multi-scale fused features with rich semantic information and fine spatial details.

[0057] Finally, the multi-scale fused features are fed into the detection head. The detection head typically contains multiple parallel convolutional layers, responsible for performing two main tasks on each pre-defined anchor point or grid: Position regression: predicts the coordinate offset and size scaling factor of the bounding box; Category recognition: Predict the probability that the target contained within the bounding box belongs to each predefined category.

[0058] By performing post-processing operations such as confidence screening and non-maximum suppression on all prediction results, the target detection model finally outputs small target detection results.

[0059] It should be noted that small object detection results can be presented in various formats to meet the needs of different applications. For example, small object detection results can be presented in the form of data structures such as lists or arrays, where each detected object instance includes its bounding box location coordinates (such as center point coordinates, width, and height), class label, and a confidence score characterizing the reliability of the detection. In addition, small object detection results can also be presented as a new image with visual annotations (such as bounding boxes and class labels) overlaid on the original image to be detected, or output as a structured data file conforming to specific standards (such as JSON or XML), etc., which are not limited in this application.

[0060] The small target detection method provided in this application achieves automated and lightweight causal feature learning and fusion by setting a feature-causal decoupling module and a causal feature fusion module in the backbone network of the target detection model. The feature-causal decoupling module can separate causal features strongly correlated with small target detection from the input features; the causal feature fusion module dynamically and adaptively fuses the separated causal features to obtain enhanced fused causal features, thereby improving the recognition accuracy of small target features. This, in turn, improves the generalization ability and accuracy stability of small target detection.

[0061] The automation is reflected in the feature processing stage: the feature causal decoupling module automatically completes the causal decoupling of the input features without the need for manual feature separation; Feature fusion stage: The causal feature fusion module automatically realizes dynamic adaptive fusion of separated causal features without the need for manual setting of fusion rules.

[0062] Lightweight design is reflected in: reduced redundant computation: core causal features are separated by feature causal decoupling, redundant features are filtered out, and the computational load of feature processing is reduced; Simplify the fusion process: Perform dynamic adaptive fusion only on valid causal features, avoid processing irrelevant features, and reduce model complexity and resource consumption.

[0063] Figure 3 This is a flowchart illustrating the feature causal decoupling module provided in an embodiment of this application, as shown below. Figure 3 As shown, the method includes the following: Step 301: Perform frequency domain transformation on the input features of the image to be detected to obtain the corresponding frequency domain features, which include phase components and amplitude components.

[0064] Frequency domain transformation refers to the mathematical process of transforming the image to be detected or its input features from the spatial domain representation to the frequency domain representation.

[0065] For example, frequency domain transformation can be achieved through Fourier transform. Through frequency domain transformation, the spatial information of each location in the input features of the image to be detected is transformed into a series of frequency components. The phase component mainly carries stable semantic information such as the structure, shape, and edge position of the target in the image to be detected; while the amplitude component mainly reflects the apparent information of the target features, such as intensity, texture, and lighting conditions, which are easily affected by environmental changes.

[0066] Specifically, applying Fourier transform to the output feature map of a certain intermediate layer of the backbone network yields a complex form of frequency domain features, which can be decomposed into a phase component representing image structural information and an amplitude component representing image appearance intensity.

[0067] Step 302: Keep the phase component unchanged and perform bilinear interpolation on the amplitude component to obtain the frequency domain characteristics after intervention.

[0068] This step aims to implement an automated causal intervention to simulate perturbations to non-causal factors (such as background texture and lighting) while enabling the object detection model to learn essential causal features that remain unchanged by this appearance perturbation.

[0069] Specifically, the phase component obtained from step 301 is kept unchanged, while the amplitude component is subjected to an intervention operation to obtain the frequency domain characteristics after intervention.

[0070] Optionally, the intervention can be performed using bilinear interpolation, without any specific restrictions.

[0071] Specifically, this involves mixing and interpolating the amplitude components of different input samples within the same batch. For example, for the amplitude A of sample a... a And the amplitude A of sample b b The amplitude component A′ after intervention is generated by linearly combining the random weights.

[0072] Interventions simulate the physical process of altering the appearance of an image (dominated by amplitude) while maintaining its intrinsic structure (dominated by phase), thereby achieving "intervention" on non-causal factors.

[0073] It should be noted that, in order to simulate causal factors that remain unchanged under non-causal amplitude disturbances, this application constrains the features before and after the Fourier transform to remain unchanged in dimension, as shown in the following formula.

[0074] in, and These represent the characteristics before and after the Fourier transform, respectively. To eliminate the influence of dimensions, Z-score standardization is further applied. and They represent and The i-th column of the algorithm. k represents the number of images processed in the batch. By maximizing the correlation of features with the same dimension while keeping the dimension unchanged, we simulate that non-causal factors and causal factors are separated. Since causal factors are independent of each other, we minimize the correlation coefficients of different dimensions to achieve their independence.

[0075] That is, F represents the original input features (before Fourier transform), F ∗ This represents the characteristics after undergoing the above frequency domain intervention (phase invariance, amplitude interpolation) and inverse transformation back to the spatial domain.

[0076] To eliminate the influence of dimensions, they can be standardized, for example, using Z-score standardization. Let z... i and Let F and F be the standardized features respectively. ∗ The i-th eigenvector.

[0077] Step 303: Construct a feature correlation matrix based on the frequency domain features and the frequency domain features after intervention.

[0078] To facilitate calculation, this application constructs a feature correlation matrix M, integrating the two formulas from step 302 for calculation. This allows for the calculation of features of the same dimension. and This can be viewed as needing to maximize correlation, while different dimensions need to minimize correlation.

[0079] Specifically, the feature correlation matrix M satisfies the following formula: Where <⋅,⋅> represent the inner product operation. express norm, express The norm of .

[0080] Step 304: Use the feature correlation matrix to separate causal features from non-causal features.

[0081] Specifically, a loss function or constraint is designed and optimized and applied to the feature correlation matrix M constructed in step 303.

[0082] The optimization objective is to maximize the correlation between the diagonal elements of matrix M that correspond to the same feature dimension (i.e., (As large as possible), which forces this dimension to remain highly consistent before and after the intervention, thus learning properties that are invariant to non-causal interventions; at the same time, it minimizes the correlation of off-diagonal elements (i.e., (i≠j as small as possible), which promotes independence between different feature dimensions and avoids redundant entanglement of information.

[0083] Through this joint optimization of "maximizing diagonal correlation and minimizing off-diagonal correlation", the network can automatically decouple input features into intervention-robust causal features and intervention-sensitive non-causal features, thus achieving automated, end-to-end causal representation learning without relying on manually preset causal graphs.

[0084] The small target detection method provided in this application introduces a feature causal decoupling module, which effectively removes interference features that are irrelevant to the essence of the target and extracts robust causal features, significantly improving the model's generalization ability and detection robustness in complex and variable scenarios.

[0085] Figure 4 This is a flowchart illustrating the causal feature fusion module provided in an embodiment of this application, as shown below. Figure 4 As shown, the method includes the following: Step 401: Align the causal features from different network layers. The alignment process includes adjusting the channels of the lower-level causal features and upsampling the higher-level causal features to ensure that the lower-level causal features and the higher-level causal features are consistent in terms of the number of channels and spatial resolution.

[0086] Among them, low-level causal features usually refer to feature maps from shallower layers of the network, which have high spatial resolution, are rich in detailed information, but have a low semantic level.

[0087] High-level causal features refer to feature maps from deeper layers of the network, which have rich semantic information but low spatial resolution.

[0088] To achieve effective integration of the two, alignment processing is required first.

[0089] Specifically, channel number adjustment can be achieved through a 1×1 convolutional layer, transforming the number of channels in the lower-level causal features to be the same as that in the higher-level causal features. Spatial resolution upsampling can be achieved through interpolation methods (such as bilinear interpolation or transposed convolution), expanding the spatial dimensions (height and width) of the higher-level causal features to be consistent with those of the lower-level causal features.

[0090] This step aligns the two types of features in terms of tensor shape, laying the foundation for subsequent element-by-element fusion.

[0091] Step 402: Through the dynamic attention mechanism, the low-level causal features and high-level causal features after alignment are adaptively weighted and fused to obtain dynamic fused features.

[0092] Among them, the dynamic attention mechanism can automatically generate spatial weight maps and / or channel weight maps based on the content of the input features.

[0093] In one embodiment, the aligned two types of features can be concatenated along the channel dimension, and then the importance weights of each spatial location and / or each channel can be calculated through a light quantum network (e.g., a small module containing global average pooling, fully connected layers, and activation functions).

[0094] By recalibrating and weighting the underlying causal features and the high-level causal features using these weights, dynamic fusion features are obtained.

[0095] It should be noted that this step aims to achieve adaptive feature fusion, rather than simple addition or splicing.

[0096] This enables the object detection model to dynamically determine which locations or channels rely more on detailed information (low-level features) or semantic information (high-level features) based on the specific image content, achieving better feature complementarity.

[0097] Step 403: Perform residual connections between the dynamic fusion features and the corresponding static features extracted from the backbone network to output enhanced fusion causal features.

[0098] To ensure training stability and preserve the original, reliable information extracted from the backbone network, this step introduces residual connections.

[0099] Static features refer to the original features extracted directly from the corresponding layer of the backbone network without being processed by the causal feature fusion module.

[0100] The dynamic fusion features obtained in step 402 are added element by element to the static features to achieve residual connection.

[0101] The benefits of this operation are twofold: firstly, it uses static features as a basis, ensuring the stability of information flow and avoiding gradient problems that may occur in deep networks; secondly, the dynamically fused features, as residual terms, provide incremental information enhanced by causal reinforcement and adaptive focusing. When these two are added together, the final output enhanced fused causal feature retains rich original context while integrating refined representations after causal decoupling and dynamic selection, thus simultaneously satisfying the dual requirements of small object detection for accurate localization (depending on details) and accurate classification (depending on semantics). This feature will serve as a key representation for subsequent multi-scale feature fusion or detection head input.

[0102] The small target detection method provided in this application realizes adaptive weighted fusion of multi-scale features through the dynamic attention mechanism of the causal feature fusion module, and combined with residual connections, greatly enhances the expression of details and semantic information required for small targets.

[0103] Figure 5 This is a flowchart illustrating the improved target detection model training and testing method provided in the embodiments of this application. Figure 5 As shown, the method includes the following: Step 501: Obtain the labeled image dataset containing small targets and perform differentiation processing.

[0104] Specifically, after obtaining the image dataset, the dataset is randomly divided into three non-overlapping parts according to a preset ratio: training set, validation set, and test set.

[0105] The training set is used for the main update of the object detection model parameters, the validation set is used to monitor the performance of the object detection model during training, perform hyperparameter tuning and prevent overfitting, and the test set is used to finally evaluate the generalization performance of the object detection model and does not participate in any part of the training.

[0106] Step 502: Perform data augmentation on the training set images.

[0107] Specifically, this application employs an enhancement method based on Fourier transform.

[0108] Specifically, a batch of randomly selected training images are subjected to Fourier transform to convert them to the frequency domain, thereby obtaining their respective amplitude and phase components.

[0109] While keeping the phase component unchanged (because it carries image structural information), linear interpolation is performed on the amplitude components of different images to generate new amplitude components. The new amplitude components are then combined with the original phase components, and a new spatial domain image is generated through inverse Fourier transform.

[0110] For detailed steps, please refer to steps S301 and S302, which will not be elaborated here.

[0111] Step 503: Build and initialize the target detection model.

[0112] Object detection model, i.e. Figure 1 The target detection model in [the context].

[0113] Set the hyperparameters required for training the object detection model, including but not limited to: initial learning rate, learning rate decay strategy (such as cosine annealing), optimizer type (such as AdamW), batch size, weight decay coefficient, batch normalization parameter, and total training epochs, etc., without specific restrictions.

[0114] The backbone network of the object detection model is initialized using the weight file obtained by pre-training the backbone network on a large general dataset.

[0115] The parameters of other newly added modules (such as the feature-causal decoupling module and the causal feature fusion module) can be randomly initialized using standard methods such as Kaiming initialization or Xavier initialization. This can accelerate model convergence and improve training stability.

[0116] Step 504: Training and storing the target detection model.

[0117] The object detection model is trained end-to-end using training and validation sets.

[0118] In each training epoch, data is sampled from the training set, forward propagation is performed to calculate the total loss (including AHEL localization loss and classification loss), and then all model parameters are updated through the backpropagation algorithm and optimizer.

[0119] During training, the model performance is evaluated periodically on the validation set (e.g., the mean average precision mAP is calculated).

[0120] Set training termination conditions; training will stop when any of the following conditions are met: (1) The model’s performance on the validation set reaches the preset expected accuracy threshold; (2) The training has reached the preset maximum number of rounds.

[0121] After training, the optimal model parameters are stored to obtain the final weight file.

[0122] Step 505: Target detection model testing and deployment.

[0123] After the object detection model is trained, it enters the testing and evaluation phase. The model is initialized by loading the optimal weight file saved in step 504.

[0124] The test set images, which are not used in training, are fed into the model with pre-loaded weights for forward inference. The object detection model processes the test images and outputs the final recognition result, which includes the location information (usually represented by bounding box coordinates) and category information for each detected object.

[0125] The final detection performance of the model in this invention is evaluated by analyzing quantitative indicators and qualitative results on the test set. Subsequently, the trained object detection model can be applied to real-world image or video streams to perform small object detection tasks.

[0126] The object detection method provided in this application effectively expands the diversity of training data by dividing the training, validation, and test sets and combining a frequency domain enhancement strategy using Fourier transform. This enables the model to exhibit stronger adaptability and stable detection performance in unseen complex scenes during the testing phase, avoiding overfitting. The complete implementation process, from data preparation, model construction, pre-training initialization to automated training and testing, not only ensures the efficient implementation and reproducibility of the proposed solution but also fully demonstrates its high practicality and engineering feasibility in solving the real-world problem of small object detection.

[0127] The target detection method provided in this application achieves a systematic improvement in the performance of small target detection, and its beneficial effects are specifically reflected in: First, the feature causal decoupling module analyzes the input features at their source, separating causal features that reflect the essential attributes of the target, and effectively suppressing non-causal interference information related to the background and environment. This significantly enhances the purity and robustness of the model's feature representation, fundamentally improving the algorithm's generalization ability when facing unknown or complex scenarios.

[0128] Secondly, a causal feature fusion module is introduced to perform in-depth processing on the extracted causal features. This module not only further filters out potentially residual non-causal information, but more importantly, it adaptively fuses high-resolution detail features from shallow layers and rich semantic features from higher layers through a dynamic attention mechanism and residual connections. This dynamic and adaptive fusion strategy simultaneously meets the stringent requirements of small object detection for both precise localization (detail-dependent) and accurate classification (semantic-dependent), significantly improving the expressive efficiency of the feature pyramid.

[0129] Finally, to address the challenge of imbalanced samples during training, an adaptive IoU loss function weighted by easy and difficult samples was introduced into the detection head. This loss function reconstructs the optimization objective, adaptively tilting the training focus of the model towards difficult samples (many of which are small targets), thereby ensuring that the model can fully learn and improve its detection ability for difficult cases, directly improving the overall detection accuracy, especially the recall and localization accuracy for small targets.

[0130] In summary, the three modules described above do not work in isolation, but rather form a synergistic and optimized organic whole. Feature causal decoupling provides a clean and stable feature foundation for subsequent fusion; dynamic fusion builds upon this foundation to construct a highly discriminative multi-scale feature representation; and the adaptive loss function guides the entire system to focus on the most critical optimization directions at the training level. The combined effect of these three modules effectively addresses the core challenges of small object detection in terms of feature robustness, multi-scale information utilization, and training sample balance, thereby achieving a significant leap in overall performance in complex real-world scenarios.

[0131] Those skilled in the art will understand that the modules and steps in the above embodiments can be implemented by hardware, software, or a combination of both. Any improvements and refinements made to the specific algorithm for feature causal decoupling, the form of the dynamic attention mechanism, the structure of the multi-scale fusion network, and the detailed design of the loss function without departing from the principles of this invention should also be considered within the scope of protection of this application.

[0132] The small target detection device provided in the embodiments of this application is described below. The small target detection device described below can be referred to in correspondence with the small target detection method described above.

[0133] Figure 6 This is a schematic diagram of the small target detection device provided in an embodiment of this application. Figure 6 As shown, this application embodiment provides a small target detection device 600, which may include: The acquisition module 601 is used to acquire the image to be detected containing small targets; The detection module 602 is used to input the image to be detected into the improved target detection model to obtain the small target detection result output by the improved target detection model; The improved target detection model's backbone network includes a feature-causal decoupling module and a causal feature fusion module. The feature-causal decoupling module is used to decouple the input features of the image to be detected causally to separate causal features. The causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features. The small target detection result is generated based on the enhanced fused causal features.

[0134] In one embodiment, the detection module 602 is specifically used for: The input features of the image to be detected are transformed in the frequency domain to obtain the corresponding frequency domain features, which include phase components and amplitude components. The phase component is kept constant, and the amplitude component is subjected to bilinear interpolation to obtain the frequency domain characteristics after the intervention. Construct a feature correlation matrix based on the frequency domain characteristics and the frequency domain characteristics after intervention; The feature correlation matrix is ​​used to separate causal features from non-causal features.

[0135] In yet another embodiment, the detection module 602 is specifically used for: Alignment processing is performed on causal features from different network layers. The alignment process includes channel adjustment of lower-level causal features and upsampling of higher-level causal features to ensure that the lower-level and higher-level causal features are consistent in terms of channel number and spatial resolution. By using a dynamic attention mechanism, the aligned low-level causal features and high-level causal features are adaptively weighted and fused to obtain dynamic fused features. The dynamic fused features are residually connected with the corresponding static features extracted from the backbone network to output enhanced fused causal features.

[0136] In yet another embodiment, the improved target detection model further includes a multi-scale feature fusion module; the multi-scale feature fusion module is used to receive and integrate enhanced fused causal features and output multi-scale fused features.

[0137] In another embodiment, the improved target detection model further includes a detection head; the detection head is used to perform position regression and category recognition processing on multi-scale fused features and output small target detection results; the detection head is optimized and trained using an adaptive easy-sampling weighted IoU loss function.

[0138] In yet another embodiment, the improved object detection model uses the YOLO object detection model as the baseline network architecture.

[0139] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 7As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a small target detection method. This method includes: acquiring an image to be detected containing small targets; inputting the image to be detected into an improved target detection model to obtain a small target detection result; wherein the backbone network of the improved target detection model includes a feature-causal decoupling module and a causal feature fusion module; the feature-causal decoupling module is used to causally decouple the input features of the image to be detected to separate causal features; the causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features; the small target detection result is generated based on the enhanced fused causal features.

[0140] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0141] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the small target detection method provided by the above methods. The method includes: acquiring an image to be detected containing small targets; inputting the image to be detected into an improved target detection model to obtain a small target detection result; wherein the backbone network of the improved target detection model includes a feature causal decoupling module and a causal feature fusion module; the feature causal decoupling module is used to causally decouple the input features of the image to be detected to separate causal features; the causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features; the small target detection result is generated based on the enhanced fused causal features.

[0142] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the small target detection method provided by the above methods. The method includes: acquiring a detection image containing small targets; inputting the detection image to an improved target detection model to obtain a small target detection result; wherein the backbone network of the improved target detection model includes a feature causal decoupling module and a causal feature fusion module; the feature causal decoupling module is used to causally decouple the input features of the detection image to separate causal features; the causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features; the small target detection result is generated based on the enhanced fused causal features.

[0143] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting small targets, characterized in that, The method includes: Acquire the image to be detected that contains small targets; The image to be detected is input into the improved target detection model to obtain the small target detection result output by the improved target detection model; The improved target detection model's backbone network includes a feature-causal decoupling module and a causal feature fusion module. The feature-causal decoupling module is used to decouple the input features of the image to be detected causally to separate causal features. The causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features. The small target detection result is generated based on the enhanced fused causal features.

2. The small target detection method according to claim 1, characterized in that, The feature causal decoupling module is used to perform causal decoupling on the input features of the image to be detected to separate causal features, including: The input features of the image to be detected are transformed in the frequency domain to obtain the corresponding frequency domain features, which include phase components and amplitude components. The phase component is kept constant, and the amplitude component is subjected to bilinear interpolation to obtain the frequency domain characteristics after the intervention. Construct a feature correlation matrix based on the frequency domain features and the frequency domain features after intervention; The feature correlation matrix is ​​used to separate causal features from non-causal features.

3. The small target detection method according to claim 2, characterized in that, The causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features, including: Alignment processing is performed on the causal features from different network layers. The alignment processing includes: channel adjustment of the lower-level causal features and upsampling of the higher-level causal features to make the lower-level causal features consistent with the higher-level causal features in terms of channel number and spatial resolution. By using a dynamic attention mechanism, the aligned low-level causal features and the high-level causal features are adaptively weighted and fused to obtain dynamic fused features. The dynamic fusion features are residually connected with the corresponding level static features extracted from the backbone network to output the enhanced fusion causal features.

4. The small target detection method according to claim 1, characterized in that, The improved target detection model also includes a multi-scale feature fusion module; The multi-scale feature fusion module is used to receive and integrate the enhanced fusion causal features and output multi-scale fusion features.

5. The small target detection method according to claim 4, characterized in that, The improved target detection model also includes a detection head; The detection head is used to perform position regression and category recognition processing on the multi-scale fused features, and output the small target detection results; The detection head is optimized and trained using an adaptive IoU loss function that weights samples of varying difficulty.

6. The small target detection method according to any one of claims 1 to 5, characterized in that, The improved target detection model uses the YOLO target detection model as the baseline network architecture.

7. A small target detection device, characterized in that, include: The acquisition module is used to acquire images to be detected that contain small targets; The detection module is used to input the image to be detected into the improved target detection model to obtain the small target detection result output by the improved target detection model; The improved target detection model's backbone network includes a feature-causal decoupling module and a causal feature fusion module. The feature-causal decoupling module is used to decouple the input features of the image to be detected causally to separate causal features. The causal feature fusion module is used to dynamically and adaptively fuse the separated causal features to obtain enhanced fused causal features. The small target detection result is generated based on the enhanced fused causal features.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the small target detection method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the small target detection method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the small target detection method as described in any one of claims 1 to 6.