Research Work
Research Work
Research Work
Traffic congestion is a major problem in most cities all over the world and it influences
urban communities in diverse ways including loss of valuable time, delayed deliveries,
monetary losses, fuel wastage, vehicle wear and tear, and stress levels. Existing practice
of using hands to control traffic by Traffic warders/managers lacks analysis capabilities.
This study focused on developing predictive model for road traffic congestion for
effective traffic management on Nigeria roads.
It is concluded that the developed predictive model for road traffic congestion
effectively addressed the challenges of the situation in Nigeria. This was demonstrated
through prototype web and mobile applications for real-time transportation data
analyzing. It is therefore recommended that the model should be integrated into existing
traffic policies which would capture monitoring and tracking of information that are
1
associated with factors causing congestion. Finally, the implementation of this model
would provide valuable reference for decision-making in metropolitan traffic
congestion solutions.
Keywords: Traffic Congestion, Decision Tree, Random Forest, Deep Neural Network,
LSTM-RNN
2
CHAPTER ONE
INTRODUCTION
incessant traffic congestion. Traffic congestion occurs when the number of vehicles
increase beyond the road capacity (Taiwo et al., 2023). This leads to loss of valuable
time, vehicle wear and tear, high consumption of fuel and accidents (Taiwo et al.,
information is necessary. Traffic data are increasing daily, and their analysis is majorly
concerned with bringing out predictions of future data. One crucial step in the operation
because it will assist traffic managers in the area of route planning and traffic
regulations (Jiber et al., 2020). Ramchandra & Rajabhushanam (2021) described traffic
speed of vehicles.
wherein the expanded use of road by vehicles in traffic streams generates slower vehicle
speeds, time delays as well as a complete paralysis of the traffic network. As a result of
increase in population and the number of private cars in this contemporary age, traffic
congestion has turned out to be considerably worse, not only causing economic losses,
but also leading to environmental damages (Yinan et al.., 2017). Li et al. (2020)
asserted that the only remedy for traffic congestion is prevention, that is, to forecast the
changing trend of the traffic situation due to the current traffic flow information and
3
The increased number of vehicles each day has made traffic congestion in big
Artificial Intelligence (AI) techniques can solve this difficulty by analyzing and
learning the traffic flow patterns and forecasting traffic situation at any point in a given
time (Wafa et al., 2019). Zhu et al. (2016) noted that drivers need traffic information
that can affect their driving to a certain extent. This will assist them in traffic flow state
in the upstream and downstream of the road network. Whenever congestion occur in a
city traffic network, due to increasing traffic flow it will spread through road networks.
As rightly observed by Adekanmbi (2018), traffic congestion is one of the main severe
issues in any city, and can be predicted earlier with the aid of using traffic flow patterns.
Such predictions are feasible through means of analyzing the real-time transportation
and ML sub-field known as Deep Learning (DL) have particular set of algorithms that
permits computers to ponder and analyze on their own (Jafar et al., 2018). Ravi et al.
learns from the input data and makes predictions. According to Alqudah and Yaseen
(2020), ML means that without being programmed computer is capable of bringing out
a solution i.e. machines can learn consistently and address large datasets with the use
new input data and make use of them for predictions (Wang et al., 2019). ML is used to
resolve diverse problems that require getting to know (learning) on the part of the
4
machine. Therefore, ML solutions are data driven and based on the data fed to the
model, it uses algorithms to forecast expected results (Andrew and Parvathi, 2020).
There are three features of learning problem. These include task that must be learnt, the
(DL) is a subfield of machine learning that makes use of algorithms called artificial
neural networks (ANNs) that are capable of self-learning and inspired by the structure
and function of the brain (Inzunza et al., 2020). It means training an artificial neural
network (ANN) with a huge amount of data. In deep learning, the network learns by
itself and thus requires humongous data for learning. It is a crucial tool for AI research
with applications in numerous areas. It uses several layers of nonlinear processing units
for feature extraction and transformation (Wafa et al., 2019). Each successive layer uses
instance, some intelligent transport systems react to present day traffic situations and
introduce measures to reduce the effect of congestion. These include variable speed
limits on busy motorways and urban traffic control systems that assist to manage traffic
traffic accidents on roads, traffic management has become more problematic and
challenging nowadays. In response to the increase in traffic demand and the pressure
on transportation resources, the traditional way of traffic control and management using
hands by traffic managers are no longer effective and efficient. Existing literature
showed that a wide range of methods have been used for road traffic prediction
(Odesanya and Odesanya, 2021). However, none of these studies has identified features
5
which are peculiar to Nigerian roads especially with numerous features that may
influence traffic congestion, such as rain, faulty vehicle, potholes, poor drainage and
accident to mention a few. There is need to provide a predictive model for traffic
congestion based on knowledge about relevant factors, hence this study. Therefore, this
types of traffic conditions for Lagos state road networks. Tensorflow machine learning
framework was used to model congestion prediction system. Moreover, the study
presented a comparative study between the two traditional machine learning algorithms
and two deep learning including decision tree, random forest, deep neural network, and
LSTM using confusion matrix, accuracy, precision, recall, and F1 score as metrics
This study seeks to develop a model for predicting traffic congestion for
effective traffic management on Lagos roads while the specific objectives were to:
i. elicit variables causing traffic congestion in Lagos and collect relevant data;
ii. formulate model for predicting traffic congestion based on the variables
identified in (i);
The work is significant as the outcome will provide model and theoretical
information which could serve as guide that can be used by traffic managers for a
coherent traffic congestion handling and management policy. It could be integrated into
an existing traffic policy for the early detection of traffic congestion following the
6
monitoring and tracking of information that are associated with factors causing
traffic congestion solutions. The study will also serve as guide to others researchers in
this field as the outcome filled the gaps found in the literature.
The scope of the study covered eliciting variables causing traffic congestion in
Lagos, formulating model to predict traffic congestion in Lagos state of Nigeria based
on the variables identified, simulating the model using Google Colab environment,
validating the model using evaluation metrics such as Accuracy, Precision, Recall,
Specificity and F1 Score and implemented a web and mobile based prototype for the
model.
were:
Safety Corps and road traffic warders) regarding factors causing traffic
ii. the predictive model for traffic congestion was formulated using
7
iii. the model was simulated using Python programming language to apply
a percentage split approach of the data into a training dataset for building
iv. the model was validated using evaluation metrics such as Accuracy,
v. LSTM-RNN model was adopted for integration into both mobile and
Development: It involves the creation of algorithms, models and systems that can learn
Artificial Intelligence: It is the branch of computer science that deals with the
Classifiers: They are learning algorithms used to assign a class label to a data input.
8
Algorithm: It constructs model of behaviours and makes use of them for predictions
Traffic Managers: They plan and control traffic from one location to another.
Chapter One provided the background and rationale for the study. Chapter Two
methodology was adopted. Chapter Four presented the results and discussion. Chapter
9
CHAPTER TWO
LITERATURE REVIEW
literature from machine learning methods to more recent deep learning techniques. It
highlighted the limitations of previous studies and established the need for features that
Traffic flow is the rate at which vehicles pass through a given point on the road,
and it is normally calculated in terms of vehicles per hour. It is the interactions between
travellers and infrastructure, with the aim of developing an optimal transport network
with efficient movement of minimal traffic congestion problems. They are two types of
interstate motorway are taking part in uninterrupted flow. Interrupted flow is regulated
They are two main parts of traffic flow modelling approaches (Gerlough and
Huber, 1975). The first entails the specific modelling of the general traffic system itself
with the aid of using simulations that take traffic parameters into consideration. This
approach is basically built on the traffic flow theory foundations in which traffic models
relationships among variables including signalling, congestion, traffic density and flow
(Minev et al., 2018). This method considers traffic control measures in the prediction
process and tried to quantify traffic conditions in road networks (FHWA, 2001).
numerous drawbacks (Sun et al., 2019). These models cannot inherently learn latent
10
traffic patterns from traffic datasets but their prediction quality largely lies on the
quality of inputs that are manually determined (Vlahogianni et al., 2014). This research
focuses on the second technique that is characterized by data driven methods for traffic
techniques bring out useful information between input features and output features and
learn patterns in traffic datasets to predict variables such as traffic speed, volume, flow
Traffic is measured along x and y axes respectively. Kerner (2009) opined that
traffic flow, vehicle density and speed of vehicles are calculated at a given time as
𝑡
𝑘= (2.2)
𝐴
𝑑
𝑣= (2.3)
𝑡
where:
k is the vehicle density i.e. number of vehicles per unit length km of the road.
v is the speed of the vehicle. It measures link-travel distance per unit of time.
observation. In prediction, the accuracy value of a predicated attribute for new data
depends on how well a given predictor can guess. In the modern professional world,
11
prediction, weather forecasting, stock market forecasting, and of course traffic
prediction. When historic data features do not exist, prediction is usually done through
quantitative forecasting models are used to forecast future data based on existing
historic data.
or non-parametric approaches (Smith et al., 2002). Recent studies show that powerful
statistical results are performed by parametric models. However, data driven non-
(Tang et al., 2020). Parametric are usually derived from empirical data that its structure
patterns and trends in time series data in order to perform traffic flow predictions (Smith
et al., 2002). Autoregressive Moving Average (ARMA) and the Kalman filter are
examples of such models that are largely considered to be classical time series
include Historical averages (HA), Historical Mean (HM) and linear regression (LR)
(Zhang and Liu, 2009; Alghamdi et al., 2019). Parametric techniques are easy to
understand as well as implement with low model complexity and provide simplicity in
12
the modelling process (Gravvanis et al., 2019). However, road traffic is always
dynamically changing, and complex which parametric methods cannot learn because
they do not model uncertainty well (Fouladgar et al., 2017). Therefore, the performance
of the parametric approaches in traffic prediction is extensively influenced with the aid
of using underlaying external factors in traffic systems (Rzeszótko and Nguyen, 2012;
approaches that are majorly machine learning methods to overcome the weakness of
classical statistical modelling approaches (Akçelik et al., 2000; Salott et al., 2018;
methods that rely largely on training big data to build the model structure (Zheng,
2015). They carry out to mine historic conditions which might just be like the conditions
at prediction stages (Sun et al., 2019). As a result of their flexible structure and great
learning capabilities, machine learning models are currently widely used for traffic
predictions and studies reveal that better results have been produced compared to the
classical parametric models (Salott et al., 2018). Support Vector Regression (SVR)
(Drucker et al., 1997), Bayesian network models, K-Nearest Neighbour (KNN) (Zhang,
2016), Artificial Neural Networks (ANN) (Zupan, 1994), Recurrent Neural Networks
(RNN) (Sherstinsky, 2020), and Convolutional Neural Networks (CNN) (Indolia et al.,
speeds, increased vehicular queueing and longer trip times. When vehicles are stopped
for longer periods of time traffic congestion occurs (Treiber et al., 2012). According to
13
Systematics (2005), congestion occurs when the regular traffic flow is interrupted by a
high density of vehicles that result in excess travel time. Caves (2004) opined that since
1950s traffic congestion has increased substantially on urban road networks. When
traffic demand is high to the extent that the interaction between vehicles slows down
Different data sources can be used to obtain congestion-related and traffic flow
information such as GPS, sensors, simulation models, social media, probe data etc.
i. GPS: Global positioning system is used to provide location and travel times
information from anywhere on the Earth surface. It can be used with or without
14
Figure 2.1: GPS Satellite Network
15
ii. Sensors: These devices are used to analyze and measure travel times in traffic so as
to identify time critical routes, congestion patterns, and other crucial traffic information
to optimize traffic flow. The sensors called BlipTrack was first used in Zurich,
emissions, economic values through reduced travel times. Since then the BlipTrack
solution has gained acceptance in the UK, US and New Zealand (BlipSystem, 2016).
16
Figure 2.2: Smart traffic sensors for monitoring traffic congestion
17
iii. Simulation: It involves developing a model that imitates the process of a real-world
system over time (Banks et al., 2001). It helps to reduce cost and understand the real
Simulation has been extensively used in traffic flow and traffic travel time prediction.
The models can be developed using software tools like: MATSIM, Repast, ArcGIS,
iv. Social media: This is a good source for streaming real-time big data from online
sources including Facebook and Twitter (Hortonworks, 2017). Figure 2.3 illustrates the
stages involved in streaming of tweets from the input source to the destination using a
18
Figure 2.3: Streaming processing pipeline architecture
19
v. Probe vehicle: Vehicle probe is an emerging technology used for monitoring traffic
without the need for maintaining and deploying equipment in the right-of-way (Young,
2007). Vehicle probes directly measure travel time using data from a portion of the
vehicle probe data services primarily include the automated vehicle location (AVL) and
Machine learning (ML) is a branch of artificial intelligence (AI) that reveals the
experiential “learning” that is related to human intelligence, also having the ability to
learn and through the use of computational algorithms enhances its analyses (Bini,
2018; Naylor, 2018). ML is the study of data and algorithms that a computer uses to
improve its understanding of a given task (Aronsson and Bengtsson, 2019). Manning
(2020) defined ML as the subset of AI studying how computer can enhance their
be described as the gathering of the use of diverse algorithms to teach computer systems
to discover patterns in data to be used for future prediction (Belyadi and Haghighat,
2021). ML focuses on creating computer programs that use and access data to learn by
instruction. ML has demonstrated valuable due to the fact that it can solve problems at
a pace and scale that cannot be duplicated by the human thoughts alone. There are four
20
2.2.1 Supervised Learning
learning algorithm is trained on labeled data in this type (Russell, 2018). Supervised
learning is extremely powerful when used in the right circumstances, although the data
needs to be labeled accurately for this technique to work. ML algorithm is given a small
training dataset to work with in supervised learning. This training dataset is a smaller
part of the larger dataset and provides the algorithm a simple concept of the problem,
solution, and data points to be dealt with. The training dataset is similar also to the final
dataset in its characteristics and offers the labelled parameters required for the problem
to the algorithm (Russell, 2018). The algorithm then reveals relationships between the
parameters given, effect relationship between the variables and essentially establishing
a cause in the dataset. At the end of the training, the algorithm established the
relationship between the input and the output and idea of how the data works. This
solution is then deployed to be used with the final dataset, which it learns from in the
same manner as the training dataset (Mohammed et al., 2017). This implies that
relationships as it trains itself on new data, and enhance even after being deployed.
Unsupervised learning has advantage of being able to work with unlabelled data
(Russell, 2018). This implies that human effort is not needed for the dataset to be
In supervised learning, the labels permit algorithm to discover the precise nature of the
relationship between any two data points (Mohammed et al., 2017). However,
unsupervised learning does not have labels to learn from, this results in the creation of
hidden structures. Relationships between data points require no input from human
21
beings but are perceived by the algorithm in an abstract manner. What makes
(Russell, 2018). Unsupervised learning algorithms can adapt to the data by dynamically
changing hidden structures instead of a defined and set problem statement. This gives
The classified and unclassified data are a mixture of the given data in this type
of learning (Mohammed et al., 2017). The appropriate model for the classification of
data can be generated through the combination of labelled and unlabelled data.
Unlabelled data is in abundance and labelled data is scarce in most of the situations.
The essence of semi-supervised learning is to create a model that will predict future test
data better than that of the model generated using the labelled data alone (Russell,
2018).
This type of learning is based on reward or penalty, and its utmost purpose is to
use insights acquired from environmental activities to take action to increase the reward
or minimize the risk (Mohammed et al., 2017). Sutton and Barto (2017) asserted that
reinforcement learning is a learning process that evolves with trial and error where a
teacher or a supervisor is not available. This learning takes inspiration directly on how
human beings learn from data in their lives. It features an algorithm that learns from
new situations using a trial-and-error method and improves upon itself. Non-favourable
reinforced.
22
2.3 Evolution of Machine Learning
machine learning.
Alan Turing researches in 1940s fastened with the idea of machine intelligence.
Arthur Samuel created an early learning machine in 1952 which turned into
specialists and games. It played against itself to learn how to differentiate good
and Claude Shannon birthed the term ‘artificial intelligence’ at a workshop that
In 1967, Nearest Neighbour Algorithm was proposed which could be used for
robot that could move round a room and keep away from barriers in its path.
In 1986, David Rumelhart together with James McClelland and the PDP
work that accelerated the use of neural network models for machine learning.
that was able to play backgammon and could match the abilities of top human
players.
In 1997, IBM invented Deep Blue computer became the first computer chess-
23
In 2011, IBM’s Watson defeats two of its champions at Jeopardy game in US.
paper that described a model that had been used to win an annual image
recognition competition.
ancient Chinese game of Go. It won four out of five matches against
i. Data Acquisition: This is the method of amassing data from relevant sources
before it can be stored, cleaned, preprocessed, and used for further mechanisms.
iii. Feature Selection: The data obtained from the above step may consist of many
features, all of which might not be applicable to the learning process. These
features need to be eliminated and the most crucial featured subset needs to be
obtained.
iv. Model Building: Training the dataset and building the model by choosing the
24
v. Execution and Model Validation: This involves implementation of the model
and validating the model. These include validating and fine-tuning the
parameters.
systems and computer vision. Such vision will make computers to detect and
image recognition could be used to tag people with photos that have been
ii. Filtering Emails: Spam detection systems can use machine learning to filter
which are classified as spam and non-spam, to distinguish between emails and
direct them to the correct folders (Papadopoulos, 2019). In this training process,
the system can learn how the presence of specific words, or the names of
different senders, and other characteristics, relate to whether or not the email is
spam (Sun et al., 2019). When deployed in the live system, it uses this learning
to classify new emails, refining its training when users identify incorrect
classifications.
be desirable to the user. It is machine learning that processes data from previous
25
purchases, and the purchases of others, and uses this to discover patterns and
detection systems associated with credit card use or other payment systems.
Using the normal transaction data from a large number of users, algorithms are
2020). Using this data for each user, it can also learn what makes a transaction
of spending activity.
low levels of accuracy, which made them difficult to use in many cases (López
and Guerrero, 2017). Recent advances mean that these systems can now
recognize speech much more accurately, translating the data patterns encoded
within sound waves to text, and carrying out the commands contained therein.
As a result, many smartphones and other devices now come equipped with
vi. Machine Translation: Using machine translation, computer systems are able
to automatically convert text or speech from one language into another. Efforts
in this field date back to at least the early 1950s (Weaver, 1955). Recent
advances in the field that have made these techniques more broadly useful.
There now exists a range of approaches to this task, including statistical, rule-
26
based, and neural network-based techniques (Le and Schuster, 2016). Today,
machine translation is used in specific translation apps for mobile phones, social
smart city. Accurate traffic prediction based on machine learning can assist to
minimize the issues (Boukerche and Wang, 2020). For instance, machine
learning can help transportation companies to predict possible issues that may
happen on particular routes and advising their customers to take a different path
based on the travel history and trend of traveling through diverse routes.
threats, forecast where bad neighborhoods are online, keep people secure while
surfing, or safe data in the cloud by revealing suspicious activity (Zhang et al.,
policy violations.
27
In addition to these application areas, machine learning based models could be also
intelligence system predicts output values from given input data and conducts its task.
ML algorithms create a model based on a training data known as sample (Maulud and
The two algorithms used for this study under machine learning are Decision Tree and
Random Forest.
DT is a tree-based method in which any path starting from the root is defined
through a data separating sequence until an outcome on the leaf node is achieved (Yang,
2019). Each tree comprises of the nodes and branches (Swain and Hauska, 1997). Each
subset defines a value that can be taken by the node and each node represents features
division that makes use of a top-down, divide-and-conquer technique (Tao et al., 2016).
nodes represent the features of a dataset and each leaf node represents the outcome
(Yang, 2019). Decision tree algorithm could be utilized to solve classification and
model that can predict the value or class of the target variable by learning simple
decision rules inferred from training data (Tao et al., 2016). There are two nodes in a
Decision tree which are the decision node and leaf node. Decision nodes are used to
28
make any decision and have feature more than one branches while leaf nodes are the
output of these decisions and do not comprise of any further branches (Dey, 2016). The
test or decisions are executed on the premise of features of the given dataset. Zhang et
al. (2020) opined that decision tree evaluates and compares within the decision tree the
attribute values of nodes and based on the different attribute values determine the
branch down from the node. Decision tree learners make attempt to discover a decision
rule that produces the greatest decrease in impurity at a node (Albon, 2018).
29
Decision Node
ooooooNN
Leaf Node Leaf Node
NNNNode
ooooooNN ooooooNN
Node
NNNNode NNNNode
Node Node
Leaf Leaf
NNNNN NNNNN
ode ode
Node Node
30
Advantages of Decision Tree
According to Jijo and Abdulazeez (2021), below are the Decision Tree advantages:
fulfilled.
3. It can classify both numerical and categorical outcomes but the generated attribute
must be categorical.
5. It can create complex decision boundaries, allowing them to easily solve non-linear
problems.
(Yang, 2019). It includes many decision trees from a bootstrap aggregated sample in
the original training set with the same distribution for the individual trees such that each
tree depends on the values of random vector grown (Liaw and Wiener, 2002). To create
that of any individual tree, it uses bagging and feature randomness when building each
31
3. It produces good predictions that can be easily understood.
The model is said to overfit the training data when a machine learning model
cannot generalize well to new data (the test set) and learns unique features to the
training set (Géron, 2017). Different ML models make use of various regularization
from the training set at all (Géron, 2017). In this situation, the performance of the model
will be poor on both the training set as well as the test set. The quality of the training
data must be considered in order to avoid underfitting (Kamble and Kounte, 2020). For
instance, relevant features for the learning objective must be part of the data and outliers
and different noise must be removed. Removing noise also help against overfitting. The
reason being that the model learns the noise of the training data that does not exist in
the test set (Géron, 2017). Additionally, during the learning phase adding random noise
in each iteration can also help against overfitting. This is feasible as it prevents the
Provision of relevant features for a given task is very essential for a successful
ML model. For instance, prediction of the traffic congestion is likely not going to be
very successful based on the current price of gold. Intuitively, the model will not
achieve anything interesting because these two variables are completely unrelated.
Featuring engineering is the process of uncovering the most relevant and useful features
(Géron, 2017).
32
2.7.2 Data Preparation
The first and foremost points to guarantee the successful building of forecasting
models are data quality and its representation. Preparing the data appropriately for a
given model is the next step. The quality of the data is the first part to consider.
Secondly, the data must be organized in a particular way for a time series forecasting
context.
2.7.3 Parameters
parameters used remain constant during the learning phase and do not directly belong
to the model itself. In avoiding a poorly performing model, tuning the parameters is an
important step.
hierarchical model that incorporates traditional neural networks (Narmadha and Kumar,
multiple levels (Amitha et al., 2020). It has been increasingly recognized as a crucial
tool for artificial intelligence research with applications in numerous areas such as
makes use of algorithms called artificial neural networks (ANNs) that are capable of
self-learning and inspired by the structure and function of the brain. Rather than being
explicitly told how to solve a problem, ANNs are trained to learn models and patterns.
Deep learning has gained a popularity to the extent that as the amount of data available
33
2.9 Deep Learning algorithms
Deep learning algorithms are set of decision-making networks that are pre-
trained to serve a task and they are dynamically made to run through
numerous layers of neural networks (Inzunza, et al., 2020). They mostly work with any
kind of data and require huge amounts of information and computing power to solve
These include Deep Neural Network (DNN) Long Short Term Memory Recurrent
transmission of information between the different layers of neural connections and the
recognition of patterns (Chollet, 2021). It has an input layer and at least one layer in
between an output layer. The higher the number of layers, the deeper the network. Each
2. It improves performance.
5. It unravels non-linear relationships within data that may be elusive to detect using
conventional methods.
34
2.9.2 Long Short Term Memory Recurrent Neural Network (LSTM-RNN)
outcomes through those sequences. LSTM-RNN allows prior inputs to learn and evolve
with more exposure. It is used for sequential modeling and language modeling. Without
mentioning them in the code, LSTM-RNN can learn patterns and predict outcomes.
Advantages of LSTM-RNN
object detection (Babu, 2019). CNN is also known as ConvNet. It makes use of more
than one layer to extract features from the available data. It consists of four layers.
These include Convolution layer, Rectified Linear Unit (ReLU), Pooling Layer, Fully
Connected Layer. These four layers offer an operating mechanism for the network. The
first layer in CNN is convolution layer, which from the data filters out complicated
features. The ReLU then maps data to train the network. Thereafter, the pooling layer
receives the process sends by the map, which converts the data from 2D to a linear
array, and reduces sampling. Finally, the fully connected layer used as input to detect
35
2.9.4 Deep Belief Network (DBN)
DBN is another popular deep learning with artificial intelligence features that
permits the network to learn patterns in data. It is used for image feature detection and
face recognition software tasks. The DBN is an artificial neural network that helps in
layers provide a robust structure that can classify data based on different categories,
and the layers of DBN follow the top-down technique, permitting communication
(AI). It can generate results on their own by training through specific datasets to create
new data instances and capable of unsupervised learning (Huang et al., 2020). The
GAN model has two major key elements. These include a discriminator and a generator.
The discriminator is trained to check the output for any fake data or errors and rectify
the model based on it. In contrast, the generator is trained to create fake data based on
its learning. GAN is used for generating videos, simulating gravitational lenses, and
enhancing astronomical images. It is also used for image generation, such as enhancing
the graphics quality in video games. In the AI community, GAN remains a popular
Taiwo et al. (2023) proposed a model to predict traffic congestion. They applied
classification tree, support vector machine and RUSboosted algorithms to build traffic
congestion models. The experimental results indicated that support vector machine
outperforms the other two algorithms. However, the study was limited to the use of
36
online dataset and the dataset used is not applicable to Nigeria situation. Ramchandra
and Rajabhushanam (2021) worked on traffic prediction system using machine learning
algorithm. They utilized Deep Autoencoder (DAN), Deep Belief Network (DBN),
Random Forest (RF) and Long Short Term memory (LSTM) to predict the traffic flow
of a particular zone. The experimental results indicated that the LSTM performs better
than the other three algorithms with 94.3%. However, the authors did not subject
posed by random oversampling. Ravi et al. (2021) conducted a study on a system that
can be used to analyze the traffic and predict the congestion on specific path and
notifying well in advance the vehicles intending to travel on the congested path. They
applied You Only Look Once (YOLO) algorithm to implement the model. The model
provides accurate and early prediction of the traffic congestion. However, the dataset
used is not applicable to Nigeria situation. In addition, Uber movement data collected
did not contain all the necessary information that could have made their predictive
model to be more realistic. Geetha et al. (2021) proposed a system to increase traffic
efficiency. They employed genetic algorithm to build predictive model. The system
performs better than the existing ones. However, the study was limited to the use of
online dataset and the dataset used lacks real-time testing of the proposed scheme.
Duhayyim et al. (2021) proposed a model to predict traffic flow with weather
conditions in smart cities. They employed artificial intelligence based traffic flow
prediction with weather conditions (AITFP-WC) technique. The results indicated the
efficiency of the AITFP-WC approach is higher than the recent state of art techniques.
37
model to analyze traffic flow. They applied Bayesian Regularization (BR), Scaled
Experimental results showed that BR outperformed SCG and LM. Ramesh in terms of
accuracy. However, the dataset used was not subjected to SMOTE algorithm so as to
upcoming vehicles into the shortest path or alternate path based on prediction methods.
They utilized Random Forest (RF), AdaBoost (AB) and Logistic Regression (LR) to
build models. The results indicated that LR performed better than RF and AB in terms
of prediction accuracy. However, the study was limited to the use of online dataset
which is not applicable to Nigeria situation. Majumdar et al. (2021) introduced long
short-term memory networks for the prediction of congestion propagation across a road
posed by random oversampling. Liu and Shetty (2021) developed a model for traffic
congestion and road accidents. They applied four various machine learning algorithms
to build models. The results indicated that random forest outperformed the other three
algorithms. However, the model lacks in performance due to uncertain run-time traffic
conditions. Rajeev et al. (2021) conducted a study on a system for traffic assessment.
They utilized regression based algorithm for image detection to analyze the bulk data
of the transport system and machine learning for prediction. The system achieved 83%
Nigeria situation.
38
Hassan et al. (2021) developed a system that will control traffic congestion in smart
societies. They utilized IoT based intelligent traffic congestion handling system
system accomplished 81% accuracy. However, time delays are main limitations which
may occur due to poor collection of sensors or slow connectivity of network. Rajendran
and Ayyasamy (2020) conducted a study on a model for short term traffic flow
prediction. They utilized structure pattern and regression to build models. The proposed
system performs better than the conventional systems in terms of accuracy and turns
out to facilitate in conserving energy. However, the dataset used is not applicable to
Nigeria situation. Andrew and Parvathi (2020) proposed a solution to predict vehicular
traffic using machine learning methods. They build a model that is capable of predicting
traffic volume based on features that brings out hidden insights in vehicular movements.
The research resulted in identifying an optimal model to the publicly available dataset.
However, time-consuming features extraction makes the model inefficient for real time
forecast. In addition, the dataset used was not subjected to SMOTE algorithm in order
on multiple parameters. They utilized Gaussian process in machine learning for the
prediction of traffic speed. The technique performs accurate results in traffic speed
prediction. However, Gaussian process lacks real-time testing of the proposed scheme.
Kyaw et al. (2020) predicted traffic congestion of urban road network. Decision Trees,
Random Forest Classifiers and ExtraTree Classifiers algorithms were used to build
predictive models. The experimental results showed that Decision Trees produced a
better result than the other two algorithms. However, the study was limited to the use
39
Tamir et al. (2020) conducted a study on a model to predict traffic congestion. They
employed Decision Tree, Logistic Regression and Neural Networks algorithms to build
traffic congestion models. The results showed that Decision Tree outperforms other two
algorithms with accuracy of 97%. However, the study failed to subject the preprocessed
random oversampling. Rahman (2020) predicted short term traffic flow using machine
learning approaches such as k-nearest neighbor (KNN), support vector machine (SVM)
and artificial neural network (ANN). Related parameters were incorporated with the
algorithms of machine learning for better traffic flow prediction in this study. The
results revealed that KNN produces more accurate results than SVM and ANN.
However, the study failed to adopt multiple simulations to justify the performance of
the selected algorithms. Ata et al. (2020) proposed a TCC-SVM model for an
predict congestion with a preprocessing layer to enhance the incoming data by dealing
with missing values. The performance of the proposed TCC-SVM model is much better
when compared to the previous techniques based on the evaluation of the results
produced from the simulation. However, the study was limited to the use of online
dataset which is not applicable to Nigeria situation. Meena et al. (2020) developed a
model to predict accurate and timely traffic flow information. They applied machine
learning algorithms such as Decision Tree, Support Vector Machine (SVM) and
Random Forest to build models. The results indicated that Random Forest produced a
better result than the other two algorithms. However, the study failed to adopt the use
of feature selection techniques for feature selection. Zafar and Ul Haq (2020)
researched on traffic prediction that is based on traffic data collected through Google
40
congestion state using Estimated Time of Arrival (ETA). They used three machine
learning techniques to build models. Results indicated that random forest classification
algorithm has the highest prediction accuracy of 92% followed by XGBoost and KNN
(HTM) cortical learning algorithm. The algorithm is evaluated and compared against
some of the state-of-the-art anomaly detection techniques. The results showed that the
algorithm performed better than KNN-GAS, the ICA-LoOP, and the SVD-IO.
However, the study failed to subject the preprocessed dataset to SMOTE algorithm in
to predict daily and hourly traffic volume. They carried out the research through two
case studies. In first case study, they applied Linear Regression, Multilayer Perceptron,
Lazy IBk (k-Nearest Neighbors), M5P, Random Forest, Random Tree, and REPTree
algorithms to predict daily traffic volume of traffic flow and M5P outperformed the
others. In second case study, they utilized Lazy IBk (k-Nearest Neighbors), Random
Forest, Random Tree, and Random committee were trained with the aim to predict the
hourly volume. The Lazy IBk algorithm was slightly better than the others. However,
the dataset used is not applicable to Nigeria situation. Mei et al. (2020) conducted a
technique to divide traffic status level (TSL) as well as five various machine learning
algorithms to build predictive models. However, the study lacks in time-efficiency for
dense traffic condition with rapid fluctuations. The results showed that BP neural
network is more accurate than other algorithms. Jiber et al. (2020) proposed a hybrid
41
model that combines Extreme Learning Machine (ELM) and Ensemble Based System
in Decision Making (EBDM) to predict the future hourly traffic of a road section in
Tangier Morocco. They applied single hidden Layer Feed-forward Neural Network
(SLFN) to build model. The experimental results indicated that the model outperformed
However, the study was limited to the use of online dataset which is not applicable to
Nigeria situation. Inzunza et al. (2020) developed a system to predict the traffic flow in
a city. They employed machine learning, computer vision, deep learning, and neuronal
networks to implement the model. The proposed system works relatively fast and
produced promising results. However, the study failed to The study failed to adopt
system (RCPS) that makes use of traffic volume and vehicle speed to predict traffic
congestion. To extract traffic volume and vehicle speed on the road, the proposed model
collects real-time road images taken from camera drones. They used extracted traffic
indicators to predict the congestion level in the future. RCPS produces high accuracy
in congestion level prediction. However, the dataset used is not applicable to Nigeria
situation. Verma and Badade (2019) worked on a system to control traffic in a smart
city. They utilized Long Range Wide Area Network (LoRa) and Intelligent Traffic
Management System (ITMS) to predict traffic. Experimental results indicated that the
system will produce high performance in traffic prediction. However, the study failed
to incorporate the spatial traffic flow features. In addition, the authors did not subject
level of traffic congestion on the basis of a time series analysis. They employed various
42
machine learning algorithms to build predictive models. The results of the various
algorithms used showed that logistic regression outperforms with an accuracy of 85%.
However, the study was limited to the use of online dataset which is not applicable to
Nigeria situation. Sridevi et al. (2019) conducted a study on a model for traffic analysis
considering social media platforms. They used random forest algorithm for the
estimation of traffic based on the traffic congestion level. The model accomplished 86%
accuracy. However, the study lacks in time-efficiency for dense traffic condition with
incremental learning for road traffic congestion detection. However, the study failed to
addition, the preprocessed dataset was not subjected to SMOTE algorithm in order to
Zhang et al. (2019) proposed a model to forecast traffic congestion. They used
predictive model. The results showed that the model performs better than the baselines
of congestion prediction. However, delay in data received by the signal sensors affected
model to predict traffic congestion. They used Decision Trees and Logistic Regression
to build models. Experimental results showed that Decision Trees were more accurate
than Logistic Regression. However, large amount of data make algorithm slower and
changes are not distinguishable. Alshamrani et al. (2019) worked on a machine learning
based model for the prediction of traffic flow in smart cities. The proposed system
43
congestion, delays, and emergency issues such as accidents. However, the study was
limited to the use of online dataset which is not applicable to Nigeria situation. Kong et
al. (2019) proposed a prediction network-based on machine learning. They utilized long
short-term memory (LSTM) on big data-driven traffic flow. Based on machine learning
network, they also constructed the LSTM parameter optimization algorithm. Couple
with the increase of training steps, the model has superior performance. However, the
dataset used is not applicable to Nigeria situation. Ata et al. (2019) proposed a model
for smart road traffic congestion. They applied Artificial Back Propagation Neural
Networks (MSR2C-ABPNN) to build model. Experiment showed that the model gives
attractive results. However, time delays are main limitations which may occur due to
study on a model for the traffic congestion for Internet of things (Iot) based smart city.
The convolution neural networks (CNN) and different machine learning techniques
were utilized to predict traffic congestion. The results revealed that CNN outperformed
other various machine learning algorithms. However, the dataset used is not applicable
to Nigeria situation. In addition, the preprocessed dataset was not subjected to SMOTE
44
Table 2.1: Review of closely related works for traffic congestion
Taiwo et al. Traffic The authors The authors Support The study was
(2023) congestion proposed a utilized vector limited to the
prediction model to classification machine use of online
using predict tree, support outperforms dataset. In
supervised traffic vector the other two addition,
machine congestion. machine and algorithms. dataset used is
learning RUSboosted not applicable
algorithms algorithms to to Nigeria
build traffic situation.
congestion
models.
Hassan et Iot enabled The They The system Time delays
al. (2021) intelligent researchers employed accomplishe are main
traffic proposed a support vector d high limitation
congestion system that machine accuracy in which may
handling sense and (SVM) to training and occur due to
system notify the build traffic validation. poor
empowered congested congestion collection of
by machine areas. model. sensors or
learning slow
connectivity
of network.
Ramchandr Traffic The authors They utilized The The time
a, & Prediction proposed a Deep experimental dependence of
Rajabhusha System using model toAutoencoder results the traffic data
nam, Machine predict (DAN), Deep indicated that should be
(2021) Learning traffic flow Belief the LSTM investigated
Algorithms of aNetwork performs prior to
particular (DBN), better than inputting the
zone. Random the other data into the
Forest (RF) three model.
Long Short algorithms
Term Memory with 94.3%
(LSTM) accuracy,
algorithms to
build models.
Geetha et A traffic The authors They applied The system Dataset
al. (2021) prediction for proposed a genetic performs collected
intelligent system to algorithm to better than lacks real-
transportatio increase build model. the existing time testing of
n system traffic ones. the proposed
using efficiency. scheme.
machine
learning
45
Ravi et al. Traffic The They applied The model Uber
(2021) managementresearchers You Only provides movement
system using
proposed a Look Once accurate and data collected
machine model to (YOLO) early did not
learning predict algorithm to prediction of contain all the
algorithm traffic implement the the traffic necessary
congestion model. congestion. information
and that could
notifying have made
well in their
advance the predictive
vehicles model to be
intending to more realistic.
travel on the
congested
path.
Odesanya, Performance The They applied Experimental The time
I. & Analysis of researchers Bayesian results dependence of
Odesanya, Traffic developed a Regularizatio showed that the traffic data
(2021). Congestion model to n (BR), Scaled BR should be
Using analyse Conjugate outperformed investigated
Designated traffic flow. Gradient SCG and prior to
Neural (SCG) and LM. inputting the
Network Levenberg- data into the
Training Marquardt model.
Algorithms (LM)
algorithms to
build models.
Ramesh et Smart Traffic The authors Random The results Noise in the
al. (2021) Prediction proposed a Forest (RF), indicated that raw data
and model toAdaBoost LR causes low
Congestion minimize (AB) and performed accuracy of
Reduction in the traffic Logistic better than the model.
Smart Cities congestion Regression RF and AB in
in urban(LR) were terms of
areas. applied to prediction
build models. accuracy.
Majumdar Congestion The They Both Trajectory
et al. prediction researchers employed univariate information
(2021) for smart developed a univariate and and extracted from
sustainable model to multivariate multivariate traffic
cities using predict the algorithms to predictive simulator did
IoT and propagation build models. models’ not contain the
machine of analysis most needed
learning congestion showed an information.
approaches across a road accuracy of
network. 84–95%.
46
Liu & Analytical The authors They utilized The results The model
Shetty Models for developed a four various indicated that lacks in
(2021) Traffic model to machine random performance
Congestion predict learning forest with uncertain
and Accident traffic algorithms to outperformed run-time
Analysis
congestion build models. the other traffic
and road three conditions.
accidents. algorithms
with 87.5%.
Rajeev et Traffic flow The They used The system The time
al. (2021) prediction researchers random forest has greater dependence of
using random developed a and bellman accuracy in the traffic data
forest and system for ford terms of should be
bellman ford traffic algorithms to traffic investigated
for best route assessment. build model. prediction. prior to
detection inputting the
data into the
model.
Duhayyim Modeling of The They The results Unknown
et al. artificial researchers employed indicated the optimization
(2021) intelligence proposed a artificial efficiency of performance
based traffic model to intelligence the AITFP- when the
flow predict based traffic WC approach method is
prediction traffic flow flow higher than used in
with weather with prediction the recent combination
conditions weather with weather state of art with other
conditions conditions techniques. techniques.
in smart (AITFP-WC)
cities. technique
Rajendran, Short-term The They The model One major
& traffic researchers employed performs deficiency of
Ayyasamy, prediction proposed a locally better than locally
(2020) model model to weighted the weighted
for urban predict short learning to conventional learning is its
transportatio term traffic build model. systems in inability to
n using flow. terms of scale well.
structure accuracy and
pattern turns out to
and regressio facilitate in
n: An Indian conserving
context energy.
47
Tamir et al. Traffic The They The results Dataset used
(2020) congestion researchers employed showed that is not
prediction developed a Decision Tree, Decision applicable to
using model to Logistic Tree Nigeria
decision tree, predict Regression outperforms situation.
logistic traffic and Neural other two
regression congestion. Networks algorithms
and neural algorithms to with 97%
networks build nodels. accuracy.
Andrew, Vehicular The authors The build a The research Time-
M. & Traffic proposed a model that is resulted in consuming
Parvathi, R. analysis and model to capable of identifying features
(2020) prediction predict predicting an optimal extraction
using traffic flow. traffic volume model to the makes the
Machine based on publicly model
learning features that available inefficient for
algorithms brings out dataset. real time
hidden forecast.
insights in
vehicular
movements.
Mei et al. Research on The authors Fuzzy The results The study
(2020) short-term proposed a comprehensiv showed that lacks in time-
urban traffic model to e evaluation BP neural efficiency for
congestion forecast technique and network is dense traffic
based on traffic five various more condition with
fuzzy congestion. machine accurate than rapid
comprehensi learning other fluctuations.
ve evaluation algorithms algorithms.
and machine were utilized
learning to build
models.
Kamble, & Machine The They applied The Gaussian
Kounte learning researchers gaussian technique process lacks
(2020) approach on presented process in performs real-time
traffic machine machine accurate testing of the
congestion learning learning for result in proposed
monitoring approach to prediction of traffic speed scheme.
system in identify traffic speed. prediction.
internet of traffic
vehicles congestion
based on
multiple
parameters.
48
transport road and ExtraTree
Trees predictive
GPS data network. Classifiers
produced a model.
algorithmsbetter result
were used to
than the other
build models.
two
algorithms.
Rahman, F. Short term The He employed KNN The study
I. (2020) traffic flow researcher k-nearest produces failed to adopt
prediction predicted neighbor more multiple
using short term (KNN), simulations to
accurate
machine traffic flow support vector justify the
learning - using machine result than performance
KNN, SVM machine (SVM) and SVM and of the selected
and ANN learning artificial ANN with algorithms.
with weather techniques. neural 94.8%
information network accuracy.
(ANN) to
build traffic
congestion
models.
Meena et Traffic The authors They used The results The study
al. (2020) prediction for developed a decision tree, indicated that failed to adopt
intelligent model to support vector Random the use of
transportatio predict machine Forest feature
n accurate and (SVM) and produced a selection
system using timely random forest better result techniques for
machine traffic flow to build than the other feature
learning information. models. two selection.
algorithms
with 88.88%.
Jiber et al. Road traffic The authors They applied The The study has
(2020) prediction proposed a single hidden experimental high delay in
model using hybrid Layer Feed- results computational
extreme model to forward indicated that steps.
learning predict Neural the model
machine future Network outperformed
hourly (SLFN) to in terms of
traffic of a build model. prediction
road section. accuracy
when
compared to
other well-
known
algorithms.
Ata et al. Adaptive IoT The They applied The Has high data
(2020) empowered researchers Support performance processing
smart road proposed a Vector of the model delay.
traffic model for an Machine to is much
congestion intelligent build models. better when
49
control traffic compared to
system using congestion the previous
supervised control. techniques
machine based on the
learning evaluation of
algorithm the results
produced
from the
simulation.
Huang et Traffic The Traffic The system The time
al. (2020) Congestion researchers volume and produces dependence of
Level proposed a vehicle speed high the traffic
Prediction system to were used to accuracy in volume and
Based on predict predict traffic congestion vehicle speed
Recurrent traffic congestion. level data should be
Neural congestion. prediction. investigated
Networks prior to
inputting the
data into the
model.
Zafar & Ul Traffic The They used Results Data collected
Haq, congestion researchers random forest, indicated that through
(2020) prediction developed XGBoost and random Google Map
based on model to KNN to build forest API lacks the
Estimated predict models. algorithm has most needed
Time of traffic highest information.
Arrival congestion prediction
state using accuracy
Estimated more than
Time of XGBoost and
Arrival KNN.
(ETA).
Alshamrani Machine The They applied The system The proposed
et al. learning researchers machine manages system needed
(2019) based model developed a learning traffic in further
for system to algorithm to terms of investigation
traffic predict build model. congestion, to ascertain its
prediction in accurate and delays, and performance
smart cities timely emergency
traffic flow issues such as
information. accidents.
Kong et al. Big data- The authors They utilized The model Unknown
(2019) driven proposed a long short- has superior optimization
machine prediction term memory performance. performance
learning- on big data- (LSTM) when the
enabled driven parameter method was
traffic flow traffic flow. optimization used in
prediction. algorithm to combination
build model. with other
techniques.
50
Verma & Traffic The authors They utilized Experimental The study
Badade Prediction proposed a Long Range results failed to
(2019) Using system to Wide Area showed that incorporate
Machine control Network the system the spatial
Learning traffic in a (LoRa) and will produce traffic flow
smart city. Intelligent high features.
Traffic performance
Management in traffic
System prediction.
(ITMS) to
predict traffic.
Babu. Methodologi The author Convolution The results Delay in data
(2019) es for Traffic proposed a neural revealed that received by
congestion model for networks CNN the signal
prediction for the traffic (CNN) and outperformed sensors
a Iot based congestion different other various affected
smart city for Internet machine machine solution
using of things learning learning performance
machine (Iot) based techniques algorithms. of the model.
learning and smart city. were utilized
CNN to build
models.
Sridevi et Traffic The They used The model The study
al. (2019) analysis by researchers random forest accomplishe lacks in time-
using developed a algorithm to d 86% efficiency for
random model for build model. accuracy. dense traffic
forest traffic condition with
algorithm analysis. rapid
considering fluctuations.
social media
platforms
51
Based on the review of related works, it is evident that while substantial research has
causing traffic congestion in the Nigeria context. To address this gap, the proposed
research aims to develop predictive model for road traffic congestion in Lagos using
two machine learning algorithms: (Decision Tree and random Forest) and two deep
learning algorithms: (Deep Neural Network and Long Short Term Memory Recurrent
Neural Network). It will also integrate SMOTE algorithm with Deep Neural Network
and Long Short Term Memory Recurrent Neural Network to enhance the performance
of the model.
52
CHAPTER THREE
RESEARCH METHODOLOGY
methodology has been carefully structured to address the study's previously outlined
the appropriate road traffic congestion data for model development. The careful
consideration given to data selection and collection forms the foundation for subsequent
analytical processes.
The dataset was collected using mixed research method. Qualitative aspect was
done using dataset from the Federal Road Safety Corps (FRSC) office while
quantitative aspect was done by developing google form (sentiment approach) for those
that reside in those areas and road users that are plying those roads who daily fill the
form and submit it. Six months of traffic dataset were used to predict traffic congestion.
The dataset consists of 4600 instances and 14 attributes namely: Date_time, Holiday,
was later uploaded into Google Drive to facilitate easy access into the simulation
environment where different analyses were done for this study. Figure 3.1 shows a
53
Traffic Dataset
Data Preprocessing
Pre processing
Sampled Dataset
Unsampled Dataset (Using Unsampling)
(using Upsampling)
Training Dataset Splitting Testing
(80%) (20%)
Prediction
Validation
Accuracy, Precision,
Recall, Specificity, F1
Score
54
Figure 3.2: Sample of dataset instances with their features
55
Table 3.1: Input and target attributes
Holiday
Narrow_road_network
Bad_access_roads
Presence_of_too_many_vehicles_on_the_road
Accident
Rain
Presence_of_traffic_control_officer
Potholes
Poor_drainage
Faulty_vehicle
Traffic_volume
56
3.1.1 Data Preprocessing
The data preprocessing in this study was performed using an online cloud-based
Python notebook called Google CoLaboratory that was provided by Google to its users.
This provided a convenient way of preprocessing the different steps in the working
procedure. Several python libraries would be applied in different ways, and are
summarized below.
NumPy: It was used for easy handling of huge multi-dimensional lists and matrices. It
data structures.
Pandas: It was used for data wrangling, analysis and statistics. It was built with the
Scikit-learn: This library was used for manipulation of datasets and implementation of
Matplotlib: A 2D plotting library was used to create graphs that visualize data in
different ways.
Data preprocessing started with categorizing the data acquired to different types of data
structures including Categorical data (Direction, Type of road, Congestion Level) and
Numerical data (Date, Time, Length of the road, Travel Time, road Volume, Speed of
the car, Occupancy of the road). Both of the data types were preprocessed and made
ready for constructing the predictive model. The following three tasks were associated
57
A. Assigning data to the attributes /variables deceleration
The attributes used in the traffic congestion predictive model was assigned data types
58
Figure 3.3: Assigning data to the attributes /variables
59
B. Filling the missing values: There are different methods to handling the missing data
in the data preprocessing; (1) Ignore the tuple, (2) fill in the missing value manually,
(3) Fill in it automatically with Mean, Mode, and Median, and (4) select the most
probable value. In this study the missing values are treated by ignoring the tuple as
60
Figure 3.4: Filling of missing values
61
C. Assign numerical values for categorical data
The categorical attributes in the datasets were converted to numerical values and the
Predictive model for traffic congestion were formulated using sampling the
dataset with SMOTE algorithms, Decision Tree, Random Forest, DNN and LSTM.
After the completion of data preprocessing, the dataset is left with eleven input
attributes and one target attribute. Consequently, training and testing datasets need to
be identified prior to prediction model design. The training datasets were subjected to
two section: first data with SMOTE algorithm while the second was without SMOTE
for the construction of the predictive model. The size of training dataset is an influential
synthetic dataset; where X is the original dataset; x_sythentic is the synthetic dataset
𝑁∗𝐾
𝑇= (3.2)
𝑁−1
62
Where N is number of minority class samples
Decision Tree is used to create model for predicting the value of a target variable
based on input features. Gini impurity metric was used to evaluate the quality of a split
in the traffic congestion predictive model developed. It was used to measure the
dataset acquired. The mathematical model for Gini impurity used for the traffic
Where:
in the Dataset D.
tree prediction. On a different random subset of the training data, each tree in the forest
is trained to evaluate the quality of a split in the traffic congestion predictive model
Y = mode{hk(X)}k =1 (3.4)
Where:
63
D is the dataset of the traffic congestion
network models. Input features were fed into input layer for process analysis. Two
hidden layers were used to transform input features into next levels through weighted
Z = max(0, z) (3.6)
The process continues through all layers until the output layer l:
Where:
in the data and it is used in time series prediction. It consists of forget gate, input gate
and output gate. Forget gate was used to remove unwanted information from the cell
state. Input gate was used to store new information in the cell state while output gate
was used to determine what part of cell state to output in the next time step as the hidden
64
state. ft decides how much of the previous cell state (Ct-1 ) should be passed to the next
Where σ is the sigmoid activation function, W f and bf are the weight and bias
Input features were fed into the cell state through input gate to predict traffic congestion
Output gate is determined based on the updated cell state that passed through tanh as
follows:
ht = O t . tanh(Ct) (3.12)
model for road traffic congestion was done by splitting the dataset into two subsets.
The larger part which is 80% consisting of the training dataset were used to build the
predictive model while the smaller part consisting of 20% dataset were used to validate
the performance of the predictive model. The Simulation was done on Python
The model used 20% test dataset to validate the performance of the predictive
model. The simulation done in this study were evaluated, and the results of the model
65
validation were reported on a confusion matrix. The performance evaluation metrics
were used for evaluating the performance of the predictive model include accuracy,
precision, recall, F1 Score, specificity, execution time for each of the algorithms.
that is defined as the ratio of true positives and true negatives to all positive and negative
observations. The closer the value is to 100% the better the model. In other words,
accuracy tells us how often we can expect our machine learning model to correctly
predict an outcome out of the total number of times it made predictions as shown in
equation 3.14.
(𝑇𝑃+𝑇𝑁)
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 𝑆𝑐𝑜𝑟𝑒 = (𝑇𝑃+𝐹𝑁+𝑇𝑁+𝐹𝑃) ˟ 100% (3.13)
Where:
TP (True Positive): The amount of time the model predicted 1 when the actual value
was 1.
TN (True Negative): The amount of time the model predicted 0 when the actual
value was 0.
FN (False Negative): The amount of time the model predicted 0 when the actual
value was 1.
FP (False Positive): The amount of time the model predicted 1 when the actual value
was 0.
66
3.4.2 Precision
Precision is the number of correct cases returned by the model. The closer the
𝑇𝑃
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = (3.14)
𝑇𝑃+𝐹𝑃
Recall is the number of positives returned by the model. The closer the value is
3.4.4. Specificity
Specificity is the number of negatives returned by the model. The closer the
3.4.5 F1 Score
the precision and recall scores of a model into a single metric to gain a better
Confusion matrix is a table that displays the number of correct and incorrect
the model by comparing its predictions against the actual values. The explanation of
True Positives (TP): It is the case when both actual class & predicted class of data
point is 1.
67
True Negatives (TN): It is the case when both actual class & predicted class of
data point is 0.
False Positives (FP): It is the case when actual class of data point is 0 & predicted
False Negatives (FN): It is the case when actual class of data point is 1 & predicted
Predicted Value
Light LL LM LH
Actual value
Medium ML MM MH
High HL HM HH
Where:
68
3.5 Integration of the LSTM-RNN Model for Road Traffic Congestion into a
This section expounds the methodology for integrating the LSTM-RNN model
for road traffic congestion into a web application. The aim is to provide an accessible
and interactive interface for users to predict traffic congestion. This integration
promotes the deployment of the model by allowing users to input traffic parameters and
receive real-time prediction from the user's end and at the backend for the traffic
a. Framework Selection
was used for its flexibility and simplicity. It permits rapid development of web
ii. HTML and CSS: HTML (HyperText Markup Language) structures the web
pages, while CSS (Cascading Style Sheets) was employed for styling, ensuring
i. Setup: Begins by setting up a Flask project. Install Flask and other necessary
components: the main application script, templates (HTML files), and static
69
iii. Main Application Script (app.py): The script initialized the Flask application
and defined routes for handling user inputs and displaying results.
to structure the web pages. The primary templates include index.html for the
enhance the user experience by validating input and providing instant feedback.
e. Styling the Web Application CSS (styles.css): Used CSS to style the web
seamless blend of deep learning approaches with mobile software development. The
objective is to deploy a robust predictive system for road traffic congestion that operates
interface design, and backend development, all implemented within the mobile
a. Model Serialization and Preparation: The initial step in this integration is the
Python-based deep learning model into a format for the Android application.
i. Model Exportation: After training the model in Python using the Google Colab
environment, the model is serialized using the pickle module. This serialization
serialized model is then saved in a format (e.g., .pkl) that can be transferred to
70
ii. TensorFlow Lite Conversion: To optimize the model for mobile deployment,
the serialized model is converted to TensorFlow Lite (TFLite) format. This step
reduces the model's size and enhances its inference speed on mobile devices.
ensuring that the model retains its predictive accuracy while becoming more
resource-efficient.
(IDE), which offers robust support for Java programming and Android
ii. User Interface (UI) Design: The UI was designed using XML layouts in
iii. Model Inference using TensorFlow Lite: The TensorFlow Lite model was
loaded into the Android application using the TensorFlow Lite Interpreter API,
which allows the application to perform inference. The user input was
environment.
i. Data Storage and Retrieval: The application utilized local storage or a remote
database (e.g., Firebase) to store and retrieve user predictions. This storage
ensures that users can track their past results. The data handling is managed
71
using Android’s Room Persistence Library for local databases or Firebase
required (e.g., for more complex tasks), the Android application communicates
with a Flask backend. The backend can be hosted on a cloud platform, enabling
the Android application and the Flask backend is facilitated using RESTful
APIs over HTTP. JSON is used for data serialization and deserialization during
these exchanges.
Integrating the LSTM-RNN model for road traffic congestion prediction into a
web using Flask, jinja2, and Pickle, while mobile application using Java programming,
and android toolkits offers a practical solution for deploying road traffic congestion
prediction into Web and Android views. This technique ensures usability, accessibility
and provides a platform for users to interact with the model endlessly.
72
CHAPTER FOUR
RESULTS AND DISCUSSION OF FINDINGS
overview of key variables that were used for data analysis. The detailed analysis was
presented in Table 4.1, summarizing the type of attribute, categorical value and
73
Table 4.1: Numerical values for categorical data
74
4.2 Model Formulation
The result of Decision Tree Model as shown in figure 4.1 and Table 4.2.
75
Table 4.2: Result of Decision Tree Model
1 Accuracy 79%
2 Precision 0.7922780624081572
3 Recall 0.7883008356545961
4 F1-Score 0.7892611317349966
5 Specificity 0.7910447761194029
76
4.2.1.1 Discussion on Decision Tree Confusion Matrix
Decision Tree prediction model was built by taking the road network datasets.
Consequently, the model generated confusion matrix as shown in Figure 4.2 and Table
4.3 which could be used to compute performance evaluation metrics. The confusion
matrix showed that out of 134 data classified as predicted value in row 1, 106 was
was classified as high-congestion. It also showed that out of 122 data classified as
confusion matrix showed that out of 161 data classified as predicted value in row 2, 15
while 17 was classified as high-congestion. It also showed that out of 173 data classified
confusion matrix showed that out of 64 data classified as predicted value in row 3, 1
while 48 was classified as high-congestion. It also showed that out of 66 data classified
77
Figure 4.2: Python-based Decision tree confusion matrix
78
Table 4.3: Python-based Decision tree confusion matrix
Predicted Value
Light 106 27 1
Actual value
Medium 15 129 17
High 1 15 48
79
4.2.1.2 Discussion on Decision Tree Prediction Model
The results showed that the Decision Tree had accuracy of 79% which indicated
a good performance of the model. It also had precision of 0.79; recall of 0.79; F1 Score
of 0.79; and specificity of 0.79. The closer the value is to 1, the better the model.
Feeding testing datasets to the Decision Tree prediction model generated the
prediction probabilities of the three congestion levels. Moreover, the bar chat-based
Medium-congestion’, and ‘High-congestion’ were shown in Figure 4.3, Figure 4.4, and
80
Light
120
106
100
80
Actual Value
60
40
27
20
1
0
Light Medium High
Predicted Value
81
Medium
140
129
120
100
80
Actual Value
60
40
20 17
15
0
Light Medium High
Predicted Value
82
High
60
50
48
40
Actual Value
30
20
15
10
1
0
Light Medium High
Predicted Value
83
The probability distribution graph represented the three level congestion predictions in
84
4.2.2 Result of Random Forest Model
The result of Random forest model as shown in Figure 4.6 and Table 4.4.
85
Table 4.4: Result of Random Forest Model
86
4.2.2.1 Discussion on Random Forest Confusion Matrix
Random Forest prediction model was built by taking the road network datasets.
Consequently, the model generated confusion matrix as shown in figure 4.7 and Table
4.5 which could be used to compute performance evaluation metrics. The confusion
matrix showed that out of 134 data classified as predicted value in row 1, 113 was
was classified as high-congestion. It also showed that out of 134 data classified as
confusion matrix showed that out of 161 data classified as predicted value in row 2, 19
while 6 was classified as high-congestion. It also showed that out of 173 data classified
confusion matrix showed that out of 64 data classified as predicted value in row 3, 2
while 46 was classified as high-congestion. It also showed that out of 52 data classified
87
Figure 4.7: Python-based Random forest confusion matrix
88
Table 4.5: Python-based Random forest confusion matrix
Predicted Value
Light 113 21 0
Actual value
Medium 19 136 6
High 2 16 46
89
4.2.2.2 Discussion on Random Forest Prediction Model
The results showed that the Random Forest had accuracy of 82% which
indicated a good performance of the model. It also had precision of 0.83; recall of 0.82;
F1 Score of 0.82; and specificity of 0.84. The closer the value is to 1, the better the
model.
Feeding testing datasets to the Random forest prediction model generated the
prediction probabilities of the three congestion levels. Moreover, the bar chat-based
Medium-congestion’, and ‘High-congestion’ were shown in, Figure 4.8, Figure 4.9, and
90
Light
120
113
100
80
Actual Value
60
40
21
20
0
0
Light Medium High
Predicted Value
91
Medium
160
140 136
120
100
Actual Value
80
60
40
19
20
0
Light Medium High
Predicted Value
92
High
50
46
45
40
35
30
Actual Value
25
20
16
15
10
0
Light Medium High
Predicted Value
93
The probability distribution graph represented the three level congestion predictions in
94
4.2.3 Result of Deep Neural Network Model
The result of Decision Tree Model as shown in figure 4.11 and Table 4.2.
95
Table 4.6: Result of DNN Model without SMOTE
96
4.2.3.1 Discussion on DNN Confusion Matrix
DNN prediction model was built by taking the road network datasets.
Consequently, the model generated confusion matrix as shown in Figure 4.12 and Table
4.7 which was used to compute performance evaluation metrics. The confusion matrix
shows that out of 728 data classified as predicted value in row 1, 725 was actually
classified as high-congestion. It also shows that out of 736 data classified as predicted
shows that out of 126 data classified as predicted value in row 2, 11 was actually
classified as high-congestion. It also shows that out of 112 data classified as predicted
shows that out of 72 data classified as predicted value in row 3, 0 was actually classified
high-congestion. It also shows that out of 78 data classified as predicted value in column
97
Figure 4.12: Python-based DNN confusion matrix
98
Table 4.7: Python-based DNN without SMOTE confusion matrix
Predicted Value
Light 725 3 0
Actual value
Medium 11 109 6
High 0 0 72
99
4.2.3.2 Discussion on DNN Prediction Model
The results showed that the DNN had accuracy of 98% which indicated a very
high performance of the model. It also had precision of 0.98; recall of 0.98; F1 Score
of 0.98; and specificity of 0.97. The closer the value is to 1, the better the model.
generated the prediction probabilities of the three congestion levels. Moreover, the bar
100
Light
800
725
700
600
500
Actual Value
400
300
200
100
3 0
0
Light Medium High
Predicted Value
101
Medium
120
109
100
80
Actual Value
60
40
20
11
0
Light Medium High
Predicted Value
102
High
80
72
70
60
50
Actual Value
40
30
20
10
0 0
0
Light Medium High
Predicted Value
103
The probability distribution graph represented the three level congestion predictions in
was a relatively high probability of Light -congestion and less probability of High-
104
4.2.3.3 DNN Accuracy and Loss graphs
The DNN graph for the accuracy and loss at epoch 1000 without SMOTE for
the Train and validation accuracy as shown in Figure 4.16 and figure 4.17. The Figure
shows that the model was able to predict the congestion accurately.
105
Figure 4.16: DNN Accuracy graph
106
Figure 4.17: DNN Loss graph
107
4.2.4 DNN Model with SMOTE Result
108
4.2.4.1 DNN Accuracy and Loss graphs with SMOTE
The DNN graph for the accuracy and loss at epoch 1000 for the Model with
SMOTE algorithm as shown in Figure 4.18 and Figure 4.19. The figure shows that the
model was able to predict the congestion accurately. The accuracy increases as the
109
Figure 4.18: DNN Accuracy graph with SMOTE
110
Figure 4.19: DNN Loss graph with SMOTE
111
4.2.5 LSTM-RNN Model Result
The Result of LSTM-DNN model as shown in figure 4.20 and table 4.9.
112
Table 4.9: Result of LSTM-RNN Model without SMOTE
113
4.2.5.1 Discussion on LSTM-RNN Confusion Matrix
datasets. Consequently, the model generated confusion matrix as shown in Figure 4.21
and Table 4.10 which could be used to compute performance evaluation metrics. The
confusion matrix shows that out of 728 data classified as predicted value in row 1, 727
while 0 was classified as high-congestion. It also shows that out of 738 data classified
confusion matrix shows that out of 120 data classified as predicted value in row 2, 11
while 0 was classified as high-congestion. It also shows that out of 111 data classified
confusion matrix shows that out of 3 data classified as predicted value in row 3, 0 was
was classified as high-congestion. It also shows that out of 2 data classified as predicted
114
Figure 4.21: Python-based LSTM-RNN confusion matrix
115
Table 4.10: Python-based LSTM -RNN without SMOTE confusion matrix
Predicted Value
Light 727 1 0
Actual value
Medium 11 109 0
High 0 1 2
116
4.2.5.2 Discussion on LSTM-RNN Prediction Model
The results showed that the LSTM-RNN had accuracy of 99% which indicated
a very high performance of the model. It also had precision of 0.99; recall of 0.99; F1
Score of 0.99; and specificity of 0.97. The closer the value is to 1, the better the model.
Feeding testing datasets to the LSTM -RNN prediction model generated the
prediction probabilities of the three congestion levels. Moreover, the bar chat-based
Medium-congestion’, and ‘High-congestion’ were shown in, Figure 4.22, Figure 4.23,
117
Light
800
727
700
600
500
Actual Value
400
300
200
100
1 0
0
Light Medium High
Predicted Value
118
Medium
120
109
100
80
Actual Value
60
40
20
11
0
0
Light Medium High
Predicted Value
119
High
80
72
70
60
50
Actual Value
40
30
20
10
6
0
0
Predicted Value
120
The probability distribution graph represented the three level congestion predictions in
was a relatively high probability of Light -congestion and less probability of High-
121
4.2.5.3 LSTM-RNN Accuracy and Loss graphs
The LSTM-RNN graph for the accuracy and loss at epoch 1000 without
SMOTE as shown in Figure 4.25 and Figure 4.26. The figure showed that the model
122
Figure 4.25: LSTM-RNN Accuracy graph
123
Figure 4.26: LSTM-RNN Loss graph
124
4.2.6 Result of LSTM-RNN Model with SMOTE
125
4.2.6.1 LSTM-RNN Accuracy and Loss graphs with SMOTE
The LSTM-RNN graph for the accuracy and loss at epoch 1000 for the Model with
126
Figure 4.27: LSTM-RNN Accuracy graph with SMOTE
127
Figure 4.28: LSTM-RNN Loss graph with SMOTE
128
4.3 Model Simulation
Model simulation was done using Python programming language to split the
dataset into two subsets. The larger part which is 80% consisting of the training dataset
were used to build the predictive model while the smaller part consisting of 20% dataset
were used to validate the performance of the predictive model. The Simulation was
The model used 20% test dataset to validate the performance of the predictive
model. The performance evaluation metrics used to evaluate the performance of the
predictive model were accuracy, precision, recall, f1 score, specificity, execution time
4.5.1 Accuracy
The results showed accuracy (%) of 79, 82, 98, 99 for Decision Tree, Random
Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural
Network algorithms respectively as shown in Figure 4.29. The accuracy of the LSTM-
RNN algorithm is higher compared to Decision Tree, Random Forest and Deep Neural
Network algorithms for the traffic dataset divided into 80% 20% as shown in Table
4.12.
129
Table 4.12: Accuracy of the Algorithms used
130
Figure 4.29: Comparison of traffic congestion models based on accuracy
131
4.5.2 Precision
The results showed precision of 0.79, 0.83, 0.98, 0.99 for Decision Tree,
Random Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural
Network algorithms respectively as shown in Figure 4.30. The precision of the Long
Short Term Memory Recurrent Neural Network algorithm is higher compared to and
Decision Tree, Random Forest, Deep Neural Network algorithms for the traffic dataset
divided into 80% 20% as shown in Table 4.13. Based on the values of the precision for
the four algorithms which is close to 1 showed that the model prediction was right.
132
Table 4.13: Precision of the Algorithms used
133
Figure 4.30: Comparison of traffic congestion models based on precision
134
4.5.3 Recall
The results showed recall of 0.79, 0.82, 0.98, 0.99 for Decision Tree, Random
Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural
Network algorithms respectively as shown in Figure 4.31. The recall of the Long Short
Tree, Random Forest and Deep Neural Network algorithms for the traffic dataset
divided into 80% 20% as shown in Table 4.14. Based on the values of the recall for the
four algorithms which is close to 1 depicted that the model prediction was right.
135
Table 4.14: Recall of the Algorithms used
136
Figure 4.31: Comparison of traffic congestion models based on recall
137
4.5.4 F1 Score
The results showed F1 Score of 0.79, 0.82, 0.98, 0.99 for Decision Tree, Random
Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural
Network algorithms respectively as shown in Figure 4.32. The F1 Score of the Deep
Neural Network algorithm is higher compared to Decision Tree, Random Forest and
Long Short Term Memory Recurrent Neural Network algorithms for the traffic dataset
divided into 80% 20% as shown in Table 4.15. Based on the values of the F1 Score for
the four algorithms which is close to 1 depicted that the model prediction was right.
138
Table 4.15: F1 Score of the Algorithms used
139
Figure 4.32: Comparison of traffic congestion models based on F1 Score
140
4.5.5 Specificity
The results showed specificity of 0.79, 0.84, 0.98, 0.97 for Decision Tree, Random
Forest, Deep Neural Network and Long Short Term Memory Recurrent Neural
Network algorithms respectively as shown in Figure 4.33. The specificity of the Deep
Neural Network algorithm is higher compared to Decision Tree, Random Forest and
Long Short Term Memory Recurrent Neural Network algorithms for the traffic dataset
divided into 80% 20% as shown in Table 4.16. Based on the values of the specificity
for the four algorithms which is close to 1 showed that the model prediction was right.
141
Table 4.16: Specificity of the Algorithms used
142
Figure 4.33: Comparison of traffic congestion models based on specificity
Source: Field Work (2024)
143
4.5.6 Execution Times
The results showed execution times (secs) of 0.01, 0.45, 415.62, 566.12 for Decision
Tree, Random Forest, Deep Neural Network and Long Short Term Memory Recurrent
Neural Network algorithms respectively as shown in Figure 4.34. With respect to the
execution times, Random Forest algorithm has fastest speed compare to Decision Tree,
Deep Neural Network and Long Short Term Memory Recurrent Neural Network
144
Table 4.17: Execution Times of the Algorithms used
145
Figure 4.34: Comparison of traffic congestion models based on execution times
146
Figure 4.35: Execution time of the algorithms used
147
Having compared the four models, it can be deduced that LSTM-RNN model with
(99%) is more effective and accurate in predicting traffic congestion than Deep Neural
Network (98%), Random Forest (82%) and Decision Tree (79%). The accuracy of
LSTM-RNN and DNN developed in this thesis showed higher predictive rate compared
to the accuracy found in the literature Ramchandra & Rajabhushanam (2021), and
4.6 Results of the Web and Mobile Prototype for Traffic Congestion Predictive
Model
predicting traffic congestion. The interface features a text input box where users
can select 1 or 2 and press 'Submit' button to predict traffic congestion based on
b. User Interaction
The primary interaction element in this prototype is the number input boxes that
users can use to select 1 or 2 on each traffic parameter. The clear and concise
instructions ensure that users understand how to use the tool effectively. Once
the number is entered, users can click the 'Submit' button to predict traffic
prediction.
c. Functional Flow
ii. Prediction Process: Clicking the 'Submit' button initiates traffic congestion
148
iv. Backend Processing: The entered number is sent to the backend, where the
displayed alongside the input text, providing clear feedback to the user.
traffic congestion prediction. The user-friendly interface was designed for ease
drivers. The immediate traffic prediction results offer valuable insights into
drivers’ satisfaction.
149
Figure 4.36: Web-based Prototype Results for Traffic Congestion Prediction
150
4.6.2 Mobile Prototype Result for Traffic Congestion Prediction
platform for predicting traffic congestion. The interface features a text input box
where users can select 1 or 2 and press 'Submit' button to predict traffic
b. User Interaction
The primary interaction element in this prototype is the number input boxes that
users can use to select 1 or 2 on each traffic parameter. The clear and concise
instructions ensure that users understand how to use the tool effectively. Once
the number is entered, users can click the 'Submit' button to predict traffic
prediction.
c. Functional Flow
ii. Prediction Process: Clicking the 'Submit' button initiates traffic congestion
prediction process.
iii. Backend Processing: The entered number is sent to the backend, where the
displayed alongside the input text, providing clear feedback to the user.
traffic congestion prediction. The user-friendly interface was designed for ease
151
drivers. The immediate traffic prediction results offer valuable insights into
drivers’ satisfaction.
152
Figure 4.37: Mobile Prototype Results for Traffic Congestion Prediction
153
Figure 4.38: Mobile Prototype Results for Traffic Congestion Prediction
154
CHAPTER FIVE
5.1 Summary
This study analyzed the effectiveness of two machine learning algorithms and
two deep learning algorithms on traffic dataset collected through mixed research
method. The dataset contains 14 attributes and 4600 instances which were further
divided into 80% for training and 20% for testing. The dataset was used to formulate
predictive models for traffic congestion. The results showed that LSTM-RNN model
to Deep Neural Network (98%), Random Forest (82%) and Decision Tree (79%).
Regarding the precision, the LSTM-RNN model had highest performance of 0.99
compared to Deep Neural Network (0.98), Random Forest (0.83) and Decision Tree
(0.79). With respect to the recall, the LSTM-RNN model had highest performance of
0.99 compared to Deep Neural Network (0.98), Random Forest (0.82) and Decision
Tree (0.79). In terms of F1-Score, the Deep Neural Network model had highest
Decision Tree (0.79). With regards to Specificity, both Deep Neural Network and Long
Short Term Memory Recurrent Neural Network models had highest performance of
0.97 compared to Random Forest (0.84) and Decision Tree (0.79). The Decision Tree
model had fastest execution time of 0.01 secs compared to Random Forest (0.45 secs),
Deep Neural Network (415.62 secs) and Long Short Term Memory Recurrent Neural
Network (566.12 secs). Notably, both DNN with SMOTE and LSTM-RNN with
155
5.2 Conclusion
In this study, two machine learning algorithms (Decision Tree and Random
Forest) and two deep learning algorithms (DNN and LSTM-RNN) were used to build
a predictive model that can be used to predict road traffic congestion in Lagos. The
formulation and simulation of the predictive models were carried out using Python
Google Colab environment. The results showed that the LSTM-RNN model achieved
highest prediction accuracy followed by Deep Neural Network, Random Forest and
5.3 Recommendations
proposed:
a. The model should be integrated into existing traffic policies which capture
monitoring and tracking of information that are associated with factors causing
congestion.
c. The model should be continuously updated and fine-tuned with new data to
traffic congestion.
156
d. The study addressed gaps found in the literature reviewed to forecast the traffic
congestion.
157
REFERENCES
Albon, C. (2018). Machine Learning with Python Cookbook. Practical Solutions from
Almehmadi, A., Bosakowski, T., Sedky, M. & Bastaki, B. B. (2020). HTM based
https://doi.org/10.1145/3416921.3416941
model for traffic prediction in smart cities. 2nd Smart Cities Symposium, March
Alqudah, N., & Yaseen, Q. (2020). Machine Learning for Traffic Analysis: A Review.
559-608.
158
Anzai, Y. (2012). Pattern recognition and machine learning. Published by
Elsevier (2012).
Andrew, M. & Parvathi, R. (2020). Vehicular Traffic analysis and prediction using
https://doi./10.1109@ic-ETITE47903.2020.279
Gothenburg, Sweden.
Ata, A., Khan, M. A., Abbas, S., Khan, M. S. & Ahmad, G. (2020). Adaptive IoT
https://doi/10.1093/comjnl/bxz129
Ata, A., Khan, M. A., Abbas, S., Ahmad, G. & Fatima, A. (2019). Modelling smart
edition. https://otexts.com/fpp2/
Babu, P. T. (2019). Methodologies for Traffic congestion prediction for a Iot based
smart city using machine learning and CNN. Institute of Scholars. Available in
Bandaragoda, T., De Silva, D., Kleyko, D., Osipov, E., Wiklund, U. & Alahakoon, D.
159
computing. In 2019 IEEE Intelligent Transportation Systems Conference
Banks, J., Carson J., Nelson, B. & Nicol, D. (2001). Discrete-Event System Simulation.
Belyadi, H. & Haghighat, A. (2021). Machine learning guide for oil and gas using
Bengio, Y., Courville, A. & Vincent, P. (2013). Representation learning: A review and
cognitive computing: what do these terms mean and how will they impact health
https://doi.org/10.1016/j.arth.2018.02.067
Blip systems (2016). Smart traffic sensors help alleviate traffic congestion in
Switzerland. http://blipsystems.com/smart-sensor-switzerland/
Carleo, G. (2019). Machine learning and the physical sciences. Reviews of Modern
Carl Goves, Robin North, Ryan Johnston & Graham Fletcher (2015). Short term traffic
160
Engineering. 18(4), 4-7.
Chollet, F. (2021). Deep Learning with Python. Second Edition. Published by Manning
Deb, B., Khan, S. R., Hasan, K. T., Khan, A. H., and Alam, M. D. A. (2019). Travel
Drucker, H., Surges, C. J. C., Kaufman, L., Smola, A. & Vapnik V. (1997). Support
Duhayyim, M. A., Albraikan, A. A., Al-Wesabi, F. N., Burbur, H. M., Alamgeer, M.,
https://DOI:10.32604/cmc.2022.022692
EndoCode (2015, April 8). Building a stream processing pipeline with Kafka, Storm
https://endocode.com/blog/2015/04/08/building-a-stream-processing-
pipeline-with-kafka-storm and-cassandra-part-1-introducing-the-
components/.
FHWA (2001). Traffic Flow Theory Revised. A State-of-the-Art Report (2001 revision).
TRB Spec. Rep. 165 Monogr. Traffic Flow Theory, pp. 1-1,12-6.
Fouladgar, M., Parchami, M., Elmasri, R. & Ghaderi, A. (2017). Scalable deep traffic
161
flow neural networks for urban traffic congestion prediction. Proc. Int. Jt. Conf.
10(4)166-168. https://DOI:10.35940/ijeat.D2426.0410421
Inc.
Parametric methods for short-term traffic forecasting in the era of big data. vol.
Hassan, F., Ijaz, A., Ali, M., Afzal, Z. & Arslan, F. (2021). Iot enabled intelligent traffic
He, L., Levine, R. A., Fan, J., Beemer, J. & Stronach, J. (2018). Random forest as a
Hortonworks (2017, June 18). Realtime event processing in Hadoop with Nifi, Kafka
event-processing-nifi-kafka-storm/.
162
http://www.space.com/19794-navstar.html.
Huang, F., Wang, C. & Chao, C. (2020). Traffic Congestion Level Prediction Based on
Inzunza, M. C., Robles, L. H., Mancilla, M. A. & Neri, E. L. (2020). Traffic prediction
Jafar Alzubi, Anand Nayyar & Akshi Kumar (2018). Machine Learning from Theory
Janković, S., Uzelac, A., Zdravković, S., Mladenović, D., Mladenović, S. & Andrijanić,
http://dx.doi.org/10.7708/ijtte2021.11(2).01
Janikow, C. Z. (1998). Fuzzy decision trees: issues and methods. IEEE Transactions
Jiber, M., Mbarek, A., Yahyaouy, A., Sabri, M. A. & Boumhidi, J. (2020). Road traffic
prediction model using extreme learning machine: The case study of Tangier,
163
Jijo, B. T. & Abdulazeez, A. M. (2021). Classification based on decision tree algorithm
for machine learning. Journal of Applied Science and Technology Trends. 2(1),
Kerner, B. S. (2004). The Physics of Traffic. Pulished by Springer, Berlin, New York
20716-0.
semanticscholar.org/CorpusID:1088 99410.
Kong, F., Li, J., Jiang, B., Zhang, T. & Song, H. (2019). Big data-driven machine
e3482. https://doi.org/10.1002/ett.3482
Kumar, V. P. & Sowmya, I. (2021). A review on pros and cons of machine learning
Kyaw, T., Nyein, N. & Zaw, W. (2020). Predicting on-road traffic congestion from
https://doi.org/10.31695/IJASRE.2020.33771
164
Lam, W. H. K., Tang, Y. F., Chan, K. S, & Tam, M. L. (2006). Short-term hourly traffic
33(3), 291-310.
Le, Q. & Schuster, M. (2016). A neural network for machine translation, at production
network-for-machine.html
Li, L., Lin, H., Wan, J., Ma, Z., & Wang, W. (2020). MF-TCPV: A Machine Learning
Li, M., Andersen, D. G., Park, J. W., Smola, A. J., Ahmed, A., Josifovski, V., Long, J.,
Liu, H. & Shetty, R. R. (2021). Analytical Models for Traffic Congestion and Accident
https://doi.org/10.31979/mti.2021.2102
López, G., Quesada, L. & Guerrero, L. A. (2017). Alexa vs. siri vs. cortana vs. google
Majumdar, S., Subhani, M. M., Roullier, B., Anjum, A. & Zhu, R. (2021). Congestion
prediction for smart sustainable cities using IoT and machine learning
https://doi.org/10.1016/j.scs.2020.102500
165
https://hai.stanford.edu/sites/default/files/2020-09/AI-Definitions-HAI.pdf
140-147.
Meena, G., Sharma, D. & Mahrishi, M. (2020). Traffic prediction for intelligent
Record 48199)
Mei, Y., Hu, T. & Yang, L. C. (2020). Research on short-term urban traffic congestion
of the 5th International Conference on Data Mining and Big Data (DMBD), pp.
Mystakidis, A. & Tjortjis, C. (2019). Big data mining for smart cities: predicting traffic
using long short term memory network. International Journal of Scientific &
Naylor, C. D. (2018). On the prospects for a (deep) learning health care system. JAMA.
166
using Designated Neural Network Training Algorithms. International Journal
https://doi:10.18052/www.scipress.com/IJET.20.23
Rahman, F. I. (2020). Short term traffic flow prediction using machine learning - KNN,
SVM and ANN with weather information. International Journal for Traffic and
https://dx.doi.org/10.7708/ijtte.2020.10(3).08
Rajeev, G. L., Nancy, R., Megha, S., John, J. M. & John, N. E. (2021). Traffic flow
prediction using random forest and bellman ford for best route detection.
Rajendran, S. & Ayyasamy, B. (2020). Short-term traffic prediction model for urban
https://doi.org/10.1007/s42452-020-2946-2
2021.2308860
Ramesh, K., Lakshna, A., Renjith, P. N. & Sheema, D. (2021). Smart Traffic Prediction
Ravi, A., Nandhini, R., Bhuvaneshwari, K., Divya, J. & Janani, K. (2021). Traffic
6002.
167
Russell, R. (2018). Machine learning: Step-by-step guide to implement machine
Rzeszótko, J. & Nguyen, S. H. (2012). Machine learning for traffic prediction. Fundam.
Salott, J., Fenet, S., Billot, R., El Faouzi, N. E. & Solnon,, C. (2018). Comparison of
traffic forecasting methods in urban and suburban context. Proc. - Int. Conf.
2:1159 | https://doi.org/10.1007/s42452-020-2946-2
Seymour, L., Brockwell, P. J. & Davis, R. A. (1997). Introduction to Time Series and
nonparametric models for traffic flow forecasting. Transp. Res. Part C Emerg.
Sridevi, K., Ganesan, T., Samrat, B. V. S., Srihari, V. (2019). Traffic Analysis by
7(6S), 2277-3878.
Sun, S., Chen, J. & Sun, J. (2019). Traffic congestion prediction based on GPS
168
Sutton, R. S. & Barto, A. G. (2017). Reinforcement learning: An introduction (2nd ed.).
Swain, P. H. & Hauska, H. (1997). The decision tree classifier: Design and potential.
MA, USA.
Tamir, T. S., Xiong, G., Li, Z., Tao, H., Shen, Z., Hu, B. & Menkir, H. M. (2020).
Traffic congestion prediction using decision tree, logistic regression and neural
Tang, J., Zeng, J., Wang, Y., Yuan, H., Liu, F. & Huang, H. (2020). Traffic flow
8(11), 23-29.
Tao, G., Song, H., Liu, J., Zou, J. & Chen, Y. (2016). A traffic accident morphology
The Royal Society (2017). Machine learning: the power and promise of computers that
learning
Treiber, Martin, Kresting, Arne (2012). Traffic flow dynamics: Data, Models and
169
Verma, S. & Badade, S. (2019). Traffic Prediction Using Machine Learning.
forecasting: Where we are and where we’re going. Transp. Res. Part C Emerg.
Wafa Shafqat, Sehrish Malik, Yung-cheol Byun & Do-Hyeun Kim (2019). A Short
Term Traffic Flow Prediction Based on Recurrent Neural Networks for Road
Wang, P., Li, Y. & Reddy, C. K. (2019). Machine learning for survival analysis: A
Xie, P., Li, T., Liu, J., Du, S., Yang, X. & Zhang, J. (2020). Urban flow prediction from
spatiotemporal data using machine learning: A survey. Inf. Fusion, 59, 1-12.
Yinan, J., Rui, K., Daqing, L., Shengmin, G., & Havlin, S. (2017). Spatiotemporal
Young, S. (2007). Real-time traffic operations data using vehicle probe technology.
Zafar, N. & Ul Haq, I. (2020). Traffic congestion prediction based on Estimated Time
https://doi.org/10.1371/journal.pone.0238200
170
Zhang, T., Liu, Y., Cui, J., Leng, W., Xie, W., & Zhang, L. (2019). Short-term traffic
neural network. ICCS (3), volume 11538 of Lecture Notes in Computer Science,
Zhang, Z., Zhao, Z. & Yeom, D. S. (2020). Decision tree algorithm-based model and
for non peak traffic forecasting. World Acad. Sci. Eng. Technol., 39(3), 242-
248.
Zheng, Y. (2015). Trajectory data mining: An overview. ACM Trans. Intell. Syst.
Zhu, G., Song, K., Zhang, P., & Wang, L. (2016). A traffic flow state transition model
for urban road network based on hidden Markov model. Neurocomputing, 214,
Zupan, J. (1994). Introduction to artificial neural network (ANN) methods: what they
are and how to use them. Acta Chim. Slov., 41(9), 327.
171