An unmanned aerial vehicle anomaly detection method and system based on latent phase perception

CN122365317BActive Publication Date: 2026-08-21NANCHANG HANGKONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610846688.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-12
Publication Date
2026-08-21
Estimated Expiration
2046-06-12

AI Technical Summary

Technical Problem

然而,与一般工业时序数据相比,无人机飞行数据具有更强的动态性与复杂性:一方面,不同飞行阶段(如起飞、巡航、降落)下系统运行状态差异明显,数据分布呈现显著的时序非平稳特征;另一方面,飞行阶段之间往往存在连续过渡与边界模糊现象,容易使正常工况切换过程表现出类似异常的波动特征;此外,多传感器变量之间还存在复杂的耦合关系,使得异常往往不是单一变量的孤立偏移,而是局部动态失稳与跨变量关联破坏共同作用的结果

Benefits of technology

[0006] Compared to existing technologies, the advantages of this invention are as follows: This invention, through an unsupervised latent stage embedding generation module, adaptively learns the latent operational state context from the input window, transforming the discrete manual stage division problem into a continuous representation learning problem. This enhances the model's adaptability to complex operational changes and effectively distinguishes between normal stage switching and real anomaly deviations. By extracting univariate local temporal features through TCN and combining it with the Phase-FiLM Token fusion mechanism, local dynamic features, stage context information, and variable semantic information are uniformly mapped to a variable-level representation space. Furthermore, by using iTransformer to model cross-variable global dependencies, collaborative modeling of local and global, multi-source and multi-scale information is achieved. Through joint optimization of reconstruction and prediction tasks, representation learning is constrained from both "current observation recovery capability" and "future evolution modeling capability," overcoming the limitations of single-task anomaly detection and providing a more comprehensive basis for judging complex flight anomalies. This invention has significant advantages in detection robustness and system cost, and is particularly suitable for scenarios with extremely high real-time and reliability requirements, such as UAV flight safety monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122365317B_ABST
    Figure CN122365317B_ABST
Patent Text Reader

Abstract

The application provides a kind of unmanned aerial vehicle anomaly detection method and system based on potential phase perception, method includes determining input window sequence;Each window in input window sequence is carried out unsupervised potential phase perception, and stage embedding vector is generated;Local time series coding is carried out to single variable sequence, and local time series representation is obtained;Variable level Token sequence is constructed by phase perception Token fusion mechanism;Variable level Token sequence is input to encoder for global dependence modeling, and high-level semantic representation is obtained;By reconstruction branch and prediction branch, reconstruction error and prediction error are calculated respectively, and the two are weighted and fused to obtain anomaly score, if anomaly score is greater than preset threshold, then it is judged that current window exists anomaly.The application does not need artificial phase label, effectively distinguishes normal working condition switching and real anomaly, while taking into account local dynamics and global coupling, detection accuracy is high, robustness is strong, and is suitable for unmanned aerial vehicle flight safety monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of UAV flight safety and fault detection, specifically relating to a method and system for UAV anomaly detection based on potential phase perception. Background Technology

[0002] With the widespread application of unmanned aerial vehicle (UAV) systems in scenarios such as inspection and monitoring, emergency rescue, target reconnaissance, and autonomous flight, their operational safety and mission reliability have received increasing attention. During flight, UAVs continuously generate a large amount of multivariate time-series data composed of various sensors, including those monitoring attitude, position, speed, control variables, and battery status. This flight data not only contains rich information about the system's operational status but also provides an important data foundation for anomaly detection and fault early warning. However, compared to general industrial time-series data, UAV flight data exhibits greater dynamism and complexity: on the one hand, the system's operational status varies significantly across different flight phases (such as takeoff, cruise, and landing), and the data distribution shows significant time-series non-stationary characteristics; on the other hand, there are often continuous transitions and blurred boundaries between flight phases, which can easily cause the normal operating condition switching process to exhibit anomaly-like fluctuations; furthermore, there are complex coupling relationships between multiple sensor variables, meaning that anomalies are often not isolated shifts of a single variable but rather the result of the combined effects of local dynamic instability and the disruption of cross-variable correlations.

[0003] While existing UAV anomaly detection methods based on latent phase perception can identify obvious fault modes to some extent, they still have shortcomings when faced with the aforementioned complex characteristics. Existing research typically uses residual thresholds, reconstruction errors, or prediction errors to identify anomalous deviations in flight data. However, these methods still heavily rely on error distribution or threshold boundaries, lacking explicit modeling of flight phase changes and operational condition transitions. Consequently, they struggle to adequately adapt to non-stationary changes during flight and are prone to misclassifying normal fluctuations caused by phase transitions such as takeoff, turns, cruise, and landing as anomalies. Furthermore, while existing deep learning methods can leverage neural networks to enhance feature representation capabilities, they still face two problems in modeling complex UAV flight data: first, the lack of explicit modeling of the underlying operational state context makes it difficult to distinguish between "normal distribution migration caused by phase changes" and "abnormal deviations caused by system anomalies"; second, the difficulty in simultaneously considering joint modeling of univariate local dynamic patterns and multivariate global dependencies limits the ability to express complex flight anomalies. Furthermore, anomaly detection strategies that rely solely on reconstruction or prediction tasks essentially measure the degree of anomaly from only a single perspective, making it difficult to comprehensively depict the manifestations of UAV anomalies at both the "deviation from the current state" and "instability in future evolution" levels. Summary of the Invention

[0004] To address the aforementioned technical issues, this invention proposes a method and system for detecting unmanned aerial vehicle (UAV) anomalies based on latent stage perception. Through unsupervised latent stage perception, local temporal coding, global dependency modeling, and a multi-task collaborative mechanism of reconstruction-prediction joint optimization, it can effectively distinguish between normal operating condition switching and real anomaly deviations, thereby improving the detection capability and stability of complex UAV flight anomalies.

[0005] In a first aspect, the present invention provides the following technical solution: a method for detecting anomalies in unmanned aerial vehicles (UAVs) based on potential stage perception, comprising: Acquire multivariate flight data of the UAV and obtain the input window sequence through sliding window processing; Unsupervised latent stage perception is performed on each window in the input window sequence to generate a stage embedding vector containing semantic information of the running state. Local temporal encoding is performed on the univariate sequence of each sensor variable within each window to obtain a local temporal representation; Based on the stage embedding vector and the local temporal representation, a variable-level token sequence is constructed through a stage-aware token fusion mechanism. The variable-level token sequence is input into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation. Based on the high-level semantic representation, the reconstruction error and prediction error are calculated by the reconstruction branch and the prediction branch respectively, and the two are weighted and fused to obtain an anomaly score. If the anomaly score is greater than a preset threshold, it is determined that the current window is abnormal.

