Detection of Defective Features in Cerasus Humilis Fruit Based on Hyperspectral Imaging Technology
Abstract
:1. Introduction
2. Materials and Methods
2.1. Experimental Sample
2.2. Hyperspectral Imaging System and Image Acquisition
2.3. Hyperspectral Image Correction Method
2.4. Spectral Data Extraction
2.5. Spectral Preprocessing
2.6. Variable Selection Methods and Classification Models
2.6.1. Selection Methods of Characteristic Wavelengths
2.6.2. Classification Models
2.7. Image Analysis Methods
3. Results and Discussion
3.1. Spectral Characteristics Analyses
3.2. Spectral Pretreatment
3.3. Effective Wavelength Selection
3.3.1. Regression Coefficient Method
3.3.2. Successive Projections Algorithm
3.3.3. Competitive Adaptive Reweighted Sampling
3.3.4. LS-SVM Discriminant Model
3.4. Image Information Detection
3.4.1. Principal Component Analysis
3.4.2. Defective Features Identification Algorithm
3.4.3. Verification of The Defect Feature Identification Algorithm
3.4.4. Discussion
4. Conclusions
- (1)
- The de-trending (De-T) spectral pretreatment method can better optimize spectral data, and the PLS model of spectral data after pretreatment has a relatively high accuracy, with the correlation coefficient of prediction (Rp) of 0.8571 and root mean square error of prediction (RMSEP) of 0.2964. Regression coefficient (RC), successive projections algorithm (SPA), and competitive adaptive reweighted sampling (CARS) algorithms were used to extract the characteristic wavebands of spectral data after baseline pretreatment, and the least squares-support vector machine (LS-SVM) model was established. It is concluded that the CARS-LS-SVM model was the best at detecting the defective (rust spot, insect damage, crack) and normal Cerasus humilis fruit samples, with an accuracy rate of 93.2%. As can be seen from the detection results of spectral technology, it was impossible to detect all three defect types proposed in the paper using a single spectral technology. Therefore, the analysis and detection of the three defect types were also considered from the perspective of image processing technology.
- (2)
- On the other hand, images corresponding to eight sensitive bands (950, 994, 1071, 1263, 1336, 1457, 1542, and 1628 nm) selected by CARS were subjected to principal component analysis (PCA). Then, using the “Imfill” function, “Canny” operator, “Regiongrow” algorithm, “Bwareaopen” function and the images of PCA, the edge and defect feature of 105 Cerasus humilis fruits could be recognized. The result of image discrimination shows that the detection precision of the algorithm was 88.57%. It can be seen from the research results that the image processing techniques could not identify all the defect samples.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Wang, B.; He, J.L.; Li, L.L. On-line detection of cerasus humilis fruit based on VIS/NIR spectroscopy combined with variable selection methods and GA-BP model. INMATEH-Agric. Eng. 2021, 63, 199–210. [Google Scholar] [CrossRef]
- Tian, Y.; Sun, J.; Zhou, X.; Wu, X.H.; Lu, B.; Dai, C.X. Research on apple origin classification based on variable iterative space shrinkage approach with stepwise regression–support vector machine algorithm and visible-near infrared hyperspectral imaging. J. Food Process Eng. 2020, 43, e13432. [Google Scholar] [CrossRef]
- Li, X.; Liu, Y.D.; Jiang, X.G.; Wang, G.T. Supervised classification of slightly bruised peaches with respect to the time after bruising by using hyperspectral imaging technology. Infrared Phys. Technol. 2021, 113, 103557. [Google Scholar] [CrossRef]
- Ji, Y.; Sun, L.; Li, Y.; Li, J.; Liu, S.; Xie, X.; Xu, Y. Non-destructive classification of defective potatoes based on hyperspectral imaging and support vector machine. Infrared Phys. Technol. 2019, 99, 71–79. [Google Scholar] [CrossRef]
- Zhang, M.; Zhang, B.; Li, H.; Shen, M.; Tian, S.; Zhang, H.; Zhao, J. Determination of bagged ‘Fuji’apple maturity by visible and near-infrared spectroscopy combined with a machine learning algorithm. Infrared Phys. Technol. 2020, 111, 103529. [Google Scholar] [CrossRef]
- Cui, J.; Yang, M.; Son, D.; Cho, S.I.; Kim, G. Hyperspectral imaging for tomato bruising damage assessment of simulated harvesting process impact using wavelength interval selection and multivariate analysis. Appl. Eng. Agric. 2020, 36, 533–547. [Google Scholar] [CrossRef]
- Huang, F.H.; Liu, Y.H.; Sun, X.; Yang, H. Quality inspection of nectarine based on hyperspectral imaging technology. Syst. Sci. Control Eng. 2021, 9, 350–357. [Google Scholar] [CrossRef]
- Lü, Q.; Tang, M. Detection of hidden bruise on kiwi fruit using hyperspectral imaging and parallelepiped classification. Procedia Environ. Sci. 2012, 12, 1172–1179. [Google Scholar] [CrossRef] [Green Version]
- Wu, L.; He, J.; Liu, G.; He, X. Detection of common defects on jujube using Vis-NIR and NIR hyperspectral imaging. Postharvest Biol. Technol. 2016, 112, 134–142. [Google Scholar] [CrossRef]
- Yuan, R.; Liu, G.S.; He, J.G.; Kang, N.B.; Ma, L.M. Quantitative Damage Identification of Lingwu Long Jujube Based on Visible Near-Infrared Hyperspectral Imaging. Spectrosc. Spectr. Anal. 2021, 41, 1182–1187. [Google Scholar] [CrossRef]
- Galvao, R.K.H.; Araujo, M.C.U.; José, G.E.; Pontes, M.J.C.; Saldanha, T.C.B. A method for calibration and validation subset partitioning. Talanta 2005, 67, 736–740. [Google Scholar] [CrossRef]
- Wang, B.; He, J.; Zhang, S.; Li, L. Nondestructive prediction and visualization of total flavonoids content in Cerasus Humilis fruit during storage periods based on hyperspectral imaging technique. J. Food Process Eng. 2021, 44, e13807. [Google Scholar] [CrossRef]
- Zhao, X.; Zhang, J.; Huang, Y.; Tian, Y.; Yuan, L. Detection and discrimination of disease and insect stress of tea plants using hyperspectral imaging combined with wavelet analysis. Comput. Electron. Agric. 2022, 193, 106717. [Google Scholar] [CrossRef]
- Sioma, A.; Socha, J.; Klamerus-Iwan, A. A new method for characterizing bark microrelief using 3D vision systems. Forests 2018, 9, 30. [Google Scholar] [CrossRef] [Green Version]
- Zhang, B.; Dai, D.; Huang, J.; Zhou, J.; Gui, Q.; Dai, F. Influence of physical and biological variability and solution methods in fruit and vegetable quality nondestructive inspection by using imaging and near-infrared spectroscopy techniques: A review. Crit. Rev. Food Sci. Nutr. 2018, 58, 2099–2118. [Google Scholar] [CrossRef]
- Sun, H.; Zhang, S.; Ren, R.; Xue, J.; Zhao, H. Detection of Soluble Solids Content in Different Cultivated Fresh Jujubes Based on Variable Optimization and Model Update. Foods 2022, 11, 2522. [Google Scholar] [CrossRef]
- Sen, P.K. Estimates of the regression coefficient based on Kendall’s tau. J. Am. Stat. Assoc. 1968, 63, 1379–1389. [Google Scholar] [CrossRef]
- Tang, G.; Huang, Y.; Tian, K.; Song, X.; Yan, H.; Min, S. A new spectral variable selection pattern using competitive adaptive reweighted sampling combined with successive projections algorithm. Analyst 2014, 139, 4894–4902. [Google Scholar] [CrossRef]
- Li, H.; Liang, Y.; Xu, Q.; Cao, D. Key wavelengths screening using competitive adaptive reweighted sampling method for multivariate calibration. Anal. Chim. Acta 2009, 648, 77–84. [Google Scholar] [CrossRef]
- Wang, Z.; Li, J.; Zhang, C.; Fan, S. Development of a General Prediction Model of Moisture Content in Maize Seeds Based on LW-NIR Hyperspectral Imaging. Agriculture 2023, 2, 359. [Google Scholar] [CrossRef]
- Liu, Y.; Sun, X.; Zhang, H. Nondestructive measurement of internal quality of Nanfeng mandarin fruit by charge coupled device near infrared spectroscopy. Comput. Electron. Agric. 2010, 71, S10–S14. [Google Scholar] [CrossRef]
- Shinzawa, H.; Ritthiruangdej, P.; Ozaki, Y. Kernel analysis of partial least squares (PLS) regression models. Appl. Spectrosc. 2011, 65, 549–556. [Google Scholar] [CrossRef] [PubMed]
- Osborne, B.G. Near-infrared spectroscopy in food analysis. Encycl. Anal. Chem. 2006, 15, 1–14. [Google Scholar] [CrossRef]
- Li, J.; Rao, X.; Ying, Y. Development of algorithms for detecting citrus canker based on hyperspectral reflectance imaging. J. Sci. Food Agric. 2012, 92, 125–134. [Google Scholar] [CrossRef] [PubMed]
- Lin, H.; Zhao, J.; Sun, L.; Chen, Q.; Zhou, F. Freshness measurement of eggs using near infrared (NIR) spectroscopy and multivariate data analysis. Innov. Food Sci. Emerg. Technol. 2011, 12, 182–186. [Google Scholar] [CrossRef]
- Gonzalez, R.C.; Woods, R.E.; Eddins, S.L. Digital Image Processing Using MATLAB, 2nd ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2009; pp. 107–118. [Google Scholar]
- Yu, K.Q.; Zhao, Y.R.; Liu, Z.Y.; Li, X.L.; Liu, F.; He, Y. Application of visible and near-infrared hyperspectral imaging for detection of defective features in loquat. Food Bioprocess Technol. 2014, 7, 3077–3087. [Google Scholar] [CrossRef]
- Munera, S.; Gómez-Sanchís, J.; Aleixos, N.; Vila-Francés, J.; Colelli, G.; Cubero, S.; Blasco, J. Discrimination of common defects in loquat fruit cv.‘Algerie’using hyperspectral imaging and machine learning techniques. Postharvest Biol. Technol. 2021, 171, 111356. [Google Scholar] [CrossRef]
- Wang, H.; Hu, R.; Zhang, M.; Zhai, Z.; Zhang, R. Identification of tomatoes with early decay using visible and near infrared hyperspectral imaging and image-spectrum merging technique. J. Food Process Eng. 2021, 44, e13654. [Google Scholar] [CrossRef]
Defect Types | No. of Samples | Calibration Set | Prediction Set |
---|---|---|---|
Rust spot | 92 | 69 | 23 |
Crack | 84 | 63 | 21 |
Insect damage | 84 | 63 | 21 |
Intact | 160 | 120 | 40 |
Total | 420 | 315 | 105 |
Pretreatment Methods | Lvs | Calibration Set | Prediction Set | ||
---|---|---|---|---|---|
Rc | RMSEC | Rp | RMSEP | ||
Original spectra | 12 | 0.7857 | 0.2638 | 0.8496 | 0.3073 |
S-G | 10 | 0.7681 | 0.2731 | 0.8343 | 0.3247 |
SNV | 9 | 0.6902 | 0.3086 | 0.8069 | 0.3986 |
MSC | 9 | 0.6863 | 0.3101 | 0.8045 | 0.4011 |
BC | 9 | 0.7209 | 0.2955 | 0.8065 | 0.3692 |
De-T | 9 | 0.8047 | 0.2545 | 0.8571 | 0.2964 |
Modeling Methods | Variable Selection Methods (No.) | Calibration Set | Prediction Set | |||
---|---|---|---|---|---|---|
Number of Misjudgments | Classification Accuracy (%) | Number of Misjudgments | Classification Accuracy (%) | |||
LS-SVM | RC (11) | (2.47 × 103, 1.19 × 103) | 54 | 82.86 | 16 | 84.76 |
SPA (17) | (4.64 × 103, 1.98×103) | 45 | 85.71 | 11 | 89.52 | |
CARS (13) | (5.82 × 103, 2.04 × 103) | 43 | 86.35 | 9 | 91.43 |
PCs | Characteristic Value | Contribution Rate (%) |
---|---|---|
1 | 36,533.0293 | 82.59 |
2 | 9624.0304 | 98.23 |
3 | 1429.6619 | 99.67 |
4 | 820.7365 | 99.89 |
5 | 213.8658 | 99.93 |
6 | 87.8165 | 99.96 |
7 | 11.3969 | 99.99 |
8 | 2.3585 | 100.00 |
Class | Defect Types | Sample Number | Detected (Undetected) | Accuracy (%) |
---|---|---|---|---|
Defective (n = 65) | Rust Spot | 23 | 19 (4) | 82.61 |
Crack | 21 | 17 (4) | 80.95 | |
Insect Damage | 21 | 19 (2) | 90.48 | |
Normal (n = 40) | Intact | 40 | 38 (2) | 95.00 |
Total | 4 | 105 | 93 (12) | 88.57 |
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. |
© 2023 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
Wang, B.; Yang, H.; Zhang, S.; Li, L. Detection of Defective Features in Cerasus Humilis Fruit Based on Hyperspectral Imaging Technology. Appl. Sci. 2023, 13, 3279. https://doi.org/10.3390/app13053279
Wang B, Yang H, Zhang S, Li L. Detection of Defective Features in Cerasus Humilis Fruit Based on Hyperspectral Imaging Technology. Applied Sciences. 2023; 13(5):3279. https://doi.org/10.3390/app13053279
Chicago/Turabian StyleWang, Bin, Hua Yang, Shujuan Zhang, and Lili Li. 2023. "Detection of Defective Features in Cerasus Humilis Fruit Based on Hyperspectral Imaging Technology" Applied Sciences 13, no. 5: 3279. https://doi.org/10.3390/app13053279
APA StyleWang, B., Yang, H., Zhang, S., & Li, L. (2023). Detection of Defective Features in Cerasus Humilis Fruit Based on Hyperspectral Imaging Technology. Applied Sciences, 13(5), 3279. https://doi.org/10.3390/app13053279