You are on page 1of 6

2010 International Conference on Intelligent Network and Computing (ICINC 2010)

Using artificial neural network to estimate average speed of vehicles in rural roads

Abbas Mahmoudabadi
PhD Candidate, Technical and Engineering Faculty, Payam-e-Noor University & General Director of Traffic Safety
Department, Road Maintenance and Transportation Organization, Tehran, Iran
E-mail: mahmoudabadi@phd.pnu.ac.ir

Abstract—Average speed of vehicles, one of the main of lanes have been considered as the major effective
parameters in traffic engineering, has been widely used parameters in traffic capacity analysis. Their results showed
particularly in road and safety equipment designing and road that neural networks can be used as appropriate model
working. In this paper, an artificial neural network model has comparing with linear regression models for analyzing the
been developed for estimating average speed of vehicles in capacity in weaving areas.
rural roads. Road type, day time, traffic volume, and Ngwangwa, Heyns, Labuschagne, and Kululanga [4]
proportion of heavy vehicles have been considered as the utilized an artificial neural network that reconstructs road
major effective parameters for estimating average speed of surface profiles from measured vehicle accelerations for road
vehicles. Assuming at least 85 percent of total deviations is
damage assessment and demonstrated the capabilities of their
remained, principle component analysis technique has been
used to ensure that input variables have not inter-relation. Two
methodology in the presence of noise, changing vehicle mass,
types of regression models, including simple and weighted changing vehicle speeds and road defects.
linear regression models have also been developed and Tong and Hung [5] developed an artificial neural
proposed neural network model has been evaluated by network model for estimating the discharge headway of
comparing the mean square errors with their performances. individual queued vehicle in intersections. By utilizing the
Results showed that artificial neural network with the best back propagation algorithm in training and sensitivity
performance measure (least mean square errors) can be used analysis, they concluded that the neural network model
to estimate the average speed of vehicles regarding to the main performed better than the other models to discharge headway
influential parameters in road traffic engineering. Results also estimates for individual vehicles. Chang and Su [6] also
showed that the performance measure of neural network can showed the same results by developing artificial neural
be improved when a appropriate network is considered. network models for predicting intersection queue. Their
proposed models are capable of providing prediction
Keywords-Estimating models, Average speed, Traffic Volume, accuracy more than 90% at 3 time-steps ahead.
Principle Component Analysis, Artificial Neural Network, Zhang and Forshaw [7] used an artificial neural network
Multiple Regression model for analyzing traffic volume, speed and traffic
direction, where generated data via closed circuit television
I. INTRODUCTION system was considered as input data. They combined model
Traffic parameters are widely used in process of decision and CCTV system and showed that combination of image
making and road designing in urban and rural transportation. processing techniques and neural network based model have
Estimating of traffic parameters is main concern of an appropriate ability to be used for traffic analysis concerns.
researchers because achieving the survey-based parameters is Srinivasan, Sharma, and Toh [8] presented an artificial
an expensive activity. Speed is one of traffic parameters neural network model based on multivariate techniques for
witch is widely used in road traffic planning, so it is vital that incident recognition in freeways. They used data reduction
model must be developed to estimate speed based on techniques for reducing the variables even a non-linear
achievable parameters and minimum errors. model can be used for incident recognition in freeways.
Statistical models have frequently been used in highway Dia [9] developed an object-oriented neural network
safety studies. They can be utilized for various purposes, model for predicting short-term traffic conditions on a
including establishing relationships between variables, section of highway and showed that model is capable of
screening covariates and predicting values [1]. In the recent predicting speed up to 5 minutes into the future with a high
years, artificial neural network has been used to estimate the degree of accuracy of 90 to 94%.
several kinds of traffic parameters. Fallah Tafti [2] used an Traffic parameters have complicated effects in speed that
artificial neural network model to simulate traffic flow in the drivers chose to drive vehicles [10]. This characteristics and
vicinity of merges and estimate the average time of journey. the concept behind of neural network modeling known as
Based on the good results in validation process, he suggested black box are the same so speed may be results of some
that artificial neural network models can be used to parameters which have direct or indirect effects in each other
validation of performance in different purposes. via linear or non-linear models [10].
Wa’el and Awad [3] developed a neural network model Conductive loops are widely used for data gathering in
for estimating the traffic capacity in weaving areas. urban and rural road and comparing their stored data and the
Geometric design, speed, length, traffic volume, and number results of output models would be considered in validation
process of developing traffic models because conductive

