experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 785 forks source link

Configuration for detecting small objects in big images #357

Open gonzalovodanovic opened 6 years ago

gonzalovodanovic commented 6 years ago

When use full YOLO for detecting small object (20x20 pix) in big images (1024x2048 pix), I get low mAP (61%). Not sure if there is any configuration i can use to improve this number. Should i change the input size? and what about this other options?:

    "object_scale":         5.0 ,
    "no_object_scale":      1.0,
    "coord_scale":          1.0,
    "class_scale":          1.0,

This is the result per class i get (also add the number of images per class):

class Images quantity AP
0 21980 0.5241
1 9625 0.8780
2 9505 0.7492
3 870 0.5177
4 415 0.3803

Thanks!

rodrigo2019 commented 5 years ago

maybe if you change the backend in order to create a bigger grid in YOLO output

gonzalovodanovic commented 5 years ago

Thanks for your answer, but could you give me more detail on how to do it?

rodrigo2019 commented 5 years ago

the yolo grid depends the size of output feature map from backend model, the easiest way to get a bigger grid size is removing the last max pooling layer from the backend model, the backend will be a little bit slower, because the further layers will process a bigger feature map than before.

Removing a pooling layer will generate a grid twice bigger

gonzalovodanovic commented 5 years ago

Thanks, I'll try that.

gonzalovodanovic commented 5 years ago

Hi, another question. Could be a problem than the images are not squared? how should i fix that?