An unmanned aerial vehicle detection method based on a convolutional neural network and a causal attention mechanism

CN118155095BActive Publication Date: 2026-08-21BEIJING INST OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410271296.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-11
Publication Date
2026-08-21
Estimated Expiration
2044-03-11

AI Technical Summary

Technical Problem

这方面的需求日渐迫切,但目前国内外还没有较为有效的大规模应用算法

Benefits of technology

[0065](1) The architecture provided by this invention establishes a highly reliable UAV detection model with stronger recognition capabilities and better decision reliability by leveraging the locality and feature extraction capabilities of convolutional neural networks, as well as the interpretability and robustness of causal effects. Compared with traditional deep models that only use convolutional neural networks and traditional causal effect calculation frameworks, the structure proposed in this invention has higher classification reliability, better interpretability, and lower hardware requirements. Therefore, this invention is easier to implement UAV detection-related tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118155095B_ABST
    Figure CN118155095B_ABST
Patent Text Reader

Abstract

The application discloses a kind of unmanned aerial vehicle high reliability detection methods based on convolutional neural network and causal attention mechanism, realize the unmanned aerial vehicle detection effect of high robustness, high anti-noise ability, low hardware requirement, low computational complexity.The architecture provided by the present application establishes the unmanned aerial vehicle high reliability detection model with stronger recognition ability and more optimal decision reliability by the locality of convolutional neural network, feature extraction capability and the interpretability and robustness of causal effect, compared with the traditional deep model using only convolutional neural network and the traditional causal effect calculation framework, the structure proposed by the present application has higher classification reliability, better interpretability and lower hardware requirement.Therefore, the present application is easier to realize unmanned aerial vehicle detection related tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention discloses a drone detection method based on convolutional neural networks and causal attention mechanisms, which achieves drone detection effects with high robustness, high noise resistance, low hardware requirements, and low computational complexity. Background Technology

[0002] Unmanned applications are one of the core development directions for my country's future industrial production and daily life. With the continuous development of drone technology, it has become a crucial tool in the fields of exploration and surveying. Drones can quickly and flexibly acquire ground information from an aerial perspective, providing entirely new solutions for various exploration and surveying tasks. Especially in fields such as geological exploration, agricultural monitoring, environmental monitoring, disaster relief, and agricultural plant protection, drone applications have become indispensable. Traditional drones are equipped with various sensors and cameras, such as infrared cameras, high-definition cameras, and thermal imagers, to acquire images and data from the ground. These sensors can capture various ground information, including visual and temperature information. However, infrared and thermal imaging sensors are expensive, bulky, and heavy, significantly impacting the drone's endurance and increasing the cost of widespread application.

[0003] The emergence of machine learning technology has provided a new direction for the development of computer vision in detection methods. Drones incorporating machine learning technology can be equipped with only low-cost visual sensors and ordinary processing chips, further expanding the applications of drones. Early vision-based drone detection relied heavily on traditional machine learning algorithms, such as decision trees, Naive Bayes, K-nearest neighbors, artificial neural networks, principal component analysis, and support vector machines. These simple algorithms identified targets with significant differences, offering advantages such as fast recognition speed and high classification efficiency. However, in complex spatial conditions, simple machine learning algorithms cannot accurately determine target categories. Drones equipped with machine learning modules are typically only used for initial screening, and human judgment is still required for specific situations.

[0004] With the emergence of deep learning, the large-scale application of drones has become possible. Deep learning allows for pre-trained models with the ability to extract and classify features of target areas in real time, offering advantages such as high accuracy, speed, ease of deployment, and low cost. New types of drones equipped with deep learning modules are already being widely used in fields such as geological exploration, agricultural monitoring, and aerial photography. However, deep learning algorithms have two main problems. On the one hand, lightweight algorithms cannot guarantee accuracy in complex real-world situations, and large models require extremely high hardware specifications, which are difficult to mount on drones due to weight and cost limitations; the long runtime of a single judgment makes it difficult to respond instantly to the real world, posing a potential safety hazard. On the other hand, applications of drones such as unmanned exploration, unmanned delivery, and unmanned reconnaissance require decision-making based on on-site conditions, demanding extremely high reliability, accuracy, and interpretability.

