# Short-Term Traffic Flow Prediction and Signal Timing Optimization Based on Deep Learning

Authors: Hao Qin; Weishi Zhang
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

The rapid development of traffic industry has caused traffic congestion and environmental pollution and other problems. Traffic flow prediction and signal timing optimization under different road environments can improve the current traffic environment. In this paper, based on historical traffic data and BP neural network, according to the characteristics of different deep learning modes, SVM neural network is integrated to achieve accurate prediction of traffic flow, fully analyze the characteristics of traffic flow in different traffic environments, and accurately estimate the current traffic capacity. Meanwhile, on the basis of traffic flow prediction data and fuzzy control method, the signal timing optimization of three-phase intersections is realized to ensure the maximum capacity and the lowest average delay time of intersections. Simulation experiments show that the accuracy of the traffic flow prediction method designed in this paper is about 19.5% higher than that of the traditional mean prediction method, and fusion neural network model is more accurate than single neural network model. The optimized signal timing method can accurately control the traffic process with different phases and has obvious improvement in traffic capacity and average delay time compared with the traditional method.


---

## Body

## 1. Introduction

With the development of economy and the continuous improvement of transportation demand, transportation industry has become an important pillar of national social development and economic development [1]. The development of intelligent transportation system and transportation industry has also caused a certain degree of pressure on the environment and road construction. In the reality of the increasing number of vehicles, the limited road environment and traffic control ability make traffic congestion and environmental pollution and other problems increasingly prominent [2].According to statistics, traffic congestion in the United States in 2020 has caused economic losses of $102 billion, with travel delays of up to 480 million hours [3]. “2020 Annual Report on The Development of Traffic in Beijing” points out that the loss caused by traffic congestion in Beijing in 2020 has reached 105.6 billion Yuan, with an average of 13.818 million trips affected every day. The average delay per person is 66 minutes per day, and it is increasing every year. Traffic congestion directly causes additional energy consumption and economic losses [4]. The extension of car travel time leads to additional fuel consumption, which increases vehicle exhaust emissions. Environmental pollution is therefore increasingly aggravated, which is also one of the reasons for the frequent occurrence of haze weather in recent years.In order to obtain and use the real‐time status information of urban road traffic, intelligent transportation system is gradually extensive; many urban main road and the intersection of traffic dense place installed a large number of advanced automatic access devices to capture the traffic flow parameters of traffic information and then the huge amounts of dynamic network traffic data are obtained by sampling, quantitative analysis, filtering, and other technical processing, using the scientific advanced theoretical model to generate the future time traffic flow state data, namely, traffic flow prediction [5]. Through real-time and accurate prediction of future traffic flow information, the country and the government can develop appropriate control strategies to improve road congestion, effectively guarantee the safety and efficient operation of vehicles, and make the road network unimpeded [6]. As the change of urban traffic is a nonlinear problem that is difficult to be predicted by simple models, the shorter the statistical period of traffic flow is, the greater the uncertainty of the change of short-term traffic flow will be, which brings great difficulties to the prediction of urban traffic flow [7].Short-time traffic flow prediction is an important subject to ensure the construction of intelligent traffic and the smooth operation of traffic system. Accurate and effective short-time traffic flow prediction is of great significance to realize the real-time adjustment of traffic lights. In addition, the existing signal lamp collocation is mostly fixed collocation based on expert experience, that is, according to the hour section. Although this method can maintain traffic lights at a relatively low cost, it cannot realize the real-time matching of traffic lights with the actual traffic flow, resulting in the waste of people and material resources, and the effect is not satisfactory. A good signal timing scheme can separate interwoven and conflicting traffic flows from time and space, so that vehicles can run smoothly at intersections and reduce or avoid intersection congestion. Therefore, accurate and real-time signal timing optimization also plays a crucial role in promoting the evolution of intelligent transportation system.Therefore, this paper takes this as an opportunity to study short-term traffic flow prediction method and signal timing optimization strategy to improve the traffic environment. The second part of the paper describes the relevant research situation and summarizes the current research status at home and abroad. The third part designs short-time traffic flow prediction method based on deep learning. The fourth part optimizes the signal lamp timing method based on short-term traffic flow prediction and fuzzy control. The fifth part designs the experiment to carry on the experiment and the test to the short-time traffic flow prediction and the signal lamp timing optimization method. Finally, it summarizes the whole paper.


## 2. Related Work

In recent years, many experts have made researches on short-time traffic flow prediction methods and signal timing optimization strategies.In terms of short-term traffic flow prediction methods, uncertainty is the basis and core of traffic flow prediction. Matas et al. based on the uncertain situation of traffic flow prediction of Spanish high-speed company, the traffic flow prediction is carried out according to different road sections as units, and the real-time data of traffic flow prediction is combined with random traffic flow distribution model [8]. Daraghmi et al. combined the concept of time and space with the actual road environment, combined with a simple neural network model, based on the traffic road environment of Taipei city, China, to predict the traffic flow of main roads and achieved better prediction results by comparing with conventional traffic flow prediction methods [9]. Cui et al. builds a deep learning framework TGC-LSTM through training and learning of the current traffic network to simulate the influence of different phases on the road and estimate the current traffic state without considering the influence of external factors on traffic factors [10].Neural network can analyze the historical running rules of transactions and predict the future development rules according to the historical learning samples. The change of traffic flow is regular, and the data of future traffic flow can be predicted according to the change characteristics of history. Therefore, neural network is feasible and practical in short-term traffic flow prediction. At present, experts at home and abroad have carried out extensive research on this.Belhadi et al. took the long-term traffic flow of Beijing as the research object and proposed traffic flow prediction based on cyclic neural network. However, this model only discusses the relationship between time and traffic flow and does not take external factors into account, resulting in a one-sided effect of actual prediction [11]. Zhang et al. takes traffic characteristics and traffic flow prediction of multiple cities as the research content and uses multitask learning method to explore traffic flow prediction methods of different cities. Therefore, the author proposes a multitask multicity traffic flow prediction neural network, which summarizes the temporal and spatial dependence of traffic flow prediction in different cities. However, it focuses on the traffic flow between different cities and does not focus on the traffic flow prediction at a specific urban intersection, resulting in poor practical significance [12].From the current research results and status quo, the current traffic flow prediction methods are mainly based on deep learning, but they focus on describing the relationship between time and traffic flow without taking external factors into consideration.In terms of signal timing optimization, Mahler and Vahidi designed the signal lamp timing model based on real-time data of different phases to determine the green pass time, but this method could not predict the green time, resulting in the lack of data support for the actual green time [13]. Hajbabaie and Benekohal designed the traffic signal timing optimization scheme of the current urban traffic network by combining realism with intelligent transportation system. This method combines the production objective function of many factors to solve the maximum parameters of travel efficiency [14]. Zhao et al. designed the signal lamp timing optimization method from the aspects of vehicle fuel consumption and environmental pollution index, so as to reduce environmental pollution while ensuring traffic communication capacity. However, this method involves many parameters and variables, which can easily lead to large calculation errors and other problems, and the practical application effect is not good [15]. Rafter et al. [16] designed a multimode adaptive traffic signal (MATS) according to the position between vehicles and the sensor collection results of intelligent transportation system. Signal timing plan is formulated according to the distance between vehicles to improve traffic communication efficiency. This aspect requires a variety of hardware intelligent devices to participate in, and the calculation process is complex, the actual availability is poor.From the aforementioned research, the research on signal timing is mainly based on the actual intersection situation and the length of the fleet, without integrating the predicted traffic flow data, which lacks real-time performance and predictability. This paper takes this as an opportunity to study the multifactor traffic flow prediction method and integrates the traffic flow prediction results into the signal timing method to improve traffic communication ability and reduce the average delay time.


