You are on page 1of 5

VEHICLE DETECTION USING HOG AND SVM

BHIMA PHANI BHARGAV Dr. ASNATH PHAMILA.Y


M.Tech Associate Professor
School of computing Science & Enginnering School of Computuing Science & Enginnering
VIT University,Chennai VIT University,Chennai
baargavb@gmail.com asnathvicty.phamila@vit.ac.in

ABSTRACT PREVIOUS WORK

Improving safety and reducing accidents are the One of the features that is widely used in object
most goals of Advanced Driver Assistance Systems detection is the histogram of oriented gradient (HOG).
(ADAS). For their low cost and capability of providing The HOG feature is firstly introduced by Dalal and
information about driving environments, Vision-based Triggs [1] with application on pedestrian detection but
driver assistance systems are the most important it had been used in various object detection applications
systems in recent years. In these systems, robust and including vehicle detection [2], [3], and [4].
precise vehicle detection is a critical step, and the Since then efforts had been made to improve the
detected cars can be used for various applications. This discriminative power of HOG introducing different
paper presents an algorithm for vehicle detection in an changes on Dalal and Triggs HOG version.
urban environment which is very important for driver In [5], Zhang et al. introduced the local structured HOG
assistance systems and autonomous driving. To succeed (LSHOG) fused with local structured Local Binary
the detection of a vehicle, we propose the histogram of Pattern (LSLBP) and applied it for object detection.
oriented gradients features descriptor (HOG) and linear In [6], Cheon et al. made use of the symmetry in HOG
support vector machine (SVM) for the classification. feature vector for symmetric objects such as vehicles
Our experimental results illustrate the robustness and and introduced a new HOG variant called symmetric
precision of our algorithm for different scenes. HOG.
In [7], Kim et al. concatenated position and intensity
Keywords—vehicle detection; histogram of oriented data for the original HOG to form a position and
gradients features descriptor; support vector machine. intensity HOG (𝜋HOG).
Recently Kassani el at. [8], introduced the soft HOG
(sHOG) that depends on random selection of cells
INTRODUCTION position with symmetric features and applied it on
traffic sign detection.
However, all the mentioned efforts maintained the
Every year traffic accidents increased sharply. More than same gradient calculation method as in conventional
50,000 people are killed about these accidents in USA. The HOG. The goal of this paper is to introduce a new
most causes of accidents is driver defects so human security HOG variant using compass gradient mask in the
is threatened. To reduce this huge number of deaths we calculation of HOG that is proved to increase the
think about the automated driving. Many systems have discriminative power of the original HOG on vehicle
appeared such as Driver Assistance Systems (DAS). These detection. The classification part is done using the
systems have been a popular research topic last years. Car support vector machines (SVM) [9] which is widely
detection is a challenging part of the DAS. used in literature in combination with the HOG feature.

There have been many researches for vision-based vehicle


detection. And Support Vector Machine (SVM) with PROPOSED APPROACH
Histogram of Oriented Gradients (HOG) became one of the
popular approaches. The HOG feature basically uses the The car detection algorithm begins with the training
gradient information of objects. Because the typical phase. In this step, we used the Gradient Histograms to
appearance of vehicle has clear edges in vertical and extract the characteristics of an image.
horizontal directions, the HOG can be a good candidate as a After training, we pass to the classification of captured
visual feature of vehicle. And SVM is an effective scheme and processed images. This step requires a robust
that is widely used for the classification of various objects. classification method. For that, we used the SVM
We can expect much better accuracy as well as robustness technique. Fig.1 illustrates the steps of our algorithm.
to wild environment by using this combination.
B. SVM: Support Vector Machine

The methods for classification are numerous: the


methods of the support vector machines (SVMs),
neural networks, etc. SVM is considered easier to use
than the neural network.
The support vector machine is a supervised learning
technique destined to solve classification problems.
SVM exploit the concepts of the theory of statistical
learning and the boundary theory of Vapnik and
Chervonenkis.
This technique is a method of classification in two
classes whish tries to separate the positive examples
from negative example in the set of example. The
Figure 1. Car detection architecture method then looks for the hyper plane that separates the
positive examples from the negative examples,
ensuring that the margin between the nearest positive
METHODOLOGY and negative is maximal. The advantage of this method
is the selection of support vectors that represented the
A. HOG features discriminate vectors by which is determined the hyper
plane.
The calculation of HOG function is based on edge gradient
orientation histograms for vehicle detection. This technique
counts occurrences of gradient orientation in localized
portions of an image. Local object appearance and shape
can often be characterized rather well by the distribution of
local intensity gradients or edge direction.

HOG features are calculated according to the following:

1.Compute horizontal GH and vertical GV gradients image.


2.Calculate norm and orientation of the gradient.
3.The window of image is divided in M u N cells.
Figure 3.Hyperplane separator and support vectors
4.Build histogram of orientation for each cell:
The cell histogram is visualized by a 'star' showing the
It is obvious that there exists a multitude of valid
strength of the edge orientations in the histogram. hyperplane but the remarkable property of the SVM is
5.Group several cells in a block to realize the normalization. that this hyperplane must be optimal. Therefore, one
must look among the valid hyper planes, that which
passes "in the middle" of the points of the two classes
of examples. Intuitively, this amounts to search the
"safest" hyperplane.

Indeed, a small variation will not modify its


