Journal of Researches in Mechanics of Agricultural Machinery

Journal of Researches in Mechanics of Agricultural Machinery

Feasibility of combining hyperspectral imaging with artificial neural network to detect pistachio powder adulteration

Document Type : Research Paper

Authors
1 Department of Biosystems Engineering, Arak University, Arak, Iran
2 Biosystems Engineering Arak University
Abstract
Introduction
Pistachio (Pistacia vera L.) is one of the world's most valuable nuts, rich in unsaturated fatty acids, high-quality proteins, phenolics, vitamins, and minerals. In 2022, Iran was the second-largest producer after the USA, and Turkey was in third place after Iran. Due to its high economic value and growing demand, pistachio powder is highly susceptible to adulteration, including mixing with cheaper powders and adding artificial colorants. Such fraud harms consumer rights and can pose health risks, particularly for individuals with allergies or favism.
Among various adulterants, faba bean (Vicia faba) powder is commonly used due to its low cost, similar color and texture, lack of strong taste or odor, and easy mixability. Traditional methods, such as sensory evaluation and simple chemical tests, cannot reliably detect this adulteration. Destructive techniques like chromatography and mass spectrometry are accurate but time-consuming, expensive, and unsuitable for rapid screening.
Recently, non-destructive methods have gained attention. Research on pistachio adulteration has focused on near-infrared, mid-infrared, and Raman spectroscopy, as well as image processing and deep learning. Hyperspectral imaging, which combines spectral and spatial information, has been successfully used to assess pistachio kernel quality, moisture content, aflatoxin, and fungal contamination. However, its application for detecting faba bean adulteration in pistachio powder has not been systematically reported. Given the complexity of hyperspectral data, artificial neural networks are ideal for pattern recognition and accurate adulteration detection.
This study aims to develop a rapid, non-destructive, and accurate method based on hyperspectral imaging combined with an artificial neural network to detect the levels of adulteration in pistachio powder with faba bean powder.
Material and Methods
Pistachio kernels (cv. Ahmad Aghaei) and faba beans were purchased from a local market. One day before the experiments, raw samples were separately milled, sieved through a 30-mesh (600 μm) sieve to achieve uniform particle size, and stored in nylon bags at room temperature. Adulterated samples were prepared by mixing faba bean powder with pure pistachio powder at 0% (pure), 25%, and 50% weight ratios. For each adulteration level, 40 samples (total of 120) were prepared. Approximately 6.5 g of each sample was placed in a wooden cup, and the surface was flattened to reduce shadow effects.
A VA1000 hyperspectral imaging system (NIT Optics) with a spectral range of 400–1000 nm was used. Reflectance calibration was performed using white and dark references. Min Max normalization was applied for standardization. Principal Component Analysis was used for dimensionality reduction. A multilayer perceptron neural network with one hidden layer was trained using 70% of the data and tested on 30%, using IBM Modeler v.18.
Results and Discussion
After observing the spectra, the initial and final wavelengths were removed due to high noise, and the spectral region from 450 to 1000 nm was analyzed. To examine differences among sample spectra, their mean spectra were plotted.
In principal component analysis, new variables are created, each being a linear combination of the original variables. These principal components retain the maximum information from the original variable matrix. The first principal component contains the largest variance, the second captures information not explained by the first, and so on. PCA performed in IBM Modeler ranked all principal components by importance. In this study, only PC1, PC2, PC4, and PC5 were identified as important. The distribution of samples in the coordinate system of the first three principal components showed good separation between classes, which is promising for achieving a high-accuracy classification model.
The software selected a three-layer perceptron neural network with one hidden layer containing three neurons. The input layer had four neurons (corresponding to the four principal components), and the output layer had three neurons for classification into classes A, B, and C. The confusion matrix showed accuracies of 98.80% for training and 94.59% for testing. Errors occurred only for class C, while classes A and B achieved 100% accuracy. Thus, the combination of hyperspectral imaging and an artificial neural network successfully distinguished the three classes, with perfect detection of pure pistachio powder.
Unlike previous studies that used adulterants such as green peas or spinach, this study uniquely employed faba bean powder—an inexpensive and common product in Iran. Hyperspectral imaging enables detailed characterization of pistachio biochemical components, including proteins, carbohydrates, minerals, fatty acids, and phenolic compounds. However, overlapping spectral features of pistachio and faba bean make interpretation challenging.
Conclusions
In this study, a novel, rapid, and non-destructive method based on hyperspectral imaging (400–1000 nm) combined with a multilayer perceptron artificial neural network was developed to detect adulteration of pistachio powder with faba bean powder. The results showed that the proposed method can distinguish pure samples from adulterated ones (25% and 50% faba bean powder) with excellent accuracy. Due to its non-destructive nature and high speed, this approach has significant practical potential for integration into food production lines, quality control laboratories, and inspection systems. Overall, the combination of hyperspectral imaging and neural networks can serve as an effective and reliable tool to preserve pistachio authenticity, prevent economic fraud, and protect consumer rights.
Future research should focus on evaluating the method's performance for detecting other adulterants, expanding the model with larger datasets that include lower adulteration levels (e.g., 5%, 10%, and 15%) and, as a next step, validating the approach on real production lines.
Keywords
Subjects