[0006] Compared to existing technologies, the advantages of this invention are as follows: This invention, through an unsupervised latent stage embedding generation module, adaptively learns the latent operational state context from the input window, transforming the discrete manual stage division problem into a continuous representation learning problem. This enhances the model's adaptability to complex operational changes and effectively distinguishes between normal stage switching and real anomaly deviations. By extracting univariate local temporal features through TCN and combining it with the Phase-FiLM Token fusion mechanism, local dynamic features, stage context information, and variable semantic information are uniformly mapped to a variable-level representation space. Furthermore, by using iTransformer to model cross-variable global dependencies, collaborative modeling of local and global, multi-source and multi-scale information is achieved. Through joint optimization of reconstruction and prediction tasks, representation learning is constrained from both "current observation recovery capability" and "future evolution modeling capability," overcoming the limitations of single-task anomaly detection and providing a more comprehensive basis for judging complex flight anomalies. This invention has significant advantages in detection robustness and system cost, and is particularly suitable for scenarios with extremely high real-time and reliability requirements, such as UAV flight safety monitoring.

[0007] Preferably, the step of performing unsupervised latent stage awareness on each window in the input window sequence to generate a stage embedding vector containing runtime state semantic information includes: For the m-th input window First, through the encoding function Extracting window-level implicit representation , L represents the window-level feature dimension, where L is the window length and N is the number of sensor variables. Through two parallel fully connected layers , Estimate the mean vector of the distribution of the latent variables respectively and scale parameters , The dimensions are defined as latent variables, and the standard deviation vector is obtained using the Softplus function. ; Employing reparameterization techniques from conditional distributions Mid-sampling yields latent representations ,in This represents element-wise multiplication; The latent representation is mapped to a stage probability distribution through a softmax soft allocation layer. ,in This is the first learnable weight matrix. Let C be the first bias vector, and C be the preset number of stage categories. This represents the soft assignment probability that the m-th window belongs to the c-th potential stage prototype; Introducing a learnable stage embedding matrix Generate stage embedding vectors based on the stage probability distribution. , where d is the embedding dimension.

[0008] Preferably, the step of performing local temporal encoding on the univariate sequence of each sensor variable within each window to obtain a local temporal representation includes: For the m-th input window Let the univariate sequence corresponding to the i-th variable be denoted as . , L is the window length, and N is the number of sensor variables; Temporal convolutional networks using shared parameters Encode each variable sequence to obtain the first... Local temporal representation of variables d is the embedding dimension.

[0009] Preferably, the step of constructing a variable-level token sequence based on the stage embedding vector and the local temporal representation through a stage-aware token fusion mechanism includes: Set a learnable variable identity embedding vector for each sensor variable. ,in Embed a lookup table for the variable; For the stage embedding of the m-th window FiLM modulation parameters are generated through learnable linear mappings: Divide the output into scaling factors and offset factor The scaling factor is then obtained by limiting the scaling range using the tanh function. ,in, This is the second learnable weight matrix. Let d be the second bias vector, and d be the embedding dimension; Local temporal representation of the i-th variable By performing phase modulation and fusing variable identity information, a variable-level token is obtained. : ; In the formula, This represents element-wise multiplication. The modulation intensity coefficient is the stage modulation intensity coefficient. Stack the tokens corresponding to all variables within the window according to the variable dimension to obtain the variable-level token sequence for the m-th window. N is the number of sensor variables.

[0010] Preferably, the step of inputting the variable-level token sequence into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation includes: The variable-level token sequence As input to the iTransformer encoder, the global dependencies between multiple sensors are modeled in the variable dimension through the self-attention mechanism and feedforward network in the encoder, resulting in a high-level variable-level representation: , In the formula, This represents the iTransformer encoding process. The i-th row The i-th variable is a high-level variable-level representation that integrates local temporal information, stage context information, and cross-variable global dependencies. N is the number of sensor variables, and d is the embedding dimension.

[0011] Preferably, the step of calculating the reconstruction error and prediction error based on the high-level semantic representation through the reconstruction branch and prediction branch respectively, and then weightedly fusing the two to obtain the anomaly score includes: For the high-level variable representation of the i-th variable By reconstructing the mapping function Get the reconstruction result of the current window And by predicting the mapping function Obtain the prediction results for the next H time steps. L is the window length; Define reconstruction loss Compared with predicted loss They are respectively: ; ; In the formula, This represents the summation of element-wise squared errors. For all The reconstructed windows obtained by stacking For the true future sequence, For all The predicted sequences obtained by stacking Let N be the m-th input window, and N be the number of sensor variables; During the inference phase, the reconstruction error score is calculated separately. and prediction error score : , , In the formula, This represents the summation of element-wise absolute errors. and The actual reconstruction and prediction results output by the model; The two scores are weighted and combined to obtain the final anomaly score. ,in and These are the weighting coefficients for reconstruction error and prediction error, respectively.

[0012] Preferably, the method further includes introducing a KL divergence regularization term during the model training phase. Constrain the potential distribution: ; In the formula, and The first The first window The mean and standard deviation of the dimension, Let KL divergence be the KL divergence. For conditional distribution, For potential representation, For the m-th input window, For the dimension of latent variables; The overall loss function of the model is: Where M is the total number of training windows, The weighting coefficients for the KL divergence term are... and These are the weighting coefficients for reconstruction error and prediction error, respectively.

[0013] Secondly, the present invention provides the following technical solution: a drone anomaly detection system based on potential stage perception, the system comprising: The processing module is used to acquire multivariate flight data of the UAV and obtain the input window sequence through sliding window processing; The perception module is used to perform unsupervised latent stage perception on each window in the input window sequence and generate a stage embedding vector containing semantic information of the running state. The encoding module is used to perform local time-series encoding on the univariate sequences of each sensor variable within each window to obtain a local time-series representation; The sequence module is used to construct a variable-level token sequence based on the stage embedding vector and the local temporal representation through a stage-aware token fusion mechanism. The building module is used to input the variable-level token sequence into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation; An anomaly module is used to calculate the reconstruction error and prediction error respectively through the reconstruction branch and the prediction branch based on the high-level semantic representation, and to obtain an anomaly score by weighted fusion of the two. If the anomaly score is greater than a preset threshold, it is determined that there is an anomaly in the current window.

