A reinforcement learning drone obstacle avoidance method based on event stream and event frame fusion
By combining the event stream and event frame feature extraction network and policy network, the problem of data inconsistency and time alignment in UAV obstacle avoidance is solved, more comprehensive feature extraction and fusion is achieved, and the performance and performance of UAV obstacle avoidance are improved. success rate.
Patent Information
- Application Number
- CN202411105759.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-13
AI Technical Summary
In UAV obstacle avoidance, data inconsistency and time alignment issues between event streams and event frames lead to unsatisfactory feature extraction and fusion effects, affecting obstacle avoidance accuracy.
A combination of event stream feature extraction network and event frame feature extraction network is used to extract and fuse features through event autoencoder and impulse neural network, and a proximal policy optimization algorithm is used in the policy network to train UAV avoidance in combination with the simulation environment. obstacle model.
It improves the obstacle avoidance performance of drones, can more comprehensively extract event information features, and improves the success rate of drones reaching the end point in the virtual environment.
Smart Images

Figure CN118628944B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle obstacle avoidance, and in particular to a reinforcement learning unmanned aerial vehicle obstacle avoidance method by integrating event stream and event frame. Background Art
[0002] The rapid development and widespread application of drone technology has become an important part of modern society. Among the background technologies of drones, event cameras are gradually becoming a key innovation and breakthrough point. Traditional drones are usually equipped with sensors and cameras to obtain environmental information and collect images. However, due to the rapid movement and unstable flight state of drones, traditional cameras often cannot meet the needs of accurate capture and image reconstruction of high-speed motion scenes. At this time, the emergence of event cameras provides a more feasible and efficient solution for drones. The outstanding features of event cameras are their excellent temporal resolution and dynamic range. During the flight of drones, event cameras can capture the moment when each pixel changes with microsecond time accuracy, thereby realizing accurate observation and recording of high-speed motion and rapidly changing scenes. In addition, event cameras adaptively adjust the exposure time according to the brightness level of the pixel changes, and can capture the details of bright and dim areas in the same frame image, providing drones with more accurate and comprehensive environmental perception capabilities. However, the way to extract features from event information is different from traditional RGB images. How to extract information from event cameras for representation has become a research hotspot in the field of drone obstacle avoidance.
[0003] An event-based camera is a special type of visual sensor that can independently measure changes in intensity levels for each pixel. Given a pixel location (x, y), the basic working principle of an event-based camera is to measure the logarithmic brightness change at that pixel. When the change in logarithmic brightness exceeds a set threshold, the camera generates an "event" that reports the time and location of the change, as well as the "sign" of the change. Compared to traditional cameras that output a certain number of frames per second, event cameras output sparse and asynchronous events in the form of a byte stream, which is referred to as an "event stream" in this application. The rate at which these events are generated is uneven, with the number of events generated per second ranging from close to 0 to tens of millions per second.
[0004] Reinforcement learning is applicable to scenarios where the agent is constantly interacting with the environment. There are five core elements in reinforcement learning: agent, environment, state s, action a, and reward r; the agent obtains the state in the environment, makes decisions based on the input state and strategy, and outputs an action. The agent then enters the next state and gets the reward value fed back by the environment at the same time. The agent's strategy will be adjusted according to the reward given by the environment to get as much reward as possible from the environment. In the process of obstacle avoidance for a drone equipped with an event camera, the drone needs to make appropriate actions based on the event information input by the event camera, so this obstacle avoidance scenario is suitable for decision-making using reinforcement learning.
[0005] In event information processing technology, event information is usually converted into one of event streams or event frames for feature extraction, which leads to insufficient utilization of event information, thus requiring fusion representation technology. The core issue of fusion representation of event streams and event frames is how to solve data inconsistency and effectively fuse the information in the two types of data.
[0006] Due to the different data representation methods of event streams and event frames, the problem of event information feature fusion has data inconsistency, which may cause time alignment difficulties or incompatible feature fusion. In order to solve this problem, researchers usually perform preliminary feature extraction on event frames and event streams based on different feature extraction networks before converting event information into feature information, and then perform fusion after the preliminary feature extraction. Currently, there are mainly event stream information feature extraction methods based on self-encoders and event frame information feature extraction methods based on deep neural networks.
[0007] The Event Variational Autoencoder (eVAE) method based on the Event Context Network (ECN) provides a probabilistic framework for mapping observations to latent space. Therefore, eVAE requires its encoder to describe the probability distribution of each latent attribute, rather than randomly mapping attributes to outputs. eVAE attempts to learn a parametric latent variable model by maximizing the marginal log-likelihood of the training data, which consists of a reconstruction loss and a relative entropy divergence loss (Kullback-Leibler, KL) divergence loss.
[0008] The deep convolutional network event frame feature extraction model based on deep learning, such as the most classic and powerful convolutional neural network (CNN) in the current artificial intelligence field, learns the knowledge of extracting feature information from event frames from the feature information returned by the large-scale strategy network, and then uses this knowledge to provide state information for the strategy. And by replacing the neurons in CNN and changing the network model to a pulse neural network, the power consumption of the model can be reduced, thereby further reducing the load of the drone.
[0009] The policy-based reinforcement learning model associates state information with the actions taken by the model. The policy network receives state information as input and outputs the corresponding action probability distribution. The policy network can be a neural network-based model that learns the mapping relationship from state to action.
[0010] However, as event cameras are used more and more widely in drone obstacle avoidance, the above drone obstacle avoidance methods using event cameras as sensors all have different shortcomings, which affect the accuracy of drone obstacle avoidance.
[0011] The event self-encoder method based on the event context network only extracts and represents features of event stream information, resulting in a lack of relative spatial position information in the environment. At this time, the drone will not be sensitive enough to the position of obstacles in the environment, and the final obstacle avoidance effect will not achieve a sufficiently ideal effect.
[0012] For the deep convolutional network event frame feature extraction model based on deep learning, it uses CNN to extract features from event frame information, which contains more spatial state information of obstacles. However, due to the way event frame data is represented, less contextual information can be obtained from the event frame, and the model is limited by the frame rate, which affects the model's response speed to emergencies and reduces the success rate of drone obstacle avoidance. Summary of the invention
[0013] The purpose of the present invention is to propose a UAV obstacle avoidance method based on reinforcement learning that integrates event streams and event frames. It aims to solve the problems of insufficient utilization of event information, data inconsistency and time alignment between frame data and stream data, unsatisfactory feature extraction and fusion effects, and difficulty in reinforcement learning training.
[0014] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solutions:
[0015] A method for obstacle avoidance of unmanned aerial vehicles by reinforcement learning based on event stream and event frame fusion includes the following steps:
[0016] Step 1: construct and pre-train an event stream feature extraction network, which is used to extract features from the event stream information input by the drone;
[0017] Collect offline event streams during drone training to build a training set; each training data in the training set includes an offline event stream and a true value image;
[0018] An event stream feature extraction training model is built based on the event autoencoder, which includes two dense layers. One dense layer is used to encode the feature of the event stream information input by the drone, and the other dense layer is used to decode the encoded features of the event stream information to reconstruct the event stream information.
[0019] The event stream feature extraction training model is trained based on the training set, and the training is stopped when the coding performance of the network reaches the expected performance. The trained event stream feature extraction network is obtained based on the dense layer used for feature coding of event stream information;
[0020] Step 2, construct a drone obstacle avoidance model, which includes an event frame feature extraction network, a strategy network, a feature fusion module, and the event stream feature extraction network trained in step 1;
[0021] Among them, the event frame feature extraction network is a spiking neural network model built based on spiking neurons, which is used to extract features from the event frame images input by the drone;
[0022] The output features of the event frame feature extraction network and the event stream feature extraction network are sent to the feature fusion module for fusion, and then the obtained fusion features are input into the strategy network to obtain the action probability distribution of the drone in the current state. ; Then based on the action probability distribution Output the drone's motion angle :
[0023] ;
[0024] ;
[0025] in, represents the natural base, Represents the action probability distribution The corresponding weight is based on The value range is used to convert the middle value Better map it to the interval (0,1), that is, the action probability distribution The value range of is divided into different segments, and different weights are configured for each segment; usually, the action probability distribution of the policy network It is realized by the sigmoid function, that is, the present invention is based on the set The purpose of adding weights to the sigmoid function is achieved to achieve the intermediate value Better mapping, and then get the final action angle of the drone.
[0026] Step 3: Build a simulation environment for UAV flight to train the obstacle avoidance model of the UAV;
[0027] When training the drone obstacle avoidance model, the network parameters of the event stream feature extraction network are fixed. During the training process, the drone inputs the collected event stream information and event frame images into the drone obstacle avoidance model, and the strategy network outputs the drone's forward motion angle based on the fusion features of the event stream and event frame information. , the drone will move according to the angle of action The drone takes corresponding actions according to the step length of each action, and obtains corresponding reward values based on the reward function of the preset strategy network;
[0028] When the preset training end conditions are met, the trained UAV obstacle avoidance model is obtained. The training end conditions include but are not limited to: the number of training steps, the convergence of the loss function value, etc.
[0029] Furthermore, in step 1, the loss function of the event stream feature extraction training model during training includes reconstruction loss and relative entropy divergence loss.
[0030] Furthermore, in the event stream information input by the drone, the corresponding time information uses a timestamp Normalized to [0,1], the event self-encoder is then based on the timestamp Calculate the D-dimensional time features for each standardized timestamp, including:
[0031] ;
[0032] Among them, the dimension D of the time feature is the preset value, and the feature dimension index , Represents the calculated time characteristics.
[0033] Furthermore, the event frame feature extraction network uses the impulse response function during forward propagation Participate in calculation; during back propagation, use the gradient replacement function The gradient of the impulse function is replaced by the gradient of
[0034] The impulse response function and the gradient surrogate function The specific expression is:
[0035] ; ;
[0036] in, Indicates function input and preset parameters Used to control the smoothness of the function.
[0037] Furthermore, the policy network uses the Proximal Policy Optimization (PPO) algorithm to update the network parameters.
[0038] Furthermore, the reward function of the policy network includes:
[0039] ;
[0040] ;
[0041] ;
[0042] in, Reward for the process, Represents the coordinate of the drone on the y-axis, It represents the coordinate of the drone on the y-axis at the last moment, and the process reward R represents the corresponding reward value that the drone will get every time it moves on the y-axis; Penalty for collision, is the reward value at the moment before the collision, is the preset penalty value, collision penalty Indicates that a collision will occur. punishment; To reach the reward, is the reward value at the moment before reaching the end point, is the preset reward value, reaching the reward Indicates that the drone will be given when it reaches the destination The reward value.
[0043] Furthermore, the simulation environment includes obstacles, flight scenarios, and settings for the starting and ending points of the drone.
[0044] Furthermore, the starting and ending points of the drone are set as follows:
[0045] A corridor full of obstacles is used as the flight scene;
[0046] Set the starting line of the drone at the beginning of the corridor, and the starting position is a random point on the starting line. Whenever the drone collides or reaches the end point, a random point on the starting line is selected as the reset point;
[0047] And the finish line is set at the end of the corridor. When the drone reaches the finish line, it is considered that no one has reached the finish line, and there is no need to reach a specially designated point on the finish line.
[0048] The technical solution provided by the present invention brings at least the following beneficial effects:
[0049] The present invention extracts the features of the event information transmitted by the event camera and converts it into a feature vector as state information, and then inputs the state information into the policy network to obtain the output action. The environment will give reward feedback according to the customized reward function to complete the update of the policy network. The present invention can extract feature information from the event stream and event frame information generated by the event camera and further perform fusion representation. This event information extraction method is better than extracting features only from the event stream or event frame. It can extract more comprehensive feature information from the event information of the two data types, thereby improving the obstacle avoidance performance of the drone.
[0050] The present invention has good performance in the unmanned aerial vehicle obstacle avoidance task and can increase the success rate of the unmanned aerial vehicle reaching the destination in a specific virtual environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. 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.
[0052] Figure 1 It is a flow chart of a method for obstacle avoidance of a UAV by reinforcement learning with fusion of event stream and event frame provided by an embodiment of the present invention;
[0053] Figure 2 is a flow chart of the construction process of the model in the embodiment of the present invention;
[0054] Figure 3 It is a flow chart of the interaction between the intelligent agent and the environment in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] To make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described in detail and completely in conjunction with the drawings in the implementation of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings can be arranged and designed using different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present invention.
[0056] The embodiment of the present invention provides a method for unmanned aerial vehicle obstacle avoidance by reinforcement learning based on event stream and event frame fusion, which is applicable to unmanned aerial vehicles equipped with event cameras, such as Figure 1 As shown, it mainly includes four steps:
[0057] Step S1, constructing and pre-training an event stream feature extraction network;
[0058] An event stream feature extraction training model is built based on the event autoencoder eVAE. eVAE includes two dense layers. One dense layer is used to encode the features of the event stream information input by the drone, namely the encoder; the other dense layer is used to decode the encoded features of the event stream information to reconstruct the event stream information, namely the decoder.
[0059] Collect offline event streams during drone training and construct a training set. Each training data in the training set includes offline event streams and true value images.
[0060] The event stream feature extraction training model is trained based on the training set, and stops when the preset training end condition is met, that is, when the network encoding performance reaches the expected performance, so that the encoder based on the event stream feature extraction training model obtains a trained event stream feature extraction network; it should be noted that during training, the factors considered for the end condition of training include but are not limited to: the number of trainings and model convergence. Correspondingly, the maximum number of iterations and the model convergence threshold need to be preset at this time.
[0061] In the embodiment of the present invention, during training, the loss function of the event stream feature extraction training model is the weighted sum of the reconstruction loss and the KL divergence loss. The hyperparameters that need to be set during training mainly include the maximum number of iterations and the model convergence threshold. When the maximum iteration parameter is reached or the loss function value converges, it can be considered that the training end condition is met.
[0062] Step S2, constructing an event frame feature extraction network and a strategy network;
[0063] A directly trainable spiking neural network model is constructed based on LIF (Leaky Integrate and Fire) neurons as an event frame feature extraction network, which is used to extract features from event frame images input by drones.
[0064] The policy network outputs the action probability distribution of the drone in the current state based on the input feature information (the fusion features of the event stream and event frame information), so that the action angle of the drone can be obtained based on the action probability distribution:
[0065] ;
[0066] ;
[0067] in, Indicates the action angle, represents the action probability distribution output by the policy network, represents the natural base, Represents the action probability distribution The corresponding weight is based on The value range is used to convert the middle value Better mapping to the interval (0,1).
[0068] Step S3, building a drone obstacle avoidance model, which includes the event stream feature extraction network pre-trained in step S1, the event frame feature extraction network and the strategy network constructed in step S2, and a feature fusion module. The feature fusion module is used to fuse the output features of the event stream feature extraction network and the event frame feature extraction network, and then send the obtained fused features to the strategy network to obtain the action angle of the drone in the current state.
[0069] Step S4, building an unmanned flight simulation environment for model training;
[0070] The drone obstacle avoidance model is trained using a simulation environment. First, the hyperparameters are determined, including the total number of steps for model training, the learning rate, and the batch size (batch_size). That is, the training process is to place the pre-trained event stream feature extraction network into the model to collaborate with the event frame feature extraction network and the strategy network for training. During this period, the parameters in the event stream feature extraction network will not change. During the training process, the drone will input the collected event stream information and event frame images into the drone obstacle avoidance model, and the strategy network will output the drone's forward motion angle based on the fusion features of the event stream and event frame information. , the drone will move according to the angle of action The drone makes corresponding actions according to the step length of each action set, and obtains the corresponding reward value based on the reward function of the preset strategy network; when the preset training end conditions are met (such as the number of training steps reaches the preset upper limit or the training loss converges), the drone obstacle avoidance model is built.
[0071] Since directly using the time data contained in the event stream input by the drone as the input of the event context network (ECN) of eVAE will interfere with feature calculation, because the global timestamp is an arbitrary value, even each time the drone inputs a new event, the relative time difference of each event will change, which requires recalculation of features. To address this problem, when obtaining event stream feature processing, the embodiment of the present invention adopts a time embedding method to normalize the timestamp to [0,1] so that the timestamp corresponding to the end of the window is mapped to 1. ECN calculates the D-dimensional time feature of each standardized timestamp as follows:
[0072]
[0073] Among them, the dimension D of the time feature is the preset value, and the feature dimension index , Represents the calculated time characteristics.
[0074] In order to realize the construction of a directly trainable spiking neural network model based on LIF neurons, the pulses in the spiking neural network can be reversely propagated by accumulating real membrane potentials instead of real numbers. The pulses received by the synapses of LIF neurons will be converted into current signals on the axons through a low-pass filter. The current is used as input to charge the capacitor to generate a model potential V(t). When the membrane potential reaches a preset threshold, the capacitor discharges, and then the membrane potential becomes the resting potential Vreset, and then the leakage integration process is restarted. In the embodiment of the present invention, the directly trainable spiking neural network uses the pulse response function during forward propagation. Participate in the calculation, the output of this function is discrete 0 and 1, and when backpropagating, the gradient replacement function is used The gradient of the impulse function is replaced by the gradient of It is used to control the smoothness of the function. The process is expressed by the following formula:
[0075] ; ;
[0076] in, Input to the function.
[0077] In the embodiment of the present invention, the policy network adopts the proximal policy optimization (PPO) algorithm. The PPO algorithm calculates the policy gradient by using the collected experience data and uses the advantage function to guide the update of the policy. The experience update method of the PPO algorithm is:
[0078]
[0079]
[0080] in, represents the policy parameters, represents the number of time steps required for each update, represents the objective function, For the target The derivative of To optimize the parameters in the target parameters; that is Indicates the policy parameters The derivation of Indicates that the parameter is The strategic network and Respectively The actions and states of the agent at each moment, Representation Policy Network exist The action taken in the state is ; express The reward value at the moment; Represents the learning rate, which determines the speed at which the policy network is updated.
[0081] Preferably, in the embodiment of the present invention, the reward function of the constructed strategy network includes:
[0082]
[0083]
[0084]
[0085] in, Reward for the process, Represents the coordinate of the drone on the y-axis, It represents the coordinate of the drone on the y-axis at the last moment, and the process reward R represents the corresponding reward value that the drone will get every time it moves on the y-axis; Penalty for collision, is the reward value at the moment before the collision, is the preset penalty value, collision penalty Indicates that a collision will occur. punishment; To reach the reward, is the reward value at the moment before reaching the end point, is the preset reward value, reaching the reward Indicates that the drone will be given when it reaches the destination The reward value.
[0086] Preferably, in an embodiment of the present invention, the starting point and end point of the drone are set as follows: considering that the environment is a corridor full of obstacles, the present invention sets the starting line of the drone at the beginning of the corridor, and the position is a random point on the starting line. Whenever the drone collides or reaches the end point, a random point on the starting line is selected as the reset point; and the end line is set at the end of the corridor, so it is not necessary to reach a specifically designated point as long as it is reached.
[0087] The method proposed in the embodiment of the present invention is used for a drone equipped with an event camera. By extracting features from the event information received by the event camera, the strategy network outputs actions based on the extracted features, and finally achieves a good obstacle avoidance effect. The embodiment of the present invention tests the effect of the drone obstacle avoidance task in a constructed virtual scene. The method proposed in the embodiment of the present invention can effectively solve the problem of poor obstacle avoidance effect of the drone equipped with an event camera, and fully extracts features from the event information to achieve a good obstacle avoidance effect.
[0088] Example 1
[0089] See also Figure 2 When executing the drone obstacle avoidance task based on the method proposed in the embodiment of the present invention, the construction process of the required drone obstacle avoidance model includes the following steps:
[0090] (1) Determine whether the pre-training of the event stream feature extraction network has been completed. If so, execute step (3); otherwise, execute step (2);
[0091] (2) Extracting offline time streams and constructing training sets, that is, collecting event data during the UAV training process as offline data, and obtaining training data for the feature extraction network through data preprocessing. The training data includes offline event streams and true value images. The training data is then divided into training sets and test sets. The training set is used for model parameter training, and the test set is used for model performance testing.
[0092] Construct an event stream feature extraction network model (also called an event stream feature extraction training model), train the event stream feature extraction network model using the training set based on the determined hyperparameters for the training process, and stop training when the preset training end conditions are met, thereby completing the pre-training process of the event stream feature extraction network model. After the training is completed, return to step (1);
[0093] (3) Construct an event frame feature extraction network and a policy network, and set a corresponding reward function for the policy network;
[0094] (4) Setting the UAV action space and hyperparameters, that is, setting the UAV action angle mapped by the action probability distribution output by the policy network; the hyperparameters are used to implement the obstacle avoidance model of the event frame feature extraction network and the policy network during the UAV human-machine flight process;
[0095] That is, this step also involves building a drone obstacle avoidance model, which includes an event stream feature extraction network, an event frame feature extraction network, a feature fusion module and a strategy network. The feature fusion module is used to fuse the output features of the event stream feature extraction network and the event frame feature extraction network, and then send the obtained fused features to the strategy network to obtain the action angle of the drone in the current state.
[0096] (5) The event frame feature extraction network and the strategy network are trained during the interaction between the UAV and the environment. That is, the obstacle avoidance model of the UAV is trained based on the constructed human flight simulation environment. The network parameters of the event stream feature extraction network are fixed during training.
[0097] (6) Determine whether the maximum number of training steps has been reached. If so, stop training and save the trained model; otherwise, continue with step (5).
[0098] Preferably, in this embodiment, the specific training process of training the drone obstacle avoidance model during the interaction between the drone and the environment is as follows: Figure 3 As shown, specifically including:
[0099] (a) Build a simulation training environment and set the starting point, end point and training parameters of the UAV;
[0100] (b) training from the starting point;
[0101] (c) Determine whether the maximum number of training steps has been reached. If not, execute step (d). If yes, execute step (e).
[0102] (d) Receive environmental information and take action to determine whether a collision occurs or the end point is reached. If a collision occurs or the end point is reached, return to step (b); otherwise, continue to step (d)
[0103] (e) Save the trained drone obstacle avoidance model and end the training.
[0104] Example 2
[0105] When performing the obstacle avoidance effect test of the drone based on the method proposed in the embodiment of the present invention, the specific test steps include:
[0106] (1) Load the trained drone obstacle avoidance model;
[0107] (2) Set the UAV’s motion space. To ensure the UAV’s obstacle avoidance effect, the motion space here should be consistent with the UAV’s training motion space.
[0108] (3) Building a simulation test environment, including the size of the environment, the selection of obstacles, and the setting of the starting and ending points;
[0109] (4) Conduct obstacle avoidance tests on the drone. First, define the number of test rounds, then conduct the test and collect the corresponding data after the test.
[0110] In this embodiment, the trained drone obstacle avoidance model is loaded into the corresponding environment, and a specific obstacle avoidance scene can be built through a customized obstacle avoidance environment, so that the model can effectively detect the obstacle avoidance effect.
[0111] Finally, 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
[0112] The above are only some embodiments of the present invention. For those skilled in the art, several modifications and improvements can be made without departing from the creative concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A reinforcement learning drone obstacle avoidance method based on event stream and event frame fusion, characterized in that: The following steps are involved: Step 1: construct and pre-train an event stream feature extraction network, which is used to extract features from the event stream information input by the drone; Collect offline event streams during drone training to build a training set; each training data in the training set includes an offline event stream and a true value image; An event stream feature extraction training model is built based on the event autoencoder, which includes two dense layers. One dense layer is used to encode the feature of the event stream information input by the drone, and the other dense layer is used to decode the encoded features of the event stream information to reconstruct the event stream information. The event stream feature extraction training model is trained based on the training set, and the training is stopped when the coding performance of the network reaches the expected performance. The trained event stream feature extraction network is obtained based on the dense layer used for feature coding of event stream information; The loss function of the event stream feature extraction training model during training includes reconstruction loss and relative entropy divergence loss; Step 2, construct a drone obstacle avoidance model, which includes an event frame feature extraction network, a strategy network, a feature fusion module, and the event stream feature extraction network trained in step 1; Among them, the event frame feature extraction network is a spiking neural network model built based on spiking neurons, which is used to extract features from the event frame images input by the drone; The event frame feature extraction network uses the impulse response function during forward propagation Participate in calculation; during back propagation, use the gradient replacement function The gradient of the impulse function is replaced by the gradient of The impulse response function and the gradient surrogate function The specific expression is: ; ; in, Indicates function input and preset parameters Used to control the smoothness of the function; The output features of the event frame feature extraction network and the event stream feature extraction network are sent to the feature fusion module for fusion, and then the obtained fusion features are input into the strategy network to obtain the action probability distribution of the drone in the current state. ; Then based on the action probability distribution Output the drone's motion angle : ; ; in, represents the natural base, Represents the action probability distribution Corresponding weights, the action probability distribution The value range of is divided into different segments, and different weights are configured for each segment ; Step 3: Build a simulation environment for UAV flight to train the obstacle avoidance model of the UAV; When training the drone obstacle avoidance model, the network parameters of the event stream feature extraction network are fixed. During the training process, the drone inputs the collected event stream information and event frame images into the drone obstacle avoidance model, and the strategy network outputs the drone's forward motion angle based on the fusion features of the event stream and event frame information. , the drone will move according to the angle of action The drone takes corresponding actions according to the step length of each action set, and obtains corresponding reward values based on the reward function of the preset strategy network. When the preset training end conditions are met, the trained drone obstacle avoidance model is obtained. Among them, the corresponding time information in the event stream information input by the drone uses the timestamp Normalized to [0,1], the event self-encoder is then based on the timestamp Calculate the D-dimensional time features for each standardized timestamp, including: ; Among them, the dimension D of the time feature is the preset value, and the feature dimension index , represents the calculated time characteristics; The reward function of the policy network includes: ; ; ; in, Reward for the process, Represents the coordinate of the drone on the y-axis, Indicates the coordinate of the drone on the y-axis at the last moment; Penalty for collision, is the reward value at the moment before the collision, is the preset penalty value; To reach the reward, is the reward value at the moment before reaching the end point, is the preset reward value.
2. The method for obstacle avoidance of unmanned aerial vehicles by reinforcement learning based on the fusion of event stream and event frame as claimed in claim 1, characterized in that: The policy network uses a proximal policy optimization algorithm to update network parameters.
3. The method for obstacle avoidance of unmanned aerial vehicles by reinforcement learning based on the fusion of event stream and event frame as claimed in claim 1, characterized in that: The simulation environment includes obstacles, flight scenes, and the settings of the drone’s starting and ending points.
4. The method for obstacle avoidance of unmanned aerial vehicles by reinforcement learning based on the fusion of event stream and event frame as claimed in claim 3, characterized in that: The starting and ending points of the drone are set as follows: A corridor full of obstacles is used as the flight scene; Set the starting line of the drone at the beginning of the corridor, and the starting position is a random point on the starting line. Whenever the drone collides or reaches the end point, a random point on the starting line is selected as the reset point; And the finish line is set at the end of the corridor. When the drone reaches the finish line, it is considered that no one has reached the finish line.
Citation Information
Patent Citations
Event camera optical flow estimation method and device based on self-attention mechanism
CN115601403A
Unmanned aerial vehicle perception avoidance method and system based on event camera and deep reinforcement learning
CN116382346A
Unmanned aerial vehicle navigation and obstacle avoidance method based on depth image and reinforcement learning
CN116384610A
Obstacle target tracking method based on dynamic visual sensing and neural network
CN116661498A
Event camera image reconstruction method based on diffusion model
CN116958192A
