We commute daily to our work, schools, and colleges and while doing so, it is a usual sight to see traffic junctions and choked traffic. If one observes these junctions, it turns out they play a very critical role in these choked roads.
We decided to do some research and found out that we are using an almost 100 years old fixed loop traffic light system on our roads. Not only do they waste time and cause frustration but also a lot of fuel, which is an imported commodity. Our survey indicated millions of rupees are wasted daily due to excess vehicle idling, just in the city of Islamabad. (attached)
Further research disclosed that a lot of projects have been done in past by students but unfortunately none of them left their university premises. So, our main objective is to not only develop this system but to deploy it on the roads.
What it does
Essentially, our system uses multiple surveillance cameras (one for each road) to get a real-time video stream. We propose to use IP cameras. These video streams are then processed by Nvidia Jetson Nano deployed at the said junction. This device comes with Ubuntu (Linux) and jetson_inference library which is capable to deploy Machine Learning models for Object Detection. These models detect the number of incoming vehicles from each road and their locations. This data is used to predict appropriate green light timings for each loop.
This would save excess waiting time and fuel wastage.
How we built it
The first step was to test our solution. We made a simulation using pyGame depicting traffic flow at a junction. We ran it multiple times with fix timed loop (as a control group) and then with the smart timing system (as an experimental group). The results were analyzed and our system proved to be much better. (demonstrated in demo video)
Then we used some sample footages, taken from the Internet, and performed object detection to extract coordinates of vehicles, as described above (also demonstrated in the demo video). This data is to be used by the smart timing system to assign a green light time to each road.
Challenges we ran into
We needed a device to experiment with edge computing. Because it is impossible to deploy Machine Learning models on CPU-only devices like Raspberry-pi. So, after some searching and convincing, we were able to get access to Nvidia Jetson Nano from our university, for this project.
Knowledge of machine learning was also new and getting the required FPS was a really challenging thing to do.
Another big challenge was the field of network engineering and electronics engineering. Since this project required knowledge of both, we had to learn those from the beginning. We had to learn how LANs work and how IP cameras use LAN to communicate with the host using NVR. We also had to learn about signalling and how Jetson's GPIO pins can control traffic lights using relays and optocouplers.
Accomplishments that we're proud of
We are proud of the fact that we started with just having the software part in our mind but the project turned out to be way more complex and we managed to learn and adapt ourselves to all the requirements and have achieved and learned so much in this project.
We were also available to convince not only our university but also CDA to allow and facilitate us to deploy our project and see results.
What we learned
We learned how important it is for a team to have a multi-dimensional skillset in order to achieve something. Time management was the key factor without which this was not possible and doing this project, definitely made us stronger in that aspect.
What's next for InLights
We have big things planned for the future of InLights. It is clear that this system is needed and there is huge demand and no producers in Pakistan. We plan to scale this project into a tech startup and offer our services to organizations like CDA, RDA, and TEPA, etc.