Inspiration

Urban areas are notorious for high traffic congestion, which can cause numerous problems, such as increased travel times, reduced urban attractiveness and economic activity, and most importantly, more accidents. By adjusting and changing roads, such as by adding or removing stop signs, traffic lights, and even lanes, these problems can be reduced.

However, city planners currently have no way to gauge how potential changes will improve traffic flow, meaning they are disincentivized from making adjustments at all, which halts innovation. Thus, we took a unique approach from the common hackathon project. Instead of creating an application meant for general use, we developed an application for government officials. We plan to implement our software as part of a nationwide government plan to promote smarter urban infrastructure and more efficient planning. Since governments often utilize outside developers to build applications, we believe our website fills a normally unoccupied niche.

Thus, we developed Traffix, an application that uses AI to allow cities to experiment with road infrastructure efficiently in order to optimize travel times and decrease the prevalence of accidents.

What it does

Traffix is a progressive web application that lets city governments and communities collaborate in order to improve road infrastructure efficiency in urban streets.

First, on the government page, city planners upload their traffic and road data that many cities already have stored. Once this data is provided, it is sent to Google Cloud, where a model and Graphical User Interface (GUI) are created for that specific city.

Once a model and GUI are created for a city, government planners, private contractors, or even residents can add, remove, or edit with different types of infrastructure changes to improve traffic flow. We provide a legend of functions and instructions for users. Specifically, we allow users to input addresses and coordinates to experiment with five different road features: Stop Signs, Yield Signs, Speed Limits, Traffic Lights, and Lanes. Existing signage can be updated to new signage, such as changing a traffic light to a stop sign, or entirely new signage can be added to new places, such as adding a stop sign to an intersection. Once signage is added or edited, users can view the impact of each individual change, represented in 5 traffic metrics: rate of flow, average speed, vehicle density, intersection wait times, and average time of travel. After finding an optimal combination of infrastructure, we display the overall improvements in traffic flow as well as an estimated cost for the project. This allows city planners to outline an entire infrastructure project with confidence. Once complete, users can save and download the map, and submit it to city planners.

The GUI is built with Google Cloud and the Maps and Places APIs, and we use Radar.io to geocode locations and perform distance/metric calculations. Our algorithm is trained on a dataset from Atlanta that contains roads and their attributes (the 5 listed above). The dataset has wait times at each intersection, so when we train our model, the model learns how each specific road feature individually affects traffic flow. Therefore, when given a prediction scenario with specific road features, the model can predict the new traffic metrics, which are all derived from wait times. When a user makes a change on the GUI, these features are fed back to the trained model with the minor change, and the model re-predicts the metrics for the slightly adjusted scenario. These results are compared to the original metrics and the change is calculated and presented. Our model is an XG Boost (gradient boosting) model, which we found performed best when compared to a neural network (models are well documented in notebooks). We trained our model for 4 cities and connected it to the GUI for Atlanta.

Often, local governments hire private contractors for infrastructure endeavors. Using our Google Cloud backend, we allow private contractors to create changes to existing city plans and then submit their proposals to the city government. This allows contractors to directly communicate and propose changes on public forums.

Finally, drivers and community members can participate in the infrastructure design process. Drivers can learn about upcoming, approved construction projects in need of funding and can choose to financially contribute to them. They can also use our visualization tool to transform their own ideas into legitimate proposals and suggestions for the governments. This allows infrastructure projects to be funded through crowdsourcing, overall making city improvements a community effort.

How we built it

After numerous hours of wireframing, conceptualizing key features, and outlining tasks, we divided the challenge amongst ourselves by assigning Ishaan to developing the UI/UX, Adithya to connecting the Google Cloud backend and testing our traffic prediction models, Ayaan to developing our traffic prediction models, and Viraaj to developing and perfecting the GUI.

We coded the entire app in the following languages/frameworks: HTML, CSS, Javascript, and Python. We used Google Cloud for our backend and GUI. We developed our interactive GUI with Google Cloud, Google Maps, and Radar.io geo functions. We used Radar.io for geocoding for locating signage and distance functions for traffic metrics. We built our AI models with Sklearn and Keras. We hosted our website through Netlify and Github. We collected our data from Kaggle and other open-source sites.

Challenges we ran into

The primary challenge that we ran into was developing our geographic models. Since the data was very complex and required cleaning, we weren’t sure how to start. Luckily, we were able to do enough EDA to understand how to develop the models and utilize the data. Training these models was also a huge challenge because of the sheer size of the data. While we were not able to deploy our models, as they are too large to deploy on free and available servers, as long as governments give us data, we can produce models and GUIs for them.

Accomplishments we are proud of

We are incredibly proud of how our team found a distinctive yet viable solution to assisting governments in optimizing road design. We are proud that we were able to develop some of our most advanced models so far. We are extremely proud of developing a solution that has never been previously considered or implemented in this setting.

What we learned

Our team found it incredibly fulfilling to use our AI knowledge in a way that could effectively assist governments. We are glad that we were able to develop models to help a vast range of people. Seeing how we could use our software engineering skills to impact people’s daily lives was the highlight of our weekend.

From a software perspective, developing a large scale model and a GUI were our focus this weekend. We learned how to use great frameworks for such as Radar.io and Google Cloud. We grew our web development skills and polished our database skills.

What is next for Traffix

We believe that our application would be best implemented on a local and state government level. City planners and government officials currently do not have a way to effectively optimize road construction, but with AI tools and solutions, we believe roads can be made safer and faster.

In terms of our application, we would love to deploy our models on the web and streamline the process of collecting and preparing data, training a model, and creating a GUI all in one step. Given that our current situation prevents us from buying a web server capable of running all those processes at once, we look forward to acquiring a web server that can process high-level computation. Lastly, we would like to refine our algorithms to incorporate more important traffic parameters and road features.

Share this project:

Updates