[0005] Traditional deep learning models are black-box models, prone to errors in less frequently encountered long-tail scenarios, which is a major obstacle to further expanding the application of drones. In recent years, using deep learning models incorporating causal effects for reliability optimization has become a new trend. This approach does not require a highly complex model structure and only needs an imaging device. It can improve reliability in arbitrarily complex regions while retaining the fast and high-precision detection capabilities of deep learning models, enhancing fault tolerance and intelligently providing model decision-making basis. This significantly reduces the possibility of operational errors caused by misjudgments in complex real-world situations, especially in scenarios requiring extremely high accuracy. Improving model reliability allows drones to achieve a certain degree of self-correction and review capabilities. The need for this is becoming increasingly urgent, but currently, there are no effective algorithms for large-scale application both domestically and internationally. Summary of the Invention

[0006] In view of this, the present invention provides a UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism, named CausalView. This architecture, after model training, can be directly deployed on a UAV as an intelligent detection module, achieving end-to-end, real-time, and reliable detection. By performing end-to-end processing and analysis of image data, the UAV can autonomously complete ground situation detection tasks, greatly improving detection efficiency and accuracy. Simultaneously, the module can save the overall decision-making basis of the scene as a reference for the credibility of the deep model, thereby assisting in important decision points and achieving high precision, high credibility, high interpretability, and low equipment requirements for unmanned detection.

[0007] The technical solution of this invention is:

[0008] A drone detection method based on a convolutional neural network model and a causal effect propagation mechanism, the method comprising the following steps:

[0009] Step 1: Obtain image data and image labels for the scene to be trained, and divide the obtained image data into training set and validation set, and divide the obtained image labels into training set and validation set, and perform unified processing.

[0010] Step 2: Train the deep learning classification model based on the image data and image label training set obtained in Step 1 to obtain the trained deep learning classification model.

[0011] Step 3: Based on the image data and image label training set obtained in Step 1 and the trained deep learning classification model obtained in Step 2, construct a classification explanation model based on convolutional neural network and causal attention transfer mechanism.

[0012] Step 4: Use the training set and validation set divided in Step 1 to train and validate the classification explanation model based on convolutional neural network and causal attention transfer mechanism constructed in Step 3.

[0013] Step 5: Terminate the training process of the explanatory model to obtain the trained classification explanatory model based on convolutional neural network and causal attention transfer mechanism;

[0014] Step 6: Input the new image data into the interpretation model trained in Step 5, and provide the output to the drone for decision-making.

[0015] In step 1, when acquiring scene image data, the dataset used is divided into training and validation sets in a ratio of 8:2.

[0016] In step 3, the constructed classification explanation model based on convolutional neural networks and causal attention transfer mechanism includes a variable spatial transfer network and a spliced ​​variational autoencoder.

[0017] The variable spatial transfer network consists of a localization network (containing 2 convolutional layers, 2 max pooling layers, and 2 activation layers), a mean sampling layer (containing 2 linear layers and 1 activation layer), and a log-variance sampling layer (containing 2 linear layers and 1 activation layer), which is responsible for extracting the range of the image attention region.

[0018] The concatenated variational encoder consists of one encoder (containing 3 convolutional layers, 1 two-dimensional zero-padding layer, and 3 activation layers), one mean mapping layer, one log-variance mapping layer, one classification fully connected layer (containing 1 linear layer and 1 activation layer), and one decoder (containing 3 deconvolutional layers, 3 activation layers, and 1 linear layer). It is responsible for extracting deep features of the image and completing the latent variable reconstruction process.

[0019] The localization network consists of the following structure in sequence: one convolutional layer with an input dimension equal to the number of channels, an output dimension of 8, a stride of 1, and a kernel size of 7×7; one max pooling layer with a window size of 2 and a stride of 2; one rectified linear activation function; one convolutional layer with an input dimension of 8, an output dimension of 10, a stride of 1, and a kernel size of 5×5; one max pooling layer with a window size of 2 and a stride of 2; and one rectified linear activation function.