978-1-4244-8270--2/10/$26.00©2010 IEEE V1-25


2010 International Conference on Intelligent Network and Computing (ICINC 2010)

loops have appropriate role in data gathering for traffic when independent variables X1, X2, . . . Xn and dependent
measures [11]. Because collecting reliable length data from variable Y are defined as equation (2) shows.
single and dual loop detectors has been considered
impossible due to the noisy speed estimates provided by
conventional data aggregation at single-loop detectors, Y = β0 + β1 X1P1 + β2 X2P2 + β3 X3P3 + ...+ βn XnPn (2)
Coifman and kim [12] presented a methodology to use
In equation (2) coefficients β0, β1, β2, β3 . . . and βn and p1,
single-loop detector to classify vehicles and speed estimation
p2, p3… and pn are being estimated regarding to the
in freeways.
minimizing the mean or total square errors between
In this paper, an artificial neural network model has been observations and the model outputs.
developed to estimate the average speed of vehicles, in
which traffic volume, daytime, road geometric design, and C. Artificial neural network model
the proportion of heavy vehicles are considered as input In the neural network model, the neuron is the basic
variables. Because neural network models have a sensitive component [16]. Each neuron of a layer is connected to each
reaction regarding to training data [13], a data analyzing has neuron of the next layer from the input layer to the output
been proposed to check the validity of model based on layer through the hidden layers as shown in figure 1 [16].
different set of training, validation, and testing data. Principle In this structure the output Yi of each neuron of the nth
component analysis, a well-known statistical technique, has layer is defined by a derivable non-linear function F by
also been used to be confident that input variables do not equation (3) where F is the non-linear activation function, wji
have inter-relations. %85 of variation had been considered to are the weights of the connection between the neuron Nj and
be remained and existing of all variables in proposed models Ni, yi is the output of the neuron of the (n−1)th layer [16]. The
has been checked. Two kinds of widely used statistical most common used of validation criteria is mean or sum
models including simple and weighted linear regression square errors between observations and model outputs.
models have been developed to validate the performance of
proposed neural network model.
II. ESTIMATING MODELS
There are various kinds of models that are used for
estimating parameters in road safety. Regression models are
known as common, because of simplicity. In this section a
brief discussion of simple and weighted linear regression and
artificial neural network models are presented.
A. Simple linear regression

Minimizing the mean square errors between observations Figure 1. General view of neural network model
and model outputs is the main concern behind the setting
parameters of simple linear regression models [14]. Two
kinds of variables including independent and dependent ⎛ ⎞
variables are used in modeling named multivariate linear y i = F ⎜⎜ ∑w ji y j ⎟⎟ (3)
regression mode if there are more than one variable as ⎝ j ⎠
independent variables [14]. Therefore, model set relationship
between independent variables X1, X2, . . . Xn, and dependent III. DATA GATHERING
variable Y by the equation (1). In the equation (1),
Input data including average speed, traffic volume, road
coefficients β0, β1, β2, β3 . . . and βn must be set based on
geometric design, daytime, and proportion of heave vehicles
minimizing the mean square errors between observations and in 461 days have been gathered in different months and
model outputs. different topography. Freeway, highway, and main road are
three types of geometric design roads are considered as input
Y = β 0 + β1 X 1 + β 2 X 2 + β 3 X 3 + ... + β n X n (1) parameters 1, 2, and 3 respectively. Daytime has been
calculated based on the length of day from sunrise to sunset
B. Weighted Regression model divided to 24. Traffic volume, the proportion of heavy
vehicles, and average speed of vehicles have been collected
When it is considered that the effects of independent via conductive loops installed in rural roads.
variables on dependent variable are power-based, the model A. Normalized Data
called weighted linear regression. Parameters are being
Data have been converted to normal type by equation (4),
calculated based on the minimum of mean or total square
which is commonly used to normalize data, where n is the
errors between observations and model outputs [15]. It is number of observations [17]. The above equation convert
obvious that multivariate regression model can be defined data in to a closed interval of [0 1]. Tables I and II

