Model-based unmanned aerial vehicle system test method and system
Through the model-based drone system testing method, GAN generates diverse flight scenario data and combines real environmental data to fine-tune the transfer learning model, the problem of insufficient data diversity and complexity in the existing drone testing methods is solved, and efficient and accurate drone testing and mission planning is achieved.
Patent Information
- Application Number
- CN202411822295.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing UAV testing methods rely on physical flight experiments, are time-consuming, costly and risky, and the generated flight scenario data lacks diversity and complexity, and cannot cover possible situations in actual flight.
Using a model-based drone system testing method, a simulated flight scenario data is generated by collecting and preprocessing drone operation data, a generative adversarial network (GAN) is used to generate a simulated flight scenario data set, and a transfer learning model is fine-tuned in combination with real environmental data, and a flight mission planning is generated and simulation evaluation is performed.
It improves the accuracy and comprehensiveness of drone testing, enhances the adaptability and accuracy of the model, reduces the testing cost, and enhances the model's coping ability in complex environments and the stability of actual operations.
Smart Images

Figure CN119720779A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle system testing, and in particular to a model-based unmanned aerial vehicle system testing method and system. Background Art
[0002] With the rapid development of drone technology, the application of drones in the fields of military, agriculture, logistics, environmental monitoring, etc. has gradually deepened. In particular, the testing and verification of drone systems has become an important part of ensuring their safety and reliability. Traditional drone testing methods usually rely on physical flight experiments, which are not only time-consuming and costly, but also risky. In order to solve this problem, more and more research has begun to turn to the use of simulation and simulation technology to evaluate the performance of drone systems. In particular, the simulated flight scene generation method based on deep learning can generate diverse flight data through models such as generative adversarial networks (GANs), greatly improving the efficiency and diversity of flight mission testing.
[0003] At present, the testing of drones mainly relies on manually collected and simulated flight data, which has certain limitations. The generated flight scene data lacks sufficient diversity and complexity to cover possible situations in actual flight. Secondly, although there are model pre-training methods based on transfer learning, most methods only perform fine-tuning in a static environment and cannot efficiently optimize for the dynamic adjustment of flight missions. In addition, the existing technologies generally lack a mechanism for rapid fine-tuning and mission planning generation for incremental data collected in actual tests, resulting in insufficient adaptability and accuracy of flight missions. Therefore, how to improve the adaptability and accuracy of the model by generating simulated flight data that is highly matched to the actual environment and combining it with real environment data has become a problem that needs to be solved urgently in current technology. Summary of the invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a model-based UAV system testing method to solve the problem of insufficient adaptability and accuracy of traditional flight missions.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a model-based UAV system testing method, which includes collecting UAV operation data, preprocessing the data, and labeling and classifying the preprocessed data; inputting the labeled data into a generative adversarial network model, training a generator, and generating a simulated flight scene data set; pre-training a transfer learning model based on the simulated flight scene data set; deploying UAVs in actual tests, collecting incremental data from real environments, and fine-tuning the pre-trained transfer learning model; generating a flight mission plan based on the fine-tuned transfer learning model, and completing a simulation evaluation in combination with the simulated flight scene data set.
[0008] As a preferred solution of the model-based UAV system testing method of the present invention, the specific steps of collecting UAV operation data and preprocessing the data are as follows:
[0009] The built-in flight control unit and sensors record the drone's operating data, and transmit the drone's operating data back to the ground station via a wireless communication link;
[0010] Clean, filter, standardize and normalize the UAV operation data transmitted back to the ground station;
[0011] Feature extraction is performed on the preprocessed UAV operation data, and the extracted features are incorporated into the UAV operation dataset.
[0012] As a preferred solution of the model-based UAV system testing method of the present invention, the specific steps of labeling and classifying the pre-processed data are as follows:
[0013] Define tag types based on flight missions, environmental conditions, and flight status;
[0014] Based on the defined label type, the preprocessed UAV operation data set is labeled to obtain a labeled data set;
[0015] Use oversampling and undersampling methods to balance the number of samples of each type of label in the labeled dataset;
[0016] The labeled dataset is verified through cross-validation and consistency checking.
[0017] As a preferred solution of the model-based UAV system testing method of the present invention, the labeled data is input into a generative adversarial network model, a generator is trained, and a simulated flight scene data set is generated. The specific steps are:
[0018] Convert the labeled data set into a vectorized representation to generate the basic input feature matrix X, and introduce multimodal environment variables to form an extended feature matrix X ext , the expression is:
[0019] X ext =X+φ(E);
[0020]
[0021] Among them, X ext is the extended feature matrix, X is the basic input feature matrix, E is the environment variable matrix, φ(E) is the environment variable mapping function, and W env is the weight matrix of environmental variables, γ is the time attenuation factor, T is the time interval, t is the time interval variable, exp is the exponential function with the natural number e as the base, and dt is the small increment of time;
[0022] Introducing a dynamic perturbation generator strategy, the expanded feature matrix X ext Input into the generative adversarial network to conduct adversarial training between the generator and the discriminator to generate a simulated flight scene dataset D sim ;
[0023] The objective function expression of the dynamic disturbance generator is:
[0024]
[0025] δ(X ext )=sin(α·X ext );
[0026] in, is the target loss function of the generator, is the expectation operator, z is the noise vector sampled from the latent space distribution, and p z is the potential space distribution, D is the discriminator model, G is the generator model, δ(X ext ) is the dynamic disturbance function, α is the disturbance coefficient;
[0027] Based on the generated simulated flight scene dataset D sim , introduce the variational enhancement method, perform multimodal evaluation, and obtain the simulated flight scene enhanced dataset D aug , the objective function expression of variational enhancement is:
[0028] D aug =D sim +λ·Var(D sim );
[0029] Among them, D sim D is the generated simulated flight scene dataset. aug is the enhanced data set for simulating flight scenes, λ is the enhanced weight, Var(D sim ) is the variance of the simulated data set.
[0030] As a preferred solution of the model-based UAV system testing method of the present invention, the transfer learning model pre-training is performed based on the simulated flight scene data set, and the specific steps are:
[0031] Select convolutional neural network as the deep learning model and ResNet-18 as the model architecture;
[0032] The acquired simulated flight scene enhanced dataset D aug As an input layer, load the model architecture;
[0033] Define the loss function and optimizer, and update the high-level network parameters through the back-propagation algorithm until the model converges;
[0034] After training is completed, the simulated flight scene is used to enhance the dataset D aug Evaluate the model and save the trained transfer learning pre-trained model.
[0035] As a preferred solution of the model-based UAV system testing method of the present invention, the UAV is deployed in the actual test, incremental data is collected from the real environment, and the pre-trained transfer learning model is fine-tuned. The specific steps are:
[0036] Deploy drones into actual flight environments to collect real-world data;
[0037] Load the transfer learning pre-trained model and freeze the underlying convolutional layer feature extraction network;
[0038] Incremental learning algorithms and regularization methods are introduced to fine-tune the high-level network of the pre-trained model based on real environment data. The expression is:
[0039]
[0040] Among them, Δθ q is the update amount of the model parameters, η is the learning rate, is the gradient of the loss function with respect to the parameter, β is the regularization strength, is the regularization term, q is the identifier of the data subset;
[0041] The mean square error (MSE) was selected as the loss function and the Adam optimizer was used to adjust the model parameters.
[0042] As a preferred solution of the model-based UAV system testing method of the present invention, the flight mission planning is generated based on the fine-tuned transfer learning model, and the simulation evaluation is completed in combination with the simulated flight scene data set. The specific steps are:
[0043] Input the target parameters of the flight mission, decompose the flight mission objectives, and complete the constraint definition;
[0044] The decomposed flight mission and constraints are input into the fine-tuned transfer learning model to generate the flight mission plan;
[0045] Augmented dataset D from simulated flight scenes aug In the flight simulation, select a simulated flight environment similar to the actual flight environment and import it into the flight simulation platform;
[0046] Use the flight simulation platform to execute flight planning schemes, simulate the performance of drones in different flight scenarios, and collect data;
[0047] Monitor the mission execution of drones and conduct simulation evaluation of flight missions;
[0048] Based on the simulation evaluation results, the flight mission planning is further optimized.
[0049] In a second aspect, the present invention provides a model-based UAV system testing system, including a data collection module, a scenario generation module, a model training module, a model fine-tuning module, and a simulation evaluation module; the data collection module is used to collect UAV operation data, pre-process the data, and label and classify the pre-processed data; the scenario generation module is used to input the labeled data into a generative adversarial network model, train the generator, and generate a simulated flight scenario data set; the model training module is used to pre-train a transfer learning model based on the simulated flight scenario data set; the model fine-tuning module is used to deploy UAVs in actual tests, collect incremental data from real environments, and fine-tune the pre-trained transfer learning model; the simulation evaluation module is used to generate a flight mission plan based on the fine-tuned transfer learning model, and complete the simulation evaluation in combination with the simulated flight scenario data set.
[0050] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the model-based drone system testing method as described in the first aspect of the present invention is implemented.
[0051] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the model-based drone system testing method as described in the first aspect of the present invention is implemented.
[0052] The beneficial effects of the present invention are as follows: by inputting labeled data into a generative adversarial network (GAN) for training, a diverse flight scene data set is generated, and multimodal environmental variables and dynamic disturbance generator strategies are introduced to enhance the quality and diversity of the simulated data, thereby improving the accuracy and comprehensiveness of the UAV test. At the same time, by optimizing the data set through the variational enhancement method, the generalization ability and adaptability of the simulated flight data are further improved, providing more abundant and effective test data for subsequent mission planning and flight simulation. The pre-trained model is fine-tuned through incremental learning of actual environmental data, combined with the regularization method, to improve the adaptability and accuracy of the model. Incremental learning enables the model to dynamically adapt to new flight missions, while the regularization method effectively avoids overfitting and ensures the stability and efficiency of the fine-tuning process. By generating high-quality flight data and continuously updating the model, the present invention effectively improves the testing and mission planning capabilities of the UAV system in a complex environment, reduces the testing cost, and enhances the model's ability to cope with different flight scenarios and its stability in actual operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0054] Figure 1 This is a flow chart of the model-based UAV system testing method in Example 1.
[0055] Figure 2 This is a module diagram of the model-based UAV system testing system in Example 1. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0057] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0058] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0059] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides a model-based UAV system testing method, comprising:
[0060] S1: Collect drone operation data, preprocess the data, and label and classify the preprocessed data.
[0061] Specifically, the following steps are included:
[0062] S1.1: The UAV operation data is recorded by the built-in flight control unit and sensors, and transmitted back to the ground station via the wireless communication link.
[0063] Specifically, drone operation data includes:
[0064] Flight status data: drone position coordinates, speed and acceleration, attitude information, and flight mode;
[0065] Sensor data: IMU, GPS, barometer data;
[0066] Environmental data: wind speed, wind direction, lighting conditions, obstacle distribution;
[0067] Energy and motor data: battery status, motor status, flight control unit log;
[0068] Task information: task description, task completion rate;
[0069] Communication and network data: signal strength, latency, packet loss rate;
[0070] Fault and abnormal data: abnormal records, emergency logs;
[0071] Video and image data: images and videos captured by real-time cameras, and environmental feature point data.
[0072] It should be understood that by comprehensively collecting this data, sufficient support can be provided for subsequent preprocessing, GAN training, transfer learning model optimization, and simulation evaluation. The diversity and accuracy of this data determine the generalization ability of the model and the effectiveness of the test method.
[0073] Furthermore, wireless communication links such as Wi-Fi, Bluetooth, LTE or 5G are selected according to the UAV mission requirements and flight environment conditions to ensure the stability and real-time performance of data transmission.
[0074] S1.2: Clean, filter, standardize and normalize the UAV operation data transmitted back to the ground station.
[0075] Specifically, data cleaning includes processing missing values through interpolation methods (such as linear interpolation, Lagrange interpolation, etc.); detecting and processing outliers through statistical analysis (such as Z-score, IQR method); performing data deduplication operations to ensure the uniqueness of each data point in the data set; this step improves the accuracy and availability of the data.
[0076] Data filtering involves using low-pass filters (such as sliding average filters, Butterworth filters, etc.) to smooth the data and filter out unwanted high-frequency noise in order to more accurately extract trends and patterns.
[0077] Data standardization involves transforming the data into a standard normal distribution (mean 0, variance 1). Standardization can accelerate the convergence of the algorithm and improve the performance of the machine learning algorithm model.
[0078] The data normalization expression is:
[0079]
[0080] Among them, Y is the original data value, μ is the mean of the data, σ is the standard deviation of the data, and Y std is the standardized data value.
[0081] Data normalization involves scaling the data to the range of [0, 1] to ensure that all features have similar influence and prevent certain features from dominating the model training process due to their large magnitude.
[0082] The data normalization expression is:
[0083]
[0084] Among them, Y is the original data value, Y min is the minimum value of the data set, Y max is the maximum value of the data set, Y nor is the normalized data value.
[0085] S1.3: Perform feature extraction on the preprocessed UAV operation data and incorporate the extracted features into the UAV operation dataset.
[0086] Specifically, the statistical characteristics of the UAV operation data are extracted, including the mean, standard deviation and variance, maximum and minimum values, skewness and kurtosis.
[0087] Extract the time series characteristics of UAV operation data, including extracting the long-term change trend of data through methods such as linear regression and sliding average.
[0088] Extracting frequency domain features of UAV operation data includes converting time domain signals into frequency domain signals through Fourier transform or wavelet transform, and extracting frequency components therefrom.
[0089] Furthermore, incorporating the extracted features into the UAV operation dataset includes selecting relevant features according to the requirements of the model, integrating the extracted features (such as mean, standard deviation, frequency domain features, etc.) into the original dataset, and forming a new dataset containing multi-dimensional features.
[0090] S1.4: Define tag types based on flight mission, environmental conditions, and flight status.
[0091] Specifically, different tag types are defined according to the flight mission objectives (such as cruising, landing, takeoff, obstacle avoidance, etc.), environmental conditions (such as weather conditions, wind speed, temperature, etc.) and flight status (such as normal flight, fault detection, flight abnormality, etc.). Each tag represents a flight status or mission scenario, for example, the tags can be "normal flight", "abnormal flight", "low battery", "deviated from the route", etc.
[0092] S1.5: Based on the defined label type, label the preprocessed drone operation dataset to obtain a labeled dataset.
[0093] S1.6: Use oversampling and undersampling methods to balance the number of samples of each type of label in the labeled dataset.
[0094] Specifically, for categories with less labeled data (such as rare flight modes or abnormal states), SMOTE oversampling is performed to improve the model's learning ability for these labels. For categories with too much labeled data, some labeled samples are randomly deleted to balance the data set to avoid the model focusing too much on a certain type of label, which leads to category imbalance.
[0095] S1.7: Verify the labeled dataset through cross-validation and consistency check.
[0096] Specifically, the labeled data set is verified using the cross-validation method to ensure the accuracy and representativeness of the labels for each category. The consistency check ensures that the same data sample is labeled consistently by multiple annotators or different tools. Professionals or auxiliary tools are used to check the rationality of data annotation to avoid human errors or model annotation errors and ensure the high quality of the final data set.
[0097] Preferably, through the implementation of the above steps, the comprehensive collection and high-quality transmission of drone operation data are ensured, laying the foundation for subsequent data processing and model training. Data cleaning, filtering, standardization and normalization processing improve the accuracy and consistency of the data, eliminate noise and outliers, and ensure data quality. Feature extraction further enhances the representativeness of the data, enabling the model to understand the flight status of the drone from multiple dimensions. Through precise label definition and labeling process, the accurate classification of each data sample is ensured, effectively improving the prediction ability of the model. The oversampling and undersampling methods are used to solve the data imbalance problem, so that the model can learn all categories fairly and avoid bias and overfitting problems. Cross-validation and consistency checks ensure the accuracy and reliability of data annotation, thereby ensuring a high-quality labeled data set. The implementation of these steps improves the quality of the data set and provides solid support for the effectiveness and reliability of the drone testing method.
[0098] S2: Input the labeled data into the generative adversarial network model, train the generator, and generate a simulated flight scene dataset.
[0099] Specifically, the following steps are included:
[0100] S2.1: Convert the labeled data set into a vectorized representation to generate the basic input feature matrix X, and introduce multimodal environment variables to form an extended feature matrix X ext , the expression is:
[0101] X ext =X+φ(E);
[0102]
[0103] Among them, X ext is the extended feature matrix, X is the basic input feature matrix, E is the environment variable matrix, φ(E) is the environment variable mapping function, and W env is the weight matrix of environmental variables, γ is the time attenuation factor, T is the time interval, t is the time interval variable, exp is the exponential function with the natural number e as the base, and dt is the small increment of time.
[0104] Converting the labeled data set into vectorized representation means using numerical encoding and one-hot encoding to convert each sample data into a numerical vector. The converted vectors are integrated to form the basic input feature matrix X.
[0105] Preferably, during the flight of a UAV, the impact of environmental factors (such as climate conditions, wind speed, light, etc.) on the flight mission cannot be ignored, so the introduction of multimodal environmental variables can greatly enhance the practical significance and diversity of training data.
[0106] Multimodal environmental variables include but are not limited to: meteorological conditions, such as wind speed, wind direction, temperature, etc.; flight area characteristics, such as obstacle distribution, openness of the flight area, etc.; flight time factors, such as day and night; electromagnetic environment, such as electromagnetic interference.
[0107] S2.2: Introduce a dynamic perturbation generator strategy to expand the feature matrix X ext Input into the generative adversarial network to conduct adversarial training between the generator and the discriminator to generate a simulated flight scene dataset D sim ;
[0108] The objective function expression of the dynamic disturbance generator is:
[0109]
[0110] δ(X ext )=sin(α·X ext );
[0111] in, is the target loss function of the generator, is the expectation operator, z is the noise vector sampled from the latent space distribution, and p z is the potential space distribution, D is the discriminator model, G is the generator model, δ(X ext ) is the dynamic disturbance function, and α is the disturbance coefficient, which determines the amplitude and frequency of the disturbance.
[0112] Preferably, the dynamic perturbation generator strategy introduces perturbations to make the generator output more diverse, thereby avoiding model overfitting and improving the authenticity and richness of the generated data. Through such perturbations, the generator can view data from different perturbation perspectives during training, thereby enhancing the diversity of generated data. This perturbation method can help the generator escape from the local optimal solution and enable it to better learn the complexity of the flight scene.
[0113] The objective loss function of the discriminator It can be expressed as:
[0114]
[0115] Among them, x~p real is the real data sample, G(z,δ(X ext )) is the simulated data generated by the generator, and D(x) is the probability output by the discriminator, which indicates the probability that the input x is real data.
[0116] The generator and the discriminator are trained adversarially by alternating optimization. In each round of training, the generator minimizes the loss function Learn to generate more realistic data. The discriminator minimizes the loss function Improve its ability to distinguish between real and generated data.
[0117] The training of the generator and the discriminator is performed alternately until the generator can generate sufficiently realistic data and the discriminator cannot distinguish between the generated data and the real data, and finally a simulated flight scene dataset D is generated. sim .
[0118] S2.3: Based on the generated simulated flight scene dataset D sim , introduce the variational enhancement method, perform multimodal evaluation, and obtain the simulated flight scene enhanced dataset D aug , the objective function expression of variational enhancement is:
[0119] D aug =D sim +λ·Var(D sim );
[0120] Among them, D sim D is the generated simulated flight scene dataset. aug is the enhanced data set for simulating flight scenes, λ is the enhanced weight, Var(D sim ) is the variance of the simulated data set.
[0121] Preferably, variational enhancement is performed by generating a simulated dataset D sim Enhance it to make it more representative and cover more flight scenarios and mission situations. aug , which can improve the generalization ability of the model, especially in dealing with different environments, task changes or disturbances.
[0122] The variance Var(D sim ) is expressed as:
[0123]
[0124] Where N is the number of samples in the data set, i is the index coefficient, and d i is the ith simulated data sample, is the mean of the simulated data set.
[0125] Based on the calculated variance, the data is adjusted through appropriate augmentation strategies. In feature dimensions with less variability, noise can be added or the data can be perturbed; in feature dimensions with greater variability, smoothing or regularization strategies can be used to avoid overfitting.
[0126] Preferably, by converting labeled data into vectorized representation and introducing multimodal environmental variables, combined with dynamic perturbation generator strategy and variational enhancement method, the final generated simulated flight scene data set has higher diversity and authenticity. The dynamic perturbation generator enhances the diversity of generated data by perturbing the feature matrix, avoids overfitting, and improves the authenticity of the data and the generalization ability of the generator. The variational enhancement method improves the adaptability and generalization ability of the model by calculating the variance of the generated data set and adjusting the enhancement strategy to ensure that the data set covers more flight scenarios and mission situations. Multimodal evaluation ensures the comprehensive consideration of environmental factors and flight missions, making the generated data more in line with actual application requirements and improving the safety, accuracy and robustness of the model in complex environments. These steps provide high-quality and diverse data support for the training, simulation evaluation and mission planning of drone systems, ensuring that the model can perform well in actual tasks.
[0127] S3: Pre-train the transfer learning model based on the simulated flight scene dataset.
[0128] Specifically, the following steps are included:
[0129] S3.1: Select convolutional neural network as the deep learning model and ResNet-18 as the model architecture.
[0130] It should be noted that the convolutional neural network (CNN) was chosen because of its excellent performance in feature extraction of image and time series data. ResNet-18 is a deep convolutional network that uses skip connections to effectively solve the gradient vanishing problem in deep networks and is suitable for learning complex flight scene data. The network structure contains 18 layers and can better capture the spatial and temporal features in flight data.
[0131] S3.2: Enhance the acquired simulated flight scene dataset D aug As input layer, load the model architecture.
[0132] Specifically, the enhanced flight scene dataset D aug As input, it is passed into the ResNet-18 model through forward propagation. aug It contains multimodal and rich flight data to ensure that the model can handle complex flight tasks and environmental conditions. The model architecture is loaded from the ResNet-18 predefined architecture to ensure that there are enough layers and parameters to handle complex tasks.
[0133] S3.3: Define the loss function and optimizer, and update the high-level network parameters through the back-propagation algorithm until the model converges.
[0134] Specifically, select the mean square error loss function and Adam optimizer. The mean square error loss function expression is:
[0135]
[0136] Among them, N is the number of samples, y is the actual value, and y is the model predicted value.
[0137] The back-propagation algorithm adjusts the model parameters by calculating the gradient of the loss function relative to the parameters of each layer in the network. The steps are as follows:
[0138] Forward propagation: pass the input data into the neural network and calculate the output of each layer;
[0139] Calculate loss: Calculate loss using loss function based on output and actual label;
[0140] Back propagation: Starting from the output layer, the gradient of the loss function is propagated to each layer through the chain rule, and the gradient of each parameter (such as convolution kernel, fully connected layer weight, etc.) relative to the loss function is calculated;
[0141] Update parameters: Update the network parameters using the calculated gradients through an optimizer (such as SGD, Adam).
[0142] Furthermore, learning rate decay is used to stabilize model training, expressed as:
[0143]
[0144] Among them, η 0 is the initial learning rate, γ is the decay factor, t is the number of training rounds, η t is the decaying learning rate.
[0145] After multiple rounds of training, the value of the loss function no longer changes significantly and approaches the minimum value. When the loss function tends to be stable, the model completes convergence.
[0146] S3.4: After training, use simulated flight scenes to enhance the dataset D aug Evaluate the model and save the trained transfer learning pre-trained model.
[0147] Specifically, the mean square error (MSE) is selected as the evaluation indicator. aug The dataset is divided into a validation set and a test set in a ratio of 80% / 20%. The validation set is used to adjust the hyperparameters, and the test set is used for the final performance evaluation.
[0148] The evaluation process includes calculating the MSE evaluation index on the validation set, performing inference on the test set, and obtaining the final evaluation index of the model. If there is a large gap between the performance of the model on the validation set and the test set, it may be necessary to further adjust the model or optimize the training process to avoid overfitting or underfitting.
[0149] Preferably, by selecting convolutional neural network (CNN) and ResNet-18 architecture, the spatial and temporal features in the flight scene data can be effectively captured, especially when dealing with complex multimodal environment data. Using the enhanced flight scene dataset as input, combined with the mean square error loss function and Adam optimizer, the model training process can be optimized and its accuracy can be improved. The introduction of learning rate decay helps stabilize training and avoid overfitting. By dividing the validation set and the test set, the generalization ability of the model is effectively evaluated to ensure its performance in different flight tasks. By saving the pre-trained model after training is completed, subsequent transfer learning or fine-tuning is facilitated, thereby improving the overall training efficiency and model performance. Together, they promote the stability and effectiveness of the model in complex flight scenarios.
[0150] S4: Deploy drones in actual tests to collect incremental data from real environments and fine-tune the pre-trained transfer learning model.
[0151] Specifically, the following steps are included:
[0152] S4.1: Deploy UAVs into actual flight environments to collect real-world data.
[0153] S4.2: Load the transfer learning pre-trained model and freeze the underlying convolutional layer feature extraction network.
[0154] It should be noted that freezing the underlying convolutional layers helps retain the low-level features extracted from the flight data (such as edges, textures, motion, etc.), while only fine-tuning the high-level network to adapt to the new flight environment data can effectively avoid overfitting and speed up training.
[0155] S4.3: Introduce incremental learning algorithm and regularization method, and fine-tune the high-level network of the pre-trained model based on real environment data. The expression is:
[0156]
[0157] Among them, Δθ q is the update amount of the model parameters, η is the learning rate, is the gradient of the loss function with respect to the parameter, β is the regularization strength, is the regularization term, and q is the identifier of the data subset.
[0158] Preferably, the goal of the incremental learning algorithm is to gradually adjust the high-level network of the pre-trained model to adapt it to the distribution of the new environment data, while trying to avoid catastrophic forgetting of the pre-trained features.
[0159] L2 regularization technology is selected, and the formula of the regularization term is:
[0160]
[0161] Among them, θ i are model parameters, is half the sum of the squares of all parameters.
[0162] The update amount of the model parameters is given by the following formula:
[0163]
[0164] Combined with the gradient of the L2 regularization term, the formula is expanded as follows:
[0165]
[0166] in This is the gradient of the L2 regularization with respect to the parameters.
[0167] S4.4: Select mean square error (MSE) as the loss function, use Adam optimizer, and adjust model parameters.
[0168] Specifically, the total loss function of the fine-tuning process is:
[0169]
[0170] in, is the original mean square error loss function, and β is the regularization strength, which is used to control the weight of the regularization term.
[0171] Use Adam optimizer to optimize the total loss function Perform optimization and adjust the parameters of high-level networks.
[0172] Preferably, the fine-tuning process of the transfer learning model in the actual environment is optimized by freezing the bottom convolutional layer, introducing incremental learning and L2 regularization. Freezing the bottom layer helps to retain the low-level features extracted from the flight data, avoid catastrophic forgetting and accelerate training; incremental learning ensures that the model gradually adapts to the new flight environment data and improves the adaptability of the model; L2 regularization prevents overfitting and improves the generalization ability of the model; at the same time, the Adam optimizer stabilizes the training process through adaptive learning rate. The total loss function combines the mean square error and regularization terms to further optimize the high-level network parameters. It effectively improves the accuracy, stability and computational efficiency of the model, ensuring the high performance and robustness of the drone in practical applications.
[0173] S5: Generate flight mission planning based on the fine-tuned transfer learning model and complete simulation evaluation by combining it with the simulated flight scenario dataset.
[0174] Specifically, the following steps are included:
[0175] S5.1: Input the objective parameters of the flight mission, decompose the flight mission objectives, and complete the constraint definition.
[0176] Specifically, input the target parameters of the flight mission according to the actual application requirements of the drone (for example: surveying, inspection, delivery, etc.). Decompose the mission objectives into specific flight subtasks, such as cruise path planning, charging / battery management, flight stability control, etc. Based on the output of the pre-trained model and combined with the flight mission requirements, define a series of constraints, such as obstacle avoidance requirements, minimum flight altitude, flight time limit, etc.
[0177] S5.2: Input the decomposed flight mission and constraints into the fine-tuned transfer learning model to generate a flight mission plan.
[0178] Specifically, the above mission objectives and constraints are input into the fine-tuned transfer learning model. The fine-tuned model has been optimized on the actual environment data and can better understand the actual requirements of the flight mission. The high-level network in the model is used to predict the decision variables related to the flight mission, such as the optimal route, flight strategy, flight phase, etc.
[0179] S5.3: From the simulated flight scene dataset D aug In the flight simulation, select a simulated flight environment similar to the actual flight environment and import it into the flight simulation platform.
[0180] Among them, flight simulation platforms include AirSim, X-Plane, MATLAB, etc.
[0181] S5.4: Use the flight simulation platform to execute flight planning schemes, simulate the performance of the UAV in different flight scenarios, and collect data.
[0182] S5.5: Monitor the mission performance of the UAV and conduct simulation evaluation of the flight mission.
[0183] Specifically, the path tracking evaluation is performed using the least squares method, and the error evaluation expression is:
[0184]
[0185] Among them, x i is the actual horizontal coordinate of the aircraft at the i-th moment, y i is the actual ordinate of the aircraft at the i-th moment, is the predetermined horizontal coordinate of the target trajectory at the i-th moment, is the predetermined ordinate of the target trajectory at the i-th moment, N is the number of trajectory points, i is the index coefficient of the number of trajectory points, and E is the total deviation between the actual trajectory of the aircraft and the target trajectory.
[0186] The target recognition and detection evaluation is performed through F1-Score, and the expression is:
[0187]
[0188]
[0189]
[0190] Among them, TP is a true positive example, FP is a false positive example, and FN is a false negative example.
[0191] The task completion rate and success rate are evaluated based on the achievement of task objectives.
[0192] S5.6: Further optimize the flight mission planning based on the simulation evaluation results.
[0193] Specifically, based on the simulation evaluation results, the deficiencies in the flight mission are identified, and the flight mission planning is adjusted and optimized. Possible optimization measures include replanning the flight path, adjusting the flight speed, redefining the constraints, etc. The flight mission planning can be further adjusted and improved by reusing the transfer learning model to ensure the success rate and efficiency of the mission.
[0194] Preferably, by refining the decomposition of flight mission objectives, defining constraints, and applying fine-tuned transfer learning models, an adaptable and accurate flight mission plan can be generated. Combined with the simulation platform's evaluation of flight paths, target identification, and mission completion, potential problems in flight missions can be accurately detected, and mission success rates and execution efficiency can be improved through optimization and adjustment. Simulation evaluation not only ensures the robustness of mission planning in complex environments, but also reduces risks and resource waste in actual flights by continuously iterating and optimizing models and mission planning, thereby achieving efficient, safe, and accurate drone mission execution.
[0195] This embodiment also provides a model-based UAV system testing system, including:
[0196] The data collection module is used to collect the UAV operation data, pre-process the data, and label and classify the pre-processed data;
[0197] The scenario generation module is used to input the labeled data into the generative adversarial network model, train the generator, and generate a simulated flight scenario dataset;
[0198] Model training module, used to pre-train the transfer learning model based on the simulated flight scenario dataset;
[0199] The model fine-tuning module is used to deploy drones in actual tests, collect incremental data from real environments, and fine-tune the pre-trained transfer learning model;
[0200] The simulation evaluation module is used to generate flight mission planning based on the fine-tuned transfer learning model and complete simulation evaluation in combination with the simulated flight scenario dataset.
[0201] This embodiment also provides a computer device, which is suitable for the case of a model-based drone system testing method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the model-based drone system testing method proposed in the above embodiment.
[0202] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0203] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the model-based unmanned aerial vehicle system testing method proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0204] In summary, the present invention generates a diverse flight scenario data set by inputting labeled data into a generative adversarial network (GAN) for training, and introduces multimodal environmental variables and a dynamic disturbance generator strategy, thereby enhancing the quality and diversity of simulated data, thereby improving the accuracy and comprehensiveness of UAV testing. At the same time, by optimizing the data set through a variational enhancement method, the generalization ability and adaptability of simulated flight data are further improved, providing more abundant and effective test data for subsequent mission planning and flight simulation. The pre-trained model is fine-tuned through incremental learning of actual environmental data, combined with a regularization method, to improve the adaptability and accuracy of the model. Incremental learning enables the model to dynamically adapt to new flight missions, while the regularization method effectively avoids overfitting and ensures the stability and efficiency of the fine-tuning process. By generating high-quality flight data and continuously updating the model, the present invention effectively improves the testing and mission planning capabilities of the UAV system in a complex environment, reduces the testing cost, and enhances the adaptability and reliability of the model.
[0205] Example 2, referring to Table 1, is the second example of the present invention. To further verify the technical solution of the present invention, experimental simulation data of a model-based UAV system testing method is provided.
[0206] The experiment first collected the UAV operation data through the built-in flight control unit and multimodal sensors, including parameters such as flight path, speed, ambient temperature, air pressure, and battery power. The UAV operation data was transmitted back to the ground station through a wireless communication link, and the data was cleaned, filtered, standardized, and normalized to eliminate noise and outliers. Subsequently, the label type was defined based on the flight mission, environmental conditions, and flight status, and the data set was labeled and classified. To address the label imbalance problem, a combination of oversampling and undersampling was used to balance the number of samples in each category. Finally, cross-validation and consistency checks were used to ensure the accuracy of the labeled data.
[0207] Next, the labeled dataset is converted into a vectorized representation to generate a basic input feature matrix, and an extended feature matrix is constructed in combination with environmental variables. Through the dynamic perturbation generator strategy, the extended feature matrix is input into the generative adversarial network to perform adversarial training between the generator and the discriminator to generate a simulated flight scene dataset. The introduction of the dynamic perturbation function increases the diversity of the simulated data, and the variational enhancement method is used to further expand the dataset and generate an enhanced dataset.
[0208] The transfer learning model based on the ResNet-18 architecture is pre-trained using an enhanced dataset, and the network parameters are updated through back-propagation until the model converges. The drone is then deployed in the actual flight environment, incremental data from real flights are collected, and the pre-trained model is fine-tuned based on the incremental learning algorithm. During the optimization process, the underlying convolutional layer feature extraction network is frozen, and only the high-level network parameters are adjusted to ensure that the model can efficiently adapt to the new environment. Finally, based on the fine-tuned transfer learning model, a flight mission plan is generated, and a simulation evaluation is completed on the flight simulation platform in combination with a simulated flight scenario dataset.
[0209] During the simulation evaluation process, the target parameters of the flight mission are input and the constraints are defined to simulate the UAV's performance of flight missions in various complex scenarios (such as strong winds and areas with dense obstacles), and its mission completion rate, path optimization degree and energy consumption performance are recorded.
[0210] The details are shown in Table 1 below:
[0211] Table 1 Experimental record table
[0212]
[0213] Through the analysis of experimental data, the effectiveness of the model-based UAV system testing method can be seen. The flight mission completion rate (92%-95%) and path optimization degree (85%-88%) of the experimental group are higher than those of the control group (85%-87% and 75%-78%), the unit energy consumption (11.8-12.5Wh / km) of the experimental group is lower than that of the control group (13.9-14.2Wh / km), and the model training convergence time of the experimental group (43-45 minutes) is also shorter than that of the control group (48-50 minutes). It shows that the flight mission planning based on the simulated flight scene dataset and the transfer learning model can effectively improve the task completion efficiency of the UAV in complex scenarios, optimize the flight path, and reduce unnecessary resource consumption. Thanks to the diversity of the simulated flight scene dataset and the high efficiency of the transfer learning model, the UAV can choose a more energy-saving flight strategy in a changing environment. The simulated flight scene dataset generated by the generative adversarial network and the dynamic perturbation generator has higher authenticity and diversity, so that the transfer learning model can better adapt to the actual flight environment.
[0214] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A model-based UAV system testing method, characterized by: include, Collect drone operation data, pre-process the data, and label and classify the pre-processed data; Input the labeled data into the generative adversarial network model, train the generator, and generate a simulated flight scene dataset; Pre-train the transfer learning model based on the simulated flight scenario dataset; Deploy drones in actual tests to collect incremental data from real environments and fine-tune pre-trained transfer learning models; Based on the fine-tuned transfer learning model, the flight mission plan is generated and combined with the simulated flight scenario dataset to complete the simulation evaluation.
2. The model-based UAV system testing method according to claim 1, characterized in that: The specific steps of collecting the drone operation data and preprocessing the data are as follows: The built-in flight control unit and sensors record the drone's operating data, and transmit the drone's operating data back to the ground station via a wireless communication link; Clean, filter, standardize and normalize the UAV operation data transmitted back to the ground station; Feature extraction is performed on the preprocessed UAV operation data, and the extracted features are incorporated into the UAV operation dataset.
3. The model-based UAV system testing method according to claim 2, characterized in that: The specific steps of labeling and classifying the preprocessed data are as follows: Define tag types based on flight missions, environmental conditions, and flight status; Based on the defined label type, the preprocessed UAV operation data set is labeled to obtain a labeled data set; Use oversampling and undersampling methods to balance the number of samples of each type of label in the labeled dataset; The labeled dataset is verified through cross-validation and consistency checking.
4. The model-based UAV system testing method according to claim 3, characterized in that: The labeled data is input into the generative adversarial network model, the generator is trained, and a simulated flight scene data set is generated. The specific steps are: Convert the labeled data set into a vectorized representation to generate the basic input feature matrix X, and introduce multimodal environment variables to form an extended feature matrix X ext , the expression is: X ext =X+φ(E); Among them, X ext is the extended feature matrix, X is the basic input feature matrix, E is the environment variable matrix, φ(E) is the environment variable mapping function, and W env is the weight matrix of environmental variables, γ is the time attenuation factor, T is the time interval, t is the time interval variable, exp is the exponential function with the natural number e as the base, and dt is the small increment of time; Introducing a dynamic perturbation generator strategy, the expanded feature matrix X ext Input into the generative adversarial network to conduct adversarial training between the generator and the discriminator to generate a simulated flight scene dataset D sim ; The objective function expression of the dynamic disturbance generator is: δ(X ext )=sin(α·X ext ); in, is the target loss function of the generator, is the expectation operator, z is the noise vector sampled from the latent space distribution, and p z is the potential space distribution, D is the discriminator model, G is the generator model, δ(X ext ) is the dynamic disturbance function, α is the disturbance coefficient; Based on the generated simulated flight scene dataset D sim , introduce the variational enhancement method, perform multimodal evaluation, and obtain the simulated flight scene enhanced dataset D aug , the objective function expression of variational enhancement is: D aug =D sim +λ·Var(D sim ); Among them, D sim D is the generated simulated flight scene dataset. aug is the enhanced data set for simulating flight scenes, λ is the enhanced weight, Var(D sim ) is the variance of the simulated data set.
5. The model-based UAV system testing method according to claim 4, characterized in that: The transfer learning model pre-training is performed based on the simulated flight scene data set, and the specific steps are as follows: Select convolutional neural network as the deep learning model and ResNet-18 as the model architecture; The acquired simulated flight scene enhanced dataset D aug As an input layer, load the model architecture; Define the loss function and optimizer, and update the high-level network parameters through the back-propagation algorithm until the model converges; After training is completed, the simulated flight scene is used to enhance the dataset D aug Evaluate the model and save the trained transfer learning pre-trained model.
6. The model-based UAV system testing method according to claim 5, characterized in that: The specific steps of deploying drones in actual tests, collecting incremental data from real environments, and fine-tuning the pre-trained transfer learning model are as follows: Deploy drones into actual flight environments to collect real-world data; Load the transfer learning pre-trained model and freeze the underlying convolutional layer feature extraction network; Incremental learning algorithms and regularization methods are introduced to fine-tune the high-level network of the pre-trained model based on real environment data. The expression is: Among them, Δθ q is the update amount of the model parameters, η is the learning rate, is the gradient of the loss function with respect to the parameter, β is the regularization strength, is the regularization term, q is the identifier of the data subset; Select mean square error as the loss function, use Adam optimizer, and adjust the model parameters.
7. The model-based UAV system testing method according to claim 6, characterized in that: The flight mission plan is generated based on the fine-tuned transfer learning model, and the simulation evaluation is completed in combination with the simulated flight scene data set. The specific steps are: Input the target parameters of the flight mission, decompose the flight mission objectives, and complete the constraint definition; The decomposed flight mission and constraints are input into the fine-tuned transfer learning model to generate the flight mission plan; From the simulated flight scene dataset D aug In the flight simulation, select a simulated flight environment similar to the actual flight environment and import it into the flight simulation platform; Use the flight simulation platform to execute flight planning schemes, simulate the performance of drones in different flight scenarios, and collect data; Monitor the mission execution of drones and conduct simulation evaluation of flight missions; Based on the simulation evaluation results, the flight mission planning is further optimized.
8. A model-based UAV system testing system, based on the model-based UAV system testing method according to any one of claims 1 to 7, characterized in that: Including data collection module, scenario generation module, model training module, model fine-tuning module, simulation evaluation module; The data collection module is used to collect the drone operation data, pre-process the data, and label and classify the pre-processed data; The scenario generation module is used to input the labeled data into a generative adversarial network model, train the generator, and generate a simulated flight scenario data set; The model training module is used to perform transfer learning model pre-training based on a simulated flight scenario data set; The model fine-tuning module is used to deploy drones in actual tests, collect incremental data from real environments, and fine-tune the pre-trained transfer learning model; The simulation evaluation module is used to generate a flight mission plan based on the fine-tuned transfer learning model and complete the simulation evaluation in combination with the simulated flight scenario data set.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the model-based unmanned aerial vehicle system testing method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the model-based UAV system testing method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Large model construction method for safe flight of low-altitude unmanned aerial vehicle
CN120010553A
Civil aviation flight student multi-dimensional evaluation method
CN120296360A
Aircraft test method and system for simulating flight environment
CN120573278A
A method and system for testing aircraft in a simulated flight environment
CN120573278B
Robot control strategy migration method, system and device, medium and program product
CN120755885A