[0020] The mean sampling layer contains the following structure in sequence: one linear layer with an input of localization network output dimension × 10 and an output of 32; one linear rectified activation function; and one linear layer with an input of 32 and an output of 4.

[0021] The log-variance sampling layer contains the following structure in sequence: one linear layer with an input of localization network output dimension × 10 and an output of 32; one linear rectified activation function; and one linear layer with an input of 32 and an output of 4.

[0022] The encoder consists of, in sequence, one convolutional layer with an input dimension equal to the number of channels, an output dimension of 64, a stride of 2, a kernel size of 4×4, and edge padding of 1; one rectified linear activation function; one convolutional layer with an input dimension equal to the number of channels, an output dimension of 64, a stride of 2, a kernel size of 4×4, and edge padding of 1; one rectified linear activation function; one two-dimensional zero-padding layer with zeros padded in the left, right, top, and bottom directions of (1, 2, 1, 2); one convolutional layer with an input dimension equal to the number of channels, an output dimension of 64, a stride of 1, and a kernel size of 4×4; and one rectified linear activation function.

[0023] The mean mapping layer consists of a linear layer whose input is the encoder output dimension × number of pixels / 16 and whose output is 7;

[0024] The log-variance mapping layer consists of one linear layer whose input is the encoder output dimension × number of pixels / 16 and whose output is 7;

[0025] The classification fully connected layer consists of one linear layer with an input of 14 and an output of encoder output dimension × number of pixels / 16.

[0026] The decoder consists of, in order: a deconvolutional layer with an input dimension of 64, an output dimension of 64, a stride of 1, a kernel size of 4×4, and edge padding of 1; one rectified linear activation function; one deconvolutional layer with an input dimension of 64, an output dimension equal to the number of channels, a stride of 2, a kernel size of 4×4, and edge padding of 1; one rectified linear activation function; one deconvolutional layer with an input dimension of 64, an output dimension equal to the number of channels, a stride of 2, a kernel size of 4×4, and edge padding of 1; one rectified linear activation function; and one sigmoid function.

[0027] Step 4, training the classification explanation model based on convolutional neural networks and causal attention transfer mechanism, includes:

[0028] Determine the loss of the classification explanation model based on convolutional neural networks and causal attention transfer mechanism:

[0029] L = L area +λ1D+L y +C

[0030] In the formula, L area λ1 is the area loss, D is the variational autoencoder loss, C is the causality loss, and L is the area loss. y This is the category loss.

[0031] Area loss L area :

[0032]

[0033] Where, N x s represents the number of images in a batch. x The scaling factor for the x-axis is s. y λ is the y-axis scaling ratio, and λ2 is the compression preference parameter;

[0034] Variational autoencoder loss D:

[0035] D = KL + MSE

[0036] Where KL is the KL divergence and MSE is the least squares error;

[0037] Category loss L y Cross-entropy loss;

[0038] Causal effect loss C:

[0039]

[0040] Where α is the causal factor and Y is the probability of the classifier model judging the input image.

[0041] The training process is divided into four parts, including classifier attention extraction, concatenated variational autoencoder training, causal attention transfer, loss calculation and optimization;

[0042] Methods for extracting content using classifier attention include:

[0043] 1. Extract the corresponding batch of training set images X, where a single batch includes N. xGiven a set of image data, input to a variable spatial transfer network. Two vectors μ and σ, both with a dimension of 4, are obtained from the mean sampling layer and the log-variance sampling layer of the variable spatial transfer network.

[0044] 2. Gaussian sampling is performed on μ and σ to obtain the corresponding batch transfer values, including the x-axis shift ratio d. x y-axis shift ratio d y x-axis scaling ratio s x y-axis scaling ratio s y Normalize it using sigmoid and then d x d y Enlarged to the range [-1,1], and concatenated to obtain the corresponding batch transition matrix θ, where each transition matrix θ is 2×3 in size, and the oblique transition deviation is 0;

