Document Type : Research Article
Authors
1
Department of Biosystems Mechanical Engineering Shahid Bahonar University of Kerman, Iran
2
Department of Computer Engineering Shahid Bahonar University of Kerman, Iran
3
Department of Chemistry Shahid Bahonar University of Kerman, Iran
Abstract
Introduction
Ensuring the authenticity and safety of almonds is a critical food safety challenge, primarily due to the presence of amygdalin in bitter varieties, a cyanogenic glycoside that can release toxic hydrogen cyanide upon hydrolysis. Traditional detection methods, such as chromatography, are often destructive, time-consuming, and unsuitable for industrial-scale applications. While the current laboratory-scale analysis relies on a sample preparation method (KBr pellet) that is inherently destructive, the ultimate goal of this research is to develop a non-destructive, automated sorting system suitable for industrial implementation. This can be achieved through the use of alternative FTIR techniques, such as Attenuated Total Reflectance (ATR)-FTIR, which allows for direct analysis of the almond shell surface without the need for sample preparation. This study addresses the need for rapid, non-destructive, and automated sorting by developing an integrated framework that combines Fourier-transform infrared (FTIR) spectroscopy of almond shells with machine learning and mechatronic automation. The research specifically focuses on exploiting the rich phenolic content of almond shells as a novel, low-cost substrate for reliable classification.
Materials and Methods
A set of 200 almonds (100 bitter, 100 sweet) was collected. Their shells were separated, vacuum-dried, ground into powder, and pressed into potassium bromide (KBr) pellets for analysis. FTIR spectra were recorded in the range of 400–4000 cm⁻¹. The raw spectral data underwent preprocessing using first and second Savitzky–Golay derivatives, Standard Normal Variate (SNV), and Multiplicative Scatter Correction (MSC). Four supervised learning algorithms, Support Vector Machine (SVM), Random Forest (RF), Multi-Layer Perceptron (MLP), and an Autoencoder-MLP hybrid, were trained and compared, using a 70-30 train-test split with fivefold cross-validation. The best-performing model's output was integrated with a custom-built laboratory-scale mechatronic sorting system. This system featured a conveyor belt, a microcontroller-based control board, and a mechanical deflection mechanism to physically separate the almonds based on the classification decision.
Results and Discussion
Among the tested models, the MLP network achieved the highest classification performance for almond shells, with an accuracy of 95.5% and an Area Under the Curve (AUC) of 0.984. Statistical analysis via the McNemar test confirmed its significant superiority over the best classical model (RF, p < 0.01). This superior performance is attributed to the MLP's ability to model the complex, non-linear relationships within the high-dimensional FTIR spectral data, which traditional linear models like SVM (accuracy 82.5%) failed to capture effectively. Feature importance analysis revealed three key discriminating spectral bands: 1030 cm⁻¹ (associated with phenolic C–O stretching), 1740 cm⁻¹ (related to carbonyl C=O stretching), and 2920 cm⁻¹ (linked to aliphatic C–H stretching). These bands were more pronounced in bitter almond shells, corresponding to their higher phenolic and lipid content, including amygdalin derivatives. Dimensionality reduction visualisations using t-SNE and UMAP on the latent features extracted by the Autoencoder-MLP model further corroborated the superior class separability achieved by deep learning approaches compared to linear methods like PCA. When the MLP model's decisions were deployed on the mechatronic sorter, the system achieved an average physical sorting accuracy of 99.5% across consecutive tests with varying sample compositions. Error analysis indicated that the primary sources of infrequent mis-sorting were related to mechanical synchronisation and sample positioning on the conveyor, rather than errors in the MLP classification algorithm itself. The throughput was measured at 30–35 almonds per minute, demonstrating practical potential for medium-scale processing. This performance aligns with or surpasses the accuracy ranges reported in recent studies utilising HSI or ATR-FTIR for almond discrimination, while uniquely adding the critical step of real-time physical separation.
Conclusion
This study successfully demonstrates the feasibility of a non-destructive, integrated system for almond authentication and sorting. The integration of shell-based FTIR spectroscopy with an MLP classifier yields superior analytical accuracy. Crucially, the direct integration of this classification into an automated mechatronic sorter bridges the gap between laboratory detection and industrial application. The approach offers a scalable, cost-effective, and non-destructive solution for enhancing food safety in almond processing by enabling the real-time removal of toxic bitter almonds from production lines.
Acknowledgement
The authors gratefully acknowledge the staff of the Chemistry Laboratory of Shahid Bahonar University of Kerman for providing access to FTIR equipment and technical support during the spectral acquisition and analysis process.
Keywords
Subjects