Annual: 2019

AP002 »
Vision Based Traffic Control with Custom CNN Accelerator for Object Detection
📁Machine Learning
👤Abarajithan Gnaneswaran
 (University of Moratuwa)
📅Sep 23, 2019
Regional Final
Community Award

👀 8776   💬 165

AP002 » Vision Based Traffic Control with Custom CNN Accelerator for Object Detection


Traffic congestion is a widespread problem that results in the loss of billions of dollars annually, valuable time of citizens and in some cases: invaluable human lives. By utilizing our custom designed CNN accelerator, we propose an edge-computing solution for this problem, that is both cost-effective and scalable. For developing countries like Sri Lanka, our vision-based traffic control on FPGA would be an ideal solution as described below.

In most countries, traffic flow is controlled by traffic lights with pre-set timers. In Sri Lanka, this often causes congestion during peak hours as the system is not sensitive to the traffic levels in each lane of an intersection. To solve this, the traffic policemen usually turn off the lights and manually control the traffic during peak hours. However, the policemen are unable to visually judge the level of traffic in each lane from their vantage point close to the ground.

An automated solution to this problem would be vision-based traffic sensing. However, the neural networks that excel in machine vision tasks require powerful GPUs or dedicated hardware. Laying cables along the road to transmit video feeds to control centers would require expensive infrastructure which is infeasible for a developing country like Sri Lanka.

Therefore, we present an implementation of a traffic sensing algorithm that is based on Object Detection on FPGA as a cost-effective, scalable, edge solution. We use YOLOv2, a state-of-the-art CNN for object detection accelerated through our custom CNN accelerator with post processing done on the ARM processor.

Custom CNN Accelerator Design:

A unique aspect of our project is, we design and implement a brand-new highly parallelized CNN accelerator whose single core at 100 Mhz can run a 384 x 384 RGB image through YOLOv2: (a 23-layer state-of-the-art object detection CNN with 2 billion floating point multiplications, 6 million comparisons, 8 billion additions) within 0.2 seconds. Multiple such cores can be implemented in parallel / series inside an FPGA to further improve throughput. The architecture can also be used to accelerate several other neural networks with slight modifications.

Project Proposal

1. High-level Project Description

2. Block Diagram

3. Intel FPGA Virtues in Your Project

4. Design Introduction

5. Function Description

6. Performance Parameters

7. Design Architecture


Great job ! Support!
🕒 Jul 13, 2019 11:46 PM
Ansaff Ahamed Mohamed Ashraff
Keep up the good work and all the best team
🕒 Jul 08, 2019 07:59 PM
Luka Mestrovic
Great work!
🕒 Jul 08, 2019 04:57 PM
Wennan Sun
Great project. All the best !!!
🕒 Jul 08, 2019 03:59 PM
Julian Paris Ortiz Ortiz
Good idea!
🕒 Jul 08, 2019 02:30 PM
Tilak Dissanayake
Aba and team great work!

This is the kind of real world product design engineering projects that we need rather than the many science fair projects that come out of universities!

