nsr51324/Road_Damage_Object_Detection
<div align="center">
๐ฃ๏ธ Road Damage Object Detection
Three YOLO generations, trained and benchmarked head-to-head on the same road-damage dataset โ pick your trade-off: accuracy, speed, or size.
 
</div>
Benchmark Results
YOLOv8n, YOLOv10n, and YOLO11n were each trained from their official pretrained checkpoints for up to 50 epochs (640px, batch 16) on the same train/val split, then evaluated with model.val() on the same validation set:
Takeaway: YOLOv8n gives the best detection quality but is ~4x larger than the other two. YOLO11n is the lightest and quickest to run, trading off some accuracy. YOLOv10n sits in between with the best raw precision. Pick the checkpoint that matches your deployment constraints (edge device vs. server, latency budget, etc.).
Files in this Repository
Note: some models have duplicate *-2 run folders from repeated training/validation passes โ the metrics above come from the primary evaluation run in the notebook.How to Use
pip install ultralytics huggingface_hubfrom huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights_path = hf_hub_download(
repo_id="nsr51324/Road_Damage_Object_Detection",
filename="runs/detect/yolov8_road/weights/best.pt" # swap for the v10 / v11 path to try another model
)
model = YOLO(weights_path)
results = model("path/to/road_image.jpg")
results[0].show()Training Data
Trained on a road-damage detection dataset hosted on Roboflow (7 damage classes, exported in YOLOv8 format). Bring your own Roboflow API key and project reference to re-download the exact split used in Road_Damage.ipynb, or substitute any YOLO-format road-damage dataset with a matching data.yaml.
Training Procedure
- Image size: 640ร640 ยท Batch size: 16 ยท Epochs: up to 50 (early stopping)
- Early stopping patience: 10 epochs for YOLOv8n, 3 epochs for YOLOv10n and YOLO11n
- Each model trained independently from its official Ultralytics pretrained weights (
yolov8n.pt,yolov10n.pt,yolo11n.pt) - Evaluated with the built-in Ultralytics validator (
model.val()) โ box precision/recall, mAP50, mAP50-95, and inference speed all reported directly fromDetMetrics
Gradio User Interface
This repository includes a modern Gradio interface that allows users to perform road damage detection directly from a web browser.
Features
- Upload a road image.
- Detect multiple road damage classes.
- Display annotated prediction image.
- Show object counts.
- Display confidence score for every detection.
- Modern responsive interface.
Run the UI
Simply execute:
python UI.pyAfter running, open your browser:
http://127.0.0.1:7860Deployment
The Gradio interface can be deployed easily on:
- Hugging Face Spaces
- Local Machine
- Google Colab
- Linux Server
- Windows
- Docker
Model Architecture
- Framework: Ultralytics YOLO
- Language: Python
- Interface: Gradio
- Backend: PyTorch
- Inference Engine: Ultralytics
Limitations
This is a research/benchmarking project, not a production-ready inspection system. Detection quality (mAP50-95 in the 0.19โ0.23 range) reflects a lightweight "nano" model family trained for a limited number of epochs on a single dataset โ expect false negatives on damage types underrepresented in training data, and re-validate before any real-world deployment (e.g. road inspection, insurance assessment).
License
MIT for the code and trained weights. Check the source dataset's license on Roboflow before commercial use.
Author
Nasr Mohamed โ AI Engineer ๐ค huggingface.co/nsr51324
