AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.8k stars 7.96k forks source link

Adding Class_weights for Classification training #7382

Open kenrickfernandes opened 3 years ago

kenrickfernandes commented 3 years ago

A cfg parameter called "counters_per_class" exists for Object Detection to tackle imbalanced data. Is it possible to add this feature for classification purposes? And if not, could you guide me on how to tackle class imbalance for classification purposes? (Darknet53 model used) I have a scenario where two classes look very similar, the only difference being a small part of the objects' color. Object A has a lot of samples (9k) and Object B has around 2k samples. Upon testing, all samples under Object B are classified as Object A. How do I resolve this? Thanks for your help!

stephanecharette commented 3 years ago

Sounds like you know what you are doing, but just in case, did you also remember to turn down the colour-based data augmentation? E.g., https://www.ccoderun.ca/darkmark/DataAugmentationColour.html

kenrickfernandes commented 3 years ago

Yes, I have removed all color-based augmentations except exposure. Do you think removing exposure augmentations would help? Thanks for the reply!