Unmanned aerial vehicle small target lightweight detection method and system applied to complex scene

By employing a two-way weighted shared feature extraction branch and a cross-regional collaborative enhancement unit in complex scenarios, the problem of poor cross-regional feature continuity in small target detection is solved, achieving efficient small target detection under lightweight conditions.

CN122313341APending Publication Date: 2026-06-30NANJING TIANQING AEROSPACE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610778464.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-02
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies struggle to enhance response capabilities under lightweight conditions when detecting small targets in complex scenarios. They also suffer from poor cross-regional feature continuity, discontinuous detection results, duplication, or missed detections.

Method used

Two weight-sharing feature extraction branches are used to extract multi-scale feature maps of the left and right regions respectively. Position alignment and region association weight calculation are performed through cross-regional collaborative enhancement units. Region association weights are generated by combining feature response intensity, texture change degree and row-level basic correlation coefficient to form cross-regional enhanced feature maps. Multi-scale fusion is performed through feature fusion network to finally generate target detection results.

Benefits of technology

While controlling the number of model parameters, inference latency, and memory usage, it enhances the response capability and boundary representation capability of small targets in complex backgrounds, and improves the continuity, stability, and consistency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122313341A_ABST
    Figure CN122313341A_ABST
Patent Text Reader

Abstract

This invention discloses a lightweight method and system for detecting small targets on UAVs in complex scenarios, relating to the field of target detection technology. It acquires image data captured during UAV flight and annotates the targets to construct a standardized dataset for training and validation. Based on this, the images undergo size normalization and left / right block cropping to form candidate detection regions suitable for small target detection. These candidate detection regions are then input into a small target detection model built on an improved YOLOv5s platform. Through lightweight feature extraction, multi-scale feature fusion, and detection result mapping and filtering, the model outputs detection results containing target category information, target bounding box position, and target confidence. Simultaneously, by introducing a cross-regional collaborative enhancement mechanism, the semantic constraints and feature sharing between block regions are strengthened, thereby improving the continuity, stability, and lightweight deployment adaptability of UAV small target detection in complex backgrounds.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and more specifically to a lightweight detection method and system for small targets on unmanned aerial vehicles (UAVs) applied in complex scenarios. Background Technology

[0002] With the widespread application of drones in scenarios such as inspection and monitoring, security early warning, emergency search and rescue, and low-altitude perception, small target detection in complex scenarios has become an important research direction in the field of visual perception.

[0003] In existing technologies, to balance detection accuracy and real-time performance, general object detection networks are typically used to directly identify the entire image, or image cropping is used to improve the resolution of local regions. While the former is simple, when small targets have a low pixel ratio, target details are easily weakened or even obscured during multi-layer downsampling, making it difficult to fully preserve the edge texture and spatial location information of small targets. The latter, while enhancing the resolution of small targets in local areas and reducing the computational scale of a single detection, often relies solely on local information for feature extraction in each cropped region, lacking collaborative modeling of the overall spatial structure of the original image. This is especially problematic for targets distributed across segmentation lines, leading to issues such as broken feature representations, discontinuous detection results, and duplicate or missed detections. Therefore, how to enhance the response capability of small targets under lightweight conditions, improve the continuity of cross-regional features, and ensure that the detection results can be stably mapped to the original image coordinate space has become a critical problem that urgently needs to be solved in existing technologies. Summary of the Invention

[0004] This invention addresses the shortcomings of existing technologies by proposing a lightweight detection method and system for small targets on unmanned aerial vehicles (UAVs) in complex scenarios.

[0005] The technical solution to achieve the objective of this invention is as follows:

[0006] On the one hand, a lightweight detection method for small targets on UAVs in complex scenarios is provided, including the following steps:

[0007] Acquire image data captured during drone flight and annotate the targets, including target category labels and target bounding box positions, and organize the data to generate a standardized dataset.

[0008] Based on a standardized dataset, the image data is normalized in size and cropped in blocks with overlapping adjacency regions according to the adjacency relationship to obtain candidate detection regions.

[0009] The candidate detection region is input into the small target detection model, and the multi-scale feature map of the left region and the multi-scale feature map of the right region are extracted through two weight-shared feature extraction branches respectively.

[0010] Based on the spatial adjacency relationship between the multi-scale feature maps of the left and right regions, position alignment is performed on the feature maps of the same scale. Regional association weights are generated based on feature response intensity, texture change degree and row-level basic correlation coefficient. Bidirectional cross-regional mapping is performed on key features according to the regional association weights to form cross-regional enhanced feature maps.

[0011] The cross-regional enhanced feature map is input into the feature fusion network for multi-scale fusion to obtain a fused feature map. Candidate detection boxes are generated based on the fused feature map, mapped to the original image coordinate system, and output as target detection results after filtering and merging.

[0012] Furthermore, the small target detection model includes a feature extraction network, a cross-regional collaborative enhancement unit, a feature fusion network, and a target detection head. The feature extraction network includes two symmetrically structured feature extraction branches with shared weights, used to process the left and right region images respectively. The cross-regional collaborative enhancement unit is located between the feature extraction network and the feature fusion network, used to perform position alignment, region association weight calculation, and bidirectional mapping of key features on the feature maps of the same scale in the left and right regions. The feature fusion network uses FPN and PAN structures to perform multi-scale fusion of the cross-regional enhanced feature maps from top to bottom and bottom to top. The target detection head includes multiple decoupled detection heads corresponding to fused feature maps of different scales, used to generate candidate detection boxes, category prediction results, and target confidence scores.

[0013] Furthermore, region association weights are generated based on feature response intensity, texture variation degree, and row-level basic correlation coefficient, including:

[0014] Eigenvalue standardization is performed on the feature maps of the left and right regions of the same scale. The feature response intensity of each spatial location is calculated. The depth-separable Sobel operator is used to calculate the feature gradient magnitude in the horizontal and vertical directions to obtain the degree of texture change.

[0015] Based on the spatial adjacency relationship between the left and right feature maps of the same scale, row-by-row position mapping is performed on the two feature maps, and the Pearson correlation coefficient of the corresponding row feature sequences is calculated to obtain the row-level basic correlation coefficient.

[0016] For each spatial location in the left and right feature maps of the same scale, the initial value of the association weight of the corresponding spatial location is calculated by using the row-level basic correlation coefficient as a multiplier and combining the feature response intensity and the degree of texture change.

[0017] For adjacent edge positions at the dividing line, Gaussian kernel weighting is used to enhance the initial values ​​of the association weights within the neighborhood, and global normalization is performed on the initial values ​​of the association weights of all spatial positions to generate regional association weights.

[0018] Furthermore, a bidirectional cross-regional mapping is performed on key features according to regional association weights to form a cross-regional enhanced feature map, including:

[0019] For each spatial location in the left and right feature maps of the same scale, the spatial location that simultaneously satisfies the following conditions is marked as a key feature location: the feature response intensity is not lower than the response intensity threshold of the corresponding scale, the region association weight is not lower than the association weight threshold of the corresponding scale, and the texture change degree is lower than the complex background judgment threshold.

[0020] Using the regional association weight of each key feature location as a weighting coefficient, a weighting operation is performed on the key feature vector to generate a feature vector to be mapped, which is then mapped to the corresponding position in the feature map of the other side. A neighborhood weighted matching strategy is adopted for the neighborhood position of the dividing line.

[0021] The original feature vector and the received feature vector to be mapped are superimposed according to the fusion weight coefficient. The fusion weight coefficient is increased for the neighborhood of the segmentation line. Batch normalization is performed on the fused feature map, and the cross-region enhanced feature map is output.

[0022] Furthermore, multi-scale feature maps of the left and right regions are extracted, including:

[0023] The left and right region images in the candidate detection regions are respectively mapped to two symmetrical feature extraction branches with shared weights in the feature extraction network.

[0024] Each feature extraction branch first performs initial feature mapping through the ReLUconv integrated convolutional structure, and then enhances the response to small targets through a feature enhancement module that embeds a C3_CA_light lightweight channel attention structure;

[0025] We continue to perform cascaded feature extraction using the lightweight C3 module, downsampling convolution, and spatial pyramid pooling fast module to obtain region feature maps corresponding to different scale levels.

[0026] Feature maps of each region are extracted according to scale level, forming multi-scale feature maps of the left and right regions respectively.

[0027] Furthermore, the C3_CA_light lightweight channel attention structure includes:

[0028] The C3_CA_light lightweight channel attention structure embeds an improved coordinate attention unit into the bottleneck structure of the native C3 module in YOLOv5s, while replacing the standard convolutional layer of the bottleneck branch with a depthwise separable convolution.

[0029] The improved coordinate attention unit adapts the kernel size of the global average pooling in the horizontal and vertical directions to the width and height dimensions of the corresponding feature map;

[0030] The improved coordinate attention unit simultaneously performs global average pooling in the horizontal and vertical directions to generate horizontal and vertical position-aware feature vectors. The horizontal and vertical position-aware feature vectors are concatenated and then convolved with a sigmoid activation function to generate a channel attention weight map. The channel attention weight map is then multiplied element-wise with the bottleneck branch input feature map to complete the channel weight enhancement.

[0031] Furthermore, the fused feature map is obtained, including:

[0032] Two structurally symmetrical and weight-shared feature fusion branches are assigned to the cross-regional enhanced feature maps of the left and right regions;

[0033] Each feature fusion branch first performs top-down FPN path feature fusion, passing deep semantic features layer by layer to shallow high-resolution features, resulting in FPN first-level fusion feature map and FPN second-level fusion feature map;

[0034] Then, perform bottom-up PAN path feature fusion to pass the shallow positional detail features to the deep semantic features layer by layer, and obtain the PAN first-level fusion feature map and the PAN second-level fusion feature map.

[0035] Each feature fusion branch generates a fusion feature map corresponding to a different detection scale. Each set of fusion feature maps is bound to the coordinate offset parameters of the corresponding region, forming a set of fusion feature maps.

[0036] Furthermore, the target detection results are output, including:

[0037] The fused feature maps of different detection scales in the fused feature map set are input into the decoupled detection head of the corresponding scale to generate initial candidate detection boxes;

[0038] Based on the coordinate offset parameters bound to the fused feature map, the coordinates of the initial candidate detection boxes of each region are added to the coordinate offset of the corresponding region, unified to the normalized image coordinate system, and the normalized image coordinates are restored to the original image coordinate system to generate global candidate detection boxes.

[0039] For global candidate detection boxes within the neighborhood range on both sides of the dividing line, cross-regional target matching verification is performed, and preliminary merging is performed on global candidate detection boxes that meet the intersection-union ratio and center distance conditions;

[0040] The DIoU-NMS algorithm is used to group targets by category. After filtering based on confidence threshold, duplicate global candidate detection boxes are removed based on intersection-union ratio and center distance to generate target detection results.

[0041] Furthermore, the image data is size normalized and cropped in blocks with overlapping adjacencies according to adjacency relationships to obtain candidate detection regions, including:

[0042] Image data and corresponding annotation files are retrieved from a standardized dataset. Gray-scale mean normalization and size normalization are performed on the image data to obtain a normalized image that maintains the original aspect ratio.

[0043] Using the midpoint of the normalized image width as a reference, a 10-pixel-wide adjacent overlap region is set along the vertical direction to crop the normalized image into a left region image and a right region image.

[0044] The left and right regions are used as independent input units, and a unique unit identifier is assigned to each independent input unit. A Gaussian filtering algorithm is used to denoise each independent input unit to form a set of candidate detection regions.

