Vol. 28, No. 8s, (2019), pp. 834-838
Comparison of Vehicle Detection Using Haar-like Feature, LBP and HOG Technique for Feature Extraction in Cascade Classifier
Rosa Andrie Asmara1, Muh Bambang Purwanto2, Cahya Rahmad3, Desy Derius M4. and Isa Mahfudi5
1,5Electrical Engineering Departement, State Polytechnic of Malang. Jl. Soekarno-Hatta No. 9, Malang 65141, Indonesia.
2,3Information Technology Departement, State Polytechnic of Malang. Jl. Soekarno-Hatta No. 9, Malang 65141, Indonesia.
4Military Telecommunications Departement, Army Polytechnic. Pendem, Junrejo, Batu City, East Java 65324, Indonesia.
Abstract—Transportation continues to increase every year.
Recorded in 2018, the number of vehicles registered in Indonesia is more than 111 million. Problems such as traffic congestion and traffic accidents need to be resolved. One of the solutions implements intelligent transportation systems (ITS). ITS plays a very important role in the suitability of the traffic conditions of the vehicle. Many researchers apply the Haar-like feature, Histogram of Oriented Gradients (HOG) and Local Binary Pattern (LBP) to detect objects and vehicles. This paper describes the comparison of the applicability of the Haar-like Feature, the LBP Feature and the HOG Feature on vehicle detection. The results of the comparison of the three features are Haar-like features for vehicle detection system proves better than of using HOG features and LBP feature for vehicle detection. Its detection rate is higher than HOG and LBP where it detected 40 vehicles from the total of 42 vehicles rather by HOG and LBP with only 36 and 35 vehicles detected. In the execution process, the haar- like detection feature is faster at execution time of 14.56 s rather by HOG and LBP with the execution time only 21.36 s and 19.41 s. Haar-like features faster by 46.7% times more than HOG feature detector and Haar-like features faster 33.3% times more than LBP. Haar-like feature based detector system is the best technique for vehicle detection using cascade classifier
Keywords— Intelligent Transportation Systems, Haar-like Feature, Histogram of Oriented Gradients, Local Binary Pattern.
I. INTRODUCTION
Transportation continues to increase every year. Recorded in 2018, the number of vehicles registered in Indonesia is more than 111 million. Problems such as traffic congestion and traffic accidents need to be resolved. One of the solutions implements intelligent transportation systems (ITS). ITS plays a very important role in the suitability of the traffic conditions of the vehicle [1][2]. The development of perception technology is very helpful including the identification of the vehicle which is one important research content from ITS. The scope of ITS is intelligent traffic monitoring, Advanced Traffic Management System, Advanced Traveler Information System, Incident Management System, Electronic Toll Collection System and Support for Public Transportation[3].
Detecting vehicles, counting vehicles and analyzing vehicle traffic including ITS technology. Many researchers have presented several approaches to detecting, calculating and classifying vehicles. Kanhere et al, [4] presents a vehicle segmentation and tracking approach using cameras that are of low quality. The vehicle will be calculated and it will be classified as a car or truck. each frame containing a vehicle will be extracted and processed to be recognized and counted
the number of vehicles. this works in realtime and produces vehicle counts. This method produces an accuracy of more than 90%. Some researchers [5][6][7][8][9] applies the Haar- like feature, Histogram of Oriented Gradients (HOG) [10][11][12][13][14] and Local Binary Pattern [15][16][17][18][19][20] to detect objects and vehicles. The three methods have provided satisfactory results in detecting vehicles, so it is necessary to compare three methods that is known the best method. This paper describes comparison of the applicability of the Haar-like Feature [9], the LBP (Linear Binary Patterns) Feature [15] and the HOG Feature [14] on vehicle detection.
II. RELATEDWORK
Many object recognition approaches were present and the researchers proposed using the Haar cascade classifier, LBP cascade classifier, and HOG to recognize objects and recognize vehicles. these three approaches are claimed to produce good performance, robustness and ability to work in real time [21][22]. Many tutorials have arrived which show that these three approaches are quite high in use, such as to detect humans, although this approach is to detect all types of objects. Peneliti [5] menggunakan fitur haar yang dikombinasikan dengan menghitung kontras menggunakan normalisasi faktor. it was designed to reflect the average intensity of the feature area. The results show an increase in performance under a wide range of illumination conditions.
This makes it more efficient when used for object detection in a real-time environment.This [5] uses the haar feature and calculates the contrast using the normalization factor devised to reflect the average intensity of feature region This technique produces real-time applications by not requiring variance normalization during detection process.
The researcher [6] used the Haar-like feature and the symmetric feature as an approach to robust vehicle detection.
The result of this method is more reliable detection to verify the vehicle candidate and the execution time was very short.
This researcher [7] uses static images for Vehicle Detection.
The image will be extracted using the extraction and recognition features in the traffic surveillance system. Haar- like features are used to represent the appearance of vehicles, and then a learning algorithm. The results of this method produce good vehicle detection performance, which is more than 97%. This researcher [8] presents a vehicle detection system that also applies haar-like that is used for descriptors
Vol. 28, No. 8s, (2019), pp. 834-838 on images and classifications using artificial neuron networks.
The learning of the system is set of positive images and negative images (non-vehicle), and the test is another set of scenes (positive or negative). The results of this study are that the system is able to detect vehicles in real time as quickly and accurately.
This researcher [10] uses a HOG combined latent (SVM).
The proposed method shows good performance in complex situations at intersections. The results of the proposed method indicate that accuracy can reach an average vehicle detection rate of 97%, while for vehicle tracking the average rate is 86%. Other research [11] applies new vehicle detection methods based on histogram of oriented gradients. There are 3 variants of the modified HOG-based features. it is used to train linear and nonlinear classifiers of SVM. The results show that the proposed method increased the discriminative power and improved the detection rates.
This researcher [15] applied LBP to recognize faces based on consideration of information on shapes and textures. The initial process is that the face area is divided into small areas and then extracted and combined into one. This acknowledgment is done using the Nearest Neighbor classification in the computed feature space. The results of the study are that accuracy for facial recognition is quite good and tested with facial expression and different lighting. The proposed method allows for very fast extraction of features.
Rahmad et al. [20] also applied LBP compared to several features, namely HOG and Gabor to recognize traffic signs.
The results of this experiment showed that detecting traffic signs produced precision and recall namely: 98.7% and 95.1%
and for the recognition traffic signs process using SVM Classifier obtained 100% for precision and 86.7% for recall.
This researcher [16] has applied LBP to detecting the moving vehicle in the traffic scene. The researcher combines the LBP algorithm, Gaussian Algorithm, and Codebook algorithm to eliminate the traffic scene jitter. The results of the proposed experiments show that the proposed method is able to eliminate interference. This interference caused by camera shake. The proposed method is able to save time in detecting vehicles and increasing accuracy. This researcher [17] applied the LBP feature to eliminate these problems. The proposed method calculates the local texture feature of the image according to LBP. Whereas the classification is done using the AdaBoost classifier. The results of this method show the robustness of the classifier to be increased, this creates a classifier that can detect vehicles accurately.
III. PROPOSEDSYSTEM
The overall flow of proposed system in vehicle detection system using image processing technique are illustrated in the flow diagram Figure 1.
Pre-Processing
Feature Extraction
Classifier Training
Vehicle Detector
Test &
Evaluation
Figure 1. Proposed architecture.
There are two collections of image dataset; positive images and negative images. Both are prepared and collected from the video frame recorded by the camera. The positive images set are images that have vehicle objects. Vehicle images are taken from the right and left side whereas the negative images are the set of road highways background that the vehicle are not visible or present. The next step of all image datasets is done pre-processed leading to gray scale images and increasing image contrast for feature enhancements, and all datasets of diekstra images use Haar-like features, LBP Feature and HOG. Third technique are used for performance comparisons in which between the third features can perform well in vehicle detection. Third feature extractor undergone cascade classifier training to generate vehicle detector system. In the end there are 3 system objects generated from the training on the dataset image, namely: Haar-like vehicle detector, LBP detector and HOG vehicle detector. The three types of features for vehicle detection were tested on recorded videos. Vehicle detection performances are analyzed to determine which features perform best as a vehicle detector system.
A. Image Dataset
Image datasets consist of positive and negative images are prepared using image frame obtained from the video recorded.
The video consists of road traffic around highways. The positive image dataset consist images of vehicle, with total of 300 vehicle images consist of cars, bus and motorcycles vehicle type in dimension of 70x70 pixel. On the other hand, Total of 1734 negative images are the road background which does not contain any vehicle objects. Dimension of negative images are 70x70 pixel.
B. Feature Extraction
The positive image dataset are applied to the extraction feature using Haar-like features, LBP Feautre and HOG
Vol. 28, No. 8s, (2019), pp. 834-838 features. The third features are compared to find out the best
features in the vehicle detection system. The process of feature extraction involves in assigning vector descriptor to the object around its point feature in the image. Figure 2. is a vector visualization of the HOG feature, where the HOG vector is on the grayscale image. Figure 2 (b) is the outline of the vehicle feature extracted by HOG vector. The outline shows the direction of the vector based on the vehicle feature. The theory of the vector magnitude is that to obtain the feature of the object, orientation of the gradients in each pixel of the image region needs to be calculated[23].
(a) (b)
Figure 2. HOG feature vector. (a) The original Image with Extract and Plot HOG Features (b) The result HOG Feature.
HOG has been applied by [14] for human detection. The technique used in the HOG is to calculate the appearance of the gradient orientation in the local portion of an image. The initial stage of the HOG method is to convert RGB (Red, Green, Blue) images to grayscale, which is then followed by calculating the gradient value of each pixel. After getting the gradient value, the next process is to determine the number of orientation bin that will be used in histogram making. This process is called spatial orientation binning. But before the gradient compute training drawings were divided into several cells and grouped into larger sizes called blocks. Whereas in the block normalization process R-HOG geometry calculations are used. This process is done because there are overlapping blocks. Unlike the image histogram process that uses pixel intensity values of an image or a specific part of the image for its histogram[14][22]. HOG descriptor extraction steps is illustrated in Figure 3.
Figure 3. HOG descriptor extraction steps.
A Local Binary Pattern (LBP) is a descriptor to clarify images based on image texture. So, a picture that is measuring 3x3, where the binary value is at the center the image is compared with the value around it[15]. If it is smaller then 0.
With 8 pixels around it means that there are 28 = 256 possible combinations of Local Binary Pattern codes [15] [18][19]. The
first step in building a Local Binary Pattern is illustrated in Figure 4.
Figure 4. The first step in building a Local Binary Pattern.
The original LBP labels the pixels by thresholding the 3x3 neighborhood in relation to the central pixel Next, calculate the Local Binary Pattern value for pixels in the middle starting from the surrounding pixels by clockwise (counter clockwise) or counter-clockwise (reverse clockwise) with the conditions must be consistent. This value will be stored in the Local Binary Pattern 2D output array, then can be visualized as a thresholding process, namely collecting binaries and storing decimal values at the output of the array Local Binary Pattern is repeated for each pixel in the inputted image [15] [18][19].
The calculated Local Binary Pattern is illustrated in Figure 5.
(a) (b)
Figure 5. The calculated Local Binary Pattern values are then stored in an output array with the same width and height as the
original image (a) The Original Image (b) The result calculated Local Binary Pattern.
Haar Feature is a feature based on the Haar Wavelet [24].
Haar wavelets are single square waves (one high interval and one low interval). For two dimensions, one light and one dark.
then box combinations are used for better detection of visual objects. Each Haar-like feature consists of a combination of black and white boxes. Rectangular type on haar-like features, namely: two rectangle feature (horizontal/vertical) type, three-rectangle feature type and four-rectangle feature type.
Kinds of Haar Feature Variations is described in Figure 6.
Figure 6. Kinds of Haar Feature Variations
Vol. 28, No. 8s, (2019), pp. 834-838
(a) (b)
Figure 7. The result of Haar Feature (a) The Original Image (b) The Result of Haar Feature for Vehicle Detection
The Haar feature is determined by reducing the average pixel in the dark regions of the average pixel in bright areas. If the difference value is above the threshold or threshold value, it can be said that the feature exists. After the process of features extraction on the image dataset, Haar-like feature dataset, LBP feautre dataset and HOG feature dataset are ready for cascade classifier training for developing the vehicle system detector.
C. Cascade Classifier Training
Cascade classifier is a cascading multistage of ensemble learning that uses the output from the previous stage of classifier onto the next classifier in the cascade. as shown in Figure 6. The system object detector output is the detector used in the vehicle detection system to detect vehicle in road video captured by the camera. The cascade classifiers architecture is illustrated on Figure 8.
Figure 8. The cascade classifiers architecture.
The image dataset will be extracted with three features, Haar-like features, LBP Feature and HOG. Third features are trained separately into the cascade classifier. Third image dataset feature type are trained with the same negative image dataset. The classifier training is executed to get vehicle detectors. Total Classifier training (N) are 20 Stages in each type of feature. The vehicle detector for each feature output trained are tested on highway road image and videos. This test aims to determine vehicle detection performance in the sequence of videos or images.
IV. RESULTANDDISCUSSION
Third vehicle detector systems; Haar-like features, LBP Features and HOG vehicle detection system is evaluated and
analyzed using same image and video sequence that are recorded by the camera. Third system detectors are compared by analyzing its detection accuracy that includes the true positive rate, 𝑇𝑝 in equation (4), and false detection rate, 𝐹n in equation (5). Other crucial comparison is the execution time third both vehicle detection systems using 𝐸𝑡 in equation (6).
Execution time is also calculated by calculating the processing time required for each video frame to scan the entire image with an algorithm. The scanning time takes effect based on the processing time of each features to scan whole image to find the vehicle.
Vehicle of
Numbe Total
Vehicle Detected
Tp (4)
Positive False Vehicle Detected
Positives False
Fn (5)
Frame Time Video
Time Execution
Et (6)
TABLE I. DETECTION RESULTS FOR BOTH DETECTOR
Feature Types Vehicle Detected False Detection
Haar-Like 40 12
HOG 36 17
LBP 35 19
TABLE II. TRUE POSITIVE RATE, FALSE DETECTION RATE AND EXECUTION TIME RESULTS
Feature types
True positive rate, 𝑇𝑝
False negative rate, 𝐹𝑛
Execution time 𝑠 Haar-Like
0.95 0.23 14.56
HOG 0.85 0.32 21.36
LBP 0.83 0.35 19.41
Based on the comparison of the detection system from Table 1 and Table 2, Haar-like features for vehicle detection system proves better than of using HOG features and LBP feature for vehicle detection. Its detection rate is higher than HOG and LBP where it detected 40 vehicles from total of 42 vehicles rather by HOG and LBP with only 36 and 35 vehicles detected. From the third feature, the lowest feature in detecting a vehicle is the LBP feature making it 12% less in true positive rate with Haar-like features detector. False Detection is the result of wrong detection. In the vehicle detection process sometimes there is wrong detection so that objects that are not vehicles are detected as vehicles. LBP features system produces high in false detection with 19 of false detection occurrences. Its total are higher than Haar-like with false detection of 12 occurrences. the amount of false detection is a parameter to measure robustness of the system. So that the
Vol. 28, No. 8s, (2019), pp. 834-838 amount of error detection can cause a large problem in terms
of robustness of the system.
In the execution process, the haar-like detection feature is faster at execution time of 14.56 s rather by HOG and LBP with only execution time is 21.36 s and 19.41 s. Therefore, with Haar-like features faster by 46.7% times more than HOG feature detector and Haar-like features faster 33.3% times more than LBP. Haar-like feature based detector system is the best technique for vehicle detection using cascade classifier.
V. CONCLUSION
This paper is proposed development of vehicle detection system using three different feature extraction namely: Haar- Like Feature, LBP and HOG. The algorithm used Cascade classifier as main ensemble training and third features are tested for be able to see performance with the same dataset data consisting of positive and negative images.Third vehicle detectors system are developed with third are distinguished by the use of feature extractor between Haar-like features, LBP Feature and HOG features. The performances of third vehicle detector are compared based on its true positive rate, false detection rate and execution time calculation and records. The results of the comparison of the three features are Haar-like features for vehicle detection system proves better than of using HOG features and LBP feature for vehicle detection. Its detection rate is higher than HOG and LBP where it detected 40 vehicles from total of 42 vehicles rather by HOG and LBP with only 36 and 35 vehicles detected. In the execution process, the haar-like detection feature is faster at execution time of 14.56 s rather by HOG with the execution time only 21.36 s. Haar-like features faster by 31.8% times more than HOG feature detector.
Acknowledgment
The Authors would like to thank to The State Polytechnic of Malang and Army Polytechnic for supporting to attend this conference.
References
[1] X. Kong et al., “Mobility dataset generation for vehicular social networks based on floating car data,” IEEE Trans. Veh. Technol., vol.
67, no. 5, pp. 3874–3886, 2018.
[2] Paryadi, “Wow Jumlah kendaraan mencapai 111 Juta di Tahun 2018,”
2018. [Online]. Available: https://paryadi.com/2018/01/16/jumlah- kendaraan-2018/populasi-sepeda-motor-per-pulau/.
[3] A. Perallos, U. Hernandez-Jayo, E. Onieva, and I. J. García-Zuazola,
“Intelligent Transport Systems,” no. July, 2015.
[4] N. K. Kanhere, S. T. Birchfield, and S. Member, “Real-Time Incremental Segmentation and Tracking of Vehicles at Low Camera Angles Using Stable Features,” vol. 9, no. 1, pp. 148–160, 2008.
[5] K. Park and S. Hwang, “An improved Haar-like feature for efficient object detection,” PATTERN Recognit. Lett., vol. 42, pp. 148–153, 2014.
[6] S. Han, Y. Han, and H. Hahn, “Vehicle Detection Method using Haar- like Feature on Real Time System,” vol. 3, no. 11, pp. 1957–1961, 2009.
[7] Y. Tang, Y. C. Xu, and C. Z. Zhang, “Robust Vehicle Detection Based on Cascade Classifier in Traffic Surveil- lance System,” pp. 349–354, 2014.
[8] A. Mohamed, A. Issam, B. Mohamed, and B. Abdellatif, “Real-time detection of vehicles using the haar-like features and artificial neuron networks,” Procedia - Procedia Comput. Sci., vol. 73, no. Awict, pp.
24–31, 2015.
[9] P. Viola and M. Jonesl, “Rapid Object Detection using a Boosted Cascade of Simple,” Proc. 2001 IEEE Comput. Soc. Conf. Comput.
Vis. Pattern Recognition. CVPR 2001, vol. 36, no. 2, p. I-511, 2001.
[10] H. Tehrani 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, 2012.
[11] Y. Zakaria, H. E. Abd, E. Munim, M. Ghoneima, and S. Hammad,
“Modified HOG based on-road vehicle detection method,” vol. 118, no.
18, pp. 3277–3285, 2018.
[12] X. Li, “A HOG Feature and SVM Based Method for Forward Vehicle Detection With Single Camera,” vol. 2, no. 1, pp. 2–5, 2013.
[13] S. Lee, M. Bang, and K. Jung, “An Efficient Selection of HOG Feature for SVM Classification of Vehicle,” pp. 1–2, 2015.
[14] N. Dalal, B. Triggs, and D. Europe, “Histograms of Oriented Gradients for Human Detection,” 2005.
[15] T. Ahonen, A. Hadid, and M. Pietik, “Face Recognition with Local Binary Patterns,” pp. 469–481, 2004.
[16] X. U. Xue-mei, Z. Li-chao, M. O. Qin, and G. U. O. Qiao-yun,
“Vehicle detection algorithm based on codebook and local binary patterns algorithms,” pp. 593–600, 2015.
[17] Q. Qin-jun, L. Yong, and C. Da-wei, “Vehicle detection based on LBP features of the Haar-like Characteristics,” pp. 1050–1055, 2014.
[18] M. Heikkila, M. Pietikainen, and J. Heikkila, “A Texture-based Method for Detecting Moving Objects.”
[19] M. Heikkila and M. Pietikainen, “A Texture-Based Method for Modeling the Background and Detecting Moving Objects,” vol. 28, no.
4, pp. 657–662, 2006.
[20] C. Rahmad, I. F. Rahmah, R. A. Asmara, and S. Adhisuwignjo,
“Indonesian traffic sign detection and recognition using color and texture feature extraction and SVM classifier,” 2018 Int. Conf. Inf.
Commun. Technol. ICOIACT 2018, vol. 2018–January, no. May, pp.
50–55, 2018.
[21] P. Viola and M. J. Jones, “Robust Real-time Object Detection,” Int J.
Comp Vis, pp. 1–30, 2001.
[22] T. Gritti, C. Shan, V. Jeanne, and R. Braspenning, “Local Features based Facial Expression Recognition with Face Registration Errors.”
[23] M. S. Karis et al., “Fruit sorting based on machine vision technique,” J.
Telecommun. Electron. Comput. Eng., vol. 8, no. 4, pp. 31–35, 2016.
[24] P. Viola, O. M. Way, and M. J. Jones, “Robust Real-Time Face Detection,” vol. 57, no. 2, pp. 137–154, 2004.