Reading number plates at a yard gate: what building Theia taught us

Building Theia, our own plate recognition product for logistics yards: Indian plates, Vahan and e-way bill checks, and the trucks a person reviews.

A yard gate needs two answers about every truck: what does the plate say, and does this truck have a reason to be here? Reading the plate is the part computer vision does well. Checking it against the Vahan registry and the GST e-way bill, and putting the odd ones in front of a person, is what makes a plate reader useful at a gate. This is what we learned building Theia, our own plate recognition product for logistics yards in India.

The yard gate problem

A logistics yard sees a steady stream of trucks, and each one has to be recorded in and out. At a manual gate that means someone writing a number down and matching it to a document later. [What the gate looked like before Theia: staff, volumes, how long a truck waited]

A plate reader replaces the notebook, but the number alone tells the gate very little. What the gate wants to know is whether the truck is registered, and whether it is carrying a load with an e-way bill that matches.

Yard gate: one truck, start to finishCleared at the gate

  1. Camera reads the frame Gate cameras, day and night
  2. Plate text The characters read, and how sure the reader is of them Goes to a person: If the read is unclear
  3. Vahan check Is the truck registered? Goes to a person: If there is no registration, or it does not match the truck
  4. GST e-way bill check Is there an e-way bill that matches the load? Goes to a person: If there is no bill, or it does not match the load
  5. Cleared at the gate The read and both records agree

Needs a person

The trucks that do not resolve go into one queue. The person sees the detected truck, the plate as read and a field to verify it.

A truck is cleared only when the read and both records agree.

How a truck is checked at the gate. Each step either passes the truck on or sends it to a person. [Confirm: what the gate does once a truck is cleared, and who or what acts on it]

Indian plates are harder than the textbook examples

Most plate recognition material assumes one clean line of characters in a standard font, photographed square-on in daylight. A gate in India gives you something else:

  • Two-line plates: some plates split the registration over two lines, and the reading order has to be right before anything else makes sense.
  • Fonts and spacing: plates are not all set in one typeface, so a model trained on a single style will misread the rest.
  • Dirt and damage: mud, dents, bent mounting and worn paint all hide characters, and characters that look different on a clean plate can look alike on a dirty one.
  • Angle and speed: a truck turning into a gate is rarely square to the camera, and part of the plate can be hidden behind another vehicle for a few frames. Tracking the vehicle from frame to frame, so you can keep the best reading of its plate, is worth doing alongside the single-frame model.
  • Night and artificial light: headlights, sodium lamps and glare change how a plate looks. Plate colour carries meaning (commercial vehicles, for instance, run yellow plates) and is a separate matter from vehicle colour, so treat them as two problems.

[Accuracy at the gate, day and night, and how it was measured]

Five things that make a plate hard to readIllustrations

  • Two lines

    Some plates split the registration over two lines, and the reading order has to be right.

  • Fonts and spacing

    Plates are not set in one typeface, and some letters can pass for digits.

  • Dirt and damage

    Mud, dents and worn paint hide characters, and the ones left can look alike.

  • Angle and speed

    A truck turning into a gate is rarely square to the camera, so characters lean and narrow.

  • Night and light

    Headlights, sodium lamps and glare change how a plate looks.

A string of characters is only a guess until something confirms it.

Illustrations drawn for this post, not photographs of real plates.

Reading the plate, then checking it

A string of characters is only a guess until something confirms it. Theia checks what the camera read against Vahan, the national vehicle registration database, and against the GST e-way bill for the load. A plate that reads cleanly but matches no registration is useful information. So is a registered truck with no matching e-way bill.

[Figure 3: what the two checks can say. A small grid of outcomes: registration found or not, e-way bill matched or not, and what the gate does with each combination. Built only from the outcomes described here.]

Because every reading gets checked, a confident wrong reading does more harm than an honest “not sure”, so the reader needs to say when it is unsure instead of guessing. [How Theia scores confidence, and what happens when the registry or the e-way bill service is unavailable]

The trucks a person still has to check

Some trucks will not resolve on their own: a plate too dirty to read, a reading that matches no registration, a number that matches a vehicle but not the load. These go into a queue for a person. The Theia dashboard shows the detected truck, the plate as read, and a field for someone to verify it.

[Figure: the Theia review screen, annotated — needs a current, cleared screenshot]

The queue is part of the product: the gate keeps moving while a person looks at the few trucks that need it. [What share of trucks reach the queue, and how long a person takes to clear one]

The less visible work

Some of the effort never shows on a dashboard. Getting GPU drivers, CUDA and the libraries to agree with each other takes time on every new machine, and tools like Docker and conda help keep that repeatable. Training data has to come from real gates, in different light and from different angles, and labelling it is slow, hand-done work. Running several camera feeds in real time means tuning the models and the pipeline together. [Stack and hardware at a site: cameras, GPUs, feeds per site, size of the labelled dataset]

What we would tell someone building plate recognition for a yard

  1. Start from the decision at the gate, not from the model. Know what a person needs to be told about each truck.
  2. Collect images from your own gate early: its cameras, its angles, its night.
  3. Track each vehicle across frames and keep the best reading.
  4. Check every reading against something that can confirm it. In India that means Vahan and the e-way bill.
  5. Design the queue for the trucks that do not resolve, with the evidence on screen, before you tune the last point of accuracy.

If you are weighing a plate reader for a yard, see what Theia does, or talk to us about AI engineering.

All writing

Want to talk it through?

Talk to a partner

A partner can tell you how it would apply to yours.