Clear Filters
Clear Filters

Unable to train multilabel object detection usingYOLOv3

4 views (last 30 days)
I have been trying to train a YOLOv3 model for multiclass, but the accuracy for the second and third class are way too low. i am unable to find the cause for it. I am using a unbalanced dataset and using data augmentation techniques to balance it. Apart from that, i do not see any other cause.
I have trained the YOLOv3 model with pretrained models with just one class and got the average precision of 0.713 but with multiclass even the fist class has accuracy around 0.56, second class 0.09 and third class 0.07. Do i need to configure any parameters to improvise the performance of the model?
I am following the example code Object Detection Using YOLO v3 Deep Learning

Accepted Answer

Neha on 6 Apr 2023
I understand that you want to boost the accuracy for the second and third class where dataset being used is imbalanced. There are a few ways to improve the performance of the model:
  1. SMOTE (Synthetic Minority Over-sampling Technique) is a popular data augmentation technique for imbalanced datasets. It generates synthetic samples for the minority class (second and third classes in this case) by interpolating between existing samples. You can refer to Synthetic Minority Over-sampling Technique (SMOTE) file exchange to download the GitHub repository containing the implementation for the algorithm.
  2. Using a Weighted Loss function: The loss function can be weighted to give more importance to the minority class by multiplying the loss of the positive examples by a weight factor. To achieve this, you can try modifying the parameters for crossentropy defined in “objectnessLoss and “classConfidenceLoss functions as given in Object Detection Using YOLO v3 Deep Learning. The “perfweights” parameter as explained in Cross-Entropy, lets you modify the weights for each class, thereby giving more priority to the second and third classes.
  1 Comment
Akshatha Doddabyaladakere Nagaraju
Thank you for the response.
Regarding the cross-entropy function, YOLOv3 is using cross-entropy loss for classification tasks (CE) instead of cross-entropy function you mentioned above.
I tried giving numeric vector for weights for this funciton, but I am unable to understand the format. I have three classes and I tried [1 2 3] but the error said the dimesnion of predicted value and weights doesn't match. I had to use [1 2 2 3] vector to resolve the error.
Why so i need to give 4 inputs instead of 3 for weights here?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!