Inspiration

The daily frustration of traffic congestion and the desire to make informed travel decisions inspired us. We wanted to leverage real-time data and machine learning to provide a practical tool for Manchester's commuters, helping them anticipate delays and choose better routes.

What it does

Manchester Traffic Predictor is a web application that offers a real-time, interactive map of current traffic conditions across Manchester. It displays live sensor data, predicts traffic speeds for upcoming intervals using an XGBoost model, and provides an overall traffic condition analysis for user-defined routes.

How we built it

We developed a full-stack solution:

  • Frontend: A responsive React application using Google Maps API for visualization and Axios for API communication.
  • Backend: A Python FastAPI application serving as the API, handling data requests, and running predictions.
  • Database: MongoDB Atlas to store and query historical and real-time traffic sensor readings.
  • Machine Learning: An XGBoost model trained on historical traffic data to predict future speed conditions.
  • Deployment: The frontend is hosted on Vercel, and the backend API is containerized with Docker and deployed on Render.

Challenges we ran into

  • Data Integration: Sourcing, cleaning, and structuring the diverse traffic sensor data for effective use in both real-time display and ML model training.
  • Real-time Prediction Accuracy: Fine-tuning the ML model and feature engineering to provide meaningful short-term speed predictions.
  • Deployment & CORS: Configuring the full-stack deployment across Vercel and Render, and resolving Cross-Origin Resource Sharing (CORS) issues between the frontend and backend.
  • Route Analysis Logic: Efficiently identifying relevant sensors along a given route and aggregating their data for a meaningful traffic summary.

Accomplishments that we're proud of

  • Successfully building a functional end-to-end application within the hackathon timeframe.
  • Integrating a machine learning model to provide predictive traffic insights.
  • Creating an intuitive user interface that clearly visualizes complex traffic data.
  • Deploying the application to live cloud platforms, making it accessible.

What we learned

  • The intricacies of full-stack development, from frontend UI/UX to backend API design and database management.
  • Practical application of machine learning for real-world predictive tasks.
  • Effective strategies for debugging and problem-solving in a fast-paced development environment, especially with cloud deployments and API integrations.
  • The importance of robust data handling and efficient querying for real-time applications.

What's next for Manchester Traffic Predictor

  • Enhanced Prediction Models: Incorporating more features (e.g., weather, public events) and exploring more advanced ML models.
  • User Accounts & Saved Routes: Allowing users to save frequent routes and receive personalized traffic alerts.
  • Alternative Route Suggestions: Integrating logic to suggest faster or less congested alternative routes.
  • Expanded Data Sources: Integrating additional real-time data sources for more comprehensive coverage.
Share this project:

Updates