[0014] Thirdly, the present invention provides the following technical solution: a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for detecting unmanned aerial vehicle anomalies based on potential stage perception.

[0015] Fourthly, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described method for detecting unmanned aerial vehicle anomalies based on latent stage perception. Attached Figure Description

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

[0017] Figure 1The flowchart shows the UAV anomaly detection method based on latent stage perception provided in Embodiment 1 of the present invention. Figure 2 This is a general framework diagram of the UAV anomaly detection method based on latent stage perception provided in Embodiment 1 of the present invention; Figure 3 Anomaly score graphs for the three methods provided in Embodiment 1 of the present invention; Figure 4 This is a structural block diagram of the UAV anomaly detection system based on latent stage perception provided in Embodiment 2 of the present invention; Figure 5 This is a schematic diagram of the hardware structure of a computer provided for another embodiment of the present invention.

[0018] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain embodiments of the present invention, and should not be construed as limiting the present invention.

[0020] Example 1 In Embodiment 1 of the present invention, as Figure 1 , Figure 2 As shown, a method for detecting anomalies in unmanned aerial vehicles (UAVs) based on latent phase perception includes: S1. Acquire multivariate flight data of the UAV and obtain the input window sequence through sliding window processing; Specifically, during flight, drones continuously generate multivariate time-series data composed of various sensors, including those for attitude, position, velocity, control variables, and battery status. The raw data, collected synchronously from multiple sensors, is characterized by numerous variable dimensions, inconsistent sampling frequencies, significant differences in units of measurement, and substantial noise interference. Directly inputting this raw data into the model can easily affect the stability and effectiveness of subsequent representation learning. Therefore, this invention first performs necessary feature filtering on the raw flight data, retaining core variables that characterize flight status and abnormal behavior; then, it resamples data from different sources to a unified time axis, imputing missing values ​​generated during resampling using interpolation; finally, it employs normalization to eliminate differences in units of measurement between different variables. After these processes, the raw flight data is converted into a unified format of multivariate time series data. Where T represents the total number of time steps in the entire flight sequence, and N represents the number of sensor variables. Let represent the multivariate observation vector at time step t.

[0021] After segmenting the sequence using a sliding window method, the m-th input window is denoted as... Where m represents the window number, L represents the window length, and N represents the number of variables. In this embodiment, the window length L is set to 60 (corresponding to 6 seconds of data, sampling frequency 10Hz), and the sliding window step size is set to 1.

[0022] S2. Perform unsupervised latent stage perception on each window in the input window sequence to generate a stage embedding vector containing semantic information of the running state. Step S2 includes: S21. For the m-th input window First, through the encoding function Extracting window-level implicit representation , L represents the window-level feature dimension, where L is the window length and N is the number of sensor variables. Specifically, in order to extract overall operating condition information from the window level, the encoding function is first used. Feature mapping is performed on the input window to obtain the window-level latent representation. ,in The window-level feature dimension is set to 128 in this embodiment. Implemented by a multilayer perceptron, it includes two layers of linear mapping (input dimension L×N→256→128), the GELU activation function, and Dropout regularization (Dropout rate 0.2), which are used to compress the original two-dimensional temporal window into a window-level implicit representation.

[0023] S22, through two parallel fully connected layers , Estimate the mean vector of the distribution of the latent variables respectively and scale parameters , The dimensions are defined as latent variables, and the standard deviation vector is obtained using the Softplus function. ; S23. Employing reparameterization techniques from conditional distributions Mid-sampling yields latent representations ,in This represents element-wise multiplication; Specifically, due to the transitional and uncertain nature of flight phases, this invention does not directly classify the phases but instead models them as a latent random variable. Specifically, for the m-th window, two parallel branches are used to estimate the mean and scaling parameters of the latent variable distribution: , ,in This represents the dimension of the latent variable, which is set to 16 in this embodiment; and These represent the mapping functions for the output mean and scale parameter, respectively, implemented by a fully connected layer (128→16). The scale parameter is ensured to be positive using the Softplus function. ,in Let represent the standard deviation vector of the latent distribution corresponding to the m-th window. This defines the conditional distribution. .

[0024] S24. Map the latent representation to a stage probability distribution using a Softmax soft allocation layer. ,in This is the first learnable weight matrix. Let C be the first bias vector, and C be the preset number of stage categories. This represents the soft assignment probability that the m-th window belongs to the c-th potential stage prototype; In order to enable the random sampling process to participate in backpropagation training, this invention employs a reparameterization technique to sample from the aforementioned Gaussian distribution to obtain the latent representation of the m-th window. .

[0025] Due to latent variables Lacking direct interpretability, it is further mapped to a stage probability space. Specifically, the latent stage probability distribution is obtained through a Softmax soft allocation layer. ,in Represents a learnable linear mapping matrix. This represents the bias vector, and C represents the preset number of stage categories. In this embodiment, C is set to 4 by default. This represents the soft assignment probability that the m-th window belongs to the c-th potential stage prototype, satisfying... .

[0026] S25. Introduce a learnable stage embedding matrix. Generate stage embedding vectors based on the stage probability distribution. , where d is the embedding dimension; In order to incorporate stage information into subsequent models, this invention introduces a learnable stage embedding matrix. And generate stage embedding vectors based on stage probability distribution. Where d is the embedding dimension, which is set to 256 in this embodiment; during the training phase, in order to model the uncertainty of the training phase, the latent variables... Random sampling is required; however, during the inference phase, anomaly detection needs to maintain stable results, so random noise is no longer introduced. Instead, the mean of the latent distribution is directly used as a deterministic representation. The stage probability distribution and stage embedding are then calculated in the same way.

