Back to timeline
school Mar 2024

Is that car electric?

A group project at NTNU that detects whether a passing car is electric, end-to-end from a single frame. I built the vision side: a fine-tuned YOLOv8 to find the licence plate, then a CNN trained from scratch to read it, and finally a Statens vegvesen lookup to resolve the engine type.

The pipeline

Four-step pipeline: image captured, plate located in the image, plate text read, vehicle data fetched. Final classification: 'Motor 1: Elektrisk (ELBIL)'.
End-to-end: capture, detect, read, look up. The last box is a one-liner from the vegvesen API.

Why train a plate-reader from scratch

Generic OCR works on plates, but it's overkill: too many parameters, too little domain. Norwegian plates have a fixed alphabet, a fixed font, two predictable layouts. A small CNN with the right inductive bias outperformed off-the-shelf OCR on the data I had, and ran an order of magnitude faster.

Ten-panel training dashboard: train/val losses converging, precision and recall climbing into the high-90s, mAP@50 and mAP@50-95.
YOLOv8 fine-tune metrics. Losses converging cleanly, precision ~0.98, recall ~0.95, mAP@50 ≈ 0.98.

End-to-end results

On test footage from real Trondheim streets, the system tagged each car with the right engine class in a single frame. EVs got highlighted green; combustion cars red.

Server-side visualization: a black EV on a city street with its plate boxed in green, marking it as fully electric.
EV: plate read, vegvesen API confirms electric, box drawn green.
Server-side visualization: a red car with its plate redacted, classified as non-electric.
Non-EV: same path, different answer from the API.

Walkthrough

Full walkthrough of the pipeline.

What I'd improve

The classifier sometimes hesitates on plates with strong motion blur, the kind that come off cars actually moving. A small temporal stack of frames, or a quick deblurring pre-pass, would close that gap. The vegvesen API was also the slowest step by a wide margin; caching by plate prefix would have helped.

Course report

The Smart City project report (IELS2001), covering methodology, dataset choices and results, is in the repo:

Back to timeline