LightGBM-based unmanned aerial vehicle trajectory feature anomaly detection method
Through the drone trajectory feature anomaly detection method based on lightGBM, the problems of low accuracy and high time complexity of drone trajectory detection in the prior art are solved, and higher detection accuracy and lower time complexity are achieved.
Patent Information
- Application Number
- CN202411104840.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-06-24
AI Technical Summary
When processing large-scale drone flight data, the existing drone trajectory anomaly detection methods have low accuracy and high time complexity, so they cannot effectively identify abnormal trajectories.
The drone trajectory feature anomaly detection method based on lightGBM is adopted, and the noise data is cleaned through the clustering algorithm, takeoff and descent data are eliminated, the trajectory feature vector is constructed, and the detection model is trained using lightGBM.
It improves the accuracy of drone trajectory anomaly detection, reduces time complexity, and enhances the efficiency and accuracy of the detection model.
Smart Images

Figure CN120196971A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle trajectory detection, and in particular to a method for detecting anomaly of unmanned aerial vehicle trajectory features based on lightGBM. Background Art
[0002] The application of intelligent unmanned inspection terminals (such as drones, mobile inspection robots, mobile operation handheld terminals, etc.) in the field of power transmission and distribution inspection is becoming increasingly popular and has become an indispensable inspection tool for grassroots teams. In the field of power transmission, drones can easily fly over high-voltage lines, detect the status of equipment such as towers and wires, detect potential problems early, and prevent accident risks. In the field of substations, mobile inspection robots assist operation and maintenance personnel to strengthen the refined inspection of substation equipment. In the field of power distribution, drones can quickly monitor overhead lines, distribution equipment, etc., providing strong information support for the normal operation of the power system.
[0003] The intelligent unmanned inspection terminal collects data during the inspection process, and it is necessary to ensure the security of the collection process. During the data collection process, drones are vulnerable to unauthorized access, tampering or interruption, or problems such as their own failures. This may lead to data leakage, drone crashes, yaw and other problems. For drone trajectory anomaly detection, data-driven anomaly detection algorithms are currently commonly used, including statistical anomaly detection algorithms, classification-based anomaly detection algorithms, and prediction-based anomaly detection algorithms. However, the amount of data generated by drones is huge, and there are no specific data labels, and there is a lot of noise data. Therefore, the use of a single anomaly detection algorithm cannot identify abnormal trajectories with a high accuracy rate, and the time complexity is high. Summary of the invention
[0004] The purpose of the present invention is to overcome the problems of low accuracy and high time complexity in the detection of abnormal UAV trajectories in the prior art, and provide a method for detecting abnormal UAV trajectory features based on lightGBM. By cleaning the noise data in the UAV flight data and identifying the data under different flight modes, the data classification of different flight modes is completed, and the corresponding trajectory feature vectors are constructed. The trajectory detection model is trained using light GBM, which has lower time complexity and higher accuracy.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions: A method for detecting abnormality of UAV trajectory features based on lightGBM, characterized by comprising the following steps: S1: Obtain UAV flight data and establish UAV flight data set; S2: Use clustering algorithm to classify flight data according to the Euclidean distance between data points, and remove takeoff data and landing data; S3: Construct a trajectory feature vector for the UAV cruise based on the UAV flight data processed in step S2; S4: Based on the trajectory feature vector, use lightGBM to train a UAV trajectory anomaly detection model for UAV trajectory anomaly detection.
[0006] The present invention uses a clustering algorithm to clean the noise data in the UAV flight data, and at the same time eliminates the flight data generated by the UAV in the takeoff and landing modes, which improves the accuracy of the UAV trajectory anomaly detection model. Then, based on the UAV flight data, a UAV trajectory feature vector is constructed, and a trajectory detection model is trained using lightGBM, which reduces the time complexity of the UAV trajectory anomaly algorithm and improves the detection accuracy of the trajectory anomaly detection model using the unique parameters of the UAV.
[0007] Preferably, the step S2 includes: S2.1: Select a sample point set from the UAV position data set to obtain a data candidate set; S2.2: Set the neighborhood radius and the UAV position threshold; S2.3: Traverse the data candidate set, calculate the first core point difference between the UAV position at time i and the j-th point in the data candidate set, and construct a position data core object set according to the relationship between the first core point difference and the neighborhood radius; S2.4: Traverse the position data core object set, calculate the second core point difference between the UAV position at time i and the j-th point in the core object set, and construct a UAV position cluster set according to the relationship between the second core point difference and the neighborhood radius.
[0008] Construct a sample set, and based on the constructed sample set, select points from the sample set as the classification basis for classification.
[0009] Preferably, the step S3 includes: Select longitude and latitude data from the UAV position data set to calculate the direction jitter; Select speed data from the UAV speed set to calculate the speed feature; Define a UAV flight segment set, initialize the flight segment set according to the straight-line distance between two position points, and calculate the distance feature according to the UAV position data set; Combine the direction jitter, speed feature, and distance feature to obtain a UAV flight trajectory feature vector.
[0010] After completing the data classification, construct a UAV flight trajectory feature vector based on the longitude, latitude, altitude, instantaneous speed, average speed, and flight distance segment in the UAV flight data.
[0011] Preferably, the construction of the set of core location data objects in step S2.3 includes: If the number of location points in the UAV location data set whose first core point difference from the j-th point in the data candidate set is less than or equal to the neighborhood radius is greater than the UAV location threshold, then the j-th point in the data candidate set is added to the set of core location data objects.
[0012] Wherein, the first core point difference DIST(Location i , Vistited j ) is:
[0013] Preferably, step S2.4 includes: If the second core point difference between the UAV location at time i and the j-th point in the core object set is less than or equal to the neighborhood radius, then the UAV location at time i is added to the UAV location cluster C j .
[0014] Wherein, the second core point difference DiST(Location i , COC j ) is: Preferably, step S2.4 includes: The UAV location cluster set includes multiple UAV location clusters. If there is an intersection between two of the UAV location clusters, they are merged.
[0015] Clusters with similarity are merged to complete the data classification for different flight modes.
[0016] Preferably, step S4 includes: Setting the lightGBM model parameters and the constant flight threshold; Using the trajectory feature vector as the input and the UAV trajectory training value as the output; During anomaly detection, if the trajectory training value is greater than the constant flight threshold, the UAV trajectory is normal, and if the trajectory training value is less than the constant flight threshold, the UAV trajectory is abnormal.
[0017] Preferably, step S2.1 includes: Randomly selecting non-repeating subscripts k from the UAV location data set as the data of the sample point set, where k is less than or equal to the length of the sample point set.
[0018] Preferably, the UAV flight data includes UAV location data and the UAV speed data corresponding to this location. The UAV location data includes the latitude of the UAV location at time i, the longitude of the UAV location at time i, and the flight altitude of the UAV location at time i; The UAV speed data includes the historical average speed of the UAV at time i and the instantaneous speed of the UAV at time i.
[0019] Preferably, if there are missing values in the UAV flight data, the dichotomy interpolation method is used to fill in the missing values.
[0020] Therefore, the present invention has the following beneficial effects: 1. The present invention uses a clustering algorithm to clean the noise data in the UAV flight data, and at the same time eliminates the flight data generated by the UAV in the take-off and landing modes, which improves the accuracy of the UAV trajectory anomaly detection model.
[0021] 2. Then, according to the UAV flight data, a UAV trajectory feature vector is constructed, and the lightGBM is used to train the trajectory detection model, which reduces the time complexity of the UAV trajectory anomaly algorithm. Using the unique parameters of the UAV, the detection accuracy of the trajectory anomaly detection model is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is the overall step flow chart of the UAV trajectory anomaly detection method based on lightGBM in the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0023] The present invention will be further described in detail below in conjunction with the drawings and the specific embodiments: Embodiment 1: During the UAV inspection, due to the influence of factors such as the environment, weather, and network environment where the UAV is located, the accuracy of obtaining the UAV state information decreases, and at the same time, the flight data obtained contains a large amount of noise data, which to a certain extent reduces the accuracy of the general UAV trajectory anomaly detection method. The UAV has multiple different stages such as take-off, cruise, hover, and descent. In different stages, the flight characteristics of the UAV are different, and the performance of the noise data is also different. The UAV flight data has a high dimension and a large amount of data, and the complexity of the traditional anomaly detection algorithm is too high.
[0024] In view of the above problems, this embodiment provides a UAV trajectory feature anomaly detection method based on lightGBM, as Figure 1 shown, and its operation process is as follows: Step 1: Obtain the UAV flight data and establish a UAV flight data set.
[0025] The UAV flight data includes UAV position data and UAV speed data. Among them, the UAV position data includes the longitude data of the UAV position, the latitude data of the UAV position, and the UAV flight altitude. The UAV speed data includes the historical average speed of the UAV at time i and the instantaneous speed of the UAV at time i.
[0026] After obtaining the UAV flight data set, it is necessary to clean the data. In this embodiment, after obtaining the UAV flight data set, the dichotomy interpolation method is used to fill in the missing values.
[0027] If there are outliers in the UAV flight dataset, remove the outliers and handle them as missing values.
[0028] In summary, the UAV flight dataset obtained in Step 1 includes the UAV position data set and the UAV speed data set.
[0029] Step 2: Use a clustering algorithm to classify the flight data according to the Euclidean distance between data points, and remove the takeoff data, descent data, and noise data.
[0030] The UAV flight trajectory dataset mainly includes several data types such as noise data, takeoff data, cruise data, hover data, and descent data. Use a clustering algorithm to identify the corresponding trajectory data in different modes of the flight data, remove the takeoff data, descent data, and noise data, and retain the required cruise data and hover data.
[0031] Specifically, use the density-based clustering algorithm to classify the UAV flight dataset. In density clustering, density-connected points form a set and are divided into a cluster, and clusters with similarity are merged to complete the classification of data in different flight modes.
[0032] The specific classification process is as follows: 1. Randomly select a set of sample points from the UAV position data set to obtain a data candidate set (the data candidate set is the selected set of sample points).
[0033] 2. Set the neighborhood radius and the UAV position threshold.
[0034] 3. Calculate the first core point difference between the UAV position at time i in the UAV position data set and the j-th point in the data candidate set. According to the relationship between the first core point difference and the neighborhood radius, construct the position data core object set.
[0035] Specifically, if in the UAV position data set, the first core point difference between the UAV position and the j-th point in the data candidate set is less than or equal to the neighborhood radius, it means that the j-th point in the data candidate set is within the neighborhood radius. Calculate the number of position points in the UAV position data set whose first core point difference from the j-th point in the data candidate set is less than or equal to the neighborhood radius (i.e., Figure 1 the number of neighborhood points of sample point j in
[0036] ). If the number of position points is greater than or equal to the UAV position threshold, add the j-th point in the data candidate set to the position data core object set.
[0037] 4. Calculate the second core point difference between the UAV position at time i and the j-th point in the core object set. Based on the relationship between the second core point difference and the neighborhood radius, construct the UAV position cluster set, where i = 1, 2, …, n, and n is the total number of position data (position points) in the UAV position data set.
[0038] If the second core point difference between the UAV position at time i and the j-th point in the core object set is less than or equal to the neighborhood radius, add the UAV position at time i to the UAV position cluster C j . The UAV position cluster C j contains all the position points in the UAV position data set whose second core point difference from the j-th point in the core object set is less than or equal to the neighborhood radius. For example, the UAV position cluster C i contains all the position points in the UAV position data set whose second core point difference from the i-th point in the core object set is less than or equal to the neighborhood radius.
[0039] Traverse the core object set of position data, and add the position points in the UAV position data set that meet the above conditions to the corresponding UAV position clusters. All UAV position clusters form the UAV position cluster set.
[0040] The UAV position cluster set includes multiple UAV position clusters. If there is an intersection between two of them, they are merged.
[0041] Step 3. Based on the processed UAV flight data in Step 2, construct the trajectory feature vector of the UAV cruise.
[0042] According to the UAV flight data after removing the takeoff data and landing data, use variables such as longitude, latitude, flight altitude, speed, and flight distance segments in the flight data to construct the trajectory feature vector of the UAV.
[0043] Step 4. Based on the trajectory feature vector obtained in Step 3, use light GBM to train the UAV trajectory anomaly detection model for UAV trajectory feature anomaly detection.
[0044] The light GBM framework is a machine learning framework based on the Gradient Boosting Decision Tree (GBDT) algorithm. It has the advantages of faster training speed, higher efficiency, lower memory usage, better accuracy, support for parallel and GPU learning, and the ability to process large-scale data.
[0045] Use light GBM to construct, learn, and train the UAV trajectory anomaly detection model.
[0046] During training, the obtained trajectory feature vectors are used as a dataset, and the dataset is divided into a training set, a validation set, and a test set according to a ratio of 7:2:1. The training set is used to train the UAV trajectory anomaly detection model; the validation set is used to adjust the hyperparameters of the UAV trajectory anomaly detection model and conduct a preliminary evaluation of the capabilities of the UAV trajectory anomaly detection model; after training the UAV trajectory anomaly detection model, the generalization ability of the current model (such as accuracy, recall, etc.) is verified to determine whether to stop training or adjust the parameters and train again; the test set is used to evaluate the generalization ability of the UAV trajectory anomaly detection model.
[0047] The trained UAV trajectory anomaly detection model is used to identify UAV trajectory anomalies.
[0048] The trajectory feature vectors are used as inputs, and the UAV trajectory training values are used as outputs; during anomaly detection, if the trajectory training value is greater than the constant flight threshold, the UAV trajectory is normal, and if the trajectory training value is less than the constant flight threshold, the UAV trajectory is abnormal.
[0049] A method for detecting UAV trajectory feature anomalies based on lightGBM provided in this embodiment uses interpolation and clustering algorithms to clean the noise data in the UAV flight data, realizes data discrimination under different flight modes, and eliminates the flight data generated by the UAV in the takeoff and landing modes, improving the accuracy of the UAV trajectory anomaly detection model. At the same time, according to the flight data of the UAV such as longitude, latitude, altitude, flight segment distance, and instantaneous speed, UAV trajectory feature vectors are constructed, and the lightGBM is used to train the UAV trajectory anomaly detection model, reducing the time complexity of the UAV trajectory anomaly algorithm and improving the detection accuracy of the trajectory anomaly detection model by using the unique parameters of the UAV.
[0050] Embodiment 2: This embodiment provides a method for detecting UAV trajectory feature anomalies based on lightGBM and executes this method in a specific application scenario.
[0051] With the rapid development of information technology and the modern transformation of the power system, the traditional power system is gradually transforming into a new type of power system. In recent years, the State Grid has vigorously promoted unmanned patrols in transmission and distribution, using UAVs to fly along preset trajectories to collect transmission and transformation line data, thereby realizing the detection of transmission and transformation line anomalies.
[0052] Therefore, anomaly detection of drone flight trajectories is particularly important. Anomaly detection is widely used in various research fields. By identifying outliers, researchers can gain important knowledge that helps make better data decisions. There are three main types of general anomaly detection: anomaly detection based on prior knowledge, quantitative anomaly detection algorithms based on models, and data-driven anomaly detection algorithms. Early anomaly detection methods were based on statistical model theory. By assuming that normal data objects satisfy a specific distribution or probability model, and then determining outliers based on whether the object conforms to the distribution or model, many anomaly detection methods are mostly derived from this idea.
[0053] For drone trajectory anomaly detection, drone trajectory data sets mainly include the following types: noise data, takeoff data, cruise data, hovering data, and descent data. The general trajectory detection algorithm is affected by noise data, takeoff data, and descent data, and the constructed trajectory anomaly detection model is not suitable for drone trajectory detection. At the same time, drone flight data has high dimensions and large data volume, and the general anomaly detection algorithm is highly complex. In addition, drones are in the air, and there are more uncontrollable factors. The general trajectory anomaly detection algorithm is not suitable for drone scenarios.
[0054] Therefore, this embodiment adopts a drone trajectory anomaly detection method based on lightGBM, which can not only take the above problems into consideration but also ensure the accuracy of trajectory anomaly detection and the efficiency in data cleaning and processing.
[0055] The method comprises the following steps: step 1, obtaining UAV flight data and establishing a UAV flight data set; step 2, using a clustering algorithm to classify the flight data according to the Euclidean distance between data points, and eliminating take-off data and landing data; step 3, constructing a trajectory feature vector of the UAV cruise according to the UAV flight data processed in step 2; step 4, based on the trajectory feature vector obtained in step 3, using light GBM to train a UAV trajectory anomaly detection model to perform UAV trajectory feature anomaly detection.
[0056] Based on the longitude, latitude, altitude, flight distance, instantaneous speed and other flight data of the drone, the drone trajectory feature vector is constructed, and the trajectory detection model is trained using lightGBM. The time complexity of the drone trajectory anomaly algorithm is reduced, and the detection accuracy of the trajectory anomaly detection model is improved by using the unique parameters of the drone.
[0057] The technical scheme and technical effects of the present invention will be further described below through specific examples. The following examples are explanations of the present invention and the present invention is not limited to the following examples.
[0058] A method for detecting abnormalities in drone trajectory features based on lightGBM, the operation process is as follows: The first stage: Preprocess the UAV flight data and fill the missing values in the UAV flight data using the binary interpolation method.
[0059] The first step: Obtain the UAV flight data and establish a UAV flight data set.
[0060] (1) Obtain the UAV position data set DroneLocationDataSet: DroneLocationDataSet = {Location1, Location2,..., Location i ..., Location n-1 , Location n} Among them, Location i represents the UAV position at the i-th moment, and n represents the total number of position data in the UAV position data set DroneLocationDataSet.
[0061] Specifically: Location i = {Lon, Lat, Hei} Among them, Lon represents the longitude of the UAV position at the i-th moment, Lat represents the latitude of the UAV position at the i-th moment, and Hei represents the altitude of the UAV position at the i-th moment.
[0062] (2) Obtain the UAV speed set DroneSpeedDataSet: DroneSpeedDataSet = {Speed1, Speed2.,..., Speed i ,..., Speed n-1 , Speed n} Among them, Speed i represents the UAV flight speed at the i-th moment, n represents the total number of speed data in the UAV speed set DroneSpeedDataSet. Since the UAV position and the UAV speed at the i-th moment are in one-to-one correspondence, the total number of position data in the UAV position data set and the total number of speed data in the UAV speed set are the same.
[0063] Specifically: Speed i = {avgSpeed, std} Among them, avgSpeed represents the historical average speed of the UAV flight at the i-th moment, and std represents the instantaneous speed of the UAV flight.
[0064] Step 2: Process the missing values in the drone flight data.
[0065] Traverse the drone location data set DroneLocationDataSet. If Location i is empty, use the bisection interpolation method to fill in the missing values.
[0066] It is expressed by the formula:
[0067] Similarly, traverse the drone speed data set DroneSpeedDataSet. If Speed i is empty, use the bisection interpolation method to fill in the missing values.
[0068] This process is the data cleaning process.
[0069] Second stage: After completing the data filling, use the clustering algorithm to classify according to the Euclidean distance between data points. The flight data is mainly divided into takeoff data, cruise data, hover data, descent data, and noise data. The takeoff data and descent data are removed, and the cruise data and hover data are retained.
[0070] Step 3: Select the sample point set Visited.
[0071] Select the sample point set Visited from the drone location data set DroneLocationDataSet. In this embodiment, the following formula is used for selection: Visited j = Location k (k = Random().nextInt) 0 ≤ k ≤ DroneLocationDataSet.length() Among them, Visitedj represents the selected sample point set, that is, the location data candidate set; Location k represents the data selected from the drone location data set. Random().nextInt represents randomly selecting a non-repeating subscript k as the data of the sample point set, and DroneLocationDataSet.length() represents the length of the location data candidate set.
[0072] This process is to construct the sample set.
[0073] Step 4: Construct the core object set COC of the location data.
[0074] Set the neighborhood radius Eps and the drone location threshold MinPoints.
[0075] In this embodiment, Eps = 0.4 and Minpoints = 10 are taken.
[0076] Traverse the candidate set Visited of location data j , and calculate the core point difference between the position at the i-th moment in the UAV position data set and the position of the j-th point (or the j-th moment) in the candidate set of position data. The calculation formula is: where visited j represents the position of the j-th point in the candidate set Visited of location data j in.
[0077] Set: N Eps (Location i ) = {Location i | Location i in the UAV position data set DroneLocationDataSet, DIST(Location i , visited j ) ≤ Eps} where N Eps (Location i ) represents the number of the remaining Location j in the UAV position data set included within the neighborhood radius Eps of the UAV position visited i .
[0078] Therefore, if N Eps (Location i ) > MinPoints, then add Visited j to the core object set COC of location data.
[0079] This process is to select some points from the constructed sample set to form a set as the basis for classification.
[0080] Step 5: Construct the UAV position cluster set DroneLocationCluster.
[0081] Define the UAV position cluster set DroneLocationCluster and initialize it: DroneLocationCluster = {C0, C1, C2,..., C i ..., C m-1 , Cm} (n = the length of COC) Where the length of COC represents the length of the core object set.
[0082] Traverse the core object set COC of the UAV position data, and calculate the core point difference between the UAV position at the i-th moment and the j-th point COC of the core object set j Core point difference: If the core point difference DIST(Location i , COC j ) ≤ Eps, then add Location i to the UAV position cluster C j where C j contains all position points in the UAV position data set whose core point difference from COC j is less than or equal to the neighborhood radius.
[0083] That is, select a core object from the core object set, find the flight data within the neighborhood radius of the core object, generate a clustering cluster, and add it to the UAV position cluster set DroneLocationCluster.
[0084] Sixth step: Traverse the UAV position cluster set DroneLocationCluster, according to the following formula: C i ∩ C j ! = null If it is satisfied, then add the position cluster C i to the position cluster C j and delete the position cluster C i .
[0085] That is, according to the process of the fifth step, multiple clustering clusters will be formed. If there is an intersection between two clustering clusters, they will be merged.
[0086] Third stage: After completing data cleaning, construct a UAV flight trajectory feature vector based on the longitude, latitude, altitude, instantaneous speed, average speed, and flight distance segment in the UAV flight data.
[0087] Seventh step: Calculate the feature direction jitter DS (Direction Shake).
[0088] Define the feature direction jitter DS (Direction Shake): DS: <Xl, yl> Select the longitude and latitude data from the drone location data set DroneLocationDataSet to calculate the direction jitter DS.
[0089] The horizontal component xl of the direction jitter is calculated according to the following formula: A component calculated by using the residual, then converting it through the sign function, and finally taking the absolute value. It can be understood as an offset, that is, the offset degree on the x-axis from the original route to be taken.
[0090] The vertical component yl of the direction jitter is calculated according to the following formula: The offset degree on the y-axis from the original route to be taken.
[0091] Step 8: Calculate the speed feature V.
[0092] Define the speed feature V: V = <avgSpeed, std> Select the speed data from the drone speed set DroneSpeedDataSet to calculate the speed feature V.
[0093] Among them, the component avgSpeed is calculated according to the following formula: avgSpeed = DroneSpeedDataSet.avgSpeed Take out the average speed from the drone speed set.
[0094] The component std is calculated according to the following formula: std = DroneSpeedDataSet.std. Take out the instantaneous speed from the drone speed set.
[0095] Step 9: Calculate the distance feature.
[0096] Define the drone flight segment set DroneLegSet and initialize it according to the following formula: DroneLegSet = {x0, x1, x2, …, x i , …, x n-1 , x n} = DistanceCalculator(Location i , Location j ) DistanceCalculator(Location i ,Location j)It represents the straight-line distance between the position of the drone at the i-th moment and the position of the drone at the j-th moment.
[0097] Calculate the distance feature D based on the drone position data set DroneLocationDataSet: D: <FT, dsd> The flight segment distance FT is calculated according to the following formula: FT i = x i The segment standard deviation dsd is calculated according to the following formula: where g is the number of segments of the continuous flight distance of the drone, and x i is the i-th distance segment of the drone trajectory.
[0098] Step 10: Calculate the trajectory feature vector of the drone cruise.
[0099] Combine the direction jitter DS, speed feature V, and distance feature D to obtain the trajectory feature vector of the drone cruise: feature: <DS, V, D> = <xl, yl, avgSpeed, std, FT, dsd>.
[0100] Phase 4: Use the constructed drone trajectory feature vector as input and train it using lightGBM.
[0101] Step 11: Based on the trajectory feature vector of the drone cruise: feature: <DS, V, D>, train the drone trajectory anomaly detection model using the light GBM framework.
[0102] Set the light GBM framework parameters. In this embodiment: 'max_depth': 6 'learning_rate': 0.1 'num_leave': 50 'bagging_freq': 5 DroneTraingingValue = bet.predict() Among them, max_depth represents the depth, learning_rate represents the model learning rate, num_leave represents the number of leaf nodes, bagging_freq represents the frequency of bagging, 0 means disabling bagging, and a positive integer means performing bagging every k rounds of iteration. DroneTraingingValue represents the trajectory training value of the drone's cruise. bst.predict() is a function used for prediction in the light GBM framework. After training the model using the light GBM framework, the bst.predict() function can be called to predict new data. This function can accept different parameters to adapt to different prediction requirements. The input of the drone trajectory anomaly detection model is the trajectory feature vector of the drone's cruise, and the output is the trajectory training value DroneTraingingValue of the drone's cruise.
[0103] The twelfth step: Perform drone trajectory feature anomaly detection.
[0104] Set the constant flight threshold FTV, and compare the constant flight threshold FTV with the trajectory training value DroneTraingingValue of the drone's cruise obtained by the drone trajectory anomaly detection model. If: DroneTrainingValue>FTV It means that the trajectory of the drone's cruise is normal.
[0105] If DroneTrainingValue<FTV, it means that the trajectory of the drone's cruise is abnormal.
[0106] Compared with other algorithms, the drone trajectory anomaly detection method based on lightGBM provided in this embodiment has the following advantages: After obtaining the drone flight data set, the dichotomy interpolation method is used to fill in the missing values. Then, according to the clustering method, the corresponding trajectory data in different modes in the flight data are identified, and the required cruise data and hover data are retained. Finally, a trajectory feature vector of the drone is constructed based on variables such as longitude, latitude, altitude, and flight distance segment, and the lightGBM training model is used. The noise data, takeoff data, and landing data in the drone flight data are removed. The accuracy of the trajectory anomaly detection model is improved. At the same time, the drone trajectory anomaly detection model constructed by constructing the drone trajectory feature vector and trained by lightGBM has a lower time complexity and higher accuracy, and is more suitable for the scenario of drone trajectory anomaly detection.
[0107] The above-described embodiments are only a preferred solution of the present invention, and do not impose any form of limitation on the present invention. There are other variations and modifications without exceeding the technical solutions described in the claims.
Claims
1. A method for detecting abnormality of drone trajectory features based on lightGBM, characterized in that: include: S1: Obtain UAV flight data and establish a UAV flight data set; S2: Use clustering algorithm to classify flight data according to the Euclidean distance between data points, and remove takeoff data and landing data; S3: constructing a trajectory feature vector of the UAV cruise according to the UAV flight data processed in step S2; S4: Based on the trajectory feature vector, lightGBM is used to train a drone trajectory anomaly detection model to perform drone trajectory feature anomaly detection.
2. According to claim 1, a method for detecting abnormalities in drone trajectory features based on lightGBM is characterized in that: The step S2 comprises: S2.1: Select a set of sample points from the drone position data set to obtain a data candidate set; S2.2: Set the neighborhood radius and drone location threshold; S2.3: traverse the data candidate set, calculate the first core point difference between the drone position at time i and the jth point in the data candidate set, and construct a position data core object set based on the relationship between the first core point difference and the neighborhood radius; S2.4: Traverse the core object set of location data, calculate the second core point difference between the drone position at time i and the jth point in the core object set, and construct the drone position cluster set based on the relationship between the second core point difference and the neighborhood radius.
3. The method for detecting abnormality of drone trajectory features based on lightGBM according to claim 1 or 2, characterized in that: The step S3 comprises: Select longitude and latitude data from the drone position data set to calculate the direction jitter; Select speed data from the drone speed set to calculate speed features; Defining a set of UAV flight segments, initializing the set of flight segments according to the straight-line distance between two position points, and calculating a distance feature according to the set of UAV position data; The direction jitter, speed features and distance features are combined to obtain the UAV flight trajectory feature vector.
4. According to claim 2, a method for detecting abnormality of drone trajectory features based on lightGBM is characterized in that: The step S2.3 of constructing the location data core object set includes: If the number of location points in the drone location data set whose first core point difference with the j-th point in the data candidate set is less than or equal to the neighborhood radius is greater than or equal to the drone location threshold, then the j-th point in the data candidate set is added to the location data core object set.
5. According to claim 2, a method for detecting abnormality of drone trajectory features based on lightGBM is characterized in that: The step S2.4 includes: if the difference between the position of the drone at time i and the second core point of the jth point in the core object set is less than or equal to the neighborhood radius, then the position of the drone at time i is added to the drone position cluster C j middle.
6. A method for detecting abnormality of drone trajectory features based on lightGBM according to claim 2, 4 or 5, characterized in that: The step S2.4 includes: the drone position cluster set includes multiple drone position clusters, and if two drone position clusters have an intersection, they are merged.
7. A method for detecting abnormality of drone trajectory features based on lightGBM according to claim 1, 2, 4 or 5, characterized in that: The step S4 includes: setting lightGBM model parameters and a constant flight threshold; taking the trajectory feature vector as input and the drone trajectory training value as output; during anomaly detection, if the trajectory training value is greater than the constant flight threshold, the drone trajectory is normal, and if the trajectory training value is less than the constant flight threshold, the drone trajectory is abnormal.
8. A method for detecting abnormality of drone trajectory features based on lightGBM according to claim 2, 4 or 5, characterized in that: The step S2.1 includes: randomly selecting a non-repeating subscript k from the drone position data set as data of the sample point set, where k is less than or equal to the length of the sample point set.
9. A method for detecting abnormalities in drone trajectory features based on lightGBM according to claim 1, 2, 4 or 5, characterized in that: The drone flight data includes drone position data and drone speed data corresponding to the position, wherein the drone position data includes the latitude of the drone position at time i, the longitude of the drone position at time i, and the flight altitude of the drone position at time i; the drone speed data includes the historical average speed of the drone at time i and the instantaneous speed of the drone at time i.
10. A method for detecting abnormalities in drone trajectory features based on lightGBM according to claim 1, 2, 4 or 5, characterized in that: If there are missing values in the UAV flight data, the bisection interpolation method is used to fill the missing values.