RoadLens — Agentic Road Damage Inspection
Inspiration
Road damage is a common problem for road users, especially during the monsoon season when potholes can fill with water and become difficult to identify from a distance. Cracks, uneven surfaces and damaged pavement can create safety risks, while identifying and documenting road defects manually can be time-consuming.
I wanted to explore how computer vision could help make road inspection more systematic. Instead of building another application that simply draws boxes around objects, I wanted to build a system that examines road images, looks for possible defects, and gathers additional visual evidence when its first inspection is uncertain.
That idea led to RoadLens, a computer-vision-based road inspection and screening system.
What I Built
RoadLens combines OpenCV 5, deep-learning object detection and a bounded vision-agent workflow to identify candidate road defects and generate an inspection report.
The system focuses on four road-damage categories: longitudinal cracks, transverse cracks, alligator cracking and potholes. It combines a multi-class road-damage detector with a pothole-specialist detector to provide complementary evidence during inspection.
The application is deployed on Amazon Web Services (AWS) and provides a web interface where users can upload road images, inspect annotated results, review confidence scores and image-quality measurements, and export findings for further review.
How It Works
The inspection process has several stages:
- Image assessment: OpenCV 5 measures image characteristics such as sharpness, brightness and contrast.
- Initial detection: A pretrained YOLO-based road-damage model identifies candidate defects and returns labels, confidence scores and bounding boxes.
- Evidence-driven reinspection: When the first pass finds no candidates, image quality is poor, or detections are uncertain, the inspection agent can request additional analysis. Depending on the situation, this includes image enhancement, higher-resolution inference, overlapping image tiles and a specialist pothole detector.
- Evidence aggregation: The system combines candidate detections, handles overlapping boxes and records which inspection actions produced the results.
- Reporting: The web interface presents the annotated image, candidate counts, image-quality information, processing measurements and inspection trace. Findings can be exported for review.
The inspection budget is bounded so that additional analysis does not continue indefinitely. The system treats its output as preliminary screening evidence for human review, not as a certified road-safety assessment.
Technology Stack
- OpenCV 5: Image processing, quality assessment, enhancement and image-region preparation.
- YOLO-based detection models: Multi-class road-damage detection and specialist pothole detection.
- Python 3.11 and Ultralytics: Model execution and the computer-vision pipeline.
- Streamlit: Interactive inspection interface and reporting.
- Amazon EC2: Cloud hosting for the application and inference pipeline.
Challenges and What I Learned
One of the biggest challenges was that a real pretrained detector does not necessarily perform well on every road image. During testing, RoadLens detected several candidates in a reference road-damage image but returned no candidates for a difficult water-filled pothole image. That failure showed why a successful model load or a visually convincing bounding box is not sufficient evidence of reliable performance.
I introduced a bounded inspection workflow to give the system additional opportunities to examine difficult images. I also explored a specialist pothole model to provide another source of evidence. These changes make the inspection process more deliberate, but they do not guarantee that every missed defect will be recovered.
Building RoadLens taught me that practical computer vision involves much more than choosing a model. Input quality, differences between training images and real roads, false positives, false negatives, inference time and clear reporting all influence whether a system is useful outside a controlled example.
It also reinforced the importance of evaluating model behaviour honestly. A system should distinguish between a detected candidate and a verified defect, and the absence of detections should never be interpreted as proof that a road is safe.
What's Next
RoadLens is a prototype for more evidence-aware road inspection. The next stage is broader evaluation on varied, labelled road images, including water-filled potholes, deep holes, cracks, wet surfaces, rural roads and normal pavement. Comparing the original detector with the additional inspection strategies on the same labelled dataset will help establish whether the extra analysis improves detection and what computational cost it introduces.
The long-term goal is to help maintenance teams identify locations that warrant closer human inspection, while keeping the system's limitations visible and its decisions understandable.
RoadLens explores how OpenCV 5, complementary vision models and a bounded agentic workflow can work together to make road-damage screening more systematic and auditable.
Built With
- agentic-vision
- amazon-ec2
- amazon-web-services
- artificial-intelligence
- computer-vision
- deep-learning
- image-processing
- machine-learning
- object-detection
- opencv-5
- pothole-detection
- python
- road
- streamlit
- ultralytics
- yolov8
Log in or sign up for Devpost to join the conversation.