AlexeyAB / darknet

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

Negative sample resolution #6770

Open sabrinatuli opened 3 years ago

sabrinatuli commented 3 years ago

I want to add negative samples in my face dataset to reduce false positive and improve accuracy for small faces. Training images are mostly 1024x500 in this resolution.My training cfg network resolution is 832x832. I am planning to slice the original image and use those slices as negative samples. In that case the slices resolution will be less less than 832 (maybe approximately 250-300px). @AlexeyAB Can I use any resolution image for negative samples or it needs to be exactly or larger than network resolution(for my case 832)? It will be more helpful if you specify how many negative sample is good (my training set has almost 12k images including training and validation)? Also how to generate the training samples and what should be the resolution of negative samples?

sabrinatuli commented 3 years ago

@AlexeyAB can you please help me with this issue?

stephanecharette commented 3 years ago

It doesn't matter what resolution the original images are. All images are stretched to match the network size.

I'm not certain I understand what you mean by "slice the original image". If you have a partial face in your image, then it should be marked as a face.

As for the number -- the readme mentions the same number of negative images as positive images. If you have 12K images, I think you'll find you don't need 12K negative images before you see an impact.

sabrinatuli commented 3 years ago

@stephanecharette thanks for your help. After slicing the original image into different pieces, some pieces contain background like sky, tree, clothes and some contain partial or some part of faces like only ear, forehead visible. Can I consider the partial face images as negative or not? If not then what is the best way to generate negative samples? Any suggestion is much appreciated.

stephanecharette commented 3 years ago

I don't know your data set. Hard to tell. But if the images contain parts of what you are trying to detect, then it isn't a negative image.

sabrinatuli commented 3 years ago

I am using WIDER FACE dataset, it contains very small faces with pose, occlusion and other hard conditions, with YOLOv4, it detects parts of faces, or sometimes clothes which are not actual faces or detects same face multiple times, that's why wanted to use negative samples. Is there any implementation of Online Hard Example Mining in Darknet Yolov4?