# An Automatic Driving Control Method Based on Deep Deterministic Policy Gradient

Authors: Haifei Zhang; Jian Xu; Jianlin Qiu
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

The traditional automatic driving behavior decision algorithm needs to manually set complex rules, resulting in long vehicle decision-making time, poor decision-making effect, and no adaptability to the new environment. As one of the main methods in the field of machine learning and intelligent control in recent years, reinforcement learning can learn reasonable and effective policies only by interacting with the environment. Firstly, this paper introduces the current research status of automatic driving technology and the current mainstream automatic driving control methods. Then, it analyzes the characteristics of convolutional neural network, reinforcement learning method (Q-learning), and deep Q network (DQN) and deep deterministic policy gradient (DDPG). Compared with the DQN algorithm based on value function, the DDPG algorithm based on action policy can well solve the continuity problem of action space. Finally, the DDPG algorithm is used to solve the control problem of automatic driving. By designing a reasonable reward function, deep convolution network, and exploration policy, the intelligent vehicle can avoid obstacles and, finally, achieve the purpose of avoiding obstacles and running the whole process in a 2D environment.


---

## Body

## 1. Introduction

The traditional automatic driving technology involves the composition of perception, planning, decision-making, control, and other modules. Through the perception module, the relevant information of the road and environment is obtained, the overall driving route is planned, and then, the planning and perceived information are continued to be used for future driving goals. Such a design may be associated with many task modules. For some complex task systems, the number of modules will be particularly large, and the maintenance cost will be relatively high. At present, some supervised learning methods can achieve their goals through learning and training, but such learning methods need a large amount of learning data as the basis of network training. Through the historical data, some feature points are obtained to act on the experience pool of target decision-making. Such methods need a large amount of labeled data, which cannot achieve the goal of self-help learning and online decision-making. This paper uses the technology of the deep reinforcement learning-deep deterministic policy gradient method to train the policy network, so that the network can control the intelligent vehicle to avoid obstacles and, finally, achieve the purpose of avoiding obstacles and running the whole process in the 2D environment.


## 2. Related Work

The automatic driving technology in China started later than in other countries. In the real sense, the automatic driving vehicle equipped with some sensors is the beginning of the study of automatic driving in China. After entering the 21st century, the emergence of autonomous driving of unmanned vehicles has created the highest driving speed record in China, reaching 76 kilometers per hour. After that, some other scientific research institutions developed an automatic driving vehicle platform, which has a certain impact in China. The domestic Baidu company is a leader in the IT field and has invested a lot of money and R&D strength in automatic driving. In terms of automatic driving, fully automatic driving under mixed road conditions has been perfectly realized, and relevant research and development tests are further promoted [1, 2]. By the end of November 2016, the number of patent applications for Baidu automatic driving technology had reached 605. Relying mainly on the accumulation of artificial intelligence and deep learning, Baidu is engaged in the development of ten technologies related to driverless vehicles, including ten technologies of environmental perception, behavior prediction, planning and control, operating system, intelligent interconnection, on-board hardware, human-computer interaction, high-precision positioning, high-precision map, and system security [3]. The methods based on reinforcement learning and deep reinforcement learning have achieved good results in automatic driving and have great application significance in training efficiency and driving strategies. However, further research and development are still needed in complex problems and considering pedestrians [4–7]. In terms of deep learning automatic driving, scholars from Tsinghua University have improved the robustness and accuracy of algorithm recognition through the research on CNN-related algorithms and achieved good results in multitarget recognition, but there are too many redundant results and low efficiency [8]. The automatic driving technology using machine learning mainly studies how computers acquire knowledge or optimize their own skills through experience or exploring the environment to improve learning and computing efficiency. This is a technical field used to solve automatic driving in the current development [9]. Transfer trajectory planning, reinforcement learning, deep reinforcement learning, and machine learning are widely used to solve the problem of automatic driving [10–12]. At present, although some research results have been achieved in automatic driving technology, there are still some problems in many aspects. Therefore, it is very meaningful to use the deep deterministic policy gradient method to study automatic driving technology.Foreign automatic driving technology, from the beginning of the unmanned carrier, automatic driving handling equipment first appeared in the United States. It was used to transport goods in the grocery warehouse with arranged wires [3]. After that, someone successfully developed an autonomous robot, which can drive automatically on low speed and flat roads. Some automatic driving competitions abroad have also promoted the development of automatic driving technology. The foreign Google company is a leader in the technology of automatic driving in the industry. Since the preparation, it participated in the driving test on time urban roads with the developed automatic driving vehicle in 2010 [13–15]. Bojarski et al. [16] proposed an end-to-end learning automatic driving mode, which can learn the steering wheel control policy from the data captured by the vehicle camera through the convolutional neural network. However, this method needs to input the data of human driving into the training network, and the cost of data acquisition and annotation is large. Chae et al. [17] proposed a brake control system based on deep reinforcement learning. Based on the DQN algorithm, the system judges whether braking is required and the braking force through the data captured by the sensor, so as to avoid hitting obstacles and pedestrians. However, this method only applies deep reinforcement learning to the brake control system, which has great limitations. Sallab et al. proposed an end-to-end reinforcement learning policy [18] for lane auxiliary maintenance, comparing the DQN algorithm of discrete policy with the DDAC algorithm of discrete policy, and achieved good results. Sallab et al. proposed a deep reinforcement learning framework for automatic driving [19], which divides automatic driving into three stages: identification, prediction, and planning. The framework uses a deep neural network for identification and a cyclic neural network for prediction and uses the method of deep reinforcement learning to train the planning network segment. Chen et al. [20] proposed a new autonomous driving mode based on direct perception, which uses the deep ConvNet architecture to estimate the enlightenment of driving behavior, rather than analyzing the whole scene (intermediary perception method) or blindly mapping the image directly to driving commands (behavior reflection method). In May 2016, Google announced its cooperation with Fiat Chrysler Automobiles (FCA). FCA produced 100 Pacifica hybrid vans for Google, equipped with a complete set of sensors, telematics, and computing units. In October, the test vehicle equipped with the new automatic driving system was tested in many places with extreme weather in the United States. At the same time, automobile enterprises including Japan and Germany have also joined the research of automatic driving and are jointly committed to the research of automatic driving technology.