## 3. Design of Short-Term Traffic Flow Prediction Method Based on Deep Learning

### 3.1. Traffic Flow Data Preprocessing

The short-term traffic flow prediction input data and sample data selected in this paper are traffic flow and vehicle speed, which can directly reflect the current traffic conditions and capacity. The traffic flow data studied in this paper mainly include traffic flow and speed. Traffic flow can describe the regional passing capacity of the intersection and road. In this paper, the observation time interval of traffic flow is set to 1 minute, so that it can reflect the real-time change characteristics and diversity of traffic flow. Traffic flow is mainly measured by the number of vehicles passing per unit of time. The average speed of a vehicle is the result of dividing the course and time of a vehicle in a certain period of time.At the same time, to ensure the effect of short-time traffic flow prediction method based on deep learning, data factors such as weather and holidays are added into the sample data to improve the effect of traffic flow prediction. Rain and snow weather has a great influence on traffic flow, and the data of traffic flow also vary greatly in working days and holidays.Before traffic flow data prediction, it is necessary to obtain historical traffic flow data samples. Traffic flow data, including traffic flow data and average speed data, can be collected and analyzed by roadside equipment or manual of intelligent transportation system. However, network environment and the traffic flow is a dynamic change, the need to constantly adjust, acquisition of data, there may be error need of traffic flow data preprocessing, the standardized processing and standardization of deleted and repeated data can improve the accuracy and efficiency of traffic flow data prediction.(1)
The missing value of road network environmental data and traffic flow sequence refers that the value of few time points does not exist in the specified collection cycle, which needs to be supplemented according to the data before and after to maintain the integrity of data. When the default value is supplemented in this paper, it is obtained by calculating the weighted average value of the same type data of the day before the missing value.(2)
In the process of collection, noise signals may be generated due to the influence of the external environment. Noise signal is different from normal value in data size and frequency, which can be filtered by conventional filter to improve the cleanliness of data.(3)
The normalized processing of time series of traffic flow data is to standardize the description of data according to the definition of data and improve the efficiency and processing ability of traffic flow prediction through data calculation and statistics.


### 3.2. Establishment of Neural Network Model

BP neural network can remember and store traffic flow data. After entering the model from the input layer, the data can be trained through the intermediate hidden layer, and the actual learning result data can be output through the neurons of the output layer. The BP neural network processing unit architecture used in this paper is shown in Figure1. The short-time traffic flow neural network prediction model designed in this paper consists of three layers: input layer, hidden layer, and output layer, where the number of neurons at the first layer is n, and the neuron data at the second layer is p. The neurons at the two layers are directly related, and the weight vector is set on the connected link, which is defined as W=wij,i=1,2,…,n,j=1,2,…,p. The input vector of layer 1 neuron can be defined as X=x1,…,xi,…,xnT, as the input vector of layer 2. Meanwhile, the corresponding verification is set in layer 2 neuron, which is defined as θj,j=1,2,…,p, the input signal of layer 2 neuron is calculated by formula (1):(1)sj=∑i=1nxiwij−θj,j=1,2,…,p.Figure 1
BP neural network processing unit.The transfer function is used to complete the calculation internally in the second-layer neuron. Sigmoid function is selected for internal calculation based on the type of current model and the wide application of the transfer function. The specific expression is shown in formula (2):(2)fx=11+e−x.Therefore, after calculation, the output data of layer 2 neurons can be defined as follows:(3)yj=fsj=11+e−sj.BP neural network uses Sigmoid function for output judgment to achieve nonlinear data estimation, while ensuring the advantage of linear data.(1)
Figure2(a) illustrates the output curve of Sigmoid function. The Sigmoid function changes only in the middle data interval, and the rest data interval tend to be stable. When the input data are less than 5, the output of fx tends to 0. When the input data are greater than 5, the output data of fx tends to 1. Only in the intermediate data interval does the output change dynamically.(2)
By setting different thresholdsθj for each neuron in the second layer, the output data can be offset according to the prediction needs of actual traffic flow data.Figure 2
Sigmoid function output data curve.
(a)(b)The traffic flow data prediction model designed in this paper is based on three-layer BP neural network, and the specific process is as follows:Step 1: Model initialization. The connection weight matrixW and neuron threshold parameters θ between neurons at different levels are set.Step 2: Extract the input data and corresponding dataXk,Yk from the traffic flow data samples, input them into the neural network model for training, and constantly optimize and update the model parameters.Step 3: Calculate the input and output of layer-2 neurons, as shown in formulae (4) and (5):(4)sjk=∑i=1nxjkwij−θj,j=1,2,…,p,(5)bjk=fsjk,j=1,2,…,p.Step 4: Calculate the input and output data of layer-3 neurons, as shown in formulae (6) and (7):(6)ltk=∑j=1pbjkvjt−γt,t=1,2,…,q,(7)ctk=fltk,t=1,2,…,q.Step 5: By comparing the predicted value of traffic flow data with the actual value of traffic flow data, calculate the errordtk according to formula (8).(8)ejk=∑t=1qvjtdtkf′sjk,j=1,2,…,p.Step 6: By comparing the predicted value of traffic flow data with the actual value, the hidden layer errorejk is calculated according to formula (9).(9)ejk=∑t=1qvjtdtkf′sjk,j=1,2,…,p.Step 7: Calculate the difference between the output of the hidden layer and the input signal of the output layer through formulae (10) and (11), where the learning rate is expressed by α, and the value range is 0<β<1:(10)Δwij=βejkxik,i=1,2,…,n,j=1,2,…,p,(11)Δθj=βejk,j=1,2,…,p.Step 9: Judging that the convergence conditions can meet the actual prediction requirements, namelyE≤ε. If the traffic flow data prediction requirements are met, the prediction process ends.Step 10: Continue iterative learning until the number of iterative learning reaches the set maximum number of learning. According to the characteristics of the neural network model in this paper, the iteration value of learning times is set to 60 times.Step 11: End of neural network model learning process.