Milk adulteration identification using hyperspectral imaging and machine learning. Journal of Dairy Science, 108(2), 1301-1314. https://doi.org/10.3168/jds.2024-25635
 
Callao, M. P., & Ruisánchez, I. (2018). An overview of multivariate qualitative methods for food fraud detection. Food Control, 86, 283-293. https://doi.org/10.1016/j.foodcont.2017.11.034
 
Cevoli, C., Mingrone, M., & Fabbri, A. (2026). Hyperspectral imaging and linear and nonlinear machine learning for tracing the geographical origin of pistachios. Food Control, 184, 112048. https://doi.org/10.1016/j.foodcont.2026.112048
 
Çinarer, G., Doğan, N., Kılıç, K., & Doğan, C. (2024). Rapid detection of adulteration in pistachio based on deep learning methodologies and affordable system. Multimedia Tools and Applications, 83(5), 14797-14820. https://doi.org/10.1007/s11042-023-16172-5
 
Cortés, V., Blasco, J., Aleixos, N., Cubero, S., & Talens, P. (2019). Monitoring strategies for quality control of agricultural products using visible and near-infrared spectroscopy: A review. Trends in Food Science & Technology85, 138-148. https://doi.org/10.1016/j.tifs.2019.01.015
 
Doğan, C., Şehirli, E., Doğan, N., & Buran, İ. (2023). Non-targeted approach to detect pistachio authenticity based on digital image processing and hybrid machine learning model. Journal of Food Measurement and Characterization, 17(2), 1693-1702. https://doi.org/10.1007/s11694-022-01671-0
 
Eksi-Kocak, H., Mentes-Yilmaz, O., & Boyaci, I. H. (2016). Detection of green pea adulteration in pistachio nut granules by using Raman hyperspectral imaging. European Food Research and Technology, 242(2), 271-277. https://doi.org/10.1007/s00217-015-2538-3
 
Faqeerzada, M. A., Lohumi, S., Kim, G., Joshi, R., Lee, H., Kim, M. S., & Cho, B. K. (2020). Hyperspectral shortwave infrared image analysis for detection of adulterants in almond powder with one-class classification method. Sensors, 20(20), 5855.
 
Genis, H. E., Durna, S., & Boyaci, I. H. (2021). Determination of green pea and spinach adulteration in pistachio nuts using NIR spectroscopy. Lwt, 136, 110008. https://doi.org/10.1016/j.lwt.2020.110008
 
He, H. J., Chen, Y., Li, G., Wang, Y., Ou, X., & Guo, J. (2023). Hyperspectral imaging combined with chemometrics for rapid detection of talcum powder adulterated in wheat flour. Food Control, 144, 109378. https://doi.org/10.1016/j.foodcont.2022.109378
 
Horn, B., Esslinger, S., Pfister, M., Fauhl-Hassek, C. and Riedl, J. 2018. Non-targeted detection of paprika adulteration using mid-infrared spectroscopy and one-class classification–Is it data preprocessing that makes the performance? Food chemistry, 257, 112-119. https://doi.org/10.1016/j.foodchem.2018.03.007
 
Innamorato, V., Longobardi, F., Lippolis, V., Cortese, M., Logrieco, A.F., Catucci, L., Agostiano, A. and De Girolamo, A. (2019). Tracing the Geographical Origin of Lentils (Lens culinaris Medik.) by Infrared Spectroscopy and Chemometrics. Food Analytical Methods, 12(3), 773-779. https://doi.org/10.1007/s12161-018-1406-8
 
Jamshidi, B., (2012). Non-destructive Taste Characterization and Classification of Oranges Using Vis/NIR Spectroscopy, Doctoral Dissertation, Tarbiat Modares University. (In Persian).
 
Khadivi, A., Nikoogoftar-Sedghi, M., & Tunç, Y. (2025). Agronomic characteristics, mineral nutrient content, antioxidant capacity, biochemical composition, and fatty acid profile of Iranian pistachio (Pistacia vera L.) cultivars. BMC Plant Biology, 25(1), 1-21. https://doi.org/10.1186/s12870-025-06094-9
 