## 3. Reinforcement Learning

### 3.1. Principles of Reinforcement Learning

Reinforcement learning is a process in which agents learn how to take a series of actions in the environment, so as to maximize the cumulative reward. The basic framework of reinforcement learning algorithm is shown in Figure1. The agent in the algorithm represents the subject of problem solving. For example, the agent in this study is an autonomous vehicle. The agent tries to make an action in the environment, which will lead to the environment being updated, and the agent will transition to a new state. In such a process, the agent can get the reward corresponding to the previous action at the same time. Repeating this process will produce a large number of training sample sets. Using these data to continuously optimize the behavior of the agent, after a long time of training, we will get an optimal policy to complete the task.Figure 1
Basic framework of reinforcement learning.The theoretical basis of reinforcement learning is the Markov decision process (MDP). The most basic form of MDP is the Markov chain, which must conform to the Markov property, that is, the conditional probability distributionP of the future state S of the system only depends on the current state and has nothing to do with the past state, which will make the observed state conditionally independent.The Markov decision process includes the following steps: give the agent the initial states1, the agent is in the s1 state, select the action a1 from the action space A, reach the next state s2, get the reward r1, continue to select the action a2, get the reward r2, and enter the state s3, and so on until the agent reaches the maximum number of iterative steps T. The process from any time t to the ending state is called an episode, and the reward obtained in the episode is expressed as the following equation:
(1)Gt=rt+1+γrt+2+γ2rt+3+⋯⋯+γTrt+T+1=∑k=0Tγkrt+k+1.Among them,γ is a number between 0,1; γk means that the larger the time step t is, the less influence the reward will have on the current action. Since the reward obtained fluctuates greatly, the expectation of reward is introduced as the state-value in the following equation:
(2)Vs=EG∣St=s.The learning process of reinforcement learning is the process of optimizing the policy by maximizing the state value function. The policy is the control rule of the agent, which can be expressed as the probability distribution function of the actions that can be taken in a certain state. That is,(3)πa∣s=PAt=a∣St=s.If you want to maximize the reward in the whole stage, you can achieve it by selecting the maximum reward action in each state in the agent and introducing the Bellman equation to define the state value in the following equation:(4)Vs=maxa∈AEs′∈Srs,a+γVs′=maxa∈A∑s′∈Spa,s⟶s′rs,a+γVs′,where Vs and Vs′ represent the value of the current state and the target state, respectively; pa,s⟶s′ represents the probability that the agent reaches the target state s′ after an action a is selected in the state s. According to this formula, the value expression of the action can be extracted as the following equation:
(5)Qs,a=Es′∈Srs,a+γVs′=∑s′∈Spa,s⟶s′rs,a+γVs′.Thus, the theoretical basis ofQ-learning is obtained as the following equation:
(6)Qs,a=rs,a+γmaxa′∈AQs′,a′.


