Top Banner
Vehicle logo recognition in traffic images using HOG,SIFT features and SVM with combined logistic regression Under the guidanc of Prof. Md. Abdul Alim sheikh DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERI ALIAH By Khelafat Hossain(Roll No-ECE13417) Sk Golam Rocky Bul(Roll No-ECE13422) Saharupuddin Laskar(Roll No-ECE13424) Abdul Touhid Bar(ECE13429)
24

Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Apr 12, 2017

Download

Engineering

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Vehicle logo recognition in traffic images using HOG,SIFT features and SVM with

combined logistic regression

Under the guidance of

Prof. Md. Abdul Alim sheikh

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING ALIAH UNIVERSITY,KOLKATA 2017

By Khelafat Hossain(Roll No-ECE13417) Sk Golam Rocky Bul(Roll No-ECE13422) Saharupuddin Laskar(Roll No-ECE13424) Abdul Touhid Bar(ECE13429)

Page 2: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

OUTLINE

Introduction Why HOG & SVM Basic steps of HOG Basic Steps of SVM Description Vehicle Logo Localization Experiment Off-Line Classification Result Single-frame logo recognition results Vehicle Logo Recognition On-line vehicle logo recognition result Conclusion References

Page 3: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Introduction

Nowadays, the ability of recognizing the vehicle manufacturer (car make) by the standard License Plate Recognition(LPR) systems in the context of Intelligent Transportation Systems (ITS) applications, is getting more and more important.

In addition, LPR systems are unable to detect fake car plate numbers. Automatic vehicle identification systems increase their reliability and robustness by including more details about the monitored vehicle, such as the vehicle color , the plate color ,the car make , the car model, etc.

In this paper a vehicle manufacturer recognition system based on the classification of the vehicle logo is proposed. Logo detection is assisted by a previously developed license plate recognition stage. A sliding window technique is then applied in a region of interest (ROI) defined above the detected license plate.

Local Binary Patterns (LBP), Scale-Invariant Feature Transform (SIFT) and Histograms of Oriented Gradients (HOG) have been studied as features to represent the vehicle logo. A multi-class Support Vector Machine (SVM) is then used to classify all the regions provided by the sliding window stage.

Page 4: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Why HOG & SVMIn this paper a vehicle manufacturer recognition system based on the classification of the vehicle logo is proposed. Logo detection is assisted by a previously developed license plate recognition stage. A sliding window technique is then applied in a region of interest (ROI) defined above the detected license plate. Local Binary Patterns (LBP), Scale-Invariant Feature Transform (SIFT) and Histograms of Oriented Gradients (HOG) have been studied as features to represent the vehicle logo. A multi-class Support Vector Machine (SVM) is then used to classify all the regions provided by the sliding window stage. Finally, a majority vote approach is implemented to estimate the logo using the binary outputs given by the SVM. Key differences with previous approaches are the use of HOG features in combination with a multi-class SVM to deal with logo recognition, the evaluation concerning a texture-based descriptor such as LBP, and the use of a sliding window technique combined with a majority vote approach. In addition, our VMR system has been specially devised to be used with traffic images, like the ones depicted in Fig. 1. Whereas other approaches recognize logos with high resolution regions, our proposal works with images in which the logos appear contained in a low-medium resolution region. The proposed approach is assessed on a set of 3.579 vehicle images, captured by two different traffic cameras (see Fig. 2), that belong to 27 distinctive vehicle manufacturers.

Page 5: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Basic steps of HOG

HOG features were first introduced by Dalal and Triggs.In their work, Dalal and Triggs.To compose HOG, the cell histograms of each pixel within the cell cast a weighted vote. In this work the histogram channels are calculated over rectangular cells by the computation of unsigned gradient. The cells overlap half of their area, meaning that each cell contributes more than once to the final feature vector. In order to account for changes in illumination and contrast, the gradient strengths were locally normalized, i.e. normalized over each cell. The nine histograms with nine bins were then concatenated to make a 1x81 dimensional feature vector.