### 3.3. SVM and BP Hybrid Neural Network

In this paper, the combination prediction of short-term traffic flow is the combination of SVM and BP neural network. In the case of fewer data sets, support vector machine has better prediction effect. However, generally speaking, the traffic flow data set is large, so the dimension disaster will occur when the support vector machine deals with the large data set, that is, the computation amount will increase exponentially. Although the performance of modern computers has been very high, it is not enough to deal with the computation amount in this paper, and it also wastes the computing resources greatly. However, BP neural network has the ability of information parallel processing and can deal with the traffic flow calculation in this paper under the condition of limited computing resources. At the same time, local minima and other problems may occur in BP neural network, while support vector machine does not have such shortcomings. Therefore, this paper considers the advantages and disadvantages of support vector machine and BP neural network and combines them to give full play to their advantages, so that the prediction results can be optimized.This paper adopts the combination of SVM and BP neural network to predict the traffic flow, which overcomes the shortcomings of the two prediction models. In this paper, SVM and BP hybrid neural network combined model is designed to improve the accuracy and rationality of traffic flow prediction. The prediction model of SVM and BP hybrid neural network is shown in Figure3.Figure 3
SVM and BP hybrid neural network prediction model.The SVM neural network is suitable for the prediction scenario with low traffic flow, and the BP neural network is suitable for the prediction scenario with high traffic flow. Meanwhile, the proportion of prediction results of different neural network models can be set according to the prediction errors of different neural networks.In the prediction of the combined model, SVM and BP neural network are single prediction models, soy is the actual value of traffic flow, ysvm is the predicted value of traffic flow of SVM, and ybp is the predicted value of traffic flow of BP neural network. The predicted value of traffic flow ypre is as follows:(12)ypre=Q1⋅ysvm−Q2⋅ybp,where Q1 and Q2 are the weights of SVM-predicted value and BP-neural-network-predicted value, respectively, and the sum of the two is 1.Suppose that the traffic flow errors of SVM prediction and BP neural network at the momentt are, respectively, est and ebt, Q1 and Q2 can be calculated by formulae (13) and (14).(13)Q1=∑t=1nebt2−∑t=1nestebt∑t=1nest2+∑t=1nebt2−2∑t=1nestebt,(14)Q2=∑t=1nest2−∑t=1nestebt∑t=1nest2+∑t=1nebt2−2∑t=1nestebt.


## 3.1. Traffic Flow Data Preprocessing

The short-term traffic flow prediction input data and sample data selected in this paper are traffic flow and vehicle speed, which can directly reflect the current traffic conditions and capacity. The traffic flow data studied in this paper mainly include traffic flow and speed. Traffic flow can describe the regional passing capacity of the intersection and road. In this paper, the observation time interval of traffic flow is set to 1 minute, so that it can reflect the real-time change characteristics and diversity of traffic flow. Traffic flow is mainly measured by the number of vehicles passing per unit of time. The average speed of a vehicle is the result of dividing the course and time of a vehicle in a certain period of time.At the same time, to ensure the effect of short-time traffic flow prediction method based on deep learning, data factors such as weather and holidays are added into the sample data to improve the effect of traffic flow prediction. Rain and snow weather has a great influence on traffic flow, and the data of traffic flow also vary greatly in working days and holidays.Before traffic flow data prediction, it is necessary to obtain historical traffic flow data samples. Traffic flow data, including traffic flow data and average speed data, can be collected and analyzed by roadside equipment or manual of intelligent transportation system. However, network environment and the traffic flow is a dynamic change, the need to constantly adjust, acquisition of data, there may be error need of traffic flow data preprocessing, the standardized processing and standardization of deleted and repeated data can improve the accuracy and efficiency of traffic flow data prediction.(1)
The missing value of road network environmental data and traffic flow sequence refers that the value of few time points does not exist in the specified collection cycle, which needs to be supplemented according to the data before and after to maintain the integrity of data. When the default value is supplemented in this paper, it is obtained by calculating the weighted average value of the same type data of the day before the missing value.(2)
In the process of collection, noise signals may be generated due to the influence of the external environment. Noise signal is different from normal value in data size and frequency, which can be filtered by conventional filter to improve the cleanliness of data.(3)
The normalized processing of time series of traffic flow data is to standardize the description of data according to the definition of data and improve the efficiency and processing ability of traffic flow prediction through data calculation and statistics.


## 3.2. Establishment of Neural Network Model