### 3.2.Q-Learning Algorithm

TheQ-learning algorithm is an algorithm based on value function, which belongs to the model-free learning method. The learning algorithm establishes a “state action” Q table, learns the value of a specific state and a specific action, records the action value function obtained by the action taken in the current state, and updates the Q table through the reward brought by each action. The update method is expressed in the following equation:
(7)Qs,a=1−λtQs,a+λtr+γmaxa∈AQs′,a′,whereA is the collection of a series of actions, a is the action taken in the current state, s′ is the next state, and a′ is the next predicted action. γ is the discount factor, and λ is the learning rate. The larger the λ value, the faster the learning convergence. If it is too large, it is easier to overconverge rather than to arrive at the optimal solution. The flow chart of the Q-learning algorithm is shown in Figure 2.Figure 2
Flow chart ofQ-learning algorithm.


## 3.1. Principles of Reinforcement Learning

Reinforcement learning is a process in which agents learn how to take a series of actions in the environment, so as to maximize the cumulative reward. The basic framework of reinforcement learning algorithm is shown in Figure1. The agent in the algorithm represents the subject of problem solving. For example, the agent in this study is an autonomous vehicle. The agent tries to make an action in the environment, which will lead to the environment being updated, and the agent will transition to a new state. In such a process, the agent can get the reward corresponding to the previous action at the same time. Repeating this process will produce a large number of training sample sets. Using these data to continuously optimize the behavior of the agent, after a long time of training, we will get an optimal policy to complete the task.Figure 1
Basic framework of reinforcement learning.The theoretical basis of reinforcement learning is the Markov decision process (MDP). The most basic form of MDP is the Markov chain, which must conform to the Markov property, that is, the conditional probability distributionP of the future state S of the system only depends on the current state and has nothing to do with the past state, which will make the observed state conditionally independent.The Markov decision process includes the following steps: give the agent the initial states1, the agent is in the s1 state, select the action a1 from the action space A, reach the next state s2, get the reward r1, continue to select the action a2, get the reward r2, and enter the state s3, and so on until the agent reaches the maximum number of iterative steps T. The process from any time t to the ending state is called an episode, and the reward obtained in the episode is expressed as the following equation:
(1)Gt=rt+1+γrt+2+γ2rt+3+⋯⋯+γTrt+T+1=∑k=0Tγkrt+k+1.Among them,γ is a number between 0,1; γk means that the larger the time step t is, the less influence the reward will have on the current action. Since the reward obtained fluctuates greatly, the expectation of reward is introduced as the state-value in the following equation:
(2)Vs=EG∣St=s.The learning process of reinforcement learning is the process of optimizing the policy by maximizing the state value function. The policy is the control rule of the agent, which can be expressed as the probability distribution function of the actions that can be taken in a certain state. That is,(3)πa∣s=PAt=a∣St=s.If you want to maximize the reward in the whole stage, you can achieve it by selecting the maximum reward action in each state in the agent and introducing the Bellman equation to define the state value in the following equation:(4)Vs=maxa∈AEs′∈Srs,a+γVs′=maxa∈A∑s′∈Spa,s⟶s′rs,a+γVs′,where Vs and Vs′ represent the value of the current state and the target state, respectively; pa,s⟶s′ represents the probability that the agent reaches the target state s′ after an action a is selected in the state s. According to this formula, the value expression of the action can be extracted as the following equation:
(5)Qs,a=Es′∈Srs,a+γVs′=∑s′∈Spa,s⟶s′rs,a+γVs′.Thus, the theoretical basis ofQ-learning is obtained as the following equation:
(6)Qs,a=rs,a+γmaxa′∈AQs′,a′.


## 3.2.Q-Learning Algorithm

