A dynamic self-adaptive feature-aware trusted low-slow-small uav detection method
By improving the YOLOv8s model and dynamic adaptive feature perception module, and combining it with a reliable classifier, the problem of insufficient detection accuracy of low-speed and small UAVs was solved, and high-precision and high-reliability target recognition was achieved in complex environments.
Patent Information
- Application Number
- CN202311711078.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-12-13
AI Technical Summary
Existing technologies are insufficient for effectively detecting low-speed, small unmanned aerial vehicles (UAVs), especially in complex environments where the detection accuracy and reliability for small targets are inadequate. Traditional methods are limited by small reflective area, low echo signal-to-noise ratio, Doppler effect, and complex background interference.
An improved YOLOv8s target detection model is adopted, adding a small target detection module. It combines a dynamic adaptive feature perception module and a reliable classifier, and uses DMSFP, AFFM and AACFP to suppress background noise and improve the small target detection capability. Dirichlet distribution is also introduced to model uncertainty prediction.
It improves the accuracy and reliability of detecting low-speed, small UAVs, enabling accurate identification of extremely small targets in complex environments and providing uncertainty prediction to enhance the credibility of classification results.
Smart Images

Figure CN117635904B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target detection technology, specifically, it relates to a reliable low-speed small unmanned aerial vehicle (UAV) detection method based on dynamic adaptive feature perception. Background Technology
[0002] Currently, the main detection technologies used for detecting low-altitude, slow-speed, and small unmanned aerial vehicles (UAVs) revolve around four technologies: radar detection, radio frequency detection, acoustic detection, and photoelectric detection. "Low-altitude, slow-speed, and small" targets mainly refer to targets that fly at low altitudes, fly slowly, and have small radar cross-sections.
[0003] Radar detection is a widely used method. UAVs detect radar signals and receive reflections to measure direction and distance (position). It has mature technology for detecting large targets flying at high speeds. However, for small, slow-moving targets, the small reflective area, low echo signal-to-noise ratio, and high clutter in the low-altitude field greatly increase the difficulty of radar detection, making it difficult for traditional radar to detect them.
[0004] Radio frequency (RF) detection uses RF receivers in the corresponding frequency band to extract RF information and characteristics from the communication or image transmission signals between the drone and the remote controller or ground station to detect specific drones. RF detection has a long range, but it is limited by the types of drone communication protocols, has inconsistent technical standards, poor universality, high equipment cost, and is susceptible to interference from other RF signals. Acoustic detection uses ultrasonic waves (above 20,000 Hz), which are inaudible to the human ear, as a detection source. Devices using this method are called ultrasonic detectors and are generally used to detect moving objects.
[0005] The working principle of an ultrasonic detector is to use ultrasonic waves to measure the distance by measuring the time difference between the reflection and echo received by the object being measured. It is a non-contact measuring instrument, but it cannot handle the Doppler effect well and is relatively expensive.
[0006] Optoelectronic detection technologies mainly include laser detection, infrared detection, and visible light detection. Image information is acquired through imaging technology and compared for identification to achieve target detection. Laser detection, similar in principle to radar detection, detects targets by analyzing echo pulses; however, it is susceptible to obstruction and complex environments, and cannot work in the dark. Infrared detection uses infrared thermal imaging sensors to receive thermal radiation emitted by the drone and generate visual images, enabling it to work in the dark, but thermal imaging lacks texture features, making identification difficult. Visible light detection technologies include classic moving target detection, traditional target detection, and deep learning-based target detection. Moving target detection algorithms mainly include optical flow, inter-frame difference, background subtraction, and fusion algorithms of these methods. However, due to the complex background environment of drones, and the numerous factors affecting them such as lighting changes and foliage obstruction, these methods are no longer suitable. Traditional methods rely on manual features based on prior knowledge and experience, which is difficult and slow. Therefore, they may be unsuitable in terms of speed and accuracy.
[0007] Patent document CN116503762A provides a lightweight UAV detection method for embedded devices. The proposed feature fusion method combines shallow and high-level features, which does improve the detection accuracy of small targets. However, it lacks a specific accuracy detection strategy for small targets, thus limiting its detection accuracy for small targets.
[0008] Patent document CN117037004A discloses a UAV image detection method based on multi-scale feature fusion and context enhancement. It improves multi-scale skip connections in the neck network, enabling feature fusion at different levels while eliminating redundant information. A context enhancement module (CAM) is introduced in the neck network to acquire different receptive fields through dilated convolutions with different dilation coefficients. The context information surrounding the target within these receptive fields is used to enhance the target's feature representation, thereby improving the detector's target recognition ability. However, after acquiring multi-scale context information, CAM does not denoise this feature information, easily causing small targets to blend into the background noise, making them difficult to detect. Therefore, there is an urgent need to find an ideal technical solution to address the current problems in UAV detection. Summary of the Invention
[0009] The purpose of this invention is to address the shortcomings of existing technologies by providing a reliable, low-speed, and small UAV detection method based on dynamic adaptive feature perception, which can improve the detection accuracy and reliability of UAV targets.
[0010] To achieve the above objectives, this invention provides a dynamically adaptive feature-aware, reliable low-speed small unmanned aerial vehicle (UAV) detection method, such as... Figure 1 As shown, the method includes the following steps:
[0011] Step S1: Obtain images containing drone targets and images containing bird targets to construct a sample set, and divide the sample set into a training set, a validation set, and a test set; annotate the image samples in the training set to generate sample labels containing category information and location information; perform size adjustment and data augmentation preprocessing on the image samples in the training set, and perform size adjustment preprocessing on the image samples in the validation set and the test set; size adjustment is to avoid image distortion problems, and data augmentation operations can not only enrich the training samples, but also improve the network training speed;
[0012] Step S2: Construct an improved YOLOv8s object detection model. This improved model includes an input module, a backbone module, a neck module, and a head module. Compared to the original YOLOv8s object detection model, the improved model adds a minimal object detection module to the neck layer. This minimal object detection module is connected to the output features of the P2 layer of the backbone. The minimal object detection module includes one upsampling unit, one downsampling unit, one feature concatenation unit, one composite convolutional unit (C2 unit), one dynamic adaptive feature perception module, and one detection head. The features from the P3 layer of the neck module are then processed... The features output by the composite convolutional unit of layer P3 are used as input to the upsampling unit. The features output by the upsampling unit are then concatenated with the features of layer P2 by the feature concatenation unit. The concatenated result is input to the C2 unit for processing. The processed features have two uses. First, they are used as input to the downsampling unit. After processing by the downsampling unit, they are provided to layer P3 of the neck and then used by layers P4 and P5 to supplement the details of higher-level features, which helps in detecting very small targets. Second, they are used as input to the dynamic adaptive perception module. After processing by the dynamic adaptive feature perception module, its output is used as input to the detection head. Finally, the detection head processes the data to obtain the detection result.
[0013] To suppress background noise and further improve the detection capability of small targets, a dynamic adaptive feature perception module is embedded in the extremely small target detection module. This module consists of a Dynamic Multi-scale Spatial Feature Perceptron (DMSFP), an Adaptive Feature Fusion Module (AFFM), and an Adaptive Attention Channel Feature Perceptron. The Perceptron (AACFP) consists of three parts. The features processed by the C2 unit are used as input to the dynamic adaptive perception module. First, multi-scale features are obtained through DMSFP processing. These multi-scale features are then fused using AFFM to obtain fused multi-scale contextual information. The AACFP generates attention weights based on this multi-scale contextual information. It should be noted that DMSFP utilizes three max-pooling layers with different kernel sizes to obtain multi-scale contextual information, enhancing feature representation and acquiring rich spatial information about small targets. After obtaining multi-scale features through pooling layers, further feature extraction is needed. To mitigate the locality bias of the convolution mechanism, dynamic convolution is used for scale and spatial awareness. The AFFM fuses the multi-scale features. Having obtained scale and spatial awareness features through DMSFP, adaptive feature fusion is used to fuse the output multi-scale features to fully utilize the correlation between different scales. The AACFP introduces adaptive channel attention to enhance feature representation, and its output is the output of the dynamic adaptive feature perception module. After obtaining the fused multi-scale contextual information through AFFM, richer information about small targets is obtained. However, since the background in shallow features is complex and easily confused with small targets, AACFP generates attention weights under the guidance of multi-scale information. It suppresses useless information through the attention mechanism, weakens the complex background features, and makes the small target features more prominent, thereby effectively improving the model's attention to small targets.
[0014] To address the issue of birds being mistaken for drones, the classifier in the head module is replaced with a reliable classifier. This reliable classifier introduces subjective logic (SL) and Dirichlet distribution to model the uncertainty distribution, and introduces a new loss function to learn the parameters of the Dirichlet distribution. Ultimately, the classifier can not only output the classification result, but also provide the reliability of the classification result.
[0015] S3. Construct a GPU training environment, set training parameters, and load the data configuration file and model configuration file; input the preprocessed training set and validation set into the improved YOLOv8s target detection model for training and validation, and obtain the trained UAV target detection model.
[0016] S4, input the test set image or other images to be identified into the above-trained UAV target detection model for detection, and output the detection result with classification uncertainty.
[0017] Preferably, in step S1, the specific operation of the size adjustment is as follows: an adaptive image scaling mechanism is used to adjust the image size, and when the length and width of the image are scaled proportionally, the remaining part is filled with gray.
[0018] Preferably, in step S1, in order to avoid overfitting due to low data volume, online data augmentation is performed on all image samples in the training set. The prior data augmentation includes six processing steps: mix_up, mosaic, color transformation, scaling, shifting, and flipping. The order of these six processing steps is adjustable.
[0019] Preferably, in step S2, the step of obtaining multi-scale features through DMSFP processing includes: obtaining multi-scale contextual information using three max-pooling layers with different kernel sizes, and then using dynamic convolution DyConv for scale and spatial awareness. This module takes feature F as input. input ∈R C*H*W Output The calculation formula is as follows:
[0020]
[0021] Unlike ordinary pooling layers, this pooling layer incorporates padding to ensure that the input and output feature maps are of the same size. The padding size dynamically changes with the pooling kernel size, as shown in the following formula:
[0022]
[0023] Where kernel_size represents the kernel size, stride represents the convolution stride, and padding represents the feature map padding width;
[0024] The MaxPool2d calculation formula is as follows, with the pooling kernel size k selected as (1, 3, 5).
[0025]
[0026]
[0027] Among them, H in W in H represents the height and width of the input feature map, respectively. out W out These represent the height and width of the output feature map, respectively. The input and output height and width remain unchanged, while the kernel_size and padding are determined by the input k. After obtaining multi-scale features through the pooling layer, further feature extraction is needed. To alleviate the locality bias of the convolution mechanism, a dynamic convolution DyConv is added, as shown in the following formula:
[0028]
[0029]
[0030]
[0031] in and These are the weight matrix and bias vector, where g is the ReLU activation function, and π is the weight matrix and bias vector. m It is the m-th linear function The weights are M, a hyperparameter representing the number of linear functions selected, x represents the input feature, and y represents the output feature. Dynamic convolution is composed of multiple convolutional kernels with different weights. By dynamically selecting important features through dynamic convolution, rich spatial information about small targets can be obtained.
[0032] Preferably, in step S2, the step of obtaining the fused multi-scale context information after fusing the multi-scale features through AFFM includes: AFFM fully utilizes the information at each scale and uses adaptive feature fusion to fuse the multi-scale features output by DMSFP, the calculation process of which is as follows:
[0033]
[0034] α k +β k +γ k =1
[0035]
[0036]
[0037] Where k = 1, 3, 5 represent the indices of the features after passing through a pooling kernel of size k. Learned from a 1x1 convolution function, This represents the k-th output feature of AFFM. This represents the k-th input feature. After fusion, multi-scale features are fully utilized, making small target features more prominent. This module's input features... Output C represents the number of channels, and H and W represent the image height and width, respectively.
[0038] Preferably, in step S2, the step of AACFP generating attention weights based on the multi-scale context information includes: AACFP introducing adaptive channel attention, firstly by using the multi-scale context information obtained from AFFM after feature fusion. Channel compression is performed using Global Average Pooling (GAP) and Max Average Pooling (MAP) respectively. The results are then fused and fed into Adaptive Convolution (AC). A sigmoid function is added to the output to obtain attention weights. Finally, the attention weights are multiplied by the multi-scale contextual information after feature fusion for channel feature perception, as shown in the following equation:
[0039]
[0040] Where AC is an adaptive 1d convolution with kernel size K, where σ represents the sigmoid function, whose output is the attention score of the input vector. This represents the product of corresponding elements of two matrices. AACFP enhances feature representation along the channel dimension, obtaining more fine-grained features, weakening complex background noise, suppressing useless information, and strengthening target features, thereby greatly improving the detection capability of small targets. This module takes input features... Output Finally, we concatenate the output multi-scale features and then perform a 3x3 convolution to obtain the final result. The calculation process is as follows:
[0041]
[0042] Preferably, in step S2, the classifier of the improved YOLOv8s object detection model is a reliable classifier. The reliable classifier adds an uncertainty prediction value to the deterministic classification result output by the original YOLOv8s object detection model. The reliable classifier introduces subjective logic (SL) and a Dirichlet distribution to complete the uncertainty distribution modeling. Dempster-Shafer evidence theory (DST) is a generalization of Bayesian theory to subjective probability. It assigns trust quality to a subset of discrete frames, where the subset contains class labels. When the trust quality is low, the output can be represented as "I don't know". SL formalizes the concept of trust assignment in the discriminative frame of DST as a Dirichlet distribution. Therefore, SL allows the use of the principles of evidence theory to quantify trust quality b and uncertainty u through a well-defined theoretical framework. Trust quality assignment, i.e., subjective opinion, corresponds to a Dirichlet distribution with parameter α = e+1. By placing the Dirichlet distribution on the class probabilities, the predictions of the improved YOLOv8s object detection model are treated as subjective opinions. The network parameters of this model are learned from all training data. This model is used to collect evidence that leads to subjective opinions. For example, if the target is a bird, more evidence is generated for the prediction branch of birds. The evidence output by the network is e = [e1, e2, ..., e]. k By parameterizing, the Dirichlet distribution parameters α = [α1, α2, ..., α] can be obtained. k ]:α k =e k +1;
[0043] Then, using SL modeling on the Dirichlet distribution, the uncertainty M = [b1, b2, ..., b k [,u], as follows:
[0044]
[0045] and
[0046]
[0047] Among them, e k This indicates that the predicted result is evidence of class k, S is the Dirichlet strength, K represents the number of classes, and b k Let represent the trust quality of the k-th class, and u represent the uncertainty of the classification result, with a value of (0, 1). The smaller the uncertainty value, the more reliable the result.
[0048] Furthermore, based on the aforementioned reliable classifier, a new classification loss function is introduced to learn the Dirichlet distribution parameters using the input samples.
[0049]
[0050] Where i represents the i-th training sample, N represents the total number of training samples, and Θ represents the network parameters. Evidence used to learn the correct category Used to punish erroneous evidence, thereby reducing evidence of incorrect categories, λ t =min(1.0,t / 10)∈[0,1] is the annealing coefficient, and t represents the current training epoch. It is the adjustment parameter of the Dirichlet distribution, which can avoid penalizing evidence of the correct class as 0. This is used to address the vanishing gradient problem for the correct class with zero evidence, because when the output evidence for the correct class is zero, the gradient will vanish, which will prevent the parameters from being updated.
[0051] Preferably, the network parameters are initialized, including convolutional kernel weights and their bias weights, to train the network model. All hyperparameters of the model are then adjusted to obtain the final trained model. These hyperparameters include: hyperparameter M, the number of training epochs, the learning rate, and the bath size. Hyperparameter M is set to a fixed value of 4, and other hyperparameters are adjusted by increasing or decreasing based on experimental results. Mosaic enhancement is enabled, and the number of training epochs is set to 500. Transfer learning is used for training. In the first 100 epochs, the backbone network is frozen, the learning rate is set to 0.01, and a pre-trained model is loaded with a bath size of 16. Mosaic enhancement is disabled in the last 10 epochs, and the learning rate is reduced to 0.94 after each epoch. After 500 epochs of training, the final trained model is obtained.
[0052] The present invention provides a dynamic adaptive feature-aware reliable low-speed small UAV detection model, which is a new model for target detection of low-speed small UAVs obtained by improving the original YOLOv8s target detection model and then training it. It has at least the following technical effects:
[0053] This invention provides a dynamic adaptive feature-aware, reliable low-speed small UAV detection method. A tiny target detection module is added after the backbone P2 layer output to obtain more texture and contour information. The P2 layer is the result of upsampling / downsampling the original image by a factor of 4. While the P2 layer has rich detail information, it lacks high-level semantic information. Therefore, high-level features are upsampled and concatenated with the P2 layer features to supplement semantic information. Simultaneously, the P2 layer features are downsampled to supplement high-level features with detail information. After feature fusion and enhancement via the neck, the output of the P2 layer is fed into a newly added head, which is used to predict tiny targets present in the image. Finally, feature maps at four scales are used to predict the bounding boxes of objects. The four-branch structure can mitigate the negative impact caused by drastic changes in object scale, which helps in detecting small targets. However, after the above processing, the background noise of shallow features increases, affecting the accuracy of the detection results. Therefore, a dynamic adaptive feature perception module is also inserted into the extremely small target detection module to suppress background noise and improve the attention to extremely small targets. The dynamic adaptive feature perception module includes a dynamic multi-scale spatial feature perceptron, an adaptive feature fusion module, and an adaptive attention channel feature perceptron. The DMSFP uses three max pooling layers with different kernel sizes to obtain multi-scale contextual information, enhance feature representation capabilities, and obtain rich spatial information of small targets. After obtaining multi-scale features through the pooling layers, further feature extraction is needed. To mitigate the locality bias of the convolution mechanism, dynamic convolution is used for scale and spatial perception. The AFFM fuses multi-scale features. The multi-scale features obtained through DMSFP after scale and spatial perception are used. To fully utilize the correlation between different scales, adaptive feature fusion is used to fuse the output multi-scale features. The AACFP introduces adaptive channel attention-enhanced feature representation. After obtaining multi-scale contextual information through AFFM, it yields richer information about small targets. However, due to the complexity of the background in shallow features, which can easily be confused with small targets, AACFP generates attention weights under the guidance of multi-scale information. It suppresses useless information through the attention mechanism, weakens the complex background features, and makes the small target features more prominent, thereby effectively improving the model's attention to small targets.
[0054] As a preferred implementation of the dynamic adaptive feature-aware reliable low-speed small UAV detection method of this application, a reliable classifier is adopted. The reliable classifier adds an uncertainty prediction value to the deterministic classification result output by the original YOLOv8s. In YOLOv8s, the detection head uses the sigmoid function to obtain the classification result, and its value range is (0,1). The result of using the sigmoid function cannot provide reliable uncertainty. The reliable classifier replaces the sigmoid function used by the classification head with the Exp function and introduces subjective logic (SL) and Dirichlet distribution to model the uncertainty. The output result of the Exp function is greater than 0, which is represented as evidence e. In addition, a new classification loss function is introduced, which can not only increase the evidence of the correct category, but also suppress the evidence of the wrong category. It also solves the problem that when the evidence is 0 or close to 0, the correct category with 0 evidence cannot be learned due to gradient vanishing. The improved network processing outputs classification results with uncertainty, which provides more accurate predictions and explains "how confident is the classification result?" and "why is the confidence of the classification result so high / low?". This improves the reliability, robustness, and accuracy of classification in target detection in complex environments, thus enabling better identification of UAV targets. Attached Figure Description
[0055] Figure 1 The flowchart shows the reliable low-speed small UAV detection method based on dynamic adaptive feature perception of the present invention.
[0056] Figure 2 This is a schematic diagram of the structure of the dynamic adaptive feature perception reliable low-speed small UAV detection model of the present invention.
[0057] Figure 3 This is a schematic diagram of the overall structure of the dynamic adaptive feature fusion module of the present invention;
[0058] Figure 4 A schematic diagram of the Dynamic Multi-Scale Spatial Feature Perceptron (DMSFP) processing unit;
[0059] Figure 5 This is a schematic diagram of the AFFM (Adaptive Feature Fusion) module processing unit.
[0060] Figure 6 A schematic diagram of the Adaptive Attention Channel Feature Perceptron (AACFP) processing unit;
[0061] Figure 7 This is a schematic diagram of the reliable classifier structure of the present invention;
[0062] Figure 8 Example 1 is an example of detection using the dynamic adaptive feature perception reliable low-speed small UAV detection method provided by the present invention;
[0063] Figure 9 Example 2 is an example of detection using the reliable low-speed small UAV detection method with dynamic adaptive feature perception provided by the present invention;
[0064] Figure 10 Example 3 is an example of a reliable low-speed small UAV detection method using dynamic adaptive feature perception provided by the present invention. Detailed Implementation
[0065] The technical solution of the present invention will be clearly and completely described below through specific embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0066] In practical implementation, an image sample set of drones and birds is acquired and divided into training, validation, and test sets. This includes: First, the sample set is divided into training, validation, and test sets. Then, the LabelImg annotation tool is used to annotate all images in the sample set, generating label files containing category and location information. Second, the image samples in the training set are preprocessed, including: resizing and data augmentation preprocessing. Third, the image samples in the validation and test sets are resized using an adaptive image scaling mechanism. When scaling the length and width of the image proportionally, the remaining portion is filled with gray to avoid image distortion during resizing. Fourth, online data augmentation is used. The purpose of online data augmentation is to avoid overfitting due to low data volume. It augments all training data, including mix-up, mosaic, color transformation, scaling, shifting, and flipping. Data augmentation not only enriches the training samples but also improves the network training speed.
[0067] In practical implementation, the target detection model YOLOv8s is improved to construct a reliable low-speed small UAV detection model with dynamic adaptive feature perception, such as... Figure 2As shown, similar to the original YOLOv8s network, the dynamic adaptive feature-aware reliable low-speed small drone detection model also includes an input end, backbone, neck, and head. The backbone is responsible for extracting features from the input image; the neck is responsible for fusing the features extracted by the backbone, making full use of deep semantic information (some information about the overall graph) and shallow detail information (color, texture, edges, corners, etc.); the head is responsible for predicting the fused features, comparing the prediction results with the actual results (the previously labeled label file), and gradually approximating the actual results through gradient descent.
[0068] Specifically, such as Figure 2 As shown, the original YOLOv8 network structure is as follows: the backbone includes a 3*3 Conv module, four 3*3 Conv and C2f modules (an improvement on C3 in YOLOv5), and an SPPF module. The Conv module contains standard convolution, normalization, and SiLu activation operations. The four 3*3 Conv and C2f modules are used to downsample the input image, corresponding to layers P2, P3, P4, and P5, respectively. The SPPF structure is used to convert feature maps of arbitrary size into feature vectors of fixed size. The neck uses a PANet structure, including two upsampling units and two downsampling units. Each upsampling unit includes a 1*1 Conv module, an upsampling module, a Concat module, and a C2f module; each downsampling unit includes a 3*3 Conv module, a Concat module, and a C2f module. The PANet structure, based on the top-down feature fusion of the FPN structure, combines a bottom-up feature fusion method to fully acquire target feature information. YOLOv8s introduces a similar feature pyramid network concept, using feature maps of three different scales for multi-scale prediction. That is, the outputs of layers P3, P4, and P5 of the backbone are fed into the neck layer to obtain multi-scale features, making full use of and fusing features from different receptive fields.
[0069] However, drones are quite small against the sky background, and extremely small targets may lose target information due to downsampling. Therefore, to obtain more texture and contour information, compared with the original YOLOv8s network, this invention adds an extremely small target detection module to the P2 layer in specific implementations. Specifically, this module includes one upsampling unit, one downsampling unit, one feature concatenation unit, one composite convolutional unit (i.e., the C2 structure of the YOLOv8s model), one dynamic adaptive feature perception module, and one detection head, as shown below. Figure 2As shown in the dashed box, the features output from the composite convolutional unit in layer P3 of the neck module are used as the input to the upsampling unit. The features output after upsampling are then concatenated with the features from layer P2 using a feature concatenation unit. Layer P2 is the result of upsampling and downsampling the original image by a factor of 4. Layer P2 has rich detail information but lacks high-level semantic information. Therefore, the features from P3 are upsampled and concatenated with the features from layer P2 to supplement the semantic information of layer P2. The concatenated result is then input to the composite convolutional unit for processing. The output features have two uses: first, they are used as the input to the downsampling unit, which processes them and provides them to layer P3 of the neck module, and then to layers P4 and P5, thus supplementing the high-level features with detailed information, which helps in detecting very small targets; second, they are used as the input to the dynamic adaptive perception module. After processing by the dynamic adaptive feature perception module, its output is used as the input to the detection head, which finally processes the results to obtain the detection result.
[0070] A dynamic adaptive feature fusion module is introduced into the minimal target detection module. After passing through the minimal target detection module, the features of minimal targets are retained. However, due to the large amount of background noise in the shallow features, the detection results may be affected. Therefore, the features are sent to the dynamic adaptive feature perception module to suppress background noise and improve the focus on minimal targets.
[0071] Specifically, in the embodiment, the Dynamic Adaptive Feature Perception Module (DAFPM) consists of three parts: a Dynamic Multi-scale Spatial Feature Perceptron (DMSFP), an Adaptive Feature Fusion Module (AFFM), and an Adaptive Attention Channel Feature Perceptron (AACFP). Figure 3 As shown.
[0072] like Figure 4The DMSFP first utilizes three max-pooling layers with different kernel sizes to obtain multi-scale contextual information. Max pooling is a commonly used pooling operation in Convolutional Neural Networks (CNNs). Pooling is a technique used to reduce the spatial size of images or feature maps while retaining the most important information. Max pooling is a form of pooling operation whose main goal is to select the maximum value within each pooling window as the output, thereby achieving spatial dimensionality reduction of the feature map. After obtaining multi-scale features through pooling layers, further feature extraction is needed. To alleviate the locality bias of the convolution mechanism, dynamic convolution (DyConv) is used for scale and spatial awareness. Dynamic convolution is a high-level operation in convolutional neural networks, designed to introduce stronger contextual information and spatiotemporal relationships to better understand dynamic changes in data. Traditional convolution operations extract local features based on fixed-size convolution kernels, which may lead to incomplete information capture in some cases. Dynamic convolution, on the other hand, uses variable-size convolution kernels to adapt to features at different scales and can adjust according to dynamic changes in the data. This allows the model to better capture spatial variations in the data, thereby improving the model's representational power and capturing small target features to a greater extent.
[0073] Based on the above principles, this example designs the DMSFP, but unlike ordinary pooling layers, this pooling layer incorporates padding. The padding size dynamically changes with the pooling kernel size, and the calculation formula is as follows.
[0074]
[0075]
[0076] The MaxPool2d calculation formula is as follows, with the pooling kernel size k selected as (1, 3, 5).
[0077]
[0078]
[0079] Among them, H in W in H represents the height and width of the input feature map, respectively. out W out These represent the height and width of the output feature map, respectively. The input and output height and width remain unchanged, while the kernel size and padding size are determined by the user-provided k.
[0080] The calculation of DyConv is as follows:
[0081]
[0082]
[0083]
[0084] in and These are the weight matrix and bias vector, where g is the ReLU activation function, and π is the weight matrix and bias vector. m It is the m-th linear function The weights are M, a hyperparameter representing the number of linear functions selected, x represents the input feature, and y represents the output feature. Dynamic convolution is composed of multiple convolutional kernels with different weights. Through dynamic convolution, important features are dynamically selected to obtain rich spatial information about small objects. This module takes input feature F as its input feature. input ∈R C*H*W Output
[0085] like Figure 5 The AFFM method fuses multi-scale features. Through DMSFP, we obtained scale- and space-aware multi-scale features. To fully utilize the correlations between different scales, adaptive feature fusion is used to fuse the output multi-scale features. Adaptive feature fusion is a commonly used technique in computer vision, deep learning, and signal processing to combine different features or information sources to improve model performance or solve specific tasks. This fusion can automatically adjust according to the needs of the task to optimize performance. The main idea of adaptive feature fusion is to use algorithms to automatically select, combine, or weight features from different sources to obtain optimal results under different conditions. This fusion typically includes the following steps:
[0086] S501, Feature Extraction: First, features are extracted from different information sources or data.
[0087] S502, Feature Selection: In adaptive feature fusion, the features that need to be fused are selected instead of using all extracted features.
[0088] S503, Feature Weight Allocation: For the selected features, the algorithm will automatically assign weights to determine their relative importance in the final fusion result.
[0089] S504, Feature Fusion: This involves fusing selected features with their assigned weights to generate a final feature vector or representation. This can be a simple operation such as weighted summation, convolution, or pooling, or a more complex operation such as hierarchical fusion in convolutional neural networks.
[0090] S505, Adaptive Adjustment: Based on the performance feedback of the task, the adaptive feature fusion algorithm can adjust feature selection and weight allocation to continuously optimize the model's performance.
[0091] The advantage of adaptive feature fusion is that it can be dynamically adjusted according to the characteristics of different data, thereby improving the robustness and generalization ability of the model and enriching the features of small targets.
[0092] Based on the above principles, this embodiment designs the AFFM, and its calculation process is as follows:
[0093]
[0094] α k +β k +γ k =1
[0095]
[0096]
[0097] Where k = 1, 3, 5 represent the indices of the features after passing through a pooling kernel of size k. Learned from a 1x1 convolution function, This represents the k-th output feature of AFFM. This represents the k-th input feature. After fusion, multi-scale features are fully utilized, making small target features stand out better. This module's input features... Output
[0098] like Figure 6 The AACFP introduces adaptive channel attention to enhance feature representations. After obtaining multi-scale contextual information through AFFM, richer information about small targets is obtained. However, due to the complexity of the background in shallow features, they are easily confused with small targets. AACFP generates attention weights under the guidance of multi-scale information, suppressing useless information through the attention mechanism, weakening complex background features, and making small target features more prominent, thereby effectively improving the model's attention to small targets. The attention mechanism adopts channel attention, which is used to enhance the information interaction between different channels (feature channels) in deep neural networks, thereby improving model performance. Channel attention is mainly applied to image processing tasks, such as image classification and object detection, to help the model better understand and utilize the correlation between feature channels. The core idea of channel attention is to dynamically learn the weight of each channel to adjust the contribution of different channels, so that important channels are enhanced and unimportant channels are suppressed. This is achieved through the following steps:
[0099] S601, Feature Extraction: First, features are extracted from the input data through operations such as convolutional layers to obtain a three-dimensional feature tensor, represented as (C,H,W), where C represents the number of channels, and H and W represent the height and width.
[0100] S602, Channel Attention Weight Learning: Channel attention learns the weights for each channel by introducing an additional operational layer. These weights are computed using global average pooling and max-average pooling methods, and then passed through 1d convolutions with an adaptive kernel size to generate the channel attention weights. The generation process of these weights is trainable, so the model can automatically learn which channels are more important for a specific task.
[0101] S603, Applying Channel Attention: The learned channel attention weights are multiplied by the original feature tensor, thereby strengthening or suppressing the response of each channel. In this way, the model is able to better capture key information and ignore irrelevant information.
[0102] Based on the above principles, this embodiment designs the AACFP, which first obtains multi-scale contextual information from AFFM after feature fusion. Channel compression is performed using Global Average Pooling (GAP) and Max Average Pooling (MAP) respectively. The results are then fused and fed into Adaptive Convolution (AC). A sigmoid function is added to the output to obtain attention weights. Finally, the attention weights are multiplied by the multi-scale contextual information obtained from feature fusion for channel feature perception, as shown in the following formula:
[0103]
[0104] AC is an adaptive 1d convolution with a kernel size of K, where σ represents the sigmoid function, whose output is the attention score of the input vector. This represents the product of corresponding elements of two matrices. AACFP enhances feature representation along the channel dimension, obtaining more fine-grained features, weakening complex background noise, suppressing useless information, and strengthening target features, thereby greatly improving the detection capability of small targets. This module takes input features... Output Finally, we concatenate the output multi-scale features and then perform a 3x3 convolution to obtain the final result. The calculation process is as follows:
[0105]
[0106] To reduce expensive computation and memory costs, and because background noise in higher layers decreases relative to lower layers as the network deepens, DAFPM only operates on the P2 branch where background noise is relatively high, focusing on the detection of small targets.
[0107] like Figure 7 In this embodiment, the trust classifier introduces subjective logic (SL) and a Dirichlet distribution to model the uncertainty distribution. Dempster-Shafer evidence theory (DST) is a generalization of Bayesian theory to subjective probability. It assigns trust quality to a subset of discrete frames (containing class labels). When trust quality is low, the output can be represented as "I don't know". SL formalizes the concept of trust assignment on the discriminative frame in DST as a Dirichlet distribution. Therefore, it allows the use of the principles of evidence theory to quantify trust quality b and uncertainty u through a well-defined theoretical framework. Trust quality assignment, i.e., subjective opinion, corresponds to a Dirichlet distribution with parameters α = e+1. By placing the Dirichlet distribution on the class probability, we treat the neural network's prediction as a subjective opinion and learn network parameters from the training data using a deterministic neural network. This network is used to collect evidence leading to the subjective opinion, and the network output evidence e = [e1, e2, ..., e] is used to model the subjective opinion. k By parameterizing, the Dirichlet distribution parameters α = [α1, α2, ..., α] can be obtained. k ]:
[0108] α k =e k +1
[0109] Then, using SL modeling on the Dirichlet distribution, we obtain the uncertainty M = [b1, b2, ..., b k ,u]:
[0110]
[0111] and
[0112] K represents the number of categories, b k This represents the classification result for the k-th class, and u represents the confidence level of the classification result, with a value of (0,1). The smaller the uncertainty value, the more reliable the result.
[0113] Specifically, the YOLOv8s loss function consists of three parts: the first two terms are regression loss, and the last term is classification loss. The overall loss function can be expressed as:
[0114] Loss = L ciou +Ldfl +L class
[0115] Among them, L ciou and L dfl These are the regression losses in the original YOLOv8s network, calculated using CIOU loss and DFL loss respectively, without modification; for L... class Because the network introduces the Dirichlet distribution, the original YOLOv8s loss function for class determination is no longer applicable. The improved overall prediction loss function can be expressed as:
[0116]
[0117] Where i represents the i-th training sample, N represents the total number of training samples, Θ represents the network parameters, and λ t =min(1.0,t / 10)∈[0,1] is the annealing coefficient, and t represents the current training epoch.
[0118] The evidence used to learn the correct category uses the Dirichlet distribution D(p) i |α i ) as the polynomial likelihood Mult(y i |p i The prior probability of the class is used, and the negative logarithm of the marginal likelihood obtained by integrating the class probability is used as the class prediction loss function, which is calculated as follows:
[0119]
[0120] Where K represents the number of categories, y ik Let represent the Ground Trust of the i-th sample in the k-th category.
[0121] We can only ensure that the correct label for each sample generates more evidence than other classes, but we cannot guarantee that incorrect labels will generate less evidence. That is, incorrect categories also generate some evidence, which, although it doesn't affect the final classification result, does hinder the network's uncertainty. In our model, we expect the evidence from incorrect category labels to be reduced to zero. Therefore, we add a KL regularization term, which penalizes incorrect evidence and thus reduces evidence from incorrect categories, as follows:
[0122]
[0123] in, It is the adjustment parameter of the Dirichlet distribution, which can avoid penalizing evidence of the correct class as 0.
[0124] To ensure that the evidence is greater than or equal to 0, the ReLU activation function is typically used, i.e., e^(-∞ ... k =ReLu(o k ), through analysis The gradient is as follows:
[0125]
[0126] Although It can generate more evidence for the correct category, but when the network is just starting to train, due to the randomness of the parameters, there may be some predictive evidence e corresponding to the correct category. k =0, we say that the sample is in the 0 evidence region, and this sample is called the 0 evidence sample, that is, when o = 0. k <0 o'clock The vanishing gradient problem occurs, which prevents zero-evidence samples from being learned, thus preventing parameter updates and rendering the sample invalid.
[0127] To address the vanishing gradient problem, the implementation uses the Exp function instead of the ReLU function, i.e., e k =Exp(o k ), when o k When <0, Approaching 0 (which is also considered to be in the 0 evidence region) alleviates gradient vanishing to some extent, but it is still relatively difficult to learn. Regular expressions are used to handle problems that are difficult to update, as follows:
[0128]
[0129] Analyze its gradient,
[0130] The absolute value of the gradient is in the range (0,1), when o k When <0, evidence e k Approaching 0, α k -1 approaches 0, at which point the absolute value of the gradient is at its maximum, and the network, through learning, will encourage it to update the evidence e. k This increases the amount of evidence. As the amount of evidence increases, zero-evidence samples gradually leave the zero-evidence region and the regularization term is no longer needed to assist in learning zero-evidence samples. The absolute value of the gradient will also become smaller and smaller, and the role of the regularization term will gradually be reduced.
[0131] After designing the loss function, we train the network using stochastic gradient descent based on the dataset we have prepared, and update the network parameters until the network converges.
[0132] The improved network processing outputs localization results and classification results with uncertainty. The classification results with uncertainty provide more accurate predictions and explain "how confident is the decision?" and "why is the confidence in the decision so high / low?", which improves the reliability, robustness and accuracy of classification when detecting targets in complex environments, thus better identifying UAV targets.
[0133] In practice, a GPU training environment is constructed, training parameters are set, and data and model configuration files are loaded. These parameters include: a 3090 GPU with 24GB of VRAM is selected; the network training epochs are set to 500 rounds, using transfer learning; the backbone network is frozen in the first 100 epochs, the learning rate is set to 0.01, a pre-trained model is loaded, and the bath size is set to 16; Mosaic enhancement is disabled in the last 10 epochs, and the learning rate is reduced to 0.94 after each epoch. After 500 epochs of training, the final trained model is obtained. These parameters are stored in the data configuration file, which is loaded during training. The pre-trained YOLOv8s model is selected as the model configuration file.
[0134] After each training iteration, the model file, training results, and training data for each round are obtained. The training results include metrics such as accuracy, recall, mean precision (mAP), and loss. Among these, accuracy, recall, and mAP are important parameters for evaluating model performance and can be used to verify the feasibility of this invention. The final calculated mAP value is 88.8%, which is 2.5% higher than the original YOLOv8s model. The mAP_S (mAP for small targets) is 48.1%, which is 4.8% higher than the original YOLOv8s model. In addition, to visualize the training results, the wandb file can be used to perform visualization operations, ultimately obtaining the trained UAV target detection model.
[0135] like Figure 8 As shown, the trained UAV target detection model can accurately detect UAV targets and provide a high level of confidence. Figure 9 As shown, the trained UAV target detection model can accurately detect bird targets and provide a high level of confidence. Figure 10 As shown, the trained UAV target detection model can accurately detect some bird targets. Although one bird was mistakenly identified as a UAV target, it gave a low confidence level.
[0136] The specific embodiments described above provide a detailed explanation of the technical solution of the present invention. It should be understood that the above description is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A reliable low-speed small unmanned aerial vehicle (UAV) detection method based on dynamic adaptive feature perception, characterized in that, The method includes the following steps: Step S1: Obtain images containing drone targets and images containing bird targets to construct a sample set, and divide the sample set into a training set, a validation set, and a test set; label the image samples in the training set to generate sample labels containing category information and location information; perform size adjustment and data augmentation preprocessing on the image samples in the training set, and perform size adjustment preprocessing on the image samples in the validation set and the test set. Step S2: Construct an improved YOLOv8s object detection model. This improved model includes an input module, a backbone module, a neck module, and a head module. A minimal object detection module is added to the neck layer. This minimal object detection module is connected to the output features of the P2 layer of the backbone. The minimal object detection module includes one upsampling unit, one downsampling unit, one feature concatenation unit, one composite convolutional unit (C2 unit), one dynamic adaptive feature perception module, and one detection head. The features output from the P3 layer of the neck module after processing by the composite convolutional unit are used as the input to the upsampling unit. The features output after upsampling are then concatenated with the P2 layer features by the feature concatenation unit. The concatenated result is input to the C2 unit for further processing. The processed features have two uses: first, they are used as the input to the downsampling unit, and after processing by the downsampling unit, they are provided to the head module. The P3 layer of the eck is used; the second purpose is to use it as input to the dynamic adaptive perception module. After processing by the dynamic adaptive feature perception module, its output is used as input to the detection head. The dynamic adaptive feature perception module consists of three parts: Dynamic Multi-Scale Spatial Feature Perceptron (DMSFP), Adaptive Feature Fusion Module (AFFM), and Adaptive Attention Channel Feature Perceptron (AACFP). The features processed by the above C2 unit are used as input to the dynamic adaptive perception module. First, multi-scale features are obtained through DMSFP processing. The multi-scale features are then fused by AFFM to obtain fused multi-scale context information. The AACFP generates attention weights based on the multi-scale context information. The classifier in the head module is replaced with a reliable classifier. The reliable classifier introduces subjective logic (SL) and Dirichlet distribution to complete the modeling of uncertain distributions, and introduces a new loss function to learn the parameters of the Dirichlet distribution. Step S3: Build a GPU training environment, set training parameters, and load the data configuration file and model configuration file; input the preprocessed training set and validation set into the improved YOLOv8s target detection model for training and validation, and obtain the trained UAV target detection model. Step S4: Input the test set images or other images to be identified into the trained UAV target detection model for detection, and output the detection results with classification uncertainty.
2. The method as described in claim 1, characterized in that, In step S1, the specific operation of the size adjustment is as follows: the image size is adjusted by using an adaptive image scaling mechanism. When the length and width of the image are scaled proportionally, the remaining part is filled with gray.
3. The method as described in claim 1, characterized in that, In step S1, the prior data augmentation includes six processing steps: mix_up, mosaic, color transformation, scaling, shifting, and flipping. The order of these six processing steps is adjustable.
4. The method as described in claim 1, characterized in that, In step S2, the step of obtaining multi-scale features through DMSFP processing includes: using three max-pooling layers with different kernel sizes to obtain multi-scale contextual information, and then using dynamic convolution DyConv for scale and spatial awareness. This module takes the features as input. Output , The calculation formula is as follows: Unlike ordinary pooling layers, this pooling layer incorporates padding to ensure that the input and output feature maps are of the same size. The padding size dynamically changes with the pooling kernel size, as shown in the following formula: Where kernel_size represents the kernel size, stride represents the convolution stride, and padding represents the feature map padding width; The MaxPool2d calculation formula is as follows, with the pooling kernel size k selected as (1, 3, 5). = ; = ; in, These represent the height and width of the input feature map, respectively. , These represent the height and width of the output feature map, respectively. The input and output height and width remain unchanged, while the kernel_size and padding are determined by the input k. After obtaining multi-scale features through pooling layers, a dynamic convolution DyConv is added, as shown in the following formula: in and These are the weight matrix and bias vector, where g is the ReLU activation function. It is the m-th linear function The weights are M, which is a hyperparameter representing the number of linear functions selected, x represents the input feature, and y represents the output feature. Dynamic convolution is composed of multiple convolution kernels with different weights. Through dynamic convolution, important features are dynamically selected to obtain rich spatial information of small targets.
5. The method as described in claim 4, characterized in that, In step S2, the step of obtaining fused multi-scale context information by fusing the multi-scale features through AFFM includes: AFFM fully utilizes the information at each scale and uses adaptive feature fusion to fuse the multi-scale features output by DMSFP. The calculation process is as follows: = + + ; + + = 1; = ; = Conv( ); Where k=1,3,5 represents the index of the feature after passing through a pooling kernel of size k. Learned from a 1x1 convolution function, This represents the k-th output feature of AFFM. This represents the k-th input feature; after fusion, multi-scale features are fully utilized, making small target features more prominent; the input features of this module are... Output C represents the number of channels, and H and W represent the image height and width, respectively.
6. The method as described in claim 5, characterized in that, In step S2, the step of AACFP generating attention weights based on the multi-scale context information includes: AACFP introducing adaptive channel attention, firstly by using the multi-scale context information obtained from AFFM after feature fusion. Channel compression is performed using Global Average Pooling (GAP) and Max Average Pooling (MAP) respectively. The results are then fused and fed into Adaptive Convolution (AC). A Sigmoid function is added to the output to obtain attention weights. Finally, the attention weights are multiplied with the multi-scale contextual information obtained from feature fusion for channel feature perception, as shown in the following equation: in, It is an adaptive 1d convolution with a kernel size of K, where , This represents the sigmoid function, whose output is the attention score of the input vector. This represents the product of corresponding elements of two matrices; AACFP enhances feature representation along the channel dimension, and this module takes features as input. Output The output multi-scale features are concatenated and then passed through a 3x3 convolution to obtain the final result. The calculation process is as follows: =Conv(Concat( ))。 7. The method as described in claim 1, characterized in that, In step S2, the classifier of the improved YOLOv8s object detection model is a reliable classifier. This reliable classifier adds an uncertain prediction value to the deterministic classification result output by the original YOLOv8s object detection model. The reliable classifier introduces subjective logistic regression (SL) and Dirichlet distribution to complete the uncertainty distribution modeling. The predictions of the improved YOLOv8s object detection model are considered subjective opinions, and the network parameters of the model are learned from all training data. This model is used to collect evidence leading to subjective opinions; for example, if the target is birds, more evidence is generated for the prediction branch for birds. The evidence output by the network is then considered... =[ The Dirichlet distribution parameters can be obtained by parameterization. =[ ]: ; Then, use SL to model the uncertainty of the Dirichlet distribution. =[ ],as follows: =1; = and ; S ; in, This indicates that the predicted result is evidence of class k, where S is the Dirichlet strength and K represents the number of classes. Let represent the trust quality of the k-th class, and u represent the uncertainty of the classification result, with a value of (0, 1). The smaller the uncertainty value, the more reliable the result.
8. The method as described in claim 7, characterized in that, The reliable classifier introduces a new classification loss function to learn the Dirichlet distribution parameters using the input samples; ; Where i represents the i-th training sample, and N represents the total number of training samples. Represents network parameters, Evidence used to learn the correct category Used to punish erroneous evidence, thereby reducing evidence of incorrect categories. = min(1.0, t / 10) ∈ [0, 1] is the annealing coefficient, and t represents the current training epoch. It is the adjustment parameter of the Dirichlet distribution, which can avoid penalizing evidence of the correct class as 0. Used to handle the vanishing gradient problem of categories with zero evidence of correctness.
9. The method as described in claim 1, characterized in that, The specific steps for setting training parameters are as follows: Initialize network parameters, including convolutional kernel weights and their bias weights, to train the network model; debug all hyperparameters of the model to obtain the final trained model; the hyperparameters include: hyperparameter M, number of training epochs, learning rate, and bath size; hyperparameter M is set to a fixed value of 4, and other hyperparameters are adjusted by increasing or decreasing based on the analysis of experimental results; enable Mosaic enhancement, set the number of training epochs to 500, and use transfer learning for training; freeze the backbone network in the first 100 epochs, set the learning rate to 0.01, load the pre-trained model, and set the bath size to 16; disable Mosaic enhancement in the last 10 epochs, and reduce the learning rate to 0.94 after each epoch; after 500 epochs of training, the final trained model is obtained.
Citation Information
Patent Citations
Light-weight unmanned aerial vehicle detection method for embedded equipment
CN116503762A
Unmanned aerial vehicle image detection method based on multi-scale feature fusion and context enhancement
CN117037004A