It is addressing a real need, and the way that you guys have approached it is immensely doable taking into consideration the many operational issues that usually cause projects to fail. The only barrier will be someone in the GoSL wanting to buy a much more pricey (and most likely inferior) imported product since the commission they get will be larger! ;-(
🕒 Jul 08, 2019 12:21 PM
Thank you for your encouragement!

It is a rare privilege for us to impress a renowned entrepreneur and a product design engineer with uncompromising standards like you.

We will definitely work hard with dedication on successfully implementing this project and building a prototype. I will keep you updated on the progress.

🕒 Jul 08, 2019 02:01 PM
Guo Ying Ying
Good job!
🕒 Jul 07, 2019 11:42 PM
Sanoojan Baliah
Superb work!!!!!!!!!!!!!!!
🕒 Jul 07, 2019 11:35 PM
Kisal Randula
Excellent plan
🕒 Jul 07, 2019 11:23 PM
S. L. Sachin Madhushanka
Will be very opportune in future!
🕒 Jul 07, 2019 10:50 PM
Isuru Senevirathne
Innovative !
🕒 Jul 07, 2019 10:31 PM
Amanda S.Manage
Great work! All the best!
🕒 Jul 07, 2019 09:41 PM
Govindu Dilshan
good job... keep it up
🕒 Jul 07, 2019 06:38 PM
Hope your team will be able to make University of Moratuwa proud.
🕒 Jul 07, 2019 03:48 PM
Ranjan Ramanayake
Do well. Hope to see this application in practice in Sri Lanka. Cheers
🕒 Jul 07, 2019 03:46 PM
HMJ Abeysekera
Excellent work brother. Good luck
🕒 Jul 07, 2019 03:40 PM
Matheesha Abeysekera
I wish all the very best for your project.
🕒 Jul 07, 2019 03:36 PM
Good work. All the best.
🕒 Jul 07, 2019 03:35 PM
Thamidu Naveen
Excellent work. All the best !!!
🕒 Jul 07, 2019 02:41 PM
Shanaka Bandara
Excellent work
🕒 Jul 07, 2019 01:37 PM
Isuru Sajith
It's great ....
🕒 Jul 07, 2019 11:28 AM
Birte Meyer
Great work!!
🕒 Jul 07, 2019 04:27 AM
Naveen Dushyantha
Excellent work. Good luck
🕒 Jul 07, 2019 04:27 AM
Dambure Hewage Lakshitha Asanka
Good stuff for transport engineering in Sri Lanka..!!! Great job guys..!!!
🕒 Jul 07, 2019 04:17 AM
Hasinthaka Eranga Hewapathirana
Excellent project. Keep up the good work!
🕒 Jul 07, 2019 04:05 AM
Indrani Gajanayake
Excellent work. Looking forward to real-world implementation, I wish you all the success!
🕒 Jul 07, 2019 03:54 AM
Mallawa Thanthrige Chanaka Jaliya
Good work. All the best team!!
🕒 Jul 07, 2019 03:33 AM
Mayadunna Rusiri
🕒 Jul 07, 2019 03:23 AM
Randula Bandara
Good Luck guys!
🕒 Jul 07, 2019 02:39 AM
Nice Idea, All the best..
🕒 Jul 07, 2019 02:10 AM
Sajani thisara
Great project idea.good luck
🕒 Jul 07, 2019 12:37 AM
Sajeeva Jeyakumar
Great work guys.
Good luck.
🕒 Jul 06, 2019 10:40 PM
Thilina Thilakarathna
Great work guys. Good luck !!
🕒 Jul 06, 2019 05:07 PM
Vinura Dhananjaya
Great project and work! Keep it up!
🕒 Jul 06, 2019 02:00 PM
Shehan Ishanka
Nice solution. Good luck guys.
🕒 Jul 06, 2019 11:28 AM
Hasindu Sulakshitha Samaraweera
Excellent work. Wish you all the best
🕒 Jul 06, 2019 05:12 AM
Radershan Suguneswaran
Excellent Idea! An essential project for countries that were facing a higher level of traffic congestion. Looking forward to seeing this project on the action. Best of luck.
🕒 Jul 06, 2019 02:32 AM
Great work and good luck for your success
🕒 Jul 06, 2019 02:07 AM
Mathan Piragash
Excellent guys. All the best.
🕒 Jul 06, 2019 02:02 AM
Nivetha Yogendran
Good Luck !!!
🕒 Jul 06, 2019 12:24 AM
Kowsikanth Kuganathan
Looking forward for real-world implementation, esp. in Sri Lanka.
🕒 Jul 05, 2019 11:25 PM
Great work
🕒 Jul 05, 2019 08:09 PM
Yasith Perera
Great work!!
🕒 Jul 05, 2019 05:59 PM
Dinindu Kudagama
Budu Saranai .!
🕒 Jul 05, 2019 05:11 PM
Dinindu Kudagama
බුදු සරණයි ..!
🕒 Jul 05, 2019 05:10 PM
Ravindu Fernando
Wish you all the best to make this project a reality.
🕒 Jul 05, 2019 04:35 PM
Ishara Priyadarshana
Great project idea. Way to go!
🕒 Jul 05, 2019 03:56 PM
Great idea. Good luck !!
🕒 Jul 05, 2019 03:48 PM
kasun sanjaya
Great idea! All the best!
🕒 Jul 05, 2019 01:51 PM
Anuradha Priyankara
Really useful and innovative project. Wish you good luck!
🕒 Jul 05, 2019 10:41 AM
Amali Herath
Great work guys! All the best!
🕒 Jul 05, 2019 10:15 AM
Sathira Tennakoon
This is great! All the best!!!
🕒 Jul 05, 2019 10:05 AM
Dinesh Madusanka
A Great idea
🕒 Jul 05, 2019 04:05 AM
Lokesha Rasanjalee
Good job..Wish you all the best..!!! :-)
🕒 Jul 05, 2019 03:33 AM
Orpheus Magnusson
Great idea! All the best!
🕒 Jul 05, 2019 03:09 AM
Supun Amarasingha
Excellent work.
🕒 Jul 05, 2019 02:53 AM
Gammampilage Uthpala Samadhi Gammampila
All the best guys!!!
🕒 Jul 05, 2019 02:51 AM
Dimuthu Dias
Great work man
🕒 Jul 05, 2019 02:47 AM
Shehan de Silva
Excellent work guys !! Wish you all the very best!!
🕒 Jul 05, 2019 02:41 AM
Nalinka Heshan
Great work, good luck
🕒 Jul 05, 2019 02:31 AM
Dohitha Yapa
All the best!
🕒 Jul 05, 2019 02:22 AM
Good job
🕒 Jul 05, 2019 02:19 AM
Chandula Nethmal
Good work guys! Keep it up.
🕒 Jul 05, 2019 02:16 AM
Good job
🕒 Jul 05, 2019 02:15 AM
Good job! Really useful!
Try to get government approval and implement
🕒 Jul 05, 2019 02:13 AM
Excellent job guys! .. it's very useful. Try to execute with entire Sri Lanka.. nice job!
🕒 Jul 05, 2019 02:10 AM
Kavindu Pasan
Great idea... I wish if I could join with u...
🕒 Jul 05, 2019 02:07 AM
We would love to collaborate / share ideas. Contact me on
🕒 Jul 05, 2019 02:15 AM
Shevan Jayawardena
Excellent project. Good luck.
🕒 Jul 05, 2019 01:59 AM
Maleesha Lasith Weerasekara
congratulations on your achievement.
🕒 Jul 05, 2019 01:58 AM
Hanthanadewage Minoli Shiranthi Silva
Great work ! Good luck
🕒 Jul 05, 2019 01:56 AM
Chinthalanka Wijesinghe
Excellent project!
Good luck!
🕒 Jul 05, 2019 01:45 AM
Hiran Perera
Much needed project. Wish you best of luck!
🕒 Jul 05, 2019 01:42 AM
Lahiru Dilshan
Well done boys...
🕒 Jul 05, 2019 01:41 AM
Supun Gunawardane
Great project. keep it up guys
🕒 Jul 05, 2019 01:34 AM
Chameera Jananjaya Wijethunga
Great Work....!!!
🕒 Jul 05, 2019 01:33 AM
senith dilitha
Good job. Keep it up!!
🕒 Jul 05, 2019 01:33 AM
Nipuna Peiris
Excellent project idea. Keep up the good work.
🕒 Jul 05, 2019 01:30 AM
samith Ashan
Great project..good luck
🕒 Jul 05, 2019 01:29 AM
Pasindu dasun
Good luck uom
🕒 Jul 05, 2019 01:28 AM
Kasun Imesha
Great work..! Go ahead..
🕒 Jul 05, 2019 01:25 AM
Keep up the good work! All the best!
🕒 Jul 05, 2019 01:21 AM
Iyani Nadeni Kalupahana
Great project Idea! Wish you all the best!!
🕒 Jul 05, 2019 01:18 AM
upul rangana
well done ...
Great project. All the best !!!
🕒 Jul 05, 2019 01:00 AM
Uditha Anuranjana
Great work. Wish u all the best
🕒 Jul 05, 2019 12:55 AM
Suchinthaka Prabhashwara
Great idea...!!! Wish you the best..!!!
🕒 Jul 05, 2019 12:53 AM
Amaya Dharmasiri
great stuff!! good luck!
🕒 Jul 05, 2019 12:50 AM
Kasun Withana
Great project. Akl the best!!
🕒 Jul 05, 2019 12:48 AM
Chirath Diyagama
Good idea... Wish you success!
🕒 Jul 05, 2019 12:46 AM
Naveen Avishka
Nice idea! Good luck with your project
🕒 Jul 05, 2019 12:43 AM
Ishan Kumarasinghe
Excellent work guys.. keep it up..!!!
🕒 Jul 05, 2019 12:37 AM
Gihan Gamage
This is excellent guys. Cheers !!!
🕒 Jul 05, 2019 12:37 AM
Danuka Yasuranda Bentharavithana
Best of luck guys. Cheers!
🕒 Jul 05, 2019 12:31 AM
Hashini De Silva
Excellent idea. Good luck guys.
🕒 Jul 05, 2019 12:30 AM
This is the project that people would need!!
🕒 Jul 05, 2019 12:28 AM
Wickramarachchi Appuhamilage Dilshan Nipuna Wickramarachchi
Good project guys. Looking forward to see in practice.
🕒 Jul 05, 2019 12:25 AM
Shamil Dilshan Prematunga
Great project..!!!
🕒 Jul 05, 2019 12:24 AM
Lashini sharika jayasekara
Good luck guys
🕒 Jul 05, 2019 12:20 AM
Ravindu Rashmin
This looks like a very promising project. Good luck you guys. !
🕒 Jul 05, 2019 12:20 AM
Prasadi Kuruppu
Great idea! Good luck!
🕒 Jul 05, 2019 12:17 AM
Sandali yashodhara Jayaweera
All the best guys...!
🕒 Jul 05, 2019 12:16 AM
This is the best project I have seen!! Have trust in you guys!!
🕒 Jul 05, 2019 12:06 AM
Excellent project idea....Good luck !
🕒 Jul 05, 2019 12:00 AM
Kalani Samarathunga
Good luck guys!
🕒 Jul 04, 2019 11:58 PM
Excellent Idea for inevitable stuff.. Keep going guys
🕒 Jul 04, 2019 11:49 PM
Natasha Kularatne
Excellent work. All the best !!!
🕒 Jul 04, 2019 11:45 PM
Ravindu Buddhila Danthasinghe
Great job guys. Well done
🕒 Jul 04, 2019 11:42 PM
Aleksandr Amerikanov
This project is very interesting and could be implemented not only in Sri Lanka, but in any major city. The proposed solution is great economically-wise. I would like to know how you would determine if timings for traffic lights they end up using are optimal. Will there be some form of strict mathematical optimization involved, or would you just settle for a simple improvement in traffic on the road? It would also be wiser to use comparisons between different devices (FPGA, processors) to justify the choice of an Altera device. Do you plan to further evolve your project and potentially use it in different countries, how hard will it be to account for differences in road traffic of a different country, lane count, vehicle types and different speeds? Wish you good luck with this project!
🕒 Jul 04, 2019 01:47 AM
Aleksandr Amerikanov
Good answer. I wish you success.
🕒 Jul 04, 2019 07:00 PM
Thank you for the encouragement! We are glad you like our project.

