Development and Interpretability Analysis of Near-Infrared Spectroscopy Models for Fat and Protein Prediction in Foxtail Millet [Setaria italica (L.) Beauv.]
Abstract
1. Introduction
- Growing and collecting representative foxtail millet samples under field conditions. Measuring reference values for fat and protein content, then analyzing their distributions and statistical characteristics.
- Introducing the Sparrow Search Algorithm to screen key wavelengths from foxtail millet’s near-infrared hyperspectral data. Through multiple independent runs and frequency-based statistics, establishing a stable wavelength selection strategy to obtain a robust set of informative key wavelengths.
- Building quantitative prediction models for fat and protein content based on the selected wavelengths. Identifying the best model by comparing performance metrics and analyzing reasons for differences in model performance.
- Using the SHAP interpretability framework to analyze the optimal model. This quantifies—from both global and local perspectives—the direction, magnitude, and mode of each key wavelength’s contribution to predictions, clarifying the model’s decision logic and improving its transparency and trustworthiness.
2. Materials and Methods
2.1. Experimental Design and Material Collection
2.2. NIR Hyperspectral Data Acquisition
2.3. Determination of Fat and Protein Content
2.4. Spectral Data Preprocessing
2.5. Key Wavelength Selection
2.6. Detection Model Construction and Interpretability
3. Results and Analysis
3.1. Analysis of Variance in Fat and Protein Content in Foxtail Millet
3.2. Spectral Response and Preprocessing of Foxtail Millet
3.3. Key Wavelength Selection and Model Construction for Fat and Protein
3.4. Model Interpretability Analysis
4. Discussion
4.1. Statistical Differences in Fat and Protein Content of Foxtail Millet and Implications for Spectral Modeling
4.2. Analysis of the Advantages of SSA in Spectral Feature Extraction
4.3. Attribution Analysis of Chemical Bonds for Key Wavelength Screening Results
4.4. Decision Mechanism Interpretation Based on SHAP
4.5. Strengths and Limitations of This Study
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
| NIR | Near-Infrared Spectroscopy |
| SSA | Sparrow Search Algorithm |
| PLS | Partial Least Squares Regression |
| RF | Random Forest |
| SVM | Support Vector Machine |
| SHAP | SHapley Additive exPlanations |
| DNN | Deep Neural Network |
| CNN | Convolutional Neural Network |
| S–G | Savitzky-Golay |
| SNV | Standard Normal Variate |
| MSE | Mean Squared Error |
| CV | Coefficient of Variation |
| R2 | Correlation coefficient |
| RMSE | Root mean square error |
| RPD | Relative Percent Deviation |
References
- Yang, X.S.; Wang, L.L.; Zhou, X.R.; Shuang, S.M.; Zhu, Z.H.; Li, N.; Li, Y.; Liu, F.; Liu, S.C.; Lu, P.; et al. Determination of protein, fat, starch, and amino acids in foxtail millet [Setaria italica (L.) Beauv.] by Fourier transform near-infrared reflectance spectroscopy. Food Sci. Biotechnol. 2013, 22, 1495–1500. [Google Scholar] [CrossRef]
- Wang, K.; Zhang, C.Y.; Zhao, W.; Zhang, A.X.; Sheng, Q.H.; Liu, J.K. Effects of dry and wet ball milling on physicochemical properties of foxtail millet. Food Chem. 2025, 483, 143916. [Google Scholar] [CrossRef]
- Mendoza, P.T.D.; Armstrong, P.R.; Siliveru, K.; Pulivarthi, M.K.; Ramalingam, A.P.; Prasad, P.V.; Perumal, R. Non-destructive characterization of pearl millet [Pennisetum glaucum (L.) R. Br.] composition using single--kernel NIR spectroscopy. Crop Sci. 2024, 64, 3043–3051. [Google Scholar] [CrossRef]
- Monica, V.; Anbarasan, R.; Mahendran, R. Cold plasma-induced changes in the structural and techno-functional properties of sprouted foxtail millet protein concentrate. Food Bioprocess Technol. 2025, 18, 850–867. [Google Scholar] [CrossRef]
- Gao, A.Q.; Wang, X.F.; Guo, E.H.; Zhang, D.X.; Cheng, K.; Yan, X.G.; Wang, G.L.; Zhang, A.Y. Rapid and Non-Destructive Assessment of Eight Essential Amino Acids in Foxtail Millet: Development of an Efficient and Accurate Detection Model Based on Near-Infrared Hyperspectral. Foods 2025, 14, 3760. [Google Scholar] [CrossRef] [PubMed]
- Luque-Garcıa, J.L.; De Castro, M.L. Ultrasound-assisted soxhlet extraction: An expeditive approach for solid sample treatment: Application to the extraction of total fat from oleaginous seeds. J. Chromatogr. A 2004, 1034, 237–242. [Google Scholar] [CrossRef] [PubMed]
- Liu, N.; Xie, Z.H.; Helian, M.Y.; Li, J.Y.; Wang, D.N.; Deng, Z.Y.; Li, J. Development of Microencapsulated Rice Bran to Improve the Quality of Infant Rice Cereal. LWT 2025, 239, 118928. [Google Scholar] [CrossRef]
- Wang, F.X.; Wang, C.G.; Song, S.Y. Rapid and Low-Cost Detection of Millet Quality by Miniature Near-Infrared Spectroscopy and Iteratively Retaining Informative Variables. Foods 2022, 11, 1841. [Google Scholar] [CrossRef]
- Manley, M. Near-infrared spectroscopy and hyperspectral imaging: Non-destructive analysis of biological materials. Chem. Soc. Rev. 2014, 43, 8200–8214. [Google Scholar] [CrossRef]
- Kamboj, U.; Guha, P.; Mishra, S. Comparison of PLSR, MLR, SVM regression methods for determination of crude protein and carbohydrate content in stored wheat using near Infrared spectroscopy. Mater. Today Proc. 2022, 48, 576–582. [Google Scholar] [CrossRef]
- Yu, Y.; Qiao, Y.K.; Fan, C.L.; Dong, M.; Cao, K. Machine learning and near-infrared fusion-driven quantitative characterization and detection of protein content in maize kernels. Front. Nutr. 2025, 12, 1719661. [Google Scholar] [CrossRef]
- Yang, H.E.; Kim, N.W.; Lee, H.G.; Kim, M.J.; Sang, W.G.; Yang, C.; Mo, C. Prediction of protein content in paddy rice (Oryza sativa L.) combining near-infrared spectroscopy and deep-learning algorithm. Front. Plant Sci. 2024, 15, 1398762. [Google Scholar] [CrossRef]
- Yu, S.; Huan, K.W.; Liu, X.X. Application of quantitative non-destructive determination of protein in wheat based on pretreatment combined with parallel convolutional neural network. Infrared Phys. Technol. 2023, 135, 104958. [Google Scholar] [CrossRef]
- Bai, Y.; Zhang, Z.; Qiao, J.W.; Liu, X.L.; Guo, S.Y.; Wang, G.P.; Zhang, T.; Zhang, G.H.; Ren, G.X.; Zhang, L.Z. Establishment of near-infrared rapid prediction model and comprehensive evaluation model for foxtail millet quality. J. Food Compos. Anal. 2024, 136, 106769. [Google Scholar] [CrossRef]
- Ma, Z.Q.; Zhou, Z.J.; Mu, T.M.; Wen, C. Hybrid energy storage systems for photovoltaic storage microgrids power allocation and capacity determination based on adaptive Savitzky-Golay filtering and VMD-DTW. J. Electr. Power Energy Syst. 2025, 170, 110845. [Google Scholar] [CrossRef]
- Fábián, G. Generalized Savitzky–Golay filter for smoothing triangular meshes. Comput. Aided Geom. D 2023, 100, 102167. [Google Scholar] [CrossRef]
- Wang, G.L.; Liu, M.; Xue, H.T.; Guo, E.H.; Zhang, A.Y. Simultaneous determination of the amylose and amylopectin content of foxtail millet flour by hyperspectral imaging. Front. Remote Sens. 2025, 6, 1460523. [Google Scholar] [CrossRef]
- Chi, K.P.; Lin, J.R.; Chen, M.; Chen, J.J.; Chen, Y.M.; Pan, T. Changeable moving window-standard normal variable transformation for visible-NIR spectroscopic analyses. Spectrochim. Acta A 2024, 308, 123726. [Google Scholar] [CrossRef]
- Shahrabadi, S.; Adão, T.; Peres, E.; Morais, R.; Magalhães, L.G.; Alves, V. Automatic Optimization of Deep Learning Training through Feature-Aware-Based Dataset Splitting. Algorithms 2024, 17, 106. [Google Scholar] [CrossRef]
- Zhao, J.G.; Zhu, T.Y.; Qiu, Z.C.; Li, T.; Wang, G.L.; Li, Z.W.; Du, H.L. Hyperspectral prediction of pigment content in tomato leaves based on logistic-optimized sparrow search algorithm and back propagation neural network. J. Agric. Eng. 2023, 54, 1528. [Google Scholar] [CrossRef]
- Liu, X.P.; Guo, H.Y. Air quality indicators and AQI prediction coupling long-short term memory (LSTM) and sparrow search algorithm (SSA): A case study of Shanghai. Atmos. Pollut. Res. 2022, 13, 101551. [Google Scholar] [CrossRef]
- Xue, J.K.; Shen, B. A novel swarm intelligence optimization approach: Sparrow search algorithm. Syst. Sci. Control Eng. 2020, 8, 22–34. [Google Scholar] [CrossRef]
- Iranzad, R.; Liu, X. A review of random forest-based feature selection methods for data science education and applications. Int. J. Data Sci. Anal. 2025, 20, 197–211. [Google Scholar] [CrossRef]
- Mallala, B.; Ahmed, A.I.U.; Pamidi, S.V.; Faruque, M.O.; Reddy, R. Forecasting global sustainable energy from renewable sources using random forest algorithm. Results Eng. 2025, 25, 103789. [Google Scholar] [CrossRef]
- Belgiu, M.; Drăguţ, L. Random forest in remote sensing: A review of applications and future directions. ISPRS J. Photogramm. Remote Sens. 2016, 114, 24–31. [Google Scholar] [CrossRef]
- Hur, S.; Lee, Y.; Park, J.; Jeon, Y.J.; Cho, J.H.; Cho, D.; Lim, D.; Hwang, W.; Cha, W.C.; Yoo, J. Comparison of SHAP and clinician friendly explanations reveals effects on clinical decision behaviour. npj Digit. Med. 2025, 8, 578. [Google Scholar] [CrossRef] [PubMed]
- Kim, S.; Alizamir, M.; Heddam, S.; Chang, S.W.; Chung, I.M.; Kisi, O.; Kulls, C. Development of the machine learning and deep learning models with SHAP strategy for predicting groundwater levels in South Korea. Sci. Rep. 2025, 15, 35523. [Google Scholar] [CrossRef] [PubMed]
- Agheli, A.; Aghabayk, K. How does distraction affect cyclists’ severe crashes? A hybrid CatBoost-SHAP and random parameters binary logit approach. Accid. Anal. Prev. 2025, 211, 107896. [Google Scholar] [CrossRef] [PubMed]
- Vani, G.; Chakraborty, S.K.; Hamad, R. Identification of markers for rapid determination of rice age by NIR hyperspectral imaging. J. Food Compos. Anal. 2025, 148, 108257. [Google Scholar] [CrossRef]
- Chopra, Y.; Xie, X.; Clothier, J.; Ghosh, S.; Yu, H.; Walia, H.; Sattler, S.E. Hyperspectral imaging to characterize the vegetative tissue biochemical changes in response to water deficit conditions in sorghum (Sorghum bicolor). Front. Plant Sci. 2025, 16, 1515998. [Google Scholar] [CrossRef]
- Khadivi, A.; Nikoogoftar-Sedghi, M.; Tunç, Y. Agronomic characteristics, mineral nutrient content, antioxidant capacity, biochemical composition, and fatty acid profile of Iranian pistachio (Pistacia vera L.) cultivars. BMC Plant Biol. 2025, 25, 68. [Google Scholar] [CrossRef] [PubMed]
- Khalid, A.; Hameed, A.; Tahir, M.F. Wheat quality: A review on chemical composition, nutritional attributes, grain anatomy, types, classification, and function of seed storage proteins in bread making quality. Front. Nutr. 2023, 10, 1053196. [Google Scholar] [CrossRef]
- Altangerel, N.; Neuman, B.W.; Hemmer, P.R.; Yakovlev, V.V.; Sokolov, A.V.; Scully, M.O. A Novel Non-Destructive Rapid Tool for Estimating Amino Acid Composition and Secondary Structures of Proteins in Solution. Small Methods 2024, 8, 2301191. [Google Scholar] [CrossRef]
- Sharma, H.; Sandhu, S.; Yousuf, N.; Oberoi, H.K.; Karnatam, K.S.; Bhavyasree, R.; Vikal, Y.; Kumar, V. Analysis of genetic variability for nutritional quality traits among maize inbreds adapted to Punjab: A North-Western province of India. Cereal Chem. 2024, 101, 1283–1293. [Google Scholar] [CrossRef]
- Jeong, S.; Seol, D.; Kim, H.; Lee, Y.; Nam, S.H.; An, J.M.; Chung, H. Cooperative combination of LIBS-based elemental analysis and near-infrared molecular fingerprinting for enhanced discrimination of geographical origin of soybean paste. Food Chem. 2023, 399, 133956. [Google Scholar] [CrossRef]
- Florian-Huaman, J.; Cruz-Tirado, J.P.; Barbin, D.F.; Siche, R. Detection of nutshells in cumin powder using NIR hyperspectral imaging and chemometrics tools. J. Food Compos. Anal. 2022, 108, 104407. [Google Scholar] [CrossRef]
- Kreienborg, N.M.; Yang, Q.; Pollok, C.H.; Bloino, J.; Merten, C. Matrix-isolation and cryosolution-VCD spectra of α-pinene as benchmark for anharmonic vibrational spectra calculations. Phys. Chem. Chem. Phys. 2023, 25, 3343–3353. [Google Scholar] [CrossRef]
- Chen, Z.W.; Li, D.X.; Zhou, H.; Liu, T.; Mu, X.J. A hybrid graphene metamaterial absorber for enhanced modulation and molecular fingerprint retrieval. Nanoscale 2023, 15, 14100–14108. [Google Scholar] [CrossRef] [PubMed]
- Wang, F.; Wang, C.; Song, S. Origin identification of foxtail millet (Setaria italica) by using green spectral imaging coupled with chemometrics. Infrared Phys. Technol. 2022, 123, 104179. [Google Scholar] [CrossRef]
- Wang, Y.; Fu, X.H.; Chen, Y.Y.; Qin, L.; Ning, Y.Q.; Wang, L.J. The Development Progress of Surface Structure Diffraction Gratings: From Manufacturing Technology to Spectroscopic Applications. Appl. Sci. 2022, 12, 6503. [Google Scholar] [CrossRef]
- Lanjewar, M.G.; Morajkar, P.P.; Parab, J.S. Portable system to detect starch adulteration in turmeric using NIR spectroscopy. Food Control 2024, 155, 110095. [Google Scholar] [CrossRef]
- Puttipipatkajorn, A.; Puttipipatkajorn, A. Rapid quality evaluation of Camellia oleifera seed kernel using a developed portable NIR with optimal wavelength selection. IEEE Access 2022, 10, 8317–8327. [Google Scholar] [CrossRef]
- Tonolini, M.; Wawrzynczyk, J.; Nielsen, P.M.; Engelsen, S.B. On-line monitoring of enzymatic degumming of soybean oil using near-infrared spectroscopy. Appl. Spectrosc. 2023, 77, 1333–1343. [Google Scholar] [CrossRef]
- Davila, M.J.; Alcalde, R.; Aparicio, S. Pyrrolidone derivatives in water solution: An experimental and theoretical perspective. Ind. Eng. Chem. Res. 2009, 48, 1036–1050. [Google Scholar] [CrossRef]
- Barth, A.; Zscherp, C. What vibrations tell about proteins. Q. Rev. Biophys. 2002, 35, 369–430. [Google Scholar] [CrossRef]
- Ryu, J.; Choi, J.; Lee, J.; Kim, S.H. Orientation Distribution of Crystalline β-Sheet Domains in Bombyx mori Silk Fiber Studied with Vibrational Sum Frequency Generation Spectroscopy. Biomacromolecules 2024, 25, 7178–7190. [Google Scholar] [CrossRef]
- Yan, Y.; Zhang, X.; Li, D.; Zheng, H.B.; Yao, X.; Zhu, Y.; Cao, W.X.; Cheng, T. Laboratory shortwave infrared reflectance spectroscopy for estimating grain protein content in rice and wheat. Int. J. Remote Sens. 2021, 42, 4467–4492. [Google Scholar] [CrossRef]
- Ye, D.D.; Sun, L.J.; Zou, B.R.; Zhang, Q.; Tan, W.Y.; Che, W.K. Non-destructive prediction of protein content in wheat using NIRS. Spectrochim. Acta A 2018, 189, 463–472. [Google Scholar] [CrossRef] [PubMed]





