Unmanned aerial vehicle inspection terminal data anomaly detection method and system based on cooperation of behavior coding and Transform-RVM

By combining behavior coding and Transformer-RVM, the problem of low accuracy in anomaly detection of UAV inspection terminal data was solved, and efficient and accurate anomaly detection of high-dimensional and nonlinear data was achieved.

CN121765576APending Publication Date: 2026-03-31ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID NINGXIA ELECTRIC POWER COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies have low detection accuracy in anomaly detection of UAV inspection terminal data, especially in high-dimensional, nonlinear, and noisy data, where it is difficult to capture temporal correlation and spatial topological relationships, resulting in low anomaly recognition accuracy and poor generalization performance.

Method used

We employ a behavior-encoding-based Transformer-RVM approach. By preprocessing multi-source sensor data, we generate a regular temporal sample set. We then use graph convolutional networks to fuse device spatial topology information to generate spatiotemporal fusion features. We extract deep features using a Transformer editor and combine Relevant Vector Machine (RVM) and Neural Differential Equations for efficient training to construct a highly sparse RVM model for anomaly detection.

Benefits of technology

It effectively improves the accuracy and efficiency of anomaly detection in UAV inspection terminal data, and can efficiently capture dynamic behavior patterns and global temporal dependencies, thereby achieving accurate detection of anomalies in inspection data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765576A_ABST
    Figure CN121765576A_ABST
Patent Text Reader

Abstract

The invention provides an unmanned aerial vehicle inspection terminal data anomaly detection method and system based on behavior coding cooperating with Transform-RVM, and relates to the technical field of artificial intelligence, the method comprises the following steps: preprocessing sensor original data of an unmanned aerial vehicle inspection terminal, and generating a time sequence sample set; the time sequence samples are converted into behavior coding vectors, and space-time fusion features are generated by fusing equipment space topology information through a graph convolutional network; inputting the space-time fusion features into a Transform editor, and extracting deep features through a multi-head self-attention mechanism, residual connection, layer normalization and a feedforward network; constructing a probability classification model by adopting a relevance vector machine RVM, modeling a parameter optimization process by utilizing a neural differential equation, and performing efficient training in combination with a dynamic sparsity control and adjoint sensitivity method to obtain a highly sparse RVM model; and performing anomaly detection on the unmanned aerial vehicle inspection terminal data acquired in real time by using the highly sparse RVM model. According to the scheme, the anomaly detection precision of the unmanned aerial vehicle inspection terminal data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and drone inspection technology, and in particular to a method and system for detecting data anomalies in drone inspection terminals based on behavior coding and Transformer-RVM. Background Technology

[0002] With the rapid development of drone technology, its application in fields such as power line inspection, industrial equipment monitoring, and oil and gas pipeline inspection is becoming increasingly widespread. Drones can replace manual labor in completing inspection tasks in high-risk and complex environments, and can collect massive amounts of time-series data in real time through multi-modal sensors such as infrared thermal imagers, LiDAR, and vibration sensors. However, how to accurately identify anomalies from this high-dimensional, nonlinear, and noisy data has become a core challenge restricting the efficiency and safety of inspections.

[0003] Traditional methods for anomaly detection typically employ Support Vector Machines (SVM), Random Forests (RF), and Isolation Forests. These methods rely on manual feature engineering and require pre-defined statistical features such as mean, variance, and spectral energy. They struggle to capture the temporal correlations and spatial topological relationships in dynamic behaviors such as abrupt changes in drone flight trajectories and robotic arm vibration patterns, leading to low anomaly detection accuracy. Furthermore, these methods are sensitive to the curse of dimensionality in high-dimensional data, and their generalization performance drops sharply in small-sample scenarios, such as when historical fault data for new equipment is scarce, increasing the risk of overfitting. While deep learning-based methods can automatically extract features and have strong fitting capabilities, they still face challenges in data fusion and feature extraction when dealing with high-dimensional sparse data and heterogeneous multi-source data, similarly impacting anomaly detection accuracy.

[0004] In summary, existing technologies have low detection accuracy when detecting anomalies in drone inspection terminal data. Summary of the Invention

[0005] In view of this, and to address the above shortcomings, it is necessary to propose a method and system for anomaly detection of UAV inspection terminal data based on behavior coding combined with Transformer-RVM, so as to improve the accuracy of anomaly detection of UAV inspection terminal data.

[0006] In a first aspect, the present invention provides a method for detecting data anomalies in UAV inspection terminals based on behavior coding combined with Transformer-RVM, comprising:

[0007] S10: Preprocess the raw data from multiple sensor sources from the UAV inspection terminal to generate a regular time-series sample set;

[0008] S20: The kinematic model based on the UAV inspection terminal converts the time-series samples into behavior encoding vectors, and uses graph convolutional networks to fuse device spatial topology information to generate spatiotemporal fusion features;

[0009] S30: Input the spatiotemporal fusion features into the Transformer editor and extract deep features containing global context information through multi-head self-attention mechanism, residual connection, layer normalization and feedforward network;

[0010] S40: A probabilistic classification model is constructed using Relevance Vector Machine (RVM), and its parameter optimization process is modeled using neural differential equations. The model is then trained efficiently by combining dynamic sparsity control and the adjoint sensitivity method, resulting in a highly sparse RVM model for anomaly detection.

[0011] S50: Utilize the highly sparse RVM model to perform anomaly detection on the real-time collected UAV inspection terminal data.

[0012] Preferably, step S10 specifically includes:

[0013] S11: Z-score normalization is used to normalize the data of each sensor channel to eliminate dimensions;

