Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Available online at www.sciencedirect.

com

ScienceDirect
Procedia Computer Science 73 (2015) 24 – 31

The International Conference on Advanced Wireless, Information, and Communication


Technologies (AWICT 2015)

Real-time detection of vehicles using the haar-like features and


artificial neuron networks
ATIBI Mohameda,ATOUF Issama,BOUSSAA Mohameda, BENNIS Abdellatifa
a
Laboratory of information processing, Hassan II ̢ Casablanca University Cdt Driss El Harti, BP 7955 Sidi Othman Casablanca, 20702,
Maroc

Abstract

In this document, a vehicle detection system is presented. This system is based on two algorithms, a descriptor of the image type
haar-like, and a classifier type artificial neuron networks. In order to ensure rapidity in the calculation extracts features by the
descriptor the concept of the integral image is used for the representation of the image. The learning of the system is performed
on a set of positive images (vehicles) and negative images (non-vehicle), and the test is done on another set of scenes (positive or
negative). To address the performance of the proposed system by varying one element among the determining parameters which
is the number of neurons in the hidden layer; the results obtained have shown that the proposed system is a fast and robust
vehicle detector.

©©2015
2015TheTheAuthors.
Authors. Published
Published by by Elsevier
Elsevier B.V.B.V.
This is an open access article under the CC BY-NC-ND license
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
Peer-review under responsibility of organizing committee of the International Conference on Advanced Wireless, Information,
Peer-review under responsibility
and Communication of organizing
Technologies (AWICTcommittee
2015). of the International Conference on Advanced Wireless, Information,
and Communication Technologies (AWICT 2015)
Keywords: vehicle detection, haar like features, the integral image, artificial neuron networks.

1. Introduction

Road safety is the set of measures to prevent road accidents or mitigate their consequences. While many passive
systems (seat belts, airbags, laminated glass …) and assets (ABS, ESP, Sips, LSD ...) were planned and led to avoid
or reduce the consequences of accidents, other more intelligent driver assistance systems can also contribute to
finding solutions for the prevention of road safety. In doing so, the study of intelligent systems constitutes an area
that requires technical and highly advanced image processing algorithms to extract useful information to provide a
driving assistance1. It is also a very active area of research that aims to reduce the number of road accidents2. The

1877-0509 © 2015 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
Peer-review under responsibility of organizing committee of the International Conference on Advanced Wireless, Information, and Communication
Technologies (AWICT 2015)
doi:10.1016/j.procs.2015.12.044
ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31 25

objective of these techniques and algorithms is to provide information to the driver on the state of the environment,
the location and distance between other vehicles, traffic signs and other road users3.
The vehicle detection is essential in intelligent systems that aims to detect potentially dangerous situations with
vehicles in advance to warn the driver4. Different types of sensors, such as ultrasonic sensor, a laser scanner and a
camera, have been used to detect vehicles in the literature5. Active sensors such as radar can operate in different
environments, but they are unable to distinguish between the various obstacles (car, pedestrian and cycling). Thus
the cameras are adapted to detect the automobiles because they are similar to the human visual perception system
and provide rich information for applying pattern recognition techniques such as the case of the artificial neural
networks6.
All vehicle detection systems aim to detect the presence of one or more cars in a complex digital image from a
CCD camera. And this goal is a difficult task considering the complexity of the outdoor scenes (environment) and
their constraints7.
In the literature, several image processing algorithms have been used for the detection of vehicles, among others,
citing HOG transformed3 and haar like features8 that are used in computer vision to detect objects in digital images.
This paper presents a robust and fast vehicle detection system, which combines two algorithms, the first is an
image processing algorithm and the second is an algorithm of artificial intelligence. The image processing algorithm
aims to extract the features of a vehicle using the descriptor haar, and the algorithm of artificial intelligence uses
artificial neural networks to classify and detect these vehicles.
This paper is a contribution in the field of intelligent detection vehicles. The first contribution is the use of the
concept of the integral image for the calculation of haar like features. The second is the use of artificial neural
networks as being a classifier with the Haar features. And the third is to present a thorough analysis of the
performance of this system.
The paper is divided as follows. The following section presents previous research on the detection of the vehicle.
Section 3 describes in detail the descriptor and the classifier that we have studied and its combination. Various
experimental results are presented and analyzed in Section 4. The last section is devoted to the conclusion.

