Development of an ANN-assisted computational hyperspectral reconstruction system and deep learning framework for spoilage detection in sliced bread
Deblu Sahu, Sivaraman Jayaraman, Bala Chakravarthy Neelapu, Maciej Jarzębski, Wojciech Smułek, Kunal PalAbstract
There is a high demand for rapid and non-destructive material characterization techniques for food quality inspection to reduce global food waste. In this study, an AI-enabled computational hyperspectral (HS) reconstruction system was developed as a new tool for food quality detection. The proposed system integrates a CMOS camera with a custom-designed graphical user interface (GUI) and a pre-trained artificial neural network for pixel-wise spectral reconstruction and HS image generation across the 340–850 nm range. Commercial white bread (test samples) was monitored over a 10-day storage period, with spectral, HS, and electrical impedance spectroscopy (EIS) measurements taken at every 48 h interval. According to the EIS results, the critical transition period occurred at Day 6, followed by significant degradation of physicochemical properties from Day 8. Two wavelength selection strategies, i.e., manual based on spectral profile variation and automated using machine learning models, were employed to identify key wavelengths. The key spectral wavelengths identified using the manual selection method are 477, 494, 513, 523, & 619 nm, and automated selection strategies are 467, 474, 508, 511, & 591 nm. Deep learning models were trained on two datasets: a binary (Fresh vs. Spoiled) and a multiclass (Fresh vs. Marginally Fresh vs. Spoiled) dataset. The 2D-CNN model achieved the highest testing accuracy of 0.9726 (MCC: 0.9327) for binary classification using auto-selected wavelengths, while Inception V3 achieved 0.9775 accuracy (MCC: 0.9660) for multiclass classification. Notably, the auto-selection of spectral components improves model generalization, especially for multiclass classification tasks. The proposed system can be applied to develop a scalable solution for early detection of bread spoilage, supporting future applications in food safety and quality control.