[0014] S12: The normalized signal is decomposed using discrete wavelet transform, soft thresholding is performed on the high-frequency details sparse, and the signal is reconstructed after denoising.

[0015] S13: Perform sliding window segmentation on the denoised and reconstructed signal according to the preset window length L and step size S to generate time-series samples with dimension L×D; where D is the number of sensor channels.

[0016] Preferably, step S12 specifically includes:

[0017] S121: The normalized signal is decomposed using the following formula: ;

[0018] in, and These represent the low-frequency and high-frequency components, respectively. DWT stands for Discrete Wavelet Transform. The signal after normalization These are wavelet basis functions;

[0019] S122: For detail coefficients Applying a soft thresholding function to suppress noise is expressed as follows: ;

[0020] Among them, threshold Adaptive calculation based on the Donoho-Johnstone criterion: , The standard deviation of noise. For signal length, The high-frequency components after noise suppression are represented by sign, where sign is the sign function.

[0021] S123: The signal is reconstructed using the denoised components, as follows: ;

[0022] Here, IDWT stands for Inverse Discrete Wavelet Transform.

[0023] Preferably, step S20 specifically includes:

[0024] S21: Define the motion primitives of the UAV inspection terminal, and use Kalman filtering to smooth the raw sensor data to obtain the state estimation sequence;

[0025] S22: Calculate the matching distance between the state estimation sequence and each template in the predefined behavior primitive template library using the dynamic time warping algorithm, and convert it into a behavior encoding vector;

[0026] S23: Construct a spatial topology graph of device components, map the behavior encoding vector and sensor data to graph nodes, aggregate neighborhood information through a graph convolutional network, and output a spatiotemporal fusion feature vector.

[0027] Preferably, step S21 specifically includes:

[0028] Define six-DOF motion primitives for the UAV inspection terminal, including position and attitude; to obtain smooth motion state estimation, apply Kalman filtering to the raw sensor data. The filtering process includes:

[0029] First, based on the state at the previous moment With control input Predict the current state using the state transition matrix A. , means as follows: ;

[0030] in, Let B be the state vector and B be the control input matrix. Q is the control variable, and Q is the process noise covariance matrix characterizing the dynamic uncertainty of the system.

[0031] The predicted observations are then represented as follows: ;

[0032] in, Here, H represents the predicted sensor observations, H is the observation matrix, and R is the observation noise covariance.

[0033] Furthermore, the residuals are weighted and fused based on Kalman gain to obtain a smoothed state estimation sequence; wherein, the residuals are sensor observations. Compared with predicted sensor observations The difference.

[0034] Preferably, the Transformer processing in step S30 specifically includes:

[0035] S31: Linearly project the input spatiotemporal fusion features into a query matrix Q, a key matrix K, and a value matrix V;

[0036] S32: Calculate the scaled dot product attention weights and sum them with the value matrix V to obtain the single-head attention output;

[0037] S33: The outputs of multiple attention heads are spliced ​​together, linearly projected, and then residually connected to the input and normalized.

[0038] S34: Input the normalization result into the feedforward network and output deep features containing global context information; wherein, the feedforward network contains two fully connected layers and the GELU activation function.

[0039] Preferably, in step S34, the feedforward network and activation function are represented as follows: ; ;

[0040] Wherein, FFN represents the feedforward network. For the normalized result, GELU is the activation function, W1 and W2 are both weight matrices, and b1 and b2 are both bias vectors.

[0041] Preferably, step S40 specifically includes:

[0042] S41: Initialize the weight vector, hyperparameter vector, and kernel function parameters of the RVM model, and establish the ordinary differential equations describing the parameter evolution;

[0043] S42: Introduce a hyperparameter decay term into the ordinary differential equation. When the absolute value of the weight is lower than a preset threshold, drive the corresponding hyperparameter to grow, so as to achieve dynamic sparsity of the weight.

[0044] S43: The gradient of the loss function with respect to the parameters is calculated in reverse using the adjoint sensitivity method to avoid storing intermediate states in the optimization trajectory;

[0045] S44: Construct a composite loss function that includes negative log-marginal likelihood and L1 regularization, perform positive integration using an adaptive ODE solver, and combine it with gradient to update the model parameters to obtain the final highly sparse RVM model.

[0046] Preferably, in step S42, the evolution of hyperparameters is controlled by the following formula: ;

[0047] in, The attenuation rate, For hyperparameters, As weight, For sparsity threshold, This is an indicator function.

[0048] Secondly, the present invention provides a UAV inspection terminal data anomaly detection system based on behavior coding combined with Transformer-RVM. The system is deployed on the UAV onboard computer or inspection edge computing gateway. The system includes: a time series sample generation module, a spatiotemporal fusion feature generation module, a deep feature extraction module, an RVM model training module, and an anomaly detection module.

[0049] The time-series sample generation module is configured to preprocess the raw data from multiple sources of sensors from the UAV inspection terminal to generate a regular time-series sample set.

[0050] The spatiotemporal fusion feature generation module is configured to convert the temporal samples into behavior encoding vectors based on the kinematic model of the UAV inspection terminal, and use graph convolutional networks to fuse the spatial topology information of the device to generate spatiotemporal fusion features.

[0051] The deep feature extraction module is configured to input the spatiotemporal fusion features into the Transformer editor and extract deep features containing global context information through multi-head self-attention mechanism, residual connection, layer normalization and feedforward network.

[0052] The RVM model training module is configured to construct a probabilistic classification model using Relevant Vector Machine (RVM), model its parameter optimization process using neural differential equations, and perform efficient training by combining dynamic sparsity control and the adjoint sensitivity method to obtain a highly sparse RVM model for anomaly detection.

