Abstract
Many food products carry a decoration that is placed at random and is always normal, such as sesame seeds on a burger bun, while the defects that matter lie on the surface underneath. We call this setting stochastic normal decoration. We introduce a benchmark for this setting: plain loaves with and without synthetic sesame placed by a model fitted to real buns, so that every defective loaf exists in a paired form, together with real sesame buns. On it, PatchCore loses most of its detectability and its heat concentrates on the seeds. A 2x2 swap of memory bank and test image shows why: at the defect pixels that plain PatchCore finds, sesame leaves the nearest-neighbour distance unchanged; it raises the distance of normal surface, most strongly next to seeds. We therefore propose decoration-context normalisation, which standardises each pixel's PatchCore distance against normal pixels that share its context (distance to the nearest detected seed, local seed density, distance to the region edge), with statistics from normal calibration images outside the memory bank. It needs no defect labels or retraining and removes no pixel. With calibration units physically disjoint from bank and test, it raises image AUROC over PatchCore's own image score (the maximum patch distance of the official code) from 0.727 to 0.920 on the paired set (all six loaves improve) and from 0.775 to 0.945 on real buns (four of five buns); the 95% hierarchical bootstrap intervals of both gains exclude zero (real buns [+0.03, +0.34]). Part of this gain comes from the blurred maximum our method uses as its image score: against PatchCore scored the same way, the gains are 0.768 to 0.920 and 0.894 to 0.945, with an interval that excludes zero on the paired set only; the real buns also served to choose the context variables. Score-level masking of detected seeds reaches numerically similar AUROC with no difference that excludes zero, but it stops inspecting 16% of the bun (30% at the wider ring), and in an exploratory stress test with pasted objects it detects white seed-shaped flakes and chips less well than our method; both fail on piles of seeds, which the detector accepts as decoration. In a synthetic colour-transfer test with glossy black sesame on the same loaves, with the seed detector mirrored to dark seeds and all other settings unchanged, the method again improves every loaf over PatchCore, while masking is better because the dark-seed detector also picks up dark defects.