[0027] S3. Perform local time-series encoding on the univariate sequences of each sensor variable within each window to obtain a local time-series representation; Step S3 includes: S31. For the m-th input window Let the univariate sequence corresponding to the i-th variable be denoted as . , L is the window length, and N is the number of sensor variables; S32. Temporal convolutional networks using shared parameters Encode each variable sequence to obtain the first... Local temporal representation of variables d is the embedding dimension; Specifically, for the m-th input window Let the univariate sequence corresponding to the i-th variable be denoted as . , To extract local dynamic patterns within variables, this invention employs a shared-parameter temporal convolutional network (TCN) to encode each variable sequence, obtaining the local temporal representation of the i-th variable. ; In this embodiment, the TCN contains four residual blocks, each containing two dilated convolutional layers with dilation rates of 1, 2, 4, and 8, and a kernel size of 3. Each dilated convolutional layer is followed by weight normalization, a ReLU activation function, and Dropout (with a Dropout rate of 0.2). Residual connections directly add the input to the convolutional output. The TCN output undergoes global average pooling, linear mapping (mapping the pooled features from the number of TCN channels to 256 dimensions), and layer normalization to obtain a fixed-dimensional local temporal embedding.

[0028] S4. Based on the stage embedding vector and the local temporal representation, construct a variable-level token sequence through a stage-aware token fusion mechanism; Step S4 includes: S41. Set a learnable variable identity embedding vector for each sensor variable. ,in Embed a lookup table for the variable; S42, Stage embedding for the m-th window FiLM modulation parameters are generated through learnable linear mappings: Divide the output into scaling factors and offset factor The scaling factor is then obtained by limiting the scaling range using the tanh function. ,in, This is the second learnable weight matrix. Let d be the second bias vector, and d be the embedding dimension. S43. Local temporal representation of the i-th variable By performing phase modulation and fusing variable identity information, a variable-level token is obtained. : ; In the formula, This represents element-wise multiplication. The modulation intensity coefficient is the stage modulation intensity coefficient. Specifically, in order to improve the stability of the token representation, the present invention further normalizes and randomly deactivates the fused representation. Therefore, after step S43, it is necessary to normalize and randomly deactivate the variable-level token.

[0029] S44. Stack the tokens corresponding to all variables within the window according to the variable dimension to obtain the variable-level token sequence of the m-th window. N is the number of sensor variables; Specifically, after obtaining the variable-level token sequence, the original multivariate time window has been converted into a representation matrix consisting of N variable-level tokens.

[0030] S5. Input the variable-level token sequence into the iTransformer encoder to perform global dependency modeling and obtain a high-level semantic representation; Step S5 includes: The variable-level token sequence As input to the iTransformer encoder, the global dependencies between multiple sensors are modeled in the variable dimension through the self-attention mechanism and feedforward network in the encoder, resulting in a high-level variable-level representation: , In the formula, This represents the iTransformer encoding process. The i-th row For the i-th variable, a high-level variable-level representation is formed by fusing local temporal information, stage context information and cross-variable global dependencies, where N is the number of sensor variables and d is the embedding dimension. In this embodiment, the iTransformer encoder contains four identical coding layers. Each coding layer contains a multi-head self-attention sublayer (the number of attention heads is set to 8, and the dimension of each head is 256 / 8=32) and a feedforward network sublayer (the feedforward network dimension is...). (Set to 1024, i.e., 4 times the embedding dimension). Each sublayer is followed by layer normalization and residual connections. The feedforward network consists of two linear transformations and a GELU activation function.

[0031] S6. Based on the high-level semantic representation, the reconstruction error and prediction error are calculated by the reconstruction branch and the prediction branch respectively, and the two are weighted and fused to obtain an anomaly score. If the anomaly score is greater than a preset threshold, it is determined that the current window is abnormal.

[0032] Step S6 includes: S61. High-level variable representation for the i-th variable. By reconstructing the mapping function Get the reconstruction result of the current window And by predicting the mapping function Obtain the prediction results for the next H time steps. L is the window length; S62. Define the reconstruction loss Compared with predicted loss They are respectively: ; ; In the formula, This represents the summation of element-wise squared errors. For all The reconstructed windows obtained by stacking For the true future sequence, For all The predicted sequences obtained by stacking Let N be the m-th input window, and N be the number of sensor variables; S63. During the inference phase, calculate the reconstruction error score respectively. and prediction error score : , , In the formula, This represents the summation of element-wise absolute errors. and The actual reconstruction and prediction results output by the model; S64. Weighted fusion of the two results yields the final anomaly score. ,in and These are the weighting coefficients for reconstruction error and prediction error, respectively.

[0033] Specifically, the method also includes introducing a KL divergence regularization term during the model training phase. Constrain the potential distribution: ; In the formula, and The first The first window The mean and standard deviation of the dimension, Let KL divergence be the KL divergence. For conditional distribution, For potential representation, For the m-th input window, For the dimension of latent variables; The overall loss function of the model is: Where M is the total number of training windows, Here are the weighting coefficients for the KL divergence term, which are set to 0.001 in this embodiment. and These are the weighting coefficients for the reconstruction error and the prediction error, respectively, which are set to 0.5 and 0.5 in this embodiment. Finally, anomaly detection is completed by comparing thresholds: ,in In this embodiment, the 99th percentile of the abnormal scores of normal samples in the validation set is used as the global detection threshold.

[0034] During the model training phase, the overall loss function is: ,in The weight coefficient for the KL divergence term is set to 0.001 in this embodiment. During model training, the batch size is set to 64, the number of training epochs is set to 30, the optimizer is Adam, the initial learning rate is set to 0.001, and a cosine annealing learning rate scheduling strategy is used. During training, after each epoch, the anomaly detection performance is calculated on the validation set, and the model parameters with the best performance on the validation set are saved for testing.

[0035] To further verify the effectiveness of the present invention, the present invention was demonstrated through the following experiments under different abnormal drone scenarios.

[0036] Dataset: First, this paper uses the ALFA (AirLab Failure and Anomaly) dataset released by Carnegie Mellon University's AirLab. This dataset is designed for research on fault and anomaly detection in fixed-wing UAVs, providing 47 processed time-series data segments from real autonomous flights. It covers eight types of sudden actuator anomalies, including engine failure and control surface failures such as aileron, rudder, and elevator. Compared to datasets containing only a single anomaly pattern, ALFA includes both power system anomalies and control surface anomalies, better reflecting the impact of multiple types of faults on multi-sensor time-series signals in real flight missions. Therefore, it is suitable as an important benchmark for validating the model's ability to perceive complex flight anomalies.

[0037] Secondly, this paper uses the UAVAttackDataset (hereinafter referred to as GPSAttack) published by IEEE DataPort. This dataset is derived from real flight time-series logs and includes both normal flight and attack flight data. The attack samples are represented by navigation layer attacks such as GPS spoofing, and it also records information from key sensor channels such as GNSS and IMU. This dataset has been used in many UAV intrusion detection and sensor attack identification studies and can effectively evaluate the model's ability to identify adversarial anomalies at the navigation layer. Unlike ALFA, which mainly focuses on mechanical components and control anomalies, GPSAttack emphasizes the disturbances of external attacks on the navigation perception link, and therefore can be used to examine the model's generalization performance under different anomaly mechanisms.