classification if its distance to the hyperplane is large.
Formally, this means looking for a hyperplane whose
minimum distance to learning examples is maximal. This
distance is called "margin" between the hyperplane and
the examples. The optimal separator hyperplane is the one
that maximizes the margin.

Figure 2.HOG features extraction


HEATMAPS

Given a few consecutive frames, notice that there are


overlapping detections and false positive detections are
spaced out. Build a heat map to combine overlapping
detections and remove false positives. To make a heat
map start with a blank grid and “add heat” for all
pixels within windows where positive detections are
reported by the classifier. The “hotter” the parts, the
more likely it is a true positive, and impose a threshold
to reject areas affected by the false positives.
Figure 4. Optimal hyperplane and maximum margin

CLASSIFIERTRAINING

The classifier algorithm used in this research is Linear


Support Vector Machine. A total number of 8,792 samples
of vehicle images and 8,968 samples of non-images. This
data set is preselected by Udacity with images from the GTI
vehicle image database and the KITTI vision benchmark
suite. As a safety measure, use a scaler to transform the raw
Figure 5.Heat Maps
features before feeding them to the classifier for training or
predicting, reducing the chance of the classifier to behave
badly.
SUMMARY
SLIDING WINDOWS
For this project,a software pipeline is excecuted to
detect and track vehicles from a video of a highway. To
A subregion of video frame is obtained and run that
do this, HOG features are extracted from the previously
classifier there to see if that patch contains a vehicle. Firstly,
collected data and fed them to a Linear Support Vector
we have to consider that getting the HOG features is
Machine classifier algorithm.Sliding window technique
extremely time consuming. Instead of getting the HOG
is used to check if subregions of a frame contain
features for each patch region with have many overlaps with
vehicles. Then heat maps are used over multiple
each other each time, the HOG features that are extracted of
consecutive frames to eliminate transient false positives
the whole frame at the beginning, then we pull out the
and gain confidence over multiple detection on the
features for each frame’s subregion as we need them.
same location.
The strip where the search was performed is decided by
HOG features of images in HLS and YUV color
eyeing the vehicles on the video. Notice that we should only
formats are good features to be used for classifying
search below the horizon.
vehicles. However, extracting 1,188 YUV HOG
features is extremely faster than extracting 7,056 HLS
HOG features so better use YUV (with 16 x 16 pixels
per cell and 11 orientations) over HLS (with 8 x 8
pixels per cell and 12 orientations).
REFERENCES
OUTPUT [1] N. Dalal and B. Triggs, “Histograms of oriented
gradients for human detection,” in 2005 IEEE
Computer Society Conference on Computer Vision and
Pattern Recognition (CVPR’05), 2005, vol. 1, pp. 886–
893 vol. 1.
[2] L. Mao, M. Xie, Y. Huang, and Y. Zhang,
“Preceding vehicle detection using Histograms of
Oriented Gradients,” in 2010 International Conference
on Communications, Circuits and Systems (ICCCAS),
2010, pp. 354–358.
[3] J. Arróspide, L. Salgado, and M. Camplani,
“Image-based on-road vehicle detection using
costeffective Histograms of Oriented Gradients,” J.
Vis. Commun. Image Represent., vol. 24, no. 7, pp.
1182–1190, Oct. 2013.
[4] G. Yan, M. Yu, Y. Yu, and L. Fan, “Real-time
vehicle detection using histograms of oriented gradients
and AdaBoost classification,” Opt. - Int. J. Light
CONCLUSION Electron Opt., vol. 127, no. 19, pp. 7941–7951, Oct.
2016.
The synergistic approach that has been introduced in this [5] J. Zhang, K. Huang, Y. Yu, and T. Tan, “Boosted
article achieves the main objectives. The precision is local structured HOG-LBP for object localization,” in
improved for the proposed system for vehicle detection. CVPR 2011, 2011, pp. 1393–1400.
This system of detection currently operates at 22 frames per [6] M. Cheon, W. Lee, C. Yoon, and M. Park, “Vision-
Based Vehicle Detection System With Consideration of
second using a resolution of 960 u 720.
the Detecting Location,” IEEE Trans. Intell. Transp.
In this Paper the use of a Gradient Histograms (HOG) is Syst., vol. 13, no. 3, pp. 1243–1252, Sep. 2012.
shown for the training phase and an SVM classifier for [7] J. Kim, J. Baek, and E. Kim, “A Novel On-Road
classification step giving a good results for the detection of Vehicle Detection Method Using πHOG,” IEEE Trans.
vehicles. Intell. Transp. Syst., vol. 16, no. 6, pp. 3414–3429,
Dec. 2015.
[8] P. H. Kassani, J. Hyun, and E. Kim, “Application of
soft Histogram of Oriented Gradient on traffic sign
detection,” in 2016 13th International Conference on
Ubiquitous Robots and Ambient Intelligence (URAI),
2016, pp. 388–392.
[9] C. Cortes and V. Vapnik, “Support-Vector
Networks,” Mach. Learn., vol. 20, no. 3, pp. 273–297,
Sep. 1995.
[10] H. T. Niknejad, A. Takeuchi, S. Mita, and D.
McAllester, “On-Road Multivehicle Tracking Using
Deformable Object Model and Particle Filter With
Improved Likelihood Estimation,” IEEE Trans. Intell.
Transp. Syst., vol. 13, no. 2, pp. 748–758, Jun. 2012.

You might also like