Semi-Supervised Hyperspectral Food Anomaly Detection Through Batch-wise Distribution Alignment

Published: 21 Oct 2025, Last Modified: 12 Nov 2025OpenReview Archive Direct UploadEveryoneCC BY-NC 4.0
Abstract: Hyperspectral imaging (HSI), with its rich spatial–spectral information beyond conventional imaging techniques, has emerged as a promising technology for safetycritical industrial inspection. In food quality assurance, anomaly detection in hyperspectral data plays a vital role in identifying contamination, adulteration, and foreign materials. However, most existing pixel- and patch-level approaches rely on trainingderived normality references, which often fail to generalize under real-world variations such as illumination shifts, object positioning, or temperature fluctuations. To address these limitations, we propose a semi-supervised anomaly detection framework that enforces batch-wise distributional alignment of normal patch-level embeddings through a Maximum Mean Discrepancy (MMD)-based objective. Our method introduces a learnable weighted masking module to suppress local noise and adaptively reweight spatial information, followed by an MMD-driven scoring function to achieve anomaly inference at the batch level. Extensive experiments on three industrial food inspection datasets—Carrot, Corn, and Pistachio—demonstrate that the proposed method consistently outperforms state-of-theart baselines, achieving improvements of up to 10.40% AUPR. These results highlight the effectiveness and robustness of our approach, underscoring its potential for reliable deployment in practical, real-time industrial food inspection systems.
Loading