Road Pothole Detection (YOLOv4-Tiny)
2023CompletedComputer Vision

Road Pothole Detection (YOLOv4-Tiny)

Road Pothole Detection (YOLOv4-Tiny) project cover

Metrics & Visuals

70%
Confidence Threshold
15–30
Typical GPU FPS
5–10
Typical CPU FPS
2 seconds
Dedup Cooldown
640×480
Input Resolution
AVI + GPS
Output
Diagram
Pipeline overview

Pipeline overview. App screenshots coming soon.

Overview

An intelligent computer vision system that detects potholes in real-time using the YOLOv4-Tiny deep learning model, automatically captures GPS coordinates of detected potholes, and generates annotated video output. Designed for autonomous vehicle safety and road maintenance workflows.

Key Features

  • Real-time pothole detection from video streams or files using YOLOv4-Tiny
  • GPU acceleration via CUDA for fast inference (fallback to CPU supported)
  • Automatic GPS coordinate capture for each detected pothole via geocoder
  • Smart deduplication filter — prevents duplicate detections within 2-second intervals
  • Confidence threshold filtering at 70% with size-based false positive reduction
  • Annotated video output (result1.avi) with detection boxes and confidence scores
  • Evidence collection: saves screenshots (pothole{N}.jpg) and GPS coordinates (pothole{N}.txt)
  • FPS counter overlay on output video
  • 15–30 FPS on GPU, 5–10 FPS on CPU

How It Works

  1. 1Input video → frame extraction → resize to 640x480, normalize pixel values
  2. 2YOLOv4-Tiny model inference via OpenCV DNN module (CUDA FP16 or CPU FP32)
  3. 3Confidence threshold (70%) + NMS threshold (40%) + size filter applied
  4. 4Deduplication: 2-second cooldown between detections
  5. 5Geocoder captures GPS coordinates (latitude, longitude) at detection time
  6. 6Output: annotated video (result1.avi) + screenshots + GPS text files per detection

System Architecture

Input
Video Stream
Camera / File
Preprocessing
Frame Extraction
640×480, normalize
Detection
YOLOv4-Tiny
OpenCV DNN (CUDA/CPU)
Confidence Filter
Threshold 70%, NMS 40%
Post-processing
Deduplication
2-second cooldown
Geocoder
GPS coordinate capture
Output
Annotated Video
result1.avi
Screenshots + GPS
pothole{N}.jpg / .txt

Roadmap

  • Add training pipeline for custom datasets
  • Implement live GPS tracking with GPS hardware
  • Create web dashboard for coordinate visualisation on map
  • Add database integration for coordinate storage
  • Improve accuracy with YOLOv8
  • Mobile app integration

Tech Stack

Detection
YOLOv4-Tiny (AlexeyAB/darknet)OpenCV 4.5 DNNCUDA (GPU acceleration)
Geolocation
GeocoderGPS Coordinate Logging
Output
OpenCV VideoWriter (AVI)Screenshot captureNumPy
Language
Python 3.7+