[0053] The anomaly detection module is configured to use the highly sparse RVM model to perform anomaly detection on the real-time collected UAV inspection terminal data.

[0054] As described above, the method and system for anomaly detection of UAV inspection terminal data based on behavior encoding combined with Transformer-RVM provided in this solution first preprocesses the raw data from multiple sensor sources of the UAV inspection terminal to generate a regular temporal sample set. Then, based on the kinematic model of the UAV inspection terminal, the temporal samples are converted into behavior encoding vectors, and the spatial topology information of the device is fused using a graph convolutional network to generate spatiotemporal fusion features. Further, the spatiotemporal fusion features are input into the Transformer editor, and deep features containing global context information are extracted through multi-head self-attention mechanism, residual connections, layer normalization, and feedforward network. Then, a probabilistic classification model is constructed using Relevance Vector Machine (RVM), and its parameter optimization process is modeled using neural differential equations. Efficient training is performed by combining dynamic sparsity control and adjoint sensitivity methods to obtain a highly sparse RVM model for anomaly detection. Finally, this highly sparse RVM model can be used to detect anomalies in real-time acquired UAV inspection terminal data. Therefore, this application transforms the raw data of UAV inspection into semantically meaningful behavioral sequence codes through behavior encoding to represent the dynamic behavioral patterns during the inspection process. Secondly, it utilizes multimodal Transformer feature extraction, leveraging multi-head attention mechanisms and residual structures to capture the complex global temporal dependencies in the behavior encoding and generate high-dimensional feature vectors. Finally, it employs RVM sparse anomaly detection to construct a probabilistic model, utilizing the sparsity of RVM to achieve feature selection and anomaly probability calculation, thereby improving efficiency while ensuring detection accuracy. This scheme effectively combines the powerful representational capabilities of behavior encoding and Transformer with the probabilistic estimation advantages of RVM, achieving efficient and accurate detection of anomalies in inspection data. Attached Figure Description

[0055] Figure 1 The flowchart illustrates a method for detecting data anomalies in UAV inspection terminals based on behavior coding and Transformer-RVM, as provided in this embodiment of the invention.

[0056] Figure 2 This is a schematic diagram of a UAV inspection terminal data anomaly detection system based on behavior coding and Transformer-RVM, provided as an embodiment of the present invention. Detailed Implementation

[0057] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0058] like Figure 1 As shown, this invention provides a method for detecting data anomalies in UAV inspection terminals based on behavior coding combined with Transformer-RVM. This method may include the following steps:

[0059] S10: Preprocess the raw data from multiple sensor sources from the UAV inspection terminal to generate a regular time-series sample set;

[0060] S20: The kinematic model based on the UAV inspection terminal converts the time-series samples into behavior encoding vectors, and uses graph convolutional networks to fuse device spatial topology information to generate spatiotemporal fusion features;

[0061] S30: Input the spatiotemporal fusion features into the Transformer editor and extract deep features containing global context information through multi-head self-attention mechanism, residual connection, layer normalization and feedforward network;

[0062] S40: A probabilistic classification model is constructed using Relevance Vector Machine (RVM), and its parameter optimization process is modeled using neural differential equations. The model is then trained efficiently by combining dynamic sparsity control and the adjoint sensitivity method, resulting in a highly sparse RVM model for anomaly detection.

[0063] S50: Utilize the highly sparse RVM model to perform anomaly detection on the real-time collected UAV inspection terminal data.

[0064] In this embodiment, the data is first preprocessed to improve the quality of the multimodal data collected by the UAV and the adaptability of the model input. Then, the raw data of the UAV inspection is transformed into semantically meaningful behavioral sequence codes through behavior encoding to represent the dynamic behavioral patterns during the inspection process. Next, multimodal Transformer feature extraction is used, leveraging multi-head attention mechanisms and residual structures to capture the complex global temporal dependencies in the behavior encoding and generate high-dimensional feature vectors. Finally, a probabilistic model is constructed using RVM sparse anomaly detection, utilizing the sparsity of RVM to achieve feature selection and anomaly probability calculation, thereby improving efficiency while ensuring detection accuracy. This scheme effectively combines the powerful representation capabilities of behavior encoding and Transformer with the probabilistic estimation advantages of RVM, achieving efficient and accurate detection of anomalies in inspection data.

[0065] The following section further explains each step of the UAV inspection terminal data anomaly detection method based on behavior coding and Transformer-RVM provided by this invention.

[0066] For step S10: preprocess the raw data from the multi-source sensors of the UAV inspection terminal to generate a regular time-series sample set;

[0067] In this step, the multimodal time-series data (such as gyroscope, accelerometer, and infrared images) collected by the UAV is normalized to eliminate dimensional differences. Wavelet transform is used to remove high-frequency noise and outliers, and sliding window segmentation is used to divide the continuous data stream into fixed-length time-series sample sets to ensure that the subsequent model can effectively capture the dynamic evolution of the time series. Specifically, step S10 can be implemented as follows:

[0068] S11: Z-score normalization is used to normalize the data of each sensor channel to eliminate dimensions;

[0069] In this embodiment, considering the significant differences in data dimensions between different sensors, directly inputting the data into the model would lead to optimization bias. Therefore, Z-score normalization is used to eliminate the influence of dimensions, as specifically expressed below: ;

[0070] in, For the first Raw data from each sensor, and These are its mean and standard deviation, respectively.

[0071] S12: The normalized signal is decomposed using discrete wavelet transform, soft thresholding is performed on the high-frequency details sparse, and the signal is reconstructed after denoising.

[0072] In this embodiment, considering that sensor data often contains high-frequency noise (such as electromagnetic interference) and transient outliers (such as signal loss), we consider using Discrete Wavelet Transform (DWT) for multi-resolution analysis and suppressing noise using a soft thresholding function. Specifically, this can be achieved through the following process:

[0073] S121: The normalized signal is decomposed using the following formula: ;

[0074] in, and These represent the low-frequency and high-frequency components, respectively. DWT stands for Discrete Wavelet Transform. The signal after normalization These are wavelet basis functions;

[0075] S122: For detail coefficients Applying a soft thresholding function to suppress noise is expressed as follows: ;

[0076] Among them, threshold Adaptive calculation based on the Donoho-Johnstone criterion: , The standard deviation of noise. For signal length, The high-frequency component after noise suppression is denoted as x, and sign is the sign function. When x is greater than 0, the sign function is equal to 1; when x is equal to 0, the sign function is equal to 0; when x is less than 0, the sign function is equal to -1.

[0077] S123: The signal is reconstructed using the denoised components, as follows: ;

[0078] Here, IDWT stands for Inverse Discrete Wavelet Transform.

[0079] S13: Perform sliding window segmentation on the denoised and reconstructed signal according to the preset window length L and step size S to generate time-series samples with dimension L×D; where D is the number of sensor channels.

[0080] In this embodiment, the continuous data stream is divided into time-series samples of fixed length to extract local dynamic patterns. Specifically, the window length can be set to L, and the step size to S. Then, the data in the k-th window is: ;

[0081] in, Number of sensor channels, window length The step size is set according to the signal characteristics. Usually taken This operation preserves temporal continuity. It transforms an infinitely long data stream into finite-length batches of data that can be processed by the model, while preserving local temporal patterns.

[0082] S20: The kinematic model based on the UAV inspection terminal converts the time-series samples into behavior encoding vectors, and uses graph convolutional networks to fuse device spatial topology information to generate spatiotemporal fusion features;

[0083] This step aims to enhance and semantically represent time-series data through a behavior encoding module, building upon data preprocessing. This module, combined with the UAV's kinematic model, maps raw sensor data into physically meaningful behavioral primitives, generating feature vectors representing dynamic behavioral patterns. Furthermore, a Graph Convolutional Network (GCN) is introduced to fuse spatial topological information with time-series data, constructing spatiotemporal joint features to enhance the physical interpretability and discriminative power of behavioral features. Specifically, step S20 can be implemented as follows:

[0084] S21: Define the motion primitives of the UAV inspection terminal, and use Kalman filtering to smooth the raw sensor data to obtain the state estimation sequence;

[0085] In this embodiment, specifically in implementation, a six-degree-of-freedom motion primitive of the UAV inspection terminal is defined, including position (three-dimensional translation). ) and attitude (3D rotation: roll) , looking up ,yaw To address sensor noise (such as high-frequency jitter from the accelerometer and drift error from the gyroscope) and obtain a smooth motion state estimate, Kalman filtering is applied to the raw sensor data. The filtering process includes:

[0086] First, based on the state at the previous moment With control input Predict the current state using the state transition matrix A. , means as follows: ;

[0087] in, Let B be the state vector and B be the control input matrix. Q is the control variable, and Q is the process noise covariance matrix characterizing the dynamic uncertainty of the system.

[0088] The predicted observations are then represented as follows: ;

[0089] in, Here, H represents the predicted sensor observations, H is the observation matrix, and R is the observation noise covariance.

[0090] Furthermore, the residuals are weighted and fused based on Kalman gain to obtain a smoothed state estimation sequence; wherein, the residuals are sensor observations. Compared with predicted sensor observations The difference.

[0091] In this embodiment, the state estimation update can be achieved in the following way: ;

[0092] Among them, Kalman gain , Current predicted state The error covariance, The total covariance of the observed residuals is given by the residuals. .

[0093] Thus, the obtained state estimates Recorded as The state estimation sequence is obtained. .

[0094] S22: Calculate the matching distance between the state estimation sequence and each template in the predefined behavior primitive template library using the dynamic time warping algorithm, and convert it into a behavior encoding vector;

[0095] In this step, the behavioral primitive template library contains typical action patterns (such as constant speed, hovering, and sudden stop), and each template consists of a time series of data from multiple sensors. This is used to filter the input sequence. With template Alignment is performed using the DTW algorithm to calculate the minimum cumulative path distance: ;

[0096] in, For the input sequence, the first... point, For the template sequence number point, For Euclidean distance, Indicates before the sequence Before the template The minimum cumulative distance between points. After matching, a behavior encoding vector is generated. (K is the number of primitive categories), each dimension represents the normalized matching confidence of the corresponding primitive. That is, for the filtered sequence The Dynamic Time Warping (DTW) algorithm is used to calculate its relationship with each template T. k minimum path product distance D k Then, a normalized matching confidence score is calculated based on the distance. This forms an encoding vector b, which semantically represents the dominant behavioral pattern within the time window.

[0097] S23: Construct a spatial topology graph of device components, map the behavior encoding vector and sensor data to graph nodes, aggregate neighborhood information through a graph convolutional network, and output a spatiotemporal fusion feature vector.

[0098] In this step, we consider constructing a spatial topology map of equipment components by integrating spatial topology and time-series features. , where nodes Indicates components (such as insulators, bearings), edges This represents physical connections (such as mechanical coupling or electrical connections). The behavior encoding or other relevant features of each node at time t are used as the initial features of that node. A Graph Convolutional Network (GCN) is applied for message propagation and feature aggregation of neighborhood information. The propagation formula for the l-th layer of the GCN is: ;

[0099] in, Add self-connects to the adjacency matrix. For degree matrix, For the first Layer features, For learnable weights, The ReLU activation function is used. Through multi-layer GCN iterations, the final output is a spatiotemporal fusion feature. Capture abnormal patterns in the collaboration between components.

