File size: 6,163 Bytes
0323264
 
07e18be
0323264
 
 
 
 
 
 
 
 
 
07e18be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46f34ae
 
 
 
 
 
07e18be
 
 
 
 
46f34ae
 
 
 
 
 
 
 
07e18be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46f34ae
07e18be
46f34ae
07e18be
 
 
 
 
46f34ae
 
 
 
 
 
07e18be
 
46f34ae
07e18be
 
 
 
 
 
46f34ae
07e18be
 
 
 
 
 
46f34ae
 
 
 
 
 
 
 
07e18be
 
 
 
 
 
 
 
 
 
 
 
 
46f34ae
 
07e18be
46f34ae
 
 
 
 
 
 
 
 
 
 
 
07e18be
46f34ae
07e18be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46f34ae
 
07e18be
 
 
 
 
 
 
46f34ae
07e18be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
---
title: Automated Road Damage Detection
emoji: ๐Ÿ›ฃ๏ธ
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 6.10.0
app_file: app.py
pinned: false
license: mit
short_description: A model fine-tuned for automatic road damage detection
---

# ๐Ÿ›ฃ๏ธ Automated Road Damage Detection

> **YOLOv8s** fine-tuned on the **RDD2022** dataset โ€” detecting 4 road damage classes across 6 countries in real time.

