Automatic Detection of Motorcycle on the Road using Digital Image Processing

Traffic accident is one of the causes of death in the world. One of them is traffic accidents on motorcyclist not wearing helmet. To overcome this problem, several researchers have developed detection system of motorcyclist not wear helmet. This system consists of motorcycle detection and motorcyclist head detection. On motorcycle detection, accuracy still needs to be improved. For this reason, this paper proposed motorcycle detection by adding image improvement processes that are enhancing contrast and adding object positioning features. The proposed technique is divided into three stages: image enhancement, feature extraction, and classification. The image enhancement stage consists of enhance contrast, convert RGB image to gray scale, background subtraction, convert gray scale image to binary, closing operation, and small object removal. The features used in this paper are the object area, the circumference of the object, and the location of the object, while the method for classification process using back-propagation neural network and SVM. The proposed method resulted in an accuracy of 96.97%.


INTRODUCTION
Traffic accident is one of many death causes in the world. A data produced by World Health Organization (WHO) states that the number of people died because of traffic accident is 1. 25 million every year and 20 up to 50 million experienced minor injuries and disability [1]. Data published by Statistics Indonesia that the number of accidents from 1992 to 2015 in general continues to increase [2].
Binary Pattern (LBP) descriptor and clarification process by SVM (Support Vector Machine). While in [5], there are five steps in motorcycle detection process: RGB conversion to grayscale, background subtraction, enhancement by threshold and mathematical morphology method, feature extraction with area, and clarification with Neural Network. These methods can be improved by enhancing image quality and adding influential features. Therefore, this paper added the process of enhancement contrast and it added feature of the location of the object.
In general, there are three main steps of the proposed method namely image enhancement, feature extraction, and classification. The image enhancement stage is divided into 6 processes: enhance contrast, convert RGB image to grayscale, background subtraction, convert grayscale image to binary, closing operation, and small object removal. The features used the area of the object, the circumference of the object, and the location of the object, while the classification process used back-propagation neural network and SVM.
Back-propagation neural network and SVM algorithms have been widely used for classification, identification, prediction, and detection that produce a fairly good degree of accuracy. The applications of back-propagation neural network and SVM for classification are the fruit classification, ship classification, natural gas pipeline classification, automatic text classification, cancer classification, audio sounds classification, handling binary classification, enzyme classification and object classification [6][7][8][9][10][11][12][13][14][15]. The applications of the two classifiers for identification are defect identification for simple fleshy fruits, hand writer character recognition, transcription factor binding sites identification on human genome, diagnosis of renal calculus disease, and automated speech signal analysis [16][17][18][19][20]. Backpropagation neural networks and SVM are also widely used for prediction and detection including breast cancer risk prediction, weld quality prediction, permeability prediction, prediction of osteosarcoma metastasis, prediction of flow rate of karstic springs, detection of tobacco disease, detection of epileptic seizure, and detection of glioblastoma brain tumor [21][22][23][24][25][26][27][28].

METHODS
In general, the proposed techniques are divided into 3 stages namely image enhancement, feature extraction, and classification. Image enhancement step is classified into six processes namely contrast enhancement, RGB image to grayscale conversion, background subtraction, grayscale image to binary conversion, closing operation, and small object removal. The order of the process can be seen in Figure 1.

Image Enhancement
This step is divided into 6 processes: enhancing contrast, converting RGB image to gray scale, background subtraction, convert gray scale image to binary, closing operation, and small object removal. Changes in each process are shown in Figure  2. The input data applied in this research includes the frames from the video extraction. This video file is obtained from one of the CCTV recordings with duration of 19 minutes and 12 seconds that are installed on the roads in Ciamis Regency, West Java.

Enhancing Contrast
The first step in image enhancement is enhancing the contrast so the image will be clearer. This process is exercised on to background and object image. Background images are the images in video frames that have no moving objects.

Converting RGB image to grayscale:
The next step is converting RGB image to grayscale in background and moving objects image. This process is run by collecting three basic colors (red, blue, and green) which later are summed up. This sum will be divided by three to get an average. This average is the grayscale colors.

Background subtraction:
The background subtraction is subtracts between object frame and background frame. In this study, background image used closest background frame with object frame for order minimize lighting variation.

Converting grayscale image to binary:
The next process is converting grayscale to binary image. The results of this image are the pixels in images with only two possibilities; black and white (1 and 0). The threshold value is 50, which means if the value of gray is greater than 50 then the color pixel is black and the other is white.

Closing operation:
The next step is closing operation process. This process is a dilation process which is followed by the erosion. The result of this process is combining some close objects. This operation is useful if the result of grayscale image to binary conversion process is not fragmented into some pieces. To combine some objects, some element shapes can be used such as rectangle, square, disk, etc. This research used disk with radius of 8 pixels.

Small object removal:
The last process in the image enhancement is small object removal. The aim is to remove unwanted object. The object removal is based on the object's size in the digital image. In this research, the object will be removed if the area is less or equal to 60 pixels. Meanwhile, the object with area more than 60 pixels will not be removed.

Feature extraction
The next step is feature extraction. The used features are area, circumference and object position. The object position is taken from center point of object at horizontal and vertical axis. The object area calculated from number of white pixel at the object. Meanwhile the circumference calculated from number of outline pixel on the object. The center point of object determinates as seen at the Figure 3. The formula for this point of the X axis and the Y axis is as equation (1)  Where X1 is the object's minimum point on X axis and Y1 is the object's minimum point on Y axis. While W is the object's width and H is the object's height.

Classification
The classification stage is used to distinguish between an object of motorcycle and an object not motorcycle. The Input data used the object area, the area circumference, the object's center point on X axis and the object's center point on Y axis. These features normalized in the range 0.1 to 0.9. The used classification methods are back-propagation neural network and SVM.
The architecture of the back-propagation neural network is as seen in Figure 4. This architecture consists of four inputs namely feature of area (X1), circumference (X2), object's center point on X axis (X3), and object's center point on Y axis (X4). The number of hidden layer is one hidden layer, meanwhile the numbers of neuron in the hidden layer are four neurons. The second classification method is using SVM. The kernel in the SVM is used linier. Both classifiers were used to distinguish two classes namely an object of motorcycle and an object not motorcycle. If the object is a motorcycle, there will be a square shape surrounding the object as a mark. While if the object is not a motorcycle, the object will be ignored.

RESULT AND DISCUSSION
In this research, there are two types of testing: testing of performance on image enhancement and testing of classifier performance.

The Testing of Performance on Image Enhancement
Purpose of this testing is to find out the performance on image enhancement technique. The image data used in this testing was taken from result of a video extraction. The used data is frames image from video. The video was obtained from recording of CCTV on a highway in Ciamis Regency, West Java. The data testing number of frames image are 176 images with the measurement of 200 x 200 pixels (102 objects of motorcycle and 74 objects of not motorcycle). Data example used in this research is as seen in Figure 5.
The result of the testing is accuracy as 93.75%, while eleven images are not detected. The enhancement technique cannot detect object that the test image have similar color with background color. Another caused is the object is too small so the object accidentally removed on the process of small object removal.  The network weights be saved and it used to testing, after back-propagation neural network is doing training. The SVM classifier also needs training process before it does testing. The result of classification (testing) from both the classifiers can be seen on the Table 2. From this table, it can be seen that back-propagation and SVM produced the same accuracy on each K-fold and the average result. The average accuracy produced in both classifiers is 96.97%. The error is caused too difference small color between object and background image. This problem can be reduced by increasing the contrast between the object and background color.