Almonds are a highly valued nut due to their rich protein and nutritional content. However, they are vulnerable to aflatoxin B1 (AFB1) contamination in warm and humid environments. Consumption of AFB1-contaminated almonds can pose serious health risks, including kidney damage, and may lead to significant economic losses. Consequently, a rapid and non-destructive detection method is essential to ensure food safety by identifying and removing contaminated almonds from the supply chain. Hyperspectral imaging (HSI) and 3D deep learning provide a non-destructive, efficient alternative to current AFB1 detection methods. This study presents an attention-guided Inception ResNet 3D Network (AGIR-3DNet) for fast and precise detection of AFB1 contamination in almonds utilizing HSI. The proposed model integrates multi-scale feature extraction, residual learning, and attention mechanisms to enhance spatial-spectral feature representation, enabling more precise classification. The proposed 3D model was rigorously tested, and its performance was compared against 3D Inception and various conventional machine learning models. Compared to conventional machine learning models and deep learning architectures, AGIR-3DNet outperformed and achieved superior validation accuracy of 93.30%, an F1-score (harmonic mean of precision and recall) of 0.94, and an area under the receiver operating characteristic curve (AUC) value of 0.98. Furthermore, the model enhances processing efficiency, making it faster and more suitable for real-time industrial applications.
Kabir et al. (Mon,) studied this question.