Training Phase:-In the experiment total 10 classes has taken and to form training set total training set 5 images is used to form training set per class. First of all the images are resized to 150x150 pixels ,converted binary image and SIFT descriptor, SURF descriptor and HOG descriptors are calculated for first 5 image belongs to a particular class where feature vector’s size is 128+65+81=274. fv_t(SA, : ,CL)=F1;F1 is feature vector of length 1X274.SA represents training sample no and CL represents class no. and : is for feature vector .

fv_t1=fv_t(:,:,1); fv_t1 contains all 5 feature vectors of 5 training images of a class1.fv_ti (i=1 to 10)contains all 5 feature vectors of 5 training images of a class. Now size of fv_t1=5x274.So mean value, mn_t1 is calculated for fv_t1.Similiarly mean value is calculated for all classes, mn_ti=mean (fv_ti); And those mean are the feature vector of size 1×274.

mn_t1=mean(fv_t1);

size of(mn_t1) is 1x274 .

Page 6: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Algorithm:-

1.Original HOG Algorithm Bellow figure portrays a flow diagram of object detection using the original HOG algorithm [1]. Scanning on the input image is based on detection window. The window is divided into cells, for each cell accumulating a histogram of gradient orientations over the pixels of the cell. For better invariance to illumination, histogram normalization can be done by accumulating a measure of the local histogram energy over blocks and using the results to normalize all cells in the block. The normalized histograms (HOG features) are collected over the detection window. The collected features are fed to a linear SVM for object/nonobject classification.

Page 7: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

2.Simplified HOG Algorithm for Implementation A simplified HOG algorithm for VLSI implementation is introduced in this subsection. Figure 3 shows a flow diagram of object detection using simplified HOG algorithm. This flow is modified from the original flow using the following five techniques. 1. Cell-based scanning (Section 2.3) 2. Gradient calculation using CORDIC [10] 3. Approximation of weighted voting for spatial and orientation anti-aliasing 4. Newton method with approximated initial value 5. Simultaneous SVM calculation (Section 2.4)

Figure-3

Page 8: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Figure 4 portrays the workload analysis of HOG-based object detection. Simplified HOG algorithm with cell-based scanning and simultaneous SVM calculation reduces the workload to 10.6 GOPS, as portrayed in Fig. 4. However, the workload of 10.6 GOPS is still heavy for a processor with low operating frequency. To accommodate the workload in real time, our architecture has parallelized modules for cell histogram generation, histogram normalization, and SVM classification.

Fig-4 Workload Analysis

Page 9: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Basic steps of SVMIn the window-based approach, HOG features of 105 blocks are collected. Then the features are multiplied by SVM coefficients corresponding to one window. However, the cell-based approach provides partial HOG features after normalization for one block; then the features are multiplied by SVM coefficients corresponding to 105 windows. Figure 6 presents simultaneous SVM calculations for cell-based processing. Partial HOG feature belongs to 105 windows maximally and are located at different positions in each window. Partial HOG features are multiplied and accumulated by the SVM coefficients of each window. The accumulation result is stored and reused in the subsequent SVM calculation. Simultaneous SVM calculation is suitable for parallel computing in hardware.

Simultaneous SVM Classification

Page 10: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

DescriptionThe overall architecture of the proposed VMR system is depicted in Fig. 3. As can be observed, the recognition module is triggered by previous stages if these ones detect the motion and the license plate of the vehicle that appears on the images. LPR module is only applied if we detect motion on the traffic images. Once the logo recognition module is switched on, a sliding window technique is applied to select ROIs where the logo can be located. A fast implementation of the HOG features is run for each previously selected ROI, and these feature vectors are classified by means of a multi-class SVM. The estimated logo that will correspond to the vehicle manufacturer is finally obtained using a majority voting scheme which takes all the binary outputs of the SVM classifiers for each one of the pre-selected ROIs.The proposed majority voting scheme is defined in a multi-frame fashion, i.e., the SVM binary outputs used to recognize the logo correspond to all the frames in which the same vehicle appears. Depending on the vehicle speed, the camera captures between 2-7 frames corresponding to the same vehicle with full visibility of its logo. This approach is graphically described in the Finite State Machine (FSM) depicted in Fig. 4. The No Car state means that neither motion nor a license plate appear on the images. Once we detect the first appearance of a vehicle license plate on the images, we change to Car state, in which the logo recognition module is run. We accumulate all the binary outputs of the multi-class SVM. The majority voting approach is only applied once thelicense plate is lost.