TheQ-learning algorithm is an algorithm based on value function, which belongs to the model-free learning method. The learning algorithm establishes a “state action” Q table, learns the value of a specific state and a specific action, records the action value function obtained by the action taken in the current state, and updates the Q table through the reward brought by each action. The update method is expressed in the following equation:
(7)Qs,a=1−λtQs,a+λtr+γmaxa∈AQs′,a′,whereA is the collection of a series of actions, a is the action taken in the current state, s′ is the next state, and a′ is the next predicted action. γ is the discount factor, and λ is the learning rate. The larger the λ value, the faster the learning convergence. If it is too large, it is easier to overconverge rather than to arrive at the optimal solution. The flow chart of the Q-learning algorithm is shown in Figure 2.Figure 2
Flow chart ofQ-learning algorithm.


## 4. Deep Reinforcement Learning

Deep reinforcement learning is the combination of deep learning and reinforcement learning. Classical algorithms include the DQN algorithm and DDPG algorithm. The DDPG algorithm is further developed on the basis of the DQN algorithm. It is a model-free and off-policy algorithm.


### 4.1. DQN Algorithm

The traditional DQN [21] is a method combining Q-learning and the deep neural network. Deep Q network has advantages in dealing with continuous state space, but it cannot solve the problem of continuous action space. Figure 3 shows the structure of the DQN algorithm, and Figure 4 shows the flow chart of the DQN algorithm.Figure 3
DQN algorithm flow structure.Figure 4
The flow chart of DQN algorithm.


### 4.2. DDPG Algorithm

The DDPG algorithm [22] is an off-policy and model-free deep reinforcement learning algorithm, combining deep learning and reinforcement learning, integrating the advantages of the DQN algorithm and Actor-Critic (AC) algorithm. The DDPG algorithm is the same as the AC algorithm framework, but its neural network division is finer. The DQN algorithm has good performance in discrete problems. The DDPG algorithm uses the experience of DQN for reference to solve the problem of continuous control and realize end-to-end learning. The algorithm flow of DDPG is shown in Figure 5, in which the actor network accepts the input state, makes action selection, and outputs action variables; the critic network evaluates the quality of the selected action and calculates the reward value. The detailed steps of the DDPG algorithm are as follows:
(1)
Initialize the parameters of the neural network. The actor selects an action according to the behavior policy, adds noiseNt to the action output by the policy network to increase exploration, and transmits it to the environment to execute the action at:
(8)at=μst∣θμ+Nt.(2)
After the environment is executedat, return to reward rt and new state st+1(3)
Actor stores the state transitionst,at,rt,st+1 into the replay memory as the training set of the online network(4)
DDPG creates two copies of neural networks for the policy network and theQ network, respectively, the online network and the target network. The update method of the policy network is as follows:(9)online:Qs,a∣θμ,gradientupdateθμ,target:Qs,a∣θμ′,softupdateθμ′.Figure 5
The algorithm flow chart of DDPG.TheQ network update method is as follows:
(10)online:Qs,a∣θQ,gradientupdateθQ,target:Qs,a∣θQ′,softupdateθQ′.N transition data are randomly sampled from replay memory as minibatch training data of the online policy network and online Q network. Single transition data in minibatch is represented by si,ai,ri,si+1.
(5)
In critical, calculate theQ gradient of the online Q network:The loss of theQ network is defined as
(11)L=1N∑iyi−Qsi,ai∣θQ2,yi=ri+γQ′si+1,μ′si+1∣θμ′∣θQ′.The gradient forL and θQ can be obtained: ∇θQL, where the calculation uses the target policy network μ′ and target Q network Q′.
(6)
Update onlineQ: update θQ with the Adam optimizer(7)
In the actor, calculate the policy gradient of the policy network:(12)∇θuJβμ≈1N∙∇αQs,a∣θQs=si,a=wsi∙∇θμμs∣θμs=si.(8)
Update online policy network: updateθμ with the Adam optimizer(9)
The parameters of the target network adopt the method of soft update:(13)θQ′⟵τθQ+1−τθQ′,θμ′⟵τθμ+1−τθμ′.In general, the DDPG algorithm uses the Actor-Critic framework to iterate the training of the policy network andQ network through the interaction among the environment, actor, and critic.


## 4.1. DQN Algorithm

