CoolFace
Modelpublic

nsr51324/Road_Damage_Object_Detection

sourceHugging Facemitupdated 2mo agoView on Hugging Face
1likes114downloads
Model Card

<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.

![License](#license) ![Ultralytics](https://github.com/ultralytics/ultralytics)

</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:

ModelmAP50mAP50-95PrecisionRecallSize (MB)FPS (inference)
๐ŸŽฏ YOLOv8n โ€” best accuracy0.39360.22990.58350.395223.36269.97
โš–๏ธ YOLOv10n โ€” balanced0.36940.21730.58490.35275.49253.44
โšก YOLO11n โ€” smallest & fastest0.33440.19050.50930.35045.22272.88

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

PathDescription
Road_Damage.ipynbFull training & benchmarking notebook โ€” dataset download, training all 3 models, evaluation, comparison table/plots.
runs/detect/yolov8_road*/weights/best.ptTrained YOLOv8n checkpoint.
runs/detect/yolov10_road/weights/best.ptTrained YOLOv10n checkpoint.
runs/detect/yolov11_road*/weights/best.ptTrained YOLO11n checkpoint.
runs/detect/val*Validation run artifacts (PR curves, confusion matrices, sample predictions) for each model.
yolov8n.pt, yolov10n.pt, yolo11n.pt, yolo26n.ptBase pretrained checkpoints used as training starting points.
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

bash
pip install ultralytics huggingface_hub
python
from 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 from DetMetrics

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:

bash
python UI.py

After running, open your browser:

text
http://127.0.0.1:7860

Deployment

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