Fig. 4. Finite State Machine (FSM). Fig. 3. Overall architecture of the proposed VRM approach.

Page 11: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Vehicle Logo LocalizationThe first stage uses a frame-to-frame differencing approach to detect changes between consecutive frames corresponding to the traffic sequence captured by the camera. Thus, if no vehicles appear on the images, the CPU load remains low. Once the motion module detects a considerable change between two adjacent frames, a LPR system, previously developed by our research group, is executed providing both the text and the location of the license plate. Then, the following assumption is made: in most cases, the vehicle logo will appear in a region located just above the license plate. This assumption is not valid for certain types of vehicles in which the license plate is not located in the center but in one of the sides of the vehicle frontal area. Accordingly, we apply a sliding widow technique using different region sizes (square windows), sliding the windows along the vertical axis that separates the license plate in two equal sized regions (see Fig. 5)

Fig. 5. Overall view of the sliding window approach.

Page 12: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

It is worth to mention that other approaches are specifically devised to provide only one region fitted to the vehicle logo [6], [9], [10]. In our case, we supply a set of regions that are fed to the classifier. Although this procedure increase the CPU load since HOG features and SVM classification have to be run for more than one region, we expect better results since we do not rely on the output of only one classification per image. A similar approach was successfully applied by the authors in the context of pedestrian [11] and pavement [12] recognition.

Page 13: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

EXPERIMENTSA digital camera with a resolution of 640 × 480 pixels and a focal length of 50mm was placed at two different road bridges pointing to one specific lane of a highway (see Fig. 2). The images were captured on two different days, under different lighting conditions (from sunny to cloudy). The sequences comprise a total of 3.579 vehicle images that belong to 27 distinctive vehicle manufacturers. Ground truth corresponding to the license plate number and its position as well as the logo and its position was obtained by manual labeling the corresponding bounding boxes in the camera images. The number of samples for each car manufacturer are shown in Table I.

Table I

Page 14: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Off-line classification results The performance of our HOG/SVM classifier is firstly evaluated in an off-line fashion using the manually labeled logo regions. All the samples are scaled to 32 × 32 pixels and HOG features are obtained. We compared two SVM kernels: linear and RBF. According to the data distribution shown in Table I we select 2/3 of the samples for each one of the vehicle logos for the training phase, leaving 1/3 for the test. Table II compares the performance of the HOG/rbfSVM classifier with the HOG/linSVM for each one of the vehicle manufacturers. The overall accuracy is 95.88% and 92.87% for the linear and RBF kernels respectively. It is worth to mention that logos with an accuracy of 0.00% correspond with classes in which the number of training samples is below 12, a value which is clearly insufficient for generalizing.

Table II

Page 15: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Single-frame logo recognition resultsIn order to evaluate the proposed logo recognition approach, including both the vehicle logo localization stage and the majority voting scheme, we trained a SVM classifier using the samples that correspond to 2/3 of the sequence images, i.e., 2.386 logo samples maintaining the distribution showed in Table I. The rest of the images (1/3) were used in a single-frame fashion to test the system performance. According to the off-line classification results, we directly selected a linear kernel function. A second experiment was carried out by training a linear SVM classifier with a higher amount of samples. For each manually labeled logo cutout corresponding to the training images we automatically created 162 samples by horizontal mirroring, geometric jittering and size varying (see Fig. 10). Accordingly, the number of training samples increased up to 386.532.

