Traffic Flow Prediction For Intelligent Transportation System Using Machine Learning

: This study attempts to develop a model that forecasts precise data on traffic flow.Everything that can impact the flow of traffic on the road is referred to as the traffic environment, including traffic signals, accidents, rallies, and even road repairs that could result in a traffic bottleneck.The driver or passenger can make an informed choice if they have prior knowledge about the vehicle crowd close to the area that will have the greatest impact on traffic.Additionally, it can be utilised in driverless vehicles, which are the automobiles of the future.Today's traffic is increasing tremendously, and big data transportation concepts are becoming more popular.We are motivated to develop a machine learning model that forecasts traffic flow because the present prediction techniques and models are still insufficient for use in practical applications.The amount of data available to forecast traffic flow is so enormous that it is awkward and laborious.In this work, we intended to evaluate the data for the transportation with significantly less complexity using machine learning and deep learning methods.The user will be informed of the projected information and the constructed machine learning model will predict the traffic flow.


Introduction
The rise in the number of businesses, government organisations, and individual travellers, which also raises the demand for accurate and useful traffic flow statistics.It improves the efficiency of traffic operations and lowers carbon emissions by enabling drivers and passengers to make better decisions in congested areas.The creation and introduction of intelligent transportation systems (ITSs) has improved the accuracy of traffic prediction.It will be essential to the development of modern transportation, traveller given information, and also the traffic flow management systems.. [2] Data is increasingly being used more and more in transportation management and control. There are already many traffic flow prediction models and systems; the most of them use shadow traffic models, and they still struggle to anticipate the traffic flow due to the enormous volumes of data and growing dataset sizes.The also always have some difficulty in prediction [3], [4]. Due to its capacity to handle classification problems, interpret natural languages, reduce dimensionality, recognise objects, and model motion, machine learning principles have recently drawn the attention of both academics and industrialists. Ml employs multi-layer neural network techniques to mine the innate qualities in data at all layers, from the most fundamental to the most complex.. [5] Massive amounts of structures in the data can be found by them, and these structures finally enable us to visualise the data and draw conclusions from it that improve model performance. The majority of research into Intelligent Transportation Systems is focused on creating autonomous cars, which can improve the economy of transportation systems and lower the danger of fatalities.Safe driving has received a lot of attention in recent decades.It can be done by utilising the model created here and giving the user the information they need at the proper moment via the user interface.. [6] Despite the fact that numerous algorithms have been created for estimating traffic flow data.However, these algorithms are not very effective and accurate due to the large dimensions of the data, making it difficult to anticipate the precise traffic flow information with minimal complexity. Numerous journals and research papers imply that the machine learning methods function effectively since the datasets are enormous.

Background
The 1994 World Congress in Paris authorised the Intelligent Transportation System (ITS). By utilising computer, electrical, and communication technologies, ITS has been able to inform travellers and increase the efficiency and safety of the road transportation systems. The main advantage of ITS is to guarantee the efficient and secure movement of road transportation. Lowering carbon emissions is also advantageous in terms of environmental friendliness. There are several chances for the auto industry to enhance the security and safety of its clients.. [7] Regardless of the rise in vehicles on the roads, traffic also grows. Additionally, this heavy load cannot be supported by the capability of the current road network. The two options available ways to fix this problem. The first step is to build additional highway lanes and roads to ensure that vehicles can move freely. To keep it, additional lands and a sizable infrastructure are needed, which raises the cost of expenditure. The network occasionally experienced a lot of issues, much like an urban region. The expansion of the roads and lanes is not possible on this piece of property. The second strategy makes effective use of the current road network by utilising some control methods. These control tactics are cost-effective models for the government or traffic controllers because they reduce costs as well. This control's strategies alert drivers to potential traffic congestion and suggest that they take alternate routes to their destinations. [8].A powerful tool for handling massive volumes of data, deep learning is a component of machine learning algorithms.A approach to increase wireless intelligence is provided by ML..A network's sophisticated radio data and extensive topology. Identification of network characteristics, such as spectrum availability, congested locations, hotspots, and traffic bottlenecks, is aided by the use of this function in DL.. [9] One of the most challenging parts of developing ITS is anticipating the correct trip time, which is a fundamental component of ITS. One of the more efficient classification techniques among those that are largely linear is the Support Vector Machine (SVM). Avoiding data overfitting has advantages. When dealing with small, less severe data sets, SVM thrives. Although it needed more data, a different approach (Random Forest, Deep Neural Network, etc.) consistently generated models that were quite trustworthy. Support vector regression, which we can refer to as SVM, supports both linear and nonlinear regression in addition to restricting margin violation rather than seeking to fit the most significant feasible roads between two classes.. [1] For many years, traditional ML methods have been used to estimate traffic. These strategies are based on statistical procedures that forecast the future using data from the past. For instance, the prediction of trip time and traffic volume has been done using Random Forests. To produce predictions, this algorithm combines a number of decision trees. Additionally, traffic speed has been predicted using SVR. To create predictions, this approach employs a linear regression model with a nonlinear kernel function. Traffic volume and speed predictions have been made using gradient boosting machines. An ensemble of ineffective learners is used by this algorithm to generate predictions. Machine learning: Machine learning is a branch of artificial intelligence (AI) that involves using statistical models and algorithms to help computers get better over time at a particular job. Making it possible for computers to learn from data, recognize patterns and relationships, and make predictions or decisions without being expressly programmed is the aim of machine learning. Traffic prediction: Predicting traffic movement is a typical machine learning application. It entails forecasting future traffic patterns and congestion using past traffic data, such as speed and volume.Regression models, time series models, and deep learning models are some of the machine learning methods for predicting traffic movement. GRU: An RNN architecture known as a Gated Recurrent Unit (GRU) was first developed as a more straightforward variant of the LSTM model. GRU, like LSTM, is made to record sequential data and is frequently used for processes like time series prediction, voice recognition, and natural language processing. ML-based traffic prediction has shown some encouraging results, but there are still problems that need to be solved. The availability of data is one issue. It can be difficult to create precise prediction models for traffic since the quantity and quality of available data are frequently limited. The scalability of models is an additional difficulty. Models must be scalable to accommodate enormous volumes of data as traffic volume rises. Finally, the models must be easy to comprehend. In recent decades, traffic statistics have increased significantly, and big data concepts for transportation are becoming more prevalent.