The civil engineers who specialize in traffic management in our university have been researching optimal strategies to control traffic flow in a city and publishing algorithms for the past few years. They develop mathematical models and verify them using a traffic simulator (VISSIM). A similar approach is used by traffic flow design engineers in countries such as Vietnam and India to model their highly erratic traffic and develop optimized algorithms for that.

However, the key problem our traffic engineers face is, there is no reliable way to measure the traffic level (congestion level) to feed their algorithms. Methods like induction loops, radar and wireless sensor networks detect the presence/absence of vehicles, but not really the traffic level. Another team tried to perform vision-based traffic sensing by detecting edges and blobs in the image and passing them into a small, three layered dense neural network running on a raspberry pi. Similar research have been done in India also.

However, we believe an object detector has a better "understanding" on what to detect (vehicles), hence would be more suitable for this task. Hence, we did a preliminary analysis and found the YOLOv2 object detector performs well (even without fine tuning) in the erratic traffic conditions, while being robust to different lighting conditions, reflections, motion blur, shadows and other visual anomalies.

Our small team consists of electronics undergraduates; hence we specialize in electronic product design, digital design and machine vision. We have a co-supervisor and an adviser from the Traffic division of Civil Engineering department, who assist us with algorithm design. For the first phase of the project, we are keen on developing a reliable traffic sensing system and then test it with a simple algorithm and get empirical results, to show it is better than the static timers. If we get further funding, support and permission to test in real world, it will be relatively straightforward to combine the existing sophisticated algorithms with our traffic sensing method.