[0038] Simulation Dataset (referred to as Raw Dataset in this paper): This study constructs an electromechanical coupling simulation model of a UAV actuator based on Simulink, used for input commands. The model simulates the dynamic response of the actuator under normal and abnormal operating conditions and generates abnormal detection data. The model uses the front-end transfer function num(s) / den(s) to describe the actuator's main dynamics, obtaining the position signal, and then using a differential element to obtain velocity and acceleration. Simultaneously, related parameters are used to construct torque, current, and voltage responses, forming a state propagation chain of "input—position—velocity—acceleration—torque—current—voltage". The model ultimately outputs six time-series signals: position, velocity, acceleration, torque, current, and voltage, which are saved as a continuous flight record via ToWorkspace. Based on this, a controllable fault is injected after the normal operation period. By setting the fault occurrence time, anomaly amplitude severity, and rampSec, anomaly modes such as jam, failure, and their composite faults are generated, thus forming a simulation dataset of "normal first, then anomaly". This provides a unified data foundation for the construction of subsequent normal training sets and anomaly detection test sets. The simulation model is constructed in Simulink as shown in the figure. In general, these three datasets correspond to three typical application scenarios: "component failure / control anomaly - navigation attack - simulation anomaly". They can verify the detection effect and generalization ability of the proposed method on multivariable UAV time-series anomalies from different dimensions.

[0039] Data processing: Due to differences in sampling frequency, field naming, timestamp format, and label organization among the three datasets, this paper performed unified preprocessing on the raw data before the experiment to ensure that different data sources could be trained and tested within the same experimental framework. The preprocessing process mainly includes steps such as time alignment, feature selection, missing value handling, label construction, standardization, and sliding window segmentation.

[0040] First, the raw flight logs undergo field organization and feature filtering. Addressing the issue of inconsistent available sensor fields across different data sources, this paper retains multivariate time-series features closely related to flight status perception and anomaly detection, and standardizes field names and data formats to ensure consistency across different datasets at the input level. Invalid columns, constant columns, or auxiliary fields not directly related to the detection target are removed during the preprocessing stage.

[0041] Secondly, the time series is uniformly aligned and resampled. Since the sampling intervals of the original flight logs may not be strictly consistent, this paper resamples the data at a uniform sampling frequency of 10Hz and reconstructs a uniform timeline based on timestamps, thereby mitigating the time series deviation caused by inconsistent sampling between different flight records. For missing values ​​appearing after resampling, a combination of interpolation and forward / backward padding is used to fill in the missing values, in order to maintain temporal continuity as much as possible.

[0042] Next, the anomaly labels are organized and constructed. For datasets that already contain point-level labels in the original data, this paper uniformly converts them into binary label format, where 0 represents normal and 1 represents anomaly. For records where anomalies only occur in the latter half of the flight or are indirectly given by the fault status field, corresponding point-level anomaly labels are generated based on the fault status change interval. After this processing, each flight record is represented in a unified format of "multivariate sensor sequence + corresponding time step anomaly label".

[0043] Regarding data normalization, this paper only uses the mean and standard deviation of each feature from normal samples during the training phase, and then uses this to standardize the training set, validation set, and test set. This strategy avoids the leakage of test data distribution information into the training phase, and also enables outlier scores to more objectively reflect the degree of deviation from the normal pattern.

[0044] Experimental Setup: All experiments in this paper were implemented within a unified deep learning framework. The experimental platform was PyTorch:2.11.0+cu126, and the hardware environment was an NVIDIA GeForce RTX 3060 Laptop GPU. During model training, the input sequence length was set to 60, the prediction length to 10, the sliding window step size to 1, the batch size to 64, the number of training epochs to 30, and the optimizer to Adam. Experiments were conducted on ALFA, GPSAttack, and a simulation dataset. For the ALFA dataset, normal data from multiple flights were used for training, and four typical fault types were selected as evaluation objects: engine_failure, elevator_failure, rudder_right_failure, and rudder_left_failure, covering anomaly types such as engine failure, elevator failure, and rudder failure. The above records cover power system anomalies and control surface anomalies, and can well reflect the abnormal change characteristics of fixed-wing UAVs under critical actuator failures. For the GPSAttack dataset, this paper selects spoofing anomalies as the test anomaly sequence to evaluate the model's detection capability in GPS spoofing attack scenarios. This setting mainly focuses on the anomalous perturbations caused by navigation layer attacks to the time-series signals of UAV multi-sensor systems, thereby verifying the model's effectiveness in GPS spoofing anomaly scenarios. For simulation data, we train the model on normal data generated from the simulation and test it with jam and a composite anomaly. In the anomaly detection phase, this paper first calculates the corresponding anomaly score based on the model output, and then determines the detection threshold using the score distribution of normal samples on the validation set. To ensure the stability and reproducibility of the threshold setting, this paper uses the 99th percentile of the anomaly scores of normal samples in the validation set as the global detection threshold. This approach does not rely on the label information of the test set and can better balance the issues of false positives and false negatives.

[0045] For different datasets, this paper follows a unified training-validation-testing process. The training set is used for model parameter learning, the validation set is used for model selection and threshold setting, and the test set is only used for final performance evaluation. In datasets containing multiple flight records, the training, validation, and test sets are divided according to the flight record level. For datasets that have been merged into a single training file, the training and validation segments are divided according to time sequence to avoid information leakage caused by window-level random mixing.

[0046] Under conditions of low anomaly rate and strong sequence correlation, this paper adopts an unsupervised threshold setting method based on the validation set score distribution. Specifically, it uses a specified quantile of the anomaly score at the validation set level as the global detection threshold, avoiding optimistic bias caused by parameter tuning on the test set. To comprehensively evaluate the effectiveness of the anomaly detection method, this paper uses the following metrics: Rec (recall), F1 (F1 score), and ACC (accuracy): ; ; ; ; In the formula, TP represents correctly detected anomalies, FN represents undetected anomalies, FP represents normal samples incorrectly labeled as anomalies, and TN represents correctly identified normal samples. For accuracy; Comparative experiment: To comprehensively evaluate the anomaly detection performance of the method (PA-ViTAD) on different datasets, as shown in Table 1, this paper compares it with baseline models such as CNNLSTM, MLP, BiLSTM, TranAD, dcdetector, USAD and timesnet on the ALFA, GPSattack and RAW datasets, and conducts a comprehensive analysis based on the above three metrics. Table 1

