Study on the Identification and Detection of Walnut Quality Based on Terahertz Imaging
Abstract
:1. Introduction
2. Materials and Methods
2.1. Sample Preparation
2.2. THz-TDS Spectroscopy System
2.3. THz Spectroscopy Detection System for Walnut Samples
2.4. Terahertz Spectrum and Image Processing
2.5. Algorithm Principle of Qualitative Discrimination Model
2.6. Image Binarization Processing
2.7. Model Evaluation Method
3. Results and Discussion
3.1. THz Spectral Feature Analysis
3.2. Establishment of SVM Qualitative Determination Model for Terahertz Spectrum in Different Regions of Interest of Walnuts
3.3. Establishment of Random Forest Qualitative Discriminant Model for Terahertz Spectra of Walnut Samples
3.4. Establishment of the KNN Qualitative Discriminant Model for Terahertz Spectra of the Walnut Samples
3.5. Visual Expression of the Fullness of the Walnut Samples
3.5.1. Fullness Detection of Terahertz Transmission Image
3.5.2. Fullness of Physical Images
3.5.3. Fullness Comparison between Physical Image and Transmission Image
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Geng, S.; Ning, D.; Ma, T.; Chen, H.; Zhang, Y.; Sun, X. Comprehensive analysis of the components of walnut kernel (Juglans regia L.) in China. J. Food Qual. 2021, 2021, 9302181. [Google Scholar] [CrossRef]
- Wei, L.; Fu, H.; Lin, M.; Dang, H.; Zhao, Y.; Xu, Y.; Zhang, B. Identification of dominant fungal contamination of walnut in Northwestern China and effects of storage conditions on walnut kernels. Sci. Hortic. 2020, 264, 109141. [Google Scholar] [CrossRef]
- Chuang, C.L.; Ouyang, C.S.; Lin, T.T.; Yang, M.M.; Yang, E.C.; Huang, T.W.; Kuei, C.F.; Luke, A.; Jiang, J.A. Automatic X-ray quarantine scanner and pest infestation detector for agricultural products. Comput. Electron. Agric. 2011, 77, 41–59. [Google Scholar] [CrossRef]
- Long, Y.; Huang, W.; Wang, Q.; Fan, S.; Tian, X. Integration of textural and spectral features of Raman hyperspectral imaging for quantitative determination of a single maize kernel mildew coupled with chemometrics. Food Chem. 2022, 372, 131246. [Google Scholar] [CrossRef] [PubMed]
- Jiang, H.; Jiang, X.; Ru, Y.; Chen, Q.; Li, X.; Xu, L.; Zhou, H.; Shi, M. Rapid and non-destructive detection of natural mildew degree of postharvest Camellia oleifera fruit based on hyperspectral imaging. Infrared Phys. Technol. 2022, 123, 104169. [Google Scholar] [CrossRef]
- Einarsdóttir, H.; Emerson, M.J.; Clemmensen, L.H.; Scherer, K.; Willer, K.; Bech, M.; Larsen, R.; Ersbøll, B.K.; Pfeiffer, F. Novelty detection of foreign objects in food using multi-modal X-ray imaging. Food Control 2016, 67, 39–47. [Google Scholar] [CrossRef] [Green Version]
- Jiang, Y.Y.; Ge, H.Y.; Zhang, Y. Detection of foreign bodies in grain with terahertz reflection imaging. Optik 2019, 181, 1130–1138. [Google Scholar] [CrossRef]
- Wang, C.; Zhou, R.; Huang, Y.; Xie, L.; Ying, Y. Terahertz spectroscopic imaging with discriminant analysis for detecting foreign materials among sausages. Food Control 2019, 97, 100–104. [Google Scholar] [CrossRef]
- Sun, X.D.; Liu, J.B. Measurement of plumpness for intact sunflower seed using terahertz transmittance imaging. J. Infrared Millim. Terahertz Waves 2020, 41, 307–321. [Google Scholar] [CrossRef]
- Qi, S.Y.; Zhang, Z.W.; Zhao, K.; Han, D.H. Evaluation of walnut by terahertz nondestructive technology. Spectrosc. Spectr. Anal. 2012, 32, 3390–3393. [Google Scholar]
- Rong, D.; Xie, L.J.; Ying, Y.B. Computer vision detection of foreign objects in walnuts using deep learning. Comput. Electron. Agric. 2019, 162, 1001–1010. [Google Scholar] [CrossRef]
- Wang, Q.; Hameed, S.; Xie, L.; Ying, Y. Non-destructive quality control detection of endogenous contaminations in walnuts using terahertz spectroscopic imaging. J. Food Meas. Charact. 2020, 14, 2453–2460. [Google Scholar] [CrossRef]
- Dorney, T.D.; Baraniuk, R.G.; Mittleman, D.M. Material parameter estimation with terahertz time-domain spectroscopy. JOSA A 2001, 18, 1562–1571. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Duvillaret, L.; Garet, F.; Coutaz, J.L. Highly precise determination of optical constants and sample thickness in terahertz time-domain spectroscopy. Appl. Opt. 1999, 38, 409–415. [Google Scholar] [CrossRef] [PubMed]
- Fan, S.; Li, J.; Zhang, Y.; Tian, X.; Wang, Q.; He, X.; Zhang, C.; Huang, W. On line detection of defective apples using computer vision system combined with deep learning methods. J. Food Eng. 2020, 286, 110102. [Google Scholar] [CrossRef]
- Poona, N.K.; Van Niekerk, A.; Nadel, R.L.; Ismail, R. Random forest (RF) wrappers for waveband selection and classification of hyperspectral data. Appl. Spectrosc. 2016, 70, 322–333. [Google Scholar] [CrossRef] [PubMed]
- Bo, C.; Lu, H.; Wang, D. Spectral-spatial K-Nearest Neighbor approach for hyperspectral image classification. Multimed. Tools Appl. 2018, 77, 10419–10436. [Google Scholar] [CrossRef]
- Kim, M.; Yeo, Y.; Shin, H. Binarization for eliminating calibration in fiberscope image processing. Opt. Commun. 2021, 497, 127198. [Google Scholar] [CrossRef]
Samples | Cal | Val | Category | Prediction | Correct | Accuracy |
---|---|---|---|---|---|---|
2445 | 1834 | 611 | Walnut Kernel | 150 | 127 | 84.67% |
Walnut Shell | 150 | 150 | 100% | |||
Mildew Sample | 156 | 123 | 78.84% | |||
Reference Group | 155 | 155 | 100% | |||
2445 | 1834 | 611 | Total | 611 | 555 | 90.83% |
Samples | Cal | Val | Category | Prediction | Correct | Accuracy |
---|---|---|---|---|---|---|
2445 | 1834 | 611 | Walnut Kernel | 150 | 139 | 92.67% |
Walnut Shell | 150 | 150 | 100% | |||
Mildew Sample | 156 | 151 | 96.79% | |||
Reference Group | 155 | 155 | 100% | |||
2445 | 1834 | 611 | Total | 611 | 595 | 97.38% |
Samples | Cal | Val | Category | Prediction | Correct | Accuracy |
---|---|---|---|---|---|---|
2445 | 1834 | 611 | Walnut Kernel | 150 | 141 | 94% |
Walnut Shell | 150 | 150 | 100% | |||
Mildew Samples | 156 | 152 | 97.44% | |||
Reference Group | 155 | 155 | 100% | |||
2445 | 1834 | 611 | Total | 611 | 598 | 97.87% |
Category | Walnuts (a) | Walnuts (b) | Walnuts (c) | Walnuts (d) | Walnuts (e) |
---|---|---|---|---|---|
Kernel Total Pixels | 191,229 | 197,756 | 214,005 | 206,360 | 210,020 |
Shell Total Pixels | 4401 | 29,147 | 67,321 | 107,558 | 171,068 |
Fullness | 2.301% | 14.739% | 31.458% | 52.122% | 81.453% |
Category | Walnuts (a) | Walnuts (b) | Walnuts (c) | Walnuts (d) | Walnuts (e) |
---|---|---|---|---|---|
Kernel Total Pixels | 125,054 | 126,708 | 103,295 | 130,339 | 113,698 |
Shell Total Pixels | 0 | 24,010 | 35,633 | 67,103 | 91,216 |
Fullness | 0% | 18.949% | 34.496% | 51.483% | 80.227% |
Category | Walnuts (a) | Walnuts (b) | Walnuts (c) | Walnuts (d) | Walnuts (e) |
---|---|---|---|---|---|
THz Image Fullness | 2.301% | 14.739% | 31.458% | 52.122% | 81.453% |
Kernel Fullness | 0% | 18.949% | 34.496% | 51.483% | 80.227% |
Error | 2.301% | 4.210% | 3.038% | 0.639% | 1.226% |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hu, J.; Shi, H.; Zhan, C.; Qiao, P.; He, Y.; Liu, Y. Study on the Identification and Detection of Walnut Quality Based on Terahertz Imaging. Foods 2022, 11, 3498. https://doi.org/10.3390/foods11213498
Hu J, Shi H, Zhan C, Qiao P, He Y, Liu Y. Study on the Identification and Detection of Walnut Quality Based on Terahertz Imaging. Foods. 2022; 11(21):3498. https://doi.org/10.3390/foods11213498
Chicago/Turabian StyleHu, Jun, Hongyang Shi, Chaohui Zhan, Peng Qiao, Yong He, and Yande Liu. 2022. "Study on the Identification and Detection of Walnut Quality Based on Terahertz Imaging" Foods 11, no. 21: 3498. https://doi.org/10.3390/foods11213498
APA StyleHu, J., Shi, H., Zhan, C., Qiao, P., He, Y., & Liu, Y. (2022). Study on the Identification and Detection of Walnut Quality Based on Terahertz Imaging. Foods, 11(21), 3498. https://doi.org/10.3390/foods11213498