Inspiration
Anyone who drives regularly has felt the sudden jolt of hitting an unavoidable pothole. Potholes cause billions in vehicle damage every year, but what struck me even more was how backward municipal road maintenance still is. Most cities still find potholes either through infrequent manual inspection drives or through angry 311 phone calls from residents. By the time a citizen calls in, dozens of cars have already hit the crater, and the dispatch desk gets flooded with duplicate complaints lacking accurate GPS coordinates or photo proof.
At the same time, city-owned vehicles like garbage trucks, sweepers, and transit buses travel down almost every municipal road on a regular schedule, often with basic dashcams already installed. I realized cities do not need multi-million dollar sensor rigs or dedicated survey teams. If I could tap into those existing vehicle camera feeds, every garbage truck could double as an automatic road inspector.
What it does
CivicLens turns municipal fleet dashcam video into prioritized, verified road repair tickets without human triage:
- Ingests fleet footage: Municipal vehicles upload standard dashcam video at the end of a shift, paired with GPS track logs.
- Detects road damage with OpenCV and YOLO: The vision pipeline scans keyframes for potholes, severe asphalt cracking, and surface depression.
- Enforces privacy at ingest: Before any frame is cached or saved to disk, Haar cascade filters detect and blur vehicle license plates and pedestrian faces in memory.
- Collapses duplicate sightings: A truck idling near a pothole might capture it across 40 consecutive frames. CivicLens uses DBSCAN spatial clustering within a 15-meter radius and ORB feature vector comparison to collapse repeat sightings into a single clean ticket. In testing, this reduced raw detections by 88.8%.
- Deterministic priority scoring: Rather than using unpredictable LLM summaries, tickets are ranked using a mathematical formula based on defect surface area, recurrence frequency across runs, and road priority. Tickets scoring 70 or above are auto-filed, scores between 40 and 69 enter a manual review queue, and minor defects below 40 are archived.
- City dispatch interface: An interactive Leaflet map dashboard lets public works operators inspect cropped evidence, review triage scores, and export work orders through HMAC-SHA256 authenticated webhooks.
How I built it
I built the entire project solo, dividing the architecture into four core stages:
- Vision and Ingestion: I used Python with OpenCV 5 and YOLOv8 for frame decoding and defect identification.
cv2.VideoCaptureextracts keyframes, while custom preprocessing isolates asphalt regions and discards sky and hood reflections. - Privacy Layer: I built an in-memory redactor using Haar cascade classifiers that blurs plates and faces before frames touch storage.
- Spatial Deduplication: To solve the frame overlap problem, I computed 128-dimensional unit-norm ORB descriptors on each cropped defect. Combining these feature vectors with GPS distance in a DBSCAN clustering pass allowed the pipeline to recognize the same pothole seen from different vehicle angles.
- Triage and Dispatch: I wrote a scoring engine that evaluates pothole surface area, sighting counts, and road classification weights. I deliberately kept this logic deterministic so city engineers have a fully auditable decision trail for why one repair was prioritized over another.
- Web Dashboard: The frontend is built with React 19, Tailwind CSS, and Leaflet. It displays ward maps (tested with real triage data in Ward 12 Bengaluru), ticket status queues, and webhook dispatch tools.
Running on my local machine with an NVIDIA RTX 3050 GPU, the inference pipeline processes 1080p video at approximately 90 frames per second, well above real-time playback.
Challenges I ran into
- Dashcam vibration and false positives: Real municipal trucks rattle constantly. My early test runs produced false detections from camera shake, tree canopy shadows, and tar patches on dry asphalt. I had to tune adaptive thresholding and contour aspect ratio limits to filter out shadows and linear seams before passing crops to the detector.
- GPS drift in urban corridors: When vehicles move slowly between tall buildings, consumer-grade GPS drifts several meters. Relying purely on GPS coordinates caused the system to file duplicate tickets for the same pothole five meters apart. Pairing spatial distance with ORB visual feature matching resolved this, letting the algorithm confirm two sightings were identical even when the GPS coordinates differed slightly.
- Privacy compliance without latency hits: Blurring faces and license plates can easily become a performance bottleneck. Running full deep learning models on every full frame dragged down throughput, so I scoped Haar cascades to specific regions of interest and ran the redaction in-memory prior to image persistence.
Accomplishments that I'm proud of
- Achieving an 88.8% reduction in duplicate tickets. In my test dataset, 39 raw detections collapsed into 8 unique, actionable work orders.
- Building the system to work with existing consumer dashcams, eliminating the need for municipalities to buy specialized hardware.
- Keeping the entire prioritization pipeline deterministic, explainable, and hallucination-free.
- Delivering a working end-to-end prototype solo, from GPU video decoding to a functional municipal triage dashboard.
What I learned
- Real-world computer vision is mostly about handling dirty inputs. Pothole puddles, sunlight glare, and cracked windshields require far more preprocessing than clean benchmark datasets suggest.
- Simple mathematical heuristics and classical computer vision techniques like ORB and DBSCAN often outperform heavier models when you need fast, explainable results on a budget.
- Designing for privacy from day one is much cleaner than trying to bolt redaction onto a system after data has already been stored.
What's next for CivicLens
- Temporal degradation tracking: Comparing sightings of the same pothole across multiple weeks to measure growth rate and alert road crews before small cracks turn into dangerous craters.
- On-device edge inference: Porting the model using TensorRT to run directly on low-power vehicle hardware like an NVIDIA Jetson or Raspberry Pi 5, sending only lightweight JSON alerts over cellular instead of uploading full video logs.
- Broader defect detection: Training additional classifiers to identify damaged guardrails, faded crosswalks, and obscured street signs.
Built With
- amazon-web-services
- computer-vision
- cuda
- dynamodb
- edge-ai
- ffmpeg
- gis
- gps
- javascript
- leaflet.js
- nginx
- node.js
- numpy
- nvidia
- opencv
- python
- react
- rest-api
- scikit-learn
- tailwind-css
- typescript
- webhooks
- yolov8
Log in or sign up for Devpost to join the conversation.