[0045] Secondly, a lightweight detection system for small targets on UAVs in complex scenarios is provided, including a data construction module, a region generation module, and a detection output module.

[0046] The data construction module acquires image data captured during the drone's flight and performs target annotation, including target category labels and target bounding box positions, and organizes the data to generate a standardized dataset.

[0047] The region generation module is based on a standardized dataset. It performs size normalization on the image data and performs block cropping with adjacent overlapping regions according to the adjacency relationship to obtain candidate detection regions.

[0048] The detection output module inputs candidate detection regions into the small target detection model. It extracts multi-scale feature maps of the left and right regions through two weight-sharing feature extraction branches. Based on the spatial adjacency of the left and right multi-scale feature maps, it performs positional alignment on feature maps of the same scale. It then generates region association weights based on feature response intensity, texture change degree, and row-level basic correlation coefficient. Bidirectional cross-regional mapping is performed on key features according to these weights to form a cross-regional enhanced feature map. This enhanced feature map is then input into a feature fusion network for multi-scale fusion to obtain a fused feature map. Candidate detection boxes are generated based on the fused feature map and mapped to the original image coordinate system. After filtering and merging, the target detection result is output.

[0049] Compared with the prior art, the advantages of this invention are as follows:

[0050] By performing left and right block cropping after image normalization, and combining the improved C3_CA_light lightweight channel attention structure, ReLUconv integrated convolutional structure, and FPN and PAN multi-scale fusion mechanism in YOLOv5s, shallow high-resolution detail features and deep semantic features are collaboratively involved in detection. While controlling the number of model parameters, inference latency and memory usage, the response capability and boundary representation capability of small targets in complex backgrounds are enhanced, thus balancing detection accuracy and lightweight deployment requirements.

[0051] A cross-regional collaborative enhancement mechanism is introduced between feature extraction and feature fusion. By aligning the feature maps of the same scale in the left and right regions, and combining the feature response intensity, texture change degree, target response distribution and background complexity to calculate the region association weight, the key features are mapped to the corresponding positions on the opposite side according to the weight, forming an enhanced feature map containing cross-regional semantic constraints. This effectively compensates for the problem of cross-line target feature breakage caused by block pruning, and improves the continuity, stability and consistency of small target detection in complex scenes. Attached Figure Description

[0052] Figure 1 This is a schematic diagram of the ReLUConv integrated convolutional structure in this invention;

[0053] Figure 2 This is a schematic diagram of the C3_CA_light lightweight channel attention structure in this invention;

[0054] Figure 3 A flowchart of a lightweight detection method for small targets by UAVs applied in complex scenarios;

[0055] Figure 4 This is a diagram showing the overall structure of the lightweight UAV small target detection model in this invention.

[0056] Figure 5 This is a schematic diagram of the cross-regional collaborative enhancement mechanism in this invention. Detailed Implementation

[0057] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0058] Example 1:

[0059] This invention discloses a lightweight detection method for small targets on UAVs in complex scenarios, comprising the following steps:

[0060] Acquire image data captured during drone flight and annotate the targets, including target category labels and target bounding box positions, and organize them into a standardized dataset as required.

[0061] Based on a standardized dataset, the image data is size normalized and left and right block cropping with adjacent overlapping regions is performed to obtain two region images. These are then organized as independent input units to form candidate detection regions.

[0062] The candidate detection region is input into the small target detection model. The model performs feature extraction and feature fusion processing and identifies and locates the target. The output includes target category information, target bounding box position and target confidence.

[0063] Furthermore, acquire image data captured during the drone's flight and annotate the targets, then organize and generate a standardized dataset as required, including the following steps:

[0064] The drone platform equipped with an image acquisition module is controlled to enter the complex scene airspace according to a preset flight trajectory; the image acquisition module uses a combination of visible light camera and infrared imaging camera to simultaneously acquire multimodal image sequences in the same scene; the image acquisition resolution is set to be no less than 1920×1080 pixels and the frame rate is no less than 30fps to ensure complete capture of the spatial details and temporal dimension information of small targets.

[0065] The acquired raw image sequence undergoes an initial data cleaning process to remove invalid images with motion blur, severe fogging, or lens flare. For the remaining valid images, bad pixel repair and white balance correction are performed to unify the image color space and eliminate the interference of ambient lighting changes on subsequent feature extraction.

[0066] A labeling category system is constructed to match the characteristics of complex scenarios and small targets. The labeling category system includes at least target subject category and interference background category. The target subject category is further subdivided into subcategories according to actual application needs. Each subcategory corresponds to a unique category label, and the label encoding adopts one-hot vector form for unique identification.

[0067] A dual annotation strategy combining polygonal bounding boxes and rectangular bounding boxes is adopted: for small targets with irregular shapes, polygonal bounding boxes are used to accurately outline the target contour to generate a contour annotation mask; for small targets with regular shapes or high contrast, rectangular bounding boxes are used to mark the area where the target is located.

[0068] The preprocessed image is annotated frame by frame using annotation tools to ensure that each target instance is uniquely annotated and no one is missed. For cases where the target is occluded or located at the edge of the image, occlusion attribute labels and edge attribute labels are added to the annotation information to quantify the annotation uncertainty. The annotation data is associated with the corresponding original image data and stored to form a set of one-to-one sample data pairs.

[0069] The sample data pairs are formatted and standardized; image data is converted to JPEG format and annotation data is converted to TXT format files to achieve a one-to-one mapping between image data and annotation files; the overall sample dataset is randomly divided into training set, validation set and test set according to a preset ratio of 8:1:1.

[0070] Statistical analysis is performed on the sample dataset to generate a description file for the sample dataset. The description file includes metadata information such as the total number of samples, category distribution, image resolution, and number of labeled targets. Finally, it is packaged into a standardized dataset with a complete structure that can be directly used for model training and validation.

[0071] Furthermore, the image data is normalized in size and cropped into left and right blocks with adjacent overlapping regions to obtain two region images. These are then organized as independent input units to form candidate detection regions, including the following steps:

[0072] Image data and corresponding annotation files are retrieved in batches from the established standardized dataset. The image data are all in JPEG format and the annotation files are in TXT format to ensure that each frame of image data corresponds one-to-one with its annotation information. During the retrieval process, the integrity of the images is checked synchronously, and damaged images caused by storage or transmission abnormalities are removed to avoid affecting the accuracy of subsequent processing.

[0073] The image data after the call is preprocessed with gray-level mean normalization to normalize the pixel values ​​to the [0,1] range, thereby eliminating the interference of image gray-level differences on subsequent size normalization and feature extraction, while preserving the pixel feature details of small targets.

[0074] The target size parameter for size normalization is set. Combined with the input requirements of the small target detection model, the baseline size of the normalized image is determined to be 640×320 pixels, i.e., width×height. This size takes into account both the preservation of small target details and the need for lightweight model, avoiding the increase in model computation due to excessive size, or the loss of small target features due to excessive size.

[0075] The preprocessed image data is scaled using a bilinear interpolation algorithm while maintaining the aspect ratio of the image. If the original aspect ratio of the image is inconsistent with the reference aspect ratio, black pixels (i.e., pixel values ​​of 0) are filled in the blank areas of the scaled image to ensure that the normalized image size is strictly 640×320 pixels and that the proportion of the target position in the normalized image is consistent with that of the original image, without producing stretching or compression distortion.

[0076] The normalized image is checked for pixel values ​​to ensure that all pixel values ​​are in the range [0,1]. If there are pixel values ​​outside this range, they are corrected to the range [0,1] by threshold truncation. At the same time, the scaling ratio parameter during the normalization process is recorded for subsequent reverse mapping of the target bounding box coordinates.

[0077] Based on the 640×320 pixel image after size normalization, the baseline for block cropping is determined. Taking the midpoint of the image width as the baseline, i.e., at the x-coordinate of 320 pixels, a 10-pixel wide adjacent overlap area is set along the vertical direction to crop the normalized image into two standard 320×320 pixel regions. The pixel coordinate range of the left region is (0,0) to (319,319), and the pixel coordinate range of the right region is (310,0) to (639,319). The coordinate definition is consistent with the target bounding box coordinates, with the upper left corner of the image as the origin, the horizontal direction to the right as the positive x-axis, and the vertical direction downward as the positive y-axis.

[0078] The cropping process employs pixel-level precision to ensure that the images on both sides of the dividing line retain a 10-pixel overlap area with no content omissions. The two cropped regions correspond to the left and right halves of the original normalized image, respectively.

[0079] The two cropped regions are validated to check for cropping deviations and missing pixels. If deviations are found, the cropping baseline is readjusted to ensure that the size of both regions is strictly 320×320 pixels and that the image content fully preserves the small targets and background features of the corresponding regions.

[0080] The two 320×320 pixel regions obtained from the cropping are organized as two independent input units. Each input unit is assigned a unique unit identifier, which is encoded in the form of a numerical sequence, such as "left input unit 01" and "right input unit 02". This identifier is used for input differentiation and result correspondence in subsequent model processing.

[0081] Feature preprocessing is performed on each independent input unit, and Gaussian filtering algorithm is used to denoise the region image. The filter kernel size is set to 3×3 and the standard deviation is set to 0.5. While removing image noise, the edge features and details of small targets are preserved to the maximum extent, providing high-quality input for subsequent model feature extraction.

[0082] Two preprocessed independent input units are arranged and combined in a preset order, such as the left input unit first and the right input unit second, to form a complete set of candidate detection regions. This set contains two independent candidate regions, each carrying a corresponding unit identifier and original image association information, which can be directly input into the small target detection model for subsequent feature extraction and target recognition and localization.

[0083] Furthermore, based on a standardized dataset, the training set, validation set, and test set are divided in an 8:1:1 ratio to perform model pre-training and accuracy verification. The training samples are augmented using Mosaic data. A joint loss function is constructed using the intersection-over-union (CIoU) loss function and the binary cross-entropy loss function. The network weights are iteratively updated using the Adam optimizer until the model loss converges and the accuracy of the validation set meets the target, thus generating a pre-trained small object detection model.

[0084] Among them, the joint loss function The complete formula is:

[0085] ,

[0086] in, For CIoU bounding box regression loss, For binary cross-entropy classification loss, The regression loss weight is set to 0.75. The classification loss weight is set to 0.25. This weighting ratio is based on the characteristic that bounding box localization has a higher priority than classification in small object detection tasks, and the optimal value was determined through 100 sets of comparative experiments.

[0087] The core hyperparameters of the Adam optimizer are set as follows: initial learning rate of 0.001, weight decay coefficient of 0.0005, first moment estimate exponential decay rate of 0.9, second moment estimate exponential decay rate of 0.999, batch size of 16, and training epochs of 300. During training, a cosine annealing learning rate scheduling strategy is adopted, and the learning rate decays to 0.8 times its original value every 30 epochs.

[0088] The criteria for model convergence and accuracy achievement are as follows: the average accuracy (mAP@0.5) of the validation set for 20 consecutive rounds fluctuates by no more than 0.2%, and the validation set mAP@0.5 is not lower than 92%, and the training set loss value drops below 0.5 and tends to stabilize.

[0089] After pre-training, the left and right region images within the candidate detection area are input into the two weight-shared feature extraction branches of the pre-trained small target detection model, and then input into the decoupled detection head of the corresponding scale in the target detection head through the feature fusion branch, finally outputting the target detection result.

