Modeling of Artificial Intelligence Based Traffic Flow Prediction with Weather Conditions

: Short-term traffic flow prediction (TFP) is an important area in intelligent transportation system (ITS), which is used to reduce traffic congestion. But the avail of traffic flow data with temporal features and periodic features are susceptible to weather conditions, making TFP a challenging issue. TFP process are significantly influenced by several factors like accident

The growth of intelligent transportation systems (ITS) needs a higher degree of carrying capacity as an assurance [5]. Due to their high capacity and flexibility, vehicles are the main resources of transportation. Assuring traffic performance would have a significant effect on operation of the city. But, with the constant surge of vehicle ownership, the inadequate carrying capability of urban roads has slowed down the traffic performance of vehicles. Timely and accurate predictions of traffic flow (TF) give consistent basis of traffic control for governors and provide suitable travel guidance for the tourists thus enhancing road network and decrease traffic congestion [6]. But, traffic prediction is a nonlinear and sophisticated challenge. In reality, TF has clear periodicity and temporal correlation, however, it might develop in an irregular manner under the disturbance of weather modifications that creates this problem more complex. The present short-term TFP methods could be generally separated into three classifications: DL, statistical modules, and conventional ML methods.
Related to the statistical models, conventional ML approaches such as SVM and SVR shows powerful function fitting capability in nonlinear and complex TFP problem. The fundamental concept of this type of technique is to convert lower dimension and linearly inseparable traffic data to higher dimension and linearly separable expression via kernel function. With the development of traffic big data [7], short-term traffic prediction has to turn into more complex and challenging that propose higher needs for modelling data. DL modules, with the efficiency for higher dimension space modelling and the capability for extracting features of variables via hierarchical depiction, have turn into the popular technology of TFP. [8] proposed a short-term multistep freeway TFP method using RBF where center position of hidden layer is established by the fuzzy c-means clustering. [9] initially utilized SAE for learning the depiction of TF features for predicting. This paper introduces a novel artificial intelligence (AI) based TFP with weather conditions (AITFP-WC) for smart cities. The AITFP-WC model focuses on the improvement of the predictive performance of the TF with the consideration of weather related conditions. The proposed AITFP-WC technique involves Elman neural network (ENN) model for TFP in smart cities. In addition, tunicate swarm algorithm with feed forward neural networks (TSA-FFNN) model is utilized for the weather and periodicity analysis. Furthermore, a fusion of TFP and WPA processes takes place using the FFNN model to determine the final prediction output. For examining the increased prediction performance of the AITFP-WC model, a series of experiments were carried out on TF and weather data.

Existing Traffic Flow Prediction Models
Lu et al. [10], proposed an integrated predictive technique for short term TF that relies on LSTM-NN and ARIMA. This technique can create short-term predictions of upcoming TF depends on the past traffic data. Initially, the LR feature of traffic data was taken by the rolling regression ARIMA module; later, BP was utilized for training the LSTM network to take nonlinear features of traffic data; and lastly, relies on the dynamic weighting of sliding window integrated the predictive influences of this 2 methods. Kong et al. [11] take RBM as the technique for predicting TF that is a usual process relies on DL framework. RBM creates the long-term module of polymorphic for chaotic time sequence, with phase space recreation for recognizing the data.
Hou et al. [12] proposed an integrated structure of SAE and RBF NN for predicting TF that could efficiently capture the disturbance of weather factors and periodicity of TF and data temporal correlation. Initially, SAE is utilized for processing the TF data in many time slices for acquiring early predictions. Later, RBF is utilized for capturing the relation among periodicity of TF and weather disturbance thus gaining other predictions. Lastly, alternative RBF is utilized for combining the above 2 predictions on decision level, obtain a recreated prediction with high precision.
Zheng et al. [13] focused on the short term TF predictive problems on the basis of real time traffic data as one crucial module of a smart cities. In contradiction of long term traffic prediction, precise prediction of short term TF facilitate rapid response and timely traffic management. They developed and studied a new EM on the basis of LSTM, DAE, and CNN modules. This method considered spatial & temporal features of the traffic condition. In Rajendran et al. [14], the structural patterns of TF could be pinched from freeway toll data accordingly, a novel predictive module has been projected. Locally weighted learning is utilized for predicting the subsequent sample TF of current sector and the succeeding station entrance flow. This learning module places nonlinear and linear modules for fitting the adjacent points and later employs this value for predicting query point values.
Kang et al. [15], proposed a hybrid module for spatio temporal feature extraction and prediction of urban road network travel time that integrates EDM and CN with an XGBoost predictive module. Because of the dynamic nature and high nonlinear travel time sequence, it is essential for considering time reliance and spatial dependence of travel time sequence to predict the travel time of road network. The dynamic feature of travel time sequence could be exposed through the EDM technique, a nonlinear technique is depending upon Chaos concept. In Raza et al. [16], GA is utilized for designing ANN and LWR modules. This proposed method is based on the integration of GA, NN, and LWR for achieving optimum predictive efficiency in several traffic and input conditions. The GA aimed ANN (GA-ANN) and GA aimed LWR (GA-LWR) disaggregate and aggregate modules are utilized for predicting short term traffic (five minutes) for 4 lanes of urban road in Beijing, China.

