Multi-attribute spectral imaging with a wavelength-aware band-gated vision transformer for camellia oil adulteration detection
Abstract
Adulteration-induced differences in near-infrared spectra of camellia oil may occur simultaneously in the global spectral profile, local variation patterns, and interactions among distant spectral regions. Conventional one-dimensional modeling provides limited means to preserve and jointly learn these multilevel relationships. This study proposes a wavelength-aware Vision Transformer driven by multi-attribute spectral imaging (ViT-BandGate) for qualitative detection of camellia oil adulteration. The preprocessed spectrum and its first- and second-order variations are encoded into a two-dimensional joint representation that preserves their wavelength-wise co-location, thereby integrating global absorption profiles with local slope and curvature information. A Transformer subsequently learns long-range dependencies across spectral regions, while the proposed BandGate adaptively modulates regional token contributions under an explicit wavelength-continuity prior. The method was evaluated on a multi-date dataset containing 884 near-infrared spectra: 84 pure camellia-oil spectra and 800 spectra adulterated with rapeseed, peanut, or sunflower oil. Using a stratified hold-out test set and a validation-calibrated decision threshold, ViT-BandGate achieved 98.29% accuracy, 99.07% balanced accuracy, 100.00% pure-oil recall, 98.14% adulterated-oil recall, and 99.91% ROC AUC. The results demonstrate high sensitivity to adulterated oils while maintaining reliable recognition of pure camellia-oil samples. Compared with direct one-dimensional deep models and conventional baselines, ViT-BandGate achieved the strongest balanced screening profile for qualitative adulteration detection. These findings indicate that preserving wavelength-wise co-location among multi-order spectral attributes and jointly learning regional importance and global dependencies can improve qualitative adulteration recognition. The proposed framework provides a structured spectral-representation strategy for qualitative, reagent-free authenticity screening of edible oils.