New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to improve accuracy of detecting small objects? #545
Comments
@PhoenyHan How small are your objects? Are they smaller than 8x8 pixels? |
coco evel, small object AP < 0.3 |
not that small, they are just car plates and can be recognized well by yolov4 |
|
@PhoenyHan Can you show me your exp file and training command? I need to make sure you correctly configure your experiments. |
@Joker316701882 I didn't change any thing in yolox_base.py. I'm using VOC exp file provided by you and only changed the model depth and width to 1.0. Training command is : python tools/train.py -f exps/example/yolox_voc/yolox_voc_l.py -d 3 -b 24 --fp16 -c yolox_l.pth.tar |
@PhoenyHan You may set the self.random_size = (10, 26) so that there will be more small objects during training (currently it is set to 14, 26. The explanation of these numbers can be found here). Also, the performance at the 100th epoch for yolox is far from convergence. We close the data aug at 285th epoch, which will greatly improve the performance(4~6 mAP in our experiments). But if you don't want to train 300epochs, you may reduce the self.max_epoch = 300 to 100. Just make sure when you stop the training, the augmentation has already closed for a few epochs. |
@Joker316701882 Thanks for your suggestion! The problem of my dataset is that there are small objects as well as big foreground objects. I tried to increase the input size to 800*800, I found that by increasing input size, the accuracy of detecting small objects will be better but will be worse for big objects. It's hard to find a balance. Do you have any suggestion for the dataset containing both big and small objects? Thx a lot |
@PhoenyHan Given your current situation (800x800, with relatively poor performance on the big objects), you can try to add P6 in FPN layers, which will increase the receptive field. By the way, can get good results on both small and big objects with a single yolov4 model without p6 layers and input size 640x640? |
@Joker316701882 yes, it's weird that using default setting of yolov4 can get a much better result than yolox. The mAP in yolov4 can reach 90%+ but in yolox it's only 80% or lower |
@PhoenyHan Interesting. Is it possible to share your data with us in private? |
@Joker316701882 Sorry that I cannot share my data. I noticed that my dataset is direction sensitive so flipping augmentation may make the training result worse. How to close the flipping augmentation in YOLOX? thx |
@PhoenyHan You can modify the code here: YOLOX/yolox/data/data_augment.py Line 192 in 3c07916
Let us know if you get better results. |
This issue has been solved by #600 . |
Hi @PhoenyHan , I don't think car plates would be much direction sensitive right? I'm also training on license plates. Did you achieve higher AP after disabling flipping augment? |
@BatmanofZuhandArrgh My datasets include arrows that are direction sensitive, it's not for license plates. |
Got it, thanks a lot! |
Thanks for sharing your works! I have a question. Closing the augmentation in the second half of the training phase can improve detection accuracy? |
I trained yolox_L model for 100 epochs, the detection for big objects is good but is bad for small objects. The confidence for small targets is too low that cannot show the bounding box with a normal conf and nms value. Could anyone provide idea on how to improve it? Thanks a lot
The text was updated successfully, but these errors were encountered: