Improved Coffee Beans Detection Using Contrast Limited Adaptive Histogram Equalization and Unsharp Masking


Srivan Palelleng(1*); Nugra Tasik Allo(2); Juprianus Rusman(3);

(1) Universitas Kristen Indonesia Toraja
(2) Universitas Kristen Indonesia Toraja
(3) Universitas Kristen Indonesia Toraja
(*) Corresponding Author

  

Abstract


Contrast Limited Adaptive Histogram Equalization (CLAHE) is widely used to enhance image contrast, but it has limitations in improving edge sharpness and may amplify noise. Meanwhile, Unsharp Masking (USM) is effective for edge enhancement, yet it is less optimal when applied to low-contrast images. To address these weaknesses, this study proposes a hybrid image enhancement method combining CLAHE and USM for coffee beans quality analysis. The dataset consists of four classes: Biji-Kopi Normal (normal), Biji-Kopi Pecah (broken), Biji-Kopi Hitam (black), and Biji-Kopi Berlubang (hollow). All images were trained at a resolution of 512×512 pixels for 2000 iterations without transfer learning to ensure fair and unbiased evaluation. Histogram-based analysis demonstrates significant improvements after enhancement, including a 50.19% increase in mean intensity, a 217.9% increase in variance, a 78.38% rise in standard deviation, and a 22% increase in skewness, along with a 37.42% reduction in kurtosis. Performance evaluation using YOLOv4-Tiny shows that the proposed method improves AP50 from 96.51 to 97.7 and AP75 from 59.91 to 66.24, while AP95 remains unchanged at 0.01. The most notable improvements are observed at AP70 to AP90, indicating that the hybrid approach not only enhances classification performance but also strengthens object localization accuracy, making it effective for coffee bean defect detection.

Keywords


Coffee Beans; Object Detection; CLAHE; Unsharp Masking; YOLOv4.

  
  

Full Text:

PDF
  

Article Metrics

Abstract view: 95 times
PDF view: 10 times
     

Digital Object Identifier

doi  https://doi.org/10.33096/ilkom.v18i2.3120.351-362
  

Cite

References


V. Voora, S. Bermudez, C. Larrea, and S. Balino, “Global Market Report: Coffee.” International Institute for Sustainable Development, 2019. [Online]. Available: https://www.iisd.org/system/files/2022-09/2022-global-market-report-coffee.pdf

P. T. S. Soares, E. R. Tavares Filho, M. M. Pagani, E. T. Mársico, A. G. Cruz, and E. A. Esmerino, “Coffee quality: Insights of Brazilian consumers from different sociodemographic levels combining modified Word Association and Maximum Difference Scaling (MaxDiff),” Journal of Sensory Studies, vol. 38, no. 5, p. e12856, 2023, doi: 10.1111/joss.12856.

K. Zuiderveld, “Contrast limited adaptive histogram equalization,” in Graphics gems IV, USA: Academic Press Professional, Inc., 1994, pp. 474–485. doi: https://doi.org/10.1016/B978-0-12-336156-1.50061-6.

B. Hati̇Poğlu, Prof. Dr. İ. Karagöz, and M. İNal, “Threshold Based Image Enhancement Method for Low Contrast X-Ray Images Using CLAHE,” IJERAD, Dec. 2022, doi: https://doi.org/10.29137/umagd.1203617.

“Adaptive Clip Limit Tile Size Histogram Equalization for Non-Homogenized Intensity Images”, doi: https://doi.org/10.1109/ACCESS.2021.3134170.

K. Kumar and B. T. Chakkaravarthy, “Contrast Enhancement and Noise Reduction Through Synthesizing Gaussian Filter, CLAHE and HE Algorithm for Image Preprocessing,” in 2025 International Conference on Emerging Technologies in Engineering Applications (ICETEA), Jun. 2025, pp. 1–5. doi: 10.1109/ICETEA64585.2025.11100055.

X. Liang, Y. Tian, S. Yan, K. Wang, C. Guo, and B. Du, “A real-time infrared image enhancement algorithm based on improved CLAHE,” in 2018 International Conference on Image and Video Processing, and Artificial Intelligence, SPIE, Oct. 2018, pp. 130–138. doi: 10.1117/12.2514629.