The traditional DQN [21] is a method combining Q-learning and the deep neural network. Deep Q network has advantages in dealing with continuous state space, but it cannot solve the problem of continuous action space. Figure 3 shows the structure of the DQN algorithm, and Figure 4 shows the flow chart of the DQN algorithm.Figure 3
DQN algorithm flow structure.Figure 4
The flow chart of DQN algorithm.


## 4.2. DDPG Algorithm

The DDPG algorithm [22] is an off-policy and model-free deep reinforcement learning algorithm, combining deep learning and reinforcement learning, integrating the advantages of the DQN algorithm and Actor-Critic (AC) algorithm. The DDPG algorithm is the same as the AC algorithm framework, but its neural network division is finer. The DQN algorithm has good performance in discrete problems. The DDPG algorithm uses the experience of DQN for reference to solve the problem of continuous control and realize end-to-end learning. The algorithm flow of DDPG is shown in Figure 5, in which the actor network accepts the input state, makes action selection, and outputs action variables; the critic network evaluates the quality of the selected action and calculates the reward value. The detailed steps of the DDPG algorithm are as follows:
(1)
Initialize the parameters of the neural network. The actor selects an action according to the behavior policy, adds noiseNt to the action output by the policy network to increase exploration, and transmits it to the environment to execute the action at:
(8)at=μst∣θμ+Nt.(2)
After the environment is executedat, return to reward rt and new state st+1(3)
Actor stores the state transitionst,at,rt,st+1 into the replay memory as the training set of the online network(4)
DDPG creates two copies of neural networks for the policy network and theQ network, respectively, the online network and the target network. The update method of the policy network is as follows:(9)online:Qs,a∣θμ,gradientupdateθμ,target:Qs,a∣θμ′,softupdateθμ′.Figure 5
The algorithm flow chart of DDPG.TheQ network update method is as follows:
(10)online:Qs,a∣θQ,gradientupdateθQ,target:Qs,a∣θQ′,softupdateθQ′.N transition data are randomly sampled from replay memory as minibatch training data of the online policy network and online Q network. Single transition data in minibatch is represented by si,ai,ri,si+1.
(5)
In critical, calculate theQ gradient of the online Q network:The loss of theQ network is defined as
(11)L=1N∑iyi−Qsi,ai∣θQ2,yi=ri+γQ′si+1,μ′si+1∣θμ′∣θQ′.The gradient forL and θQ can be obtained: ∇θQL, where the calculation uses the target policy network μ′ and target Q network Q′.
(6)
Update onlineQ: update θQ with the Adam optimizer(7)
In the actor, calculate the policy gradient of the policy network:(12)∇θuJβμ≈1N∙∇αQs,a∣θQs=si,a=wsi∙∇θμμs∣θμs=si.(8)
Update online policy network: updateθμ with the Adam optimizer(9)
The parameters of the target network adopt the method of soft update:(13)θQ′⟵τθQ+1−τθQ′,θμ′⟵τθμ+1−τθμ′.In general, the DDPG algorithm uses the Actor-Critic framework to iterate the training of the policy network andQ network through the interaction among the environment, actor, and critic.


## 5. Automatic Driving Control Method Based on DDPG

### 5.1. System Structure

The model of automatic driving is mainly divided into two parts, including the DDPG algorithm and the experimental simulation. By using the DDPG algorithm to train the neural network of the automatic driving model, the network can control the motor vehicle to avoid obstacles and drive normally on the road.The experimental simulation part mainly includes the motor vehicle and the environment of the motor vehicle. After receiving the control sensor, the information of the environment is continuously transmitted to the DDPG algorithm, so that the algorithm can obtain the state variables and reward values. Through the continuous training of the network and the continuous updating of network parameters, the target reward value is also continuously improved. The structure diagram of the automatic driving control system model is shown in Figure6. It mainly reflects that in the motor vehicle motion model, according to the control command action execution of the environment, the new state value is obtained and then the obtained reward value; the relevant parameters of this motion are trained in the neural network; and the trained network is continuously updated until the end. Such a process ends with the maximum number of iterations.Figure 6
Structure of automatic driving control system.


### 5.2. Automatic Driving Control Model

