Investigates the effectiveness of Focal Loss as a solution to the problem of class imbalance in multi-label fruit and vegetable classification tasks. Using a ResNet50-based Convolutional Neural Network (CNN) architecture, two models were trained and evaluated: one using Focal Loss and another using Binary Cross-Entropy (BCE) Loss as a baseline. To address the availability of multi-label datasets, a synthetic multi-label dataset was created by combining images from existing single-label datasets. Experimental results show that the model trained with Focal Loss achieved an accuracy of 0.9390 and an F1-score of 0.9863, outperforming the BCE Loss model which only reached an accuracy of 0.8850 and an F1-score of 0.9718. The comparative analysis indicates that Focal Loss, with its ability to focus the training process on difficult examples, effectively addresses class imbalance and produces superior performance. This study concludes that Focal Loss is an effective tool for multi-label classification tasks and highlights the existing limitations, including the synthetic nature of the dataset and the limited training duration, which underscore the need for further research
Copyrights © 2025