A small target detection method, system, device and medium
By combining a two-stage detection architecture with a feature extraction network, the problems of low computational efficiency and insufficient accuracy in small target detection are solved, enabling fast and accurate detection of small targets in high-resolution images. This technology is suitable for applications such as mosquito monitoring, industrial micro-defect detection, and remote sensing image recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MOMING INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies suffer from low computational efficiency, insufficient extraction of weak edge features, weak ability to preserve multi-scale texture details, and difficulty in optimizing small target localization in small target detection. They are particularly difficult to meet the requirements of real-time or high-throughput processing in high-resolution images.
A two-stage detection architecture is adopted, which combines a multi-directional edge gradient enhancement feature extraction network and a cross-stage texture detail preservation network. A lightweight coarse detection model is used to quickly locate potential small target regions, and a fine detection model is used for accurate detection. The localization accuracy is optimized by combining a hybrid bounding box loss function.
It significantly improves the speed and accuracy of small target detection, and solves the problems of high computational cost, insufficient extraction of weak edge features and poor positioning accuracy in high-resolution images. It is suitable for mosquito monitoring, industrial micro-defect detection, small target recognition in remote sensing images and long-distance small object detection in autonomous driving scenarios.
Smart Images

Figure CN122115828A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of small target detection technology, and in particular to a method, system, device and medium for small target detection. Background Technology
[0002] Small object detection has long been a technical challenge in the fields of computer vision and object detection. It aims to accurately locate and identify targets that occupy very few pixels and have weak visual features from images. With the development of deep learning technology, object detection methods based on convolutional neural networks have achieved significant success on targets of conventional scale. However, when directly applied to small object detection, they still face many severe challenges, resulting in detection accuracy and efficiency that cannot meet the needs of practical applications.
[0003] Small object detection is a technical challenge due to the extremely low pixel ratio and weak visual features of the targets. High-resolution images are often required to capture subtle features, but this conflicts with limited computing resources. Directly performing full-image deep network inference incurs huge computational overhead and memory consumption, severely limiting detection speed and making it difficult to meet real-time or high-throughput processing requirements. Simultaneously, the inherent scarcity of features in small objects makes them difficult to accurately represent in complex backgrounds. The severe lack of information such as appearance and texture makes it difficult for feature extraction networks to learn robust and discriminative representations. Existing deep learning detection frameworks have three limitations in this task: First, standard convolution is insufficient in responding to weak edge gradients at the pixel level and with sensitive orientation, leading to a decline in small object localization and shape perception capabilities; second, in the multi-scale feature fusion process, downsampling easily dilutes small object information, while upsampling and simple concatenation operations are insufficient to effectively recover key texture details; third, the widely used cross-union ratio (CUI) based loss function is extremely sensitive to small objects, with even small positional deviations causing drastic numerical fluctuations or zeroing, failing to provide stable gradients, resulting in poor localization accuracy and difficulty in convergence.
[0004] In summary, existing technologies for small target detection in high-resolution images generally suffer from core drawbacks such as low computational efficiency, insufficient extraction of weak edge features, poor preservation of multi-scale texture details, and difficulty in optimizing small target localization. These shortcomings are particularly pronounced in practical applications such as mosquito monitoring, industrial micro-defect detection, small target recognition in remote sensing images, and long-distance small object detection in autonomous driving scenarios, severely limiting the performance and practicality of detection systems. Therefore, there is an urgent need for a novel detection method that can significantly improve the perception of small target edges and texture features, as well as localization accuracy, while maintaining detection speed. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, device and medium for small target detection, which can solve the problems of slow detection speed and low detection accuracy caused by high computational cost of high-resolution images, small mosquito size and weak texture.
[0006] To achieve the above objectives, the present invention provides a small target detection method, comprising the following steps: Step S1: Obtain the high-resolution image to be detected; Step S2: Input the high-resolution image to be detected into the coarse detection model to obtain the coarse detection result containing potential small target regions, and crop the low-resolution sub-image region based on the coarse detection result; Step S3: Input the low-resolution sub-image region into the fine detection model to obtain the accurate detection result of the small target, and map the coordinates of the accurate detection result back to the coordinate system of the original high-resolution image; The coarse detection model includes an edge detection operator, a contour detection unit, and a region cropping unit; the fine detection model includes a multi-directional edge gradient enhancement feature extraction network, a cross-stage texture detail preservation network, and a decoder connected in sequence.
[0007] Preferably, the multi-directional edge gradient enhancement feature extraction network includes: multiple multi-directional edge gradient enhancement convolutional modules and several convolutional residual modules; The image feature resolution decreases sequentially from the first multi-directional edge gradient enhancement convolutional module to the last multi-directional edge gradient enhancement convolutional module; the middle of the second multi-directional edge gradient enhancement convolutional module to the last multi-directional edge gradient enhancement convolutional module is connected by several convolutional residual modules.
[0008] Preferably, the multi-directional edge gradient enhancement convolutional module includes sequentially connected... Convolutional layers and edge gradient-enhanced convolutional layers; The edge gradient enhancement convolutional layer includes: a standard convolutional branch, a central difference convolutional branch, an angular difference convolutional branch, a horizontal difference convolutional branch, and a vertical difference convolutional branch set in parallel, as well as a fusion unit for weighted summation of the weights and biases of each branch convolutional kernel to obtain an equivalent convolutional kernel; The central difference convolution branch models the difference between the weights at the center of the original convolution kernel and the sum of the weights at other locations; the angular difference convolution branch models the response difference between adjacent pixels in the diagonal direction; the horizontal difference convolution branch replicates the one-dimensional convolution kernel in the horizontal direction and constructs an equivalent... The convolution kernel method combines positive and negative gradients in the horizontal direction for modeling; the vertical difference convolution branch replicates and constructs an equivalent layer in the vertical direction using a one-dimensional convolution kernel. The convolution kernel method is used to model the combination of positive and negative gradients in the vertical direction; The fusion unit is used to merge the kernel parameters of each branch into a single equivalent value. The convolution kernel is used to perform a convolution operation on the input features.
[0009] Preferably, the convolutional residual module includes: a first Convolutional layers, feature splitting units, several cascaded residual units, feature splicing units, and the second... Convolutional layer; First Convolutional layers are used to perform convolution operations on the input features. The feature splitting unit divides the output features into first-path features and second-path features along the channel dimension. The first-path features are directly input to the feature concatenation unit. The second-path features are input to several cascaded residual units for feature extraction. The output features of each residual unit are input to the feature concatenation unit and also serve as the input to the next residual unit. The feature concatenation unit is used to concatenate the first-path features, the second-path features, and the output features of each residual unit along the channel dimension. Convolutional layers are used to fuse and reduce the dimensionality of the concatenated features; The residual unit includes a first unit connected in sequence. Convolutional layer and second Convolutional layer, second The output of the convolutional layer is connected to the first The inputs of the convolutional layer are connected by adders to form residual connections.
[0010] Preferably, the cross-stage texture detail preservation network includes: a first upsampling unit, a second upsampling unit, a cross-stage texture detail feature fusion module, and a first downsampling unit; The first upsampling unit upsamples the highest-level feature map of the multi-directional edge gradient enhancement feature extraction network and concatenates it with the intermediate-level feature map in the channel dimension to generate a medium-scale feature map. The second upsampling unit upsamples the medium-scale feature map and concatenates it with the shallow feature map along the channel dimension to generate a small-scale feature map. The cross-stage texture detail feature fusion module enhances medium-scale and small-scale feature maps; The outputs of the first upsampling unit and the second upsampling unit are connected to the input of the cross-stage texture detail feature fusion module; The first downsampling unit downsamples the medium-scale feature map output by the cross-stage texture detail feature fusion module.
[0011] Preferably, the cross-stage texture detail feature fusion module includes: the third Convolutional layer, channel segmentation unit, identity mapping branch, deep feature transformation branch, channel splicing unit, and fourth Convolutional layer; third The convolutional layer is used to expand the number of input feature channels and map them to a preset number of intermediate channels; the channel segmentation unit is used to divide the intermediate channels into a first feature part and a second feature part in the channel dimension; the identity mapping branch directly transmits the first feature part to the channel concatenation unit without performing additional convolution operations. The deep feature transformation branch consists of several cascaded partial channel bottleneck structures, which are used to perform deep nonlinear transformations on the second feature part. The partial channel bottleneck structure uses partial channel convolution, which only performs convolution operations on a portion of the input feature channels, while the remaining channels remain unchanged. The channel splicing unit is used to splice the features output by the cross-stage identity mapping branch and the features output by the deep feature transform branch in the channel dimension; fourth Convolutional layers are used to perform channel fusion and dimensionality reduction on the stitched features, outputting the final texture detail-preserving features.
[0012] Preferably, the decoder is a multi-scale perceptual decoder, which includes detection branches connected to the medium-scale feature map and the small-scale feature map output by the cross-stage texture detail preservation network, respectively. Each detection branch includes a category classification sub-branch and a bounding box regression sub-branch; During the training phase, the bounding box regression sub-branch of the decoder is optimized using a hybrid bounding box loss function; The hybrid bounding box loss function is a weighted sum of a loss term based on the cross-union ratio and a loss term based on the normalized Gauss-Wasestein distance.
[0013] The present invention also provides a small target detection system, comprising: The image acquisition module is used to acquire high-resolution images of the object to be detected. The coarse detection module, connected to the image acquisition module, is used to input the high-resolution image to be detected into the coarse detection model, obtain coarse detection results containing potential small target regions, and crop low-resolution sub-image regions based on the coarse detection results; the coarse detection model includes an edge detection operator, a contour detection unit, and a region cropping unit; The fine detection module, connected to the coarse detection module, is used to input low-resolution sub-image regions into the fine detection model to obtain accurate detection results for small targets, and to map the coordinates of the accurate detection results back to the coordinate system of the original high-resolution image. The fine detection model includes a multi-directional edge gradient enhancement feature extraction network, a cross-stage texture detail preservation network, and a decoder connected in sequence. Among them, the multi-directional edge gradient enhancement feature extraction network is used to extract semantic information, detailed texture and edge features in the image to be detected, and to obtain a feature map containing semantic information and texture details; the cross-stage texture detail preservation network is used to preserve the texture details of feature maps at different scales; the decoder is used to output the detection results of small targets based on the feature map output by the texture detail preservation network and map it back to the original coordinates.
[0014] The present invention also provides a computer device, including: a memory and a processor; the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described small target detection method.
[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the small target detection method described above.
[0016] Therefore, the present invention employs the above-described method, system, device, and medium for small target detection, and the beneficial technical effects are as follows: (1) To address the problem of high computational overhead for full-image inference in high-resolution images, this invention first utilizes a lightweight coarse detection model (including Sobel operator edge detection and contour detection) to quickly locate potential small target regions and crop out low-resolution sub-images, so that the subsequent computationally intensive fine detection process is only performed on local regions. This design effectively solves the contradiction between computational resources and detection speed, realizes efficient processing of high-resolution images, and meets the needs of real-time or high-throughput application scenarios.
[0017] (2) To address the issues of weak edge features and easy loss of texture details in small targets, the multi-directional edge gradient enhancement feature extraction network in the precision detection model strengthens the response to weak pixel-level edges and multi-directional contours by fusing multiple differential convolutions; the cross-stage texture detail preservation network, through feature fusion and identity mapping mechanisms, integrates deep semantic information while preserving subtle textures from shallow layers to the greatest extent. The synergistic effect of these two networks effectively overcomes the deficiencies of scarce features in small targets and insufficient representation capabilities of standard convolutions, enhancing the model's ability to distinguish small targets in complex backgrounds.
[0018] (3) To address the problem that traditional IoU loss functions are too sensitive to small target position deviations and provide unstable gradients, this invention employs a hybrid bounding box loss function (combining IoU loss and NWD loss) in decoder training. The NWD loss models the bounding box as a Gaussian distribution and measures its distance. Even if the predicted box does not overlap with the ground truth box, it can still provide an effective gradient signal, thereby significantly improving the regression accuracy of small target bounding boxes, accelerating model convergence, and improving overall detection performance. Attached Figure Description
[0019] Figure 1 This is a flowchart of a small target detection method according to the present invention; Figure 2 This is a schematic diagram of the mosquito detection model. Figure 3 This is a schematic diagram of the multi-directional edge gradient enhancement module. Figure 4 This is a schematic diagram of the structure of the convolutional residual module; Figure 5 This is a schematic diagram of the residual element structure; Figure 6 This is a structural diagram of the cross-stage texture detail feature fusion module; Figure 7 This is a schematic diagram of the structure of a multi-scale decoder. Detailed Implementation
[0020] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0021] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0022] Example 1 This embodiment uses mosquito detection as an example for illustration. Figure 1 As shown, a small target detection method includes the following steps: Step S1: Obtain the high-resolution image to be detected.
[0023] Step S2: Input the high-resolution image obtained in step S1 into the coarse detection model. This model first uses the Sobel operator for edge detection, then performs closed contour detection to locate candidate regions in the image that may contain small targets. Finally, it crops these candidate regions from the original high-resolution image based on their coordinates, forming a series of low-resolution sub-image regions. This step aims to quickly focus on potential targets, avoiding intensive computation on the entire image, thereby significantly improving processing efficiency.
[0024] Step S3: Perform fine-tuning and result mapping on the cropped area.
[0025] The low-resolution sub-image region obtained in step S2 is input into the fine detection model for accurate identification and localization. For example... Figure 2 As shown, the precision detection model consists of a multi-directional edge gradient enhancement feature extraction network, a cross-stage texture detail preservation network, and a decoder.
[0026] The multi-directional edge gradient feature extraction network includes multiple sequentially connected multi-directional edge gradient enhancement modules (corresponding to...). Figure 2The system consists of MEEGC and several convolutional residual modules. The output of the last convolutional residual module is connected to the input of the cross-stage texture detail preservation network; the output of the second convolutional residual module is connected to the input of the upsampling layer after the first cross-stage texture detail feature fusion network; the output of the third convolutional residual module is connected to the input of the upsampling layer after the second cross-stage texture detail feature fusion network; and a multi-directional edge gradient enhancement module is used to extract mosquito texture and edge features from the input image. Figure 3 An example is given, in which a multi-directional edge gradient feature extraction network uses 5 layers of multi-directional edge gradient enhancement modules, with image feature resolutions from left to right being 1 / 2, 1 / 4, 1 / 8, 1 / 16, and 1 / 32 respectively. The output of each multi-directional edge gradient enhancement module is shown in Equation (1).
[0027] (1); in, This represents the output of the l-th layer of the multi-directional edge gradient enhancement module; when l=0, This represents the input mosquito image; This represents a multi-directional edge gradient enhancement module.
[0028] The multi-directional edge gradient enhancement module further improves the model's ability to extract defect textures and edge features. This module deploys four differential convolutions (central, angular, horizontal, and vertical differential convolutions) and one standard convolution in parallel. The four different differential convolutions are used to enhance edge gradient level information, while the standard convolution is used to obtain intensity level information. Furthermore, it utilizes reparameterization techniques to equivalently convert the detail enhancement convolution into a normal convolution without additional parameters or computational cost.
[0029] like Figure 3 As shown, the multi-directional edge gradient enhancement convolution module includes sequentially connected... Convolutional layers and edge gradient-enhanced convolutional layers. The edge gradient-enhanced convolutional layer contains five branches arranged in parallel: a standard convolutional branch, a central difference convolutional branch, an angular difference convolutional branch, a horizontal difference convolutional branch, and a vertical difference convolutional branch.
[0030] (2); in, Indicates the input feature map; Representation Standard convolution; , , , These represent central difference, angular difference, horizontal difference, and vertical difference convolutions, respectively. , , , This represents the weight coefficient of each branch. The calculation formula for each differential convolution is described in detail below. The receptive field region of the convolution kernel is , Indicates the position of the center pixel. express The neighboring pixel positions in the middle, This indicates the kernel weights at the corresponding positions. This represents the pixel value at the corresponding location.
[0031] Central difference convolution is used to capture the gradient changes of surrounding pixels relative to the central pixel within a local region, highlighting point-like or subtle texture features. Its calculation formula is as follows: (3); in, Indicates the position of the center pixel. The value obtained after central difference convolution at that location.
[0032] Angular difference convolution is used to capture gradient changes along the rotation direction. Its calculation formula is as follows: (4); in, Indicates the location The value obtained after angular difference convolution at that location; This represents the angle coefficient used to adjust the weighting of angular direction differences; This indicates the position of the next neighboring pixel in the rotation direction.
[0033] Horizontal difference convolution focuses on extracting vertical edge features (i.e., regions where grayscale changes occur abruptly in the horizontal direction). It uses 1D convolution kernel parameters to generate 2D difference weights. The calculation formula is as follows: (5); in, Indicates the location The value obtained after horizontal difference convolution at that location; express Row index in the receptive field of the convolution kernel; Indicates the first The learnable convolutional kernel weights corresponding to each row; Indicates the first In a row, the coordinates of the pixel adjacent to the left of the center pixel; Indicates the first In a row, the coordinates of the pixel adjacent to the right of the center pixel.
[0034] Vertical difference convolution focuses on extracting horizontal edge features (i.e., regions where grayscale changes occur vertically). Its calculation formula is as follows: (6); in, Indicates the location The value obtained after vertical difference convolution at that location; express The column index in the receptive field of the convolution kernel is the same as the value in formula (5); Indicates the first In the column, the coordinates of the pixel adjacent to the center pixel; Indicates the first In the column, the coordinates of the pixels adjacent to the center pixel.
[0035] The convolutional residual module is connected between the MEEGC modules, such as... Figure 4 As shown, the convolutional residual module includes a first Convolutional layers, feature splitting units, several cascaded residual units, feature splicing units, and the second... Convolutional layers are used to extract deep semantic information while preserving gradients.
[0036] First Convolutional layers are used to perform convolution operations on the input features. The feature splitting unit divides the output features into first-path features and second-path features along the channel dimension. The first-path features are directly input to the feature concatenation unit. The second-path features are input to several cascaded residual units for feature extraction. The output features of each residual unit are input to the feature concatenation unit and also serve as the input to the next residual unit. The feature concatenation unit is used to concatenate the first-path features, the second-path features, and the output features of each residual unit along the channel dimension. Convolutional layers are used to fuse and reduce the dimensionality of the concatenated features; like Figure 5 As shown, the residual unit includes a first unit connected in sequence. Convolutional layer and second Convolutional layer, second The output of the convolutional layer is connected to the first The inputs of the convolutional layer are connected by adders to form residual connections.
[0037] A cross-stage texture detail preservation network is used to fuse features at different scales while preserving texture details. It includes a first upsampling unit, a second upsampling unit, a cross-stage texture detail feature fusion module, and a first downsampling unit. For example... Figure 6 As shown, the cross-stage texture detail feature fusion module is designed to reduce computational redundancy. It includes a third... Convolutional layer, channel segmentation unit, identity mapping branch, deep feature transformation branch, channel splicing unit, and fourth Convolutional layers. Unlike standard convolutions that operate on all input channels, cross-stage texture detail preservation networks utilize the redundancy between feature map channels, performing spatial convolutions only on a subset of channels. Their computational flow is shown in equations (7) and (8): (7); (8); in, This represents the intermediate feature map after partial convolution and concatenation. This represents the final output feature map of the CSTDFM module; Represents a non-linear activation function; The first feature part (deep feature transformation branch participates in convolution) is the first feature part. The second feature part (the identity mapping branch remains unchanged); express Partial channel convolution operation. The deep feature transformation branch only operates on a subset of channels, which significantly reduces FLOPs while preserving the low-level texture details in the original features through the identity mapping branch. This is crucial for recognizing the subtle features of mosquitoes.
[0038] like Figure 7 As shown, the multi-scale decoder employs a decoupled head architecture design, aiming to improve detection performance and reduce computational overhead for small targets such as mosquitoes. This multi-scale decoder outputs prediction results only at downsampling scales of 1 / 4 and 1 / 8, optimizing and focusing computational resources by discarding the 1 / 32 and 1 / 16 branches, which contribute very little to small target detection. The category classification sub-branch uses convolutional layers to map the feature map to the category confidence of the mosquito target; the bounding box regression sub-branch uses convolutional layers to predict the distribution parameters of the mosquito target bounding box, and decodes the distribution parameters into the center coordinates and length and width dimensions of the bounding box through integration.
[0039] like Figure 7 As shown, in the category classification sub-branch, the input features sequentially pass through two sets of... Depthwise separable convolution and Lightweight convolutional combinations are used to extract deep semantic information while reducing the number of parameters, followed by the use of a... Two-dimensional convolutional layers map feature maps to class confidence scores for mosquito targets. In the parallel bounding box regression sub-branch, the input features are processed through two consecutive layers... Standard convolutional layers perform spatial feature enhancement, followed by... A two-dimensional convolutional layer predicts the distribution parameters of the mosquito target bounding box, and finally combines integral operations to decode the distribution parameters into the center coordinates and length and width dimensions of the bounding box, thereby achieving accurate representation of the target location. Through the above decoupling structure and scale filtering mechanism, this decoder significantly improves the feature capture capability for extremely small-scale targets while ensuring detection accuracy.
[0040] Finally, the coordinates of the detection boxes output by the precision detection model are mapped back to the coordinate system of the original high-resolution image based on the cropping offset, thus completing the final detection.
[0041] During the training phase, to further improve the detection performance for small targets such as mosquitoes, the bounding box regression sub-branch of the decoder is optimized using a hybrid bounding box loss function. This loss function... Loss term based on intersection-union ratio And loss term based on normalized Gaussian Wasserstein distance The weighted composition is as follows: (9); in, Indicates the weighting coefficient; To address the issue of small targets being extremely sensitive to IoU, the calculation steps are as follows: First, the prediction box and real frame Modeled as a two-dimensional Gaussian distribution corresponding to the prediction box Two-dimensional Gaussian distribution corresponding to the true bounding box ,in, This represents the x-coordinate of the center point of the prediction box. This represents the y-coordinate of the center point of the prediction box. This indicates the width of the prediction box. Indicates the height of the prediction box. This represents the x-coordinate of the center point of the true bounding box. This represents the y-coordinate of the center point of the true bounding box. This represents the width of the actual bounding box. Indicates the height of the actual bounding box. This represents the mean vector of the Gaussian distribution, i.e., the center coordinates of the predicted bounding box. The covariance matrix representing the Gaussian distribution is determined by the width and height of the prediction box. This represents the mean vector of a Gaussian distribution, i.e., the center coordinates of the true bounding box. The covariance matrix representing the Gaussian distribution is determined by the width and height of the ground truth box.
[0042] Then, calculate the Wasserstein distance between the two Gaussian distributions. As shown below: (10); in, This represents the square of the Euclidean distance. This represents a measure of the difference between the covariance matrices. Finally, the normalized loss is obtained through a nonlinear mapping, as shown below: (11); in, It is a constant. Transform the unbounded Wasserstein distance into a normalized similarity measure within the (0,1) interval. By measuring the distance between distributions rather than just calculating the overlapping area, effective gradient information can be provided even when the predicted box and the ground truth box have no overlap or very little overlap, thus significantly improving the convergence speed and accuracy of detecting tiny mosquito targets.
[0043] To verify the effectiveness of the algorithm proposed in this application, a dedicated dataset containing 1200 high-resolution mosquito images was constructed, with an image resolution of [missing information]. The dataset was divided into a training set (1000 images) and a test set (200 images). The experimental environment was configured with an NVIDIA RTX 4090 GPU, and the software environment was based on Python 3.7 and PyTorch 1.26 framework. To ensure fairness in the comparison, all comparison methods used the same training configuration: batch size set to 8, no pre-trained weights loaded, SGD as the optimizer (momentum of 0.937, weight decay of 0.0005), initial learning rate lr0=0.01, final learning rate decay coefficient lrf=0.01, and uniform training for 300 epochs. The final experimental results are shown in Table 1.
[0044] Table 1. Performance comparison of different algorithms on the mosquito dataset.
[0045] The following conclusions can be drawn from the data in Table 1. Compared with the existing YOLO11 and YOLO12 models, this method achieves significant advantages in all accuracy metrics. Specifically, the mAP@0.5 of this method reaches 0.913, which is an improvement of 25.8% and 29.2% compared with YOLO11 (0.655) and YOLO12 (0.621), respectively. This indicates that the improved algorithm has stronger robustness in feature extraction and target localization. In small target detection tasks such as mosquitoes, recall is a key indicator of whether the algorithm "misses detections". The recall of the comparison models (YOLO11 / 12) is generally low (0.55-0.57), indicating that they have difficulty capturing small mosquito features in the image. The recall of this method is as high as 0.835, an improvement of nearly 30%. This is mainly due to the preservation of texture details of different layers by the CSTDFM module and the effective optimization of the NWD loss function for small target position deviations. While maintaining high accuracy, this method also demonstrates excellent real-time performance. The inference time is only 74ms, which shows that the coarse-to-fine network structure effectively reduces computational redundancy, making it more suitable for deployment on resource-constrained devices or devices with high real-time requirements.
[0046] In this embodiment, a multi-directional edge gradient enhancement feature extraction network is used to extract the weak edge features of mosquitoes. A lightweight cross-stage texture detail preservation network is used to reduce the amount of computation and prevent the loss of fine textures. The NWD loss function is combined to optimize the localization of small targets. Finally, the problem of slow detection speed and low accuracy of mosquitoes under high-resolution images is effectively solved.
[0047] Example 2 A small target detection system, comprising: The image acquisition module is used to acquire high-resolution images of the object to be detected. The coarse detection module, connected to the image acquisition module, is used to input the high-resolution image to be detected into the coarse detection model, obtain coarse detection results containing potential small target regions, and crop low-resolution sub-image regions based on the coarse detection results; the coarse detection model includes an edge detection operator, a contour detection unit, and a region cropping unit; The fine detection module, connected to the coarse detection module, is used to input low-resolution sub-image regions into the fine detection model to obtain accurate detection results for small targets, and to map the coordinates of the accurate detection results back to the coordinate system of the original high-resolution image. The fine detection model includes a multi-directional edge gradient enhancement feature extraction network, a cross-stage texture detail preservation network, and a decoder connected in sequence. Among them, the multi-directional edge gradient enhancement feature extraction network is used to extract semantic information, detailed texture and edge features in the image to be detected, and to obtain a feature map containing semantic information and texture details; the cross-stage texture detail preservation network is used to preserve the texture details of feature maps at different scales; the decoder is used to output the detection results of small targets based on the feature map output by the texture detail preservation network and map it back to the original coordinates.
[0048] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part 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 invention. 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.
[0049] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0050] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0051] It is worth noting that all contents not described in detail in this invention are existing technologies and are well known to those skilled in the art.
[0052] Therefore, this invention employs the aforementioned small target detection method, system, device, and medium. By constructing a coarse-fine two-stage detection architecture, combined with multi-directional edge gradient enhancement feature extraction, cross-stage texture detail preservation, and hybrid loss optimization based on normalized Gaussian Wasserstein distance, it effectively solves the problems of high computational overhead, insufficient extraction of weak edge and texture features, and poor positioning accuracy in small target detection under high-resolution images. This achieves the effect of significantly improving the accuracy of small target detection while ensuring detection speed.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for detecting small targets, characterized in that, Includes the following steps: Step S1: Obtain the high-resolution image to be detected; Step S2: Input the high-resolution image to be detected into the coarse detection model to obtain the coarse detection result containing potential small target regions, and crop the low-resolution sub-image region based on the coarse detection result; Step S3: Input the low-resolution sub-image region into the fine detection model to obtain the accurate detection result of the small target, and map the coordinates of the accurate detection result back to the coordinate system of the original high-resolution image; The coarse detection model includes an edge detection operator, a contour detection unit, and a region cropping unit; the fine detection model includes a multi-directional edge gradient enhancement feature extraction network, a cross-stage texture detail preservation network, and a decoder connected in sequence.
2. The small target detection method according to claim 1, characterized in that, The multi-directional edge gradient enhancement feature extraction network includes: multiple multi-directional edge gradient enhancement convolutional modules and several convolutional residual modules; The image feature resolution decreases sequentially from the first multi-directional edge gradient enhancement convolutional module to the last multi-directional edge gradient enhancement convolutional module; the middle of the second multi-directional edge gradient enhancement convolutional module to the last multi-directional edge gradient enhancement convolutional module is connected by several convolutional residual modules.
3. The small target detection method according to claim 2, characterized in that, The multi-directional edge gradient enhancement convolution module includes sequentially connected Convolutional layers and edge gradient-enhanced convolutional layers; The edge gradient enhancement convolutional layer includes: a standard convolutional branch, a central difference convolutional branch, an angular difference convolutional branch, a horizontal difference convolutional branch, and a vertical difference convolutional branch set in parallel, as well as a fusion unit for weighted summation of the weights and biases of each branch convolutional kernel to obtain an equivalent convolutional kernel; The central difference convolution branch models the difference between the weights at the center of the original convolution kernel and the sum of the weights at other locations; the angular difference convolution branch models the response difference between adjacent pixels in the diagonal direction; the horizontal difference convolution branch replicates the one-dimensional convolution kernel in the horizontal direction and constructs an equivalent... The convolution kernel method combines positive and negative gradients in the horizontal direction for modeling; the vertical difference convolution branch replicates and constructs an equivalent layer in the vertical direction using a one-dimensional convolution kernel. The convolution kernel method is used to model the combination of positive and negative gradients in the vertical direction; The fusion unit is used to merge the kernel parameters of each branch into a single equivalent value. The convolution kernel is used to perform a convolution operation on the input features.
4. The small target detection method according to claim 2, characterized in that, The convolutional residual module includes: First Convolutional layers, feature splitting units, several cascaded residual units, feature splicing units, and the second... Convolutional layer; First Convolutional layers are used to perform convolution operations on the input features. The feature splitting unit divides the output features into first-path features and second-path features along the channel dimension. The first-path features are directly input to the feature concatenation unit. The second-path features are input to several cascaded residual units for feature extraction. The output features of each residual unit are input to the feature concatenation unit and also serve as the input to the next residual unit. The feature concatenation unit is used to concatenate the first-path features, the second-path features, and the output features of each residual unit along the channel dimension. Convolutional layers are used to fuse and reduce the dimensionality of the concatenated features; The residual unit includes a first unit connected in sequence. Convolutional layer and second Convolutional layer, second The output of the convolutional layer is connected to the first The inputs of the convolutional layer are connected by adders to form residual connections.
5. The small target detection method according to claim 1, characterized in that, The cross-stage texture detail preservation network includes: a first upsampling unit, a second upsampling unit, a cross-stage texture detail feature fusion module, and a first downsampling unit; The first upsampling unit upsamples the highest-level feature map of the multi-directional edge gradient enhancement feature extraction network and concatenates it with the intermediate-level feature map in the channel dimension to generate a medium-scale feature map. The second upsampling unit upsamples the medium-scale feature map and concatenates it with the shallow feature map along the channel dimension to generate a small-scale feature map. The cross-stage texture detail feature fusion module enhances both medium-scale and small-scale feature maps respectively; The first downsampling unit downsamples the medium-scale feature map output by the cross-stage texture detail feature fusion module; The outputs of the first upsampling unit and the second upsampling unit are connected to the input of the cross-stage texture detail feature fusion module.
6. The small target detection method according to claim 1, characterized in that, The cross-stage texture detail feature fusion module includes: the third Convolutional layer, channel segmentation unit, identity mapping branch, deep feature transformation branch, channel splicing unit, and fourth Convolutional layer; third The convolutional layer is used to expand the number of input feature channels and map them to a preset number of intermediate channels; the channel segmentation unit is used to divide the intermediate channels into a first feature part and a second feature part in the channel dimension; the identity mapping branch directly transmits the first feature part to the channel concatenation unit without performing additional convolution operations. The deep feature transformation branch consists of several cascaded partial channel bottleneck structures, which are used to perform deep nonlinear transformations on the second feature part. The partial channel bottleneck structure uses partial channel convolution, which only performs convolution operations on a portion of the input feature channels, while the remaining channels remain unchanged. The channel splicing unit is used to splice the features output by the cross-stage identity mapping branch and the features output by the deep feature transform branch in the channel dimension; fourth Convolutional layers are used to perform channel fusion and dimensionality reduction on the stitched features, outputting the final texture detail-preserving features.
7. The small target detection method according to claim 2, characterized in that, The decoder is a multi-scale perceptual decoder, which includes detection branches connected to the medium-scale feature maps and small-scale feature maps of the output of the cross-stage texture detail preservation network, respectively. Each detection branch includes a category classification sub-branch and a bounding box regression sub-branch; During the training phase, the bounding box regression sub-branch of the decoder is optimized using a hybrid bounding box loss function; The hybrid bounding box loss function is a weighted sum of a loss term based on the cross-union ratio and a loss term based on the normalized Gauss-Wasestein distance.
8. A small target detection system, characterized in that, include: The image acquisition module is used to acquire high-resolution images of the object to be detected. The coarse detection module, connected to the image acquisition module, is used to input the high-resolution image to be detected into the coarse detection model, obtain coarse detection results containing potential small target regions, and crop low-resolution sub-image regions based on the coarse detection results; the coarse detection model includes an edge detection operator, a contour detection unit, and a region cropping unit; The fine detection module, connected to the coarse detection module, is used to input low-resolution sub-image regions into the fine detection model to obtain accurate detection results for small targets, and to map the coordinates of the accurate detection results back to the coordinate system of the original high-resolution image; The precision detection model consists of a multi-directional edge gradient enhancement feature extraction network, a cross-stage texture detail preservation network, and a decoder connected in sequence. Among them, the multi-directional edge gradient enhancement feature extraction network is used to extract semantic information, detailed texture and edge features in the image to be detected, and to obtain a feature map containing semantic information and texture details; the cross-stage texture detail preservation network is used to preserve the texture details of feature maps at different scales; the decoder is used to output the detection results of small targets based on the feature map output by the texture detail preservation network and map it back to the original coordinates.
9. A computer device, comprising: Memory and processor; The memory stores a computer program, characterized in that when the processor executes the computer program, it implements the steps of the small target detection method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the steps of a small target detection method according to any one of claims 1-7.