[0047] As shown in Table 1, the experimental results on the ALFA dataset demonstrate that the proposed PA-ViTAD method achieves the best detection performance, with F1, ACC, and Rec scores of 0.9107, 0.9763, and 0.8692, respectively, all higher than other comparative models. Among the comparative methods, DCdetector is the best performing model with an F1 score of 0.8497 and a Recall score of 0.7388, but still significantly lower than the proposed method. This indicates that in fixed-wing UAV fault and anomaly scenarios, the proposed method can more fully model flight phase changes, local temporal features, and dependencies between multivariable sensors, thereby improving the ability to identify complex anomalies such as engine failure and control surface malfunction.

[0048] On the GPSAttack dataset, all models exhibit high overall performance, indicating that navigation attack anomalies in this dataset are relatively separable. However, our proposed method still achieves the best results, with F1, ACC, and Rec scores of 0.9730, 0.9926, and 0.9474, respectively. Compared to the well-performing DCdetector, our method shows further improvements in F1 and Rec, demonstrating that PA-ViTAD also possesses good detection stability and anomaly recognition capabilities in navigation attack scenarios. In particular, the improved Rec score indicates that our method can detect more genuine anomalies, helping to reduce the risk of missed detections in UAV anomaly detection.

[0049] On the RAW simulation dataset, the overall performance of each model is significantly lower than that of the ALFA and GPSAttack datasets, indicating that the anomaly patterns in this dataset are more complex and more difficult to detect. USAD, MLP, and TimesNet all have an F1 score of 0.2610 and a Rec score of 0.2219, indicating that these methods are weak in recognizing simulation degradation anomalies. CNNLSTM has an F1 score of 0.3076, BiLSTM has an F1 score of 0.5210, and DCdetector has an F1 score of 0.4953. Although these are improvements compared to some baselines, the overall Rec score is still low, indicating that they still have some missed detection issues. TranAD performs well on the RAW dataset, with F1, ACC, and Rec scores of 0.6005, 0.7421, and 0.5050, respectively, indicating that the two-stage residual-aware reconstruction mechanism can effectively capture some anomaly patterns. In comparison, our proposed method achieved the best results, with F1, ACC, and Rec scores of 0.6099, 0.7490, and 0.5834, respectively, outperforming other baseline models in all three metrics. Particularly noteworthy is the 0.0784 improvement in Rec compared to TranAD, indicating that our method can identify more real anomalies and possesses stronger anomaly detection capabilities in simulation degradation anomaly detection tasks. The experimental results across three datasets demonstrate that our proposed method achieves superior detection performance in mechanical failure anomalies, navigation attack anomalies, and simulation degradation anomaly scenarios. Compared to baseline models that rely solely on reconstruction errors, prediction errors, or a single temporal modeling structure, PA-ViTAD, by introducing latent stage-aware modeling, TCN local temporal coding, variable-level iTransformer global dependency modeling, and a joint reconstruction-prediction optimization mechanism, can more comprehensively characterize normal patterns and anomalous deviations in UAV multivariate temporal data. Therefore, our proposed method exhibits better adaptability and generalization capabilities in different types of UAV anomaly detection tasks.

[0050] Anomaly detection experiment: To further intuitively analyze the detection behavior of different models before and after anomalies occur, such as Figure 3 As shown, this paper selects the same test flight sequence and plots the anomaly scores and detection threshold variation curves of usad, bilstm, and the proposed method PA-ViTAD. The blue curve represents the anomaly score during the normal phase, the red curve represents the time period judged as anomaly by the model, the red dashed line represents the detection threshold, and the light yellow area represents the true anomaly interval.

[0051] from Figure 3 As can be seen, the anomaly scores of all three methods increased to varying degrees after the occurrence of a real anomaly, indicating that the models can capture changes in flight status after a failure. However, the anomaly scores of BiLSTM and USAD still fluctuated somewhat during the normal phase, and the response when the score exceeded the threshold was not stable at the beginning of the anomaly, easily leading to detection lag or short-term misjudgment. In contrast, the PA-ViTAD method in this paper maintained a relatively low anomaly score throughout the normal phase, and after the start of the real anomaly interval, the anomaly score quickly exceeded the threshold and remained at a high level, with a more significant difference in scores between the normal and anomaly intervals.

[0052] This result demonstrates that the proposed method can more effectively distinguish between normal flight fluctuations and genuine fault anomalies. This is because PA-ViTAD simultaneously introduces stage-aware modeling, TCN local temporal coding, variable-level global dependency modeling, and a reconstruction-prediction joint optimization mechanism. This allows the model to not only characterize local changes in single variables but also capture correlation anomalies between multi-sensor variables. Therefore, after a fault occurs, the proposed method can generate a clearer, more continuous, and discriminative anomaly score response, thereby improving the stability and reliability of anomaly detection.

[0053] The UAV anomaly detection method based on latent stage perception provided in Embodiment 1 of this invention offers the following advantages over existing technologies: This invention utilizes an unsupervised latent stage embedding generation module to adaptively learn the latent operational state context from the input window, transforming the discrete manual stage division problem into a continuous representation learning problem. This enhances the model's adaptability to complex operational changes and effectively distinguishes between normal stage transitions and actual anomaly deviations. By extracting univariate local temporal features through TCN and combining it with a Phase-FiLM Token fusion mechanism, local dynamic features, stage context information, and variable semantic information are uniformly mapped to a variable-level representation space. Furthermore, by using iTransformer to model cross-variable global dependencies, collaborative modeling of local and global, multi-source and multi-scale information is achieved. Through joint optimization of reconstruction and prediction tasks, representation learning is constrained from both "current observation recovery capability" and "future evolution modeling capability," overcoming the limitations of single-task anomaly detection and providing a more comprehensive basis for judging complex flight anomalies. This invention has significant advantages in detection robustness and system cost, making it particularly suitable for scenarios with extremely high real-time and reliability requirements, such as UAV flight safety monitoring.