V1-26
2010 International Conference on Intelligent Network and Computing (ICINC 2010)

respectively show the experimental and normalized data of x i ( old ) - x


all variables that are considered in modeling process. As x i ( new ) = (5)
n
shown in table II, the minimum and maximum of standard
types of all variables zero and one respectively. ∑(x i - x)
2

i =1

xi ( old ) xi (min) n -1
xi ( new ) = (4)
xi (max) xi (min) Table III shows the standardized data which have been
converted from original data by equation (5).
TABLE I. EXPERIMENTAL DATA
TABLE III. STANDARDIZED DATA
Variable Experimental Data
Variable Normalized Data
Max. Min. Mean STD
Max. Min. Mean STD
Road Type (R_T) 3 1 1.99 0.816
Road Type (R_T) 1.237 -1.216 0 1
Day Time (D_T) 0.617 0.424 0.518 0.071
Day Time (D_T) 1.396 -1.316 0 1
Traffic Volume (T_V) 59768 800 9793 6356
Traffic Volume (T_V) 7.862 -1.415 0 1
Heavy Vehicle (H_V) 0.72 0.015 0.259 0.154
Heavy Vehicle (H_V) 2.993 -1.576 0 1
Average Speed (A_S) 111 22.5 85 12.6
Average Speed (A_S) 2.057 -5.029 0 1
TABLE II. NORMALISED DATA B. Eigenvalues
Variable Normalized Data Calculating eigen-values is the second stage of PCA.
Max. Min. Mean STD Each score has specific eigen-value ordered descending
Road Type (R_T) 1 0 0.496 0.408 shown in table IV. PCs are uncorrelated so if 85 percent of
Day Time (D_T) 1 0 0.485 0.369
variation is assumed to be remained PC1, PC2, and PC3 with
Traffic Volume (T_V) 1 0 0.153 0.108
Heavy Vehicle (H_V) 1 0 0.345 0.219 cumulative percent of deviation more than eighty five
Average Speed (A_S) 1 0 0.710 0.141 percent, must be considered to the next stage of PCA process
and PC4 can be ignored.
IV. PRINCIPLE COMPONENT ANALYSIS
TABLE IV. PRINCIPLE COMPONENTS
Principle component analysis (PCA) is a statistical
process categorized in data reduction techniques. The PCs Score
Eigen- Variation Cumulative
are the uncorrelated (orthogonal) variables, obtained by value percent percent
PC1 1.9606 49% 49%
multiplying the original correlated variables with the
PC2 1.0220 25% 74%
eigenvector, which is a list of coefficients [17]. Thus, the PC3 0.7864 20% 94%
PCs are weighted linear combinations of the original PC4 0.2310 6% 100%
variables. It is a powerful technique for pattern recognition
that attempts to explain the variance of a large set of inter- C. Loading
correlated variables and transforming into a smaller set of The simple correlation between original variables and
independent (uncorrelated) variables (principal components). scores, is loading [17]. As shown in table V, correlation
Factor analysis further reduces the contribution of less between traffic volume (T_V) and the first score is high,
significant variables obtained from PCA and the new group means that variation of traffic volume is more influential in
of variables, known as vari-factors, is extracted through the first score.
rotating the axis defined by PCA [18]. Selecting the first n
PCs is regarding to eigen-values grater than one or obtaining TABLE V. LOADING
enough deviations mostly 85 percent of whole deviations
Score PC1 PC2 PC3
[17]. The high proportion of deviation, consist of large R_T 0.8795 -0.1882 -0.2898
dimensioned variables, so variables should be homogenous D_T 0.5410 0.9791 -0.1864
in the process of PCA [18]. In this paper, standardized data is Variable
T_V 0.9123 0.0149 -0.2211
used for analyzing the PCA process. L_V -0.5932 -0.1668 -0.7866

A. Standardizing data D. Extracting variables


