MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION GRADUATION THESIS INFORMATION TECHNOLOGY BUIDING A VEHICLE DETECTION AND COUNTING SYSTEM INSTRUCTOR: Mr.TRAN NHAT QUANG STUDENT: PHAN DUONG GIAC NGAN LE QUANG DUY SKL012406 Ho Chi Minh City, 2023 HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY OF INTERNATIONAL EDUCATION -----oOo----- GRADUATION PROJECT BUIDING A VEHICLE DETECTION AND COUNTING SYSTEM Instructor: Mr. Tran Nhat Quang Group’s member 1. Phan Duong Giac Ngan 19110096 2. Le Quang Duy 19110072 HO CHI MINH CITY - 2023 SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom - Happiness ********* MISSIONS ON PROJECT Student Name: Phan Duong Giac Ngan ID: 19110096 Class: 19110CLA1 Student Name: Le Quang Duy ID: 19110072 Class: 19110CLA3 Major: Information Technology Lecturer: Mr.
Tran Nhat Quang Implementation Content: Theory: Understand methods of vehicle detection and counting, photo and video processing. Understanding libraries and frameworks: OpenCV, Tensorflow Object Detection API… Practice: Building a Vehicle Detection and Counting System: o Collect dataset and pre-processing data. o Apply algorithms, function and training model. o Evaluate and improve the system.
Processing time: 15 weeks (11/09/2023 - 25/12/2023) HCMC, December, 25th,2022 Program Chair Instructor (sign and write full name) (signed and write full name) SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom - Happiness ********* INSTRUCTOR COMMENTARY Group’s member: Student’s Name Student’s ID Class Phan Duong Giac Ngan 19110096 19110CLA1 Le Quang Duy 19110072 19110CLA3 Major: Information Technology Project name: Building a Vehicle Detection and Counting System. Tran Nhat Quang COMMENTARY 1. About the topic content and workload a. Theory ✓ Survey famous Vehicle Detection and Counting System.
Find out strengths and weaknesses from which to set requirements for the project. ✓ Learn about OpenCV [1], Tensorflow Object Detection API [2]. Proficient use of additional libraries. From there, apply it effectively to the project.
✓ Preprocess images with Histogram Equalization [3] and Gaussian Blur [4]. Experiment ✓ Connect, use libraries and successfully build a Vehicle Detection and Couting System with full basic and advanced functions. ✓ Full diagrams for each role and functions of the application. Links Github: https://github.com/np119411/Vehicle-Detection-System Pyinstaller: We did not publish it into an exe file because after publishing, the program had a few errors.
Advantages ✓ Includes basic and advanced functionality. ✓ Friendly interface and easy to use. ✓ Convenient to open a video and detect vehicle in this video. Disadvantages The program is a bit consuming memory and running slowly.
Detect wrong vehicles in a low-light video. Recommend for protection or not?. (Text: ) HCMC, Date ……Month …… Year …. Tran Nhat Quang SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom - Happiness ********* REVIEWER’S COMMENTARY Group’s member: Student’s Name Student’s ID Phan Duong Giac Ngan 19110096 Le Quang Duy 19110072 Major: Information Technology Project name: Building a Vehicle Detection and Couting System.
Nguyen Tran Thi Van COMMENTARY 1. About the topic content and workload. Recommend for protection or not?. (Text: ) HCMC, Date ……Month …… Year ….
Nguyen Tran Thi Van TABLE OF CONTENTS ACKNOWLEDGMENTS. The reason for choosing the topic .3 CHAPTER 2: THEORETICAL FUNDAMENTAL. Overview of Single Shot Detector (SSD). Tensorflow Object Detection.
Hard Negative Mining. Non-Maximum Suppression. Center-Size Coordinates .12 CHAPTER 3: SYSTEM REQUIREMENTS. Selection of Detection Algorithm.
Detection and Localization .14 CHAPTER 4: IMPLEMENTATION & EVALUATION. Choosing a video for data collection. Convert XML file to Record file and Create pbtxt file. Use Google Colab to train.
Download and apply model for system. Post-process the output data from Detection process. Non-Max Suppression. Tracking and Counting.
Advantages and Disadvantages. 36 TABLE OF FIGURES Figure 1: SSD layers .4 Figure 2: Histogram Equalization .7 Figure 3: Gaussian Blur .9 Figure 4: OS Module .11 Figure 5: Glob and Pandas Module.12 Figure 6: Data Processing .15 Figure 7: Data Processing .16 Figure 8: Data Processing .16 Figure 9: Data Processing .16 Figure 10: Image Processing .17 Figure 11: Image Processing .18 Figure 12: Image Processing .19 Figure 13: Image Processing .19 Figure 14: Image Processing (Before and After) .20 Figure 15: Color Histogram (Before and After) .20 Figure 16: Label Image .21 Figure 17: Label Image .21 Figure 18: Label Image .22 Figure 19: Convert XML to CSV, CSV to Record .23 Figure 20: Google Colab Training .23 Figure 21: Saved Model .24 Figure 22: Evaluate Trained Model .24 Figure 23: Evaluate Trained Model .26 Figure 24: Evaluate Learning Rate .27 Figure 25: Count Processing .28 Figure 26: Tracker file .28 Figure 27: Count Processing .28 Figure 28: Count Processing .29 Figure 29: Non-max Suppression .29 Figure 30: Count Processing .30 Figure 31: Count Processing .31 Figure 32: User Interface .32 Figure 33: Open A Video .33 Figure 34: Detection Result .33 ACKNOWLEDGMENTS To complete the graduation thesis topic "Building a Vehicle Detection and Counting System ", we would like to express our sincere thanks to Mr. Tran Nhat Quang for his guidance, guidance and suggestions throughout the project completion. Additionally, we would like to express our sincere appreciation for the devotion of the instructors at the Faculty of International Education in general and the Information Technology sector in particular for providing the necessary information to help us create the foundation for our future undertakings.
We now have all we need to study about this subject and do well on it. Moreover, we want to thank our classmates for supplying us with a plethora of knowledge and pertinent facts that helped us to strengthen our thesis. During the process of making the report, we tried very hard to learn and research, but it is inevitable that errors and as well as limited experience, the report may have errors. We hope to receive suggestions and opinions from him to learn more knowledge and draw lessons for ourselves as a premise to successfully complete the following topics.
Finally, we want to wish you continued health and achievement in your career as a people development. I want to thank you again for your kindness. Best regards! Ho Chi Minh City, December 2023 Students Phan Duong Giac Ngan Le Quang Duy Page | 1 Chapter 1: Introduction CHAPTER 1: INTRODUCTION 1. The reason for choosing the topic The creation of a reliable vehicle detection and counting system is crucial in addressing the escalating challenges of modern urban traffic congestion.
Beyond enhancing traffic safety and efficiency, this system provides vital data on traffic patterns, aiding in traffic planning and incident prediction. Its impact extends to: Daily life. Optimizing traffic lights. Reducing wait times.
Improving the overall efficiency of travel. Moreover, the system contributes to the development of public applications like online traffic maps, ensuring users are well-informed about road conditions. Ultimately, the integration of a vehicle detection and counting system is instrumental in building smart cities, fostering a secure, efficient, and intelligent traffic environment that enhances the overall quality of life for communities. TOPIC NAME: “Building a Vehicle Detection and Couting System”.
Objectives In the modern world, vehicle detection systems are commonplace and silently monitor our roads and highways. These observant eyes are more than just sophisticated devices; they play a vital role in accomplishing several important goals that improve the safety, efficiency, and smoothness of our transportation networks. Vehicle detection systems are essential tools for building safer, more seamless, and effective transportation systems. They are not just amazing pieces of technology.
These technologies are subtly reshaping the future of our roads and creating a more intelligent transportation environment for everybody, from improving safety and security to streamlining traffic and collecting important data. So our goals are to build a system that can detect vehicle and to an extend counting vehicle to help analyzing the traffic density Page | 2 Chapter 1: Introduction 1. Methodology To build a Vehicle Detection and Counting System, we start by collecting a video for our dataset. We then use Histogram Equalization and Gaussian Blur to handle image quality this data.
Next, we use the SSD MobileNet algorithm and train our model using Google Colab, which helps us with the process. After training, we test the system to see how well it works and find any mistakes. Once we identify errors, we evaluate the system's accuracy and make improvements to fix the issues. This continuous cycle of testing, evaluating, and improving ensures that our system becomes more reliable over time.
The goal is to create a system that accurately detects and counts vehicles, making traffic management more efficient. Scope Improve traffic and reduce congestion: By providing accurate information on traffic density and road conditions, vehicle detection and counting systems help traffic authorities increase their predictive capacity. traffic prediction, management and coordination. This helps to reduce congestion, improve information flow and reduce travel time for people.
Improve traffic safety: The vehicle detection and counting system assists in detecting hazards and dangerous conditions on the road. Authorities can use this information to develop safety measures such as speed monitoring, hazard warnings and safe routes. This helps to reduce the number of traffic accidents and protect the lives and property of members in traffic. Optimizing traffic planning and urban development: Traffic detection and counting data provides important information for city planning and development.
Management and planning agencies can use this data to assess road system performance, predict road transport needs, and make smart decisions about infrastructure development and urban planning. Page | 3 Chapter 2: Theoretical Fundamental CHAPTER 2: THEORETICAL FUNDAMENTAL 2. Overview of Single Shot Detector (SSD) The SSD is a purely convolutional neural network (CNN) that we can organize into three parts: • Base convolutions derived from an existing image classification architecture that will provide lower-level feature maps. • Auxiliary convolutions added on top of the base network that will provide higher-level feature maps.
• Prediction convolutions that will locate and identify objects in these feature maps. The research demonstrates two variants of the model called the SSD300 and the SSD512. The suffixes represent the size of the input image. Although the two networks differ slightly in the way they are constructed, they are in principle the same.
The SSD512 is just a larger network and results in marginally better performance. Figure 1: SSD layers 2.1 Advantages • Fast and Efficient: SSD MobileNet is designed to be fast and efficient, making it suitable for real-time object detection on mobile and embedded devices. It achieves a good balance between accuracy and speed, allowing for real-time processing even on devices with limited computational resources. Page | 4 Chapter 2: Theoretical Fundamental • High Accuracy: Despite its efficiency, SSD MobileNet maintains a high level of accuracy in object detection.
It leverages the power of deep neural networks to accurately identify and locate objects in images or videos. • Small Model Size: SSD MobileNet has a small model size, which makes it suitable for deployment on resource-constrained devices with limited storage capacity. It enables efficient deployment and reduces the memory footprint, making it ideal for mobile and embedded applications. • Easy Integration: SSD MobileNet is readily available as a pre-trained model in popular deep learning frameworks such as TensorFlow and PyTorch.
Its ease of integration allows developers to quickly incorporate object detection capabilities into their applications without having to build the model from scratch.2 Disadvantages ● Lower Accuracy compared to larger models: While SSD MobileNet achieves a good balance between accuracy and speed, it may not perform as well as larger and more complex models in terms of accuracy. This trade-off is necessary to maintain efficiency and real-time processing capabilities. ● Limited Flexibility: SSD MobileNet is a fixed architecture model, which means it has limitations in terms of architectural modifications or customizations. Developers may not have as much flexibility to fine-tune or modify the architecture compared to more flexible models.
Tensorflow Object Detection The TensorFlow Object Detection API, constructed on the TensorFlow platform, is an open-source framework designed to simplify the creation, training, and deployment of object detection models.