Problem Statement and Data Used
This section offers the detailed problem statement of this study and also explained the data (including traffic and weather data) employed for validation.

Problem Statement
TFP model makes use of existing traffic and weather-related parameters to estimate the output flow in any succeeding time slices. The outcome y of the predictive technique is defined using Eq. (1): It is considered that the TF data is not limited only to the regularity and again affected by other weather conditions, the input variables of the model want to comprise external weather conditions. Here, X i denotes the dataset on the time slice i, counting flow x flow where y flow signifies the flow prediction depending upon the traffic series data and y weather&time signifies the flow prediction depending upon the weather as well as time periodicity [17]. By the view of decision level data fusion, the end flow prediction value is the fusion value of two decisions, therefore the outcome y of the integrated model can be defined using Eq. (3): For multistep prediction, y can be defined as y i , and i indicates the step size.

Traffic and Weather Data
The traffic dataset of metro freeway in the Twin Cities is used [17]. The actual dataset is gathered at a 30 s duration of at least 4,500 loop detectors. During the preprocessing level, the data gets preprocessed in the form of table with 5 mts duration. In addition, time similarity measure is used to correct the errors and omissions. For revealing the periodicity of traffic data under weather disturbances, a time-flow correlation is derived. Besides, the training data gets partitioned into working and non-working days, and the average flow in each time slice is calculated. The time flow correlation for the time slices can be represented in Eq. (4): where x flow i,j signifies the flow of time slice i on day j.
Next, the weather dataset [17] is collected and used 1-hot coding technique to handle the nonnumerical parameters. Besides, an embedding element is employed for extracting the expression of high dimensional data of weather type. In addition, the embedding vector of weather type is represented using Eq. (5): where x embedding denotes the trained embedded vector of weather types, whereas x one represents 1-hot expression. For variable selection related to TF, Pearson correlation coefficient ρ is determined using Eq. (6) is calculated, where X and Y denotes a set of 2 target parameters.
To extract the additional weather variables, the PCA technique can be employed for the data fusion process at the feature level. The actual matrix A of weather variables can be denoted as follows: where x DB , x RH , x Vis , x WB , and x WS are the designated variables. Once the PCA is employed, the resultant matrix P can be produced as shown below.
where x pca is the fusion value of the elected weather variables examined by PCA.

The Proposed Model
The overall framework of the proposed AITFP-WC technique encompasses three major levels namely ENN based TFP, TSA-FFNN based WSA, and fusion process. Fig. 1 demonstrates the overall process of TFP process. The detailed working of every level is offered in the next subsections.

Level I: TFP
At the first level, the AITFP-WC technique exploits the ENN model to forecast TF. The ENN model is employed for the extraction of temporal correlation exist in the TF. Fig. 2 shows a simple structure of an ENN. The ENN model comprises four major layers namely input, context, hidden, and output layers. The major configuration of the ENN model is similar to the FFNN in such a way that the connections except context layer are identical to MLP. The context layer receives the input from the output of the hidden layer to store the earlier values of the hidden layer. The external input, context weight, and output weight matrices can be represented as W i h , W c h , W 0 h , respectively. The dimensions of the input and output layers are n, i.e., . . , y n (t)] T and the dimension of the context layer is m.
where l demonstrates the input and the output layers in round l. Afterward, the kth hidden layer in the network can be represented using Eq. (10): where, x c j (l) defines the signal which is passed from the kth context layer node, ω 1 kj (l) designates the ith and jth weights of the hidden layers directed from oth node [18]. At last, the outcome of the hidden layer can be fed into the context layer is given below: where, represents the normalized value of the hidden layer.
The following layer is the context layer, which can be defined as follows.
where, W k pointed out the gain of self linked feedback among 0 and 1. Lastly, the output layer at the network can be represented below.
where, ω 3 ok defines the weights of the connections from the kth layer into the oth layer.