[0045] 3. Based on the principle of spatial transfer, the space of X is projected into a grid according to θ, and the grid is used to sample the corresponding batch of images X to obtain the corresponding batch of local images V;

[0046] The training method for the concatenated variational autoencoder is as follows:

[0047] 1. Input the corresponding batch local image V into the encoder to obtain the corresponding batch latent variable z1, which has a dimension of 7;

[0048] 2. Sample the corresponding batch vector z2 from the 0-1 distribution, with a dimension of 7;

[0049] 3. Concatenate z1 and z2 to obtain the corresponding batch vector z, which has a dimension of 14;

[0050] 4. Input the corresponding batch vector z into the decoder to obtain the corresponding batch reconstructed image.

[0051] 5. Reconstructed images for the corresponding batch Input the classifier model to obtain the classification probability of the corresponding batch of reconstructed images.

[0052] The causal attention transmission method is as follows:

[0053] 1. Specify the number N of intervention box samples. α and the number of random vectors N β ;

[0054] 2. Take individual images X one by one from the corresponding batch of training set images X. i ;

[0055] 3. Randomly sample N from a standard Gaussian distribution. α Group transfer values, including x-axis shift ratio d x y-axis shift ratio d y x-axis scaling ratio sx y-axis scaling ratio s y Normalize it using sigmoid and then d x d y Enlarging to the range [-1, 1] and concatenating them yields N. α A set of transition matrices θ, where each transition matrix θ is 2×3 in size, and the oblique transition bias is 0;

[0056] 4. For each X i , using N α The transition matrix θ is sampled to obtain images X′, with N images in total. x ×N α ;

[0057] 5. Input X′ into the encoder to obtain the corresponding batch of latent vectors z′;

[0058] 6. Copy each implicit vector in z' by N. β N are randomly sampled from a 0-1 distribution. β 1 vector and concatenate them;

[0059] 7. Input the concatenated vector into the decoder to obtain a batch of reconstructed images X″, with a number of N. x ×N α ×N β ;

[0060] 8. Input the reconstructed image X″ into the classifier model to generate the classification probability Y″ of the reconstructed image;

[0061] The methods for loss calculation and optimization are as follows:

[0062] Calculate L based on the corresponding batch transition value extracted by the classifier's attention. area ; Calculate KL divergence based on log-variance mapping layer; Reconstruct images based on corresponding batches Calculate the least squared error; based on the classification probability of the reconstructed image during training of the concatenated variational autoencoder. Calculate the category loss L y The causal effect loss C is calculated based on the classification probability Y″ of the reconstructed image transmitted by causal attention.

[0063] Based on the determined classification loss, the loss value of the high-reliability UAV detection model based on the convolutional neural network model and the causal effect transmission mechanism is determined. During the training process, the learning rate can be obtained. When training is terminated, the termination time is determined based on the threshold of the loss value and the learning rate, and the trained UAV detection model based on the convolutional neural network model and the causal effect transmission mechanism is obtained.

[0064] The present invention has the following beneficial effects:

[0065] (1) The architecture provided by this invention establishes a highly reliable UAV detection model with stronger recognition capabilities and better decision reliability by leveraging the locality and feature extraction capabilities of convolutional neural networks, as well as the interpretability and robustness of causal effects. Compared with traditional deep models that only use convolutional neural networks and traditional causal effect calculation frameworks, the structure proposed in this invention has higher classification reliability, better interpretability, and lower hardware requirements. Therefore, this invention is easier to implement UAV detection-related tasks.

[0066] (2) The architecture provided by this invention is applicable to fine-grained classification and localization tasks in multiple scenarios and categories, and has excellent performance in target detection and judgment under complex shapes. At the same time, by performing region reconstruction and judgment on the target region, the reliability of the scene target features of the proposed architecture can be further improved, that is, it effectively solves the problem that the accuracy of existing technologies fluctuates greatly in complex real-world scenarios and the credibility of detection results is difficult to interpret.