2. Related work

Until now, many researchers have proposed vehicle detection algorithms. A trivial solution for vehicle detection
is the exhaustive search of all possible positions in the processed image. But this solution remains unsatisfactory for
applications necessitates a calculation speed3 To solve this problem many researchers have proposed robust and fast
algorithms for detecting vehicle; these algorithms have an attentional process that can be divided into two stages9:

x Learning: this step consists in learning the class features of the vehicle from a set of images. Each image of the
training is represented by a10 feature vector extracted by an image processing algorithm. A classifier is trained to
estimate the class of vehicles and not vehicles.
x the detection: this step consists in cutting the original image into zones and then extract the feature vector of each
zone with the same algorithm used during the learning phase 11, Finally using the same classifier that will detect
as role, this time, the presence of the vehicle in the treated area image or not.

Among the most known systems for detecting objects, one proposed by Viola and Jones8, which consists in
extracting the haar like features12,13 and to cascade a set of called weak classifiers to construct a strong classifier,
forming a boosting algorithm named.
In14, the authors used a 2 step approach for the detection of vehicle. The first step is to find the shadow areas of
the vehicle in the lower part by applying Haar algorithm and as AdaBoost classifier. The second step consists of
applying the combined treatment of regions of interest with HOG and SVM algorithm as the classifier to verify the
presence of the vehicle and then use the K-means algorithm to increase the detection rate.
In4, the authors proposed a comparative study of two image processing algorithms: haar like features and the
histograms oriented gradient (HOG). The classifier used in this article was AdaBoost. This method gives very
satisfactory results.
26 ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31

And in3, the same authors have proposed a comparative study of three image processing algorithms: haar like
features, the oriented gradient histograms (HOG) and fusion to improve the system before with the same classifier.
The results of this study show that the merger between the two algorithms allowed combining their respective
advantages.
In15, the authors present a general framework for active learning for robust recognition and tracking of road
vehicles. Using the supervised learning algorithm applied with a particle filter, the results of experiments showed a
strength when the recognition and tracking of vehicles.

3. The vehicle detection system proposed

This section is devoted to the description of the proposed vehicle detection system. This system is composed of
two parts: learning section and detection section.
The learning section is done in two phases:
Extraction phase of the features for learning:
During this phase a descriptor based on haar wavelet8 extracted for each image in the training set, a feature
vector. This database contains a set of positive images fig.1.a (with car) and negative fig.1.b (no vehicle) gray scale.
The vector characterizing the image size depends on the size of the window used in the extraction3.
Learning phase:
The vectors from the first phase form a basis for training a learning algorithm of an artificial neural network. The
architecture of the selected artificial neural network is the multilayer perceptron which has proved robust and fast
results in various applications in the field of signal processing and image.

a b

Fig. 1. (a) Positive images; (b) negative images

The detection part includes two phases:


Extraction phase of the features for detection:
For any test image that contains or not the vehicles, a sliding window having the same size as that used in the
feature extraction phase for learning, divides this picture thumbnails. The descriptor Haar is used then to extract the
feature vector of each image to form base test vectors of the original image.
Detection phase:
An artificial neural network, trained before, will attend to classify all the thumbnails in areas that represent the
vehicle or areas that do not represent them.
The following two diagrams show the overall system fig.2 and fig.3.
ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31 27

Fig. 2. The diagram of the learning phase

Fig. 3. The diagram of the detection phase

3.1. Haar like features

