Share

Export Citation

APA
MLA
Chicago
Harvard
Vancouver
BIBTEX
RIS
Universitas Hasanuddin
Research output:Contribution to journalArticlepeer-review

Improving the Accuracy of Coffee Bean Quality Detection Using Manhattan Distance Method in the Loss Function of You only Look Once V4

Samas Z.M.

International Conference on New Media Studies Conmedia

Published: 2025

Abstract

Coffee is a major export commodity that plays an important role in the economies of developing countries, including Indonesia. However, owing to the decline in quality and quantity of production caused by environmental factors, an efficient quality evaluation system is required. This study aims to improve the accuracy of coffee bean quality detection by modifying the You Only Look Once version 4 (YOLOv4) algorithm by combining the Complete Intersection over Union (CIoU) and Manhattan Distance Intersection over Union (MIoU) methods in the loss function. CIoU considers the aspect ratio and midpoint distance, but CIoU itself has obstacles, one of which is convergence at the beginning of training, causing a slow training process because of the use of the Euclidean distance method. To obtain the most accurate results, it is necessary to integrate MIoU, which uses the Manhattan distance method, an improved gradient stability, and a faster training process. The dataset consisted of 400 original coffee bean images (100 per class), which were augmented using Roboflow to 2,000 images to enrich visual variation and improve model generalization. The dataset was collected by taking images of coffee beans using a high-resolution digital camera. The images were taken in a controlled lighting environment, using a neutral background and a top-view angle. Each image contains coffee beans with a variety of shapes and real conditions as found in the field. Experimental results show that the YOLOv4 model with the CIoU+MIoU joint loss function achieves a 7.4% improvement in mAP compared to the baseline model, with significant improvement at high-precision levels. This study contributes a new approach to the development of loss functions for object detection in the field of computer vision.

Other files and links

Fingerprint

Intersection (aeronautics)Sciences
Function (biology)Sciences
MathematicsSciences
Convergence (economics)Sciences
Computer scienceSciences
Quality (philosophy)Sciences
Artificial intelligenceSciences
Euclidean distanceSciences
Image qualitySciences
Process (computing)Sciences
Image processingSciences
StatisticsSciences
Training setSciences
Baseline (sea)Sciences
Euclidean geometrySciences
European unionSciences