The automatic driving model involved in this design uses the two-dimensional500∗500 pixel space to control the automatic driving motor vehicle, in which the range of obstacles is the pixel space of the middle area 260∗260, and the parts (120, 120), (380, 120), (380, 380), and (120, 380) surrounded by the following four points and the areas beyond 500∗500 are the range of obstacles. The motor vehicle adopts the mode of fixed speed, with 5 sensors; the farthest detectable distance is 150; and the position coordinate of the motor vehicle starting training is (450, 300). The sensors are located in the middle and front of both sides of the vehicle, 45 degrees in front of the left and 45 degrees in front of the right. A total of five sensors are used to detect the operation of the current vehicle. The automatic driving control model is shown in Figure 7. The unmanned vehicle is marked as a 20∗40 pixel coordinate area. The sensor data mainly includes the distance from the obstacle and its coordinates. During the training process, the straight and turning directions of the agent are controlled by the network.Figure 7
Automatic driving model.


### 5.3. Automatic Driving Control Method

#### 5.3.1. Reward

The design of the reward function of the unmanned vehicle under this model is relatively simple. It mainly detects whether the unmanned vehicle encounters obstacles during each movement. If the target is -1, otherwise it is 0.(14)r=0,No_collision,−1,Have_collision.


#### 5.3.2. State

According to the current model design, the relevant parameters of the unmanned vehicle are selected as the training parameters of the DDPG algorithm, which mainly includes the five distance parameters detected by the sensor. When the minimum distance between the motion sensor and the obstacle is less than half of the unmanned vehicle, it means that the unmanned vehicle has a collision, and the reward is -1.


## 5.1. System Structure

The model of automatic driving is mainly divided into two parts, including the DDPG algorithm and the experimental simulation. By using the DDPG algorithm to train the neural network of the automatic driving model, the network can control the motor vehicle to avoid obstacles and drive normally on the road.The experimental simulation part mainly includes the motor vehicle and the environment of the motor vehicle. After receiving the control sensor, the information of the environment is continuously transmitted to the DDPG algorithm, so that the algorithm can obtain the state variables and reward values. Through the continuous training of the network and the continuous updating of network parameters, the target reward value is also continuously improved. The structure diagram of the automatic driving control system model is shown in Figure6. It mainly reflects that in the motor vehicle motion model, according to the control command action execution of the environment, the new state value is obtained and then the obtained reward value; the relevant parameters of this motion are trained in the neural network; and the trained network is continuously updated until the end. Such a process ends with the maximum number of iterations.Figure 6
Structure of automatic driving control system.


## 5.2. Automatic Driving Control Model

The automatic driving model involved in this design uses the two-dimensional500∗500 pixel space to control the automatic driving motor vehicle, in which the range of obstacles is the pixel space of the middle area 260∗260, and the parts (120, 120), (380, 120), (380, 380), and (120, 380) surrounded by the following four points and the areas beyond 500∗500 are the range of obstacles. The motor vehicle adopts the mode of fixed speed, with 5 sensors; the farthest detectable distance is 150; and the position coordinate of the motor vehicle starting training is (450, 300). The sensors are located in the middle and front of both sides of the vehicle, 45 degrees in front of the left and 45 degrees in front of the right. A total of five sensors are used to detect the operation of the current vehicle. The automatic driving control model is shown in Figure 7. The unmanned vehicle is marked as a 20∗40 pixel coordinate area. The sensor data mainly includes the distance from the obstacle and its coordinates. During the training process, the straight and turning directions of the agent are controlled by the network.Figure 7
Automatic driving model.


## 5.3. Automatic Driving Control Method

### 5.3.1. Reward

The design of the reward function of the unmanned vehicle under this model is relatively simple. It mainly detects whether the unmanned vehicle encounters obstacles during each movement. If the target is -1, otherwise it is 0.(14)r=0,No_collision,−1,Have_collision.


### 5.3.2. State

According to the current model design, the relevant parameters of the unmanned vehicle are selected as the training parameters of the DDPG algorithm, which mainly includes the five distance parameters detected by the sensor. When the minimum distance between the motion sensor and the obstacle is less than half of the unmanned vehicle, it means that the unmanned vehicle has a collision, and the reward is -1.


## 5.3.1. Reward

The design of the reward function of the unmanned vehicle under this model is relatively simple. It mainly detects whether the unmanned vehicle encounters obstacles during each movement. If the target is -1, otherwise it is 0.(14)r=0,No_collision,−1,Have_collision.


## 5.3.2. State