[0100] S30: Input the spatiotemporal fusion features into the Transformer editor and extract deep features containing global context information through multi-head self-attention mechanism, residual connection, layer normalization and feedforward network;

[0101] In this step, the Transformer feature extraction layer employs a multi-head self-attention mechanism. The sequence after behavior encoding is linearly projected to generate query (Q), key (K), and value (V) matrices. Attention scores are calculated using scaled dot products, and weights are normalized using Softmax to efficiently model global dependencies in long sequences. To optimize training stability, the output of each attention layer is residually connected to the input and then normalized to mitigate the vanishing gradient problem. Subsequently, the feedforward network further extracts high-dimensional nonlinear features through two fully connected layers and the GELU activation function, outputting a global temporal representation rich in contextual information. Specifically, step S30 can be implemented as follows:

[0102] S31: Linearly project the input spatiotemporal fusion features into a query matrix Q, a key matrix K, and a value matrix V;

[0103] In this embodiment, the above-mentioned spatiotemporal fusion feature sequence is recorded. If X is the spatiotemporal fusion feature sequence, then X is used as the input sequence and decomposed into h attention heads through linear projection: ;

[0104] Among them, matrix coefficients d is the dimension of the input sequence. k This is the scaling factor.

[0105] S32: Calculate the scaled dot product attention weights and sum them with the value matrix V to obtain the single-head attention output;

[0106] In this embodiment, the attention weight of each head is calculated by scaling the dot product, as follows: ;

[0107] S33: The outputs of multiple attention heads are spliced ​​together, linearly projected, and then residually connected to the input and normalized.

[0108] In this embodiment, the final representation is obtained by splicing the multi-head outputs, performing a linear transformation, and connecting the residuals. ;

[0109] in, To output the projection matrix, this mechanism enables the model to focus on the temporal dependencies of different subspaces in parallel.

[0110] Furthermore, to prevent gradient vanishing in deep networks, residual connections are added to the output of each layer, and layer normalization (Layer Norm) is performed. Layer normalization is performed along the feature dimension: ;

[0111] in, and The mean and standard deviation of the features are given. For learnable parameters, This indicates element-wise multiplication.

[0112] S34: Input the normalization result into the feedforward network and output deep features containing global context information; wherein, the feedforward network contains two fully connected layers and the GELU activation function.

[0113] In this embodiment, the feedforward network (FFN) consists of two fully connected layers and a GELU activation function, used to enhance the model's nonlinear expressive power. ;

[0114] in, Let b1 and b2 represent the weight matrix, and b2 be the bias vectors. The GELU function achieves smooth nonlinear mapping by approximating the Gaussian error linear unit. ;

[0115] Thus, GELU, as the Gaussian error linear unit activation function, outputs the final deep feature F after multiple such Transformer layers are stacked. This process enhances the fitting ability of complex temporal patterns while preserving gradient stability.

[0116] S40: A probabilistic classification model is constructed using Relevance Vector Machine (RVM), and its parameter optimization process is modeled using neural differential equations. The model is then trained efficiently by combining dynamic sparsity control and the adjoint sensitivity method, resulting in a highly sparse RVM model for anomaly detection.

[0117] In the anomaly detection framework of intelligent unmanned inspection terminals, Relevance Vector Machine (RVM) serves as the core module for sparse probability determination, and its performance is highly dependent on the optimization quality of weights and kernel function hyperparameters. While traditional optimization algorithms can achieve Bayesian inference, their discrete iterative characteristics make them prone to getting trapped in local optima, and their computational efficiency is low in high-dimensional parameter spaces. Therefore, this paper introduces Neural Differential Equations (Neural ODEs) to model the RVM optimization process in continuous time. Through the implicit learning mechanism of dynamic systems, adaptive adjustment of parameter evolution trajectories and precise control of sparsity are achieved. Specifically, the Neural Differential Equation optimization algorithm is used to model the parameter optimization process as a continuous-time dynamic system. First, the weights and hyperparameters are initialized, and their time-varying ordinary differential equations (ODEs) are defined. Then, an adaptive ODE solver is used to integrate from the initial time to the final time to obtain the continuous evolution trajectory of the parameters. During the optimization process, by embedding a hyperparameter decay mechanism, when the absolute value of the weight is lower than a preset threshold, the hyperparameters grow exponentially, forcing the corresponding weights to approach zero, thereby achieving real-time parameter pruning and sparsity preservation. Meanwhile, the adjoint sensitivity method is used to solve for the gradient in reverse, avoiding explicit storage of intermediate states and significantly reducing memory usage and computational complexity. Finally, by jointly optimizing the kernel function parameters and model weights, feature discriminative power and anomaly detection accuracy are further improved.

[0118] In one embodiment, step S40 can be implemented as follows:

[0119] S41: Initialize the weight vector, hyperparameter vector, and kernel function parameters of the RVM model, and establish the ordinary differential equations describing the parameter evolution;

[0120] In this embodiment, the neural differential equation model, by optimizing parameters as a continuous-time dynamical system, implicitly describes the parameter evolution trajectory using ordinary differential equations (ODEs), thus overcoming the rigid constraints of discrete iteration. Specifically, weights are defined. With hyperparameters Over time Evolutionary ODE: ;

[0121] Among them, dynamic function Parameterized by the neural network, with the current parameters as input. With loss gradient The output is the instantaneous rate of change of the parameters. By integrating the equation using an adaptive ODE solver (such as Dopri5), the optimization path can be flexibly adjusted to avoid local optima traps.

