Penerapan Arsitektur U-Net pada Segmentasi Cacat Biji Kopi untuk Optimalisasi Inspeksi Kualitas - Ami Rahmawati; Ita Yulianti; Ani Oktarini Sari; Siti Nurajizah (LKP Unity Academy, 2025)
Manual visual inspection of coffee bean defects remains prone to subjectivity and inconsistency, necessitating a more accurate and efficient approach. This study proposes a deep learning-based coffee bean image segmentation method using the U-Net architecture to detect the presence of defects in coffee beans using a binary segmentation approach. The dataset consists of 300 coffee bean images evenly divided into 150 images of black coffee and 150 images of insect damage. Annotation was performed using a semi-automatic pseudo-labeling method based on Gaussian filtering, absolute difference, and thresholding to generate ground truth in binary mask format. Training data was enriched through augmentation techniques including horizontal flip, vertical flip, rotation, and brightness-contrast adjustment. The model was trained using a combined loss function of Dice Loss and Binary Cross-Entropy with the Adam optimizer over 15 epochs with an early stopping mechanism. Evaluation results demonstrate excellent performance with a Mean IoU of 0.9240, Precision of 0.9707, Recall of 0.9495, and F1 Score of 0.9600, with an overall correct prediction rate of 97.45% based on pixel-level confusion matrix analysis. These results indicate that the U-Net architecture is capable of segmenting defective coffee bean areas accurately and consistently, making it a promising foundation for the development of an automated coffee quality inspection system.