Abstract
Aflatoxin contamination in peanuts poses serious health risks, requiring rapid, non-destructive detection methods. This study developed a hyperspectral imaging (HSI) approach combined with deep learning for quantitative aflatoxin analysis in moldy peanuts. The dynamic degradation of nutrients during mold growth was monitored, and correlations between physicochemical properties, aflatoxin levels, and spectral features were investigated. Various preprocessing methods and feature selection techniques were compared, evaluating conventional machine learning (Partial Least Squares Regression (PLSR), Random Forest (RF), Least Absolute Shrinkage and Selection Operator (LASSO)) against a convolutional neural network (CNN). The CNN model, optimized with median filtering and genetic algorithm-based feature selection, achieved superior performance (R(2)p = 0.972, RMSEp = 8.203, RPDp = 2.738). The proposed HSI-CNN framework provides an efficient, non-destructive solution for high-throughput aflatoxin quantification, supporting industrial food safety monitoring.