Webpage design
The webpage is created in the moto to make it as the user interface and the model created can be used by all the people and can be accessed by any person. The model will predict and will give the prediction result.The result should be displayed to the user inorder to make it more user friendly.The webpage acts as an important path between the model and the users.The webpage is created using Visual Studio(VS Code).The codings are done in HTML and python. According to the input at that time step and the previous hidden state, a hidden state is updated in conventional RNNs at each time step. The update gate and reset gate in GRUs are the two gates that regulate how much of the prior concealed state should be kept and how much should be updated with the current input.

Algorithm
The reset gate chooses how much of the current input to utilize, while the update gate chooses how much of the prior hidden state to preserve. Sigmoid activation functions, which produce values between 0 and 1, are used to control these gates. Next, a linear combination of the reset gate and the current input is used to compute the new candidate hidden state, which is then combined with the old candidate hidden state based on the update gate.
Many sequence prediction tasks, including language modelling and audio recognition, have demonstrated the effectiveness of GRUs. They can be parallelized more simply and have less parameters than typical RNNs, which makes them faster to train.
The figure.1. represents the GRU Algorithm, How much of the prior hidden state (h_t-1) should be carried over to the present state is decided by the update gate. It accepts input from the last hidden state (h_t-1) and the current input (x_t). The weight matrix, hidden-to-hidden weight matrix, and bias vector, in that order, are W_z, U_z, and b_z.

4)HIDDEN STATE:
h_t = (1 -z_t) h_t' + z_t + h_t' (4) Using the hidden state (h_t) , the update gate (z_t), is calculated by adding the new candidate activation state (h_t') and the prior hidden state (h_t-1). The amount of the prior concealed state that should be kept and the amount of the new candidate activation state that should be incorporated are decided by the update gate.

Implementation
The GRU-based dynamic prediction model will make use of GRU to create a prediction model and learn a significant amount of historical data in order to more effectively plan the control strategy. The deep learning GRU forecast model comes first. The prediction ability of the model is generally better the shorter the prediction interval.The flow chart of the process is given below in fig.4., The processes mentioned in the flowchart will be explained as follows,

1) DATA COLLECTION:
In the first step, historical traffic data is gathered from a variety of devices, including traffic sensors, cameras, GPS, and weather stations.
2)DATA PROCESSING: The data is then cleaned, filtered, and transformed into a format that the GRU algorithm can use as part of the preprocessing phase. This involves normalising the data, dividing it into training and testing sets, and engineering features.

3)MODEL BUILDING:
The GRU algorithm is used to create a model that forecasts traffic flow over a specified period of time. The model is fed historical traffic data as input.

4)MODEL TRAINING:
The GRU algorithm's weights are modified to reduce the prediction error when the model is trained using the training data set.

5)MODEL VALIDATION:
The model is validated using the testing data set, and the model's accuracy is evaluated using the prediction error.

6)MODEL DEPLOYMENT:
The deployed trained and validated model is then used to forecast traffic flow in real time.

7)MODEL MONITORING AND MAINTAINING:
To make sure the deployed model is operating as anticipated, it is monitored. In the event that the model's performance declines, it is retrained with the most recent data to increase its precision.
The above mentioned process is followed in the implementation of the traffic flow prediction process.

Result and discussion
The machine learning model which will predict the traffic flow with the given input data was created with jupyter notebook and using the Gated Recurrent Unit(GRU) algorithm.The output of the machine learning model will be in the form of a graph representing the number of the vehicles in the road.It is displayed in the figure.4.below The webpage which is developed using the Microsoft Visual Studio (VS code) using the languages namely python,HTML is uded as the user interface to display the result which was predicted using the machine learning model developed.The webpage is designed with minimum buttons and it is very simple so that everybody can use it . Also the input is taken from the user from the webpage and then the required predicted result for the required junction is displayed as the output for the user in the webpage.The figure.5.shows the image of the webpage with the input from the user.The figure.5. shows the image of the webpage displaying the predicted result.

Conclusion
The machine learning model proposed in this paper is developed using the jupyter notebook and is used to predict the traffic flow with the help of the data given as the input.The predicted result is given to the user in the form of the graph which the user can easily understand.The result is displayed to the user in the webpage developed. The use of ML for traffic prediction has the potential to transform ITS. In terms of estimating traffic volume, speed, and trip time, ML models have produced promising results. These forecasts can assist planners create road networks that can accommodate both present and future traffic demands, individuals plan their trips, and traffic managers make knowledgeable judgements. Data accessibility, model scalability, and model interpretability are only a few of the issues that still need to be resolved. Future studies should concentrate on creating models that can handle these difficulties and boost the precision and efficiency of traffic forecast for ITS.