According to the current model design, the relevant parameters of the unmanned vehicle are selected as the training parameters of the DDPG algorithm, which mainly includes the five distance parameters detected by the sensor. When the minimum distance between the motion sensor and the obstacle is less than half of the unmanned vehicle, it means that the unmanned vehicle has a collision, and the reward is -1.


## 6. Simulation Experiment and Result Analysis

### 6.1. Experimental Setup

The parameters for solving the automatic driving problem using the DDPG algorithm are as follows: the maximum number of iterations is 500, the maximum number of steps per iteration is 600; the reward discount factor is 0.9; the learning rate of the actor and critical is 0.0001; batch-size, that is, the number of samples obtained in one training, is 16; and the number of neurons is 120. Simulation training for this problem was done in Python language and observation on the model training was done according to the model diagram, which can better reflect the current training degree of the model.


### 6.2. Result Analysis

The training of the algorithm at the beginning of model training is randomly intercepted. Through the visual diagram and the training process, it can be seen that the learning ability of the model at the beginning of training is not strong, the model can only be explored at will, and it is easy to collide at the beginning. Occasionally, automatic driving can be carried out briefly in a single direction. According to the diagram, we can only learn at the initial stage, mainly to explore some movement directions, and the uncertainty in the movement direction is not high.In the middle of model training, a model diagram in the training process is randomly intercepted. As can be seen from the figure, the automatic driving model of the unmanned vehicle has been able to avoid obstacles for turning or straight operation and can better avoid obstacles in the process of turning. The process of quickly avoiding obstacles and driving forward has been basically realized. The automatic driving control model can still gradually find a better motion planning direction through random straight or turning. In the process of this training, when encountering some places that have not been explored, there is still the possibility of collision, but with the continuation of the iteration, the driving can be basically completed.In the later stage of model training, a model diagram in the training process is randomly intercepted. As can be seen from the figure, the unmanned vehicle has been able to drive better in the control model, avoid obstacles perfectly, and hardly encounter obstacles. In the later stage of training, the network has basically been trained and formed, which can quickly judge whether the next action is straight or turning, and basically reaches the maximum steps of each iteration. From this aspect, it also reflects that the learning ability of the model is very good in the later stage and can well control the movement of the unmanned vehicle. The agent driverless model already has a relatively formed network model. The network parameters are optimized and the loss value is low, so this good effect can be achieved. Through this training, it is more fully explained that the DDPG algorithm is feasible and effective in solving the unmanned control problem.In this model simulation experiment, the change of reward value in each iteration is shown in Figure8. It can be seen from the figure that after about 300 iterations, the reward value obtained can basically be stable at 0, indicating that collision-free motion has been basically realized at this time. The 500 iterations set in this simulation basically converge to about 300 times, and the relative number of times to reach convergence is still relatively small. This shows that the DDPG method based on the deep deterministic policy gradient has fast convergence speed and obvious effect in solving the unmanned vehicle automatic driving problem, which shows that the depth reinforcement learning algorithm has better advantages in this problem. Through this experiment, we can know that the method based on deep reinforcement learning makes the model have better self-learning ability. Compared with the general supervised learning method, the trained model agent has obvious advantages. The agents in the model generate a large number of training data to train the network according to the environmental changes, which is flexible and convenient for network training. The network can be trained and analyzed without too much label data.Figure 8
The reward value of each iteration of automatic driving model.It can be seen from Figure9 that at the initial stage of iteration, the unmanned vehicle automatic driving model performs fewer steps, and the model easily collides with obstacles. After 300 iterations, the model can basically achieve the maximum number of steps each time. It can also be seen that due to the continuous training and the continuous optimization of the network, the network can better judge the selection decision of execution action. At the later stage of training, the collision-free driving in the model can be basically realized. This better shows that the agent algorithm model has strong applicability, strong robustness, and high stability. At the same time, the test mode is used to test the network. The trained network can well control the automatic driving of the unmanned vehicle and avoid obstacles.Figure 9
The number of steps of each episode of automatic driving model.


## 6.1. Experimental Setup

The parameters for solving the automatic driving problem using the DDPG algorithm are as follows: the maximum number of iterations is 500, the maximum number of steps per iteration is 600; the reward discount factor is 0.9; the learning rate of the actor and critical is 0.0001; batch-size, that is, the number of samples obtained in one training, is 16; and the number of neurons is 120. Simulation training for this problem was done in Python language and observation on the model training was done according to the model diagram, which can better reflect the current training degree of the model.