[0122] S42: Introduce a hyperparameter decay term into the ordinary differential equation. When the absolute value of the weight is lower than a preset threshold, drive the corresponding hyperparameter to grow, so as to achieve dynamic sparsity of the weight.

[0123] In this embodiment, to maintain the sparsity of RVM, a hyperparameter decay term is embedded in ODE to drive the redundant weights to rapidly approach zero: ;

[0124] in, The attenuation rate, For sparsity threshold, This is an indicator function. When the absolute value of the weights is below a threshold, the hyperparameters... Exponential growth forces the corresponding weights The variance of the posterior distribution approaches zero, thus enabling automatic parameter pruning.

[0125] Adaptive optimization of kernel function hyperparameters: kernel function parameters (such as Gaussian kernel bandwidth) polynomial kernel order The optimization of the kernel parameter directly affects the quality of the feature map. Traditional methods require grid search or cross-validation, which are computationally expensive. This paper incorporates the kernel parameter into the joint optimization of the ODE using implicit gradient techniques: ;

[0126] in, The adjoint state is obtained by solving the adjoint equation in reverse. This is the expanded parameter set, including the weights of the core parameters. With hyperparameters It also added a kernel function hyperparameter (Gaussian kernel bandwidth). polynomial kernel order This design achieves end-to-end optimization of kernel parameters and model weights, significantly improving feature discriminative power.

[0127] S43: The gradient of the loss function with respect to the parameters is calculated in reverse using the adjoint sensitivity method to avoid storing intermediate states in the optimization trajectory;

[0128] In this embodiment, traditional backpropagation transmits gradients between discrete layers, while neural differential equations utilize the adjoint method to calculate continuous gradients. The adjoint state is defined. Its evolution satisfies: By solving ODE in the forward direction ( ) and the inverse integral adjoint equation ( It can efficiently calculate the loss against initial parameters and dynamic network parameters. gradient: This method avoids explicitly storing intermediate states, reducing memory usage to [amount missing]. It is particularly suitable for high-dimensional kernel matrix optimization.

[0129] S44: Construct a composite loss function that includes negative log-marginal likelihood and L1 regularization, perform positive integration using an adaptive ODE solver, and combine it with gradient to update the model parameters to obtain the final highly sparse RVM model.

[0130] In this embodiment, considering the composite loss function as a balance between model likelihood and sparsity, the loss function is defined as the negative log marginal likelihood and... Weighted sum of regularization terms: Where y is the label vector and X is the sample feature matrix. The marginal likelihood term is calculated using the Laplace approximation: ,here For the kernel mapping matrix, , .

[0131] Furthermore, the Adam optimizer is used to update the dynamic network parameters. With kernel function parameters (such as) ): ;

[0132] in, and These are the first and second moment estimates after bias correction.

[0133] S50: Utilize the highly sparse RVM model to perform anomaly detection on the real-time collected UAV inspection terminal data.

[0134] After training, for new input sample features, the optimized RVM model is used to calculate the predicted probability that it belongs to the abnormal class. This probability is compared with a preset threshold (e.g., 0.85). If it is greater than the threshold, it is judged as abnormal and an alarm of the corresponding level is triggered; otherwise, it is judged as normal.

[0135] like Figure 2 As shown, the present invention also provides a UAV inspection terminal data anomaly detection system based on behavior coding combined with Transformer-RVM. The system is deployed on the UAV onboard computer or inspection edge computing gateway. The system includes: a time series sample generation module 201, a spatiotemporal fusion feature generation module 202, a deep feature extraction module 203, an RVM model training module 204, and an anomaly detection module 205.

[0136] The time-series sample generation module 201 is configured to preprocess the raw data from multiple sources of sensors from the UAV inspection terminal to generate a regular time-series sample set.

[0137] The spatiotemporal fusion feature generation module 202 is configured to convert the temporal samples into behavior encoding vectors based on the kinematic model of the UAV inspection terminal, and use graph convolutional networks to fuse device spatial topology information to generate spatiotemporal fusion features.

[0138] The deep feature extraction module 203 is configured to input the spatiotemporal fusion features into the Transformer editor and extract deep features containing global context information through multi-head self-attention mechanism, residual connection, layer normalization and feedforward network.

[0139] The RVM model training module 204 is configured to construct a probabilistic classification model using Relevant Vector Machine (RVM), model its parameter optimization process using neural differential equations, and perform efficient training by combining dynamic sparsity control and the adjoint sensitivity method to obtain a highly sparse RVM model for anomaly detection.

[0140] The anomaly detection module 205 is configured to use the highly sparse RVM model to perform anomaly detection on the real-time collected UAV inspection terminal data.

[0141] In one embodiment, the time-series sample generation module 201 is configured to perform the following operations:

[0142] S11: Z-score normalization is used to normalize the data of each sensor channel to eliminate dimensions;

[0143] S12: The normalized signal is decomposed using discrete wavelet transform, soft thresholding is performed on the high-frequency details sparse, and the signal is reconstructed after denoising.

[0144] S13: Perform sliding window segmentation on the denoised and reconstructed signal according to the preset window length L and step size S to generate time-series samples with dimension L×D; where D is the number of sensor channels.

[0145] When executing step S12, the time-series sample generation module 201 is specifically configured to perform the following operations:

[0146] S121: The normalized signal is decomposed using the following formula: ;

[0147] in, and These represent the low-frequency and high-frequency components, respectively. DWT stands for Discrete Wavelet Transform. The signal after normalization These are wavelet basis functions;

[0148] S122: For detail coefficients Applying a soft thresholding function to suppress noise is expressed as follows: ;

[0149] Among them, threshold Adaptive calculation based on the Donoho-Johnstone criterion: , The standard deviation of noise. For signal length, The high-frequency components after noise suppression are represented by sign, where sign is the sign function.

