Unmanned aerial vehicle obstacle avoidance method and device and electronic equipment
By processing environmental images and training decision-making models through lightweight neural networks, the problem of low autonomous obstacle avoidance capabilities of UAVs in unknown three-dimensional environments is solved, and the obstacle avoidance efficiency and robustness are improved.
Patent Information
- Application Number
- CN202410957250.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-15
AI Technical Summary
In an unknown three-dimensional environment, traditional drone obstacle avoidance algorithms need to build an offline three-dimensional map, and cannot use experience to iterate during the obstacle avoidance process, resulting in low autonomous obstacle avoidance capabilities and efficiency.
A lightweight neural network is used to process environmental image information through variational autoencoders, extract potential state information, and use proximal policy optimization algorithms to train the target decision model and generate action decision results to perform obstacle avoidance.
It realizes autonomous obstacle avoidance of UAVs in unknown three-dimensional environments, improves obstacle avoidance efficiency and robustness, and reduces computational complexity and noise impact.
Smart Images

Figure CN118778675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle flight control, and in particular to an unmanned aerial vehicle obstacle avoidance method, device and electronic equipment. Background Art
[0002] Small drones are relatively small and lightweight unmanned aerial systems. They are usually highly portable, easy to operate, and relatively inexpensive. The design of a small drone usually includes one or more rotors, fixed wings, or hybrid wings, as well as a series of sensors and control systems. These drones can be controlled and operated by remote controls, mobile phone applications, or automated flight plans, and are widely used in both civil and military fields. However, real-time autonomous navigation in unfamiliar environments faces great challenges. Autonomous obstacle avoidance in unknown three-dimensional environments with unclear structures and changing light conditions remains an urgent problem to be solved.
[0003] Traditional obstacle avoidance algorithms for drones require the construction of an offline three-dimensional or three-dimensional map. Based on the global map, the optimal path is calculated using a path search algorithm with obstacle points as constraints. Although some obstacle avoidance algorithms avoid the complicated map construction work, they require manual adjustment of a large number of parameters and the robot cannot use obstacle avoidance experience to self-iterate during the obstacle avoidance process. With the development of machine learning, researchers have introduced supervised learning into obstacle avoidance for drones, and regard obstacle avoidance as a classification problem based on supervised learning, but each sample label needs to be annotated, which is undoubtedly time-consuming and laborious.
[0004] In the process of drone obstacle avoidance, how to make full use of drone spatial information, avoid environment construction work, simplify algorithm models, improve drone autonomous obstacle avoidance capability and drone obstacle avoidance efficiency, and ultimately enable drones to reach designated destinations more safely and efficiently is still a problem that needs to be solved. Summary of the invention
[0005] The present invention provides a method, device and electronic equipment for unmanned aerial vehicle obstacle avoidance, which utilizes a lightweight neural network to replace the complex traditional flight control process, thereby greatly improving the computing efficiency while ensuring the continuity of the action.
[0006] According to one aspect of the present invention, a method for avoiding obstacles in a drone is provided, comprising:
[0007] Acquire environmental image information, and process the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information;
[0008] Inputting the potential state information into a target decision model to obtain an action decision result output by the target decision model, wherein the target decision model is obtained by training an initial decision model based on a proximal strategy optimization algorithm;
[0009] The drone avoids obstacles based on the action decision result.
[0010] According to another aspect of the present invention, there is provided a drone obstacle avoidance device, comprising:
[0011] A state information determination module is used to obtain environmental image information and process the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information;
[0012] An action decision determination module, used for inputting the potential state information into a target decision model to obtain an action decision result output by the target decision model, wherein the target decision model is obtained by training an initial decision model based on a proximal strategy optimization algorithm;
[0013] The action decision execution module is used to execute the drone obstacle avoidance based on the action decision result.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the drone obstacle avoidance method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the drone obstacle avoidance method described in any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention obtains the potential state information corresponding to the environmental image information by acquiring environmental image information and processing the environmental image information based on the variational autoencoder. Based on the data dimensionality reduction method, noise can be effectively removed and key features of the image can be extracted, thereby providing input data with smaller and better information volume. Then, the potential state information is input into the target decision model to obtain the action decision result output by the target decision model, wherein the target decision model is obtained by training the initial decision model based on the proximal strategy optimization algorithm; the drone obstacle avoidance is performed based on the action decision result, which solves the problems of being unable to achieve autonomous obstacle avoidance in an unknown three-dimensional environment, or being unable to use obstacle avoidance experience for self-iteration, or needing to label each sample label, the autonomous obstacle avoidance capability of the drone, and the low obstacle avoidance efficiency of the drone. The technical solution of the embodiment of the present invention uses a lightweight neural network to replace the complex traditional flight control process, greatly improving the computing efficiency while ensuring the continuity of the action. At the same time, a deep neural network is used, and various scenes and flight operation behaviors can be learned through a large amount of training data, ensuring that the drone can adapt to dynamic and complex operation scenes, thereby improving the robustness of the drone system operation.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flowchart of a method for avoiding obstacles in a drone provided in Embodiment 1 of the present invention;
[0023] Figure 2 A structural diagram of a variational autoencoder provided in Embodiment 1 of the present invention;
[0024] Figure 3 A flowchart of a method for avoiding obstacles in a drone provided by Embodiment 2 of the present invention;
[0025] Figure 4 The pruned strategy optimization function graph provided in the second embodiment of the present invention;
[0026] Figure 5 A framework diagram of a drone obstacle avoidance method provided in Embodiment 2 of the present invention;
[0027] Figure 6 A diagram of the training environment structure provided in the second embodiment of the present invention;
[0028] Figure 7 A schematic diagram of the average obstacle avoidance times provided in the second embodiment of the present invention;
[0029] Figure 8 A schematic diagram of the structure of an obstacle avoidance device for a drone provided in Embodiment 3 of the present invention;
[0030] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] Figure 1 This is a flow chart of a drone obstacle avoidance method provided in Example 1 of the present invention. This embodiment can be applied to real-time autonomous navigation in an unfamiliar environment, and to autonomously avoid obstacles in an unknown three-dimensional environment with unclear structure and changing light conditions. The method can be executed by a drone obstacle avoidance device, which can be implemented in the form of hardware and / or software, and can be configured in a small drone.
[0035] like Figure 1 As shown, the method includes:
[0036] S110, acquiring environmental image information, and processing the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information.
[0037] The environmental image information can be the information corresponding to the image of the current environment taken by the drone; the variational autoencoder (VAE) is a generative model that aims to learn the potential representation of data and generate new data samples through the representation. The variational autoencoder maps the data to the latent space through the encoder and generates data by sampling from the latent space through the decoder, thereby modeling and generating the latent structure of the data, thereby eliminating unimportant or redundant components in the data and reducing the data dimension into a more compact expression.
[0038] Specifically, the camera of the drone can be used to collect environmental image information. Environmental image information contains important visual features about the surrounding environment, which is crucial for the navigation and obstacle avoidance of the drone. The variational autoencoder is a generative model that can encode high-dimensional image data into a low-dimensional latent state representation and reconstruct the original image from it. The environmental image information is input into the encoder part of the VAE, and the encoder compresses the image into a lower-dimensional latent state information, which contains the main features of the environmental image. After obtaining the latent state information, it can be used for various tasks, such as controlling the drone to perform obstacle avoidance tasks. The beneficial effect of this is that by reducing the dimensionality of the data, noise can be effectively removed and the key features of the image can be extracted, thereby providing smaller and better information data as the data basis for drone obstacle avoidance.
[0039] In an embodiment of the present invention, before the variational autoencoder processes the environmental image information, it also includes: inputting image sample information into the encoder of the variational autoencoder to obtain sample potential state information corresponding to the image sample information; inputting the sample potential state information into the decoder of the variational autoencoder to obtain state restoration information corresponding to the image sample information; and optimizing the variational autoencoder based on the state restoration information and the objective function of the variational autoencoder.
[0040] It is understandable that in order to ensure that VAE can effectively learn and represent image data, so as to obtain more accurate potential state information when subsequently processing environmental image information, the variational autoencoder can also be optimized before the variational autoencoder processes the environmental image information.
[0041] The image sample information may be information corresponding to some image samples acquired in advance, and some image sample information is selected and input into the encoder part of the VAE. The image sample information may be a data set similar to the environment image information to ensure that the VAE can effectively learn and process these images. For example, the image sample and the environment image may be images of the same scene.
[0042] Specifically, the encoder processes the input image sample information and compresses it into a low-dimensional latent state representation, namely the sample latent state information. Further, the latent state information is input into the decoder part of the VAE. Through the task of the decoder, the image sample is reconstructed or restored according to the latent state to obtain the state restoration information. Finally, by comparing the image sample information and the state restoration information, a loss value can be calculated. This loss value reflects the performance of the VAE during the encoding and decoding process. Based on the loss value and the objective function of the VAE, the parameters of the VAE can be optimized to improve its performance.
[0043] Exemplarily, the process of processing the image sample information by the variable self-decomposition encoder is as follows:
[0044] For an input image sample Xk, assume that there is a distribution p(Z|X k ), and further assume that this distribution is an independent, multivariate normal distribution, construct two neural networks μ k =f1(X k ), logσ 2 =f2(X k ) to calculate the mean and variance of the normal distribution, respectively.
[0045] Figure 2 The variational autoencoder structure diagram provided in the first embodiment of the present invention is as follows: Figure 2 Shown: X i (i=1,2,3,4,5,6) are input image samples; the mean is μ k =f1(X k ), the variance is logσ 2 =f2(X k ), the normal distribution is p(Z|X k ); after the image is input, a normal distribution is generated, and the potential state Z is obtained by sampling from the normal distribution i (i=1,2,3,4,5,6), and then restored to the original state X of the image sample through the generator i (i=1,2,3,4,5,6).
[0046] For example, the input depth map is set to a grayscale image of 128×72 and the number of channels is 1. The encoding network consists of a four-layer convolutional neural network, and each convolution layer uses a (4×4) convolution kernel. Before decoding, the present invention expands the potential code into data of size 1024×1×3. In order to successfully restore the data to its original size, the present invention uses convolution kernels of sizes (5×7), (6×8), (7×8) and (8×6). In the decoding part, in order to minimize the error between the decoded and the original image, the objective function is adopted as follows:
[0047]
[0048] In the above formula, n is the number of samples, p(x i |z i ) is the probability of generating the original image according to the latent state, d is the dimension of the latent variable z, μ i and σ i The mean and variance of the normal distribution are generated according to the i-th input image. By minimizing the objective function, a compact encoding with the least information loss compared to the original image is obtained.
[0049] S120, inputting the potential state information into a target decision model to obtain an action decision result output by the target decision model.
[0050] Among them, the target decision model can be a deep neural network model, which is used to predict the action decision of the drone based on the input potential state information; the target decision model is obtained by training the initial decision model based on the proximal strategy optimization algorithm.
[0051] Specifically, the latent state information obtained by the variational autoencoder is used as input and passed to the trained target decision model, which can process the input latent state information and output the action decision result. The action decision result can include the speed, direction, altitude, etc. of the drone, which is used to guide the drone to avoid obstacles safely.
[0052] S130: Execute obstacle avoidance for the drone based on the action decision result.
[0053] Specifically, the action decision result can be converted into a specific instruction that the drone control system can understand and execute, and the drone control system adjusts its flight state according to the specific instruction to perform obstacle avoidance action. Through the above process, the drone can adjust its flight state in real time to avoid obstacles based on the output of the target decision model, thereby achieving safe and efficient flight.
[0054] The technical solution of the embodiment of the present invention obtains the potential state information corresponding to the environmental image information by acquiring environmental image information and processing the environmental image information based on the variational autoencoder. Based on the data dimensionality reduction method, noise can be effectively removed and key features of the image can be extracted, thereby providing input data with smaller and better information volume. Then, the potential state information is input into the target decision model to obtain the action decision result output by the target decision model, wherein the target decision model is obtained by training the initial decision model based on the proximal strategy optimization algorithm; the drone obstacle avoidance is performed based on the action decision result, which solves the problems of being unable to achieve autonomous obstacle avoidance in an unknown three-dimensional environment, or being unable to use obstacle avoidance experience for self-iteration, or needing to label each sample label, the autonomous obstacle avoidance capability of the drone, and the low obstacle avoidance efficiency of the drone. The technical solution of the embodiment of the present invention uses a lightweight neural network to replace the complex traditional flight control process, greatly improving the computing efficiency while ensuring the continuity of the action. At the same time, a deep neural network is used, and various scenes and flight operation behaviors can be learned through a large amount of training data, ensuring that the drone can adapt to dynamic and complex operation scenes, thereby improving the robustness of the drone system operation.
[0055] Embodiment 2
[0056] Figure 3 This is a flow chart of a method for avoiding obstacles in a drone provided in the second embodiment of the present invention. Based on the above embodiment, this embodiment further refines the training process of the target decision model. The specific implementation method can refer to the technical solution of this embodiment. The technical terms that are the same or corresponding to the above embodiment are not repeated here. Figure 3 As shown, the method includes:
[0057] S210: construct an initial decision model.
[0058] Among them, the initial decision model is a deep neural network model, and the deep neural network model can be a deep reinforcement learning network model. The initial decision model includes: an input layer, a hidden layer and an output layer, and the connection mode of the input layer, the hidden layer and the output layer is fully connected; the activation function of the initial decision model is a ReLU function. In an embodiment of the present invention, a three-layer fully connected layer neural network is constructed, and the ReLU function is selected as the activation function in the layer, which fully simplifies the calculation process and accelerates the convergence speed of gradient descent.
[0059] It can be understood that the deep reinforcement learning network model is a decision-making model built based on the idea of reinforcement learning. Therefore, before constructing the initial decision-making model, the state space, action space and reward and punishment function of reinforcement learning can be constructed according to the Markov process.
[0060] The state space S contains the attributes and information of the agent in the environment, and is used as a basis for selecting the action to be performed. This embodiment uses the compact encoding (latent state information) after dimensionality reduction as the state space of the PPO agent; selects two states of the drone: speed v (m / s) and yaw angular velocity As the main action, in order to avoid the problem of global positioning required to use location information. In order to ensure that the drone "survives" long enough in an unfamiliar environment, it is also necessary to avoid obstacles as much as possible during the flight to reach the designated target point, rather than standing still or falling into a local optimal state. Therefore, the design of the reward function should not only encourage the drone to reach the target point from the origin, but also punish the drone for collision. When the drone collides, a penalty of -20 is given and the round is stopped; when the drone successfully reaches the end point, a reward of +20 is given and the round is stopped.
[0061] S220: Input the potential state information to be used corresponding to the sample image to be used into the initial decision model to obtain a decision result to be used.
[0062] The sample images to be used refer to sample images used to train the initial decision model, and the decision results to be used include the speed and yaw angular velocity of the drone.
[0063] Specifically, the sample image to be used is converted into potential state information, i.e., the state information to be used, through the trained variational autoencoder; the potential state information to be used is further input into the initial decision model, and the initial decision model outputs the speed and yaw angular velocity prediction values of the UAV according to the input potential state information to be used, and these prediction values constitute the decision result to be used.
[0064] S230. Based on the potential state information to be used and the decision result to be used, the strategy of the initial decision model is updated through the proximal strategy optimization algorithm to obtain the target decision model.
[0065] Among them, Proximal Policy Optimization (PPO) is a reinforcement learning algorithm widely used in policy gradient methods, which aims to ensure the stability of the policy by limiting the amplitude of policy updates. The target decision model can be the model obtained after the final training.
[0066] Specifically, the parameters of the initial decision model are updated through the PPO algorithm according to the potential state information to be used and the decision results to be used. The PPO algorithm can evaluate the quality of the current strategy based on the reward function, and fine-tune the network weights based on the evaluation results, thereby improving the strategy of the decision model. After multiple iterations and optimizations, the initial decision model will gradually converge to a better strategy, which can be regarded as the target decision model. The target decision model can output better drone speed and yaw rate control instructions based on the input potential state information.
[0067] In the embodiment of the present invention, preferably, the policy update of the initial decision model based on the potential state information to be used and the decision result to be used by the proximal policy optimization algorithm includes: determining the potential state information to be used and the decision result to be used, and determining the importance sampling ratio; based on the importance sampling ratio and the clipping function, determining the policy optimization function of the initial decision model, and updating the policy of the initial decision model based on the policy optimization function.
[0068] It is understandable that the Importance Sampling Ratio is used to measure the difference between the current policy and the old policy. In reinforcement learning, when the policy is updated, it is usually hoped that the new policy will not deviate too far from the old policy to avoid performance instability caused by excessive policy changes.
[0069] The importance sampling ratio is usually defined as the ratio of the probability of taking the same action under the new strategy and the old strategy. Based on this ratio, we can understand the degree of change of the new strategy relative to the old strategy.
[0070] The formula for importance sampling ratio is as follows:
[0071]
[0072] Among them, π θ (a t |s t ) is the current strategy θ, in state s t Select action a t The probability of Under the old strategy, in state s t Select action a t probability.
[0073] Furthermore, the core idea of the PPO algorithm is to limit the difference between the new strategy and the old strategy at each update to ensure the stability of the strategy. This is usually achieved through a clipping function, which clips the importance sampling ratio to prevent it from being too large. The clipping function is used to control the degree of clipping. When the importance sampling ratio exceeds a certain range, the clipping function will limit it to a reasonable range. The formula of the clipping function CLIP is as follows:
[0074] CLIP=clip(r t (θ),1-ε,1+ε)
[0075] In the formula, r t (θ) is the importance sampling ratio, and ε is the given limit update amplitude.
[0076] Combined with the importance sampling ratio after clipping, a policy optimization function (such as a loss function) can be defined, which aims to maximize the expected return while limiting the magnitude of the policy update. The policy optimization function can be used to optimize the policy of the initial decision model. The policy optimization function is as follows:
[0077]
[0078] in, It is the advantage function, which indicates the advantage of an action a over the average in state s. Refers to the estimate of expectation at time t.
[0079] in, Figure 4 This is a pruned strategy optimization function diagram provided in Example 2 of the present invention.
[0080] In the embodiment of the present invention, the proximal policy optimization algorithm introduces importance sampling and clipping to simplify calculations, improve data utilization and limit updates to solve the problem of high cost of online reinforcement learning in the guidance field. Importance sampling is a statistical technique used in reinforcement learning to estimate the expected value under the target policy. By introducing the importance sampling ratio, samples sampled from the behavior policy are effectively used to adjust the estimate and correct the sampling bias.
[0081] S240: Acquire environmental image information, and process the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information.
[0082] S250: Input the potential state information into a target decision model to obtain an action decision result output by the target decision model.
[0083] S260: Execute drone obstacle avoidance based on the action decision result.
[0084] In the embodiment of the present invention, optionally, after executing the drone obstacle avoidance based on the action decision result, it also includes: acquiring a current environment image through the drone, and updating the environment image information based on the current environment image.
[0085] Specifically, during the obstacle avoidance process, the drone's sensors and cameras will continuously monitor the surrounding environment and feed back new environmental image information to the variational autoencoder and target decision model, allowing the drone to continuously adjust its flight path based on real-time environmental information to ensure safe obstacle avoidance.
[0086] Figure 5 A framework diagram of a drone obstacle avoidance method provided in Example 2 of the present invention, which is an end-to-end drone obstacle avoidance method based on a lightweight neural network. In each simulation step, the drone agent receives potential state information from the variational autoencoder, makes decisions and returns them to the environment. The environment updates the relevant position and state information according to the agent's decision, and calculates the corresponding reward value based on the current state, thereby completing a simulation process. After completing a simulation, the reinforcement learning model transfers the reward value to each node through back propagation to optimize the evaluation network. After several iterative trainings, it finally converges to the optimal action decision.
[0087] During the test, the drone only took off from the initial starting point and tried to avoid obstacles without any noise. The drone that safely passed 5 obstacles and touched the end wall was considered to have passed the test. In order to verify whether the drone can adapt to certain environmental changes, we repeatedly changed the order of the walls for testing, such as Figure 4 The test environment contains three obstacles in different order. They are a training environment (the obstacle order is 12345) and two reconfigured environments (the obstacle order is 34125 and 53412). Figure 6 This is a structural diagram of the training environment provided in Example 2 of the present invention.
[0088] In the simulation test, the network is updated after each round, and the average number of obstacle avoidances of the drone agent within 50 rounds is recorded during the training process. 50 rounds are used to calculate the average because the agent changes the starting point to the next level every 10 epochs. After 50 rounds, the starting point passes through all levels and then returns to level 1. Ideally, if the drone completes all obstacle avoidances without collision within 50 rounds, the average number of obstacle avoidances should be 3 times. Figure 7 This is a schematic diagram of the average obstacle avoidance times provided in the second embodiment of the present invention, from Figure 7It can be seen that as the training progresses, the average number of obstacle avoidances can gradually stabilize at more than 1, and is close to 2 after 4000 trainings. The test results show that the method proposed in the present invention can significantly reduce the number of layers of state input while retaining effective information, and greatly improve the computational efficiency while ensuring the continuity of the action, which reflects the advantages of the method.
[0089] The technical solution of the embodiment of the present invention obtains the potential state information corresponding to the environmental image information by acquiring environmental image information and processing the environmental image information based on the variational autoencoder. Based on the data dimensionality reduction method, noise can be effectively removed and key features of the image can be extracted, thereby providing input data with smaller and better information volume. Then, the potential state information is input into the target decision model to obtain the action decision result output by the target decision model, wherein the target decision model is obtained by training the initial decision model based on the proximal strategy optimization algorithm; based on the action decision result, the drone obstacle avoidance is performed, which solves the problems of being unable to achieve autonomous obstacle avoidance in an unknown three-dimensional environment, or being unable to use obstacle avoidance experience for self-iteration, or needing to label each sample label, the autonomous obstacle avoidance capability of the drone, and the low obstacle avoidance efficiency of the drone. The technical solution of the embodiment of the present invention uses a lightweight neural network to replace the complex traditional flight control process, greatly improving the computing efficiency while ensuring the continuity of the action. At the same time, a deep neural network is used, and various scenes and flight operation behaviors can be learned through a large amount of training data, ensuring that the drone can adapt to dynamic and complex operation scenes, thereby improving the robustness of the drone system operation.
[0090] Embodiment 3
[0091] Figure 8 This is a schematic diagram of the structure of a drone obstacle avoidance device provided by Embodiment 3 of the present invention. Figure 8 As shown, the device comprises:
[0092] The state information determination module 310 is used to obtain environmental image information and process the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information;
[0093] An action decision determination module 320 is used to input the potential state information into a target decision model to obtain an action decision result output by the target decision model, wherein the target decision model is obtained by training an initial decision model based on a proximal strategy optimization algorithm;
[0094] The action decision execution module 330 is used to execute drone obstacle avoidance based on the action decision result.
[0095] Optionally, the device further comprises: a variational autoencoder optimization module, configured to:
[0096] Before the variational autoencoder processes the environmental image information, inputting the image sample information into the encoder of the variational autoencoder to obtain sample potential state information corresponding to the image sample information;
[0097] Inputting the sample potential state information into the decoder of the variational autoencoder to obtain state restoration information corresponding to the image sample information;
[0098] The variational autoencoder is optimized based on the state restoration information and an objective function of the variational autoencoder.
[0099] Optionally, the device further includes a target decision model training module, which is used to:
[0100] Constructing an initial decision model, wherein the initial decision model is a deep neural network model;
[0101] Inputting the potential state information to be used corresponding to the sample image to be used into the initial decision model to obtain the decision result to be used, wherein the decision result to be used includes the speed and yaw angular velocity of the drone;
[0102] Based on the potential state information to be used and the decision result to be used, the strategy of the initial decision model is updated through the proximal strategy optimization algorithm to obtain the target decision model.
[0103] Optionally, the initial decision model includes: an input layer, a hidden layer and an output layer, and the connection mode of the input layer, the hidden layer and the output layer is full connection;
[0104] The activation function of the initial decision model is the ReLU function.
[0105] Optionally, the updating of the strategy of the initial decision model by the proximal strategy optimization algorithm based on the potential state information to be used and the decision result to be used includes:
[0106] Determine the potential state information to be used and the decision result to be used, and determine the importance sampling ratio;
[0107] Based on the importance sampling ratio and the clipping function, a policy optimization function of the initial decision model is determined, and the policy of the initial decision model is updated based on the policy optimization function.
[0108] Optionally, the formula for the importance sampling ratio is as follows:
[0109] The calculation formula of importance sampling ratio is as follows:
[0110]
[0111] Among them, πθ (a t s t ) is the current strategy θ, in state s t Select action a t The probability of Under the old strategy, in state s t Select action a t probability.
[0112] Optionally, the formula of the clipping function CLIP is as follows:
[0113] CLIP=clip(r t (θ),1-ε,1+ε)
[0114] In the formula, r t (θ) is the importance sampling ratio, and ε is the given limit update amplitude.
[0115] The drone obstacle avoidance device provided in the embodiment of the present invention can execute the drone obstacle avoidance device method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0116] Embodiment 4
[0117] Fig. 9 A schematic diagram of the structure of an electronic device provided for Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0118] like Fig. 9 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0119] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0120] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the drone obstacle avoidance method.
[0121] In some embodiments, the drone obstacle avoidance method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the drone obstacle avoidance method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the drone obstacle avoidance method in any other appropriate manner (e.g., by means of firmware).
[0122] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0123] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0124] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0125] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0126] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0127] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0128] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0129] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for avoiding obstacles in a drone, characterized in that: include: Acquire environmental image information, and process the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information; Inputting the potential state information into a target decision model to obtain an action decision result output by the target decision model, wherein the target decision model is obtained by training an initial decision model based on a proximal strategy optimization algorithm; The drone avoids obstacles based on the action decision result.
2. The method according to claim 1, characterized in that Before the variational autoencoder processes the environment image information, the method further includes: Inputting the image sample information into the encoder of the variational autoencoder to obtain sample potential state information corresponding to the image sample information; Inputting the sample potential state information into the decoder of the variational autoencoder to obtain state restoration information corresponding to the image sample information; The variational autoencoder is optimized based on the state restoration information and an objective function of the variational autoencoder.
3. The method according to claim 1, characterized in that The training process of the target decision model includes: Constructing an initial decision model, wherein the initial decision model is a deep neural network model; Inputting the potential state information to be used corresponding to the sample image to be used into the initial decision model to obtain the decision result to be used, wherein the decision result to be used includes the speed and yaw angular velocity of the drone; Based on the potential state information to be used and the decision result to be used, the strategy of the initial decision model is updated through the proximal strategy optimization algorithm to obtain the target decision model.
4. The method according to any one of claims 1 to 3, characterized in that The initial decision model includes: An input layer, a hidden layer and an output layer, wherein the input layer, the hidden layer and the output layer are connected in a fully connected manner; The activation function of the initial decision model is the ReLU function.
5. The method according to claim 3, characterized in that: The updating of the strategy of the initial decision model by the proximal strategy optimization algorithm based on the potential state information to be used and the decision result to be used includes: Determine the potential state information to be used and the decision result to be used, and determine the importance sampling ratio; Based on the importance sampling ratio and the clipping function, a policy optimization function of the initial decision model is determined, and the policy of the initial decision model is updated based on the policy optimization function.
6. The method according to claim 5, characterized in that The formula for the importance sampling ratio is as follows: The calculation formula of importance sampling ratio is as follows: Among them, π θ (a t |s t ) is the current strategy θ, in state s t Select action a t The probability of Under the old strategy, in state s t Select action a t probability.
7. The method according to claim 5, characterized in that The formula of the clipping function CLIP is as follows: CLIP=clip(r t (θ),1-ε,1+ε) In the formula, r t (θ) is the importance sampling ratio, and ε is the given limit update amplitude.
8. The method according to claim 1, characterized in that After executing the drone obstacle avoidance based on the action decision result, the method further includes: The current environment image is acquired through the drone, and the environment image information is updated based on the current environment image.
9. An obstacle avoidance device for a drone, characterized in that: include: A state information determination module is used to obtain environmental image information and process the environmental image information based on a variational autoencoder to obtain potential state information corresponding to the environmental image information; An action decision determination module, used for inputting the potential state information into a target decision model to obtain an action decision result output by the target decision model, wherein the target decision model is obtained by training an initial decision model based on a proximal strategy optimization algorithm; The action decision execution module is used to execute the drone obstacle avoidance based on the action decision result.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the drone obstacle avoidance method described in any one of claims 1-8.
Citation Information
Cited By
Multi-unmanned aerial vehicle path planning method and system
CN119847207A
Unmanned aerial vehicle end-to-end navigation obstacle avoidance method and system, terminal and storage medium
CN122346150A