[0067] (3) The framework provided by this invention reduces the number of model parameters and computational complexity by using a lower number of convolutional layers and a variational autoencoder structure, achieving an excellent balance between recognition performance and model complexity. Therefore, this invention has stronger industrial practical significance and meets the deployment requirements of UAV equipment.

[0068] (4) The framework provided by this invention has better feature interpretation capabilities, can quickly capture and aggregate the causal basis that contributes the most to the category determination in the scene image, and the weight distribution of the trained model is relatively uniform, and the distribution of the basis for reconstructing the image is also relatively stable. Attached Figure Description

[0069] Figure 1 A schematic diagram of a classification explanation model based on convolutional neural networks and causal attention transfer mechanism;

[0070] Figure 2 This is a schematic diagram of a variable space transfer network structure. Detailed Implementation

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

[0072] Example

[0073] Step 1: Select two categories, cats and dogs, from the everyday animal dataset, and randomly select 10,000 images from each category as the image data and image labels for the training scene; divide the image data and image labels for the training scene into the training set and the validation set in a ratio of 8:2; uniformly modify the size of all images to 52×52 pixels.

[0074] Step 2: Build and obtain a deep learning classification model. Use the official VGG16 pre-trained model as the training foundation for the deep learning classification model. Remove the classification layer, retain the feature layer, and redefine the new classification layer required for the image data and image labels of the scene to be trained. The classification layer includes, in order: one linear layer with an input of 512×7×7 and an output of 512; one linear rectified activation function; one random deactivation layer; one linear layer with an input of 512 and an output of 128; one linear rectified activation function; one random deactivation layer; and one linear layer with an input of 128 and an output of 2 classes. Input the training set into the deep learning classification model with the following hyperparameters: batch size = 64, optimization function = Adam, initial learning rate = 10. -4 The loss function is CrossEntropyLoss. The model iterated for a total of 300 generations, and the trained model achieved an accuracy of 95.6% on the test set.

[0075] Step 3: Train a classification explanation model based on convolutional neural networks and causal attention transfer mechanisms, such as... Figure 1 As shown, the image training set and the trained deep learning classification model are input into the variable space transfer network, as follows: Figure 2 As shown, the results of the mean sampling layer and the log-variance sampling layer are input into the sigmoid function for normalization, and the 3- and 4-dimensional d are converted into sigmoid values. x d y Multiply each image by 2 and subtract 0.5 to enlarge it to the range [-1, 1], then concatenate them according to their positions to form the transition matrix θ. Project the transition matrix θ onto a grid using affine_grid, and use the grid to sample local images V on the corresponding batch images X using the grid_sample function. Set the hyperparameters as follows: batch size = 64, epoch = 1500, optimization method is Adam, learning rate = 0.0001, betas = (0.5, 0.999), λ1 = 0.05, λ2 = 3, and select a test set for testing.

[0076] Step 4: Obtain the trained and deployable classification explanation model based on convolutional neural networks and causal attention transfer mechanism, and load it onto the drone.

[0077] Step 5: Use a drone to take frontal photos to obtain 3 cat pictures and 3 dog pictures. Input the animal pictures into a classification interpretation model based on convolutional neural networks and causal attention transfer mechanism to obtain attention output pictures, counterfactual result pictures and classification probabilities.