[0150] S123: The signal is reconstructed using the denoised components, as follows: ;

[0151] Here, IDWT stands for Inverse Discrete Wavelet Transform.

[0152] In one embodiment, the spatiotemporal fusion feature generation module 202 is configured to perform the following operations:

[0153] S21: Define the motion primitives of the UAV inspection terminal, and use Kalman filtering to smooth the raw sensor data to obtain the state estimation sequence;

[0154] S22: Calculate the matching distance between the state estimation sequence and each template in the predefined behavior primitive template library using the dynamic time warping algorithm, and convert it into a behavior encoding vector;

[0155] S23: Construct a spatial topology graph of device components, map the behavior encoding vector and sensor data to graph nodes, aggregate neighborhood information through a graph convolutional network, and output a spatiotemporal fusion feature vector.

[0156] In one embodiment, the spatiotemporal fusion feature generation module 202 is specifically configured to perform the following operations when executing step S21:

[0157] Define six-DOF motion primitives for the UAV inspection terminal, including position and attitude; to obtain smooth motion state estimation, apply Kalman filtering to the raw sensor data. The filtering process includes:

[0158] First, based on the state at the previous moment With control input Predict the current state using the state transition matrix A. , means as follows: ;

[0159] in, Let B be the state vector and B be the control input matrix. Q is the control variable, and Q is the process noise covariance matrix characterizing the dynamic uncertainty of the system.

[0160] The predicted observations are then represented as follows: ;

[0161] in, Here, H represents the predicted sensor observations, H is the observation matrix, and R is the observation noise covariance.

[0162] Furthermore, the residuals are weighted and fused based on Kalman gain to obtain a smoothed state estimation sequence; wherein, the residuals are sensor observations. Compared with predicted sensor observations The difference.

[0163] In one embodiment, the deep feature extraction module 203 is configured to perform the following operations:

[0164] S31: Linearly project the input spatiotemporal fusion features into a query matrix Q, a key matrix K, and a value matrix V;

[0165] S32: Calculate the scaled dot product attention weights and sum them with the value matrix V to obtain the single-head attention output;

[0166] S33: The outputs of multiple attention heads are spliced ​​together, linearly projected, and then residually connected to the input and normalized.

[0167] S34: Input the normalization result into the feedforward network and output deep features containing global context information; wherein, the feedforward network contains two fully connected layers and the GELU activation function.

[0168] In one embodiment, the RVM model training module 204 is configured to perform the following operations:

[0169] S41: Initialize the weight vector, hyperparameter vector, and kernel function parameters of the RVM model, and establish the ordinary differential equations describing the parameter evolution;

[0170] S42: Introduce a hyperparameter decay term into the ordinary differential equation. When the absolute value of the weight is lower than a preset threshold, drive the corresponding hyperparameter to grow, so as to achieve dynamic sparsity of the weight.

[0171] S43: The gradient of the loss function with respect to the parameters is calculated in reverse using the adjoint sensitivity method to avoid storing intermediate states in the optimization trajectory;

[0172] S44: Construct a composite loss function that includes negative log-marginal likelihood and L1 regularization, perform positive integration using an adaptive ODE solver, and combine it with gradient to update the model parameters to obtain the final highly sparse RVM model.

[0173] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods in any of the embodiments of the specification.

[0174] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any of the embodiments of the specification.

[0175] Since the system embodiments and method embodiments of the present invention are based on the same inventive concept, detailed descriptions can be found in the method embodiments, and will not be repeated here.

[0176] The modules or units in the device of this invention can be merged, divided, and deleted according to actual needs. The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that implementing all or part of the processes of the above embodiments and making equivalent changes according to the claims of this invention still fall within the scope of the invention.

Claims

1. A method for detecting data anomaly of a UAV inspection terminal based on behavior encoding cooperation with a Transformer-RVM, characterized in that, The method comprises the following steps: S10: preprocessing the multi-source sensor raw data from the unmanned aerial vehicle inspection terminal to generate a regular time series sample set; S20: converting the time series sample into a behavior encoding vector based on the kinematic model of the unmanned aerial vehicle inspection terminal, and generating a spatio-temporal fusion feature by using a graph convolution network to fuse the device space topology information; S30: inputting the spatio-temporal fusion feature into a Transformer editor to extract deep features containing global context information by using a multi-head self-attention mechanism, residual connection, layer normalization and a feedforward network; S40: constructing a probability classification model by using a relevance vector machine (RVM), modeling the parameter optimization process by using a neural differential equation, and combining dynamic sparsity control and the accompanying sensitivity method for efficient training to obtain a highly sparse RVM model for anomaly detection; S50: using the highly sparse RVM model to perform anomaly detection on the real-time collected data of the unmanned aerial vehicle inspection terminal.

2. The method according to claim 1, wherein, The step S10 specifically comprises: S11: performing normalization processing on the data of each sensor channel by using Z-score standardization to eliminate the dimension; S12: decomposing the normalized signal by using a discrete wavelet transform, performing soft threshold denoising on the high-frequency details, and reconstructing the signal after denoising; S13: performing sliding window segmentation on the reconstructed signal after denoising according to a preset window length L and a step size S to generate a time series sample with a dimension of LxD; wherein D is the number of sensor channels.