BP neural network can remember and store traffic flow data. After entering the model from the input layer, the data can be trained through the intermediate hidden layer, and the actual learning result data can be output through the neurons of the output layer. The BP neural network processing unit architecture used in this paper is shown in Figure1. The short-time traffic flow neural network prediction model designed in this paper consists of three layers: input layer, hidden layer, and output layer, where the number of neurons at the first layer is n, and the neuron data at the second layer is p. The neurons at the two layers are directly related, and the weight vector is set on the connected link, which is defined as W=wij,i=1,2,…,n,j=1,2,…,p. The input vector of layer 1 neuron can be defined as X=x1,…,xi,…,xnT, as the input vector of layer 2. Meanwhile, the corresponding verification is set in layer 2 neuron, which is defined as θj,j=1,2,…,p, the input signal of layer 2 neuron is calculated by formula (1):(1)sj=∑i=1nxiwij−θj,j=1,2,…,p.Figure 1
BP neural network processing unit.The transfer function is used to complete the calculation internally in the second-layer neuron. Sigmoid function is selected for internal calculation based on the type of current model and the wide application of the transfer function. The specific expression is shown in formula (2):(2)fx=11+e−x.Therefore, after calculation, the output data of layer 2 neurons can be defined as follows:(3)yj=fsj=11+e−sj.BP neural network uses Sigmoid function for output judgment to achieve nonlinear data estimation, while ensuring the advantage of linear data.(1)
Figure2(a) illustrates the output curve of Sigmoid function. The Sigmoid function changes only in the middle data interval, and the rest data interval tend to be stable. When the input data are less than 5, the output of fx tends to 0. When the input data are greater than 5, the output data of fx tends to 1. Only in the intermediate data interval does the output change dynamically.(2)
By setting different thresholdsθj for each neuron in the second layer, the output data can be offset according to the prediction needs of actual traffic flow data.Figure 2
Sigmoid function output data curve.
(a)(b)The traffic flow data prediction model designed in this paper is based on three-layer BP neural network, and the specific process is as follows:Step 1: Model initialization. The connection weight matrixW and neuron threshold parameters θ between neurons at different levels are set.Step 2: Extract the input data and corresponding dataXk,Yk from the traffic flow data samples, input them into the neural network model for training, and constantly optimize and update the model parameters.Step 3: Calculate the input and output of layer-2 neurons, as shown in formulae (4) and (5):(4)sjk=∑i=1nxjkwij−θj,j=1,2,…,p,(5)bjk=fsjk,j=1,2,…,p.Step 4: Calculate the input and output data of layer-3 neurons, as shown in formulae (6) and (7):(6)ltk=∑j=1pbjkvjt−γt,t=1,2,…,q,(7)ctk=fltk,t=1,2,…,q.Step 5: By comparing the predicted value of traffic flow data with the actual value of traffic flow data, calculate the errordtk according to formula (8).(8)ejk=∑t=1qvjtdtkf′sjk,j=1,2,…,p.Step 6: By comparing the predicted value of traffic flow data with the actual value, the hidden layer errorejk is calculated according to formula (9).(9)ejk=∑t=1qvjtdtkf′sjk,j=1,2,…,p.Step 7: Calculate the difference between the output of the hidden layer and the input signal of the output layer through formulae (10) and (11), where the learning rate is expressed by α, and the value range is 0<β<1:(10)Δwij=βejkxik,i=1,2,…,n,j=1,2,…,p,(11)Δθj=βejk,j=1,2,…,p.Step 9: Judging that the convergence conditions can meet the actual prediction requirements, namelyE≤ε. If the traffic flow data prediction requirements are met, the prediction process ends.Step 10: Continue iterative learning until the number of iterative learning reaches the set maximum number of learning. According to the characteristics of the neural network model in this paper, the iteration value of learning times is set to 60 times.Step 11: End of neural network model learning process.


## 3.3. SVM and BP Hybrid Neural Network

In this paper, the combination prediction of short-term traffic flow is the combination of SVM and BP neural network. In the case of fewer data sets, support vector machine has better prediction effect. However, generally speaking, the traffic flow data set is large, so the dimension disaster will occur when the support vector machine deals with the large data set, that is, the computation amount will increase exponentially. Although the performance of modern computers has been very high, it is not enough to deal with the computation amount in this paper, and it also wastes the computing resources greatly. However, BP neural network has the ability of information parallel processing and can deal with the traffic flow calculation in this paper under the condition of limited computing resources. At the same time, local minima and other problems may occur in BP neural network, while support vector machine does not have such shortcomings. Therefore, this paper considers the advantages and disadvantages of support vector machine and BP neural network and combines them to give full play to their advantages, so that the prediction results can be optimized.This paper adopts the combination of SVM and BP neural network to predict the traffic flow, which overcomes the shortcomings of the two prediction models. In this paper, SVM and BP hybrid neural network combined model is designed to improve the accuracy and rationality of traffic flow prediction. The prediction model of SVM and BP hybrid neural network is shown in Figure3.Figure 3
SVM and BP hybrid neural network prediction model.The SVM neural network is suitable for the prediction scenario with low traffic flow, and the BP neural network is suitable for the prediction scenario with high traffic flow. Meanwhile, the proportion of prediction results of different neural network models can be set according to the prediction errors of different neural networks.In the prediction of the combined model, SVM and BP neural network are single prediction models, soy is the actual value of traffic flow, ysvm is the predicted value of traffic flow of SVM, and ybp is the predicted value of traffic flow of BP neural network. The predicted value of traffic flow ypre is as follows:(12)ypre=Q1⋅ysvm−Q2⋅ybp,where Q1 and Q2 are the weights of SVM-predicted value and BP-neural-network-predicted value, respectively, and the sum of the two is 1.Suppose that the traffic flow errors of SVM prediction and BP neural network at the momentt are, respectively, est and ebt, Q1 and Q2 can be calculated by formulae (13) and (14).(13)Q1=∑t=1nebt2−∑t=1nestebt∑t=1nest2+∑t=1nebt2−2∑t=1nestebt,(14)Q2=∑t=1nest2−∑t=1nestebt∑t=1nest2+∑t=1nebt2−2∑t=1nestebt.


## 4. Research on Signal Timing Method Based on Short-Term Traffic Flow Prediction and Fuzzy Control

### 4.1. Signal Lamp Timing Optimization Evaluation Index

Average delay time and traffic capacity are selected for signal timing effect and optimization index. The average delay time not only reflects drivers’ satisfaction with signal timing but also reflects the efficiency of the entire intersection. Traffic capacity can be quantified.


#### 4.1.1. Average Delay Time