As it is mentioned briefly in the last section, in PCA Extracting variables, last stage of principle component
analysis, dimension of variables must be homogenous. analysis, is based on loadings that are shown in table V. In
Standardizing data is one of the well known methods to this stage Selected PCs must be considered with loading
homogenize data in normal function. Equation (5) converts either more than 0.7 or less that -0.7 [18]. For the first PC it
original data in different dimension to normal distribution can be concluded that variables R_T and T_V must be
function with the average of zero and standard deviation of considered as input variables, by considering PC2 variable
one, where x(new) is standardized data and x(old) is original D_T, by considering the PC3 variable L_V would be added
data. to inputs. In this case it is concluded that all of the variables
R_T, D_T, T_V, and L_V must be considered as input
variables. All of desired loading in table V, which have been

V1-27
2010 International Conference on Intelligent Network and Computing (ICINC 2010)

used in decision process are shown in bold marked style. It is Figure 2. Structure of Artificial Neural Network
concluded that all input variables must be considered as
input variables by considering at least 85 percent of In order to evaluate the model, four structures of
variations. networks with different numbers of neuron in hidden layers
have been analyzed. Four structures including (4-4-1-1), (4-
V. DEVELOPING OF THE MODEL 5-1-1), (4-6-1-1), (4-8-1-1) have been analyzed and (4-8-1-1)
As mentioned briefly in section II.C, the neural network structure is the best one based on mean square errors.
model is consisting of input layer, hidden layer, and output
TABLE VI. CATEGORIZING DATA
layer. In this case, with three input and one output variables,
neural network model must be formed of three neurons in Sample Sample Size (Percent)
input and one neuron in output layer. Hidden layer will be Code Training Validation Testing
different based on the number of observation. If it’s assumed A 323(70) 69(15) 69(15)
B 369(80) 46(10) 46(10)
that the number of observation should not be exceeded than C 415(90) 23(5) 23(5)
ten times of necessary parameters, the maximum number of
hidden neurons in model was calculated as 8. Well-known The numbers of data that are assigned in each category of
software of MATLAB has been used for modeling. Figures 2 training, validating, and testing process have significant
shows artificial neural network model of average speed of effect in the process of model development and network
vehicles and five times of running models have been measures [19]. Three types of categorizing data defined as
considered with stop criteria of 1e-5. sample codes A, B, and C shown in table VI have been
considered in data analysis. The proposed model has been
run five times, using different sample size and network
structure and the average of two criteria measures of
correlation coefficient and mean square errors have been
calculated and shown in table VII.

TABLE VII. MEAN SQUARE ERRORS AND CORRELATION COEFFICIENT


Network Sample Correlation Coefficient Mean Square Error (e-4) Iterations Stopping
Structure Code Train Validate Test Train Validate Test Iteration
A 0.943 0.956 0.931 22 18 28 39 33
4-4-1-1 B 0.963 0.957 0.888 14 30 37 59 59
C 0.917 0.867 0.944 32 53 15 24 18
A 0.980 0.958 0.936 8 12 26 37 31
4-5-1-1 B 0.983 0.976 0.951 6 21 18 64 59
C 0.968 0.899 0.961 13 16 16 12 6
A 0.983 0.954 0.962 7 11 12 25 19
4-6-1-1 B 0.974 0.980 0.980 16 12 9 12 6
C 0.960 0.945 0.943 15 20 38 14 8
A 0.990 0.915 0.963 4 57 15 23 17
4-8-1-1 B 0.970 0.950 0.977 10 30 14 15 9
C 0.972 0.984 0.971 14 7 17 12 6
4-8-1-1 Total 0.9889 4.4 16 10

According to the measures in table VII, it can be


concluded that if the number of neurons in hidden layer is
increased, the number of iterations will be decreased and
network parameters will be improved. When there is no
improvement in mean square errors, iterative calculations are
stopped and network is reached in steady state. Network
measures in three stages of training, validation, and testing
have a reverse behavior depending on the number of data in
each category. It means that network measures will be
improved (mean square errors will be decreased and
correlation coefficient is getting to be close of one) when the
number of data in each category is increased. Figure 3
illustrates a kind of improvement process when mean square
errors have not improvement after 6 iterations.
Figure 3. Stopping Iteration After 6 Iterations

