AI-based traffic congestion detection system for improving road safety in Nairobi, Kenya. Classifies traffic conditions from University Way images using deep learning (Python, TensorFlow/Keras).
# Project Summary — AI Traffic Congestion Detection (University Way, Nairobi)
## Overview
This project investigates how Artificial Intelligence can help improve road safety and traffic management in Nairobi. We developed a simple AI model that can automatically detect whether a road scene shows High Traffic or Low Traffic, using real images captured from University Way.
The goal is to demonstrate how AI can assist traffic authorities in making quicker and smarter safety decisions.
## Objectives
Use AI to automatically classify road congestion levels
Support faster response to traffic build-up and incidents
Show how technology can contribute to safer and smarter cities in Kenya
## AI Model Used
We built and trained a Convolutional Neural Network (CNN) using 100 labeled traffic images:
Category Images
Low Traffic 54
High Traffic 46
The model learns visual patterns such as:
- Number of vehicles
- How close vehicles are to each other
- Road visibility and flow
## Results
- 100% accuracy on unseen test images
- Correctly predicted every congestion level in the evaluation set
- Proved capable of real-time classification using uploaded images
This shows that AI can reliably detect congestion using just CCTV camera images.
## Real-World Impact
If applied across Nairobi’s road system, this model could:
- Reduce congestion and associated accidents
- Improve emergency response times
- Help plan better road infrastructure
- Support Kenya’s smart city development goals
## Team Members
- Ilham Mohamed
- Halima Mohamed
## Conclusion
This project successfully demonstrates that even a small AI system can play a meaningful role in road safety improvement. With more data and wider deployment, similar technology could help build a safer, more efficient transportation system for Nairobi and beyond.