2024– · in progress

Reading blurred licence plates

A restoration network that makes a blurred, noisy or compressed European plate readable again. Trained on generated French plates, then adapted to real ones.

Started during an internship with the Gendarmerie nationale (Rodez, 2024–25). Rebuilt here on generated plates and public datasets of real European plates; no real plate is shown on this page.

characters read by an OCR on 158 real test plates, degraded → restored (97.8% on the sharp originals)
83.6 → 95.4%
real test plates read without a single error, degraded → restored
67.1 → 82.3%
PSNR against the sharp original, real test plates
23.3 → 26.9 dB

How it works

Sharp plates, generated or real, are degraded by one of ten blur, noise, resolution and JPEG settings, and the network learns to invert the degradation. Stage 1 uses generated plates only; stage 2 adds real European plate crops, half of each batch.generated plate+ camera simulationdegradeblur · noise · JPEG · low-resmixed batch½ real plates (stage 2)NAFNet11.6 M paramsrestored platescored by OCR on 158 real plates
Fig. 1 Sharp plates, generated or real, are degraded by one of ten blur, noise, resolution and JPEG settings, and the network learns to invert the degradation. Stage 1 uses generated plates only; stage 2 adds real European plate crops, half of each batch.

French plates are generated to the regulation’s dimensions and photographed by a simulated camera, then degraded (motion blur, Gaussian blur, low resolution, noise, JPEG). A NAFNet network learns to invert the degradation, first on generated plates only, then on a half-and-half mix with real European plate crops.

Results

degradedrestoredoriginal
heavy motion blurheavy motion blur, degradedheavy motion blur, restoredheavy motion blur, original
heavy Gaussian blurheavy Gaussian blur, degradedheavy Gaussian blur, restoredheavy Gaussian blur, original
low resolutionlow resolution, degradedlow resolution, restoredlow resolution, original
noisenoise, degradednoise, restorednoise, original
JPEGJPEG, degradedJPEG, restoredJPEG, original
all combinedall combined, degradedall combined, restoredall combined, original
Fig. 2 Generated plates the network never saw, one per degradation. The registration comes back; the small department number and the EU stars mostly do not, because the blur has destroyed them and the network does not invent them.

The figure shows generated plates, since the real test photos cannot be republished. The figures above are measured on the 158 real plates: after restoration, the OCR reads nearly as many characters as on the sharp originals.

Technical details

Generated plates

The renderer draws French plates at 4 pixels per millimetre on the 520 × 110 mm format of the 9 February 2009 regulation: 75 mm characters, 44 mm wide (25 mm for a 1), 15 × 10 mm dashes, 44 × 98 mm blue bands with twelve five-point stars. It covers the current AB-123-CD format and the older 1234 AB 56 format, white at the front and yellow at the back. The typeface is a free condensed DIN look-alike: the official font is not freely available.

A simulated camera then photographs each plate: yaw, pitch and roll, distance, daylight, overcast, night with headlights, retroreflection, sun glare, dust and scratches, shot and read noise in linear light, and JPEG last. It produces 43 photographs a second on one CPU core, so every training pair is new.

Formats
SIV AB-123-CD, FNI 1234 AB 56 front and rear
Output
520 × 112 RGB
Speed
43 photographs/s on one core

Degradations

Each sharp plate is degraded by one of ten settings: light and heavy motion blur, light and heavy Gaussian blur, downsampling by 3 to 8, Gaussian noise, JPEG at quality 10 to 30, and three combinations. The same settings are applied to real plates, so the test measures restoration of simulated damage on real photographs, not of blur from an actual moving camera.

Settings
10, drawn at random per pair
Heaviest
motion blur of 25–45 px, Gaussian σ 6–12

Network

NAFNet is a U-shaped restoration network without non-linear activation functions: gating by element-wise products replaces them. Four encoder levels halve the resolution each time, four decoder levels restore it, with skip connections across; the output is added to the input, so the network learns the correction.

Width
32 channels at full resolution
Blocks
encoder 1, 1, 2, 4 · middle 4 · decoder 1, 1, 1, 1
Parameters
11.57 million
Loss
L1

Training in two stages

Stage 1 trains from random weights on generated plates only. On generated test plates it reaches 30.2 dB, but on real plates it makes things worse: 50.4% of characters read against 83.6% for the degraded input, with stripe artifacts. It had never seen real surroundings, the real typeface or real sensor noise.

Stage 2 fine-tunes that network on a half-and-half mix of real plate crops and plates from the camera simulator. The real crops come from public datasets: UC3M-LP (Spain), the AUTO.RIA dataset (mostly Ukrainian and other European plates, CC BY 4.0) and the OpenALPR European benchmark, split by vehicle so that no vehicle appears in two splits. The checkpoint is chosen on real validation plates, never on the test set.

Stage 1
24,000 steps, batch 8, AdamW lr 2e-4, cosine, 3 h 20 on an M4 Max GPU
Stage 2
8,000 steps, lr 5e-5, cosine, 1 h 15
Real crops
2,092 train, 283 validation
Test
158 real plates (149 French, 9 OpenALPR), never used in training

Evaluation

Each test plate is degraded once, restored, and read by fast-plate-ocr, an off-the-shelf European plate reader. Character accuracy is one minus the edit distance to the true text, divided by its length. The gain is largest where the input is unreadable: under heavy motion blur, characters read go from 51% to 91% and whole plates from 0% to 56%; under heavy Gaussian blur, from 41% to 91% and from 19% to 69%.

Where the plate is already readable, restoration adds little and can cost a character: under light motion blur, 97.4% degraded against 96.0% restored. A reader should therefore run on both the degraded and the restored plate.

OCR
fast-plate-ocr, European MobileViT v2 model
Real test, characters
83.6% degraded → 95.4% restored (97.8% sharp)
Real test, whole plates
67.1% → 82.3% (91.1% sharp)
Real test, PSNR
23.3 → 26.9 dB
Stage 1 alone, characters
50.4% on the same real plates

← All projects