[0078] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism, characterized in that... The steps of this method include: Step 1: Obtain image data and image labels for the scene to be trained, and divide the obtained image data into training set and validation set, and divide the obtained image labels into training set and validation set, and perform unified processing. Step 2: Train the deep learning classification model based on the image data and image label training set obtained in Step 1 to obtain the trained deep learning classification model. Step 3: Based on the image data and image label training set obtained in Step 1 and the trained deep learning classification model obtained in Step 2, construct a classification explanation model based on convolutional neural network and causal attention transfer mechanism. Step 4: Use the training and validation sets divided in Step 1 to train and validate the classification explanation model based on convolutional neural network and causal attention transfer mechanism constructed in Step 3. Step 5: Terminate the training process of the explanatory model to obtain the trained classification explanatory model based on convolutional neural network and causal attention transfer mechanism; Step 6: Input the new image data into the interpretation model trained in Step 5, and provide the output to the drone for decision-making. In step 3, the constructed classification explanation model based on convolutional neural networks and causal attention transfer mechanism includes a variable spatial transfer network and a spliced ​​variational autoencoder. The variable spatial transfer network consists of a localization network, a mean sampling layer, and a log-variance sampling layer, and is used to extract the range of the image attention region. The localization network consists of two convolutional layers, two max pooling layers, and two activation layers. The mean sampling layer consists of two linear layers and one activation layer; The log-variance sampling layer consists of two linear layers and one activation layer; The spliced ​​variational autoencoder consists of one encoder, one mean mapping layer, one log-variance mapping layer, one classification fully connected layer, and one decoder, and is used to extract deep features of an image. The encoder contains three convolutional layers, one two-dimensional zero-padding layer, and three activation layers. The classification fully connected layer consists of one linear layer and one activation layer; The decoder consists of 3 deconvolutional layers, 3 activation layers, and 1 linear layer; The localization network comprises the following structures in sequence: A convolutional layer with an input dimension equal to the number of channels, an output dimension of 8, a stride of 1, and a kernel size of 7×7; A max pooling layer with a window size of 2 and a stride of 2; One linear rectified activation function; One convolutional layer with an input dimension of 8, an output dimension of 10, a stride of 1, and a kernel size of 5×5; A max pooling layer with a window size of 2 and a stride of 2; One linear rectified activation function; The mean sampling layer contains the following structures in sequence: A linear layer with an input of 10 times the output dimension of the localization network and an output of 32; One linear rectified activation function; A linear layer with 32 inputs and 4 outputs; The log-variance sampling layer contains the following structures in sequence: A linear layer with an input of 10 times the output dimension of the localization network and an output of 32; One linear rectified activation function; A linear layer with 32 inputs and 4 outputs.

2. The UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism according to claim 1, characterized in that: In step 1, when acquiring scene image data, the dataset used is divided into training and validation sets in a ratio of 8:

2.

3. The UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism according to claim 1, characterized in that: The encoder includes, in sequence: A convolutional layer with an input dimension equal to the number of channels, an output dimension of 64, a stride of 2, a kernel size of 4×4, and edge padding of 1; One linear rectified activation function; A convolutional layer with an input dimension of 64, an output dimension of 64, a stride of 2, a kernel size of 4×4, and edge padding of 1; One linear rectified activation function; A two-dimensional zero-filled layer with (1, 2, 1, 2) zeros padded in the left, right, up, and down directions respectively; A convolutional layer with an input dimension equal to the number of channels, an output dimension of 64, a stride of 1, and a kernel size of 4×4; One linear rectified activation function; The mean mapping layer consists of one linear layer with an input of encoder output dimension × number of pixels / 16 and an output of 7; The log-variance mapping layer consists of one linear layer whose input is the encoder output dimension × number of pixels / 16 and whose output is 7; The classification fully connected layer consists of one linear layer with an input of 14 and an output of encoder output dimension × number of pixels / 16. The decoders include, in order: A deconvolutional layer with an input dimension of 64, an output dimension of 64, a stride of 1, a kernel size of 4×4, and edge padding of 1; One linear rectified activation function; A deconvolutional layer with an input dimension of 64, an output dimension of 64, a stride of 2, a kernel size of 4×4, and edge padding of 1; One linear rectified activation function; A deconvolutional layer with an input dimension of 64, an output dimension equal to the number of channels, a stride of 2, a kernel size of 4×4, and edge padding of 1; One linear rectified activation function; one sigmoid function.