Haar like features or rectangular filter haar provide information about the distribution of the gray levels of two
adjacent regions in an image16 fig.4.

Fig. 4. Examples of the haar like features

The first step in calculating haar features is the use of the concept of the integral image eq.1 introduced by Viola
and Jones, which gives a representation of an input image and reduces the computation time of these features. The
speed of the integral image in the calculation shows a rectangular sum using only four references, then the
difference between two adjacent rectangles, can be calculated with only six references and eight for three
rectangles17.
ii( x, y) ¦
x d x ', y d y '
i( x ', y ')
(1)
With:
ii( x, y) Is the integral image.
i( x, y) Is the original image.
Then the use of the two equations allows calculation of haar windows at various scales in an image:
28 ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31

s( x, y) s( x, y  1)  i( x, y)
ii( x, y ) ii ( x  1, y )  s( x, y) (2)

With s( x, y ) denotes the cumulative sum of the line and s( x, 1) ii(1, y) 0 .
Our approach is to use only 2 rectangular filters (horizontal and vertical) at different scales: 2x2, 4x4, 8x8 and
16x16. Details of the image are filtered while retaining the most important edges as the filter size is doubled. The
resulting assembly Haar like features using the two rectangular filter is shown in an image 24x24 pixels is 8712
fig.5.

Fig. 5. Extraction of haar features using the 2 rectangular filters (horizontal and vertical)

These vectors sizes of 8712 are the vectors input in the learning and detection process for the artificial neural
network; either for the size of 24x24 learning images or the thumbnail images extracted from the test image.

3.2. The artificial neural network

The artificial neural network is a treatment process of information that is inspired by the way biological nervous
systems, such as the brain, treat information17. This process is based on a large number of units of treatment called
neuron. These neurons interconnect with each other to form architecture for a specific application such as pattern
recognition (classification) or control. These neurons are based on an activation function to ensure the non-linearity
in the network; the most used activation function is the sigmoid function.
In order that the artificial network of neurons operates for any application of artificial intelligence domain, a
learning process is required. This process involves adjusting the connection weights between neurons called
synaptic weights. The architecture of artificial neural network, the most used in the literature, is the architecture of
multilayer perceptron MLP fig.6 to be adopted in our vehicle detection system. This architecture uses, in addition to
the input and output layer, intermediate layers called hidden layer18.

Fig. 6. Architecture of the MLP

The architecture uses multilayer perceptron learning algorithm as the retro error propagation (Back pro) which
simulates the learning phenomenon by the error. The Back Pro algorithm is to initialize the values of synaptic
weights randomly, then successively present the elements of the training base at the entrance of the network, in
order to evaluate the error for each element observed at the output of each neuron. The value of this error will be
useful for adjusting the connection weights between neurons in order to minimize the overall error by the gradient
descent method19.

E(n) = σ௝‫א‬஼ ሺ݆݀ሺ݊ሻ െ ‫݆ݕ‬ሺ݊ሻሻ2

(3)
ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31 29

In our application, the artificial neural networks of the multilayer perceptron type have been used for learning and
for the detection of vehicles. The network learns the various scenes (vehicles or not vehicles) from the data set (the
training set) and then generalizes their learning to detect vehicles in the test image.

4. Experimental results

The database used to evaluate the performance of our detection system is composed of:

x The set of positive images: the positive database contains 550 examples. The examples consist of different cars
and different side views fig.7. Increasing number of examples reduces the overall error in learning artificial
neural network and increases the detection rate.

Fig. 7. The positive database

x The set of negative images: consisting of negative random examples fig.8. The number of these examples is 500
frames that do not contain vehicles. During the learning phase, the image size is set to 24x24 used for positive
and negative examples in order to extract the same size vectors that will be the input of neural network during the
learning phase.

Fig. 8. The negative database

x The test database: composed of 20 images containing 26 cars side view on a different scale fig.9, the test images
are 64x64 sizes. This test base comes with an associated ground truth for the automatic calculation of the correct
detection rate and false alarm rate20.