Our simple algorithm for sensing traffic level is as follows:
1. Capture photos at the last few seconds of the green light. The vehicles would be moving with the maximum speed and maximum possible separation at this point, hence counting vehicles in a frame at this point would yield a near-realistic estimate of how congested the lane is. YOLOv2 is quite robust in detecting fast moving, blurred vehicles. Also, we are more interested in counting the slow moving or stationary vehicles, since that indicates the degree of congestion.

2. Take the ratio between the area of the lane and the union of the bounding boxes of vehicles in the lane as a measure of traffic level.

3. To calculate traffic signal timing, we can receive the traffic level of each lane, then divide a pre-decided total time (delta T) in the ratio of traffic levels (such that lane with more traffic gets more time: delta ti) and add / subtract it to the present time of the currently available static timers (t_i = t_si + delta t_i) and use that time. We will be verifying this algorithm and improving it shortly by experimenting in VISSIM simulator.

Since YOLOv2 is quite heavy to be run on a raspberry pi, and GPU based devices such as NVIDIA Jetsons are fairly expensive to be used in a final product, we decided to build a custom CNN accelerator optimized for YOLOv2 on an FPGA. We are using an Altera device, because we need an integrated ARM processor to apply the above algorithm to the bounding box information and yield the traffic level / signal times. The ARM processor can be easily programmed with C++, so that the algorithm can be improved / tweaked over time or replaced with more sophisticated algorithm easily.

