Instruments & Meters

Independent Reference Checks Protect Mandatory Text in Processed Product Images

A German online shop replaced a generative image model with deterministic processing and two independent checks after AI altered digits and punctuation on carton labels.

Petra DahlbergOctober 25, 20265 min read8 views

Two carton back panels on a white studio surface, with a phone camera and a subtle alignment overlay suggesting image comparison.

A small image-processing case at a German-language online shop shows why processed images that carry mandatory text need an independent reference, not just visual inspection. The shop wanted to turn phone photos of carton back panels into straightened, clean images on a white background for product pages. The panels carried manufacturer and importer names and addresses, warning texts and contact details. The images could be improved, but the printed information had to remain unchanged. In measurement terms, the measurand was the text, not the appearance of the image.

Generative model produced plausible but wrong text

The first attempt used a generative image model. The team supplied a straightened carton image and instructed the model to keep every character, number and symbol identical. The output looked professional, with sharp print, even light and a clean background. Comparison with the source showed changes: “2801” became “2001,” a phone number contained wrong digits, and commas and full stops were swapped. Because the changes were plausible, they were difficult to spot at a glance. The team discarded the generated images and published none. Its conclusion was that a generative model produces what text plausibly looks like, not what was printed, and that visual inspection is too weak to serve as the reference.

Deterministic chain keeps photographed pixels

The replacement was a deterministic processing chain. The carton face was rectified with a perspective transform from four corner points. Uneven lighting was flattened by estimating background illumination and dividing it out, followed by white balancing to a target tone. Denoising was gentle and edge-preserving. Text blocks were marked as protected regions where pixels passed through background clean-up unchanged. The result was placed on a white background with a soft shadow. Nothing on the carton was redrawn or re-typeset; every character in the final panel came from photographed pixels.

Two measurement principles and a gate

For each image, the team kept a reference: the same crop after rectification and illumination and white-balance correction only, before denoising or clean-up. Each processed carton face was compared with that reference before being placed on the background, using two principles. The first was an OCR diff. Both images were read by an open-source OCR engine with German and English language data after upscaling; word sequences were aligned and deviations listed. The second was an ink check that did not depend on reading text. Pixels clearly darker than the carton background in the reference counted as print. If those pixels became light in the processed image and most of a connected group disappeared, the group was flagged as a lost character.

Classical filters also failed the gate

The gate showed that classical filters were not automatically safe. A speckle filter turned “130” into “30” and removed colons. A threshold clean-up step erased the dot in a web address. Both stages were dropped. The team noted that any step deciding what counts as noise can also decide that a full stop is noise.

The OCR diff also had its own measurement uncertainty. On small print, the OCR misread the reference, for example reading a “5” as an “S.” A raw diff therefore reported disagreements that processing had not caused. Taken at face value, those produced false rejects; ignored wholesale, they could hide real changes and produce false accepts. The team used a gauge-study analogy: variation from the measurement system had to be separated from changes caused by processing. The ink check and a separate review step helped do that. Disagreements were treated as stops to resolve, not as similarity scores to average away.

Second review, backups and published files

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 team removed the composite and used the genuine information block from the carton. Before any image was replaced, the previous state was backed up for restoration. After publication, the team downloaded the files as delivered and compared them with its own; at reduced resolution, the mean absolute greyscale difference was well under one grey level.

Practical takeaways

The team’s lessons for quality work were to define the measurand, keep a separate reference from the earliest reliable processing step, use two measurement principles, characterize OCR errors on the reference before trusting its verdicts, treat disagreement as a stop, test classical filters as rigorously as AI tools, add independent second review, back up before changes and pixel-compare published files. It also recommended frontal, unwrapped, frame-filling daylight photos as better input. Generative models remain useful where nothing has to be read; for mandatory information, the team now uses classical processing plus text comparison against the original. The same question applies to processed images: when output and reference disagree, the answer should be known before publication.