A small e-commerce imaging project has found that a generative image model can produce polished product-label photos while silently changing legally required text. The safeguard, the team reports, is not closer visual inspection but an independent reference against which every processed image is checked.
The project turned phone photos of carton back panels into clean, straightened images on white backgrounds for online product pages. The panels carried manufacturer and importer names and addresses, warning texts and contact details such as phone numbers. The images could look better, but the information on them had to remain unchanged. In measurement terms, the printed text was the measurand, not the appearance of the image.
A clean result that changed the text
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 identical. The output looked professional, with sharp print, even light and a clean background. A comparison with the source found that the digits 2801 had become 2001, a phone number contained wrong digits, and a comma had turned into a full stop while elsewhere a full stop had become a comma.
Because the changes were plausible, they were not easy to spot at a glance. For mandatory information, the team concluded, this was not a cosmetic issue. All generated images were discarded and none was published. The lesson was that a generative model produces what text plausibly looks like, not necessarily what was printed, and that visual inspection is a weak check against plausible errors.
A deterministic chain keeps photographed pixels
The team replaced the model with a deterministic processing chain. The carton face is rectified with a perspective transform from four corner points. Uneven lighting is flattened by estimating the background illumination and dividing it out, followed by white balancing to a target tone. Denoising is gentle and edge-preserving.
Text blocks are marked as protected regions in which pixels pass through the background clean-up unchanged. The result is then placed on a white background with a soft shadow. Nothing on the carton is redrawn or re-typeset, and every character in the final printed panel is derived from the photographed pixels.
An untouched reference and two measurement principles
For each image, the team kept a reference: the same crop after rectification and the illumination and white-balance step only, before denoising or clean-up. Every processed carton face was compared with that reference before it was placed on the background, using two different measurement principles.
The first is an OCR diff. Both images are read by an open-source OCR engine with German and English language data after upscaling, and the resulting word sequences are aligned so deviations can be listed. The second is an ink check that does not depend on reading text. Pixels clearly darker than the carton background in the reference count as print; if such pixels become light in the processed image and most of a connected group disappears, that group is flagged as a lost character.
Classical filters also need checking
The gate showed that classical filters are not automatically safe. A speckle filter had turned 130 into 30 and removed colons, while a threshold clean-up step had erased the dot in a web address. Both stages were dropped. As the team puts it, any step that decides what counts as noise can also decide that a full stop is noise.
OCR itself brought measurement uncertainty. On small print, it misread the reference image as well, for example reading a 5 as an S. A raw OCR diff therefore reports disagreements that the processing did not cause. Taken at face value, these can lead to false rejects; ignored wholesale, they can hide real changes and produce false accepts.
The team compared this with a gauge study, in which variation from the measurement system must be separated from variation in the part. In this case, the OCR’s misreads of the reference had to be separated from changes introduced by processing. A second, independent principle, the ink check, and a separate review step did that work. Each disagreement was treated as a stop to be resolved rather than as a similarity score to be averaged away.
Second review and published-file check
A separate automated review, independent of the processing chain, checked the images in two rounds. In the first round, a composite image failed because one inserted line could not be verified reliably. The team removed the composite and used the genuine information block from the carton instead. Before any image was replaced, the previous state was backed up so it could be restored.
After publication, the team downloaded the files as actually delivered and compared them with its own copies. At reduced resolution, the mean absolute greyscale difference was well under one grey level. The published file is the last link in the chain and was given the same kind of check as every step before it.
Practical takeaways for quality teams
The team’s recommendations are to define the measurand, keep a separate reference from the earliest reliable processing step and never compare an output only with itself. It advises using two measurement principles, such as an OCR text diff and a pixel-level ink check, and characterising the OCR’s own errors on the reference before trusting its verdicts.
- Treat any disagreement as a stop, not a score.
- Test classical filters as rigorously as AI tools.
- Add an independent second review and remove what cannot be verified.
- Back up before every change and pixel-compare the published files.
- Improve the input with frontal, unwrapped, frame-filling photos taken in daylight.
Generative models remain useful for images where nothing has to be read. For images that carry mandatory information, the team now uses classical processing plus a text comparison against the original. When the output and the reference disagree, the answer should come before anything is published.