If this project gains enough recognition and gets government support, we, or our successors might be able to build a marketable final product using the Cyclone V FPGA + ARM chip, at low cost.

Edit: fixed typos
🕒 Jul 04, 2019 08:41 PM
Varnasuthan Srirangan
Good work bro
🕒 Jul 04, 2019 11:43 PM
Apineishwur Govinthadas
Great Idea.wish you all the best guys!!!
🕒 Jul 03, 2019 10:12 AM
Luong Thi Thu Cuc
Excellent plan. Wish you all the success !!
🕒 Jul 03, 2019 01:24 AM
natarajan baskaran
Good idea, looking forward to see this implemented in our streets.
🕒 Jul 02, 2019 11:31 PM
igor Stolyarenko
The best work. Thank
🕒 Jul 02, 2019 07:48 PM
Angelo Fernando
An innovative and sophisticated idea which is crucial to confronting the issue of traffic congestion, this is a great project guys and I wish you the best of luck!!!
🕒 Jul 02, 2019 07:42 PM
Sara Shoouri
Nice, seems attractive. Good luck guys.
🕒 Jul 02, 2019 05:00 PM
Navodini Wijethilake
All the best guys!!
🕒 Jul 02, 2019 04:34 PM
Faith Culas
Wonderful job you guys. All the best
🕒 Jul 02, 2019 03:38 PM
Malindi jayathunga
Best of luck you all.
🕒 Jul 02, 2019 03:32 PM
Namasivayam Piranavaruban
A promising project needed for Sri Lanka... Excellent work
🕒 Jul 02, 2019 01:56 PM
Malintha Ranasinghe
A brilliant initiative. It would be very helpful for people If you could successfully implement this in countries like ours(LK)
🕒 Jul 02, 2019 01:53 PM
Thanujan Tharumarajah
Great idea.. All the best..
🕒 Jul 02, 2019 01:24 PM
Oshada Jayasinghe
Good job guys! Wish you all the best!
🕒 Jul 02, 2019 01:04 PM
Vinoj Jayasundara
Excellent work guys! Keep it up and all the best! :-)
🕒 Jul 02, 2019 01:03 PM
Hijas Farook
Great work, hope you guys succeed in this path breaking project!
🕒 Jul 02, 2019 10:03 AM
yasiru samarasekara
Great stuff people! All the best!
🕒 Jul 02, 2019 06:30 AM
Uvindu Thilanka
Excellent Job! Good luck!
🕒 Jul 02, 2019 04:16 AM
Sewwandi Pitadeniye
Good job..
🕒 Jul 02, 2019 03:54 AM
Sewwandi Pitadeniye
Good job..
🕒 Jul 02, 2019 03:54 AM
Jathurshan Pradeepkumar
🕒 Jul 02, 2019 02:49 AM
Dinuka Kavinda
Innovative thinking guys keep it up!! (y)
🕒 Jul 02, 2019 02:09 AM
Sachintha Bhanuka Dayawansa.
Timely and really useful project.. Best of luck
🕒 Jul 02, 2019 02:04 AM
Mohamed Athif
The project looks really promising. All the best!
🕒 Jul 02, 2019 02:03 AM
Sritharan Braveenan
Good project and all the best
🕒 Jul 02, 2019 01:51 AM
Great job guys...
🕒 Jul 02, 2019 01:41 AM
Manduli Hansika
excellent concept ! All the best !
🕒 Jul 02, 2019 01:20 AM
Yasiru Randeepa
Great work. All the best!!!
🕒 Jul 02, 2019 01:16 AM
Ruchira Weerakoon
Excellent work from you guys. Looking forward for a best outcome. Good luck
🕒 Jul 02, 2019 01:12 AM
Hasara Maithree De Silva
Great idea! Wish you the best!
🕒 Jul 02, 2019 01:09 AM
All the best aba&team...
🕒 Jul 02, 2019 01:01 AM
Lahiru Sampath
Fresh idea. Good luck boys <3
🕒 Jul 02, 2019 12:58 AM
Nirmal Tharanga Jayalath
Nice concept and a much needed solution for the traffic problem. Would love to see it work!!
🕒 Jul 02, 2019 12:43 AM
Janith kalpa
Great job guys.. Good luck :)
🕒 Jul 02, 2019 12:41 AM
Hasitha Wellaboda
Good project concept. Hope to see an excellent outcome. Good Luck!!
🕒 Jul 02, 2019 12:40 AM
Vahesan Vijayaratnam
Great idea.. Good luck guys!!!
🕒 Jul 02, 2019 12:31 AM
Daham navinda
Good luck brothers!
🕒 Jul 02, 2019 12:29 AM
Sasindu Geemal Wijeratne
Great Project idea. Love to see the demonstration. All the best!!
🕒 Jul 02, 2019 12:27 AM
Thamasha Rasangi
Great job...Good Luck!!
🕒 Jul 02, 2019 12:23 AM
Kasun Bhathiya
Excellent project . Good luck !
🕒 Jul 02, 2019 12:15 AM
Ruwantha Pushpika
Efficient & Practical solution for an everyday problem, all the best
🕒 Jul 02, 2019 12:02 AM
Lahiruni Ekanayake
Good luck people.Bring it home :)
🕒 Jul 01, 2019 11:58 PM
Pramod Bhanuka Ranaweera
A great initiative by an enthusiastic and highly dedicated of luck!!
🕒 Jul 01, 2019 11:53 PM
Kavindu Chamiran
good luck boys. bring the trophy home
🕒 Jul 01, 2019 11:43 PM
Aravinth Pushparaja
Excellent idea. Make it big guys
🕒 Jul 01, 2019 11:38 PM
Dilep Dev Shanmugam
one Heck of an idea, would love to see the final product
🕒 Jul 01, 2019 11:35 PM
Amrie Hussaindeen
Great move. Wish you the best!!!
🕒 Jul 01, 2019 11:31 PM
Vaigunthan Puvanenthiram
It's a needful project to solve the traffic congestion issue of developing countries which far away from sophisticated public transport system. Wish you guys for commercial success too.
🕒 Jul 01, 2019 11:21 PM
Great project. All the best !!!
🕒 Jul 01, 2019 11:16 PM
Krishnadasan kajamohan
Good plan. All the best.
🕒 Jul 01, 2019 11:09 PM
Balachandran Sangeerththan
Great project idea
🕒 Jul 01, 2019 11:06 PM
Kamalanathan Senthujan
Much needed project and looking forward to your success guys. Congrats
🕒 Jul 01, 2019 10:53 PM
Rajendramani Gnaneswaran
excellent plan. wish you all the success !!
🕒 Jul 01, 2019 06:58 PM
Doreen Liu
Looking forward to your excellent work!
🕒 Jun 26, 2019 11:27 AM

Please login to post a comment.