Apple Surface Defect Detection Based on Gray Level Co-Occurrence Matrix and Retinex Image Enhancement
Abstract
:1. Introduction
2. Materials and Methods
2.1. Materials and Instruments
2.2. Sample Preparation
2.3. Proposed Method
2.3.1. SSR Image Enhancement Based on Adaptive Bilateral Filtering
2.3.2. Reflected Component Adaptive Gamma Correction
2.3.3. Defect Segmentation Based on Region-Growing Algorithm
2.3.4. Support Vector Machine Classification Based on Texture Features
- (1)
- Angular Second Moment (ASM), which reflects the degree of uniformity of the image grayscale distribution and texture coarseness and fineness, is calculated as follows:
- (2)
- Entropy (ENT), which reflects the randomness of the amount of information contained in the image, is calculated as follows:
- (3)
- Contrast (CON), reflecting the sharpness of the image and the depth of the texture grooves, is calculated as follows:
- (4)
- Inverse Differential Moment (IDM), reflecting the clarity and regularity of the texture, is calculated as follows:
- (5)
- Correlation (COR), reflecting the degree of similarity of spatial gray scale covariance matrix elements in the row or column direction, is calculated as follows:
3. Results
3.1. Experimental Setting
3.2. Experimental Results and Comparisons
3.2.1. SSR Luminance Decomposition Results Based on Adaptive Bilateral Filtering
3.2.2. Reflected Component Adaptive Gamma Correction Results
3.2.3. Defect Segmentation Results of Improved SSR Image Enhancement and Region- Growing Algorithm
3.2.4. Support Vector Machine Classification Results Based on Texture Features
3.2.5. The Results of the Proposed Defect Detection Method
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- National Bureau of Statistics of China. China Statistical Yearbook; China Statistics Press: Beijing, China, 2022; p. 391.
- Dong, J.; Liu, Y.; Chen, F.; Wang, T.; Deng, S.; Pen, Y. Surface Defect Detection of Korla Pear Based on Multi-spectral Image. J. Agric. Mech. Res. 2021, 43, 35–40. [Google Scholar] [CrossRef]
- Azgomi, H.; Haredasht, F.R.; Safari Motlagh, M.R. Diagnosis of Some Apple Fruit Diseases by Using Image Processing and Artificial Neural Network. Food Control. 2023, 145, 109484. [Google Scholar] [CrossRef]
- Lu, Y.; Lu, R. Detection of Surface and Subsurface Defects of Apples Using Structured-Illumination Reflectance Imaging with Machine Learning Algorithms. Trans. ASABE 2018, 61, 1831–1842. [Google Scholar] [CrossRef]
- Zhang, W.; Zhou, G.; Chen, A.; Hu, Y. Deep Multi-Scale Dual-Channel Convolutional Neural Network for Internet of Things Apple Disease Detection. Comput. Electron. Agric. 2022, 194, 106749. [Google Scholar] [CrossRef]
- Kahraman, Y.; Durmuşoğlu, A. Deep Learning-Based Fabric Defect Detection: A Review. Text. Res. J. 2023, 93, 1485–1503. [Google Scholar] [CrossRef]
- Zhang, M.; Jiang, Y.; Li, C.; Yang, F. Fully Convolutional Networks for Blueberry Bruising and Calyx Segmentation Using Hyperspectral Transmittance Imaging. Biosyst. Eng. 2020, 192, 159–175. [Google Scholar] [CrossRef]
- Ismail, N.; Malik, O.A. Real-Time Visual Inspection System for Grading Fruits Using Computer Vision and Deep Learning Techniques. Inform. Process. Agric. 2022, 9, 24–37. [Google Scholar] [CrossRef]
- Xie, W.; Wei, S.; Zheng, Z.; Yang, D. A CNN-Based Lightweight Ensemble Model for Detecting Defective Carrots. Biosyst. Eng. 2021, 208, 287–299. [Google Scholar] [CrossRef]
- Hu, W.; Xiong, J.; Liang, J.; Xie, Z.; Liu, Z.; Huang, Q.; Yang, Z. A Method of Citrus Epidermis Defects Detection Based on an Improved YOLOv5. Biosyst. Eng. 2023, 227, 19–35. [Google Scholar] [CrossRef]
- Tian, X.; Zhang, C.; Li, J.; Fan, S.; Yang, Y.; Huang, W. Detection of Early Decay on Citrus Using LW-NIR Hyperspectral Reflectance Imaging Coupled with Two-Band Ratio and Improved Watershed Segmentation Algorithm. Food Chem. 2021, 360, 130077. [Google Scholar] [CrossRef]
- Yang, Y.; Liu, Z.; Huang, M.; Zhu, Q.; Zhao, X. Automatic Detection of Multi-Type Defects on Potatoes Using Multispectral Imaging Combined with a Deep Learning Model. J. Food Eng. 2023, 336, 0260–8774. [Google Scholar] [CrossRef]
- Alberto, L.R.; Ardila, C.E.C.; Ortiz, F.A.P. A Computer Vision System for Early Detection of Anthracnose in Sugar Mango (Mangifera Indica) Based on UV-A Illumination. Inform. Process. Agric. 2022, 10, 204–215. [Google Scholar] [CrossRef]
- Ge, L.; Zou, K.; Zhou, H.; Yu, X.; Tan, Y.; Zhang, C.; Li, W. Three Dimensional Apple Tree Organs Classification and Yield Estimation Algorithm Based on Multi-Features Fusion and Support Vector Machine. Inform. Process. Agric. 2022, 9, 431–442. [Google Scholar] [CrossRef]
- Caceres-Hernandez, D.; Gutierrez, R.; Kung, K.; Rodriguez, J.; Lao, O.; Contreras, K.; Jo, K.-H.; Sanchez-Galan, J.E. Recent Advances in Automatic Feature Detection and Classification of Fruits Including with a Special Emphasis on Watermelon (Citrillus lanatus): A Review. Neurocomputing 2023, 526, 62–79. [Google Scholar] [CrossRef]
- Bird, J.J.; Barnes, C.M.; Manso, L.J.; Ekárt, A.; Faria, D.R. Fruit Quality and Defect Image Classification with Conditional GAN Data Augmentation. Sci. Hortic. 2022, 293, 110684. [Google Scholar] [CrossRef]
- Moch, L.; Hasan, S.R.; Mochammad, H. Feature Extraction and Naïve Bayes Algorithm for Defect Classification of Manalagi Apples. J. Phys. Conf. Ser. 2022, 2394, 012014. [Google Scholar] [CrossRef]
- Wang, Z.; Jin, L.; Wang, S.; Xu, H. Apple Stem/Calyx Real-Time Recognition Using YOLO-v5 Algorithm for Fruit Automatic Loading System. Postharvest. Biol. Technol. 2022, 185, 111808. [Google Scholar] [CrossRef]
- Zhang, B.; Huang, W.; Wang, C.; Gong, L.; Zhao, C.; Liu, C.; Huang, D. Computer Vision Recognition of Stem and Calyx in Apples Using Near-Infrared Linear-Array Structured Light and 3D Reconstruction. Biosyst. Eng. 2015, 139, 25–34. [Google Scholar] [CrossRef]
- Zhang, D.; Lillywhite, K.D.; Lee, D.-J.; Tippetts, B.J. Automated Apple Stem End and Calyx Detection Using Evolution-Constructed Features. J. Food Eng. 2013, 119, 411–418. [Google Scholar] [CrossRef]
- Yuan, Y.; Yang, Z.; Liu, H.; Wang, H.; Li, J.; Zhao, L. Detection of Early Bruise in Apple Using Near-Infrared Camera Imaging Technology Combined with Deep Learning. Infr. Phys. Technol. 2022, 127, 104442. [Google Scholar] [CrossRef]
- Lin, P.; Yang, H.; Cheng, S.; Guo, F.; Wang, L.; Lin, Y. An Improved YOLOv5s Method Based Bruises Detection on Apples Using Cold Excitation Thermal Images. Postharvest Biol. Technol. 2023, 199, 112280. [Google Scholar] [CrossRef]
- Li, J.; Lu, Y.; Lu, R. Detection of Early Decay in Navel Oranges by Structured-Illumination Reflectance Imaging Combined with Image Enhancement and Segmentation. Postharvest Biol. Technol. 2023, 196, 112162. [Google Scholar] [CrossRef]
- Matsui, T.; Kamata, T.; Koseki, S.; Koyama, K. Development of Automatic Detection Model for Stem-End Rots of ‘Hass’ Avocado Fruit Using X-Ray Imaging and Image Processing. Postharvest Biol. Technol. 2022, 192, 111996. [Google Scholar] [CrossRef]
- Zhou, X.; Ampatzidis, Y.; Lee, W.S.; Zhou, C.; Agehara, S.; Schueller, J.K. Deep Learning-Based Postharvest Strawberry Bruise Detection under UV and Incandescent Light. Comput. Electron. Agric. 2022, 202, 107389. [Google Scholar] [CrossRef]
- Zheng, Z.; Hu, Y.; Yang, H.; Qiao, Y.; He, Y.; Zhang, Y.; Huang, Y. AFFU-Net: Attention Feature Fusion U-Net with Hybrid Loss for Winter Jujube Crack Detection. Comput. Electron. Agric. 2022, 198, 107049. [Google Scholar] [CrossRef]
- Tian, S.; Wang, S.; Xu, H. Early Detection of Freezing Damage in Oranges by Online Vis/NIR Transmission Coupled with Diameter Correction Method and Deep 1D-CNN. Comput. Electron. Agric. 2022, 193, 106638. [Google Scholar] [CrossRef]
- Min, D.; Zhao, J.; Bodner, G.; Ali, M.; Li, F.; Zhang, X.; Rewald, B. Early Decay Detection in Fruit by Hyperspectral Imaging–Principles and Application Potential. Food Control. 2023, 152, 109830. [Google Scholar] [CrossRef]
- Mahanti, N.K.; Pandiselvam, R.; Kothakota, A.; Chakraborty, S.K.; Kumar, M.; Cozzolino, D. Emerging Non-Destructive Imaging Techniques for Fruit Damage Detection: Trends. Fod. Sci. Technol. 2022, 120, 418–438. [Google Scholar] [CrossRef]
- Land, E.H. The Retinex. Am. Sci. 1964, 52, 247–253, 255–264. [Google Scholar]
- Land, E.H.; McCann, J.J. Lightness and Retinex Theory. J. Opt. Soc. Am. 1971, 61, 1. [Google Scholar] [CrossRef]
- Rahman, Z.; Jobson, D.J.; Woodell, G.A. Multi-Scale Retinex for Color Image Enhancement. In Proceedings of the 3rd IEEE International Conference on Image Processing, Lausanne, Switzerland, 19 September 1996; Volume 3, pp. 1003–1006. [Google Scholar]
- Zhao, X.; Wang, R. Improved Multi·scale Retinex Algorithm and Its Application. Comput. Eng. 2011, 37, 209–211. [Google Scholar]
- Xu, X.; Chen, Q.; Wang, P.; Sun, H.; Xia, D. A Fast Halo—Free Image Enhancement Method Based on Retinex. J. Comput-Aided. Des. Comput. 2008, 10, 1325–1331. [Google Scholar]
- Cai, M.; Wan, L. Infrared Image Enhancement Algorithm Based on Adaptive Gamma Correction. Opt. Tec. 2022, 48, 486–491. [Google Scholar] [CrossRef]
- Gonzalez, R.C.; Woods, R.E. Digital Image Processing, 4th ed.; Publishing House of Electronics Industry: Beijing, China, 2020; pp. 551–553. [Google Scholar]
- Huang, C.; Liu, Q.; Li, X. Color Image Segmentation by Seeded Region Growing and Region Merging. In Proceedings of the 2010 Seventh International Conference on Fuzzy Systems and Knowledge Discovery, Yantai, China, 10–12 August 2010; pp. 533–536. [Google Scholar]
- Yuan, L.; Fu, L.; Yang, Y.; Miao, J. Analysis of Texture Feature Extracted by Gray Level CO-occurrence Matrix. J. Comput. Appl. 2009, 29, 1018–1021. [Google Scholar] [CrossRef]
- Liu, L.; Kuang, G. Overview of Image Textural Feature Extraction Methods. J. Image Graph. 2009, 14, 622–635. [Google Scholar]
- Song, Y.; Ju, Z. Fuzzy Support Vector Machine Based on Dynamic Class-center Model Selection. J. Dalian Univ. Technol. 2023, 63, 309–314. [Google Scholar] [CrossRef]
- Bai, Y.; Sun, Y.; Song, X.; Xu, H. Extraction of Flow Resistance Characteristic Parameters and SVM Assisted Riverbed Morphology Identification. J. Hydroelectr. Eng. 2023, 42, 1–9. [Google Scholar]
- Yang, Y.; Zhang, W.; Yu, H.; Chai, W.; Liu, D. Analysis on The Relationships between Ultrasonic Parameters and The Stress State in Loaded Concrete Based on Improved Support Vector Machines. J. Vib. Shock 2023, 42, 175–181+224. [Google Scholar] [CrossRef]
Image Processing Stage | Number of Stem/ Calyx Textures | Number of Scar Textures | Total | Accuracy (%) |
---|---|---|---|---|
R-component | 200 | 230 | 430 | 84.4 |
SSR | 200 | 230 | 430 | 93.0 |
Gamma | 200 | 230 | 430 | 93.7 |
Defect Type | Sample Size | Number of Correct Disease Condition Judgments | Accuracy (%) |
---|---|---|---|
Normal-stem | 70 | 67 | 95.7 |
Normal-calyx | 70 | 65 | 92.8 |
Scar-light browning | 70 | 64 | 91.4 |
Scar-heavy browning | 70 | 68 | 97.1 |
Total | 280 | 264 | 94.2 |
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
Yang, L.; Mu, D.; Xu, Z.; Huang, K. Apple Surface Defect Detection Based on Gray Level Co-Occurrence Matrix and Retinex Image Enhancement. Appl. Sci. 2023, 13, 12481. https://doi.org/10.3390/app132212481
Yang L, Mu D, Xu Z, Huang K. Apple Surface Defect Detection Based on Gray Level Co-Occurrence Matrix and Retinex Image Enhancement. Applied Sciences. 2023; 13(22):12481. https://doi.org/10.3390/app132212481
Chicago/Turabian StyleYang, Lei, Dexu Mu, Zhen Xu, and Kaiyu Huang. 2023. "Apple Surface Defect Detection Based on Gray Level Co-Occurrence Matrix and Retinex Image Enhancement" Applied Sciences 13, no. 22: 12481. https://doi.org/10.3390/app132212481
APA StyleYang, L., Mu, D., Xu, Z., & Huang, K. (2023). Apple Surface Defect Detection Based on Gray Level Co-Occurrence Matrix and Retinex Image Enhancement. Applied Sciences, 13(22), 12481. https://doi.org/10.3390/app132212481