Improving Oil Palm Fruit Detection under Class Imbalance Using Class-Balanced Focal Loss on YOLOv11 - Adrian Suparto; Muhammad Rizky Pribadi (ISB Atma Luhur, 2026)
Accurate detection of oil palm fruit maturity levels plays a crucial role in improving harvesting efficiency and maintaining the quality of palm oil production. In practice, this task remains challenging due to the presence of severe class imbalance in real-world field datasets, where certain classes have far fewer samples than others, often leading to biased model learning and reduced detection accuracy. This study investigates the performance of several Class-Balanced Loss Function variants integrated into the YOLOv11-nano framework using a publicly available oil-palm fruit dataset for harvest estimation, which presents a significantly imbalanced class ratio. Four training configurations were evaluated: the baseline Binary Cross-Entropy (BCE), Class-Balanced Focal Loss (CB-Focal), Class-Balanced Sigmoid Loss (CB-Sigmoid), and Class-Balanced Softmax Loss (CB-Softmax). The experimental results indicate that CB-Focal achieved the highest performance with an mAP@50 of 0.783, approximately 0.5 percent higher than the BCE baseline (0.778) and 4 to 5 percent greater than YOLOv8-n and YOLOv8-s models trained on the same dataset. CB-Focal also demonstrated smoother convergence and more balanced per-class performance compared to the other loss functions. These findings suggest that integrating CB-Focal into the YOLOv11-nano framework not only improves accuracy for minority classes but also holds strong potential for supporting more accurate, efficient, and scalable automated harvest monitoring systems in real plantation environments.