K. Lucknavalai and J. P. Schulze, “Real-Time Contrast Enhancement for 3D Medical Images Using Histogram Equalization,” in Advances in Visual Computing, G. Bebis, Z. Yin, E. Kim, J. Bender, K. Subr, B. C. Kwon, J. Zhao, D. Kalkofen, and G. Baciu, Eds., Cham: Springer International Publishing, 2020, pp. 224–235. doi: 10.1007/978-3-030-64556-4_18.

T. P. H. Nguyen, Z. Cai, K. Nguyen, S. Keth, N. Shen, and M. Park, “Pre-processing Image using Brightening, CLAHE and RETINEX,” Mar. 22, 2020, arXiv: arXiv:2003.10822. doi: 10.48550/arXiv.2003.10822.

M. J. Kobra, A. M. Nakib, P. Mweetwa, and M. O. Rahman, “Effectiveness of Fourier, Wiener, Bilateral, and CLAHE Denoising Methods for CT Scan Image Noise Reduction,” Scientific Journal of Engineering Research, vol. 1, no. 3, pp. 96–108, Jun. 2025, doi: 10.64539/sjer.v1i3.2025.27.

J.-H. Kim, K.-H. Lee, J.-W. Lee, and K.-S. Kim, “Image Enhancement by Unsharp Mask Filtering Based on Detrending Method,” International Journal of Engineering & Technology, vol. 7, pp. 26–29, Dec. 2018, doi: 10.14419/ijet.v7i4.39.23693.

W. Ye and K.-K. Ma, “Blurriness-guided unsharp masking,” in 2017 IEEE International Conference on Image Processing (ICIP), Sep. 2017, pp. 3770–3774. doi: 10.1109/ICIP.2017.8296987.

J. Joseph and R. Periyasamy, “Nonlinear sharpening of MR images using a locally adaptive sharpness gain and a noise reduction parameter,” Pattern Anal Applic, vol. 22, no. 1, pp. 273–283, Feb. 2019, doi: 10.1007/s10044-018-0763-7.

I. Majid Mohammed and N. Ashidi Mat Isa, “Contrast Limited Adaptive Local Histogram Equalization Method for Poor Contrast Image Enhancement,” IEEE Access, vol. 13, pp. 62600–62632, 2025, doi: 10.1109/ACCESS.2025.3558506.

O. G. S, S. V.V, and Bekbolatov, “Application of the Clahe Method Contrast Enhancement of X-Ray Images,” ternational Journal of Advanced Computer Science and Applications, vol. 13, no. 5, pp. 412–420, 2022, doi: https://dx.doi.org/10.14569/IJACSA.2022.0130549.

X. Liu, M. Pedersen, and R. Wang, “Survey of natural image enhancement techniques: Classification, evaluation, challenges, and perspectives,” Digital Signal Processing, vol. 127, p. 103547, Jul. 2022, doi: 10.1016/j.dsp.2022.103547.

X. Chen et al., “Histogram analysis in predicting the grade and histological subtype of meningiomas based on diffusion kurtosis imaging,” Acta Radiol, vol. 61, no. 9, pp. 1228–1239, Sep. 2020, doi: 10.1177/0284185119898656.

L. Jiang et al., “Machine Learning Based on Diffusion Kurtosis Imaging Histogram Parameters for Glioma Grading,” J Clin Med, vol. 11, no. 9, p. 2310, Apr. 2022, doi: 10.3390/jcm11092310.

J. Ren, Y. Yuan, and X. Tao, “Histogram analysis of diffusion-weighted imaging and dynamic contrast-enhanced MRI for predicting occult lymph node metastasis in early-stage oral tongue squamous cell carcinoma,” Eur Radiol, vol. 32, no. 4, pp. 2739–2747, Apr. 2022, doi: 10.1007/s00330-021-08310-0.

Y. Chen et al., “Histogram analysis of MR quantitative parameters: are they correlated with prognostic factors in prostate cancer?,” Abdom Radiol, vol. 49, no. 5, pp. 1534–1544, May 2024, doi: 10.1007/s00261-024-04227-6.

H. Yang, X. Liu, J. Jiang, and J. Zhou, “Apparent diffusion coefficient histogram analysis to preoperative evaluate intracranial solitary fibrous tumor: Relationship to Ki-67 proliferation index,” Clinical Neurology and Neurosurgery, vol. 220, p. 107364, Sep. 2022, doi: 10.1016/j.clineuro.2022.107364.

O. Holub and S. T. Ferreira, “Quantitative histogram analysis of images,” Computer Physics Communications, vol. 175, no. 9, pp. 620–623, Nov. 2006, doi: 10.1016/j.cpc.2006.06.014.