| Type | Model | Training Set | Prediction Set | ||||
|---|---|---|---|---|---|---|---|
| RC2 | RMSEC (%) | RPDC | RP2 | RMSEP (%) | RPDP | ||
| Fat | PLS | 0.772 | 0.226 | 2.184 | 0.742 | 0.247 | 1.969 |
| RF | 0.806 | 0.210 | 2.270 | 0.797 | 0.218 | 2.219 | |
| SVM | 0.791 | 0.220 | 2.187 | 0.737 | 0.253 | 1.950 | |
| Protein | PLS | 0.734 | 0.247 | 1.939 | 0.695 | 0.268 | 1.811 |
| RF | 0.492 | 0.320 | 1.403 | 0.472 | 0.328 | 1.376 | |
| SVM | 0.593 | 0.296 | 1.567 | 0.538 | 0.314 | 1.471 | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Gao, A.; Guo, E.; Wang, B.; Zhang, D.; Cheng, K.; Wang, X.; Zhang, A.; Wang, G. Development and Interpretability Analysis of Near-Infrared Spectroscopy Models for Fat and Protein Prediction in Foxtail Millet [Setaria italica (L.) Beauv.]. Foods 2026, 15, 649. https://doi.org/10.3390/foods15040649
Gao A, Guo E, Wang B, Zhang D, Cheng K, Wang X, Zhang A, Wang G. Development and Interpretability Analysis of Near-Infrared Spectroscopy Models for Fat and Protein Prediction in Foxtail Millet [Setaria italica (L.) Beauv.]. Foods. 2026; 15(4):649. https://doi.org/10.3390/foods15040649
Chicago/Turabian StyleGao, Anqi, Erhu Guo, Bin Wang, Dongxu Zhang, Kai Cheng, Xiaofu Wang, Aiying Zhang, and Guoliang Wang. 2026. "Development and Interpretability Analysis of Near-Infrared Spectroscopy Models for Fat and Protein Prediction in Foxtail Millet [Setaria italica (L.) Beauv.]" Foods 15, no. 4: 649. https://doi.org/10.3390/foods15040649
APA StyleGao, A., Guo, E., Wang, B., Zhang, D., Cheng, K., Wang, X., Zhang, A., & Wang, G. (2026). Development and Interpretability Analysis of Near-Infrared Spectroscopy Models for Fat and Protein Prediction in Foxtail Millet [Setaria italica (L.) Beauv.]. Foods, 15(4), 649. https://doi.org/10.3390/foods15040649