Fig. 10. Example of some additional training samples created for each manually labeled logo.

Page 16: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Vehicle Logo RecognitionTo build a reliable training database for image super-resolution, we collect 20 HR images from internet. To account for varying body colors and illuminations, we use gamma adjustment on each HR image to generate 30 images of dierent contrast by varying gamma value from 0.1 to 3 with a step of 0.1. we normalized all the HR images to 120 120. Andthen we just simply down-sampled HR images to 30 30 to obtain our LR images for training. The magnication factor in our experiment is 4. We divide each logo image into 9 blocks and each block has 15 histogram bins, so the length of HOG feature vector is 135.

2D-CCA

1D-CCAIn Fig. we can see the comparison of super-resolved imagebetween by using 1D CCA and 2D CCA. Visually, we can say the the edges in 2D CCA super-resolved images are clearer and the noise is much less compared to 1D CCA super-resolved images.

Page 17: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Figure 5.7: Confusion matrix for recognition.

Page 18: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

From the confusion matrix shown in Fig 5.7, we can observe that some special logos perform bad, for example, Ford, Kia and Chevrolet. They have lowest classification accuracy as their is similarity in their shapes and the noise makes some character features contained in the logo more obscure, leading to incorrect classification. Other than the illumination, another reason for the bad performance is incorrect alignment. The accurate alignment is needed for the high-quality super-resolved image. However, sliding window technique cannot guarantee proper alignment, some examples are shown in Fig. 5.8.

Figure 5.8: Some examples without proper alignment.

Page 19: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

The proposed detection method can alleviate this situation to some extent. For example, Audi logo has a rectangular shape of 25 45, whereas the average dimension of most logos is 26 26. Just using traditional sliding window which is designed for most of the logos will cause the Audi logo to be partially detected. Even tough we can adjust the window size to t shape the Audi logo, a large irrelevant area will be account in the logo area too, which will cause the poor alignment. It can illustrated in Fig. 5.9.

Figure 5.9: Advantages using combined detect system

Page 20: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

On-line vehicle logo recognition resultsIn the last experiment, we tested the system in real conditions, i.e., considering the fact that one vehicle is capturedby the camera obtaining between 2 and 7 useful images depending on the vehicle speed. We applied the structureshown in Fig. 3 and the FSM described in 4. The estimated logo that will correspond to the vehicle manufacturer ishere obtained using the majority voting scheme applied over all the binary outputs provided by the classifier for allthe available images for one specific vehicle. The classifier used in this experiment was the linear SVM trained withmultiple samples. Table IV depicts the overall performance per each car manufacturer using the same number of samples of previous experiments (1/3) including consecutive frames corresponding to the same vehicle. Note that in this case the recognition rates are related with the number of detected vehicles. The final global performance we obtained was 92.59% (375/405). We can observe a correlation between the number of samples used for training and test, and the performance. Most of the vehicle manufacturers with more than 30 vehicles used for training provides recognition rates greater than 90%. Some exceptions are Volvo and Toyota, but still their recognition rates are around 70%. Fig. 13 depicts some of the vehicle recognition results.

Fig. 13. Vehicle recognition examples.

Page 21: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

CONCLUSION

This paper presented a HOG/SVM framework for vehicle logo recognition using images captured by traffic cameras. Previous approaches were mainly based on the use of SIFT features, which are not useful in scenarios where the vehicle logos are not available with high resolution. The gradient distribution of the logos has been proved as an effective descriptor for logo classification, whereas other features suchas texture-based (LBP) do not provide better results.In this thesis, a novel vehicle logo detection and recognition system is proposed. First, a morphological operations combined with sliding window technique to detect the vehicle logo is adopted. Then we use the 2D CCA to reconstruct the low-resolution image captured by traffic surveillance camera. Finally, HOG features from super-resolved image are extracted and fed in to an SVM classier with a radial basis function kernel to get the final classification result. Compared with traditional recognition methods, the proposed method yields a much better performance in dealing with low-resolution image and thusis suitable for vehicle logo recognition in real world. Future work will involve aligning the logo in detected region more accurately. Since high-quality super-resolved image needs an accurate alignment and training images and testing images should be aligned in the same manner. Without proper alignment, the quality of super-resolved image will degrade and it will influence the classification performance.