The vehicle delay time at the intersection can measure the traffic efficiency and traffic control level. By referring to Webster’s calculation method of average delay, this paper calculates according to the following formula:(15)Ad=T1−λi221−λixi.Ad represents the average delay time of a certain phase, T represents the cycle time of the whole signal lamp, and λi represents the green signal ratio of the ith phase, and xi represents road saturation and needs to be calculated from the ratio of traffic flow to maximum flow of the current phase.


#### 4.1.2. Capacity

The capacity calculation method in this paper is mainly calculated according to formula (16):(16)AQ=NiTλi,where Ni represents the traffic flow of the current lane, λi represents the green signal ratio of the ith phase, and T represents the cycle time of the whole signal light.


### 4.2. Fuzzy Controller Design

In this paper, fuzzy controller is used to simulate and realize the signal lamp timing process [17, 18]. Fuzzy controller mainly includes three parts, as shown below:(1)
Fuzzy interface: according to the needs of signal lamp timing, set the membership function of the input variable and convert the input data into fuzzy quantity.(2)
Formulate fuzzy rules: formulate fuzzy rules according to the needs of signal lamp timing and output fuzzy logic output values according to the logic operation of fuzzy rules.(3)
According to the fuzzy output value, the algorithm is used to obtain the relevant results of signal lamp timing.Fuzzy control rules can be used as control query table in operation, and the controller can query and calculate according to the purpose and logic requirements of the algorithm [19].In this paper, a three-phase intersection is selected as the algorithm design object, including one main phase and two such phases. Meanwhile, the predicted traffic flow data are taken as the input of the fuzzy controller, and the average delay and capacity are taken as the output results.In the previous traffic flow prediction methods, the objects are mainly roads and intersections with relatively saturated traffic flow, and the intersection saturation is lower than 0.9. The fundamental purpose of signal timing optimization method is to improve traffic capacity and reduce the average delay time of vehicles. The number of waiting fleets in the main phase is the predicted traffic flow and is defined as, similarly, the number of waiting fleets in this phase is the predicted traffic flow in this phase, and the value range is [0, 30], and the value range of green time is [0, 60]. The signal light control process based on traffic flow prediction is shown in Figure4.Figure 4
Control diagram of signal lights based on traffic flow prediction.Control rules need to be based on the calculation complexity and phase of the intersection. The intersection studied in this paper is three-phase, and the step size of the control rule can be set to 2 to meet the requirements. The control gap of green light duration conforms to normal distribution and the step length is too short, which increases the calculation burden. The control effect is not obvious because the step length is too long.In this paper, the control gap of green light duration is set as 3. The domain range can be defined as{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30}, and spacing of 2. Theory of the green light time-domain scope can be defined as{0, 3, 6, 9, 12 ,15 ,18, …, 45, 48, 51, 54, 57, 60}, spacing of 3. Then, the fuzzy language and rules are designed. In this paper, the fuzzy language values of the primary and secondary phases are defined as {few, less, less, appropriate, more, more, extremely much}, and the corresponding letters are represented as {TF, F, LF, N, LM, M, TM}, and the membership function is shown in Table1.Table 1
The membership function table ofFi/Fi+1.
Fi/Fi+1TFFLFNLMMTM010.420.80.640.60.80.260.410.480.20.80.6100.60.80.2120.410.4140.20.80.6160.60.80.2180.410.4200.20.80.60.2220.60.80.40.2240.410.60.4260.20.80.80.6280.610.8300.40.81Similarly, the fuzzy language value of green timeGLi is also defined as {rare, little, less, appropriate, more, more, very much}, and the corresponding letters are represented as {TF, F, LF, N, LM, M, TM}. The membership function is shown in Table 2.Table 2
The membership function table ofGLi.
GLiTFFLFNLMMTM0130.60.360.30.691120.6150.30.3180.6211240.6270.30.3300.6331360.60.3390.30.6421450.60.3480.30.6511540.60.3570.30.6601The domain distribution ofFi and GLi is shown in Figure 5.Figure 5
Domain distribution ofFi and GLi.In addition, it is necessary to establish fuzzy control rules in the controller according to the requirements of signal lamp timing to realize signal lamp control and generate fuzzy control query table. According to the predicted results of traffic flow data with different phases and the configuration requirements of green duration, the fuzzy rules are shown in Table3. The basic idea is when the traffic flow is large, the green duration is increased, and when the traffic flow is small, the green time is reduced.Table 3
The controller rule query table.
GLi fuzzy quantityFi+1 fuzzy quantityFi fuzzy quantity—TFFLFNLMMTMTFTFTFTFFFLFLFFTFTFFFLFLFNLFFLFNNLMLMMNFLFNNNLMLMLMFLFLFNNLMMMLFNLMLMMMTMTMLFNLMMMTMTMThe current control rules are based on the basic guidelines for traffic light configuration in China and the advice of relevant experts to ensure maximum capacity and minimum average delay time. After the establishment of fuzzy control rules is completed, the surface diagram of control rules can be generated, as shown in Figure6.Figure 6
Fuzzy control surface.After the delay of green light with different phases is calculated by fuzzy controller, the whole signal cycle is obtained, and the average delay and traffic capacity are calculated by formula (14) and (15).


## 4.1. Signal Lamp Timing Optimization Evaluation Index

Average delay time and traffic capacity are selected for signal timing effect and optimization index. The average delay time not only reflects drivers’ satisfaction with signal timing but also reflects the efficiency of the entire intersection. Traffic capacity can be quantified.


### 4.1.1. Average Delay Time

The vehicle delay time at the intersection can measure the traffic efficiency and traffic control level. By referring to Webster’s calculation method of average delay, this paper calculates according to the following formula:(15)Ad=T1−λi221−λixi.Ad represents the average delay time of a certain phase, T represents the cycle time of the whole signal lamp, and λi represents the green signal ratio of the ith phase, and xi represents road saturation and needs to be calculated from the ratio of traffic flow to maximum flow of the current phase.


### 4.1.2. Capacity

The capacity calculation method in this paper is mainly calculated according to formula (16):(16)AQ=NiTλi,where Ni represents the traffic flow of the current lane, λi represents the green signal ratio of the ith phase, and T represents the cycle time of the whole signal light.


## 4.1.1. Average Delay Time

