Improve detection of small object in an image

I am conducting experiments using the YOLOv8m model for small-object detection on medical images. Despite adding a P2 detection head, the performance of one specific class remains low.

Interestingly, this class has a higher number of instances compared to other classes, yet its detection performance is still poor.

I would appreciate any suggestions on architectural modifications, training strategies, or hyperparameter adjustments that could help improve detection performance for this class.

You can try increasing imgsz. That’s really the only parameter that affects small object detection

1 Like

The other aspect that will impact small object detection is the quality of the ground truth annotations. Looking at the example you posted, I would suspect that the bounding boxes for the ground truth boxes might be “loose” meaning they are not tight to the object boundary. I say this as I have done detection projects similar to yours and observed the same type of model performance on small objects. I recommend comparing the ground truth against the model predictions directly and verifying that the ground truth boxes are tight against the object boundary (no background or other classes between object boarder and box edges). Additionally, you may consider using a segmentation model, as you can better define the perimeter of each object

You mean I should make a prediction and then compare it with the ground truth?
In addition to that i want to clarify, what do you mean by loose boxes? These species are very tiny, so in theory by making the bounding boxes a bit bigger might increase the chances of being detected. In terms of loss, parameter, or metrics are there any changes i can make that might improve my results?