[0054] Example 2 like Figure 4 As shown, in Embodiment 2 of the present invention, a UAV anomaly detection system based on potential phase perception is provided, the system comprising: Processing module 1 is used to acquire multivariate flight data of the UAV and obtain the input window sequence through sliding window processing; Perception module 2 is used to perform unsupervised latent stage perception on each window in the input window sequence and generate a stage embedding vector containing semantic information of the running state. Encoding module 3 is used to perform local time-series encoding on the univariate sequences of each sensor variable within each window to obtain a local time-series representation; Sequence module 4 is used to construct a variable-level token sequence based on the stage embedding vector and the local temporal representation through a stage-aware token fusion mechanism; Module 5 is used to input the variable-level token sequence into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation; Anomaly module 6 is used to calculate the reconstruction error and prediction error respectively through the reconstruction branch and prediction branch based on the high-level semantic representation, and to obtain an anomaly score by weighted fusion of the two. If the anomaly score is greater than a preset threshold, it is determined that there is an anomaly in the current window.

[0055] The sensing module 2 is used for: For the m-th input window First, through the encoding function Extracting window-level implicit representation , L represents the window-level feature dimension, where L is the window length and N is the number of sensor variables. Through two parallel fully connected layers , Estimate the mean vector of the distribution of the latent variables respectively and scale parameters , The dimensions are defined as latent variables, and the standard deviation vector is obtained using the Softplus function. ; Employing reparameterization techniques from conditional distributions Mid-sampling yields latent representations ,in This represents element-wise multiplication; The latent representation is mapped to a stage probability distribution through a softmax soft allocation layer. ,in This is the first learnable weight matrix. Let C be the first bias vector, and C be the preset number of stage categories. This represents the soft assignment probability that the m-th window belongs to the c-th potential stage prototype; Introducing a learnable stage embedding matrix Generate stage embedding vectors based on the stage probability distribution. , where d is the embedding dimension.

[0056] The encoding module 3 is used for: For the m-th input window Let the univariate sequence corresponding to the i-th variable be denoted as . , L is the window length, and N is the number of sensor variables; Temporal convolutional networks using shared parameters Encode each variable sequence to obtain the first... Local temporal representation of each variable d is the embedding dimension.

[0057] The sequence module 4 is used for: Set a learnable variable identity embedding vector for each sensor variable. ,in Embed a lookup table for the variable; For the stage embedding of the m-th window FiLM modulation parameters are generated through learnable linear mappings: The output is divided into scaling factors. and offset factor The scaling factor is then obtained by limiting the scaling range using the tanh function. ,in, This is the second learnable weight matrix. Let d be the second bias vector, and d be the embedding dimension; Local temporal representation of the i-th variable By performing phase modulation and fusing variable identity information, a variable-level token is obtained. : ; In the formula, This represents element-wise multiplication. The modulation intensity coefficient is the stage modulation intensity coefficient. Stack the tokens corresponding to all variables within the window according to the variable dimension to obtain the variable-level token sequence for the m-th window. N is the number of sensor variables.

[0058] The construction module 5 is used for: The variable-level token sequence As input to the iTransformer encoder, the global dependencies between multiple sensors are modeled in the variable dimension through the self-attention mechanism and feedforward network in the encoder, resulting in a high-level variable-level representation: , In the formula, This represents the iTransformer encoding process. The i-th row The i-th variable is a high-level variable-level representation that integrates local temporal information, stage context information, and cross-variable global dependencies. N is the number of sensor variables, and d is the embedding dimension.

[0059] The exception module 6 is used for: For the high-level variable representation of the i-th variable By reconstructing the mapping function Get the reconstruction result of the current window And by predicting the mapping function Obtain the prediction results for the next H time steps. L is the window length; Define reconstruction loss Compared with predicted loss They are respectively: ; ; In the formula, This represents the summation of element-wise squared errors. For all The reconstructed windows obtained by stacking For the true future sequence, For all The predicted sequences obtained by stacking Let N be the m-th input window, and N be the number of sensor variables; During the inference phase, the reconstruction error score is calculated separately. and prediction error score : , , In the formula, This represents the summation of element-wise absolute errors. and The actual reconstruction and prediction results output by the model; The two scores are weighted and combined to obtain the final anomaly score. ,in and These are the weighting coefficients for reconstruction error and prediction error, respectively.

[0060] The system also includes a constraint module, which is used to introduce a KL divergence regularization term during the model training phase. Constrain the potential distribution: ; In the formula, and The first The first window The mean and standard deviation of the dimension, Let KL divergence be the KL divergence. For conditional distribution, For potential representation, For the m-th input window, For the dimension of latent variables; The overall loss function of the model is: Where M is the total number of training windows, The weighting coefficients for the KL divergence term are... and These are the weighting coefficients for reconstruction error and prediction error, respectively.

[0061] In other embodiments of the present invention, the present invention provides the following technical solution: a computer, including a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 executes the computer program to implement the UAV anomaly detection method based on potential stage perception as described above.

[0062] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0063] The memory 102 may include a large-capacity memory for data or instructions. For example, and not limitingly, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include removable or non-removable (or fixed) media. Where appropriate, the memory 102 may be internal or external to a data processing device. In a particular embodiment, the memory 102 is non-volatile memory. In a particular embodiment, the memory 102 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0064] The memory 102 can be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101.

[0065] The processor 101 reads and executes the computer program instructions stored in the memory 102 to implement the above-mentioned UAV anomaly detection method based on potential stage perception.

[0066] In some embodiments, the computer may further include a communication interface 103 and a bus 100. For example, Figure 5 As shown, the processor 101, memory 102, and communication interface 103 are connected through bus 100 and complete communication with each other.

[0067] The communication interface 103 is used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of the present invention. The communication interface 103 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0068] Bus 100 includes hardware, software, or both, that couples components of a computer device together. Bus 100 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although specific buses are described and illustrated in the embodiments of the present invention, the present invention is contemplated by any suitable bus or interconnect.

[0069] The computer can execute the drone anomaly detection method based on latent phase perception of the present invention based on the acquisition of a drone anomaly detection system based on latent phase perception, thereby realizing drone anomaly detection based on latent phase perception.

[0070] In some further embodiments of the present invention, in conjunction with the above-described method for detecting unmanned aerial vehicles (UAVs) based on latent stage perception, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described method for detecting unmanned aerial vehicles (UAVs) based on latent stage perception.

