IMPROVED ACCURACY OF VEHICLE COUNTER FOR REAL-TIME TRAFFIC MONITORING SYSTEM - Sciendo
←
→
Page content transcription
If your browser does not render page correctly, please read the page content below
Transport and Telecommunication Vol. 21, no.2, 2020 Transport and Telecommunication, 2020, volume 21, no. 2, 125–133 Transport and Telecommunication Institute, Lomonosova 1, Riga, LV-1019, Latvia DOI 10.2478/ttj-2020-0010 IMPROVED ACCURACY OF VEHICLE COUNTER FOR REAL-TIME TRAFFIC MONITORING SYSTEM De Rosal Ignatius Moses Setiadi1, Rizki Ramadhan Fratama2, Nurul Diyah Ayu Partiningsih3 1,2,3 Department of Informatics Engineering, Dian Nuswantoro University 207 Imam Bonjol Street, Semarang 50131, Indonesia 1 moses@dsn.dinus.ac.id, 2riskiramadhan0397@gmail.com, 3nuruldyah35@gmail.com This research proposes a background subtraction method with the truncate threshold to improve the accuracy of vehicle detection and tracking in real-time video streams. In previous research, vehicle detection accuracy still needs to be optimized, so it needed to be improved. In the vehicle detection method, there are several parts that greatly affect, one of which is the thresholding technique. Different thresholding methods can affect the results of the background and foreground separation. Based on the results of testing the proposed method can improve accuracy by more than 20% compared to the previous method. The thresholding method has a considerable influence on the final result of vehicle object detection. The results of the average accuracy of the three types of time, i.e. morning, daytime, and afternoon reached 96.01%. These results indicate that the vehicle counting accuracy is very satisfying, moreover, the method has also been implemented in a real way and can run smoothly. Keywords: Traffic Monitoring, Background Subtraction, Truncate Threshold, Real-time tracking, Vehicle Detection 1. Introduction Technology in the world of transportation has been advancing in the last few decades. Currently, computer vision has been implemented in intelligent transportation systems (ITS)(Gaidash & Grakovski, 2016) to process video data that is usually taken from CCTV. CCTV installed on the streets to monitor traffic in an integrated place to facilitate the authorities in managing traffic in the region. From this transportation, data can be used to make regulations and new rules to overcome transportation problems, such as traffic jams and traffic violations (Moutakki et al., 2017; Setiadi et al., 2019; Sun et al., 2017). From year to year the number of motorized vehicles in the world is increasing (Sperling & Gordon, 2008), even in some countries such as China, Indonesia, and India, the number of motor vehicles has more than doubled in a decade (Davis et al., 2018). Congestion is one of the problems experienced in many countries due to the increase in the number of motorized vehicles that are not matched by the increase inroads. In a country with a high population density and weak rules for private vehicle ownership, sales of new vehicles continue to increase while old vehicles are still being used, so that the streets are increasingly congested and add to the points of congestion. Indonesia is the fourth most populous country in the world, with a population of more than 260 million in 2018(Badan Pusat Statistik, 2020), while the number of motor vehicles reached 138 million in 2017 whereas in 2007 there were no more than 62 million, this means an increase in the number of vehicles which was very significantly more than doubled (Badan Pusat Statistik, 2017). Particularly in the problem of congestion, statistical data on the level of traffic density is needed by observing the number of vehicles that pass the road, thus it can be used to determine policies for open and close access or to determine the length of red and green lights to reduce traffic congestion. This observation was initially done manually, but with the development of existing technology, observations can be made automatically using certain methods. Previous research has discussed how to detect, motorized vehicles that cross the highway. You do this by processing video data taken from cameras mounted on the streets. In some of these studies the background subtraction method is used (Barcellos et al., 2015; Mandellos et al., 2011; Moutakki et al., 2017; Setiadi et al., 2019), even the classification of vehicle types was also carried out in research (Arinaldi et al., 2018). Background subtraction is a method that is done by comparing the background image with the image produced from the frame by frame video to detect the value of moving pixels (Bouwmans et al., 2019; Yang & Pun-Cheng, 2018). One application that is useful for building intelligent transportation systems to help overcome congestion is vehicle 125
Transport and Telecommunication Vol. 21, no.2, 2020 counting (Barcellos et al., 2015; Moutakki et al., 2017; Setiadi et al., 2019; Sun et al., 2017). The counting process can be done by starting the process of vehicle detection, tracking, and counting. Many things are very influential on the accuracy of vehicle counting results, i.e. video input quality, pre- processing, detection and classification of vehicle, the tracking vehicle, and the counting process. Internet speed, camera location, road density, video resolution, road contours (straight or winding or at an intersection), vehicle speed, light intensity due to changes in time (morning or day time or afternoon) and weather are also things that are greatly affect accuracy when the application is actually implemented later, although this will give researchers a challenge to improve accuracy. 2. Related Work In the research conducted by (Barcellos et al., 2015) the vehicle counting method is proposed with the main stages of the process of reading the video and frame foreground, followed by obtaining particles or objects, afterward, it is carried out with the region verification process. The segmentation process to get the foreground scene is done by the Gaussian mixture model method, at the end of this process we will get particles to be processed at the clustering stage. In the clustering process, the k-means method is used to obtain three types of regions, i.e. regions with unlabeled particles, regions with labeled particles and vehicle regions. Regions with unlabeled particles are carried out with initial clustering, cluster splitting, cluster merging, and vehicle detection, then they will be verified until they are labeled with an iterative process, while regions with labeled particles are carried out with the same process without passing through initial clustering. Whereas the detection of the vehicle region will be carried out by looking at the labeled particles which are assumed to be vehicles, their characteristics are the particles that are close to each other, moving congenial, but this is not necessarily directly considered as a vehicle region, a verification process needs to be done its characteristics by measuring its area, location, and shape of the cluster. Then in the tracking and counting stages, the vehicle region will be checked whether moving through the specified line will be counted as a vehicle. This research conducted experiments on six types of offline videos where the proposed method has the most accurate calculation results when compared with previous research, namely 1096 of the original value of 1081 but there are 40 vehicles that were not detected correctly and 55 vehicles were detected twice. Other research conducted by (Sun et al., 2017) proposed a traffic counting method using a multi- channel and multi-task convolutional neural networks (CNN) network method on still images. In this way, not only vehicles that pass but vehicles that are parked or may break down in the middle of the road will be detected. This idea is very good because congestion is not only caused by the volume of vehicles that pass a road but with a car parked on the road or maybe a car that might strike in the middle of the road can make traffic flow stagnate. Some important steps proposed in this method begin with RGB image input and then converted into two images, namely grayscale and illumination invariance. Then the learning process, classification and finally the vehicle calculation data and density level are generated. This research also used the camera display classification to improve method performance. Experiments carried out on the extraction of images from many videos in the city, wherefrom the sample data all use images and then traffic on relatively straight roads. Experiment results show an increase in accuracy based on calculating the absolute deviation and relative deviation values. The two studies above are not done in real-time and certainly require relatively heavier computing because there is a clustering process in research (Barcellos et al., 2015) and the classification process in research (Sun et al., 2017). Implementing traffic counting on real-time video is certainly more challenging. The conclusions from the two studies above also stated that in future research it is necessary to implement the method in real-time video. This is certainly more complex and must pay attention to the computational time needed, the proposed method must also be wiser because more things need to be considered, so it may be necessary to trim the algorithm that has no significant effect. In research conducted by (Moutakki et al., 2017) vehicle counting method is implemented in the GRAM Road- Traffic Monitoring dataset which is designed for real-time video. In this research, it is proposed that occlusion handling is applied to improve the accuracy of vehicle classification based on the background subtraction method using the codebook model. There are three main stages in this research, namely the process of segmentation, classification and counting. The segmentation process is used to search for the region of interest (ROI) at this stage the background subtraction, filtering and contour detection methods are used. At the classification stage, histogram of oriented gradient (HOG) and support vector mechine (SVM) are used which are associated with occlusion method horizontally and vertically. At the last stage, vehicle counting is done when the object moves through the specified zone. Experiments carried out on the GRAM Road-Traffic Monitoring dataset, which obtained detection accuracy of 99.45%. 126
Transport and Telecommunication Vol. 21, no.2, 2020 Other studies conducted by (Setiadi et al., 2019) In this research a real-time vehicle counting system was built based on inputs from CCTV from the Semarang City, Indonesia Transportation Agency (DISHUB). The system is built based on web applications with the Python programming language. Flask microframework is also used to process video streaming as input and display on the system. Background subtraction is a segmentation method used to detect vehicles. In detail, the process of segmentation after background subtraction is thresholding using a binary model, the erosion and the dilation process. Then the object is detected using region bound based on the chain code method, then the detected object is marked with active contour. Then the object tracking process is carried out to do the counting process when passing the specified path. Based on testing, the proposed method only produces an accuracy of 71.38%. This is caused by many factors because this application is implemented in realtime. In addition to the need for improved methods, CCTV placement factors, video quality, and internet connections are very influential matters. The location of CCTV in the area of Tugu Muda Semarang, Indonesia, monitors the road that has five intersections with very high-density levels at certain hours. From some of the related research above, this research will propose an increase in vehicle counter accuracy using the background subtraction method in real-time traffic monitoring. 3. Proposed Method This research was built to improve the accuracy of the real-time traffic monitoring system that was proposed earlier by (Setiadi et al., 2019), where the proposed method is background subtraction as the main method in the segmentation stage. This method is also still widely proposed in various researches in the last five years as in research (Fernández-Sanjurjo et al., 2019; Huang et al., 2017; Moutakki et al., 2017; Pun & Lin, 2016). In several articles a review of object detection especially vehicles written by (Bouwmans et al., 2019; Yang & Pun-Cheng, 2018) it is said that the determination of the threshold is one of the things that greatly influence the results of background and foreground separation in the background subtraction method. Where the pixel value is greater than the threshold will be detected as a foreground area and vice versa is detected as a background area so that it will produce objects that will be detected in binary images. In this case, the foreground area is a candidate for the vehicle object. The quality of the results of the segmentation will determine the accuracy of detection, so in this research, the use of the Threshold method will be modified. In detail, the stages of the proposed method will be described in Figure 1. Access the CCTV URL Split video frame by frame Perform background subtraction on each frame using truncate thresholding Perform dilation to Perform erosion to emphasize the object minimize noise shape Use active contour and chain code to detect objects Performs object tracking Perform counting if the object passes the specified path Figure 1. Proposed method 127
Transport and Telecommunication Vol. 21, no.2, 2020 4. Implementation and Analysis At the implementation stage, the application is built using the Python programming language and OpenCV as a tool, the video is taken directly from the CCTV of the Dinas Perhubungan (DISHUB) Semarang City located in the area around Tugu Muda when viewed on google maps located at the point (-6.984394, 110.409470). Please note that this area has an intersection that connects five main roads in the Semarang city, i.e. Pemuda, Imam Bonjol, Mgr. Soegijapranata, Pandanaran, and dr. Sutomo. Figure 2 is a description of the traffic around the Tugu Muda area and one of the capture frames taken from CCTV on the Pandanaran road used in this research. Due to a large number of intersections and their location in the middle of Semarang city, the level of traffic density is very high during rush hour, so that it becomes a challenge in building the vehicle counting system. (a) (b) Figure 2. (a) Description of traffic around the Tugu Muda area (b) sample of capture frame from CCTV used Live stream video can be accessed via rtsp://www.lalinsemarang.info:1935/live/tugumuda.stream, using the OpenCV video library can be processed and processed for the next step described in detail below. 4.1. Background subtraction and truncate threshold The video taken from CCTV has a resolution of 352 × 288 pixels. In the initial stages of the video will be separated frame by frame to do background subtraction. The background subtraction process uses the adaptive Gaussian mixture (MOG2) method, this method was chosen because it has good and fast performance (Trnovszký et al., 2017). Furthermore, the thresholding process uses the truncate method which can be calculated by Eq. (1)(Bradski & Kaehler, 2008). (1) 128
Transport and Telecommunication Vol. 21, no.2, 2020 Where is the threshold, and are the pixel coordinates, is the destination pixel, is the source pixel, and is the maximum intensity value. The result of this stage is a binary image, where the sample results of this process are presented in Figure 3. Figure 3. Sample frame result after background subtraction and truncate thresholding 4.2. Morphology using Erosion and Dilation At this stage two morphological operations are used, namely erosion and dilation which function to obtain a more optimal object. Erosion operations are performed first, functioning to remove noise and objects that are considered useless, while dilation operations are used to thicken the area of the object to facilitate the detection process. In Figure 4 the results of the erosion and dilation process are presented. Figure 4. Sample result after erosion (left) and dilation (right) 4.3. Detecting Vehicle Figure 5. Detecting object using chain code and region bound (left) then added bounding rectangle (right) 129
Transport and Telecommunication Vol. 21, no.2, 2020 At this stage, the object detection process is used using chain code and active contour, where the system looks for the shape of objects that are found using bound regions by detecting each corner so as to form a chain pattern. After the object is found and marked in the form of a chain pattern the object will be marked with a green box to make it clear that the object is a vehicle. At this stage the object area is also limited to a certain size, to eliminate small objects instead of passing vehicles, whether it be pedestrians or other smaller objects. This size also needs to be adjusted to the size of the frame resolution and repeated observations at the experimental stage. 4.4. Tracking and Counting Vehicle After the object is found and marked with a green bounding rectangle, every movement of the object will be tracked. This aims to validate that the object captured is a vehicle if the moving object starts from the white line (the initial tracking line) and crosses the red line (the final tracking line) then will be counted as a vehicle object, if it does not cross the red line then the object is not counted as a vehicle. For the record, because of the location of the CCTV, the video captured passes through several branches of the road, so in order to facilitate tracking the white and red lines are placed in such a way as to track the vehicle from the direction of the Pandanran road towards Tugu Muda, in detail, see the sample frame tracking in Figure 6. (a) (b) (c) (d) Figure 6. Sample frame tracking 4.5. Application GUI and Results All the methods described above are implemented in a web-based application built with the Python programming language. Because tracking is real-time, the tracking results are summarized in some vehicle calculation statistics every hour. For example, the data presented in Figure 7 during office hours there are a total of more than 1000 vehicles that pass every hour. Where vehicles are classified into two based on their sizes, such as cars, trucks, and buses are large vehicles and small vehicles are motorcycle. Due to the large amount, from this data real-time video then samples are taken to calculate the accuracy. This video sample is divided into three times: traffic in the morning, day time, and afternoon. System calculations will be compared with calculations based on manual observations. The calculation accuracy results are presented in Table 1. Tabel 1. Accuracy Testing Video Duration (in Proposed Accuracy Time Real Count Error seconds) Method Count percentage Morning 54 164 160 4 97.56% Day time 24 66 64 2 96.97% Afternoon 44 123 115 8 93.50% 130
Transport and Telecommunication Vol. 21, no.2, 2020 Figure 7. Web-based system traffic monitoring (left) and statistic report (right) 4.6. Comparison As previously discussed, the proposed method is the result of developing a system that has been published previously in research (Setiadi et al., 2019). The basic difference is the implementation of thresholding, which uses the truncate threshold. With the same data set the results are compared, where a very significant increase in results is shown in Figure 8. Comparison with Previous Method 180 160 140 Vehicle Counter 120 100 80 60 40 20 0 Morning Daytime Afternoon Real Count Method in (Setiadi et al., 2019) Proposed Method Count Figure 8. Comparison with Previous Methods Besides this method is also compared with other methods with different datasets and road traffic, presented in Table 2. Tabel 2. Comparison with previous method (different dataset and road traffic) Average accuracy Method Segmentation method Background Model Vehicle Type percentage (Lei et al., 2008) Background subtraction Adaptive background Cars only 84.77% estimation (Mohana et al., 2009) Optical Flow × Cars only 94.04% (Huang et al., 2012) Background subtraction Adaptive background Cars and bikes 96.9% estimation (Moutakki et al., 2017) Background subtraction Codebook Model Cars, bikes, and trucks 99.45% Proposed Background subtraction Adaptive Gaussian Small vehicles (bikes) 96.01% mixture (MOG2) and big vehicles (cars, trucks, and bus) 131
Transport and Telecommunication Vol. 21, no.2, 2020 5. Conclusions This research proposes a method for calculating the number of vehicles with implementation in real-time data. In the implementation process not only is the accuracy of the method required, but the speed of computing must also be adjusted to the internet connection and available hardware. This research was built with the aim to be real implemented so that the proposed method is also adapted to various conditions in the field, even though testing has not been done in rainy weather or night. In normal circumstances that are in the morning, day time and afternoon produced relatively very good accuracy, although not the best when compared with previous research. But it should also be noted that traffic in Indonesia, especially in large cities is very dense and even quite chaotic, so the implementation of methods in applications is relatively difficult and challenging. Using background subtraction based on truncate thresholding can provide a very significant increase in accuracy when compared to binary thresholding (standard). Increased accuracy by more than 20% so that vehicle counter accuracy reaches 96.01%. In further research, this method certainly still needs improvements such as the addition of occlusion handling and a more detailed vehicle classification. References 1. Arinaldi, A., Pradana, J. A., & Gurusinga, A. A. (2018). Detection and classification of vehicles for traffic video analytics. Procedia Computer Science, 144, 259–268. DOI:10.1016/j.procs.2018.10.527 2. Badan Pusat Statistik. (2017). Perkembangan Jumlah Kendaraan Bermotor Menurut Jenis, 1949- 2017. DOI:10.1055/s-2008-1040325 3. Badan Pusat Statistik. (2020). Sensus Penduduk 2020 - Satu Data Kependudukan Indonesia. Retrieved January 6, 2020, from https://www.bps.go.id/sp2020/slide-1.html#slide=7 4. Barcellos, P., Bouvié, C., Escouto, F. L., & Scharcanski, J. (2015). A novel video based system for detecting and counting vehicles at user-defined virtual loops. Expert Systems with Applications, 42(4), 1845–1856. DOI:10.1016/j.eswa.2014.09.045 5. Bouwmans, T., Javed, S., Sultana, M., & Jung, S. K. (2019, September 1). Deep neural network concepts for background subtraction: A systematic review and comparative evaluation. Neural Networks, Vol. 117, pp. 8–66. DOI:10.1016/j.neunet.2019.04.024 6. Bradski, G., & Kaehler, A. (2008). Learning OpenCV (First Edit; M. Loukides, Ed.). Retrieved from https://www.bogotobogo.com/cplusplus/files/OReilly Learning OpenCV.pdf 7. Davis, S. C., Williams, S. E., & Boundy, R. G. (2018). Transportation Energy Data Book. Retrieved from https://tedb.ornl.gov/ 8. Fernández-Sanjurjo, M., Bosquet, B., Mucientes, M., & Brea, V. M. (2019). Real-time visual detection and tracking system for traffic monitoring. Engineering Applications of Artificial Intelligence, 85, 410–420. DOI:10.1016/j.engappai.2019.07.005 9. Gaidash, V., & Grakovski, A. (2016). “Mass Centre” Vectorization Algorithm for Vehicle’s Counting Portable Video System. Transport and Telecommunication Journal, 17(4), 289–297. Retrieved from https://content.sciendo.com/view/journals/ttj/17/4/article-p289.xml?rskey=vMNxen&result=6 10. Huang, D.-Y., Chen, C.-H., Hu, W.-C., Yi, S.-C., & Lin, Y.-F. (2012). Feature-based vehicle flow analysis and measurement for a real-time traffic surveillance system. 3(3), 282–296. 11. Huang, D. Y., Chen, C. H., Chen, T. Y., Hu, W. C., & Feng, K. W. (2017). Vehicle detection and inter-vehicle distance estimation using single-lens video camera on urban/suburb roads. Journal of Visual Communication and Image Representation, 46, 250–259. DOI:10.1016/j.jvcir.2017.04.006 12. Lei, M., Lefloch, D., Gouton, P., & Madani, K. (2008). A video-based real-time vehicle counting system using adaptive background method. SITIS 2008 - Proceedings of the 4th International Conference on Signal Image Technology and Internet Based Systems, 523–528. DOI:10.1109/SITIS.2008.91 13. Mandellos, N. A., Keramitsoglou, I., & Kiranoudis, C. T. (2011). A background subtraction algorithm for detecting and tracking vehicles. Expert Systems with Applications, 38(3), 1619–1631. DOI:10.1016/j.eswa.2010.07.083 14. Mohana, H. S., Ashwathakumar, M., & Shivakumar, G. (2009). Vehicle detection and counting by using real time traffic flux through differential technique and performance evaluation. Proceedings - International Conference on Advanced Computer Control, ICACC 2009, 791–795. DOI:10.1109/ICACC.2009.149 15. Moutakki, Z., Ouloul, I. M., Afdel, K., & Amghar, A. (2017). Real-Time Video Surveillance System for Traffic Management with Background Subtraction Using Codebook Model and Occlusion 132
Transport and Telecommunication Vol. 21, no.2, 2020 Handling. Transport and Telecommunication Journal, 18(4), 297–306. Retrieved from https://content.sciendo.com/view/journals/ttj/18/4/article-p297.xml?rskey=vMNxen&result=8 16. Pun, C. M., & Lin, C. (2016). A real-time detector for parked vehicles based on hybrid background modeling. Journal of Visual Communication and Image Representation, 39, 82–92. DOI:10.1016/j.jvcir.2016.05.009 17. Setiadi, D. R. I. M., Fratama, R. R., Partiningsih, N. D. A., Rachmawanto, E. H., Sari, C. A., & Andono, P. N. (2019). Real-time multiple vehicle counter using background subtraction for traffic monitoring system. Proceedings - 2019 International Seminar on Application for Technology of Information and Communication: Industry 4.0: Retrospect, Prospect, and Challenges, ISemantic 2019, 23–27. DOI:10.1109/ISEMANTIC.2019.8884277 18. Sperling, D., & Gordon, D. (2008). Two Billion Cars Transforming a Culture. 19. Sun, M., Wang, Y., Li, T., Lv, J., & Wu, J. (2017). Vehicle counting in crowded scenes with multi- channel and multi-task convolutional neural networks. Journal of Visual Communication and Image Representation, 49, 412–419. DOI:10.1016/j.jvcir.2017.10.002 20. Trnovszký, T., Sýkora, P., & Hudec, R. (2017). Comparison of Background Subtraction Methods on Near Infra-Red Spectrum Video Sequences. Procedia Engineering, 192, 887–892. DOI:10.1016/j.proeng.2017.06.153 21. Yang, Z., & Pun-Cheng, L. S. C. (2018, January 1). Vehicle detection in intelligent transportation systems and its applications under varying environments: A review. Image and Vision Computing, Vol. 69, pp. 143–154. DOI:10.1016/j.imavis.2017.09.008 133
You can also read