[![Hugging Face Spaces](https://img.shields.io/badge/๐Ÿค—%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/ProjectRoadDamageDetection/Automated-Road-Damage-Detection)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Model: YOLOv8s](https://img.shields.io/badge/Model-YOLOv8s-orange)](https://github.com/ultralytics/ultralytics)
[![Dataset: RDD2022](https://img.shields.io/badge/Dataset-RDD2022-green)](https://arxiv.org/abs/2209.08538)

---

## ๐Ÿ“Œ Overview

This project provides an automated road damage detection system powered by **YOLOv8s**, fine-tuned on the **RDD2022 (Road Damage Dataset 2022)**. It detects four types of surface damage from road images and provides per-class counts, pothole severity assessments, and country-specific pothole density context.

Upload any road image and get instant visual annotations along with a structured damage report.

---

## ๐ŸŽฏ Damage Classes

| Code | Class Name | Color |
|------|---------------------|------------|
| D00 | Longitudinal Crack | ๐Ÿ”ต Blue |
| D10 | Transverse Crack | ๐ŸŸข Green |
| D20 | Alligator Crack | ๐ŸŸ  Orange |
| D40 | Pothole | ๐Ÿ”ด Red |

---

## ๐ŸŒ Supported Countries (Pothole Context)

| Country | Pothole Density |
|-------------------|------------------------|
| ๐Ÿ‡ฎ๐Ÿ‡ณ India | โฌ›โฌ›โฌ› Very High |
| ๐Ÿ‡ณ๐Ÿ‡ด Norway | โฌ›โฌ›โฌ› High |
| ๐Ÿ‡บ๐Ÿ‡ธ United States | โฌ›โฌ›โฌ› Moderate |
| ๐Ÿ‡จ๐Ÿ‡ฟ Czech Republic | โฌ›โฌ›โฌ› Moderate |
| ๐Ÿ‡จ๐Ÿ‡ณ China | โฌ›โฌ› Low-Moderate |
| ๐Ÿ‡ฏ๐Ÿ‡ต Japan | โฌ› Low |

---

## ๐Ÿš€ How to Use

1. **Upload a road image** using the image input panel (drag & drop, camera capture, or paste from clipboard).
2. **Adjust thresholds** (optional):
   - **Confidence Threshold** (default: `0.25`) โ€” minimum detection confidence score.
   - **IoU Threshold** (default: `0.45`) โ€” suppresses overlapping boxes.
3. **Select the country** where the photo was taken for pothole density context.
4. Click **๐Ÿ” Detect Damage** (or the image auto-triggers detection on upload).
5. View the **annotated output image** + **Detection Summary**, **Pothole Report**, and **Country Context** tables.

---

## ๐Ÿ“Š Output Explained

### Detection Summary

A per-class breakdown table showing:

- Count of each damage type detected
- Percentage of total detections

### Pothole (D40) Report

| Field | Description |
|------------------|------------------------------------------------|
| Pothole Count | Number of D40 boxes detected |
| % of Detections | Proportion of potholes vs all damage |
| Severity | Critical / Moderate / Low / None |
| Avg Confidence | Mean confidence score for pothole boxes |

**Severity thresholds:**

- ๐Ÿ”ด **CRITICAL** โ€” Potholes > 30% of all detections โ†’ Immediate repair needed
- ๐ŸŸ  **MODERATE** โ€” Potholes > 10% โ†’ Schedule maintenance
- ๐ŸŸก **LOW** โ€” Any potholes detected โ†’ Monitor road surface
- ๐ŸŸข **NONE DETECTED** โ€” Road surface OK

### Country Context

Provides pothole density, dominant damage types, and data collection method for the selected country as documented in the RDD2022 dataset.

---

## ๐Ÿง  Model Details

| Property | Value |
|---------------|---------------------------|
| Architecture | YOLOv8s (small) |
| Weights file | `yolov8s_best.pt` |
| Input size | 640 ร— 640 px |
| Classes | 4 (D00, D10, D20, D40) |
| Framework | Ultralytics YOLOv8 |
| Device | CUDA (GPU) / CPU fallback |

---

## ๐Ÿ“ Dataset โ€” RDD2022

- **Total images:** 47,420
- **Countries:** India, Japan, United States, Czech Republic, China, Norway
- **Annotation format:** Bounding boxes (YOLO format)
- **Reference:** [Arya et al., 2022 โ€” arxiv:2209.08538](https://arxiv.org/abs/2209.08538)

---

## ๐Ÿ—‚๏ธ Repository Structure

```text
Automated-Road-Damage-Detection/
โ”œโ”€โ”€ app.py                  # Gradio UI + inference pipeline
โ”œโ”€โ”€ predict.py              # Standalone prediction script
โ”œโ”€โ”€ yolov8s_best.pt         # Fine-tuned YOLOv8s weights (22.5 MB)
โ”œโ”€โ”€ rdd2022.yaml            # Dataset config (class names, paths)
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ examples/               # Sample road images (6 countries)
โ”‚   โ”œโ”€โ”€ india_test_image.jpg
โ”‚   โ”œโ”€โ”€ China_Drone_000253.jpg
โ”‚   โ”œโ”€โ”€ United_States_004798.jpg
โ”‚   โ”œโ”€โ”€ Czech_test_image.jpg
โ”‚   โ”œโ”€โ”€ China_Drone_000295.jpg
โ”‚   โ””โ”€โ”€ norway_road_test.jpg
โ””โ”€โ”€ README.md
```

---

## ๐Ÿ”ง Local Setup

```bash
# Clone the Space
git clone https://huggingface.co/spaces/ProjectRoadDamageDetection/Automated-Road-Damage-Detection
cd Automated-Road-Damage-Detection

# Install dependencies
pip install -r requirements.txt

# Run the app
python app.py
```

The app will be available at `http://localhost:7860`.

---

## ๐Ÿ“ฆ Requirements

```text
gradio>=4.0
ultralytics
torch
torchvision
numpy
Pillow
opencv-python
```

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License** โ€” see the [LICENSE](https://opensource.org/licenses/MIT) for details.

---

## ๐Ÿ“š Citation

If you use this work or the RDD2022 dataset, please cite:

```bibtex
@article{arya2022rdd2022,
  title   = {RDD2022: A multi-national image dataset for automatic Road Damage Detection},
  author  = {Arya, Deeksha and Maeda, Hiroya and Ghosh, Sanjay Kumar and Toshniwal, Durga and Mraz, Alexander and Kashiyama, Takehiro and Sekimoto, Yoshihide},
  journal = {arXiv preprint arXiv:2209.08538},
  year    = {2022}
}
```

---

## ๐Ÿ™Œ Acknowledgements

- [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics) for the object detection framework
- [RDD2022 Dataset](https://arxiv.org/abs/2209.08538) for the training data
- [Gradio](https://gradio.app/) for the web interface