The vehicle delay time at the intersection can measure the traffic efficiency and traffic control level. By referring to Webster’s calculation method of average delay, this paper calculates according to the following formula:(15)Ad=T1−λi221−λixi.Ad represents the average delay time of a certain phase, T represents the cycle time of the whole signal lamp, and λi represents the green signal ratio of the ith phase, and xi represents road saturation and needs to be calculated from the ratio of traffic flow to maximum flow of the current phase.


## 4.1.2. Capacity

The capacity calculation method in this paper is mainly calculated according to formula (16):(16)AQ=NiTλi,where Ni represents the traffic flow of the current lane, λi represents the green signal ratio of the ith phase, and T represents the cycle time of the whole signal light.


## 4.2. Fuzzy Controller Design

In this paper, fuzzy controller is used to simulate and realize the signal lamp timing process [17, 18]. Fuzzy controller mainly includes three parts, as shown below:(1)
Fuzzy interface: according to the needs of signal lamp timing, set the membership function of the input variable and convert the input data into fuzzy quantity.(2)
Formulate fuzzy rules: formulate fuzzy rules according to the needs of signal lamp timing and output fuzzy logic output values according to the logic operation of fuzzy rules.(3)
According to the fuzzy output value, the algorithm is used to obtain the relevant results of signal lamp timing.Fuzzy control rules can be used as control query table in operation, and the controller can query and calculate according to the purpose and logic requirements of the algorithm [19].In this paper, a three-phase intersection is selected as the algorithm design object, including one main phase and two such phases. Meanwhile, the predicted traffic flow data are taken as the input of the fuzzy controller, and the average delay and capacity are taken as the output results.In the previous traffic flow prediction methods, the objects are mainly roads and intersections with relatively saturated traffic flow, and the intersection saturation is lower than 0.9. The fundamental purpose of signal timing optimization method is to improve traffic capacity and reduce the average delay time of vehicles. The number of waiting fleets in the main phase is the predicted traffic flow and is defined as, similarly, the number of waiting fleets in this phase is the predicted traffic flow in this phase, and the value range is [0, 30], and the value range of green time is [0, 60]. The signal light control process based on traffic flow prediction is shown in Figure4.Figure 4
Control diagram of signal lights based on traffic flow prediction.Control rules need to be based on the calculation complexity and phase of the intersection. The intersection studied in this paper is three-phase, and the step size of the control rule can be set to 2 to meet the requirements. The control gap of green light duration conforms to normal distribution and the step length is too short, which increases the calculation burden. The control effect is not obvious because the step length is too long.In this paper, the control gap of green light duration is set as 3. The domain range can be defined as{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30}, and spacing of 2. Theory of the green light time-domain scope can be defined as{0, 3, 6, 9, 12 ,15 ,18, …, 45, 48, 51, 54, 57, 60}, spacing of 3. Then, the fuzzy language and rules are designed. In this paper, the fuzzy language values of the primary and secondary phases are defined as {few, less, less, appropriate, more, more, extremely much}, and the corresponding letters are represented as {TF, F, LF, N, LM, M, TM}, and the membership function is shown in Table1.Table 1
The membership function table ofFi/Fi+1.
Fi/Fi+1TFFLFNLMMTM010.420.80.640.60.80.260.410.480.20.80.6100.60.80.2120.410.4140.20.80.6160.60.80.2180.410.4200.20.80.60.2220.60.80.40.2240.410.60.4260.20.80.80.6280.610.8300.40.81Similarly, the fuzzy language value of green timeGLi is also defined as {rare, little, less, appropriate, more, more, very much}, and the corresponding letters are represented as {TF, F, LF, N, LM, M, TM}. The membership function is shown in Table 2.Table 2
The membership function table ofGLi.
GLiTFFLFNLMMTM0130.60.360.30.691120.6150.30.3180.6211240.6270.30.3300.6331360.60.3390.30.6421450.60.3480.30.6511540.60.3570.30.6601The domain distribution ofFi and GLi is shown in Figure 5.Figure 5
Domain distribution ofFi and GLi.In addition, it is necessary to establish fuzzy control rules in the controller according to the requirements of signal lamp timing to realize signal lamp control and generate fuzzy control query table. According to the predicted results of traffic flow data with different phases and the configuration requirements of green duration, the fuzzy rules are shown in Table3. The basic idea is when the traffic flow is large, the green duration is increased, and when the traffic flow is small, the green time is reduced.Table 3
The controller rule query table.
GLi fuzzy quantityFi+1 fuzzy quantityFi fuzzy quantity—TFFLFNLMMTMTFTFTFTFFFLFLFFTFTFFFLFLFNLFFLFNNLMLMMNFLFNNNLMLMLMFLFLFNNLMMMLFNLMLMMMTMTMLFNLMMMTMTMThe current control rules are based on the basic guidelines for traffic light configuration in China and the advice of relevant experts to ensure maximum capacity and minimum average delay time. After the establishment of fuzzy control rules is completed, the surface diagram of control rules can be generated, as shown in Figure6.Figure 6
Fuzzy control surface.After the delay of green light with different phases is calculated by fuzzy controller, the whole signal cycle is obtained, and the average delay and traffic capacity are calculated by formula (14) and (15).


## 5. Simulation and Test

### 5.1. Simulation and Test of Short-Term Traffic Flow Prediction