Fig. 9. The test database

As already detailed in section III, the detection system is divided into two parts:

x The learning part: the artificial neural network receives the 1050 positive and negative examples to its entry; each
example is characterized by a vector of size 8712 descriptor haar like. During the learning of the artificial neural
network, two essential criteria are used to indicate the end of this process: decreasing the overall error and the
maximum number of iterations reached.

x Detection phase: the network is ready to detect vehicles contained in the test images. A sliding window in the test
images can cut image thumbnails that have the same size as the images of the learning base 24x24. Descriptor
haar extracted from each thumbnail 24x24 a feature vector composed of 8712 parameters. The artificial neural
network processes each vector and is in the end a decision whether or not the vehicle in the corresponding
thumbnail to vector fig.10. To optimize the detection result and avoid duplication windows detects the same
30 ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31

vehicle; a fusion method is proposed to merge the overlapping windows as the distance between two windows.
This method has eliminated similar detections and detects vehicles at different levels, beginning with the small
size 24x24 to identify the optimal view of the vehicle fig.11.

Fig. 10. The detection result

Fig. 11. The fusion result

To illustrate the performance of the detection system, and make a comparison according to various parameters,
we have adjusted one of the most interesting parameters of the artificial neural network that matches the number of
neuron in the hidden layer. It is then, extracting the overall error, the execution time, the good detection rate; namely
that the rate of correct detections is the percentage of vehicles with properly on all vehicles present in the images of
the test database3. False alarms are calculated from the average of false alarms per image for each number of neuron.
The figures show the comparison result obtained from the tests in C ++ on a PC-type platform for features: (Intel®
Core™ i3 CPU (2,40GHZ), RAM 4,00 Go, Linux Mint):

Table 1. The comparison of DC and execution time


Number of neuron DC Execution time
50 86.95 % 0.19 s
100 86.95 % 0.35 s
150 91.3 % 0.45 s
200 91.3 % 0.59 s

0,1 FA and global error comparison


0,08
FA/global error

0,06 global error


0,04 FA
0,02
0
50 100 150 200 number of neuron
Fig. 12. the comparison of the FA and the global error

The experimental results illustrated in the table 1 show the detector performance with a high detection rate
reached 91.3% at 150 and 200 neurons. The table also shows that the execution time per image naturally increases
with the number of neuron, but this increase does not affect the speed of this detection system.
ATIBI Mohamed et al. / Procedia Computer Science 73 (2015) 24 – 31 31

The figure 11 shows that the false alarm rate is inversely proportional to the number of neuron in the hidden
layer. Moreover, we find that the system is more efficient for 150 and 200 neurons.
These results also show the robustness and speed of our method for the detection of vehicles using haar windows
as image descriptor and artificial neural network multilayer perceptron classifier and such as detector.

5. Conclusion

The proposed vehicle detection system has collected efficient algorithms in terms of image processing and in
terms of artificial intelligence. The combination of the descriptor haar like classifier based on artificial neuron
multilayer perceptron type networks gave satisfactory experimental results, which makes the proposed rapid and
robust system for the detection of vehicles in real time.
However, several improvements can be made to this single object detection system to allow it multi object
detection (vehicle, pietons. etc) robust, fast and usable in real applications of road safety. These improvements will
be the objective of future works.

References

