Self-supervised learning for aflatoxin B1 detection using masked spectra.
Journal:
Food chemistry
Published Date:
Feb 8, 2026
Abstract
Aflatoxins are highly toxic secondary metabolites widely found in peanut and maize kernels. This study proposes a strategy based on self-supervised learning (SSL) for the accurate detection of Aflatoxin B1 in peanuts and maize. Firstly, an SSL backbone network was constructed to perform a spectral reconstruction task on masked spectra, providing pre-trained weights for subsequent supervised learning. Secondly, the spectral reconstruction error was innovatively used as a wavelength attention mechanism, integrated with the fine-tuned encoder from the SSL stage to develop a classification model. This model achieved a mean accuracy of 0.9805 ± 0.0019 in peanuts and 0.9478 ± 0.0060 in maize, outperforming other deep learning models. Furthermore, key wavelengths were selected based on the spectral reconstruction error. Experimental results demonstrated that the 40 selected key wavelengths outperformed other methods, with a more uniform distribution, capturing richer spectral features. The strategy in this study provides an efficient solution for few-sample spectral detection.
Authors
Keywords
No keywords available for this article.