Tracking early warning method and system for realizing low-altitude unmanned aerial vehicle target warning countering
By improving the YOLOv8 algorithm and integrating a spectrum band interference countermeasure and a loudspeaker, the problem of the lag in traditional security systems against unauthorized drones has been solved, enabling efficient tracking and countermeasures against low-altitude drones and improving detection accuracy and countermeasure capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional security systems struggle to provide effective early warnings of unauthorized drones entering restricted areas, exhibiting a delay in response and failing to issue timely warnings and dispersal, potentially leading to losses. Small target detection suffers from low accuracy at long distances, resulting in frequent false positives and missed detections, hindering effective tracking and countermeasures.
An improved YOLOv8 algorithm is employed, combined with multi-scale feature fusion, attention mechanism, lightweight design, and path aggregation structure to enhance the detection accuracy of small targets. The system integrates a spectrum band jamming countermeasure and a loudspeaker to achieve real-time tracking and countermeasures against UAVs.
It improves the detection accuracy and efficiency of low-altitude drones, enables timely early warning and countermeasures against unauthorized drone flights, reduces the workload of management personnel, and is suitable for scenarios such as unmanned locations and energy hubs.
Smart Images

Figure CN121640618A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of unmanned aerial vehicle (UAV) technology, and in particular relates to a tracking and early warning method and system for realizing low-altitude UAV target early warning and countermeasure. Background Technology
[0002] In some key monitoring areas, such as airports, prisons, and energy hubs, restricted zones are set up in certain areas to prevent unauthorized drones from loitering, intruding, and engaging in various acts of sabotage. Traditional security systems struggle to provide early warnings of unauthorized drones entering these restricted zones and cannot immediately deploy personnel to the scene to warn and disperse them, resulting in a certain degree of lag. In some sensitive areas, this delay may cause the best opportunity to act to be missed, leading to certain losses.
[0003] Object detection, a key task in computer vision, aims to automatically identify and locate specific objects in images or videos. With the rapid development of computer vision technology and the deep application of deep learning algorithms, it plays a crucial role in many fields such as face recognition, identity authentication systems, and autonomous driving. Currently, significant progress has been made in large object detection using deep learning, but small object detection is still in the exploratory stage. Small objects suffer from problems such as small scale, low resolution, lack of contextual information, scale imbalance with the background, and inaccurate location, making detection extremely difficult and resulting in frequent false positives and false negatives. There are two main definitions of small objects: the International Society for Optical Engineering (ISO) defines small objects as those whose size is less than 0.12% of the original image size; the MSCOCO dataset considers objects smaller than 32×32 pixels as small objects. In the object detection algorithm system, small object detection algorithms are mainly divided into two categories: traditional object detection algorithms and deep learning-based object detection algorithms.
[0004] Given that the equipment needs to be able to identify distant targets, and that the farther the target is, the smaller its size becomes, the more pronounced the challenges of small target detection become. To effectively address the problems of small targets having few pixels, low resolution, weak expressive power, complex background information, and serious false negatives and missed detections, [further solutions are needed]. Summary of the Invention
[0005] To overcome the problems existing in related technologies, the present invention discloses a tracking and early warning method and system for realizing low-altitude unmanned aerial vehicle (UAV) target early warning and countermeasures. It relates to the field of intelligent tracking and countermeasures technology for unauthorized UAVs, and particularly to a fully autonomous intelligent UAV tracking, early warning, and countermeasures system and method. It also relates to an intelligent tracking and early warning method applied to this system.
[0006] The technical solution is as follows: A tracking and early warning method for detecting and countering low-altitude unmanned aerial vehicle (UAV) targets, comprising the following steps:
[0007] S1, through the image encoding and processing module of the low-light detection camera, preprocesses the real-time video of the drone target acquired by the low-light detection camera and displays the video on a browser or operating platform;
[0008] S2 takes the pre-processed real-time video of the drone target and uses the improved YOLOv8 algorithm to detect the drone target. It tracks drone targets that exceed the set threshold. The tracking command is sent to the gimbal via serial port protocol. The gimbal drives the tracking camera and spectrum band interference countermeasure to rotate to the target area in real time and transmits the current position of the gimbal back in real time.
[0009] S3 tracks the camera and corrects the current position of the gimbal in real time. Based on the corrected position, it triggers a loud warning and performs radio interference and blocking on drones that cross the boundary.
[0010] In step S2, the improved YOLOv8 algorithm includes:
[0011] S201, Feature Extraction; Through a multi-scale feature fusion mechanism and the introduction of an attention mechanism, the detailed and semantic information of small targets in the feature extraction process of the backbone network is captured; where small targets are targets with a pixel size of less than 32×32.
[0012] S202, based on the captured detailed and semantic information of small targets, obtains the localization information of small target location and category by lightweighting the backbone network, improving the path aggregation structure of the neck network, and optimizing the structure of the prediction head;
[0013] S203: Based on the acquired location and category information of small targets, the system randomly crops, scales, and stitches images, oversamples small target samples, generates synthetic samples, performs data augmentation, learns the feature distribution of UAV small targets, and generates realistic UAV small target images.
[0014] In step S201, the multi-scale feature fusion mechanism uses a combination of Feature Pyramid Network (FPN) and Path Aggregation Network (PAN).
[0015] During the feature extraction process of the backbone network, feature maps with different resolutions and semantic levels are generated. First, top-down feature fusion is performed using an FPN structure. The fusion operation after lateral connections uses an element-wise addition method. The feature map after FPN fusion is then... Represented as:
[0016]
[0017] In the formula, For deep feature maps, This is a shallow feature map. This is an upsampling operation;
[0018] Next, feature fusion is performed from bottom to top using the PAN structure. The feature fusion operation during the bottom-up process uses element-wise addition to obtain the final fused feature map. :
[0019]
[0020] In the formula, This is another type of upsampling operation. This is a low-level feature map.
[0021] In step S201, the attention mechanism introduced adopts a hybrid attention mechanism, including spatial attention mechanism and channel attention mechanism;
[0022] The spatial attention mechanism includes: processing the multi-scale fused feature map. Calculate the feature importance at each position; then use average pooling. and max pooling The operation generates two different feature descriptors. and The expression is:
[0023]
[0024]
[0025] The two descriptors are concatenated and then passed through a convolutional layer. Dimensionality reduction is performed to obtain an attention weight map of the same size as the original feature map. The expression is:
[0026]
[0027] In the formula, For splicing operations, For activation functions;
[0028] This attention weight map represents the importance of each location in the feature map, and is used in conjunction with the multi-scale fused feature map. Multiplication suppresses interference from the background region, i.e.: ; Feature maps for integrating importance factors;
[0029] The channel attention mechanism includes: processing the multi-scale fused feature map. Global average pooling is performed in the spatial dimension. and global max pooling This yields feature descriptions at two channel levels. and The expression is:
[0030]
[0031]
[0032] These two descriptions are processed separately using a Multilayer Perceptron (MLP). The MLP operation is represented as follows: Then add them together and pass them through the activation function. Generate channel attention weight vectors The expression is:
[0033]
[0034] The channel attention weight vector represents the importance of each channel, compared with the original feature map. Multiplying each channel together weakens irrelevant channel information; the expression is:
[0035]
[0036] In the formula, This is a channel-based multiplication operation.
[0037] In step S202, the lightweight design of the backbone network includes:
[0038] The backbone network adopts a lightweight design strategy based on depthwise separable convolution; depthwise separable convolution decomposes standard convolution into depthwise convolution and pointwise convolution;
[0039] The depthwise convolution includes: performing convolution operations independently on each input channel, extracting features only in the spatial dimension, and the computational complexity formula is:
[0040]
[0041] In the formula, The kernel size is the convolution kernel size. Input the number of channels. The height of the input feature map, The width of the input feature map;
[0042] The pointwise convolution is used to adjust the number of channels. A 1×1 convolution is performed on the output of the depthwise convolution. The computational complexity formula is as follows:
[0043]
[0044] In the formula, Number of output channels;
[0045] In the interlayer connections of the backbone network, an optimized version of the cross-stage local connection (CSP) structure is adopted. The improved CSP structure adjusts the channel partitioning and fusion methods to extract multi-scale features.
[0046] In step S202, the improvement of the path aggregation structure of the neck network includes:
[0047] The neck network employs an improved path aggregation network (PAN) structure, introducing an adaptive weight fusion mechanism during feature fusion. Input feature maps at different scales are... By learning adaptive weights The fused feature map Based on different feature maps, the contribution of small object detection is weighted and fused, and the expression is as follows:
[0048]
[0049] In the formula, This represents the total number of feature maps in the network. For indexing;
[0050] Weight The weights are calculated using convolutional layers and activation functions, ensuring that the sum of the weights is 1; skip connections and dense connections are added to the connection paths.
[0051] In step S202, the structural optimization of the prediction head includes:
[0052] The prediction head adopts an attention mechanism-based structure optimization strategy, introducing a multi-head attention mechanism (MHA) on the basis of the original YOLOv8 prediction head;
[0053] Suppose the feature map of the input fusion importance factor The query vector is obtained through linear transformation. Key vector Sum value vector The expression is:
[0054]
[0055]
[0056]
[0057] In the formula, All are learnable weight matrices.
[0058] Furthermore, the computational process of the multi-head attention mechanism is as follows:
[0059]
[0060] In the formula, For multi-head attention functions, The splicing operator is used to connect each head together. These are learnable weights;
[0061] in,
[0062]
[0063]
[0064] In the formula, Let be the dimension of the key vector. To query the learnable weights of vector Q, Let K be the learnable weights of the key vector. For learnable weights of the value vector, Let be the attention function. Let be the normalized probability distribution function. For query vectors, The key vector is the transpose. For the first One calculation head.
[0065] In step S3, the tracking camera performs real-time correction of the current position of the pan-tilt unit, including:
[0066] S301. Obtain the target center point after target detection. Pixel coordinates;
[0067] S302. Calculate the target's offset from the center of the screen. ;
[0068] S303. Calculate the gimbal rotation angle based on the camera's field of view.
[0069] S304. Repeat the above steps to bring the target center point closer to the center point of the screen.
[0070] Another objective of this invention is to provide a low-altitude unmanned aerial vehicle (UAV) target early warning and countermeasure system. This system is applied to the aforementioned tracking and early warning method for low-altitude UAV target early warning and countermeasure. The system includes a mounting bracket and a gimbal.
[0071] The gimbal includes a fixed part and a movable part that can move 360° horizontally and 90° vertically relative to the fixed part.
[0072] The fixed part of the gimbal is detachably located on the bottom of the annular visual detection and sensing chamber; multiple low-light detection cameras are mounted around the annular visual detection and sensing chamber.
[0073] The gimbal's movable part is provided with a tracking component and at least one countermeasure component. The movable part can be one or more, and the tracking component and at least one countermeasure component can be located on the same movable part or on separate movable parts.
[0074] The tracking component and at least one of the countermeasure components move synchronously; the countermeasure component includes one or more of a loud warning alarm and a spectrum band interference countermeasure.
[0075] The activation interface of the loud warning alarm is controlled by the interface of the tracking camera;
[0076] The tracking component includes a tracking camera and a target tracking and locking module; the target tracking and locking module is connected to a ring-shaped visual detection and sensing chamber via a rotation axis; wherein, the tracking camera adopts a variable zoom optical system, which can tilt relative to the fixed part of the gimbal to counter the locked target;
[0077] The right side of the movable part of the gimbal is provided with a side-mounted shield, and the spectrum band interference countermeasure is located inside the side-mounted shield.
[0078] Combining all the above technical solutions, the beneficial effects of this invention are as follows:
[0079] This invention provides a low-altitude unmanned aerial vehicle (UAV) target detection and countermeasure system, comprising a mounting bracket, a ring-shaped visual detection and sensing chamber, and a gimbal. The gimbal is equipped with a target AI recognition and tracking camera and a high-volume warning chamber. A side-mounted protective cover is located on the right side of the gimbal, and a spectrum band jamming countermeasure device for UAVs is housed within the side-mounted protective cover. A smart tracking and early warning method for the above system is also disclosed, combining multiple devices such as the spectrum band jamming countermeasure device, the high-volume warning device, the detection camera, and the tracking camera. Based on visual intelligent recognition and tracking, it integrates multiple countermeasure devices with sound / light functions, exhibiting a high degree of intelligence, systematization, and integration. In the application field, it will effectively play a role in preventing, warning, and counteracting unauthorized UAV flights, effectively protecting social resources, property, and personal safety.
[0080] Small target detection accuracy is usually very low. This invention proposes an improved YOLOv8 algorithm, which aims to improve the detection accuracy and efficiency of small targets by addressing multiple dimensions such as feature extraction, network structure optimization, and data augmentation.
[0081] In terms of feature extraction, the improved YOLOv8 algorithm introduces a multi-scale feature fusion mechanism. By fusing feature maps of different levels and resolutions, it fully utilizes the rich detail information of shallow networks and the powerful semantic information of deep networks. For small targets, shallow networks can capture key details such as edges and textures, while deep networks help determine the target's category information. Simultaneously, an attention mechanism is employed to enhance the network's sensitivity to small target features, reducing background interference when processing complex backgrounds.
[0082] In terms of network structure optimization, targeted adjustments were made to the backbone and neck networks of YOLOv8. The backbone network adopts a lightweight design, reducing network parameters, computational load, and detection speed while maintaining feature extraction capabilities. The neck network introduces a path aggregation structure to enhance information flow between features of different scales, further improving the expressive power of small target features. In addition, the structure of the prediction head was optimized to enable more accurate localization of small targets and improve the accuracy of the detection boxes.
[0083] In the data augmentation stage, in addition to traditional data augmentation methods, a special data augmentation strategy was designed for the characteristics of small targets. By randomly cropping, scaling, and stitching images, the distribution of small targets in different scenarios is simulated, increasing the diversity of the data. Oversampling techniques for small target samples are introduced to balance the difference in the number of small target samples with large target samples, enabling the network to learn more features of small targets during training. Attached Figure Description
[0084] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure;
[0085] Figure 1 This is a schematic diagram of a low-altitude unmanned aerial vehicle (UAV) target early warning and countermeasure system provided in an embodiment of the present invention;
[0086] Figure 2 This is a flowchart of a tracking and early warning method for detecting and countering low-altitude unmanned aerial vehicle targets provided in an embodiment of the present invention;
[0087] In the diagram: 1. Circular visual detection and sensing chamber; 2. Warning loudspeaker; 3. Spectrum band interference countermeasure; 4. Tracking camera; 5. Target tracking and locking module; 6. Side-mounted protective cover. Detailed Implementation
[0088] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0089] Example 1, such as Figure 1 As shown, the low-altitude UAV target early warning and countermeasure system provided in this embodiment of the invention includes a mounting bracket and a gimbal;
[0090] The gimbal includes a fixed part and a movable part that can move 360° horizontally and 90° vertically relative to the fixed part.
[0091] The fixed part of the gimbal is detachably located on the bottom of the annular visual detection and sensing chamber 1; multiple low-light detection cameras are mounted around the annular visual detection and sensing chamber 1.
[0092] The gimbal's movable part is provided with a tracking component and at least one countermeasure component. The movable part can be one or more, and the tracking component and at least one countermeasure component can be located on the same movable part or on separate movable parts.
[0093] The tracking component and at least one of the countermeasure components move synchronously;
[0094] The countermeasures include one or more of the following: a loud warning alarm 2 and a spectrum band interference countermeasure 3;
[0095] The sound wave outlet of the warning loudspeaker 2 is aligned with the loudspeaker outlet, which has the characteristics of strong directionality, high energy concentration and long range of action. The power supply of the warning loudspeaker 2 is provided by an external power source through the conductive slip ring inside the pan-tilt unit, and the start interface of the warning loudspeaker 2 is controlled by the interface of the tracking camera 4.
[0096] The tracking component includes a tracking camera 4 and a target tracking and locking module 5; the tracking camera 4 is connected to the target tracking and locking module 5 via a signal line; the target tracking and locking module 5 is connected to the annular visual detection and sensing chamber 1 via a rotating axis.
[0097] The gimbal's movable part is equipped with a side-mounted shield 6 on its top. The spectrum band interference countermeasure 3 is located inside the side-mounted shield. The side-mounted shield 6 is designed with a non-metallic signal transmission area to ensure that the spectrum signal can counter the unauthorized drones.
[0098] Example 2, as Figure 2As shown, the tracking and early warning method for detecting and countering low-altitude unmanned aerial vehicle (UAV) targets involves methods for detecting, tracking, issuing warnings, and countering UAV targets within restricted areas, including:
[0099] S1, through the image encoding and processing module of the low-light detection camera, preprocesses the real-time video of the drone target acquired by the low-light detection camera and displays the video on a browser or operating platform;
[0100] S2 takes the pre-processed real-time video of the drone target and uses the improved YOLOv8 algorithm to detect the drone target. It tracks drone targets that exceed the set threshold. The tracking command is sent to the gimbal via serial port protocol. The gimbal drives the tracking camera and spectrum band interference countermeasure to rotate to the target area in real time and transmits the current position of the gimbal back in real time.
[0101] S3 tracks the camera and corrects the current position of the gimbal in real time. Based on the corrected position, it triggers a loud warning and performs radio interference and blocking on drones that cross the boundary.
[0102] Among them, the tracking camera 4 corrects the current position of the gimbal in real time to achieve the best tracking effect. The management personnel track the actual situation through the tracking camera 4 and manually trigger the auxiliary equipment to counterattack the drone that crosses the boundary. This system can be equipped with multiple detection cameras, and multiple low-light detection cameras can manage the gimbal.
[0103] For example, in step S2 above, the improved YOLOv8 algorithm, with its fast inference capabilities and efficient real-time detection characteristics, can accurately identify the category and location of targets within these candidate regions, thereby improving the overall detection accuracy. Depending on the specific application scenario, model training can be tailored to further improve the algorithm's recognition rate.
[0104] This invention is an intelligent system that integrates video acquisition, target detection, alarm, tracking, warning, and countermeasure functions. The system can effectively identify, alarm, track, and warn drones that enter the hazard warning area. When the warning is ineffective, a spectrum jammer can be activated for countermeasure. The system can improve the accuracy of drone tracking in restricted areas, reduce the workload of management personnel, and is suitable for unmanned places, energy key locations, and other scenarios.
[0105] For example, in step S2 above, the improved YOLOv8 algorithm includes:
[0106] S201, Feature Extraction; This involves capturing detailed and semantic information of small targets during the feature extraction process in the backbone network through a multi-scale feature fusion mechanism and the introduction of an attention mechanism; specifically including:
[0107] S2011, a multi-scale feature fusion mechanism;
[0108] In the improved YOLOv8 algorithm, the construction of the multi-scale feature fusion mechanism mainly relies on the combined use of Feature Pyramid Networks (FPN) and Path Aggregation Network (PAN).
[0109] During the feature extraction process of the backbone network, feature maps with different resolutions and semantic levels are generated. Taking the YOLOv8 backbone network as an example, it typically outputs feature maps at multiple scales, such as high-resolution shallow feature maps with small semantics (e.g., resolutions of 13×13 and 26×26), and low-resolution deep feature maps with high semantics (e.g., resolution of 52×52).
[0110] These feature maps are first fused from top to bottom using an FPN structure. The fusion operation after lateral connections employs an element-wise addition method, resulting in the feature maps fused by FPN. It can be represented as:
[0111]
[0112] In the formula, For deep feature maps, This is a shallow feature map. This is an upsampling operation;
[0113] This process allows semantic information from deep networks to be transferred to shallow networks, while preserving the rich details of the shallow networks. Next, bottom-up feature fusion is performed using a PAN structure. Let the feature map after FPN fusion be... The feature fusion operation in the bottom-up propagation process can also be obtained by similar element-wise addition to get the final fused feature map. :
[0114]
[0115] In the formula, This is another type of upsampling operation. This is a low-level feature map.
[0116] By using a PAN network, detailed information from shallow networks is further integrated into high-level feature maps, enhancing the information interaction between features at different scales. This allows the network to better handle the feature representation of small targets at different scales. Finally, the fused multi-scale feature maps are input into the detection head for target detection and localization, fully utilizing the advantages of different levels of feature maps to improve the detection capability for small targets.
[0117] S2012 introduced an attention mechanism;
[0118] To enhance the network's sensitivity to small target features, the improved YOLOv8 algorithm introduces a hybrid attention mechanism, including spatial attention and channel attention, based on multi-scale feature fusion.
[0119] Regarding the spatial attention mechanism, for the multi-scale fused feature map F, the feature importance at each location is first calculated. This is then achieved through average pooling. and max pooling The operation generates two different feature descriptors. and The expression is:
[0120]
[0121]
[0122] The two descriptors are concatenated and then passed through a convolutional layer. Dimensionality reduction is performed to obtain an attention weight map of the same size as the original feature map. The expression is:
[0123]
[0124] In the formula, For splicing operations, For example, activation functions (such as the Sigmoid function);
[0125] This attention weight map represents the importance of each location in the feature map, and is used in conjunction with the multi-scale fused feature map. Multiplication suppresses interference from the background region, i.e.: ; Feature maps for integrating importance factors;
[0126] Channel attention mechanisms focus on the importance of features from different channels. This applies to the feature maps after multi-scale fusion. Global average pooling is performed in the spatial dimension. and global max pooling This yields feature descriptions at two channel levels. and The expression is:
[0127]
[0128]
[0129] These two descriptions are processed separately using a multilayer perceptron (MLP). Let the operation of the MLP be represented as follows: Then add them together and pass them through the activation function. (e.g., ReLU function) to generate channel attention weight vectors The expression is:
[0130]
[0131] This vector represents the importance of each channel, and it is compared with the original feature map. Multiplying each channel enhances the discriminative features of small targets while weakening irrelevant channel information, i.e.:
[0132]
[0133] In the formula, This is a channel-based multiplication operation.
[0134] In this way, the network reduces background interference when processing complex backgrounds. Through the synergistic effect of multi-scale feature fusion and attention mechanisms, the improved YOLOv8 algorithm can more effectively capture detailed and semantic information of small targets during feature extraction, significantly improving the expressive power and detection accuracy of small target features.
[0135] S202, based on the captured detailed and semantic information of small targets, obtains localization information of the small target's location and category through lightweight design of the backbone network, improvement of the path aggregation structure of the neck network, and optimization of the prediction head structure; specifically including:
[0136] S2021, lightweight design of backbone network;
[0137] The backbone network adopts a lightweight design strategy based on depthwise separable convolution. Traditional convolution operations perform convolution operations on both channels and space simultaneously during feature extraction, resulting in a large number of parameters and computational cost. Depthwise separable convolution decomposes standard convolution into two steps: depthwise convolution and pointwise convolution.
[0138] Depthwise convolution performs convolution operations independently for each input channel, extracting features only in the spatial dimension. Its computational complexity is calculated as follows:
[0139]
[0140] In the formula, The kernel size is the convolution kernel size. Input the number of channels. The height of the input feature map, The width of the input feature map;
[0141] Pointwise convolution is used to adjust the number of channels. It performs a 1×1 convolution on the output of depthwise convolution, and its computational complexity formula is as follows:
[0142]
[0143] In the formula, Number of output channels;
[0144] In this way, depthwise separable convolution significantly reduces computation and the number of parameters compared to standard convolution. Simultaneously, the Ghost module is introduced to further optimize the backbone network. The Ghost module generates some basic feature maps through a small number of ordinary convolutions, and then generates the remaining feature maps through linear operations. This reduces the number of convolution operations while maintaining feature representation capabilities, further lowering model complexity.
[0145] Furthermore, an optimized version of the Cross-Stage Partial Connection (CSP) structure was adopted in the inter-layer connections of the backbone network. The traditional CSP structure divides the input feature map into two parts: one part undergoes normal convolution, and the other part is directly connected to subsequent layers, achieving feature reuse and efficient gradient propagation. The improved CSP structure adjusts the channel partitioning and fusion methods, enabling the network to extract multi-scale features better while reducing parameters, thus enhancing its ability to capture features of small targets.
[0146] S2022, Improved path aggregation structure of neck network;
[0147] The neck network employs an improved Path Aggregation Network (PAN) structure. The original PAN network enhances information flow between features at different scales through bottom-up and top-down feature fusion. In the improved YOLOv8, the fusion method and connection paths of the PAN network have been optimized.
[0148] An adaptive weight fusion mechanism is introduced during feature fusion. Let the input feature maps at different scales be... By learning adaptive weights This makes the fused feature map It can perform weighted fusion based on the contribution of different feature maps to the detection of small objects, as shown in the following formula:
[0149]
[0150] In the formula, This represents the total number of feature maps in the network. For indexing;
[0151] Weight The weights are calculated using convolutional layers and activation functions, ensuring that the sum of the weights is 1; skip connections and dense connections are added to the connection paths.
[0152] Meanwhile, skip connections and dense connections were added to the connection paths. Skip connections allow detailed information from shallower networks to be passed more directly to higher-level networks, avoiding information loss during feature fusion. Dense connections connect the output of each module with the input of all subsequent modules, further enhancing the interaction between features and enabling the network to fully utilize the complementary information of features at different scales, thus improving its ability to express small target features.
[0153] S2023, Prediction head structure optimization;
[0154] The prediction head employs a structure optimization strategy based on an attention mechanism. Building upon the original YOLOv8 prediction head, a multi-head attention (MHA) mechanism is introduced. This MHA mechanism can process features simultaneously from different representation subspaces, capturing richer relationships between features.
[0155] Suppose the feature map of the input fusion importance factor The query vector is obtained through linear transformation. Key vector Sum value vector The expression is:
[0156]
[0157]
[0158]
[0159] In the formula, All are learnable weight matrices.
[0160] The calculation process of the multi-head attention mechanism is as follows:
[0161]
[0162] In the formula, For multi-head attention functions, The splicing operator is used to connect each head together. These are learnable weights;
[0163] in,
[0164]
[0165]
[0166] In the formula, Let be the dimension of the key vector. To query the learnable weights of vector Q, Let K be the learnable weights of the key vector. For learnable weights of the value vector, Let be the attention function. Let be the normalized probability distribution function. For query vectors, The key vector is the transpose. For the first One calculation head.
[0167] In step S3, the tracking camera performs real-time correction of the current position of the pan-tilt unit, including:
[0168] S301. Obtain the target center point after target detection. Pixel coordinates;
[0169] S302. Calculate the target's offset from the center of the screen. ;
[0170] S303. Calculate the gimbal rotation angle based on the camera's field of view.
[0171] S304. Repeat the above steps to bring the target center point closer to the center point of the screen.
[0172] By employing a multi-head attention mechanism, the prediction head can focus more precisely, enhancing its ability to discriminate the location and category of small targets. Furthermore, the parameters of the prediction head's output layer were adjusted, using smaller convolutional kernels and fewer channels to reduce computational load and improve detection speed while maintaining detection accuracy. Simultaneously, the loss function was optimized, introducing a position loss weight adjustment mechanism specifically for small target detection. This allows the network to focus more on the localization accuracy of small targets during training, further improving the accuracy of the detection boxes.
[0173] S203 involves processing the acquired location and category information of small targets by randomly cropping, scaling, and stitching images, oversampling small target samples to generate synthetic samples, performing data augmentation, learning the feature distribution of UAV small targets, and generating realistic UAV small target images. Specifically, this includes:
[0174] S2031, randomly crop, scale, and stitch images;
[0175] Random cropping is a commonly used data augmentation technique. When dealing with small objects, it can simulate the distribution of small objects in different local regions. The specific steps are as follows:
[0176] Determine the cropping region: Randomly select a cropping region from the original image. To ensure that small targets are cropped, the size and position of the cropping region need to be adjusted according to the distribution of small targets. For example, a minimum cropping region can be set to ensure that the cropping region covers a certain proportion of the small targets. Let the width of the original image be W and the height be H, and the width of the cropping region be w and the height be h. Then w and h should satisfy certain conditions, such as... ,in It is a preset scaling factor, usually with a value between 0.2 and 0.5.
[0177] Image cropping: Based on the determined cropping area, the corresponding portion is cropped from the original image. Simultaneously, the annotation information of small targets needs to be updated to ensure that the position and size of the annotation boxes correspond to the cropped image. For example, if the coordinates of the top-left corner of the cropping area are... Then the original annotation box Need to be updated to And ensure that the annotation box is within the cropped image area.
[0178] Scaling can change the size of small objects in an image, simulating their appearance at different distances. The specific steps are as follows:
[0179] Determine scaling ratio: Randomly select a scaling ratio. The scaling factor is typically between 0.5 and 2.0. A scaling factor greater than 1 indicates that the image is enlarged, while a scaling factor less than 1 indicates that the image is reduced.
[0180] Image scaling: The cropped image is scaled using bilinear interpolation. Simultaneously, the annotation information for small targets is updated; the position and size of the annotation boxes need to be adjusted accordingly based on the scaling ratio. For example, the annotation boxes... The scaled coordinates are .
[0181] Image stitching; stitching together multiple cropped and scaled image fragments to simulate the distribution of small targets in different scenes. Specific steps are as follows:
[0182] Select image segments: Randomly select several image segments from multiple cropped and scaled images.
[0183] Determine the stitching method: Image segments can be stitched together using horizontal stitching, vertical stitching, or a combination of both. During the stitching process, pay attention to the boundary treatment between image segments to avoid obvious stitching marks.
[0184] Update annotation information: Based on the stitching method and the position of the image fragments, update the annotation information of the small targets to ensure that the position and size of the annotation boxes correspond to the stitched image.
[0185] S2032, small target sample oversampling technique;
[0186] The small target oversampling technique aims to balance the difference in the number of small target samples compared to large target samples, enabling the network to learn more features of small targets during training. The specific method is as follows:
[0187] Duplicate samples containing small targets. By repeatedly copying small target samples, the proportion of small targets in the training dataset can be increased. For example, if the proportion of small target samples in the original dataset is p, by copying the small target samples n times, the proportion of small target samples can be increased to p. .
[0188] S2033, Generate a synthetic sample;
[0189] Besides directly copying small target samples, the number of small targets can also be increased by generating synthetic samples. Specific methods include:
[0190] Image fusion: Small targets are cropped from the original image and then randomly pasted into other images to generate new samples. During the pasting process, the size, rotation angle, and lighting conditions of the small targets are adjusted to blend them with the background of the target image.
[0191] GAN Generation: Generative Adversarial Networks (GANs) are used to generate synthetic images containing small targets. By training the GAN model, it learns the feature distribution of small targets on drones and generates realistic images of small targets. Adding the generated synthetic images to the training dataset increases the diversity of small target samples.
[0192] This invention addresses the challenge of small target detection by proposing an improved YOLOv8 algorithm. It enhances feature extraction through multi-scale feature fusion and attention mechanisms, optimizes the backbone, neck, and prediction head network structures, and employs strategies such as random pruning and oversampling to enhance data. These improvements effectively increase the accuracy and efficiency of small target detection, and enhance the detection range and precision of the device.
[0193] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention and within the spirit and principles of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A tracking and early warning method for implementing low-altitude unmanned aerial vehicle target alert countermeasures, characterized in that, The method comprises: S1, preprocessing the real-time video of the unmanned aerial vehicle target acquired by the low-illumination detection camera through the image coding processing module of the low-illumination detection camera, and displaying the video picture on a browser or an operation platform; S2, detecting the real-time video of the unmanned aerial vehicle target after preprocessing through the improved YOLOv8 algorithm, tracking the unmanned aerial vehicle target exceeding the set threshold, and sending the tracking instruction to the holder through a serial port protocol, and the holder drives the tracking camera and the spectrum band interference countermeasure device to rotate to the target area in real time, and the current position of the holder is returned in real time; S3, the tracking camera corrects the current position of the holder in real time, triggers the strong sound alarm to warn, and performs radio interference and blockage on the out-of-bound unmanned aerial vehicle. 2.The tracking and early warning method for realizing low-altitude unmanned aerial vehicle target alert countermeasure according to claim 1, wherein In step S2, the improved YOLOv8 algorithm comprises: S201, feature extraction; through a multi-scale feature fusion mechanism and the introduction of an attention mechanism, the detailed information and semantic information of small targets in the process of extracting features by the backbone network are captured; wherein the small target is a target with a target pixel less than 32*32; S202, based on the captured detailed information and semantic information of the small target, the positioning information of the small target position and category is obtained by lightening the design of the backbone network, improving the path aggregation structure of the neck network, and optimizing the structure of the prediction head; S203, for the obtained positioning information of the small target position and category, the image is randomly cropped, scaled and spliced, the small target sample is oversampled, the synthetic sample is generated, the data is enhanced, the feature distribution of the small unmanned aerial vehicle target is learned, and a realistic small unmanned aerial vehicle target image is generated. 3.The method of claim 2, wherein, In step S201, the multi-scale feature fusion mechanism uses a feature pyramid network FPN and a path aggregation network PAN in combination; In the process of extracting features in the backbone network, feature maps of different resolutions and semantic levels are generated. First, feature fusion is performed from top to bottom through the FPN structure. After the horizontal connection, the fusion operation is performed by element-wise addition. The feature maps after FPN fusion are represented as: ; In the formula, is a deep feature map, is a shallow feature map, is an up-sampling operation; Then, the feature fusion is performed from bottom to top through the PAN structure, and the feature fusion operation in the transmission from bottom to top is performed by element-by-element addition to obtain the final fused feature map as : ; wherein is another up-sampling operation, is a low-level feature map.
4. The tracking and early warning method for achieving low-altitude unmanned aerial vehicle target alert countermeasures according to claim 3, characterized in that, In step S201, the introduction of the attention mechanism adopts a hybrid attention mechanism, including a spatial attention mechanism and a channel attention mechanism; The spatial attention mechanism comprises: calculating feature importance of each position on the multi-scale fused feature map , generating two different feature descriptors and respectively through average pooling and maximum pooling operations, and the expression is: ; ; Concatenate the two descriptors and pass through a convolutional layer Dimension reduction is performed to obtain an attention weight map with the same size as the original feature map The expression is: ; In the formula, is a concatenation operation, is an activation function; The attention weight map represents the importance of each position in the feature map, and the feature map after multi-scale fusion are multiplied, and the interference of the background region is suppressed, that is: ; is the feature map fused with the importance factor The channel attention mechanism comprises: performing global average pooling on the multi-scale fused feature map , in the spatial dimension , and global maximum pooling , to obtain two channel-level feature descriptions and , and the expression is: ; ; The two descriptions are processed by multi-layer perceptron (MLP) respectively, and the operation of the MLP is represented as , and then added and processed by an activation function to generate a channel attention weight vector , and the expression is: ; The channel attention weight vector represents the importance of each channel, which is multiplied with each channel of the original feature map , weakening the irrelevant channel information, and the expression is: ; In the formula, is a per-lane multiplication operation.
5. The tracking and early warning method for achieving low-altitude unmanned aerial vehicle target alert countermeasures according to claim 2, characterized in that, In step S202, the lightening design of the backbone network comprises: The backbone network adopts a lightening design strategy based on a depth separable convolution; the depth separable convolution decomposes a standard convolution into a depth convolution and a point-wise convolution; The depth convolution comprises: independently performing convolution operation on each input channel, only extracting features in the spatial dimension, and the calculation formula is: ; In the formula, is the size of the convolution kernel, is the number of input channels, is the height of the input feature map, is the width of the input feature map; The point-wise convolution is used to adjust the number of channels, and a 1*1 convolution is performed on the output of the depth convolution, and the calculation formula is: ; In the formula, is the number of output channels; In the interlayer connection of the backbone network, an optimized version of a cross-stage local connection CSP structure is adopted, the improved CSP structure is adjusted in the channel division and fusion mode, and multi-scale features are extracted. 6.The method for tracking and early warning of low-altitude unmanned aerial vehicle target alert countermeasures according to claim 5, characterized in that, In step S202, the path aggregation structure improvement of the neck network comprises: The neck network adopts an improved path aggregation network (PAN) structure, and an adaptive weight fusion mechanism is introduced in the feature fusion process. Different scale input feature maps are Through learning adaptive weights , the fused feature map is weighted and fused according to the contribution of different feature maps to small target detection, and the expression is as follows: ; wherein, is the total number of feature maps in the network, is the index; Weights The weights are calculated by convolutional layers and activation functions, ensuring that the sum of the weights is 1; on the connection path, add skip connections and dense connections.
7. The tracking and early warning method for achieving low-altitude unmanned aerial vehicle target alert countermeasures according to claim 6, characterized in that, In step S202, the structure optimization of the prediction head comprises: The prediction head adopts a structure optimization strategy based on an attention mechanism, introduces a multi-head attention mechanism MHA based on the original YOLOv8 prediction head; Set the input fusion importance factor feature map , get the query vector through linear transformation , key vector and value vector , the expression is: ; ; ; wherein are both learnable weight matrices.
8. The tracking and early warning method for achieving low-altitude unmanned aerial vehicle target alert countermeasures according to claim 7, characterized in that, The calculation process of the multi-head attention mechanism is as follows: ; wherein is a multi-head attention function, is a concatenation operator that concatenates each head, is a learnable weight; Wherein, ; ; In the formula, Let be the dimension of the key vector. To query the learnable weights of vector Q, Let K be the learnable weights of the key vector. For learnable weights of the value vector, Let be the attention function. Let be the normalized probability distribution function. For query vectors, The key vector is the transpose. For the first One calculation head. 9.The method of claim 1, wherein, In step S3, the tracking camera corrects the current position of the holder in real time, comprising: S301、detecting the target to obtain a target center point Pixel coordinates S302、Calculate the target offset from the picture center point ; S303、According to the camera field of view angle, calculate the gimbal rotation angle ; S304, repeat the above steps, let the target center point approach the picture center point.
10. A low-altitude unmanned aerial vehicle target warning countermeasure system, characterized in that, The system is applied to the tracking and early warning method for realizing low-altitude unmanned aerial vehicle target warning countermeasure according to any one of claims 1-9, and the system comprises a mounting bracket and a holder; The holder comprises a fixed part and a movable part which moves laterally by 360 degrees and vertically by 90 degrees relative to the fixed part; The fixed part of the holder is detachably arranged on a ring-shaped visual detection sensing bin (1) at the bottom; a plurality of low-illumination detection cameras are carried around the ring-shaped visual detection sensing bin (1); The movable part of the holder is provided with a tracking assembly and at least one countermeasure assembly, the movable part is one or more, and the tracking assembly and the at least one countermeasure assembly are arranged on the same movable part or on one movable part respectively; The tracking assembly and the at least one countermeasure assembly move synchronously; the countermeasure assembly comprises one or more of a warning loud sound alarm (2) and a spectrum band interference countermeasure device (3); The starting interface of the warning loud sound alarm (2) is controlled by the interface of a tracking camera (4); The tracking assembly comprises the tracking camera (4) and a target tracking locking module (5); the target tracking locking module (5) is connected with the ring-shaped visual detection sensing bin (1) through a rotating shaft; A side loading shield (6) is arranged at the right side of the movable part of the holder, and the spectrum band interference countermeasure device (3) is arranged in the side loading shield (6).