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.97k forks source link

multi class training #2441

Open pkhigh opened 5 years ago

pkhigh commented 5 years ago

I have a data set of 5 classes of objects. Total dataset : 1200 images where one object is 700 and other are 30,60,15,5.

First, I am unable to divide this dataset into train, test and validation so that all the classes are present uniformly. I mean if I do random 60,20,20 split then most of the time minority class is not distributed uniformly. Is there a proper API for spliting such dataset for object detection?

Second, after training YoloV3 the confidence of most dominant class is always 0.9-0.8 whereas confident of other classes is 0.1-0.3 even on the training set. Is there a way to do class weighted training based initial object class distribution?(Something like focal loss)

AlexeyAB commented 5 years ago

You can try to set focal_loss=1 for each of 3 [yolo] layer in your cfg-file.

pkhigh commented 5 years ago

There is one more issue, while training tiny-yolov3 using your repository my gpu usage goes for around 4GB compared to original repos GPU usage of 1GB. (I build with GPU=1, DEBUG=0 and OPENMP=1 flags)(Both repos) I am unable to train any model using your repository. There is no focal_loss functionality in the original repo.

AlexeyAB commented 5 years ago

Check batch= and subdivisions= in your cfg-files in both repos.

Also much faster to train a model with CUDNN=1 (you should install cuDNN)

pkhigh commented 5 years ago

Both are same batch = 16 subdivisions = 8

AlexeyAB commented 5 years ago

There is one more issue, while training tiny-yolov3 using your repository my gpu usage goes for around 4GB compared to original repos GPU usage of 1GB.

Can you show screenshots?