[0071] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0072] More specific examples of readable media (a non-exhaustive list) include: electrical connections (electronic devices) with one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0073] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0074] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0075] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for detecting anomalies in unmanned aerial vehicles (UAVs) based on latent phase perception, characterized in that, include: Acquire multivariate flight data of the UAV and obtain the input window sequence through sliding window processing; Unsupervised latent stage awareness is performed on each window in the input window sequence to generate a stage embedding vector containing semantic information of the running state, including: For the m-th input window First, through the encoding function Extracting window-level implicit representation , L represents the window-level feature dimension, where L is the window length and N is the number of sensor variables. Through two parallel fully connected layers , Estimate the mean vector of the distribution of the latent variables respectively and scale parameters , The dimensions are defined as latent variables, and the standard deviation vector is obtained using the Softplus function. ; Employing reparameterization techniques from conditional distributions Mid-sampling yields latent representations ,in This represents element-wise multiplication; The latent representation is mapped to a stage probability distribution through a softmax soft allocation layer. ,in This is the first learnable weight matrix. Let C be the first bias vector, and C be the preset number of stage categories. This represents the soft assignment probability that the m-th window belongs to the c-th potential stage prototype; Introducing a learnable stage embedding matrix Generate stage embedding vectors based on the stage probability distribution. , where d is the embedding dimension; Local temporal encoding is performed on the univariate sequence of each sensor variable within each window to obtain a local temporal representation; Based on the stage embedding vector and the local temporal representation, a variable-level token sequence is constructed through a stage-aware token fusion mechanism, including: Set a learnable variable identity embedding vector for each sensor variable. ,in Embed a lookup table for the variable; For the stage embedding of the m-th window FiLM modulation parameters are generated through learnable linear mappings: The output is divided into scaling factors. and offset factor The scaling factor is then obtained by limiting the scaling range using the tanh function. ,in, This is the second learnable weight matrix. Let d be the second bias vector, and d be the embedding dimension. Local temporal representation of the i-th variable By performing phase modulation and fusing variable identity information, a variable-level token is obtained. : ; In the formula, This represents element-wise multiplication. The modulation intensity coefficient is the stage modulation intensity coefficient. Stack the tokens corresponding to all variables within the window according to the variable dimension to obtain the variable-level token sequence for the m-th window. N is the number of sensor variables; The variable-level token sequence is input into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation. Based on the high-level semantic representation, the reconstruction error and prediction error are calculated by the reconstruction branch and the prediction branch respectively, and the two are weighted and fused to obtain an anomaly score. If the anomaly score is greater than a preset threshold, it is determined that the current window is abnormal.

2. The UAV anomaly detection method based on latent phase perception according to claim 1, characterized in that, The step of performing local temporal encoding on the univariate sequence of each sensor variable within each window to obtain a local temporal representation includes: For the m-th input window Let the univariate sequence corresponding to the i-th variable be denoted as . , L is the window length, and N is the number of sensor variables; Temporal convolutional networks using shared parameters Encode each variable sequence to obtain the first... Local temporal representation of variables d is the embedding dimension.

3. The UAV anomaly detection method based on latent phase perception according to claim 1, characterized in that, The step of inputting the variable-level token sequence into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation includes: The variable-level token sequence As input to the iTransformer encoder, the global dependencies between multiple sensors are modeled in the variable dimension through the self-attention mechanism and feedforward network in the encoder, resulting in a high-level variable-level representation: , In the formula, This represents the iTransformer encoding process. The i-th row The i-th variable is a high-level variable-level representation that integrates local temporal information, stage context information, and cross-variable global dependencies. N is the number of sensor variables, and d is the embedding dimension.

4. The UAV anomaly detection method based on latent phase perception according to claim 1, characterized in that, The step of calculating the reconstruction error and prediction error based on the high-level semantic representation through the reconstruction branch and prediction branch respectively, and then weightedly fusing the two to obtain the anomaly score includes: For the high-level variable representation of the i-th variable By reconstructing the mapping function Get the reconstruction result of the current window And by predicting the mapping function Obtain the prediction results for the next H time steps. L is the window length; Define reconstruction loss Compared with predicted loss They are respectively: ; ; In the formula, This represents the summation of element-wise squared errors. For all The reconstructed windows obtained by stacking For the true future sequence, For all The predicted sequences obtained by stacking Let N be the m-th input window, and N be the number of sensor variables; During the inference phase, the reconstruction error score is calculated separately. and prediction error score : , , In the formula, This represents the summation of element-wise absolute errors. and The actual reconstruction and prediction results output by the model; The two scores are weighted and combined to obtain the final anomaly score. ,in and These are the weighting coefficients for reconstruction error and prediction error, respectively.

5. The UAV anomaly detection method based on latent phase perception according to claim 1, characterized in that, The method also includes introducing a KL divergence regularization term during the model training phase. Constrain the potential distribution: ; In the formula, and The first The first window The mean and standard deviation of the dimension, Let KL divergence be the KL divergence. For conditional distribution, For potential representation, For the m-th input window, For the dimension of latent variables; The overall loss function of the model is: Where M is the total number of training windows, The weighting coefficients for the KL divergence term are... and These are the weighting coefficients for reconstruction error and prediction error, respectively.

6. A UAV anomaly detection system based on latent phase perception, wherein the system employs the UAV anomaly detection method based on latent phase perception as described in claim 1, characterized in that, The system includes: The processing module is used to acquire multivariate flight data of the UAV and obtain the input window sequence through sliding window processing; The perception module is used to perform unsupervised latent stage perception on each window in the input window sequence and generate a stage embedding vector containing semantic information of the running state. The encoding module is used to perform local time-series encoding on the univariate sequences of each sensor variable within each window to obtain a local time-series representation; The sequence module is used to construct a variable-level token sequence based on the stage embedding vector and the local temporal representation through a stage-aware token fusion mechanism. The building module is used to input the variable-level token sequence into the iTransformer encoder for global dependency modeling to obtain a high-level semantic representation; An anomaly module is used to calculate the reconstruction error and prediction error based on the high-level semantic representation through the reconstruction branch and prediction branch respectively, and to obtain an anomaly score by weighted fusion of the two. If the anomaly score is greater than a preset threshold, it is determined that there is an anomaly in the current window.

7. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the UAV anomaly detection method based on potential stage perception as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the UAV anomaly detection method based on potential stage perception as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Industrial Internet of Things anomaly detection method based on time sequence and text joint modeling

    CN121093216A

  • Cross-working-condition multivariable time sequence anomaly detection method based on stage perception migration diffusion

    CN121980476A