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

+e 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 learningmodes, 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. +e 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.


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]. e 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 e 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. e 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]. e 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]. rough 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. erefore, accurate and real-time signal timing optimization also plays a crucial role in promoting the evolution of intelligent transportation system. erefore, 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. e second part of the paper describes the relevant research situation and summarizes the current research status at home and abroad. e third part designs short-time traffic flow prediction method based on deep learning. e fourth part optimizes the signal lamp timing method based on short-term traffic flow prediction and fuzzy control. e 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.

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. e change of traffic flow is regular, and the data of future traffic flow can be predicted according to the change characteristics of history. erefore, 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. erefore, 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 realtime 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. is 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. is 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. is 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.

Traffic Flow Data
Preprocessing. e 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. e 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. e 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) e 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) e 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.

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. e BP neural network processing unit architecture used in this paper is shown in Figure 1. e 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. e neurons at the two layers are directly related, and the weight vector is set on the connected link, which is defined as . , x n ) T , 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) e 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. e specific expression is shown in formula (2): (2) erefore, after calculation, the output data of layer 2 neurons can be defined as follows: BP neural network uses Sigmoid function for output judgment to achieve nonlinear data estimation, while ensuring the advantage of linear data.
(1) Figure 2(a) illustrates the output curve of Sigmoid function. e 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 f(x) tends to 0. When the input data are greater than 5, the output data of f(x) tends to 1. Only in the intermediate data interval does the output change dynamically.

Wireless Communications and Mobile Computing
(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.
e 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. e connection weight matrix W and neuron threshold parameters θ between neurons at different levels are set.
Step 2: Extract the input data and corresponding data (X k , Y k ) from the traffic flow data samples, input them into the neural network model for training, and constantly optimize and update the model parameters.
Step 5: By comparing the predicted value of traffic flow data with the actual value of traffic flow data, calculate the error d k t according to formula (8).
Step 6: By comparing the predicted value of traffic flow data with the actual value, the hidden layer error e k j is calculated according to formula (9).
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: . . , n, j � 1, 2, . . . , p, (10) Step 9: Judging that the convergence conditions can meet the actual prediction requirements, namely E ≤ ε.
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.

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. erefore, 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.
is 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. e prediction model of SVM and BP hybrid neural network is shown in Figure 3. e 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, so y is the actual value of traffic flow, y svm is the predicted value of traffic flow of SVM, and y bp is the predicted value of traffic flow of BP neural network. e predicted value of traffic flow y pre is as follows: where Q 1 and Q 2 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 moment t are, respectively, e st and e bt , Q 1 and Q 2 can be calculated by formulae (13) and (14).

Signal Lamp Timing Optimization Evaluation Index.
Average delay time and traffic capacity are selected for signal timing effect and optimization index. e 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.

Average Delay Time.
e 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: A d 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 x i represents road saturation and needs to be calculated from the ratio of traffic flow to maximum flow of the current phase.

Capacity.
e capacity calculation method in this paper is mainly calculated according to formula (16): where N i 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.

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: 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. e fundamental purpose of signal timing optimization method is to improve traffic capacity and reduce the average delay time of vehicles. e 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]. e signal light control process based on traffic flow prediction is shown in Figure 4.
Control rules need to be based on the calculation complexity and phase of the intersection. e 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. e control gap of green light duration conforms to normal distribution and the step length is too short, which increases the calculation burden. e control effect is not obvious because the step length is too long.
Similarly, the fuzzy language value of green time GL i 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}. e membership function is shown in Table 2.
e domain distribution of F i and GL i is shown in Figure 5.
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 Table 3. e 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. e 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 Figure 6.
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).

Simulation and Test of Short-Term Traffic Flow Prediction.
Traffic flow simulation software is the data source of shortterm 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. en learning samples were  Figure 7 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. e error curve of the neural network model can evaluate the processing ability and error of the neural network. e comparison results of short-time traffic flow prediction errors are shown in Figure 9. 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.
Meanwhile, in different traffic flow environments, the comparison results of SVM and BP neural network fusion are shown in Table 4. e 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. erefore, 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.

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.

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    Table 5. e signal timing results based on traffic flow prediction are shown in Figure 10. 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.

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 Table 6.
As can be seen from Table 5, 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   -TF  F  LF  N  LM  M  TM  TF  TF  TF  TF  F  F  LF  LF  F  TF  TF  F  F  LF  LF  N  LF  F  LF  N  N  LM  LM  M  N  F  LF  N  N  N  LM  LM  LM  F  LF  LF  N  N  LM  M  M  LF  N  LM  LM  M  M  TM  TM  LF  N  LM  M  M  TM  TM   3  2 Error G re en li gh tC o n tr o l S te p

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. is 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. rough 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.
Data Availability e short-term traffic data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.