V1-28
2010 International Conference on Intelligent Network and Computing (ICINC 2010)

A. Fitness measure of observations and model outputs VII. COMPARING THE MODELS
In order to check the fitness measures between Mean square errors measure is one of the most applicable
observations and model outputs, four kinds of regression measures which can be used to compare the efficiency of
equations training, validation, test, and all data models can prediction models [14]. Mean square errors have been
be analyzed. Results show that the four equations 6 to 9 calculated in different types of models and results showed in
represent the compatibility between experimental data and table VIII.
model outputs, which O = output and T = target.
TABLE VIII. MEAN SQUARE ERRORS
Training: O = 0.92 × T + 0.057 R = 0.963 (6)
Model Mean Square errors (e-4)
Artificial Neural Network 4.4
Validation: O = 0.92×T + 0.055 R = 0.976 (7) Simple Linear Regression 1316.2
Weighted Linear Regression 145.5

Test : O = 0.96 × T + 0.034 R = 0.98 (8) Results in table VIII show that artificial neural model is
the best model with minimum mean square errors as 4.4e-4
and weighted and simple regressions follows that on the
All : O = 0.93 × T + 0.054 R = 0.967 (9) second and third step respectively.
The coefficients between outputs and observation are VIII. SUMMARY AND CONCLUSION
more than 0.85 and distance from origin is less than 0.05, in
all linear regression models based on standardized data, so Because of wide application of average speed in road
the compatibility of data and model is good enough. designing and safety equipments, in this paper an artificial
neural network model has been developed based on effective
VI. REGRESSION MODELS parameters data, which collected in 461 days in different
Proposed model can be validated with the other models, roads and different months. Four main parameters including
which may be used for prediction. Simple and weighted road geometric type, daytime, traffic volume, and proportion
linear regression models have been selected for validation of heavy vehicles have been considered as input and average
and well-known software of MATLAB was used for speed of vehicles as output and data have been converted to
generating fitness equations. Input and output variables are closed interval [0 1]. By assuming at least 85 percent of total
defined as below: deviations must be remained, principle component analysis
technique has been used to ensure that input variables have
R_T: Road geometric design (Road type)
not inter-relation and results show that four assumed variable
D_T: Daytime
must be considered as input variables in modeling. Mean
T_V: Traffic volume square errors has been considered as criteria measure for
L_V: Proportion of heavy vehicles evaluation and artificial neural network has been evaluated
A_S: Average speed of vehicles with simple and weighted linear regression models and
The simple and weighted linear regression models are results show that artificial neural network has the best
fitted as equations (10) and (11) respectively. performance in estimation of average speed. It can be
A_S= 0.5995 + 0.0913*R_T + 0.0307*D_T - 0.2150*T_V - concluded that road type and daytime have direct effects in
0.1366*L_V (10) average speed means that when the grade of road improved
to the next level, average speed will be increased and vice
versa. Traffic volume has reverse effect, means that when
A_S= 0.3992 + 0.5080*(R_T)0.052 + 0.1491*(D_T)0.0442 -
traffic volume is getting to raise average speed will be
0.0652*(T_V)1.3581 - 0.3310*(L_V)9.2510 (11)
decreased and vice versa. The proportion of heavy vehicle
In the equation (10), when power coefficient is getting to traffic has a reverse effect in average speed of vehicles
raised means the effect of input variable is low because all means that when it is increased the average speed will be
data is set in closed interval [0 1] so it means that the decreased. Results show that artificial neural network model
proportion of heavy vehicles in traffic volume has not can be applied for prediction of average speed with a
significant effect on average speed. Road type and daytime significant compatibility. For the further studies, it can be
have direct effects in average speed means that when the suggested that researchers should be focused on the other
grade of road improved to the next level, average speed will parameters influencing on average speed such as level of
be increased and vice versa. Traffic volume has reverse enforcement and roadside facilities located near the roads.
effect, means that when traffic volume is getting to raise
average speed will be decreased and vice versa. The REFERENCES
proportion of heavy vehicle traffic has a reverse effect in [1] X. Yuanchang, L. Dominique, Z. Yunlong, “Predicting motor vehicle
average speed of vehicles means that when it is increased the collisions using Bayesian neural network models: An empirical
analysis”, Accident Analysis & Prevention, Volume 39, Issue 5,
average speed will be decreased. September 2007, Pages 922-933
[2] M. Fallah-Tafti “The application of artificial neural networks to
anticipate the average journey time of traffic in the vicinity of

