Instruments & Meters

Independent Reference Checks Catch Text Changes in Processed Product Images

Chidi OkonkwoOctober 25, 20265 min read9 views

At a glance

  • A small online retailer replaced generative image cleanup with deterministic processing after reference comparisons revealed altered digits and punctuation on mandatory carton text.
  • A small retail imaging project found that a generative model could make plausible but incorrect changes to legally required carton text, including digits and punctuation. The team moved to deterministic processing and used an early-step reference plus OCR and ink checks to decide what could be published.
A carton back panel, an early reference print and two translucent inspection layers illustrate a deterministic image-processing gate in a clean studio setting.

A small retail imaging project has offered a practical example of why processed images that carry mandatory information need an independent reference. The goal was not to create attractive images at any cost, but to straighten phone photos of carton back panels, place them on a white background and prepare them for online product pages without changing the printed information.

The panels included manufacturer and importer names and addresses, warning statements and contact details such as telephone numbers. Better lighting and a cleaner background were acceptable; altered characters were not. The team therefore defined the printed text as the quantity to preserve, rather than the visual appearance of the image.

Generative cleanup produced plausible errors

The first attempt used a generative image model. The team supplied a straightened carton image and instructed the model to keep every printed character, number and symbol unchanged. The result looked polished, with sharp-looking print, even lighting and a clean background.

A comparison with the source image revealed a different outcome. The digits “2801” had become “2001”; a telephone number contained incorrect digits; and commas and full stops had been exchanged in places. Because the changes looked plausible, they were not easy to notice at a glance. The team discarded the generated images and published none of them.

The conclusion was that a generative model can reproduce what text plausibly looks like rather than what was actually printed. Visual inspection was judged too weak a check against plausible errors, and therefore unsuitable as the reference.

A deterministic chain and an early reference

The team replaced the model with a deterministic processing chain. A perspective transform from four corner points rectified each carton face. Uneven illumination was estimated and divided out, followed by white balancing to a target tone. Denoising was kept gentle and edge-preserving. Text areas were marked as protected regions, so their pixels passed through background cleanup unchanged. The finished carton face was then placed on a white background with a soft shadow.

Nothing on the carton was redrawn or re-typeset. Every character in the final image came from the photographed pixels. For each image, the team also kept a reference made from the same crop after rectification and lighting correction, before denoising or cleanup. Each processed carton face was compared with that reference before being placed on the background.

Two checks and a stop rule

The comparison used two independent principles. The first was an OCR diff: both images were upscaled and read by an open-source OCR engine with German and English language data, and the resulting word sequences were aligned so that deviations could be listed. The second was an ink check that did not depend on reading. Pixels clearly darker than the carton background in the reference were treated as print. If such pixels became light in the processed image and most of a connected group disappeared, the group was flagged as a possible lost character.

The gate also showed that classical filters were not automatically safe. A speckle filter changed “130” to “30” and removed colons. A threshold cleanup step erased the dot in a web address. Both stages were dropped. A filter that defines noise can also classify a full stop as noise.

OCR was treated as a measurement system with its own error. On small print it misread the reference as well, for example reading a “5” as an “S”. A raw OCR diff could therefore report disagreements that processing did not cause: taking it at face value could create false rejects, while ignoring it could hide real changes and create false accepts. A second, independent ink check and a separate review step were used to separate OCR error from processing error. The team adopted a rule that each disagreement should stop the workflow until resolved, rather than being averaged into a similarity score.

Review, backup and the published file

A separate automated review, independent of the processing chain, checked the images in two rounds. In the first round, a composite image failed because an inserted line could not be verified reliably; the composite was removed and the genuine information block from the carton was used instead. The previous state was backed up before any image was replaced. After publication, the delivered files were downloaded and compared with the team’s own versions. At reduced resolution, the mean absolute greyscale difference was well under one grey level.

The practical lessons included defining the measurand, keeping a separate reference from the earliest reliable processing step, using two measurement principles, characterising OCR errors before trusting its verdicts, testing classical filters as rigorously as AI tools, adding an independent review and backing up before changes. The team also recommended better input photos: frontal, unwrapped, frame-filling images taken in daylight. Generative models remain useful, in its view, where nothing needs to be read; for images carrying mandatory information, the workflow now relies on classical processing plus a text comparison against the original.

Reported by Chidi Okonkwo, Factory Automation and Motion Editor.