[0090] Furthermore, the small object detection model is built on an improved YOLOv5s network structure, which includes a feature extraction network, a feature fusion network, and an object detection head.

[0091] The specific implementation process is as follows:

[0092] The candidate detection regions are input into the feature extraction network, and feature mapping is performed on the candidate detection regions through multi-layer convolution operations. The response of small targets is enhanced by the C3_CA_light lightweight channel attention structure introduced in the shallow layer. At the same time, the ReLUconv integrated convolution structure is used to complete the feature expression compression, resulting in multi-scale region feature maps corresponding to the left and right regions respectively.

[0093] Multi-scale region feature maps are input into a feature fusion network composed of a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN). Through top-down and bottom-up path propagation, features of different scales are aggregated layer by layer, enabling shallow high-resolution features and deep semantic features to participate in the fusion calculation, resulting in a fused feature map for object detection.

[0094] The fused feature map is input into the target detection head to generate candidate detection boxes, and the detection results of the candidate detection regions are mapped to the original image coordinate system. The candidate detection boxes are filtered and merged by the non-maximum suppression method to obtain the target detection results.

[0095] Furthermore, the candidate detection regions are input into the feature extraction network for convolutional operations. The C3_CA_light lightweight channel attention structure and the ReLUconv integrated convolutional structure are used to enhance the response and compress the expression, respectively, ultimately generating multi-scale region feature maps, including the following steps:

[0096] Based on the unit identifiers of two independent input units within the candidate detection region set, parallel routing is performed, mapping the left and right input units to two completely symmetrical feature extraction branches respectively. The two feature extraction branches share weight parameters and have completely consistent processing flows, ensuring the consistency of feature extraction in the left and right regions and the alignment of spatial coordinates.

[0097] For each input tensor, the first round of feature mapping is performed, using a ReLUconv integrated convolutional structure to complete initial feature extraction and channel dimension transformation. The ReLUconv integrated convolutional structure is an end-side inference operator that integrates convolutional layers (Conv), batch normalized normalization (BN) layers (BatchNorm), and ReLU activation functions. This eliminates the independent memory read / write intervals between operators, synchronously completing convolution operations, normalization correction, and nonlinear activation within a single operation. This achieves feature representation compression while reducing inference latency and memory usage, adapting to the computing power limitations of UAV embedded platforms. The core operating parameters of the first round of ReLUconv integrated convolutional structure are set as follows: kernel size of 6×6, stride of 2, padding of 2, and number of output channels of 32. During the convolution operation, a grouped convolution strategy is adopted with 4 groups to further reduce the number of model parameters while ensuring feature extraction capability. After the first round of convolution operation, the input 320×320×3-dimensional tensor is transformed into a 160×160×32-dimensional half-scale shallow feature map. This feature map fully preserves the high-resolution detail information of the input image, providing a high-fidelity foundation for subsequent small target feature enhancement.

[0098] refer to Figure 1 , Figure 1 This is a schematic diagram of the ReLUConv integrated convolutional structure.

[0099] A half-scale shallow feature map is input into the first-level feature enhancement module embedded in the C3_CA_light lightweight channel attention structure to perform small target feature enhancement processing. The C3_CA_light lightweight channel attention structure is a lightweight, small target-aware feature enhancement module formed by embedding a lightweight improved coordinate attention unit (improved CA unit) into the bottleneck structure of the native C3 module of YOLOv5s, and replacing the convolutional layer of the bottleneck branch with depthwise separable convolution. The improved CA unit cancels the channel dimensionality reduction operation of the two 1×1 convolutions in the native CA structure, retains the global correlation modeling capability of the channel dimension, and adapts the kernel size of the global average pooling in the horizontal and vertical directions of the feature to the width and height of the corresponding feature map, realizing the collaborative modeling of the position information and channel information of small targets. With only a very small number of parameters added, it significantly enhances the channel response weights of small target features and suppresses the ineffective activation of features that interfere with complex backgrounds.

[0100] The specific processing procedure is as follows:

[0101] First, a ReLUconv uni-convolutional layer with a kernel size of 1×1 and a stride of 1 is used to transform the channel dimension of the half-scale shallow feature map with dimensions of 160×160×32, resulting in an output channel number of 64. Then, the half-scale shallow feature map is equally split into two paths along the channel dimension: the main branch and the bottleneck branch. The feature map dimensions of both paths are 160×160×32.

[0102] The main branch directly performs the identity mapping, which fully preserves the detailed information of the original features and avoids the loss of weak features of small targets in continuous convolution operations;

[0103] The bottleneck branch sequentially performs two depthwise separable convolution operations and one improved CA unit operation: the depthwise separable convolution kernel size is 3×3, stride is 1, padding is 1, the number of output channels of the point convolution is consistent with the number of input channels, and the activation function is ReLU, which reduces the number of parameters by more than 75% compared with the standard convolution, achieving lightweight feature extraction; the improved CA unit simultaneously performs global average pooling in the horizontal and vertical directions of the feature map, generating position-aware feature vectors with dimensions of 160×1×32 and 1×160×32 respectively. The two position-aware feature vectors are concatenated and then subjected to a 1×1 convolution and a Sigmoid activation function to generate a channel attention weight map. The channel attention weight map is multiplied element-wise with the input feature map of the bottleneck branch to complete the weight enhancement of small target feature channels and the weight suppression of background interference channels;

[0104] The identity mapping features of the main branch and the enhanced features output by the bottleneck branch are concatenated by channel dimension (Concat), and then channel fusion and dimension unification are achieved by a ReLUconv uni-convolution with a kernel size of 1×1 and a stride of 1, resulting in a 1 / 2 scale enhanced feature map with a dimension of 160×160×64.

[0105] The ReLUconv integrated convolutional downsampling process is performed on the 1 / 2 scale enhanced feature map. The convolutional kernel size is set to 3×3, the stride is 2, the padding is 1, and the number of output channels is 128. The 1 / 2 scale enhanced feature map is transformed into a 1 / 4 scale feature map of 80×80×128. This feature map takes into account both the detailed features of small objects and the primary semantic features, and provides intermediate layer feature support for subsequent multi-scale feature fusion.

[0106] refer to Figure 2 , Figure 2 This is a schematic diagram of the C3_CA_light lightweight channel attention structure.

[0107] The second and third levels of cascaded feature extraction are performed on the 1 / 4 scale feature map. The two parallel branches execute completely consistent operation processes synchronously to ensure semantic hierarchical alignment of the features in the left and right regions.

[0108] The specific process is as follows:

[0109] Second-level feature extraction: A 1 / 4-scale feature map of 80×80×128 dimensions is input into the lightweight C3 module. The bottleneck branch of the lightweight C3 module replaces the standard convolution with a depthwise separable convolution, while the main branch retains the identity mapping. After processing by the module, the output is a 1 / 4-scale semantic feature map with the dimensions of 80×80×128. Then, downsampling is performed through a ReLUconv integrated convolution with a kernel size of 3×3, a stride of 2, and padding of 1, resulting in 256 output channels and a 1 / 8-scale feature map of 40×40×256 dimensions. This feature map contains the intermediate semantic features and contour information of the target, which is suitable for the detection needs of medium-sized targets and partially occluded small targets.

[0110] The third-level feature extraction: The 1 / 8 scale feature map with a dimension of 40×40×256 is input into the lightweight C3 module. After feature extraction and channel fusion, the output is a 1 / 8 scale semantic feature map with a dimension of 40×40×256. Then, downsampling is performed by ReLUconv integrated convolution with a kernel size of 3×3, a stride of 2, and padding of 1. The number of output channels is 512, resulting in a 1 / 16 scale feature map with a dimension of 20×20×512. This feature map contains high-level semantic features and category discrimination information of the target, realizing semantic differentiation between the target and interference objects in complex backgrounds.

[0111] The 1 / 16 scale feature map is processed by the Spatial Pyramid Pooling Fast SPPF module. The SPPF module uses three cascaded 5×5 max pooling layers to perform multi-scale pooling fusion on the input feature map. This expands the receptive field of the feature map without increasing the computational load, and fuses contextual information at different scales. The output maintains a 20×20×512 dimension for the 1 / 16 scale semantic feature map, solving the semantic confusion problem between small targets and background in complex scenes.

[0112] After completing the cascaded feature extraction, the output features of the two parallel branches are hierarchically aligned and validated to generate multi-scale region feature maps corresponding to the left and right regions respectively.

[0113] The specific process is as follows:

[0114] From each feature extraction branch, semantic feature maps at scales of 1 / 4, 1 / 8 and 1 / 16 are extracted sequentially according to scale level, forming a set of three different resolution feature maps to constitute the multi-scale feature map set corresponding to a single input.

[0115] For the multi-scale feature map sets of the left input unit branch and the right input unit branch, a hierarchical alignment check is performed. The check includes the dimensionality consistency of the feature maps at the corresponding scales, the consistency of the tensor data format, and the synchronization of the feature extraction process. This ensures that the feature maps at the same scale of the two branches are completely matched in dimension, providing an alignment benchmark for the parallel processing of the subsequent feature fusion network and the coordinate mapping of the detection results.

[0116] Each set of multi-scale feature maps is assigned a corresponding unit identifier. The set of multi-scale feature maps output by the left input unit branch is labeled as the left region multi-scale feature map, and the set of multi-scale feature maps output by the right input unit branch is labeled as the right region multi-scale feature map. This completes the entire feature extraction process and outputs two sets of multi-scale region feature maps corresponding to the left and right regions, respectively. These are then transmitted to the feature fusion network for further processing.

[0117] Furthermore, the multi-scale region feature maps are input into the feature fusion network, and the features at different scales are aggregated layer by layer through top-down and bottom-up paths to obtain a fused feature map for object detection, including the following steps:

[0118] The system receives the left and right multi-scale feature maps output by the feature extraction network. Based on the unit identifiers attached to the two sets of feature maps, it completes a one-to-one mapping and binding between the input source and the feature fusion branch. It assigns two feature fusion branches with completely symmetrical structures and completely shared weight parameters to the left and right multi-scale feature maps. The two feature fusion branches perform completely consistent fusion operation processes to ensure the semantic consistency and spatial coordinate alignment of the left and right region feature fusion, and avoid target misalignment and missed detection problems when mapping the subsequent detection results.

[0119] Perform dimensional compliance checks on the multi-scale feature map set input for each branch, verify the consistency of the data format of the feature map tensor, the binding relationship between device affiliation and unit identifier, and remove feature maps that fail the checks to ensure the input accuracy of the fusion operation.

[0120] After verification, feature value standardization preprocessing is performed on the multi-scale feature maps of each branch to normalize the feature values ​​of each scale feature map to the range of [-1,1], thereby eliminating the interference of numerical distribution differences of feature maps at different levels on the fusion effect, while retaining the weak feature responses corresponding to small targets, and providing standardized input for subsequent hierarchical feature aggregation.

[0121] Based on the standardized multi-scale feature maps, top-down FPN path feature fusion is performed synchronously within each parallel branch. This process transfers the strong semantic discriminative information carried by the deep feature maps to the shallow high-resolution feature maps layer by layer, solving the problem of weak semantics of small target features and their susceptibility to confusion with complex backgrounds. The entire process adopts the ReLUconv integrated convolutional structure and lightweight C3 module consistent with the feature extraction network to ensure the lightweight characteristics of the model. The specific sub-steps are as follows:

[0122] Take the semantic feature map at scale 1 / 16 from each branch, input it to a ReLUconv integrated convolution with kernel size of 1×1, stride of 1, and padding of 0, and perform channel dimension reduction processing to adjust the number of output channels from 512 to 256, resulting in an initial FPN dimensionality-reduced feature map with dimensions of 20×20×256. This reduces the number of parameters and computational cost in subsequent operations while preserving core semantic information. Then, perform a 2x upsampling operation on the initial FPN dimensionality-reduced feature map using bilinear interpolation. After upsampling, the feature map size is completely consistent with the 1 / 8 scale feature map, resulting in an FPN first-level upsampled feature map with dimensions of 40×40×256.

[0123] The first-level upsampled feature map of FPN and the 1 / 8 scale feature map in the same branch are concatenated element-wise along the channel dimension, resulting in a feature map with dimensions of 40×40×512. The concatenated feature map is then input into the lightweight C3 module for channel fusion and feature purification. The lightweight C3 module has the same structure as the module used in the feature extraction network. The bottleneck branch uses depthwise separable convolution to replace the standard convolution, while the main branch retains the identity mapping. The number of output channels is uniformly 256, resulting in a first-level fused feature map of FPN with dimensions of 40×40×256. This feature map simultaneously integrates deep semantic information at the 1 / 16 scale and medium-resolution detail information at the 1 / 8 scale, adapting to the feature representation needs of partially occluded small targets and medium-sized targets.

[0124] A 2x bilinear interpolation upsampling operation is performed on the FPN Level 1 fusion feature map to obtain an FPN Level 2 upsampling feature map with dimensions of 80×80×256, whose size perfectly matches the 1 / 4 scale feature map. The FPN Level 2 upsampling feature map and the 1 / 4 scale feature map in the same branch are then concatenated element-wise along the channel dimension, resulting in a concatenated feature map with dimensions of 80×80×384. The concatenated feature map is then input into the lightweight C3 module for channel fusion and feature purification, with the output channel number uniformly set to 128, resulting in an FPN Level 2 fusion feature map with dimensions of 80×80×128. This feature map simultaneously integrates deep strong semantic information and shallow highest resolution detail information, providing strong feature representation for small targets with extremely low pixel ratios, and is the core feature carrier for small target detection.

[0125] After completing the top-down layer-by-layer fusion, an FPN path output feature set is generated in each branch. The FPN path output feature set contains three sets of feature maps: an FPN secondary fusion feature map with a dimension of 80×80×128, an FPN primary fusion feature map with a dimension of 40×40×256, and an FPN initial dimensionality reduction feature map with a dimension of 20×20×256, which correspond to 1 / 4 scale, 1 / 8 scale, and 1 / 16 scale, respectively, providing input for subsequent bottom-up PAN path feature fusion.

[0126] Based on the FPN path output feature set, bottom-up PAN path feature fusion is performed synchronously within each parallel branch. This process transfers strong location information and high-resolution detail information carried by shallow feature maps to deep feature maps layer by layer, compensating for the loss of target location information during top-down fusion and further enhancing the boundary localization accuracy of small targets. The consistency of lightweight operators is maintained throughout the process. The specific sub-steps are as follows:

[0127] The 1 / 4 scale FPN second-level fusion feature map output from each branch FPN path is taken and input into a ReLUconv unified convolution with a kernel size of 3×3, a stride of 2, and padding of 1. A 2x downsampling operation is performed, and the number of output channels remains unchanged at 128, resulting in a PAN first-level downsampling feature map with dimensions of 40×40×128, whose size perfectly matches the 1 / 8 scale FPN first-level fusion feature map. The PAN first-level downsampling feature map and the 1 / 8 scale FPN first-level fusion feature map in the same branch are concatenated element-wise along the channel dimension, resulting in a concatenated feature map with dimensions of 40×40×384. The concatenated feature map is then input into the lightweight C3 module for channel fusion and feature purification, and the number of output channels is unified to 256, resulting in a PAN first-level fusion feature map with dimensions of 40×40×256. This feature map simultaneously integrates shallow strong positional detail information and mid-layer semantic-detail balance information, further enhancing the contour and boundary feature expression of the target.

[0128] A 2x downsampling operation is performed on the PAN first-level fusion feature map using a ReLUconv integrated convolution with a kernel size of 3×3, a stride of 2, and padding of 1, while keeping the number of output channels constant at 256. This results in a PAN second-level downsampling feature map with dimensions of 20×20×256, whose size perfectly matches the initial dimensionality-reduced feature map of the 1 / 16 scale FPN. The PAN second-level downsampling feature map and the initial dimensionality-reduced feature map of the 1 / 16 scale FPN within the same branch are then concatenated element-wise along the channel dimension, resulting in a concatenated feature map with dimensions of 20×20×512. The concatenated feature map is then input into the lightweight C3 module for channel fusion and feature purification, with the number of output channels uniformly set to 512, resulting in a PAN second-level fusion feature map with dimensions of 20×20×512. This feature map simultaneously integrates shallow positional information, mid-level balance information, and deep strong semantic information, enabling accurate semantic differentiation between targets and interference objects in complex backgrounds.

[0129] After bottom-up layer-by-layer fusion, a PAN path output feature set is generated within each branch, which is the initial fusion feature map set for that branch. This initial fusion feature map set contains three sets of feature maps corresponding to different detection scales: a 1 / 4-scale fusion feature map with dimensions 80×80×128, a 1 / 8-scale fusion feature map with dimensions 40×40×256, and a 1 / 16-scale fusion feature map with dimensions 20×20×512. The 1 / 4-scale fusion feature map is generated by the FPN path through top-down secondary upsampling, then concatenated with the original 1 / 4-scale shallow feature map along the channel, and finally processed by the lightweight C3 module for channel fusion and feature purification. The 1 / 8-scale fusion feature map is generated by the FPN path through the FPN path. After the N-level fusion feature map is downsampled by 2x, it is concatenated with the FPN level-one fusion feature map. The PAN path level-one bottom-up fusion generation is completed by the lightweight C3 module. The 1 / 16 scale fusion feature map is generated by the PAN level-one fusion feature map after being downsampled by 2x and concatenated with the FPN initial dimensionality-reduced feature map. The PAN path level-two bottom-up fusion generation is completed by the lightweight C3 module. Among them, the 1 / 4 scale fusion feature map is a dedicated detection feature layer for small targets, responsible for the detection of extremely small targets with a pixel ratio of less than 5%. The 1 / 8 scale fusion feature map is responsible for the detection of medium-sized targets and partially occluded targets. The 1 / 16 scale fusion feature map is responsible for the semantic distinction between large targets and background, realizing full coverage detection of targets at multiple scales.

[0130] For the two initial fused feature map sets output by the left and right region branches, cross-branch feature alignment and consistency constraint processing is performed to solve the problems of feature breakage and detection discontinuity across the segmentation line after left and right block pruning, while ensuring the semantic distribution consistency of the features of the two branches. The specific sub-steps are as follows:

[0131] Same-scale feature alignment verification: For the fused feature maps of the two branches at the same scale, perform dimension consistency and feature value distribution interval consistency verification to ensure that the dimensions of the fused feature maps at the 1 / 4, 1 / 8, and 1 / 16 scales of the left and right branches are completely matched and the feature value distribution interval deviation does not exceed the preset threshold of 5%. If the deviation exceeds the threshold, the weight parameter synchronization correction mechanism is triggered, and the shared weights are fine-tuned based on the difference in the mean feature values ​​of the two branches until the deviation meets the requirements.

[0132] For the right edge of the left region branch 1 / 4 scale fused feature map and the left edge of the right region branch 1 / 4 scale fused feature map, neighborhood feature association enhancement processing is performed. The right edge of the left region branch 1 / 4 scale fused feature map is the column pixel with x coordinate 79, corresponding to the segmentation line position of the original normalized image. The left edge of the right region branch 1 / 4 scale fused feature map is the column pixel with x coordinate 0. The feature vectors of 3 columns of pixels on each side edge are taken, and cross-branch feature weighted fusion is performed. The fusion weight is assigned using a Gaussian kernel function, with higher weights for pixels closer to the segmentation line. This achieves feature continuity completion for targets across the segmentation line and avoids the problems of missed detection and duplicate detection of cross-line targets caused by block cropping.

[0133] After aligning the two branches, the fused feature map set is re-attached with the corresponding unit identifier. At the same time, coordinate offset parameters of the corresponding region are bound to each fused feature map: the x-axis coordinate offset of the left region fused feature map is 0 pixels, the x-axis coordinate offset of the right region fused feature map is 320 pixels, and the y-axis coordinate offset is 0 pixels. The coordinate offset parameters are used for the reverse mapping of the bounding box coordinates output by the subsequent target detection head to the original image coordinate system to ensure the accuracy of coordinate positioning.

[0134] For the left and right sets of fused feature maps that have completed alignment and consistency constraints, the final validity verification and standardization process is performed to generate fused feature maps that can be directly input into the target detection head. The specific sub-steps are as follows:

[0135] Validation of fused feature maps: The validation includes compliance of the dimensions of the fused feature maps at each scale, compliance of the feature value range, completeness of the binding between the unit identifier and the coordinate offset parameter, and cross-branch feature alignment status. Feature maps that fail the validation are removed to ensure that the output fused feature maps fully meet the input requirements of the target detection head.

[0136] Detection layer-specific feature optimization: For the 1 / 4 scale fusion feature map responsible for small target detection, additional weak feature enhancement processing is performed. A 3×3 depthwise separable convolution is used to enhance the edge features of the feature map, which further improves the edge response intensity of small targets and suppresses the noise features of complex backgrounds without increasing the number of parameters.

[0137] Final fusion feature map output encapsulation: The left region fusion feature map set and the right region fusion feature map set are arranged and combined according to the preset order of the unit identifiers, that is, the left region first and the right region second, to form a complete fusion feature map output set; each fusion feature map in the fusion feature map output set carries a unique unit identifier, corresponding scale information and coordinate offset parameters, completing the entire feature fusion process, and outputting it to the target detection head to perform subsequent candidate detection box generation and target recognition and localization processing.

[0138] Furthermore, the fused feature map is input into the target detection head to generate candidate detection boxes, and the detection results of the candidate detection regions are mapped to the original image coordinate system. The candidate detection boxes are then filtered and merged using a non-maximum suppression method to obtain the target detection results. This includes the following steps:

[0139] The system receives the fused feature map output set from the feature fusion network. Based on the unit identifiers attached to the fused feature maps, it completes the one-to-one mapping and binding of the left region fused feature map set, the right region fused feature map set, and the two parallel detection branches. The two detection branches have completely symmetrical structures and fully shared weight parameters, and are consistent with the branch logic of the feature extraction network and the feature fusion network, ensuring the synchronization of the left and right region detection processes and the uniformity of the coordinate system.

[0140] For each detection branch, feature value range verification is performed on the fused feature map at each scale to ensure that the feature value is within the standardized range of [-1,1]. For feature values ​​that exceed the range, threshold truncation is performed to avoid detection box prediction deviation caused by abnormal feature values, and to provide standardized input for subsequent candidate detection box generation.

[0141] For the three sets of fused feature maps at different scales for each detection branch, decoupled detection heads of the corresponding scales are connected respectively. The decoupled detection head structures of the three scales maintain lightweight consistency and are all constructed using the same ReLUconv integrated convolutional structure as described above, without any additional redundant operators, which is suitable for the real-time inference requirements of UAV embedded platforms. Among them, the 1 / 4 scale detection head is a dedicated detection head for small targets, responsible for detecting extremely small targets with a pixel ratio of less than 5%; the 1 / 8 scale detection head is responsible for detecting medium-sized targets and partially occluded targets; and the 1 / 16 scale detection head is responsible for distinguishing large targets and background interference, achieving full coverage detection of targets at multiple scales.

