A license plate recognition demo trained on one market reads only that market: yellow plates, one row, digits only. Point it at white plates with a coloured band, or at any alphabet that contains letters, and the vehicles still get boxes while the plates get nothing or the wrong text. The fix is new training data, and not one dataset but three - vehicle detection, plate detection and character recognition. This guide gives the dataset sizes that work, the pixels-per-character target your capture must meet, the annotation and splitting rules that keep the score honest, and the decision on which models each difference between markets forces you to retrain.
Why the demo plates read and yours do not
An LPR pipeline runs three models in sequence: a vehicle detector finds the car, a plate detector finds the plate inside it, and an OCR recognizer turns the plate into a string. Each stage learned its training market, and each fails differently on a new one.
The vehicle detector transfers best - cars are cars in every market. The plate detector learned appearance: colour, brightness, proportions, where the plate sits on the vehicle. Change the plate's colour scheme or move the camera, and its score collapses. The recognizer is the most brittle, because its output alphabet is a fixed layer. A digits-only recognizer - the LPRNet class of models - has no class for a letter, so it cannot output one at all: the plate is found, the box draws, and the text stays empty or collapses to digits.
Your market's specifics decide what to collect. Count the character classes (10 digits grow to 30-40 classes once letters join), the plate colours, the row layouts, and the mounting position your camera actually sees.
How the three stages hand frames and crops to each other is covered in the license plate OCR pipeline from video frames to text; more build-and-integrate guides sit on the systems topic page.
Which of the three models you must retrain
Retraining everything is wasteful; retraining too little wastes weeks. Use the table:
| Difference between markets | Vehicle detector | Plate detector | OCR recognizer |
|---|---|---|---|
| Character set only: letters join the digits, plate looks the same | keep | fine-tune | retrain |
| Plate colour or background differs (yellow vs white, coloured band) | keep | retrain | retrain |
| Plate size, proportions or two-row layout differ | keep | retrain | retrain |
| New camera position, distance or angle | add data | retrain | retrain |
| Unusual vehicle mix (trucks only, low angle) | fine-tune | add data | add data |
Two rules sit behind the table. The recognizer must be retrained whenever the character set, the stamped font or the string layout changes, because its alphabet is a fixed output layer. The plate detector must be retrained whenever the plate's look changes, because it learned that look - a tiny-YOLO plate head such as tiny_yolov4_license_plates knows the boxes it was shown, not a generic plate concept. Everything else is data collection against a measured recall: run the pre-trained vehicle detector on an hour of your footage first, and only collect training data for it if it misses more than 1 vehicle in 20 (below 95% recall).
How many images to collect
Detection: budget 2,000-5,000 annotated frames for a market. The largest published dataset for a single regional format - Iranian plates - lists 1,466 images for plate detection and about 5,000 cropped plates for recognition, which shows roughly 1,500 annotated images carries one format; a market with private, commercial, trailer and motorcycle plates belongs at the top of the range. Spread the frames over day, night, rain and at least three camera angles before adding volume anywhere else.
Recognition: set a floor of 300 crops per character class, present in every class of your alphabet, and oversample the rare ones to about 3x the common ones - under-represented classes are where recognizers make their errors. A 40-class alphabet at 300 crops per class is 40 x 300 = 12,000 crops, about a week of annotation work.
Vehicle detection: start from the pre-trained model and collect your own footage only if the first measured recall is below 95%.
Before any training, set aside 300 real plates of your market as a test set and do not train on them - every later decision keys off that number.
Pixels per character and exposure at the lane
Two numbers decide whether your camera produces trainable, readable plates: pixels on the characters and exposure against vehicle speed.
The OCR floor is 20 pixels of character height - the working floor in OCR practice; below it, confusion between similar characters climbs steeply (see why small text fails OCR for the mechanics). Detection needs less: at 20 pixels per character a full plate spans a few hundred pixels, ample for the detector.
Worked example: a lane 3,000 mm across, a 1,920-pixel (2 MP class) sensor, characters 70 mm tall on a 520 mm plate - take these as your measured inputs. Pixel size = 3,000 mm / 1,920 px = 1.56 mm per pixel. Characters: 70 mm / 1.56 mm = 45 px, 2.2x the floor. Plate: 520 mm / 1.56 mm = 333 px wide. The same 70 mm characters stay above the floor out to a lane width of 70 x 1,920 / 20 = 6,720 mm on 2 MP; a typical 5 MP sensor at 2,592 pixels reaches 70 x 2,592 / 20 = 9,072 mm. Two lanes in one frame split the pixel budget: 2 MP over two 3 m lanes gives 6,000 / 1,920 = 3.13 mm per pixel and 70 / 3.13 = 22 px per character - passing, with little margin.
Size your own lane with the calculator:
Exposure next. A vehicle at 30 km/h moves 30,000 m / 3,600 s = 8,333 mm/s, so one pixel of blur at 1.56 mm per pixel allows 1.56 / 8,333 = 0.00019 s, about 190 microseconds: set 1/5,000 s or faster. At 50 km/h the limit halves to about 110 microseconds - shoot 1/10,000 s. Blur past 2 pixels costs you the thin strokes that separate 8 from B, and no dataset fixes a blurred capture.
Annotate for three models, split by vehicle
Annotate the same captured frames three ways. Vehicle boxes tight around the vehicle; plate boxes tight to the plate border, frame included; recognizer crops cut exactly at the plate border with the ground-truth string typed as stamped - no added spaces, separators only if your alphabet defines them.
Split by recording session or vehicle, never by frame. Ten consecutive frames of one car are one data point wearing ten costumes; scatter them across train and test and the score inflates while the field rate stays poor. Hold out 10-15% of sessions for validation and keep the 300-plate test set untouched until the end.
Detectors train on full frames - plate position on the vehicle is signal. The recognizer trains on crops; the crop-and-label mechanics are identical to building your own OCR training data from cropped character images. Reject blurred frames at annotation time rather than hoping the model learns to de-blur: a detector trained partly on blurred plates starts missing sharp ones.
Synthetic plates when the format has no data yet
When a country changes plate format, or a rare character class will not fill, render what you cannot collect. Draw the plate with the real dimensions, colours and stamp font, warp it through plausible angles and blur levels, and composite it onto real vehicle backgrounds; published work generates a new plate format from old-format images while keeping photorealism, which is the practical path after a format change.
Pre-train on synthetic, then fine-tune on the first few hundred real plates; keep the synthetic share near half once real data flows. Whatever the mix, the 300 held-out plates stay real - synthetic validation numbers do not predict field behaviour. Match synthetic colours to your camera's white balance, not to the paint specification, or the detector learns a white your camera never produces; colour normalization between training and deployment is its own check. Photorealism helps, but read what synthetic training data does and does not buy before scaling the renderer up.
When no training is needed at all
If the identifier can be a code, make it a code. Yard tags, container labels, pallet and windshield VIN barcodes decode deterministically: no dataset, no training run, no silent drift after a format change, and a decoder either reads the code or reports a miss. Fixed code readers pair naturally with a pass/fail station like the one in barcode match verification.
Specs for a fixed lane reader:
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.7"
- Shutter
- Global
The LS-CRD-0028 reads 60 codes/s at 30 fps through an 8 mm lens on a 2560 x 2048 sensor - the class of device that turns an identification problem into a decoding one.
Capture hardware: one camera for training and field
Train on the camera you deploy; a model fed borrowed images reads your camera's noise, white balance and lens distortion poorly. For lane capture the shortlist is short: colour sensor (the detector may key on plate colour), global shutter (vehicles move), and exposure at or faster than the speed formula above. Keep lighting fixed between the training set and the field - consistent lighting is what stops AI vision retraining. Night capture follows its own exposure and IR discipline, covered in day and night license plate capture: exposure and lighting.
A smart camera fits a gate lane on its own: it captures, runs the models on the device and hands plate strings to the PLC over GigE.
Lane camera with on-device inference:
- Interface
- GigE
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
The MV-SC6050C-08M-XBN is a 5 MP colour smart camera with an 8 mm lens, global shutter, 1/1.45" sensor, GigE interface, M12 mount and a built-in multi-colour light source.
Compact vision sensor for a single lane:
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
The MV-SC3050XC-16M-ATN-H is a 5 MP colour vision sensor with a global shutter, a 1/1.45" sensor, an M12 mount and a Fast Ethernet interface. Browse the wider range in the smart cameras category or the camera finder, and size the mount on the camera step of the configurator.
Checks before you train
- Measure lane width and character height on your own plates, then apply max lane width = character height x sensor pixels / 20. The capture passes this before the dataset matters.
- List your market's plate formats and count the character classes; the recognizer budget is 300 crops x class count.
- Budget 2,000-5,000 detection frames spread over day, night, rain and three camera angles.
- Reserve 300 real plates as a test set before the first training run.
- Confirm colour, global shutter, and exposure at 1/5,000 s or faster for 30 km/h traffic.
- Lock white balance, gain and exposure; log camera ID and timestamp on every image.
- Split by session; no vehicle appears in both train and test.
- Gate the project at 95% full-plate reads on the held-out set - tune data, not hyperparameters, until it clears.
The decision per case
Same plate look, new character set: retrain the recognizer only. Classes x 300 crops - 40 classes is 12,000 crops - plus the 300-plate test set; keep both detectors.
New plate colour, geometry or camera position: retrain the plate detector and the recognizer together, on 2,000-5,000 annotated frames plus the crop set; keep the vehicle detector and measure its recall on your footage before collecting for it.
The identifier can be a code instead of a plate: skip training entirely and decode.
And if reads fail in the field after all this, resist retraining on the failures - check exposure and lighting first, because a model retrained on blurred images learns blur. Start from the lane numbers in the pixels section, pick the camera from the two above or the finder, and if you want a second pair of eyes on the dataset plan, reach us through the contact page - expert support comes with every order.
Questions
Can I collect license plate training data from CCTV video?
Yes. Sample every 5th frame from 25 fps footage; consecutive frames are near-duplicates that bias the model toward easy cases. Keep full frames for the detectors and cut crops only for the recognizer. Log camera and timestamp so you can split by session later, and expect night footage to need its own batch: a set captured only in daylight under-reads at night by several points.
Do I need a colour camera for license plate recognition?
If plates in your market are told apart by colour - yellow versus white, a coloured band, taxi or diplomatic colours - yes: the plate detector uses colour as a feature and mono throws it away. Mono works only where geometry alone separates plate from vehicle. Whichever you pick, lock white balance and exposure so training images match field images, and treat training data with the same normalization your pipeline applies at run time.
What read rate should I reach before go-live?
Use 95% full-plate reads on your 300 held-out real plates as the gate, with character-level accuracy at 98% or better. Then break the score down by lane and by time of day before accepting it: a 96% average can hide 99% by day and 90% at night, and the night number is the one that generates complaints. If night lags by 5 points or more, fix capture before touching the model.
Are license plates personal data in a training set?
In many jurisdictions, yes - under the EU's GDPR a plate tied to a vehicle image is personal data. Keep the dataset access-controlled, record where and when you captured each batch, and blur third-party plates before sharing images outside the project. Synthetic plates sidestep the issue for the portion they cover, but the held-out test plates must stay real, so they stay covered by the rules.
Do two-row or trailer plates need their own model?
Two-row plates change the plate detector's job - the aspect ratio it learned no longer matches - so annotate them as their own plate class and include them in the detector retrain; the recognizer handles them as two strings or one sequence with a row break. Motorcycle and trailer plates are usually just more data, not new classes, unless their characters drop below the 20-pixel floor at your camera.