3. The method of claim 2, wherein the method is based on a behavior coding matching Transformer-RVM for a UAV inspection terminal data anomaly detection. The step S12 specifically comprises: S121: decomposing the normalized signal by using the following calculation formula: ; wherein, and D and D represent low and high frequency components, respectively, and DWT is a discrete wavelet transform, is a normalized signal, is a wavelet basis function; S122: Coefficients of details The soft threshold function is applied to suppress the noise, which is expressed as follows: ; wherein the threshold value is adaptively calculated according to the Donoho-Johnstone criterion: , is the standard deviation of the noise, is the length of the signal, is the high-frequency component after noise suppression, and sign is the sign function. S123: reconstructing the signal after denoising, which is expressed as follows: ; wherein IDWT is an inverse discrete wavelet transform.

4. The method of claim 1, wherein the method is a method of detecting data anomalies of a UAV inspection terminal based on behavior coding cooperation of a Transformer-RVM. The step S20 specifically comprises: S21: defining a motion primitive of the unmanned aerial vehicle inspection terminal, and smoothing the original sensor data by using Kalman filtering to obtain a state estimation sequence; S22: calculating the matching distance between the state estimation sequence and each template in a pre-defined behavior primitive template library by using a dynamic time warping algorithm, and converting it into a behavior encoding vector; S23: constructing a device component space topology graph, mapping the behavior encoding vector and the sensor data to graph nodes, aggregating the neighborhood information by using a graph convolution network, and outputting a spatio-temporal fusion feature vector.

5. The method of claim 4, wherein the method is based on a behavior coding matching Transformer-RVM for a UAV inspection terminal data anomaly detection. The step S21 specifically comprises: defining a six-degree-of-freedom motion primitive of the unmanned aerial vehicle inspection terminal, including position and attitude; to obtain a smooth motion state estimation, applying Kalman filtering to the original sensor data, and the filtering process comprises: First, the state at the previous time instant with the control input The current state is predicted by the state transition matrix A is given by ; wherein is a state vector, B is a control input matrix, is a control quantity, and Q is a process noise covariance matrix representing dynamic uncertainty of the system. Then, the predicted observation value is expressed as follows: ; wherein, is the predicted sensor observation, H is the observation matrix, and R is the observation noise covariance. Further, the residuals are fused by weighting based on Kalman gain to obtain a smoothed state estimation sequence; wherein the residuals are differences between the sensor observation values and the predicted sensor observation values .

6. The method of claim 1, wherein the method is a method of detecting data anomalies of a UAV inspection terminal based on behavior coding cooperation of a Transformer-RVM. The processing of the Transformer in the step S30 specifically comprises: S31: linearly projecting the input spatio-temporal fusion feature into a query matrix Q, a key matrix K and a value matrix V; S32: calculating the scaled dot-product attention weight, and performing weighted summation with the value matrix V to obtain a single-head attention output; S33: concatenating the outputs of multiple attention heads, performing linear projection, and then performing residual connection and layer normalization with the input. S34: input the normalization result into a feedforward network to output deep features containing global context information; wherein the feedforward network contains two fully connected layers and GELU activation functions.

7. The method of claim 6, wherein the method is based on a behavior coding matching Transformer-RVM for a UAV inspection terminal data anomaly detection. In the step S34, the feedforward network and the activation function are represented as follows: ; ; wherein FFN represents the feedforward network, for normalization, GELU is an activation function, W1 and W2 are both weight matrices, and b1 and b2 are both bias vectors.

8. The method of claim 1, wherein the method is a method of detecting data anomalies of a UAV inspection terminal based on behavior coding cooperation of a Transformer-RVM. The step S40 specifically includes: S41: initializing a weight vector, a hyperparameter vector, and a kernel function parameter of an RVM model, and establishing an ordinary differential equation describing parameter evolution; S42: introducing a hyperparameter decay term in the ordinary differential equation, and driving corresponding hyperparameters to grow when the absolute value of the weight is lower than a preset threshold, so as to realize dynamic sparsification of the weight; S43: using the adjoint sensitivity method to reversely calculate the gradient of the loss function on the parameter, to avoid storing the intermediate state in the optimization trajectory; S44: constructing a composite loss function containing a negative log marginal likelihood and an L1 regularization term, using an adaptive ODE solver to perform forward integration, and combining the gradient to update the model parameter, to obtain a final highly sparse RVM model.

9. The method of claim 8, wherein the method is based on a behavior coding matching Transformer-RVM for a UAV inspection terminal data anomaly detection. In the step S42, the evolution of the hyperparameter is controlled by the following formula: ; wherein, is a decay rate, is a hyperparameter, is a weight, is a sparsity threshold, is an indicator function. 10.A UAV inspection terminal data anomaly detection system based on behavior encoding cooperation with a Transformer-RVM, characterized in that, The system is deployed on an unmanned aerial vehicle on-board computer or a patrol edge computing gateway, and the system includes a time series sample generation module, a spatio-temporal fusion feature generation module, a deep feature extraction module, an RVM model training module, and an anomaly detection module; The time series sample generation module is configured to preprocess multi-source sensor raw data from an unmanned aerial vehicle patrol terminal to generate a regular time series sample set; The spatio-temporal fusion feature generation module is configured to convert the time series sample into a behavior encoding vector based on a kinematic model of the unmanned aerial vehicle patrol terminal, and generate spatio-temporal fusion features by using a graph convolution network to fuse device spatial topology information; The deep feature extraction module is configured to input the spatio-temporal fusion features into a Transformer editor, and extract deep features containing global context information by using a multi-head self-attention mechanism, residual connection, layer normalization, and a feedforward network; The RVM model training module is configured to use a relevance vector machine RVM to construct a probabilistic classification model, use a neural differential equation to model the parameter optimization process, and combine dynamic sparsity control and the adjoint sensitivity method to efficiently train a highly sparse RVM model for anomaly detection; The anomaly detection module is configured to use the highly sparse RVM model to perform anomaly detection on real-time collected unmanned aerial vehicle patrol terminal data.