AI Engineering

How to Build Image Recognition That Works in the Real World

From a good demo to a system that holds up with real cameras, real light and real users.

3 min read

Close-up of a camera lens
Photo: Eric Prouzet on Unsplash

In short

  • Image recognition that works in a demo often fails on the factory floor, in the warehouse or on a customer’s phone. The cause is usually the data, not the model.
  • Collect images in real conditions: the actual cameras, lighting, angles, dirt and rare cases.
  • Pick the simplest approach that meets the target: a ready-made API, a fine-tuned pretrained model or classic machine vision.
  • Measure per class and per condition, decide where it runs (edge or cloud), and monitor it after launch.

Image recognition software is easy to demo and hard to ship. A model that reaches high accuracy on a clean test set can struggle with a new camera, a dusty lens or winter light. Here is how we would build image recognition that holds up in the real world.

1. Define the task precisely

TaskOutputExample
ClassificationOne label per imageGood part or defective part
Object detectionBoxes around objectsFind every pallet in a frame
SegmentationPixel-level outlinesMeasure the area of a scratch
Text reading (OCR)Characters and codesRead labels, serial numbers, documents
Visual searchSimilar imagesFind matching products or parts

Then set a target that matters to the business: “miss fewer than 1 in 1,000 defects while rejecting fewer than 2% of good parts” is a target; “high accuracy” is not.

2. Collect data in real conditions

  • Use the cameras, lenses and mounting positions you will use in production.
  • Capture across shifts, seasons, lighting changes and dirty lenses.
  • Collect the rare cases on purpose: they are the ones that matter.
  • Record metadata: camera, time, location, product type. You will need it to find failure patterns.

3. Label carefully

Write labelling rules with picture examples, especially for borderline cases. Have two people label a sample and compare. Disagreement between people usually means the rule is unclear, and the model will be just as confused. Our guide to preparing data for an AI product covers this in more depth.

4. Choose the simplest approach that works

  • Ready-made APIs for common tasks such as general tagging or document text. Fast to try, limited control.
  • Pretrained models, fine-tuned on your images. The usual choice for custom objects and defects.
  • Classic machine vision (measurement, pattern matching, barcode reading) when conditions are controlled. It is often more predictable than deep learning, and many industrial tools combine both.

5. Evaluate per class and per condition

  • Report precision and recall for each class, not one overall accuracy number.
  • Break results down by camera, lighting, product and site.
  • Look at the errors themselves; patterns show up faster in images than in tables.
  • Keep a test set from a different time period or site, to check the model generalises.

6. Decide where it runs

On the edge (camera, embedded board, phone or robot) for low latency, offline operation and privacy. In the cloud for heavy models, large volumes or central monitoring. Many systems combine both: fast checks on the device, harder cases sent to the cloud.

7. Handle people and privacy with care

If images contain people, GDPR applies, and biometric data used to identify someone is a special category of personal data with stricter rules (GDPR, Article 9). The AI Act also bans some uses outright, such as building facial recognition databases by untargeted scraping of facial images (AI Act, Article 5). Blur or crop people when the task does not need them.

8. Monitor after launch

  • Sample predictions for human review, especially low-confidence ones.
  • Watch for drift: new products, new cameras, new lighting.
  • Feed confirmed errors back into the training and test sets.
  • Version models and roll back quickly if results drop.

From our work

We have taken AI into real products: the software of an autonomous warehouse drone for D-ARIA with more than 99% inventory accuracy (case study), and AI-based person following for a mobile robot with EFS Consulting. If you have an AI prototype, our free AI prototype to production review tells you what to keep, what to fix and what it will take.

Technologies you will meet

AreaTypical tools
TrainingPyTorch, TensorFlow, Ultralytics YOLO, Hugging Face Transformers
LabellingCVAT, Label Studio
OptimisationONNX, TensorRT, OpenVINO, ONNX Runtime
Vision toolsOpenCV, albumentations, FiftyOne
DeploymentNVIDIA Jetson, Docker, Kubernetes, mobile Core ML and LiteRT

To run models on robots and cameras, read edge AI on NVIDIA Jetson.

Looking for a partner? See our list of computer vision companies in Europe. For machines that also move and act, read what physical AI is, or see our robotics and perception work.

Frequently asked questions

Why does image recognition fail in production?

Usually because real images differ from training images: other cameras, lighting, angles, dirt, new products or rare cases that were never collected. Collecting data in real conditions and monitoring after launch fixes most of it.

How many images do I need to train image recognition?

It depends on the task and variety. Fine-tuning a pretrained model can start with hundreds of good examples per class, but rare and borderline cases matter more than raw volume.

Should image recognition run on the edge or in the cloud?

On the edge when you need low latency, offline operation or privacy; in the cloud for heavy models and central monitoring. Many systems combine both.

Is face recognition allowed in the EU?

Only within strict limits. Biometric data used to identify people is special-category data under the GDPR, and the AI Act bans some practices, such as untargeted scraping of facial images to build recognition databases.

Working on something like this?

Tell us where the product is stuck. We answer with a concrete next step.

Send a few lines about the product, the deadline and the team you have today. A senior engineer replies within two working days.