V1-29
2010 International Conference on Intelligent Network and Computing (ICINC 2010)

merges” Knowledge-Based Systems, Volume 14, Issues 3-4, June [11] Z. Xiaoyan, J. A. Rice, “Short-term travel time prediction”,
2001, Pages 203-211. Transportation Research Part C: Emerging Technologies, Volume 11,
[3] H. Wa’el, Awad, “Estimating traffic capacity for weaving segments Issues 3-4, June-August 2003, Pages 187-210.
using neural networks technique”, Applied Soft Computing, Volume [12] B. Coifman, S. Kim, “Speed estimation and length based vehicle
4, Issue 4, September 2004, Pages 395-404. classification from freeway single-loop detectors”, Transportation
[4] H.M. Ngwangwa, P.S. Heyns, F.J.J. Labuschagne, G.K. Kululanga, Research Part C: Emerging Technologies, Volume 17, Issue 4,
“Reconstruction of road defects and road roughness classification August 2009, Pages 349-364,
using vehicle responses with artificial neural networks simulation, [13] H.B. Gelihoglu, H. Gigizoglu, “Modeling pubic transport trips by
Journal of Terramechanics” Article In Press, Available online 15 radial basis function rural networks”, Mathematic and computer
October 2009 modeling, Number 15, 2007.
[5] H.Y. Tong, W.T. Hung, “Neural network modeling of vehicle [14] P.G. Hoel, "Elementary Statistics", Fourth Edition, Published by John
discharge headway at signalized intersection: model descriptions and Wiley, Sons, Inc., New York, 1976.
results”, Transportation Research Part A: Policy and Practice, [15] G.A.F. Seber, C. J. Wild, “Nonlinear Regression”, John Wiley &
Volume 36, Issue 1, January 2002, Pages 17-40 Sons Inc., 1989.
[6] G.L. Chang, C.C. Su, “Predicting intersection queue with neural [16] H.B. Celikoglua, H.K. Cigizoglub, “Modelling public transport trips
network models”, Transportation Research Part C: Emerging by radial basis function neural”, Networks, Mathematical and
Technologies, Volume 3, Issue 3, June 1995, Pages 175-191 Computer Modelling 45 (2007) pp. 480–489
[7] Zu. Zhang, M.R.B. Forshaw, “A parallel algorithm to extract [17] S. Sharma, “Applied Multivariate Techniques”, Published by
information about the motion of road traffic using image analysis”, University of South Carolina, 1996.
Transportation Research Part C: Emerging Technologies, Volume 5,
Issue 2, April 1997, Pages 141-152. [18] K.P. Singha, A. Malika, D. Mohana, S. Sinhab “Multivariate
statistical techniques for the evaluation of spatial and temporal
[8] D. Srinivasan, V. Sharma, K.A. Toh, “Reduced multivariate variations in water quality of Gomti River (India) a case study”,
polynomial-based neural network for automated traffic incident Water Research 38 (2004) pp. 3980–3992
detection”, Neural Networks, Volume 21, Issues 2-3, March-April
2008, Pages 484-492. [19] Y., Chiou “An artificial neural network-based expert system for the
appraisal of two-car crash accidents”, Accident Analysis &
[9] H. Dia, “An object-oriented neural network approach to short-term Prevention, Volume 38, July 2006.
traffic forecasting”, European Journal of Operational Research,
Volume 131, Issue 2, 1 June 2001, Pages 253-261
[10] D. Delen, R. Sharda, M. Bessonov, “Identifying significant predictors
of injury severity in traffic accidents using a series of artificial neural
networks”, Accident analysis and prevention, Volume 38, May 2006.

V1-30

You might also like