4. The UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism according to claim 1, characterized in that: Step 4, training the classification explanation model based on convolutional neural networks and causal attention transfer mechanism, includes: Determine the loss L of the classification explanation model based on convolutional neural networks and causal attention transfer mechanism: In the formula, For area loss, These are the loss balance parameters for the variational autoencoder. For variational autoencoder loss, For the loss of causal effect, For category loss; Area loss : in, The number of images in a batch. The scaling factor is the x-axis. The scaling factor is the y-axis scaling factor. For compression preference parameters; Variational autoencoder loss : in for divergence, It is the least squares error; Category loss Cross-entropy loss; Causal effect loss : in, As a causal factor, This represents the probability that the classifier model will judge the input image.

5. The UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism according to claim 4, characterized in that: The training process is divided into four parts: classifier attention extraction, spliced ​​variational autoencoder training, causal attention transfer, loss calculation, and optimization.

6. The UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism according to claim 5, characterized in that: Methods for extracting content using classifier attention include: Extract the corresponding batch of training set images X, where a single batch includes Given a set of image data, input it into a variable spatial transfer network. The network then generates two vectors from its mean sampling layer and log-variance sampling layer. , All dimensions are 4; right , Gaussian sampling was performed to obtain the corresponding batch shift values, including the x-axis shift ratio. y-axis shift ratio x-axis scaling ratio y-axis scaling ratio Normalize it using sigmoid and then , Enlarged to the range [-1,1], and concatenated to obtain the corresponding batch transition matrix θ, where each transition matrix θ is 2×3 in size, and the oblique transition deviation is 0; Based on the principle of spatial transfer, the space of X is projected into a grid according to θ, and the grid is used to sample the corresponding batch of images X to obtain the corresponding batch of local images V. The training method for the concatenated variational autoencoder is as follows: Input the corresponding batch of local images V into the encoder to obtain the corresponding batch of latent variables. Its dimension is 7; Sample the corresponding batch vector from the 0-1 distribution. Its dimension is 7; splicing and This yields the corresponding batch vector z, with a dimension of 14; The corresponding batch vector z is input into the decoder to obtain the corresponding batch reconstructed image. ; Corresponding batch reconstructed images Input the classifier model to obtain the classification probability of the corresponding batch of reconstructed images. ; The causal attention transmission method is as follows: Specify the number of samples for the intervention box and the number of random vectors ; Take individual images one by one from the corresponding batch of training set images X. ; Random sampling from a standard Gaussian distribution Group shift values, including x-axis shift ratio y-axis shift ratio x-axis scaling ratio y-axis scaling ratio Normalize it using sigmoid and then , Enlarge it to the range [-1,1] and then concatenate them to obtain A set of transition matrices θ, where each transition matrix θ is 2×3 in size, and the oblique transition bias is 0; For each ,use Group transition matrix θ sampling to obtain the image The number is ; Will Input the encoder to obtain a batch of latent vectors z'; Copy each implicit vector in z' One, randomly sampled from a 0-1 distribution. 1 vector and concatenate them; The concatenated vectors are input into the decoder to obtain a batch of reconstructed images. The number is × × ; Reconstructed image Input the classifier model to generate the classification probability of the reconstructed image. .

7. The UAV detection method based on a convolutional neural network model and a causal effect transmission mechanism according to claim 5, characterized in that: The method for loss calculation and optimization is as follows: Calculate the corresponding batch transition value extracted from the classifier's attention. ; Calculated based on log-variance mapping layer Divergence; Reconstruct images based on the corresponding batch Calculate the least squares error; Based on the classification probability of the reconstructed image during training of the concatenated variational autoencoder Calculate category loss ; Classification probability of reconstructed image based on causal attention transfer Calculate the loss of causal effect ; Based on the determined classification of losses The loss value of the high-reliability UAV detection model based on the convolutional neural network model and the causal effect transmission mechanism is determined. The learning rate can be obtained during the training process. When training is terminated, the termination time is determined according to the threshold of the loss value and the learning rate, and the trained UAV detection model based on the convolutional neural network model and the causal effect transmission mechanism is obtained.

Citation Information

Patent Citations

  • Intelligent mineral sorting method based on convolutional neural network and self-attention mechanism

    CN116403021A