Traffic flow simulation software is the data source of short-term traffic flow prediction, which needs to ensure its authenticity and validity.Paramics is a fully integrated software that integrates simulation, visualization, interactive road network rendering, adaptive signal control, online simulation data statistical analysis, tracking, traffic control strategy evaluation, and interactive simulation parameter adjustment.In this test, the traffic flow of Guangxian Road and Gaohe Street in Dalian city was collected by road side equipment of intelligent transportation system from June 2021 to September 2021. Then learning samples were constructed for training and then the traffic flow of multiple working days and nonworking days in October 2021 was predicted. Figure7 shows the short-term traffic flow prediction results of different neural network models, and Figure 8 shows the results of short-term traffic flow prediction. It can be seen from the test results that the SVM and BP hybrid neural network has higher accuracy in short-term traffic flow prediction than the single neural network, and the accuracy of prediction is about 19.5% higher than the traditional mean prediction method.Figure 7
Learning and training process of short-term traffic flow prediction.Figure 8
Results of short-term traffic flow prediction.The error curve of the neural network model can evaluate the processing ability and error of the neural network. The comparison results of short-time traffic flow prediction errors are shown in Figure9. Although the BP neural network model is in a convergence state, the traffic flow prediction error is about 100 vehicles. When the hybrid neural network model converges, the prediction error of traffic flow is only 10 vehicles. Based on the aforementioned analysis results, whether from the perspective of error or accuracy of traffic flow prediction, the overall effect of SVM and BP hybrid neural network is outstanding.Figure 9
Results of short-term traffic flow prediction errors.Meanwhile, in different traffic flow environments, the comparison results of SVM and BP neural network fusion are shown in Table4. The results show that when the number of traffic flows is low, the prediction accuracy of fusion neural network is close to that of SVM neural network; when the number of traffic flows is high, the prediction accuracy of fusion neural network is close to that of BP neural network, but its accuracy is lower than that of fusion neural network. Therefore, the fusion neural network model designed in this paper can adapt to the short-term traffic flow prediction scenarios of different traffic flows, and the prediction effect is good.Table 4
The fusion and comparison results of SVM and BP neural network.
Traffic flow1000 (%)2000 (%)3000 (%)4000 (%)5000 (%)Fusion neural network model93.493.794.393.993.2SVM neural network91.490.289.387.386.5BP neural network89.390.189.590.992.3


### 5.2. Experimental Test of Signal Timing Optimization

In the signal timing optimization experiment, Guangxian Road and Gaohe Street intersection of Dalian city were also selected as experimental objects. Among them, north-south straight and right turn to the first aspect, south and north turn to the left turn to the second aspect, east and west straight move to the third aspect.


#### 5.2.1. Reliability Comparison of Traffic Flow Prediction

In order to verify the effectiveness of traffic flow prediction, there are some differences in the actual average delay time and traffic capacity between AC forecast data and nonforecast data as input vectors. In this experiment, predicted data, unpredicted data, and actual data of Guangxian Road and Gaohe Street three-phase intersection in Dalian in October 2021 are selected for testing. The test results are shown in Table5.Table 5
Comparison results of traffic flow prediction reliability.
ItemSignal cycle (s)Average delay time (s)Traffic capacityBased on traffic flow prediction data98233243No traffic flow forecast data112343121Actual traffic flow results100253232The signal timing results based on traffic flow prediction are shown in Figure10. Figure 10 shows that the traffic flow in the second phase is relatively small, and the green time is relatively short. As can be seen from the overall experimental results, when the traffic flow prediction data are used as the input, it is most consistent with the actual traffic flow data and green time, and the traffic capacity and average delay time parameters are more effective at this time. When there is no predictive traffic flow data involved, the timing effect of signal lights is deficient to some extent. When the traffic flow prediction data are used as the input data of signal lamp timing, the current traffic situation can be better predicted, and the green time that is more consistent with the actual traffic situation can be obtained through the calculation of fuzzy controller, so as to ensure higher traffic capacity.Figure 10
The signal timing results based on traffic flow prediction.


#### 5.2.2. Comparison of Different Timing Optimization Methods

In this paper, test scenarios are designed to compare the results of the signal lamp timing optimization algorithm based on fuzzy control with Webster’s classical algorithm, as shown in Table6.Table 6
Comparison results of different timing optimization methods.
AlgorithmFirst phase capacitySecond phase capacityThird phase capacityOverall average delay time (s)Signal cycle (s)Fuzzy control method3212223012122398Webster algorithm29831982112229112As can be seen from Table5, the communication ability and the overall average delay time of the fuzzy control method based on traffic flow prediction at different phases are more outstanding than Webster classic timing algorithm, which shortens the overall delay by 6 seconds and improves the overall traffic capacity by 567 vehicles. Owing to the aforementioned results, on one hand, the fuzzy control method based on traffic flow forecast for the current situation of traffic flow has fully estimated, environment can be real-time traffic flow forecasting, at the same time, the environment of green time can be based on real-time traffic flow control, to ensure that their communication skills and the average delay time of the fall.


## 5.1. Simulation and Test of Short-Term Traffic Flow Prediction

Traffic flow simulation software is the data source of short-term traffic flow prediction, which needs to ensure its authenticity and validity.Paramics is a fully integrated software that integrates simulation, visualization, interactive road network rendering, adaptive signal control, online simulation data statistical analysis, tracking, traffic control strategy evaluation, and interactive simulation parameter adjustment.In this test, the traffic flow of Guangxian Road and Gaohe Street in Dalian city was collected by road side equipment of intelligent transportation system from June 2021 to September 2021. Then learning samples were constructed for training and then the traffic flow of multiple working days and nonworking days in October 2021 was predicted. Figure7 shows the short-term traffic flow prediction results of different neural network models, and Figure 8 shows the results of short-term traffic flow prediction. It can be seen from the test results that the SVM and BP hybrid neural network has higher accuracy in short-term traffic flow prediction than the single neural network, and the accuracy of prediction is about 19.5% higher than the traditional mean prediction method.Figure 7
Learning and training process of short-term traffic flow prediction.Figure 8
Results of short-term traffic flow prediction.The error curve of the neural network model can evaluate the processing ability and error of the neural network. The comparison results of short-time traffic flow prediction errors are shown in Figure9. Although the BP neural network model is in a convergence state, the traffic flow prediction error is about 100 vehicles. When the hybrid neural network model converges, the prediction error of traffic flow is only 10 vehicles. Based on the aforementioned analysis results, whether from the perspective of error or accuracy of traffic flow prediction, the overall effect of SVM and BP hybrid neural network is outstanding.Figure 9
Results of short-term traffic flow prediction errors.Meanwhile, in different traffic flow environments, the comparison results of SVM and BP neural network fusion are shown in Table4. The results show that when the number of traffic flows is low, the prediction accuracy of fusion neural network is close to that of SVM neural network; when the number of traffic flows is high, the prediction accuracy of fusion neural network is close to that of BP neural network, but its accuracy is lower than that of fusion neural network. Therefore, the fusion neural network model designed in this paper can adapt to the short-term traffic flow prediction scenarios of different traffic flows, and the prediction effect is good.Table 4
The fusion and comparison results of SVM and BP neural network.
Traffic flow1000 (%)2000 (%)3000 (%)4000 (%)5000 (%)Fusion neural network model93.493.794.393.993.2SVM neural network91.490.289.387.386.5BP neural network89.390.189.590.992.3