Level II: Weather and Periodicity Analysis
In the second level, the WPA is performed using the TSA-FFNN technique, which makes use of processed variables comprising x embedding , x timecode , and x pca , therefore, the TSA-FFNN function is denoted as follows.
The FFNN is an easier type of ANN that includes many processing modules called "neurons". In FFNN, the data takes stimulated in single way, forwards from the input to output through hidden layer. It doesn't comprise some loop or cycle [19]. All individual neurons define the entire input weight and approved the sum through activation functions and so the result is obtained. It can be determined as Eqs. (16) and (17): where iw j,i represents the weights related amongst the weight neurons i = (1, 2, . . . , R) and j = (1, 2, . . . , N), hb j implies the bias in hidden layers, R indicates the neuron count in the input layers, and x j denotes the respective input data. During this case, the S shaped curved sigmoid functions are utilized as activation functions as determined in Eq. (17): Therefore, the result of neurons in the hidden layers are determined as: In the final layer, the result of neurons are signified as: where hw j,i refers the weights interconnected amongst neurons j = (1, 2, . . . , N) and k = (1, 2, . . . , S), ob k stands for bias in final layer, N refers the neuron quantity in hidden layers, and S defines the neuron quantity in hidden layers. Usually, the training technique is carried out for modifying the weight and bias values till the maximal classification accuracy was gained.
In order to effectually adjust the parameters involved in the FFNN model, the TSA is employed. The motivation and scientific modeling of presented TSA technique are explained in detail. Tunicate has capability for finding the place of feed source in sea. But there is no knowledge about the feed source in the provided search space. In TSA, 2 performances of tunicates are utilized to determine the feed source and they are jet propulsion and SI. In order to scientifically process the jet propulsion performance, the tunicate can fulfill 3 situations such as avoid the fights amongst searching agents, movement near the place of optimum searching agents, and remained nearby the optimum searching agents. While the swarm performance upgrades the places of another search agent on the optimum solution [20]. The mathematical process of the performance is explained in the following.
For avoiding the fights amongst searching agents (for instance, another tunicate), vector A is utilized for the computation of novel search agent place as given below.
But G implies the grariab less and F depicts the water flow advection in deep ocean. The variables c 1 , c 2 , and c 3 are arbitrary numbers lies in [0,1], M stands for the social force amongst searching agents. The vector M was computed as: where P min and P max signifies the primary and subordinate speeds for making social interface. In this work, of values of P min and P max are considered as 1 and 4, correspondingly.
Afterward, in order to avoid the fight amongst neighboring ones, the searching agents are travel near the direction of optimum neighbor.
where PD implies the distance amongst the feed source and search feed, for instance, tunicate, x denotes the present iterations, FS stands for the place of feed source, for sample, optimal. The vector P p (x) represents the place of tunicate and r and signifies the arbitrary number in range 0 and 1. The searching agents are continuing their place near the optimum search agent (for instance, feed source).
where P p (x ) represents the upgraded place of tunicate interms of place of feed source FS.
For mathematically simulating the swarm performance of tunicate, initial 2 optimum solutions are stored and upgraded the places of other searching agents based on the place of an optimum search agent. The subsequent equation is presented for defining the swarm performance of tunicate: The steps and flowchart presented are provided under.
i. Initialization of the tunicate population P. ii. Select the primary variables and maximal iteration count. iii. Compute the fitness value of all searching agents. iv. Afterward calculating the fitness value, the optimum searching agent is traveled in provided searching area. v. Upgrade the place of all searching agents utilizing Eq. (26). vi. Alter the upgraded searching agent that drives away from the boundary in provided search space. vii. Calculate the upgraded searching agent fitness values. When there is an optimum solution compared to the preceding optimum solution, next upgrade P p . viii. When the termination condition is fulfilled, next the TSA gets stopped. Then, repeat  ix. Obtain optimum solutions.

Level III: Decision Level Data Fusion Model
The data fusion process takes place using FFNN model which aims to tune the features outcomes offered from the previous two modules. Since FFNN is a type of NN with easier architecture, it is not required to treat the hierarchical structure during modeling, and it could satisfy the need for data fusion in features as well as decision levels. The outcome of the fusion model is the end predictive results of the AITFP-WC model and it can be represented as follows. y = y fusion = f fusion (y flow , y weather&time ).

Results and Discussion
This section validates the TFP performance of the AITFP-WC technique over other existing techniques. Tab. 1 and Fig. 3 demonstrates the results analysis of the AITFP-WC technique with other techniques on weather data. From the obtained results, it is evident that the AITFP-WC technique has attained improved predictive outcomes on the weather data. The experimental results ensured that the AITFP-WC technique has outperformed the existing techniques with the MAPE of 17.326%, MSE of 313.417, and RMSE of 17.704. At the same time, the least performance is obtained by the RBF+PCC+PCA+BP with the MAPE of 21.446%, MSE of 517.261, and RMSE of 22.743.       In this study, a new AITFP-WC technique is designed to predict the flow of traffic with weather conditions in smart cities. The proposed AITFP-WC technique encompasses ENN based TFP, TSA-FFNN based WSA, and FFNN based data fusion processes. In TSA-FFNN model, the TSA is used to optimally tune the parameters involved in the FFNN model and thereby raises the predictive performance to a maximum extent. For examining the increased prediction performance of the AITFP-WC model, a series of experiments were carried out on TF and weather data. The experimental values pointed out the supremacy of the AITFP-WC technique over the recent state of art methods. Therefore, the AITFP-WC technique can be used in real time smart city environment to predict the flow of traffic under extreme weather conditions. In future scope, the efficacy of the AITFP-WC technique can be boosted by the use of advanced DL architectures with learning rate scheduling approaches.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.