## 6.2. Result Analysis

The training of the algorithm at the beginning of model training is randomly intercepted. Through the visual diagram and the training process, it can be seen that the learning ability of the model at the beginning of training is not strong, the model can only be explored at will, and it is easy to collide at the beginning. Occasionally, automatic driving can be carried out briefly in a single direction. According to the diagram, we can only learn at the initial stage, mainly to explore some movement directions, and the uncertainty in the movement direction is not high.In the middle of model training, a model diagram in the training process is randomly intercepted. As can be seen from the figure, the automatic driving model of the unmanned vehicle has been able to avoid obstacles for turning or straight operation and can better avoid obstacles in the process of turning. The process of quickly avoiding obstacles and driving forward has been basically realized. The automatic driving control model can still gradually find a better motion planning direction through random straight or turning. In the process of this training, when encountering some places that have not been explored, there is still the possibility of collision, but with the continuation of the iteration, the driving can be basically completed.In the later stage of model training, a model diagram in the training process is randomly intercepted. As can be seen from the figure, the unmanned vehicle has been able to drive better in the control model, avoid obstacles perfectly, and hardly encounter obstacles. In the later stage of training, the network has basically been trained and formed, which can quickly judge whether the next action is straight or turning, and basically reaches the maximum steps of each iteration. From this aspect, it also reflects that the learning ability of the model is very good in the later stage and can well control the movement of the unmanned vehicle. The agent driverless model already has a relatively formed network model. The network parameters are optimized and the loss value is low, so this good effect can be achieved. Through this training, it is more fully explained that the DDPG algorithm is feasible and effective in solving the unmanned control problem.In this model simulation experiment, the change of reward value in each iteration is shown in Figure8. It can be seen from the figure that after about 300 iterations, the reward value obtained can basically be stable at 0, indicating that collision-free motion has been basically realized at this time. The 500 iterations set in this simulation basically converge to about 300 times, and the relative number of times to reach convergence is still relatively small. This shows that the DDPG method based on the deep deterministic policy gradient has fast convergence speed and obvious effect in solving the unmanned vehicle automatic driving problem, which shows that the depth reinforcement learning algorithm has better advantages in this problem. Through this experiment, we can know that the method based on deep reinforcement learning makes the model have better self-learning ability. Compared with the general supervised learning method, the trained model agent has obvious advantages. The agents in the model generate a large number of training data to train the network according to the environmental changes, which is flexible and convenient for network training. The network can be trained and analyzed without too much label data.Figure 8
The reward value of each iteration of automatic driving model.It can be seen from Figure9 that at the initial stage of iteration, the unmanned vehicle automatic driving model performs fewer steps, and the model easily collides with obstacles. After 300 iterations, the model can basically achieve the maximum number of steps each time. It can also be seen that due to the continuous training and the continuous optimization of the network, the network can better judge the selection decision of execution action. At the later stage of training, the collision-free driving in the model can be basically realized. This better shows that the agent algorithm model has strong applicability, strong robustness, and high stability. At the same time, the test mode is used to test the network. The trained network can well control the automatic driving of the unmanned vehicle and avoid obstacles.Figure 9
The number of steps of each episode of automatic driving model.


## 7. Conclusions

This paper introduces the current research status of automatic driving technology and analyzes the current mainstream automatic driving control methods. Then, it analyzes the characteristics of the convolutional neural network, reinforcement learning method (Q-learning), and deep Q network (DQN) and deep deterministic policy gradient (DDPG). Compared with the DQN algorithm based on value function, the DDPG algorithm based on action policy can well solve the continuity problem of action space. Finally, the DDPG algorithm is used to solve the control problem of automatic driving. Data are collected through training, and the neural network training is carried out on the automatic driving model, so that the network can control the intelligent vehicle to avoid obstacles and finally achieve the goal that the intelligent vehicle can avoid obstacles and run the whole process in 2D environment. In terms of automatic driving model design, this design simply uses the unmanned vehicle driving in two-dimensional space for control, and the driving action considered is only limited to straight ahead and turning. It contains less automatic driving control information and does not carry out training and testing in real three-dimensional space or mature automatic driving model. After that, the automatic vehicle control of three-dimensional and multidimensional model can be considered for training simulation test.



---

*Source: 7739440-2022-01-24.xml*