Kheiralipour, K., Ahmadi, H., Rajabipour, A., Rafiee, S., Javan-Nikkhah, M., Jayas, D. S., & Siliveru, K. (2016). Detection of fungal infection in pistachio kernel by long-wave near-infrared hyperspectral imaging technique. Quality Assurance and Safety of Crops & Foods, 8(1), 129-135.
 
Martínez-Peña, R., Castillo, S., Vélez, S., & Álvarez, S. (2026). HSI and ML for non-destructive pistachio quality assessment: Influence of location and irrigation on nutrient and fat composition. Food Control, 112011. https://doi.org/10.1016/j.foodcont.2026.112011
 
Menevseoglu, A., Aykas, D. P., & Adal, E. (2021). Non-targeted approach to detect green pea and peanut adulteration in pistachio by using portable FT-IR, and UV–Vis spectroscopy. Journal of Food Measurement and Characterization, 15(2), 1075-1082. https://doi.org/10.1007/s11694-020-00710-y
 
Mishra, P., Mohd Asaari, M.S., Herrero-Langreo, A., Lohumi, S., Diezma, B., & Scheunders, P. (2017). Close range hyperspectral imaging of plants: A review. Biosystems Engineering, 164, 49-67. https://doi.org/10.1016/j.biosystemseng.2017.09.009
 
Mohammadi-Moghaddam, T., Razavi, S. M., Taghizadeh, M., Pradhan, B., Sazgarnia, A., & Shaker-Ardekani, A. (2018). Hyperspectral imaging as an effective tool for prediction the moisture content and textural characteristics of roasted pistachio kernels. Journal of Food Measurement and Characterization, 12(3), 1493-1502. https://doi.org/10.1007/s11694-018-9764-x
 
Nargesi, M. H., Amiriparian, J., Bagherpour, H., & Kheiralipour, K. (2024). Detection of different adulteration in cinnamon powder using hyperspectral imaging and artificial neural network method. Results in Chemistry, 9, 101644. https://doi.org/10.1016/j.rechem.2024.101644
 
Park, J. J., Cho, J. S., Lee, G., Yun, D. Y., Park, S. K., Park, K. J., & Lim, J. H. (2023). Detection of red pepper powder adulteration with allura red and red pepper seeds using hyperspectral imaging. Foods, 12(18), 3471.
 
Sezer, B., Apaydin, H., Bilge, G., & Boyaci, I. H. (2019). Detection of Pistacia vera adulteration by using laser induced breakdown spectroscopy. Journal of the Science of Food and Agriculture, 99(5), 2236-2242.
 
Taylan, O., Cebi, N., Yilmaz, M. T., Sagdic, O., Ozdemir, D., & Balubaid, M. (2021). Rapid detection of green‐pea adulteration in pistachio nuts using Raman spectroscopy and chemometrics. Journal of the Science of Food and Agriculture, 101(4), 1699-1708.
 
Taylan, O., Bulut, M., Cebi, N., Sagdic, O., & Celebi, Y. (2026). Explainable AI-assisted hybrid self-organising maps and deep learning algorithms for detecting pistachio adulteration with peas. Food Additives & Contaminants: Part A, 1-19. https://doi.org/10.1080/19440049.2025.2597288
 
Temizkan, R., Doğan, M. A., Atakan, O., Nazlım, B. A., & Ayvaz, H. (2020). Rapid detection of green pea adulteration in ground pistachio nuts using near and mid-infrared spectroscopy. International Journal of Agriculture Forestry and Life Sciences, 4(1), 71-78.
 
Teye, E., Amuah, C.L., McGrath, T. and Elliott, C. 2019. Innovative and rapid analysis for rice authenticity using hand-held NIR spectrometry and chemometrics. Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy. https://doi.org/10.1016/j.saa.2019.03.085
 
Trentanni Hansen, G. J., Almonacid, J., Albertengo, L., Rodriguez, M. S., Di Anibal, C., & Delrieux, C. (2019). NIR-based Sudan I to IV and Para-Red food adulterants screening. Food Additives & Contaminants: Part A, 36(8), 1163-1172. https://doi.org/10.1080/19440049.2019.1619940
 
Williams, L., Shukla, P., Sheikh-Akbari, A., Mahroughi, S., & Mporas, I. (2025). Measuring the level of aflatoxin infection in pistachio nuts by applying machine learning techniques to hyperspectral images. Sensors, 25(5), 154