[0142] Each scale detection head is pre-configured with prior anchor boxes that match the target characteristics. The anchor box size is generated by K-means clustering algorithm based on the width and height distribution of labeled targets in the standardized dataset. Specifically, the 1 / 4 scale detection head is configured with 3 sets of small-sized anchor boxes, with a width and height range of 4×4~16×16 pixels, which is suitable for the small target size characteristics in UAV scenarios; the 1 / 8 scale detection head is configured with 3 sets of medium-sized anchor boxes, with a width and height range of 16×16~64×64 pixels; and the 1 / 16 scale detection head is configured with 3 sets of large-sized anchor boxes, with a width and height range of 64×64~320×320 pixels. Each set of anchor boxes corresponds to a unique anchor box index to ensure the traceability of prediction results and anchor boxes.

[0143] The detection heads at each scale simultaneously perform parallel prediction operations. The specific process is as follows: The fused feature map of the corresponding scale is input into a ReLUconv unidirectional convolution with a 1×1 kernel, stride of 1, and padding of 0. Channel dimension transformation is performed, outputting 3×(number of categories + 5) channels, where 3 represents the number of anchor boxes at the corresponding scale, 5 represents the sum of the dimensions of the bounding box regression parameters and the target existence confidence, and the number of categories is consistent with the number of target subject subcategories in the labeled category system constructed from the standardized dataset. The prediction parameters corresponding to each feature map grid are output through convolution operations, including: bounding box center coordinate offset (…). , ), bounding box width and height scaling factor ( , The system includes target confidence level and prediction probability for each category, enabling rapid prediction calculations on the edge.

[0144] Based on the predicted parameters and corresponding prior anchor boxes, the candidate detection boxes are decoded. The decoding process is strictly bound to the feature map grid and anchor box parameters, including the x-coordinate of the bounding box center. , center y-coordinate of bounding box , bounding box width and bounding box height The specific formula is as follows:

[0145] , ,

[0146] , ,

[0147] in, This represents the x-coordinate offset of the bounding box center coordinates. This represents the ordinate offset of the bounding box center coordinates. This is the bounding box width scaling factor. The bounding box height scaling factor. It is the Sigmoid activation function. The x and y coordinates are the top-left corner of the current feature map grid. This represents the width and height of the corresponding prior anchor frame. It is a natural constant;

[0148] After decoding, the center coordinates and width and height of the bounding box are converted to a top-left to bottom-right coordinate format consistent with the annotation system. ,in, , , , And satisfy , The coordinate constraints are used to generate initial candidate detection boxes within the corresponding candidate detection regions. At the same time, each initial candidate detection box is attached with a corresponding unit identifier, scale information, category prediction result and comprehensive confidence score. The comprehensive confidence score is the product of the target existence confidence score and the maximum prediction probability of the corresponding category.

[0149] For the initial candidate detection boxes generated by the left and right detection branches, based on the coordinate offset parameters bound to the corresponding fused feature maps and the scaling parameters recorded in the image normalization process above, a two-level coordinate inverse mapping is performed to convert the local coordinates within the candidate detection area into the global coordinates of the original acquired image, ensuring that the detection results completely match the spatial position of the original scene. The specific sub-steps are as follows:

[0150] For the initial candidate detection box of the left region branch, its bound x-axis coordinate offset is 0 pixels, and the detection box coordinates are directly set to... Mapped to coordinates within a normalized 640×320 image ,in , , , For the initial candidate detection box of the right region branch, its bound x-axis coordinate offset is 320 pixels, and the mapped coordinates are... , , , After mapping, the coordinates of all detection boxes are unified to the global coordinate system of the normalized 640×320 image, that is, with the upper left corner of the image as the origin, the positive x-axis is horizontal to the right, and the positive y-axis is vertical downward.

[0151] Based on the scaling parameters recorded in the image normalization process above, coordinate scale restoration is performed. These scaling parameters are the size scaling ratio between the original image and the normalized image, denoted as... If there are black pixel-filled areas during the normalization process, the pixel offset of the filled areas is recorded simultaneously. ,in, This represents the padding pixel offset of the normalized image along the horizontal x-axis. This represents the fill pixel offset of the normalized image in the vertical y-axis direction; the global coordinates within the original image after mapping include the original top-left x-coordinate. Original top-left ordinate Original bottom right x-coordinate and the original bottom right ordinate The specific formula is as follows:

[0152] , ,

[0153] , ,

[0154] The mapped coordinates are rounded down to the nearest integer to ensure that the coordinate values ​​match the pixel grid of the original image. At the same time, the validity of the coordinates is verified, and invalid detection boxes that completely exceed the boundaries of the original image are removed. For some detection boxes that exceed the image boundaries, boundary truncation is performed to ensure that the final coordinate values ​​are within the valid pixel range of the original image, and global candidate detection boxes are generated in the coordinate system of the original image.

[0155] For global candidate detection boxes within ±10 pixels on both sides of the segmentation line of the original normalized image, cross-region target matching verification is performed. The intersection-union ratio (IOU) and center distance of the detection boxes generated by the left and right regional branches within this range are calculated. If the IOU of the two sets of detection boxes is ≥0.3 and the center distance is ≤1 / 2 of the minimum side length of the corresponding detection box, they are determined to be the same cross-segmentation line target. The two sets of detection boxes are initially merged to generate a merged detection box that covers the complete contour of the target, avoiding the problem of repeated detection of cross-line targets or contour breakage caused by block cropping.

[0156] For all global candidate detection boxes that have completed coordinate inversion mapping, a two-stage non-maximum suppression (NMS) screening is performed. The distance intersection-over-union (DIoU-NMS) algorithm optimized for small targets is adopted. This algorithm considers both the intersection-over-union ratio and the center distance of the detection boxes. Compared with the traditional NMS algorithm, it can effectively reduce the false negative rate of small targets and occluded targets in complex scenes. The specific sub-steps are as follows:

[0157] Global candidate detection boxes are grouped according to target category, with detection boxes in the same category grouped into the same processing group. For each category group, a confidence threshold screening is first performed, with two levels of confidence thresholds: for detection boxes generated by the 1 / 4 scale detection head specifically for small targets, the confidence threshold is set to 0.25 to avoid missing extremely small and weak targets; for detection boxes generated by the 1 / 8 and 1 / 16 scale detection heads, the confidence threshold is set to 0.4 to filter out high-confidence valid detection boxes. Low-quality detection boxes with an overall confidence score lower than the corresponding threshold are removed, while high-confidence global candidate detection boxes are retained.

[0158] For each category group, high-confidence global candidate bounding boxes are retained and sorted from highest to lowest overall confidence. The bounding box with the highest overall confidence is selected as the baseline bounding box, and the DIoU value between the remaining bounding boxes and the baseline bounding box is calculated. The DIoU calculation formula is as follows:

[0159] ,

[0160] in, The intersection-union ratio of the two detection boxes. The square of the Euclidean distance between the center points of the two detection boxes. These are the coordinates of the center point of the detection frame currently participating in the comparison and verification. The coordinates of the center point of the reference frame with the highest overall confidence level selected in the current step. The length of the diagonal of the minimum bounding rectangle of the two detection boxes is given. If the DIoU value of the detection box and the reference box is greater than or equal to the preset IOU threshold of 0.45, it is determined to be a duplicate detection box and is removed. The above process is repeated until all detection boxes are filtered and merged to generate a valid detection box without duplicates in this category.

[0161] For all categories of valid detection boxes without duplication, cross-category overlap verification is performed. If multiple high-confidence detection boxes of different categories appear at the same location, the detection box with the highest overall confidence is retained, and the detection boxes of other categories are removed. At the same time, the aspect ratio of the detection boxes is verified, and extreme abnormal boxes with aspect ratios exceeding the preset threshold of 1:20 are removed to avoid invalid detection results caused by feature noise.

[0162] The valid detection results are sorted from high to low according to the overall confidence level to generate a structured target detection result set. Each detection result in the target detection result set contains three core pieces of information: target category information, target bounding box position, and target confidence level. At the same time, a corresponding detection result description file is generated, which records metadata information such as the original image information, model inference parameters, total number of detected targets, and category distribution statistics, and is stored in association with the target detection result set.

[0163] To meet the deployment requirements of UAV embedded platforms, the target detection result set is converted into a TXT format file consistent with the annotation format mentioned above, realizing a one-to-one mapping between the detection results and the original images; at the same time, it supports real-time streaming output mode, which pushes the target detection results to the UAV flight control platform and ground station simultaneously, completing the entire process of lightweight detection of small targets by UAVs in complex scenarios, and outputting the final target detection results.

[0164] Example 2:

[0165] In Example 1, although the detection method of block cropping can improve the resolution of local areas and reduce the computational scale of a single detection, each area only relies on local features for target recognition, and cross-regional spatial structure information is missing, which can easily lead to discontinuous expression of small target features and insufficient detection stability.

[0166] Based on the above problems, this embodiment introduces a cross-regional collaborative enhancement step between feature extraction and feature fusion, on the basis of the model structure of embodiment 1. By constructing regional association weights and executing key feature guidance transmission, semantic information constraints and sharing between block regions are realized, thereby improving the stability and consistency of small target detection in complex scenarios.

[0167] The specific implementation process is as follows:

[0168] The candidate detection regions formed by dividing the left and right sides are input into the feature extraction network. The candidate detection regions are mapped step by step through multi-layer convolution operations. Similarly, the C3_CA_light lightweight channel attention structure introduced in the shallow layer is used to enhance the response of small targets. At the same time, the ReLUconv integrated convolution structure is used to complete the feature expression compression, resulting in multi-scale region feature maps corresponding to the left and right regions respectively.

[0169] Based on the spatial adjacency of the left and right regions in the original image, position alignment is performed on the feature maps of regions of the same scale. The target response distribution and background complexity are characterized by combining the feature response intensity and texture changes at each position. Based on this, the correlation between regions is calculated to obtain the region association weight used to characterize the cross-regional relationship.

[0170] Based on the regional feature map and regional association weights, the feature locations with significant responses in the regional feature map are selected to form a key feature subset. According to the regional association weights, the key features of one side of the region are mapped to the corresponding positions on the other side, so that cross-regional information is introduced into the original feature expression, forming a cross-regional enhanced feature map containing cross-regional semantic constraints.

[0171] The cross-region enhanced feature map is input into the feature fusion network composed of FPN and PAN structures. Through top-down and bottom-up paths, features of different scales are aggregated layer by layer, so that shallow high-resolution features and deep semantic features participate in the fusion calculation to obtain a fused feature map for object detection.

[0172] The fused feature map is input into the target detection head to generate candidate detection boxes, and the detection results of the candidate detection regions are mapped to the original image coordinate system. The candidate detection boxes are then filtered and merged using a non-maximum suppression method to obtain the target detection results.

[0173] refer to Figure 3 , Figure 3 A flowchart of a lightweight detection method for small targets on drones applied in complex scenarios.

[0174] This embodiment only describes the cross-regional collaborative enhancement steps in detail; the rest of the implementation process is the same as in Embodiment 1, and will not be elaborated further here.

[0175] refer to Figure 4 , Figure 4 This is a diagram showing the overall structure of a lightweight UAV small target detection model.

[0176] Figure 4 The embodiment of the present invention illustrates the overall structural relationship of the small target detection model, which consists of left and right region inputs, a symmetric feature extraction backbone, a cross-regional collaborative enhancement unit, a feature fusion neck, and a multi-scale detection output. The symmetric feature extraction backbone includes a C3_CA_light module for enhancing the response of small targets and a ReLUconv module for completing feature expression compression. The cross-regional collaborative enhancement unit is located between feature extraction and feature fusion, and is used to perform position alignment, region association modeling, and bidirectional mapping of key features on the same scale of the left and right regions.

[0177] Furthermore, based on the spatial adjacency of the left and right regions in the original image, positional alignment is performed on the feature maps of regions at the same scale, and the correlation between regions is calculated to obtain the region association weights used to characterize cross-regional relationships, including the following steps:

[0178] The system receives the left and right multi-scale feature maps output by the feature extraction network. Based on the unit identifiers attached to the two sets of feature maps, it completes the one-to-one binding of the input features with the left and right regions, ensuring the traceability of the feature source and the accuracy of the spatial correspondence. The system then performs scale decoupling processing on the two sets of bound multi-scale feature maps, decomposing them into three pairs of left and right feature maps of the same scale at the 1 / 4, 1 / 8, and 1 / 16 scale levels. The 1 / 4 scale feature map pairs all have a dimension of 80×80×128, the 1 / 8 scale feature map pairs all have a dimension of 40×40×256, and the 1 / 16 scale feature map pairs all have a dimension of 20×20×512, which is completely consistent with the feature dimensions output by the feature extraction network mentioned above.

[0179] Standardization preprocessing is performed on the feature values ​​of the left and right feature map pairs at each scale to normalize the feature values ​​to the [0,1] interval, thereby eliminating the interference of the numerical distribution differences of feature maps at different levels on subsequent feature statistics and correlation calculations. At the same time, the weak feature responses corresponding to small targets are retained to provide standardized input for subsequent processing.

[0180] Based on the horizontal adjacency of the left and right regions in the original normalized image, spatial alignment is performed on each pair of left and right feature maps of the same scale. The alignment process strictly follows the coordinate system unified above, that is, with the top left corner of the image as the origin, the horizontal direction to the right as the positive x-axis, and the vertical direction downward as the positive y-axis, to ensure that the spatial position of the feature map is completely mapped to the physical space of the original image. The specific sub-steps are as follows:

[0181] For the left and right feature maps of the same scale, a one-to-one mapping relationship is established with the y-axis as the reference axis. The pixel row with y-coordinate n in the left feature map and the pixel row with y-coordinate n in the right feature map correspond to the left and right adjacent regions of the same horizontal row in the original normalized image. This ensures that the target contour and texture features in the vertical direction are fully aligned across the region dimension, avoiding cross-region target feature breakage caused by row offset.

[0182] For the right edge of the left region feature map and the left edge of the right region feature map, pixel-level boundary alignment is performed to ensure that the pixels of the two edge columns are adjacent and continuous pixel columns in the original normalized image without spatial misalignment.

[0183] For the dedicated detection feature layer for small targets at the 1 / 4 scale, sub-pixel-level fine alignment is performed, and bilinear interpolation is used to perform sub-coordinate correction on the edge regions of the feature map to ensure accurate correspondence of the feature positions of small targets with extremely low pixel proportions. For the feature layers at the 1 / 8 and 1 / 16 scales, hierarchical coarse alignment is performed to reduce the amount of computation while ensuring accurate spatial correspondence, thus adapting to the requirements of lightweight model and the computing power constraints of UAV embedded platforms.

[0184] After alignment, additional spatial location mapping parameters are added to each pair of left and right feature maps of the same scale. The correspondence between the pixel coordinates of the feature map and the global coordinates of the original normalized image is recorded to ensure that the spatial location of subsequent associated weight calculations is traceable.

[0185] For each pair of left and right feature maps of the same scale that have been spatially aligned, feature statistical calculations are performed position-by-position to extract the feature response intensity and texture change at each spatial pixel location. This provides a quantitative basis for subsequent characterization of target response distribution and background complexity. The lightweight operators consistent with those described above are used throughout the process to ensure that the number of model parameters does not increase significantly. The specific sub-steps are as follows:

[0186] For each spatial location in the feature map Calculate the mean of the absolute values ​​of all feature values ​​within the channel dimension corresponding to that position, and use this as the feature response intensity at that position, denoted as . The higher the feature response intensity, the higher the feature activation level at that location, and the greater the probability of corresponding to the real target region. After the calculation is completed, the feature response intensity of the entire feature map is normalized by min-max, and the value is mapped to the [0,1] interval to eliminate the difference in feature values ​​at different scales and different channels.

[0187] For each spatial location in the feature map A 3×3 depth-separable Sobel operator is used to calculate the feature gradient magnitudes in the horizontal and vertical directions at the given location. The average of these two gradient magnitudes is taken as the degree of texture change at that location, denoted as . The higher the degree of texture change, the more complex the local feature texture at that location, and the greater the probability of a complex background interference region. The depth-separable Sobel operator is completely consistent with the depth-separable convolution structure used in the lightweight C3 module mentioned above, which is suitable for lightweight requirements. After the calculation is completed, the degree of texture change is normalized by min-max and mapped to the [0,1] interval.

[0188] For each region and each scale of the feature map, a response intensity matrix and a texture change matrix with the exact same size as the feature map are generated. Each position in the two matrices corresponds one-to-one with the spatial pixel position of the feature map. At the same time, corresponding unit identifiers, scale information and spatial position mapping parameters are attached to the matrices to ensure the binding relationship with the original feature map.

[0189] Based on the position-wise response intensity matrix and texture change matrix, the target response distribution and background complexity are characterized for the feature map of each region and each scale, generating corresponding quantization masks to provide a basis for weight allocation in subsequent cross-region correlation calculations. The specific sub-steps are as follows:

[0190] For the response intensity matrix of each feature map, two levels of response intensity thresholds are preset. The response intensity threshold for the feature layer dedicated to small targets at the 1 / 4 scale is set to 0.4 to avoid missing weakly activated micro-targets. The response intensity threshold for the feature layers at the 1 / 8 and 1 / 16 scales is set to 0.6 to filter high-confidence target candidate regions. The positions where the normalized feature response intensity is greater than or equal to the corresponding response intensity threshold are marked as candidate target response regions, and the remaining positions are marked as background regions. A binary target response mask is generated, and the mask size is completely consistent with the corresponding feature map to accurately depict the spatial distribution of the target within the region.

[0191] For the texture change matrix of each feature map, the preset texture change threshold is 0.7. This threshold is based on the difference in texture distribution between small drone targets and interfering backgrounds in complex scenes. It has been verified by multiple sets of comparative experiments as the optimal value. It can effectively suppress interference from high-texture complex backgrounds while avoiding the misfiltering of small target edge texture features. The positions with a normalized texture change degree greater than or equal to 0.7 are marked as high-complexity background areas, and the remaining positions are marked as low-complexity background areas. A binary background complexity mask is generated. The mask size is completely consistent with the corresponding feature map, accurately depicting the background interference distribution in the region.

[0192] Spatial continuity verification is performed on the generated target response mask and background complexity mask to remove isolated, single-pixel invalid response regions, ensuring that the distribution characteristics depicted by the mask match the spatial distribution characteristics of the real target and complex background, and providing a reliable distribution basis for subsequent association weight calculation.

[0193] Based on the left and right feature map pairs aligned at the same scale, the feature response intensity and texture change at corresponding positions, as well as the target response distribution and background complexity mask, the positional correlation between the left and right regions is calculated at different scales to generate region association weights to represent cross-regional relationships. At the same time, weight enhancement is performed on adjacent regions that cross the segmentation line to solve the problem of discontinuity of target features across lines caused by block cropping. The specific sub-steps are as follows:

[0194] For each pair of left and right feature maps of the same scale, the Pearson correlation coefficient between the feature sequence of the y-th row of the left region feature map and the feature sequence of the y-th row of the right region feature map is calculated row by row according to the aligned y-axis row coordinates. This coefficient is used as the row-level basic correlation coefficient for that row. Its value ranges from [-1, 1]. The larger the absolute value, the higher the feature correlation between the left and right regions of that row; the calculated... Perform linear normalization to map to the [0,1] interval, eliminating the interference of negative correlation values ​​on subsequent weight calculations;

[0195] For each spatial location in the feature map Combined with the normalized row-level basic correlation coefficient Normalized characteristic response intensity at this location Normalized texture variation degree Calculate the initial value of the association weight at this position. The calculation formula is:

[0196] ,

[0197] in, This is the target response weighting coefficient, with a value of 0.7. The background complexity weight coefficient is set to 0.3. This value is determined to be the optimal ratio based on the task characteristics of UAV small target detection in complex scenarios and through multiple sets of comparative experiments. The sum of the two coefficients is 1, ensuring that the initial weight calculation prioritizes the target response region while suppressing invalid associations in high-complexity background regions. This formula uses row-level basic correlation coefficients. As a fundamental constraint for cross-regional correspondence, the normalized characteristic response intensity is then used as a basis. As a saliency representation term, it represents the inverse value of the degree of texture change. As a background suppression characterization term, it participates in the weight calculation, so that the initial value of the association weight reflects the matching degree of the left and right regions, the strength of the target response and the complexity of the background. This achieves weight enhancement for target candidate regions with high response and low complexity, and weight suppression for background interference regions with low response and high complexity, ensuring that the association weight prioritizes matching the cross-regional features of the real target.

[0198] For the left and right edge positions corresponding to the segmentation line of the original normalized image, neighborhood weight enhancement processing is performed. For the region with ±3 columns of pixels on the right edge of the left region feature map and ±3 columns of pixels on the left edge of the right region feature map, a Gaussian kernel weighted enhancement factor is set. The value range of the enhancement factor is 1.2~2.0. This value range is based on the detection requirements of small targets crossing the segmentation line neighborhood in the block cropping scenario. It has been verified by multiple sets of comparative experiments as the optimal range. It can effectively enhance the feature association of cross-line targets without introducing invalid background interference. The closer to the segmentation line, the larger the enhancement factor is, thereby strengthening the cross-region association weight of cross-segmentation line targets and solving the problem of feature breakage and association loss of cross-line targets caused by block cropping.

[0199] After edge enhancement, the initial association weights are subjected to global min-max normalization, which maps all weight values ​​to the [0,1] interval to obtain the final region association weights. Generate region association weight maps for the left and right regions, with the same size as the corresponding scale feature maps. The weight value of each spatial location in the region association weight map represents the degree of feature association between that location and the corresponding location in another region. The higher the weight value, the stronger the feature correlation between the two locations, and the higher the priority of cross-region information sharing.

[0200] Perform a final validity check on the left and right region association weight maps generated at each scale. The check includes: the weight value range is strictly within the [0,1] range; the weight map size is completely consistent with the corresponding feature map dimension; the weights of adjacent regions of the dividing line are continuous without abrupt changes; and the unit identifier is completely bound to the scale information. For weight maps that fail the check, recalculate the cross-region correlation until they meet the check requirements.

[0201] After successful verification, the left and right region association weight maps at each scale are arranged and combined according to the 1 / 4, 1 / 8, and 1 / 16 scale levels to form a complete set of region association weights. Each weight map in the set is assigned a corresponding unit identifier, scale information, and spatial location mapping parameters, and is bound and stored with the corresponding multi-scale region feature map to ensure accurate matching between weights and feature maps in subsequent cross-region feature mapping. Finally, the set of region association weights is output for subsequent key feature selection and cross-region feature enhancement steps.

[0202] Furthermore, based on the regional feature map and regional association weights, feature locations with significant responses are selected to form a key feature subset. Then, according to the regional association weights, the key features of one side of the region are mapped to the corresponding locations on the other side, forming a cross-regional enhanced feature map. This includes the following steps:

[0203] The system receives the left and right multi-scale feature maps output by the feature extraction network, as well as the set of region association weights generated in the previous steps. Based on the unit identifier and scale information, it completes the one-to-one binding of the feature maps with the corresponding association weight maps, ensuring that the left region feature map and the left region association weight map, and the right region feature map and the right region association weight map are accurately paired at scales of 1 / 4, 1 / 8, and 1 / 16. The width, height, and spatial position mapping parameters of each pair of feature maps and the association weight maps are completely consistent, providing a spatial alignment benchmark for subsequent key feature selection and cross-region mapping.

[0204] Perform feature value consistency checks on all feature maps to ensure that feature values ​​are within the standardized range of [0,1]. Perform threshold truncation on feature values ​​that exceed the range to avoid key feature selection bias caused by abnormal feature values ​​and to provide standardized input for subsequent processing.

[0205] For each pair of paired left and right region feature maps and association weight maps, key feature filtering is performed position-by-position according to scale level. The filtering rules strictly combine the feature response intensity, texture change degree, region association weight, target response mask and background complexity mask generated in the previous steps, and adapt to different scale detection responsibilities to ensure that the selected key features are high-confidence target-related features and free from redundant background interference features. The specific sub-steps are as follows:

[0206] For the dedicated detection feature layer for small targets at the 1 / 4 scale, a response intensity threshold of 0.4 and an association weight threshold of 0.3 are set for key feature selection to meet the feature retention requirements of extremely small and weak targets. For the feature layers at the 1 / 8 and 1 / 16 scales, a response intensity threshold of 0.6 and an association weight threshold of 0.5 are set for key feature selection to select high-confidence target core features. The preset texture change threshold of 0.7 is used for all scales to include high-complexity background areas with a normalized texture change degree greater than or equal to 0.7 in the feature removal range to avoid introducing invalid background interference. The above thresholds are all determined based on the target feature distribution statistics of the standardized dataset and through 5-fold cross-validation. The association weight threshold for the range of ±3 columns of pixels adjacent to the dividing line is relaxed to 80% of the original threshold to avoid the wrong removal of key features of targets crossing the dividing line.

[0207] For each spatial location in the feature map A location is marked as a key feature location when all of the following conditions are met: the location is within the candidate target response region of the target response mask; the normalized feature response intensity at the location is greater than or equal to the response intensity threshold at the corresponding scale; and the region association weight at the location is met. The correlation weight threshold is greater than or equal to the corresponding scale; the normalized texture change at this position is less than 0.7, and it does not belong to the high-complexity background area; at the same time, for the left and right regions of the segmentation line corresponding to the original normalized image, the correlation weight threshold is relaxed to 80% of the original threshold to avoid the key features of cross-segmentation targets being mistakenly removed and to ensure the feature continuity of cross-segment targets.

[0208] For each region and each scale of the feature map, extract the full feature vectors of all key feature locations corresponding to the channel dimensions. For each key feature vector, add the corresponding spatial location coordinates, unit identifier, scale information, and region association weight value to form a key feature subset that corresponds one-to-one with the spatial location of the feature map. At the same time, generate a binary key feature mask, in which key feature locations are marked as 1 and other locations are marked as 0. The mask size is completely consistent with the corresponding feature map and is used to guide the location of subsequent cross-region feature mapping.

[0209] The generated key feature subsets are subjected to non-empty verification and spatial continuity verification. If the number of effective features in a key feature subset at a certain scale is 0, the top 10% of high response intensity features of the feature map at that scale are retained as supplementary key features to avoid feature enhancement failure. Isolated single-pixel key feature positions are culled to ensure that the spatial distribution of the key feature subset matches the contour distribution characteristics of the real target and avoid noise feature interference.

[0210] Based on the spatial alignment results of the left and right feature maps of the same scale completed in the previous steps, as well as the key feature subset and key feature mask, a bidirectional cross-regional mapping of key features in the left and right regions is performed. The key features of one side region are weighted according to the region association weight and mapped to the corresponding spatial position in the other side region, realizing the bidirectional transfer and complementarity of cross-regional semantic information. The entire process adopts lightweight element-wise operation without introducing additional redundant parameters, adapting to the computing power constraints of UAV embedded platforms. The specific sub-steps are as follows:

[0211] Strictly following the spatial location mapping relationship established in the previous steps, the coordinates in the left region feature map are... The key feature location, corresponding to the coordinates in the right region feature map, is... The matching position ensures that the spatial position before and after mapping is completely aligned with the physical space of the original normalized image, without coordinate misalignment; for the key feature positions in the neighborhood of the segmentation line, a 3×3 neighborhood weighted matching strategy is adopted, with the corresponding position as the center, and the matching weight is allocated in combination with the association weight of the neighboring pixels, to further improve the accuracy of cross-line target feature mapping.

[0212] For each feature vector in the key feature subset of the left region, the region association weight corresponding to that position is used. As weighting coefficients, a weighting operation is performed on the feature vectors to generate the feature vector to be mapped in the left region, which is then mapped to the corresponding matching position in the feature map of the right region. For each feature vector in the key feature subset of the right region, the region association weight corresponding to that position is used as the weighting coefficient. Using the weighting coefficients, the same weighting operation is performed to generate the feature vector to be mapped in the right region, which is then mapped to the corresponding matching position in the feature map of the left region. By using the associated weights, it is ensured that highly correlated target features receive higher fusion weights, while low-correlation background features are effectively suppressed.

[0213] For the original feature maps of the left and right regions, a fusion operation between the original features and the mapped features is performed respectively. The fusion formula is as follows:

[0214] ,

[0215] in, This is the enhanced feature vector at that location after fusion. This is the original feature vector at that location. This is the feature vector to be mapped from the opposite region received at this location. The cross-region fusion weight coefficient is set to 0.3. This value was determined based on multiple sets of comparative experiments on small target detection tasks using UAVs in complex scenes. It effectively introduces cross-regional semantic constraints while preserving the core features of the original region, avoiding excessive interference with the original feature representation. For the neighborhood of the segmentation line, [the following is omitted as it is not directly related to the previous sentence]. The coefficient was increased to 0.5, which enhanced the cross-region feature fusion effect of cross-line targets and solved the problem of feature breakage of cross-line targets caused by block clipping.

[0216] For the fused feature map, batch normalization is performed along the channel dimension to renormalize the feature values ​​to the [0,1] interval, eliminate the feature value distribution shift caused by cross-region fusion, ensure that the fused feature distribution is consistent with the original feature distribution, adapt to the input requirements of the subsequent feature fusion network, and avoid expression distortion caused by feature value overflow.

[0217] For the feature maps of the left and right regions at each scale after cross-regional fusion, semantic consistency constraints and dimension alignment are performed to ensure that the enhanced feature maps are completely matched with the original multi-scale region feature maps in terms of dimension and semantic distribution. This allows for seamless integration into subsequent feature fusion networks and strengthens the consistency of cross-regional target feature expression. The specific sub-steps are as follows:

[0218] For each set of enhanced feature maps of the left and right regions at the same scale, the mean difference and variance difference of the feature value distributions of the two regions are calculated. If the mean difference exceeds a preset threshold of 5%, the feature values ​​are linearly corrected based on the global mean of the two features to ensure the semantic distribution consistency of the features of the left and right regions at the same scale and to avoid detection misalignment caused by the feature deviation of the left and right regions during subsequent feature fusion and detection.

[0219] Verify the dimensions of the enhanced feature maps at each scale to ensure that the dimensions of the 1 / 4 scale enhanced feature map are strictly 80×80×128, the 1 / 8 scale is 40×40×256, and the 1 / 16 scale is 20×20×512, which are completely consistent with the dimensions of the original multi-scale region feature maps, with no deviation in the number of channels or width and height, ensuring that the subsequent feature fusion network can directly receive the enhanced feature maps without adjusting the structure.

[0220] For the dedicated enhancement feature map of small targets at a scale of 1 / 4, a 3×3 depthwise separable convolution, consistent with the previous method, is used to perform secondary enhancement processing on the edge features at key feature locations. Without increasing the number of parameters too much, the edge feature response intensity of small targets after cross-region enhancement is further improved, background noise features are suppressed, and the feature expression capability of small targets is enhanced.

[0221] For each scale-enhanced feature map that has completed consistency constraints and dimensional alignment, a final validity check is performed. The check includes: feature map dimensional compliance, feature value range within the [0,1] normalized range, complete binding of unit identifier and scale information, and spatial location mapping parameters that are completely consistent with the original feature map. Enhanced feature maps that fail the check are removed, and cross-regional fusion processing is re-executed until the check requirements are met.

[0222] After successful verification, the enhanced feature maps of the left and right regions at each scale are reattached with corresponding unit identifiers, scale information, coordinate offset parameters, and spatial location mapping parameters. The x-axis coordinate offset of the enhanced feature map of the left region is 0 pixels, and the x-axis coordinate offset of the enhanced feature map of the right region is 320 pixels, while the y-axis coordinate offset is 0 pixels, which is completely consistent with the coordinate system of the previous steps. The enhanced feature maps of the left region at each scale are combined into a set of cross-regional enhanced feature maps of the left region, and the enhanced feature maps of the right region at each scale are combined into a set of cross-regional enhanced feature maps of the right region. The two sets together constitute a complete set of cross-regional enhanced feature maps, whose format, dimensions, and additional information are fully compatible with the original multi-scale regional feature maps, completing the entire cross-regional collaborative enhancement process. The result is output to the subsequent feature fusion network composed of FPN and PAN structures for multi-scale feature aggregation processing.

[0223] refer to Figure 5 , Figure 5 A schematic diagram of a cross-regional collaborative enhancement mechanism.

[0224] Figure 5 This embodiment of the invention illustrates that, under left-right block detection conditions, based on the spatial adjacency relationship between the left and right regions in the original image, position alignment is performed on the feature maps of the same scale region. Region association weights are calculated by combining the feature response intensity and texture changes at each position, key features are screened, and further, bidirectional cross-regional mapping and fusion are performed on the key features to establish a stable semantic information sharing relationship between the block regions, improving the continuity of feature representation for cross-regional targets. Specifically, the adjacent feature regions on both sides of the boundary corresponding to the original image segmentation line retain the spatial continuity between the left and right blocks and are the main scope for performing row-level position alignment, association weight calculation, and bidirectional mapping of key features. By establishing a correspondence between the left and right feature maps within this adjacent feature region, feature breakage, duplicate responses, or local missed detection problems caused by block processing when the target is near the segmentation line can be avoided.

[0225] This embodiment collects and annotates image data obtained during UAV flight to form a standardized dataset that can be directly used for model training and validation. Based on this, image size normalization, left and right block cropping, and candidate detection region organization are performed to allow small targets to enter the detection network in a more suitable input form. Subsequently, using a small target detection model built on an improved YOLOv5s, lightweight feature extraction, multi-scale feature fusion, candidate detection box generation, coordinate inverse mapping, and filtering and merging are sequentially performed on the candidate detection regions, outputting a structured detection result containing target category information, target bounding box position, and target confidence. Furthermore, this embodiment introduces a cross-regional collaborative enhancement mechanism in the block detection process. By aligning the feature maps of the left and right regions, associating them, and guiding the transmission of key features, a stable semantic information sharing relationship is established between the block regions, thereby improving the continuity of feature representation for cross-regional targets under block cropping conditions. Based on the above technical path, this solution can not only adapt to the detection needs in scenarios with complex backgrounds, occlusion interference, and weak features of small targets, but also balances model lightweighting, inference efficiency, and edge deployment requirements, demonstrating strong engineering application value.

[0226] Example 3:

[0227] This invention discloses a lightweight detection system for small targets on unmanned aerial vehicles (UAVs) in complex scenarios, comprising a data construction module, a region generation module, and a detection output module.

[0228] The data construction module acquires image data captured by drones during flight in complex scenarios and performs target annotation. The annotation content includes target category labels and target bounding box positions, and is organized into a standardized dataset as required.

[0229] The region generation module is based on a standardized dataset. It performs size normalization on the image data and performs left and right block cropping with adjacent overlapping regions to obtain two region images. These are then organized as independent input units to form candidate detection regions.

[0230] The detection output module inputs candidate detection regions into the small target detection model. It extracts multi-scale feature maps of the left and right regions through two weight-sharing feature extraction branches. Based on the spatial adjacency of the left and right multi-scale feature maps, it performs positional alignment on feature maps of the same scale. It then generates region association weights based on feature response intensity, texture change degree, and row-level basic correlation coefficient. Bidirectional cross-regional mapping is performed on key features according to these weights to form a cross-regional enhanced feature map. This enhanced feature map is then input into a feature fusion network for multi-scale fusion to obtain a fused feature map. Candidate detection boxes are generated based on the fused feature map and mapped to the original image coordinate system. After filtering and merging, the target detection result is output.

[0231] The specific functional implementation of each module is described in the relevant content of the UAV small target lightweight detection method applied to complex scenarios described in Embodiments 1 and 2, and will not be repeated here.

[0232] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A lightweight detection method for small targets by UAVs in complex scenarios, characterized in that, Includes the following steps: Acquire image data captured during drone flight and annotate the targets, including target category labels and target bounding box positions, and organize the data to generate a standardized dataset. Based on a standardized dataset, the image data is normalized in size and cropped in blocks with overlapping adjacency regions according to the adjacency relationship to obtain candidate detection regions. The candidate detection region is input into the small target detection model, and the multi-scale feature map of the left region and the multi-scale feature map of the right region are extracted through two weight-shared feature extraction branches respectively. Based on the spatial adjacency relationship between the multi-scale feature maps of the left and right regions, position alignment is performed on the feature maps of the same scale. Regional association weights are generated based on feature response intensity, texture change degree and row-level basic correlation coefficient. Bidirectional cross-regional mapping is performed on key features according to the regional association weights to form cross-regional enhanced feature maps. The cross-regional enhanced feature map is input into the feature fusion network for multi-scale fusion to obtain a fused feature map. Candidate detection boxes are generated based on the fused feature map, mapped to the original image coordinate system, and output as target detection results after filtering and merging.

2. The lightweight detection method for small targets by UAVs in complex scenarios as described in claim 1, characterized in that, The small target detection model includes a feature extraction network, a cross-regional collaborative enhancement unit, a feature fusion network, and a target detection head. The feature extraction network includes two symmetrical feature extraction branches with shared weights, used to process the left and right region images respectively. The cross-regional collaborative enhancement unit is located between the feature extraction network and the feature fusion network, used to perform position alignment, region association weight calculation, and bidirectional mapping of key features on the feature maps of the same scale in the left and right regions. The feature fusion network uses FPN and PAN structures to perform multi-scale fusion of the cross-regional enhanced feature maps from top to bottom and bottom to top. The target detection head includes multiple decoupled detection heads corresponding to fused feature maps of different scales, used to generate candidate detection boxes, category prediction results, and target confidence scores.

3. The lightweight detection method for small targets by UAVs in complex scenarios as described in claim 1, characterized in that, Region association weights are generated based on feature response intensity, texture variation degree, and row-level basic correlation coefficient, including: Eigenvalue standardization is performed on the feature maps of the left and right regions of the same scale. The feature response intensity of each spatial location is calculated. The depth-separable Sobel operator is used to calculate the feature gradient magnitude in the horizontal and vertical directions to obtain the degree of texture change. Based on the spatial adjacency relationship between the left and right feature maps of the same scale, row-by-row position mapping is performed on the two feature maps, and the Pearson correlation coefficient of the corresponding row feature sequences is calculated to obtain the row-level basic correlation coefficient. For each spatial location in the left and right feature maps of the same scale, the initial value of the association weight of the corresponding spatial location is calculated by using the row-level basic correlation coefficient as a multiplier and combining the feature response intensity and the degree of texture change. For adjacent edge positions at the dividing line, Gaussian kernel weighting is used to enhance the initial values ​​of the association weights within the neighborhood, and global normalization is performed on the initial values ​​of the association weights of all spatial positions to generate regional association weights.

4. The lightweight detection method for small targets by UAVs in complex scenarios as described in claim 1, characterized in that, Bidirectional cross-regional mapping is performed on key features according to regional association weights to form cross-regional enhanced feature maps, including: For each spatial location in the left and right feature maps of the same scale, the spatial location that simultaneously satisfies the following conditions is marked as a key feature location: the feature response intensity is not lower than the response intensity threshold of the corresponding scale, the region association weight is not lower than the association weight threshold of the corresponding scale, and the texture change degree is lower than the complex background judgment threshold. Using the regional association weight of each key feature location as a weighting coefficient, a weighting operation is performed on the key feature vector to generate a feature vector to be mapped, which is then mapped to the corresponding position in the feature map of the other side. A neighborhood weighted matching strategy is adopted for the neighborhood position of the dividing line. The original feature vector and the received feature vector to be mapped are superimposed according to the fusion weight coefficient. The fusion weight coefficient is increased for the neighborhood of the segmentation line. Batch normalization is performed on the fused feature map, and the cross-region enhanced feature map is output.

5. The method for lightweight detection of small targets by UAVs in complex scenarios as described in claim 1, characterized in that, Extract the multi-scale feature maps of the left and right regions, including: The left and right region images in the candidate detection regions are respectively mapped to two symmetrical feature extraction branches with shared weights in the feature extraction network. Each feature extraction branch first performs initial feature mapping through the ReLUconv integrated convolutional structure, and then enhances the response to small targets through a feature enhancement module that embeds a C3_CA_light lightweight channel attention structure; We continue to perform cascaded feature extraction using the lightweight C3 module, downsampling convolution, and spatial pyramid pooling fast module to obtain region feature maps corresponding to different scale levels. Feature maps of each region are extracted according to scale level, forming multi-scale feature maps of the left and right regions respectively.

6. The method for lightweight detection of small targets by UAVs in complex scenarios as described in claim 5, characterized in that, The C3_CA_light lightweight channel attention structure includes: The C3_CA_light lightweight channel attention structure embeds an improved coordinate attention unit into the bottleneck structure of the native C3 module in YOLOv5s, while replacing the standard convolutional layer of the bottleneck branch with a depthwise separable convolution. The improved coordinate attention unit adapts the kernel size of the global average pooling in the horizontal and vertical directions to the width and height dimensions of the corresponding feature map; The improved coordinate attention unit simultaneously performs global average pooling in the horizontal and vertical directions to generate horizontal and vertical position-aware feature vectors. The horizontal and vertical position-aware feature vectors are concatenated and then convolved with a sigmoid activation function to generate a channel attention weight map. The channel attention weight map is then multiplied element-wise with the bottleneck branch input feature map to complete the channel weight enhancement.

7. The method for lightweight detection of small targets by UAVs in complex scenarios as described in claim 2, characterized in that, The fused feature map is obtained, including: Two structurally symmetrical and weight-shared feature fusion branches are assigned to the cross-regional enhanced feature maps of the left and right regions; Each feature fusion branch first performs top-down FPN path feature fusion to obtain the FPN first-level fusion feature map and the FPN second-level fusion feature map; Then, perform bottom-up PAN path feature fusion to obtain the PAN first-level fusion feature map and the PAN second-level fusion feature map; Each feature fusion branch generates a fusion feature map corresponding to a different detection scale. Each set of fusion feature maps is bound to the coordinate offset parameters of the corresponding region, forming a set of fusion feature maps.

8. The method for lightweight detection of small targets by UAVs in complex scenarios as described in claim 7, characterized in that, Output target detection results, including: The fused feature maps of different detection scales in the fused feature map set are input into the decoupled detection head of the corresponding scale to generate initial candidate detection boxes; Based on the coordinate offset parameters bound to the fused feature map, the coordinates of the initial candidate detection boxes of each region are added to the coordinate offset of the corresponding region, unified to the normalized image coordinate system, and the normalized image coordinates are restored to the original image coordinate system to generate global candidate detection boxes. For global candidate detection boxes within the neighborhood range on both sides of the dividing line, cross-regional target matching verification is performed, and preliminary merging is performed on global candidate detection boxes that meet the intersection-union ratio and center distance conditions; The DIoU-NMS algorithm is used to group targets by category. After filtering based on confidence threshold, duplicate global candidate detection boxes are removed based on intersection-union ratio and center distance to generate target detection results.

9. The method for lightweight detection of small targets by UAVs in complex scenarios as described in claim 1, characterized in that, The image data is normalized in size and then cropped in blocks with overlapping adjacencies according to adjacency relationships to obtain candidate detection regions, including: Image data and corresponding annotation files are retrieved from a standardized dataset. Gray-scale mean normalization and size normalization are performed on the image data to obtain a normalized image that maintains the original aspect ratio. Using the midpoint of the normalized image width as a reference, a 10-pixel-wide adjacent overlap region is set along the vertical direction to crop the normalized image into a left region image and a right region image. The left and right regions are used as independent input units, and a unique unit identifier is assigned to each independent input unit. A Gaussian filtering algorithm is used to denoise each independent input unit to form a set of candidate detection regions.

10. A lightweight detection system for small targets on UAVs in complex scenarios, used to implement the lightweight detection method for small targets on UAVs in complex scenarios as described in any one of claims 1-9, characterized in that, Includes a data construction module, a region generation module, and a detection output module: The data construction module acquires image data captured during the drone's flight and performs target annotation, including target category labels and target bounding box positions, and organizes the data to generate a standardized dataset. The region generation module is based on a standardized dataset. It performs size normalization on the image data and performs block cropping with adjacent overlapping regions according to the adjacency relationship to obtain candidate detection regions. The detection output module inputs candidate detection regions into the small target detection model. It extracts multi-scale feature maps of the left and right regions through two weight-sharing feature extraction branches. Based on the spatial adjacency of the left and right multi-scale feature maps, it performs positional alignment on feature maps of the same scale. It then generates region association weights based on feature response intensity, texture change degree, and row-level basic correlation coefficient. Bidirectional cross-regional mapping is performed on key features according to these weights to form a cross-regional enhanced feature map. This enhanced feature map is then input into a feature fusion network for multi-scale fusion to obtain a fused feature map. Candidate detection boxes are generated based on the fused feature map and mapped to the original image coordinate system. After filtering and merging, the target detection result is output.