G. Yuan et al., “Noninvasive assessment of renal function and fibrosis in CKD patients using histogram analysis based on diffusion kurtosis imaging,” Jpn J Radiol, vol. 41, no. 2, pp. 180–193, Feb. 2023, doi: 10.1007/s11604-022-01346-2.

M. A. Rasel, S. A. Kareem, and U. Obaidellah, “Integrating color histogram analysis and convolutional neural networks for skin lesion classification,” Computers in Biology and Medicine, vol. 183, p. 109250, Dec. 2024, doi: 10.1016/j.compbiomed.2024.109250.

X. Mingjin et al., “Research on Fast Multi-Threshold Image Segmentation Technique Using Histogram Analysis,” https://www.mdpi.com/journal/electronics, 2023, doi: https://doi.org/10.3390/electronics12214446.

W. Wang and Y. Yang, “A histogram equalization model for color image contrast enhancement,” SIViP, vol. 18, no. 2, pp. 1725–1732, Mar. 2024, doi: 10.1007/s11760-023-02881-9.

E. Onyedinma, I. Onyenwe, and H. Inyiama, “Performance Evaluation of Histogram Equalization and Fuzzy image Enhancement Techniques on Low Contrast Images,” Sep. 01, 2019, arXiv: arXiv:1909.03957. doi: 10.48550/arXiv.1909.03957.

X. Zhu, X. Xiao, T. Tjahjadi, Z. Wu, and J. Tang, “Image Enhancement using Fuzzy Intensity Measure and Adaptive Clipping Histogram Equalization,” Jan. 15, 2021, arXiv: arXiv:2101.05922. doi: 10.48550/arXiv.2101.05922.

J. Lee, S. R. Pant, and H.-S. Lee, “An Adaptive Histogram Equalization Based Local Technique for Contrast Preserving Image Enhancement,” International Journal of Fuzzy Logic and Intelligent Systems, vol. 15, no. 1, pp. 35–44, Mar. 2015, doi: 10.5391/IJFIS.2015.15.1.35.

Y. Chang, C. Jung, P. Ke, H. Song, and J. Hwang, “Automatic Contrast-Limited Adaptive Histogram Equalization With Dual Gamma Correction,” IEEE Access, vol. PP, pp. 1–1, Jan. 2018, doi: 10.1109/ACCESS.2018.2797872.

Y. Miao et al., “Application of the CLAHE Algorithm Based on Optimized Bilinear Interpolation in Near Infrared Vein Image Enhancement,” in Proceedings of the 2nd International Conference on Computer Science and Application Engineering, in CSAE ’18. New York, NY, USA: Association for Computing Machinery, Oct. 2018, pp. 1–6. doi: 10.1145/3207677.3277957.

I. Lazarevich, M. Grimaldi, R. Kumar, S. Mitra, S. Khan, and S. Sah, “YOLOBench: Benchmarking Efficient Object Detectors on Embedded Systems,” Aug. 21, 2023, arXiv: arXiv:2307.13901. doi: 10.48550/arXiv.2307.13901.

N. T. Allo, Indrabayu, and Z. Zainuddin, “A Novel Approach of Hybrid Bounding Box Regression Mechanism to Improve Convergency Rate and Accuracy,” IJIES, vol. 17, no. 2, pp. 715–727, Apr. 2024, doi: 10.22266/ijies2024.0430.57.

Z. Zainuddin and N. T. Allo, “More Focused Remote Sensing Object Detection Based on Improved Bounding Box Regression Loss,” IJIES, vol. 17, no. 6, pp. 230–247, Dec. 2024, doi: 10.22266/ijies2024.1231.19.

V. Ayumi, “Klasifikasi Penyakit Tanaman Berdasarkan Analisis Citra Daun Padi Menggunakan Metode SVM Dan CLAHE,” vol. 7, no. 3, 2024, doi: 10.36085.

H. Tribiakto, A. Sunyoto, and E. Pramono, “Enhancing Deep Learning-based Classification of Cassava Leaf Diseases using CLAHE and SMOTE,” Sistemasi: Jurnal Sistem Informasi, vol. 14, no. 6, pp. 2698–2706, Nov. 2025, doi: 10.32520/stmsi.v14i6.5530.


Refbacks

  • There are currently no refbacks.


Copyright (c) 2026 Srivan Palelleng, Nugra Tasik Allo, Juprianus Rusman

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.