A brain-based obstacle avoidance method for unmanned aerial vehicles (UAVs) to avoid dynamic obstacles
The brain-like obstacle avoidance decision-making of drones is carried out through impulse neural networks, which solves the problems of slow decision-making speed and high resource consumption of drones in front of dynamic obstacles, and achieves fast and resource-saving obstacle avoidance effects.
Patent Information
- Application Number
- CN202210366505.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-04-08
AI Technical Summary
When UAVs face dynamic obstacles, traditional decision-making methods are difficult to achieve rapid and resource-efficient obstacle avoidance. Especially when computing resources are limited, it is difficult to meet the demand for rapid obstacle avoidance.
The spiking neural network (SNN) is used for brain-like obstacle avoidance decision-making. By analyzing the response characteristics of spiking neurons, a neuron impulse response model is established, and the input camera data of the spiking AC network is differentially encoded and processed based on the asynchronous update of the A3C algorithm. The multi-step update mechanism of the mechanism and lambda regression algorithm performs network updates to achieve rapid obstacle avoidance decision-making.
It achieves fast, resource-saving and low-energy obstacle avoidance decision-making, significantly improving the obstacle avoidance speed and decision-making efficiency of UAVs in dynamic environments.
Smart Images

Figure CN114863268B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of unmanned aerial vehicles (UAVs), and in particular to a UAV brain-like obstacle avoidance method for avoiding dynamic obstacles. Background Art
[0002] Unmanned aerial vehicles (UAVs) have received unprecedented attention and developed rapidly in both academia and industry. Currently, UAVs are widely used in military fields such as intelligence reconnaissance, military strikes, information confrontation, search and rescue, as well as in civilian fields such as aerial photography, environmental protection, agricultural and forestry operations, cargo delivery, and road traffic monitoring.
[0003] Many drones are involved in flying at low altitudes and in restricted environments, such as aerial combat, rapid crossing of complex environments, and encountering emergencies during cruising. These situations pose a great challenge to the drone's rapid obstacle avoidance. The drone has a limited obstacle recognition distance and number. When facing close obstacles or obstacles with high speed, the drone needs to make very drastic and frequent maneuvers. Accurate and rapid maneuvering decisions can ensure the drone's own safety and greatly improve the drone's survivability.
[0004] With the continuous expansion of applications, drones are increasingly facing complex and dynamic flight environments. In complex and dynamic environments, the possibility of drones encountering unexpected accidents is increasing. In order to complete tasks intelligently and autonomously, drones must have the ability to quickly avoid fast-moving obstacles. Therefore, enabling drones to make rapid maneuvering decisions and quickly avoid close-range or dynamic obstacles is the basis for them to preserve themselves and successfully complete their tasks. Research on rapid decision-making for drone obstacle avoidance has important theoretical significance and application value.
[0005] Drones face the following challenges in achieving rapid obstacle avoidance through action decision-making:
[0006] First, the challenge of rapidity. When faced with rapid obstacle avoidance tasks, drones are faced with targets that move at a fast speed or are relatively close, which requires them to complete rapid obstacle avoidance tasks in a short time. This not only includes rapid response of motion planning and underlying control, but also requires drones to quickly complete top-level decisions for motion planning. This is difficult to achieve for traditional drone motion planning and control methods: on the one hand, motion planning can only be completed quickly when the target's motion state is known, and it is difficult to complete motion planning in a short time when the target's motion state is unknown; on the other hand, multi-layer nested feedback control loops constrain the drone's action execution frequency, making it difficult to meet the needs of rapid obstacle avoidance. Traditional drone decision-making methods are often highly dependent on the preprocessing of environmental information, which often occupies most of the time of the decision-making algorithm. If we can find a way to save this part of time, we can greatly speed up the drone's decision-making.
[0007] Second, onboard resources are limited. Small drones are limited by their own model and payload size and cannot carry much computing resources: complex decision-making algorithms consume a lot of computing resources and rely on high-performance computing devices. However, these are heavy and cannot be used on small drones with limited payloads. This leads to the need for drones to use lightweight algorithms for quick decision-making under the condition of limited onboard resources.
[0008] To address these two major challenges, we need to explore fast obstacle avoidance methods that are time-consuming, consume less computing resources, and consume less energy. When dealing with some complex tasks, the decision-making mechanism of the human brain is very efficient. Therefore, by learning from the decision-making mechanism of the human brain, it is very likely to find a fast decision-making method that is time-consuming, consumes less computing resources, and consumes less energy.
[0009] Spiking Neural Network (SNN), which originated from brain science, is the third generation of artificial neural network. It has attracted the attention of scholars for its rich neurodynamic characteristics in the spatiotemporal domain, diverse coding mechanisms, and event-driven advantages. In recent years, the development of spiking neural networks has greatly developed a new computing paradigm based on and inspired by brain science achievements, namely brain-inspired computing (BIC). Using spiking neural networks to implement brain-inspired decision-making methods can significantly reduce the size of the network, while the high-density information transmission method has the characteristics of reducing resource consumption.
[0010] The research on spiking neural networks in fast decision-making methods can be divided into two strands. The first strand starts from the understanding of the biological brain and is the study of brain-inspired decision-making methods. In the past twenty years, the basal ganglia and thalamus have gradually been considered to be involved in the selection process of motor behavior in the human brain. The second strand starts from the implementation of reinforcement learning algorithms on spiking neural networks, which is the implementation of spiking neural networks in decision-making. The goal of reinforcement learning is to achieve the mapping from state space to action space, which is naturally suitable for application in decision-making. The training methods of spiking neural networks are divided into two categories. One is to map the parameter learning process from traditional artificial neural networks to spiking neural networks according to the corresponding control relationship, and the other is to train directly on spiking neural networks based on STDP.
[0011] In general, in the field of unmanned system decision-making based on spiking neural networks, some research results have emerged, laying a certain theoretical foundation, but there is no universal learning paradigm. At the same time, the existing methods for describing the state space and modeling the state neurons are not yet mature, and the potential of spiking neural networks has not been fully utilized. Summary of the invention
[0012] The technical problem to be solved by the present invention is: in view of the technical problems existing in the prior art, the present invention provides a brain-like obstacle avoidance method for unmanned aerial vehicles with fast response speed for avoiding dynamic obstacles.
[0013] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0014] A method for avoiding dynamic obstacles by using a brain-based obstacle avoidance method for a drone, comprising the steps of:
[0015] 1) Analyze the response characteristics of spiking neurons and establish a neuron spiking response model;
[0016] 2) Perform differential coding processing on the input camera data of the pulse AC network, perform timing coding modulation on the output timing signal, and update the network update mechanism of the pulse AC network based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the λ regression algorithm;
[0017] 3) Obtain the camera data of the drone and output the obstacle avoidance decision through the neuron pulse response model and the updated pulse AC network to avoid obstacles.
[0018] Preferably, in step 2), the camera data is pulse-encoded so that it can be directly recognized by the spiking neural network; wherein the pulse encoding of the camera data is achieved by identifying the data changes on the corresponding pixels; wherein the camera data needs to be differentially operated, specifically:
[0019] The camera data is the RGB brightness value. According to the brightness change of each pixel position, a pulse signal is generated to identify the change; the brightness of each pixel is converted into logarithmic brightness as follows:
[0020] L(u,t)=log(0.299I R (u,t)+0.5781I G (u,t)+0.1141I B (u,t)) (1)
[0021] Among them, I R ,I G ,I B are the RGB data of the camera, u is the corresponding pixel position, and t is the corresponding time;
[0022] Differentiate the logarithmic brightness of the pixels to generate corresponding brightness changes; select a threshold ΔL, and set the brightness change exceeding the threshold ΔL as an obvious change that the drone needs to pay attention to, that is:
[0023] f(u,t)=1,L(u,t)-L(u,t-Δt)>ΔL(2)
[0024] These apparent changes are recorded through f(u,t); f(u,t) is the required pulse input to the drone.
[0025] Preferably, in step 2), the time interval ΔT between frames input by the camera is different from the time interval Δt used in the simulation; a linear interpolation method is used to spread the logarithmic brightness change of pixels between two frames over the frame time interval to complement the pulse signal encoding between frames.
[0026] Preferably, in step 2), the process of performing timing coding modulation on the output timing signal is:
[0027] In the Critic network, the output layer only needs one pulse neuron to encode information to represent the value function of the current state; after modulation, the pulse neuron can generate the first pulse at any time, that is, encode the information on the positive time axis, with a value range of t out ∈(0,+∞);
[0028] Set the weight of the connection between the modulation neuron and the output neuron. The pulse stimulated by the modulation neuron will cause the output neuron to stimulate a pulse after reaching the output neuron, and the time for the output neuron to stimulate the pulse is the time when the pulse response reaches the peak value.
[0029] In the Actor network, the first pulse generated by multiple spiking neurons is used for encoding, so that each neuron represents an action to be selected. Appropriate random operations are added to each neuron in the output layer to randomize the time when the neuron generates pulses. Then, the order in which different spiking neurons generate pulses is used to encode the probability of selecting a certain action instead of another action.
[0030] Preferably, when the pulse AC network is updated by the asynchronous update mechanism based on the A3C algorithm, an n-step update method is adopted, using the advantage function A(s t ,a t ; θ',w') replaces the time difference δ; whenever the Actor network generates an action signal, the input pulse sequence is truncated and the state at a new moment begins. At this time, a new Critic network is introduced, and the state at the new moment is input into the new Critic network, while the state at the old moment is still transmitted in the original Critic network until the original Critic network outputs the state value function of the old moment, at which time the network parameters are updated; initially, the pulse sequence is input into the Actor network and the Critic1 network at the same time; at time t1, the Actor network generates an action signal, at this time, the input pulse sequence takes time t1 as the new initial 0 moment, generates a new state, and is input into the Critic2 network; at time t2, the Actor network generates an action signal, at this time, the input pulse sequence takes time t2 as the new initial 0 moment, generates a new state, and is input into the Critic3 network; and so on.
[0031] Preferably, when the pulse AC network is updated based on the multi-step update mechanism of the λ regression algorithm, the rounds are merged and the time of updating the network parameters is changed to the update at the end of the large round; wherein the λ regression includes all n-step regressions, and the weight coefficients are (1-λ)λ n-1 , where λ∈[0,1], λ regression returns to update after the maximum round ends, and λ regression includes all n-step regressions.
[0032] Preferably, the obstacle avoidance decision includes flying to the left, flying to the right and hovering.
[0033] The present invention also discloses a UAV brain-like obstacle avoidance system for avoiding dynamic obstacles, comprising:
[0034] The first program module is used to analyze the response characteristics of the pulse neuron and establish a neuron pulse response model;
[0035] The second program module is used to perform differential coding processing on the input camera data of the pulse AC network, perform timing coding modulation on the output timing signal, and update the pulse AC network based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the lambda regression algorithm;
[0036] The third program module is used to obtain the camera data of the drone and output the obstacle avoidance decision through the neuron impulse response model and the updated pulse AC network to avoid obstacles.
[0037] The present invention further discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are executed.
[0038] The present invention also discloses a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is run by the processor, the steps of the method described above are executed.
[0039] Compared with the prior art, the advantages of the present invention are:
[0040] In response to the demand for speed brought about by dynamic obstacle avoidance decision-making tasks, the present invention performs differential encoding and other processing on the input camera data of the pulse AC network, and performs time-series coding modulation on the output timing signal. Secondly, the pulse AC network is updated based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the λ regression algorithm, and then the camera data of the drone is processed based on the LIF model and the three-layer input and output network to quickly obtain obstacle avoidance decisions for obstacle avoidance. For the first time, the present invention uses a simple neuron pulse response model and a 2-3-layer small-scale pulse AC network to achieve relatively complex decision-making tasks such as drone avoidance of dynamic obstacles. It has the advantages of faster decision-making speed, less resource consumption, and strong biological interpretability than traditional AC algorithms. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of the probability-based pulse excitation in the present invention.
[0042] Figure 2 This is a schematic diagram of asynchronous updating in the present invention.
[0043] Figure 3 Schematic diagram of the Gt:t+2 / 2+Gt:t+4 regression method in the present invention.
[0044] Figure 4 Schematic diagram of lambda regression in the present invention.
[0045] Figure 5 This is a schematic diagram of a UAV dodging a flying basketball task in the present invention.
[0046] Figure 6 Schematic diagram of the Actor-Critic network structure in the present invention.
[0047] Figure 7 Schematic diagram of the cumulative reward signal obtained during the training process of the present invention.
[0048] Figure 8 This is a schematic diagram of the drone failing to make a correct decision in real time when the ball flies towards it in the present invention.
[0049] Fig. 9 This is a schematic diagram of a ball falling in front of a drone and the drone maintaining hovering in the present invention.
[0050] Fig.10 This is a schematic diagram of the ball flying from the left front to the rear of the drone in the present invention, and the drone flying to the right.
[0051] Fig.11 This is a schematic diagram of the ball flying from the left front to the front of the drone in the present invention, and the drone flying to the left.
[0052] Fig.12 This is a schematic diagram of the decision time of the drone in the 2000th round of the present invention.
[0053] Fig.13 Schematic diagram of the change in average decision time within a round during the training process of the present invention.
[0054] Fig.14 Schematic diagram of the traditional Actor-Critic network structure.
[0055] Fig.15 Schematic diagram of the distribution of decision time in a basketball dodge experiment in the present invention.
[0056] Fig.16 Schematic diagram of average decision time within a round of one hundred basketball avoidance experiments in the present invention.
[0057] Fig.17 The present invention is a flowchart of an embodiment of the method. DETAILED DESCRIPTION
[0058] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0059] like Fig.17 As shown, the drone brain-based obstacle avoidance method for avoiding dynamic obstacles according to an embodiment of the present invention comprises the following steps:
[0060] 1) Analyze the response characteristics of spiking neurons and establish a neuron spiking response model;
[0061] 2) Perform differential coding processing on the input camera data of the pulse AC network, perform timing coding modulation on the output timing signal, and update the network update mechanism of the pulse AC network based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the λ regression algorithm;
[0062] 3) Obtain the camera data of the drone and output the obstacle avoidance decision through the neuron pulse response model and the updated pulse AC network to avoid obstacles.
[0063] In response to the demand for speed brought about by dynamic obstacle avoidance decision-making tasks, the present invention performs differential encoding and other processing on the input camera data of the pulse AC network, and performs time-series coding modulation on the output timing signal. Secondly, the pulse AC network is updated based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the λ regression algorithm, and then the camera data of the drone is processed based on the LIF model and the three-layer input and output network to quickly obtain obstacle avoidance decisions for obstacle avoidance. For the first time, the present invention uses a simple neuron pulse response model and a 2-3-layer small-scale pulse AC network to achieve relatively complex decision-making tasks such as drone avoidance of dynamic obstacles. It has the advantages of faster decision-making speed, less resource consumption, and strong biological interpretability than traditional AC algorithms.
[0064] In a specific embodiment, in a rapid obstacle avoidance task, the sensor of the drone is a monocular camera, and the data frames output by the monocular camera cannot be directly input into a pulse neural network for learning and training. The rapid obstacle avoidance task in a dynamic environment is heavy, and the influence of time factors needs to be considered. The present invention pulse encodes the camera data so that it can be directly recognized by a pulse neural network. The pulse encoding of the camera data is achieved by identifying the data changes on the corresponding pixels. The camera data is a response to the surrounding environmental information. For the rapid obstacle avoidance of drones, static environmental information is meaningless, and dynamic environmental information is necessary for the rapid obstacle avoidance of drones. In order to monitor such changes, it is necessary to perform differential operations on the camera data, specifically:
[0065] The camera data is the brightness value of RGB. According to the brightness change of each pixel position, a pulse signal for identifying the change can be generated. Now convert the brightness of each pixel into logarithmic brightness as follows:
[0066] L(u,t)=log(0.299I R (u,t)+0.5781I G (u,t)+0.1141I B (u,t)) (1)
[0067] Among them, I R ,I G ,I BThey are the RGB data of the camera, u is the corresponding pixel position, and t is the corresponding time. The brightness data of the pixel generated after the RGB data is integrated will inevitably be limited by some noise if it is used directly for differentiation. Especially when the drone is hovering in the air, its position state is always in a state of constant fine-tuning. For the drone, the environmental information is changing every moment. Such changes are not necessary for the drone's decision-making. After taking the logarithm, these changes can also be identified.
[0068] By taking the difference of the logarithmic brightness of the pixels, the corresponding brightness change can be generated. A threshold ΔL is selected, and the brightness change exceeding the threshold ΔL is set as an obvious change that the drone needs to pay attention to, that is:
[0069] f(u,t)=1,L(u,t)-L(u,t-Δt)>ΔL (2)
[0070] In this way, these obvious changes can be recorded through f(u,t). f(u,t) is the required pulse input of the drone. When f(u,t) = 1, the input neuron generates a pulse, and the position and time of the pulse are u and t respectively.
[0071] It should be noted that the time interval ΔT between frames input by the camera is different from the time interval Δt used in the simulation. Therefore, in order to complement the pulse signal encoding between frames, the linear interpolation method is used to spread the pixel logarithmic brightness change between two frames to the frame time interval, as shown in equations (3) and (4):
[0072]
[0073]
[0074] where N(u) is the number of events generated at pixel u, Nmax is the maximum constraint on the number of events that may be generated, and ceil(·) is the ceiling function.
[0075] In a specific embodiment, the output timing coding modulation process of the pulse AC network is as follows: In the Critic network, the output layer only needs one pulse neuron to encode information to represent the value function of the current state. For the pulse neuron, the first pulse generated by the output neuron can be meaningfully encoded. After proper modulation, the pulse neuron can generate the first pulse at any time, that is, encode the information on the positive time axis, with a value range of t out ∈(0,+∞).
[0076] Consider introducing a modulator neuron in the hidden layer of a neural network. The function of this neuron is to stimulate a pulse after a long enough time and transmit it to the output neuron. Set the weight of the connection between the modulator neuron and the output neuron.
[0077]
[0078] The pulse excited by the modulation neuron will cause the output neuron to excite a pulse after reaching the output neuron, and the time when the output neuron excites the pulse is the time when the pulse response reaches the peak.
[0079] Let the time of the modulated neuron firing pulse be t ad , then the time it takes for the modulating neuron to generate a pulse on the output neuron is
[0080] t out =t ad +t p (6)
[0081] It should be noted that the function of the modulator neuron is to enable the output neuron to generate pulses under any conditions, so it actually plays a "bottom line" role. Therefore, the time for the modulator neuron to excite the pulse must be large enough so as not to affect the output neuron's response to normal state input. The excitation time of the last pulse that reaches the output neuron is t last , then t ad The conditions that should be met are:
[0082] t ad >t last +t p (7)
[0083] In the Actor network, considering the discrete and finite action space, the first pulses generated by multiple spiking neurons can be used for encoding, so that each neuron represents an action to be selected. In this way, the time of the first pulse output by a single spiking neuron no longer has a specific meaning. What is meaningful is the order in which the first pulses are generated between different spiking neurons. In the leaky integrated discharge model and the pulse response model, the state of the spiking neuron can be solved exactly by the equation. In this way, the time when each neuron generates a pulse is strictly determined, and the order in which the first pulses are generated between different neurons is also strictly determined. Therefore, in order to apply this encoding method, it is necessary to add appropriate random operations to each neuron in the output layer to randomize the time when the neuron generates a pulse. Then, by the order in which different spiking neurons generate pulses, the probability of selecting a certain action instead of another action can be encoded.
[0084] In a specific embodiment, the pulse AC update mechanism in a dynamic environment is improved by modulating neurons and adding random operations to enable the network output to adapt to the dynamic environment. In the present invention, the update mechanism of the pulse network is improved based on the existing input-output representation to realize a pulse AC network fast decision-making method in a dynamic environment, wherein the update mechanism of the Critic network is improved:
[0085] Assume that the parameter of the Critic network is w, and list the update formula of the Critic network:
[0086]
[0087] Among them, G t λ and V(s t ,w) can be easily obtained as the network output, and then the value function gradient is calculated Based on this, the parameters of the Critic network are updated.
[0088] Among them, the asynchronous update mechanism based on the A3C algorithm is: for fast decision-making tasks such as dynamic obstacle avoidance, the action decision speed of the Actor network should be as fast as possible; and in order to ensure the output of a more accurate state value function, the first pulse of the Critic network should be taken within a larger time range. The problem caused by this is that when the Actor network generates an action signal, the Critic network may still need some time to generate a value function signal. The speed of the Critic network lags far behind that of the Actor network, causing the Critic network to be blocked. While being unable to generate the current state value function in time, it will also hinder the generation of the state value function at the next moment, causing the parameters of the AC network to be unable to be updated. In order to solve this problem, the Asynchronous Advantage Actor Critic (A3C) algorithm can be used to improve the update mechanism.
[0089] The asynchronous advantage Actor-Critic algorithm is an improved algorithm based on the Actor-Critic algorithm. Its basic idea is to asynchronously and parallelly execute multiple agents on multiple instances of the environment, and reduce sample correlation through sample training collected by each parallel agent. Because at any given time step, the parallel agents will experience a variety of different states, this parallelism makes the data of the agents become a smoother process through decorrelation. Generally, an agent is implemented by a separate thread, and the learning speed of the A3C algorithm is approximately linear with the number of threads.
[0090] In the A3C algorithm, a main thread is responsible for saving all parameters of the Actor-Critic network, including the parameters w and π of V(s,w). θ When the sub-thread starts training, it needs to download the parameters of the Actor-Critic network from the main thread, and then accumulate the gradients dw and dθ of the parameters through separate training. After training for a period of time, the accumulated gradients are uploaded to the main thread for update.
[0091] Because the A3C algorithm needs to accumulate the gradient of parameters, it uses an n-step update method when updating. The difference between it and the general Actor-Critic algorithm is that it uses the advantage function A(s t ,a t ; θ',w') replaces the timing difference δ.
[0092] Applying the idea of asynchronous update of the A3C algorithm to the pulse AC network can solve the problem of asynchronous signal generation between the Actor network and the Critic network in the pulse neural network.
[0093] Based on this idea, whenever the Actor network generates an action signal, the input pulse sequence is truncated and the state at a new moment begins. At this time, a new Critic network is introduced, and the state at the new moment is input into the new Critic network, while the state at the old moment is still transmitted in the original Critic network until the original Critic network outputs the state value function at the old moment. At this time, the network parameters are updated, such as Figure 2 As shown. At the beginning, the pulse sequence is input into the Actor network and the Critic1 network at the same time; at time t1, the Actor network generates an action signal, at this time, the input pulse sequence takes time t1 as the new initial 0 time, generates a new state, and inputs it into the Critic2 network; at time t2, the Actor network generates an action signal, at this time, the input pulse sequence takes time t2 as the new initial 0 time, generates a new state, and inputs it into the Critic3 network; and so on.
[0094] It should be noted that the practice of generating the state at a new moment by truncating the pulse sequence and passing the new state to the new Critic network does not actually separate the two networks. The parameters of the new Critic network are inherited from the parameters of the original Critic network. For the original Critic network, when it generates a state value function, its round ends and the network starts to be updated; for the new network, there is no new round, the original round does not end, and the state value function generated by the original Critic network is still in the round until the new network also generates a state value function, and the round ends.
[0095] When the Critic generates a state-value function and updates the network parameters, the newly introduced Critic no longer uses the original parameters. At this time, the two networks are separated in a practical sense, and the original rounds are no longer applied.
[0096] The multi-step update mechanism based on the λ regression algorithm is:
[0097] When the brain-like decision-making method based on the A3C update mechanism introduces a new Critic network, the original update round is not interrupted. The original Critic network ends the round when it generates a state value function, and starts to update the network with its own state value function V0; for the new Critic network, the round ends when it generates its own state value function V1, and the network starts to be updated by comprehensively considering the state value function V0 of the original Critic network and the value function V1 of the new Critic network.
[0098] In the actual training process, the method of continuously accumulating parameter gradients according to the A3C algorithm will result in the earlier the Critic network is introduced, the greater the impact of the state value function it generates. The state value function generated by the original Critic network is not only used to update parameters in the original network's own round, but also in the new network's round. When a newer network is generated, the previous state value function will still be used to update parameters in the newer round.
[0099] The reason for this phenomenon is that the algorithm based on the A3C update mechanism is not essentially running in parallel, and each Critic network has a very obvious time continuity relationship. In order to avoid this phenomenon, the rounds can be merged and the network parameter update time can be changed to the update at the end of the big round. In this way, for each Critic network, when its own round ends, it is only one step for the big round, and the parameter gradient is uploaded for update at the end of the big round, which is equivalent to "reducing" the capacity of each round to one step, thus avoiding excessive reuse of state value functions.
[0100] The method of updating in multiple rounds can refer to the lambda regression algorithm. The lambda regression algorithm is a composite update method that comprehensively considers the value function of the subsequent state when updating the network.
[0101] n-step regression can be used as a learning target for updating the parameters of the fitting function. This conclusion also applies to the average values of n-step regressions with different step numbers. When the weighted sum of the average values is 1, the composite update method of this combined regression is the same as that of n-step regression. By reducing the TD time series difference for updating, the parameter convergence can be guaranteed.
[0102] Gt:t+2 / 2+G t:t+4 For example, Figure 3 As shown. The status is updated to s t+2 When , we can calculate the 2-step regression G t:t+2 , the status is updated to s t+4 When , we can calculate the 4-step regression G t:t+4 .
[0103] λ regression is a special type of combined regression, such as Figure 4 . λ regression includes all n-step regressions, and the weight coefficients are (1-λ)λ n-1 , where λ∈[0,1]. Since the sum of weights is 1, parameter convergence is still guaranteed. The value of λ reflects the idea that the farther the state is from the current state, the smaller its influence. Like all combined regression methods, λ regression needs to return to update after the end of the largest round, and λ regression includes all n-step regressions, and its largest round has infinite steps. Of course, it is impossible to return to update the current state after infinite steps. In practical applications, it is often truncated at h steps.
[0104] The multi-step update formula based on the λ algorithm is applied to the brain-like decision-making method of the pulse AC network. Combined with the asynchronous update mechanism based on the A3C algorithm and the input-output coding adjusted in the dynamic environment, the pulse AC network algorithm in the dynamic environment can be obtained.
[0105] In a specific embodiment, in step 1), the specific process of establishing the neuron pulse response model is: through the kernel function η(s) and the kernel function κ(s), plus the threshold condition, the neuron pulse response model is constructed. The kernel function η(s) describes the reset of the membrane potential and explains the behavior of the neuron excitation pulse; the kernel function κ(s) summarizes the linear electrical characteristics of the neuron membrane surface.
[0106] Simulation verification: Let the drone hover in the air and let the dynamic obstacles quickly approach the hovering drone. After the drone detects the approaching obstacle, it quickly makes a decision based on the algorithm to avoid the flying obstacle. Figure 5As shown in the figure. The basketball is thrown from 3-5 meters in front of the drone's hovering position, and the throwing speed is 3-5 meters / second. The sensor selected by the drone to monitor flight obstacles is a monocular camera with a frame rate of 31fps. In order to facilitate network training and calculation, the actions that the drone can take are limited to three: flying to the left, flying to the right, and maintaining hovering in place. In the experiment, the maximum flight speed of the drone is limited to 3 meters / second. The position where the basketball is thrown is arbitrarily selected 3-5 meters in front of the drone, and its flight trajectory will pass through the surrounding area of the drone's initial position. The drone must determine whether the basketball will pose a threat to itself and then make a decision. Because the flight trajectory of the basketball will be concentrated on the drone's initial position, in order to prevent the drone from making an evasive decision and not returning to its original position, reducing the training effect, the drone should be kept in place as much as possible, and even after making an evasive decision, it will return again.
[0107] After setting up the experimental scene, we started to train the spiking neural network in the simulation environment. The simulation environment platform is still the XTDrone UAV simulation platform. Dynamic obstacles are designed in the XTDrone platform to train the spiking neural network.
[0108] The structure of the pulse AC network is as follows Figure 6 As shown in Figure 2, the number of neurons in the input layer is the same as the number of pixels in the monocular camera. The input neurons perform the operation of taking the difference of the logarithmic brightness of the pixels, and according to the difference result, the neurons corresponding to the pixels with obvious changes in brightness generate pulses.
[0109] The hidden layers of the Actor network and the Critic network consist of 16*16 spiking neurons.
[0110] The output layer of the Actor network has 3 neurons, representing flying to the left, flying to the right, and hovering in place. The output layer of the Critic network has 1 neuron, representing the state value function.
[0111] During the simulation, the basketball was thrown 3-5 meters in front of the drone, the throwing speed was set to 4m / s to 5m / s, and the basketball landed 1 meter around the initial position of the drone. One throw of the ball is considered a round, and generally, the duration of a round is about 1 second. During the simulation, the overall time of the pulse neural network is discrete, with a time step of 1 millisecond.
[0112] The process of throwing a ball is called one round, and the parameter learning is set to 2000 rounds. During the learning process, the cumulative reward signal obtained by the drone is as follows: Figure 7 As shown in Figure 2, the cumulative reward signal obtained by the drone shows an upward trend, indicating that the training is effective and the survival time of the drone is increasing.
[0113] like Figure 8 As shown in the figure, while waiting for the action signal, that is, during the decision-making process, the drone is at its original position and in a hovering state. When the ball flies towards the drone and the drone fails to make the correct decision in real time, the drone fails to dodge the flying ball and is penalized. It should be noted that when the drone is penalized for failing to make a decision in real time, the parameters of the Actor network are increased to speed up the decision-making process.
[0114] like Fig. 9 As shown in the figure, in this scenario, the ball falls from the front of the drone, and its trajectory does not collide with the drone. The correct decision made by the drone is to maintain hovering in place and let the ball fall freely.
[0115] like Fig.10 As shown, in this scenario, the ball flies from the left front of the drone to the rear of the drone. The drone makes a quick decision and chooses to fly to the right to avoid the flying ball.
[0116] like Fig.11 As shown in the figure, the ball flies from the left front of the drone to the front of the drone. The drone makes a quick decision and chooses to fly to the left to avoid the flying ball. The above typical scenarios do not appear in isolation. When the network is trained to a later stage and the drone's decision-making speed is further accelerated, the drone may make multiple decisions during the ball's flying process.
[0117] During the training process, the time it takes for the drone to make a decision gradually decreases. Table 1 is a distribution table of the drone’s decision time during the training process. The data in round 0 represents the performance of random parameters before training begins. In order to facilitate network optimization and improvement, relatively small parameters are selected when initializing parameters. Therefore, before training begins, the drone takes a long time to make a decision.
[0118] In addition, we selected the data of the 500th, 1000th, 1500th, and 2000th rounds for analysis. We noticed that the overall trend was that within a round, the time it took the drone to make a decision gradually decreased, and the number of times the drone made a decision gradually increased. At round 2000, when the training ended, the average time it took the drone to make a decision dropped to 30.7 milliseconds.
[0119] Table 1. Distribution of drone decision time
[0120]
[0121] At the end of the training, the specific decision time of the drone is as follows: Fig.12 As shown in the figure, it can be seen that in the 2000th round, the drone made a total of 32 decisions, and the decision time was concentrated in the range of 25ms to 35ms.
[0122] During the training process, the average decision time of the drone changes as follows: Fig.13 As shown in Figure 2, it can be seen that during the training process, the average decision time of the drone generally shows a downward trend.
[0123] Compared with the traditional Actor-Critic algorithm, the neuron impulse response model and pulse AC network decision method adopted in the present invention are based on the pulse neural network, and in the timing-based coding, the pulse neural network can reduce the decision time of the drone.
[0124] For the traditional AC network, in order to identify the trajectory of the motion obstacle, three consecutive frames of the camera are required as input. The overall network structure is two convolutional layers and one fully connected layer. The fully connected layer itself is divided into two parts, representing the actor and the critic. Fig.14 shown.
[0125] The following is a comparison of the decision-making time of the two methods: After the network training is completed, a hundred basketball throwing experiments are carried out in the simulation platform, and the drone uses the pulse AC algorithm and the traditional AC algorithm to make decisions. Fig.15 The distribution of decision time for dodging a basketball is shown. Note that the decision time of the brain-like decision algorithm based on the pulsed AC network is mainly concentrated in the range of 25ms to 35ms, while the decision time of the decision algorithm based on the traditional AC network is concentrated in the range of 55ms to 65ms. Therefore, the brain-like decision algorithm proposed by the present invention is significantly faster, and therefore the number of decisions in one round is also significantly higher.
[0126] Fig.16 As shown, it shows the average decision time in one hundred rounds of basketball dodge experiments. The average decision time of the drone using the brain-like decision algorithm proposed by the present invention is about 30ms, while the average decision time of the drone based on the traditional AC network decision algorithm is about 60ms. Therefore, the drone brain-like decision algorithm proposed by the present invention greatly speeds up the decision-making speed of the drone.
[0127] Compared with traditional neural networks, pulse neural networks have the characteristics of low power consumption and small scale. Compared with traditional AC networks, the scale of the pulse AC network in the present invention is greatly reduced. The traditional AC network requires 3 frames of data as input, while the input layer scale of the pulse AC network is only 1 / 3 of that. At the same time, the pulse AC network proposed in the present invention does not have two layers of convolution operations, but is replaced by a fully connected hidden layer. Therefore, in comparison, the brain-like decision-making network proposed in the present invention is much smaller in scale than the traditional AC network.
[0128] In addition, the pulse neural network transmits pulse information and is a neural network driven by pulse events. When the pulse signal does not arrive, the entire network is in a non-working state. In contrast, the traditional AC network is based on real values, so the network is in a working state at any time. Therefore, the brain-like decision-making algorithm proposed in this article can reduce resource consumption in terms of mechanism.
[0129] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A drone brain-based obstacle avoidance method for avoiding dynamic obstacles, characterized in that: Includes steps: 1) Analyze the response characteristics of spiking neurons and establish a neuron spiking response model; 2) Perform differential coding processing on the input camera data of the pulse AC network, perform timing coding modulation on the output timing signal, and update the network update mechanism of the pulse AC network based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the λ regression algorithm; 3) Obtain the drone’s camera data and output obstacle avoidance decisions through the neuron pulse response model and the updated pulse AC network to avoid obstacles; In step 2), the camera data is pulse-encoded so that it can be directly recognized by the spiking neural network; the pulse encoding of the camera data is achieved by identifying the data changes on the corresponding pixels; the camera data needs to be differentially operated, specifically: The camera data is the RGB brightness value. According to the brightness change of each pixel position, a pulse signal is generated to identify the change; the brightness of each pixel is converted into logarithmic brightness as follows: Among them, I R ,I G ,I B are the RGB data of the camera, u is the corresponding pixel position, and t is the corresponding time; The logarithmic brightness of the pixels is differentiated to generate corresponding brightness changes; a threshold ∆L is selected, and the brightness change exceeding the threshold ∆L is set as an obvious change that the drone needs to pay attention to, that is: These apparent changes are recorded through f(u,t); f(u,t) is the required pulse input of the drone; In step 2), the process of performing timing coding modulation on the output timing signal is as follows: In the Critic network, the output layer only needs one pulse neuron to encode information to represent the value function of the current state; after modulation, the pulse neuron can generate the first pulse at any time, that is, encode the information on the positive time axis, with a value range of t out ∈(0,+∞); Set the weight of the connection between the modulation neuron and the output neuron. The pulse stimulated by the modulation neuron will cause the output neuron to stimulate a pulse after reaching the output neuron, and the time for the output neuron to stimulate the pulse is the time when the pulse response reaches the peak value. In the Actor network, the first pulse generated by multiple spiking neurons is used for encoding, so that each neuron represents an action to be selected. Appropriate random operations are added to each neuron in the output layer to randomize the time when the neuron generates pulses. Then, the probability of selecting a certain action instead of another action is encoded through the order in which different spiking neurons generate pulses. When the pulse AC network is updated by the asynchronous update mechanism based on the A3C algorithm, an n-step update method is adopted, and the advantage function A(s t ,a t ;θ',w') replaces the time difference δ; whenever the Actor network generates an action signal, the input pulse sequence is truncated and the state at a new moment begins. At this time, a new Critic network is introduced, and the state at the new moment is input into the new Critic network, while the state at the old moment is still transmitted in the original Critic network until the original Critic network outputs the state value function of the old moment, at which time the network parameters are updated; initially, the pulse sequence is input into the Actor network and the Critic1 network at the same time; at time t1, the Actor network generates an action signal, at which time the input pulse sequence takes time t1 as the new initial 0 moment, generates a new state, and is input into the Critic2 network; at time t2, the Actor network generates an action signal, at which time the input pulse sequence takes time t2 as the new initial 0 moment, generates a new state, and is input into the Critic3 network; and so on.
2. The drone brain-based obstacle avoidance method for avoiding dynamic obstacles according to claim 1, characterized in that: In step 2), the time interval ∆T between frames input by the camera is different from the time interval ∆t used in the simulation; the linear interpolation method is used to spread the pixel logarithmic brightness change between the two frames to the frame time interval to complement the pulse signal encoding between frames.
3. The drone brain-based obstacle avoidance method for avoiding dynamic obstacles according to claim 1, characterized in that: When the multi-step update mechanism based on the λ regression algorithm is used to update the pulse AC network, the rounds are merged and the network parameter update time is transferred to the update at the end of the large round; the λ regression includes all n-step regressions, and the weight coefficients are (1-λ)λ n-1 , where λ∈[0, 1], λ regression returns to update after the maximum round ends, and λ regression includes all n-step regressions.
4. The drone brain-based obstacle avoidance method for avoiding dynamic obstacles according to claim 1, 2 or 3, characterized in that: The obstacle avoidance decisions include flying left, flying right and hovering.
5. A drone brain-based obstacle avoidance system for avoiding dynamic obstacles, used to perform the steps of the method as claimed in any one of claims 1 to 4, characterized in that: include: The first program module is used to analyze the response characteristics of the pulse neuron and establish a neuron pulse response model; The second program module is used to perform differential coding processing on the input camera data of the pulse AC network, perform timing coding modulation on the output timing signal, and update the pulse AC network based on the asynchronous update mechanism of the A3C algorithm and the multi-step update mechanism based on the lambda regression algorithm; The third program module is used to obtain the camera data of the drone and output the obstacle avoidance decision through the neuron impulse response model and the updated pulse AC network to avoid obstacles.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program executes the steps of the method according to any one of claims 1 to 4 when executed by a processor.
7. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: The computer program executes the steps of the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Multi-brain area cooperative autonomous decision making method based on multi-modal fusion
CN108197698A
Fault diagnosis model self-learning method based on asynchronous parallel reinforcement learning
CN112801272A
Anti-interference method and device for autonomous vehicle
CN113485313A
Deep space probe autonomous fault diagnosis method based on spiking neural network
CN113688885A
Method for classifying the traffic dynamism of a network communication using a network that contains pulsed neurons, neuronal network and system for carrying out said method
US20050105463A1