Page 22: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

REFERENCES[1] C.-N. E. Anagnostopoulos, I. E. Anagnostopoulos, I. D. Psoroulas, V. Loumos, and E. Kayafas, “License plate recognition from still images and video sequences: A survey,” IEEE Transactions on Intelligent Transportation Systems, vol. 9, pp. 377–391, 2008.

[2] X. Z. Li, G. M. Zhang, J. Fang, J. A. Wu, and Z. M. Cui, “Vehicle color recognition using vector matching of template,” in International Symposium Electronic Commerce and Security, 2010, pp. 189–193.

[3] W. Feng, L. Zhi-fang, and M. Li-chun, “Color recognition of license plates using fuzzy logic and learning approach,” Jouranl of Optoelectronics. Laser, vol. 20, pp. 84–88, 2009.

[4] A. P. Psyllos, C.-N. E. Anagnostopoulos, and E. Kayafas, “Vehicle logo recognition using a sift-based enhanced matching scheme,” IEEE Trans. on Intell. Transp. Sys., vol. 11, pp. 322–328, 2010.

[5] A. Psyllos, C. N. Anagnostopoulos, and E. Kayafas, “Vehicle model recognition from frontal view image measurements,” Comput. Stand. Interfaces, vol. 33, no. 2, pp. 142–151, 2011.

[6] W. Yunqiong, L. Zhifang, and Z. Fei, “A fast coarse-to-fine vehicle logo detection and recognition method,” in IEEE International Conference on Robotics and Biomimetics, 2007.

[7] A. Psyllos, C. N. Anagnostopoulos, and E. Kayafas, “Vehicle authentication from digital image measurements,” in 16th IMEKO TC4 Symp., 13th Workshop ADC Model. Test., 2007, pp. 691–696.

Page 23: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

[8] T. Burkhard, A. J. Minich, and C. Li, “Vehicle logo recognition and classification: Feature descriptors vs. shape descriptors,” Stanford University,” EE368 Final Project, 2011.

[9] W. Li, “A novel approach for vehicle-logo location based on edge detection and morphological filter,” in Second International Symposium on Electronic Commerce and Security, 2009, pp. 343–345.

[10] Z. Yong, Y. Hong-Yu, and Y. Zhi-Sheng, “A method of fast vehiclelogo location,” Journal of Si Chuan Univesity: Natural Science Edition, vol. 41, no. 6, pp. 1167–1171, 2004.

[11] I. P. Alonso, D. F. Llorca, M. A. Sotelo, L. M. Bergasa, P. R. de Toro, J. Nuevo, M. Ocana, and M. A. G. Garrido, “Combination of feature extraction methods for svm pedestrian detection,” IEEE Transactionson Intelligent Transportation Systems, vol. 8, no. 2, pp. 292–307, 2007.

[12] M. Gavil´an, D. Balcones, O. Mart´ın, D. F. Llorca, M. A. Sotelo, I. Parra, M. O. na, P. Aliseda, P. Yarza, and A. Amirola, “Adaptive road crack detection system by pavement classification,” Sensors, vol. 11,pp. 9628–9657, 2011.

[13] D. G. Lowe, “Object recognition from local scale-invariant features,” in Int. Conference on Computer Vision, 1999, pp. 1150–1157.

[14] N. Dalal and B. Triggs, “Histograms of oriented gradients for human detection,” in International Conference on Computer Vision & Pattern Recognition, 2005, pp. 886–893

Page 24: Vehicle Logo Recognition In Traffic Images Using HOG,SIFT & svn

Thank You