## 5.2. Experimental Test of Signal Timing Optimization

In the signal timing optimization experiment, Guangxian Road and Gaohe Street intersection of Dalian city were also selected as experimental objects. Among them, north-south straight and right turn to the first aspect, south and north turn to the left turn to the second aspect, east and west straight move to the third aspect.


### 5.2.1. Reliability Comparison of Traffic Flow Prediction

In order to verify the effectiveness of traffic flow prediction, there are some differences in the actual average delay time and traffic capacity between AC forecast data and nonforecast data as input vectors. In this experiment, predicted data, unpredicted data, and actual data of Guangxian Road and Gaohe Street three-phase intersection in Dalian in October 2021 are selected for testing. The test results are shown in Table5.Table 5
Comparison results of traffic flow prediction reliability.
ItemSignal cycle (s)Average delay time (s)Traffic capacityBased on traffic flow prediction data98233243No traffic flow forecast data112343121Actual traffic flow results100253232The signal timing results based on traffic flow prediction are shown in Figure10. Figure 10 shows that the traffic flow in the second phase is relatively small, and the green time is relatively short. As can be seen from the overall experimental results, when the traffic flow prediction data are used as the input, it is most consistent with the actual traffic flow data and green time, and the traffic capacity and average delay time parameters are more effective at this time. When there is no predictive traffic flow data involved, the timing effect of signal lights is deficient to some extent. When the traffic flow prediction data are used as the input data of signal lamp timing, the current traffic situation can be better predicted, and the green time that is more consistent with the actual traffic situation can be obtained through the calculation of fuzzy controller, so as to ensure higher traffic capacity.Figure 10
The signal timing results based on traffic flow prediction.


### 5.2.2. Comparison of Different Timing Optimization Methods

In this paper, test scenarios are designed to compare the results of the signal lamp timing optimization algorithm based on fuzzy control with Webster’s classical algorithm, as shown in Table6.Table 6
Comparison results of different timing optimization methods.
AlgorithmFirst phase capacitySecond phase capacityThird phase capacityOverall average delay time (s)Signal cycle (s)Fuzzy control method3212223012122398Webster algorithm29831982112229112As can be seen from Table5, the communication ability and the overall average delay time of the fuzzy control method based on traffic flow prediction at different phases are more outstanding than Webster classic timing algorithm, which shortens the overall delay by 6 seconds and improves the overall traffic capacity by 567 vehicles. Owing to the aforementioned results, on one hand, the fuzzy control method based on traffic flow forecast for the current situation of traffic flow has fully estimated, environment can be real-time traffic flow forecasting, at the same time, the environment of green time can be based on real-time traffic flow control, to ensure that their communication skills and the average delay time of the fall.


## 5.2.1. Reliability Comparison of Traffic Flow Prediction

In order to verify the effectiveness of traffic flow prediction, there are some differences in the actual average delay time and traffic capacity between AC forecast data and nonforecast data as input vectors. In this experiment, predicted data, unpredicted data, and actual data of Guangxian Road and Gaohe Street three-phase intersection in Dalian in October 2021 are selected for testing. The test results are shown in Table5.Table 5
Comparison results of traffic flow prediction reliability.
ItemSignal cycle (s)Average delay time (s)Traffic capacityBased on traffic flow prediction data98233243No traffic flow forecast data112343121Actual traffic flow results100253232The signal timing results based on traffic flow prediction are shown in Figure10. Figure 10 shows that the traffic flow in the second phase is relatively small, and the green time is relatively short. As can be seen from the overall experimental results, when the traffic flow prediction data are used as the input, it is most consistent with the actual traffic flow data and green time, and the traffic capacity and average delay time parameters are more effective at this time. When there is no predictive traffic flow data involved, the timing effect of signal lights is deficient to some extent. When the traffic flow prediction data are used as the input data of signal lamp timing, the current traffic situation can be better predicted, and the green time that is more consistent with the actual traffic situation can be obtained through the calculation of fuzzy controller, so as to ensure higher traffic capacity.Figure 10
The signal timing results based on traffic flow prediction.


## 5.2.2. Comparison of Different Timing Optimization Methods

In this paper, test scenarios are designed to compare the results of the signal lamp timing optimization algorithm based on fuzzy control with Webster’s classical algorithm, as shown in Table6.Table 6
Comparison results of different timing optimization methods.
AlgorithmFirst phase capacitySecond phase capacityThird phase capacityOverall average delay time (s)Signal cycle (s)Fuzzy control method3212223012122398Webster algorithm29831982112229112As can be seen from Table5, the communication ability and the overall average delay time of the fuzzy control method based on traffic flow prediction at different phases are more outstanding than Webster classic timing algorithm, which shortens the overall delay by 6 seconds and improves the overall traffic capacity by 567 vehicles. Owing to the aforementioned results, on one hand, the fuzzy control method based on traffic flow forecast for the current situation of traffic flow has fully estimated, environment can be real-time traffic flow forecasting, at the same time, the environment of green time can be based on real-time traffic flow control, to ensure that their communication skills and the average delay time of the fall.


## 6. Conclusion

Traffic is the basis of national development and social development. With the increasing demand for traffic, traffic congestion and environmental pollution become increasingly prominent. In this paper, traffic flow prediction and signal lamp distribution methods are designed and optimized based on the current demand for traffic development and optimization. This paper collects and preprocesses historical traffic data, based on BP neural network and according to the characteristics of different deep learning modes, integrates SVM neural network to achieve accurate prediction of traffic flow, fully analyzes the characteristics of traffic flow in different traffic environments, and realizes the prediction and data integration of current traffic flow. At the same time, based on the traffic flow prediction data of different phases of the intersection, the signal timing optimization of the three-phase intersection is realized on the basis of the fuzzy control method, which can improve the capacity of the intersection and reduce the average delay time of different fleets. Through the simulation experiment, it can be seen that the traffic flow prediction method and signal timing method designed in this paper have excellent effects, which can improve the current traffic environment and capacity and provide reference ideas and methods for the development of intelligent transportation.



---

*Source: 8926445-2022-02-23.xml*