1. Mioulet L, Breckon TP, Mouton A, Liang H, Morie T. Gabor features for real-time road environment classification. In: Industrial Technology.
ICIT; 2013 February; Cape town. IEEE International Conference; pp. 1117-1121.
2. Gerónimo D, López A, Ponsa D, Sappa AD. Haar wavelets and edge orientation histograms for on–board pedestrian detection. In: Pattern
Recognition and Image Analysis. 2007; pp. 418-425.
3. Negri P, Clady X, Hanif SM., Prevost L. A cascade of boosted generative and discriminative classifiers for vehicle detection. In: EURASIP
Journal on Advances in Signal Processing. 2008; 136.
4. Negri P, Clady X, Prevost L. Benchmarking haar and histograms of oriented gradients features applied to vehicle detection. In: ICINCO 2007;
Proceedings of the Fourth International Conference on Informatics in Control, Automation and Robotics, Robotics and Automation 1; May 9-
12, 2007; Angers, France. pp. 359-364.
5. Gandhi T, Trivedi MM. Pedestrian protection systems: Issues, survey, and challenges. In: Intelligent Transportation Systems, IEEE
Transactions on; 2007; 8(3), 413-430.
6. Ge J, Luo Y, Tei G. Real-time pedestrian detection and tracking at nighttime for driver-assistance systems. In: Intelligent Transportation
Systems, IEEE Transactions on; 2009; 10(2), 283-298.
7. Vitabile S, Gentile A, Sorbello F. A neural network based automatic road signs recognizer. In: Neural Networks; 2002. IJCNN'02. Proceedings
of the 2002 International Joint Conference on; Vol. 3, pp. 2315-2320.
8. Viola P, Jones M. Rapid object detection using a boosted cascade of simple features. In: Computer Vision and Pattern Recognition. CVPR
2001. Proceedings of the 2001 IEEE Computer Society Conference on; Vol. 1, pp. I-511.
9. Sun Z, Bebis G, Miller R. On-road vehicle detection: A review.Pattern Analysis and Machine Intelligence. In: IEEE Transactions on;
2006; 28(5), 694-711.
10. Agarwal S, Roth D. Learning a sparse representation for object detection. In Computer Vision—ECCV 2002; pp. 113-127.
11. Leyrit L, Chateau T, Tournayre C, Lapresté JT. Association of AdaBoost and kernel based machine learning methods for visual pedestrian
recognition. In Intelligent Vehicles Symposium, 2008 June; IEEE; pp. 67-72.
12. Oren M, Papageorgiou C, Sinha P, Osuna E, Poggio T. Pedestrian detection using wavelet templates. In Computer Vision and Pattern
Recognition. 1997. Proceedings. 1997 IEEE Computer Society Conference on pp. 193-199.
13. Papageorgiou C, Poggio T. A trainable system for object detection.International Journal of Computer Vision; 38(1), 15-33.
14. Wang H, Zhang H. A Hybrid Method of Vehicle Detection based on Computer Vision for Intelligent Transportation System. International
Journal of Multimedia & Ubiquitous Engineering; 2014; 9(6).
15. Sivaraman S, Trivedi MM. A general active-learning framework for on-road vehicle recognition and tracking. Intelligent Transportation
Systems, IEEE Transactions on; 2010; 11(2), 267-276.
16. Oualla M, Sadiq A, Mbarki S. A survey of Haar-Like feature representation. In Multimedia Computing and Systems (ICMCS). 2014 April;
International Conference on; pp. 1101-1106.
17. Nazeer SA, Omar N, Jumari KF, Khalid M. Face detecting using artificial neural network approach. In Modelling & Simulation. 2007 March.
AMS'07. First Asia International Conference on; pp. 394-399.
18. Shende S, Patel R. Review of Face Detection using PCA and ANN Techniques.
19. Atibi M, Atouf I, Boussaa M, Bennis A. Parallel and Mixed Hardware Implementation of Artificial Neuron Network on the FPGA
Platform.International Journal of Engineering & Technology; 2014; 0975-4024, 6(5).
20. Moutarde F, Stanciulescu B, Breheret A. Real-time visual detection of vehicles and pedestrians with new efficient adaBoost features. In: 2nd
Workshop on Planning; Perception and Navigation for Intelligent Vehicles (PPNIV); at 2008 IEEE International Conference on Intelligent
RObots Systems (IROS 2008).

You might also like