Skip to content
tezvyn:
Menu

Improving small object detection

Source: interviewMediumHow cards are made

Summary

practical detector debugging.

Key points

raise input resolution and tile, use feature pyramids for high-res features, tune anchors and copy-paste augmentation.

Watch out for

only saying collect more data without addressing scale.

What's really being asked

The interviewer wants to see structured debugging of a known failure mode rather than random hyperparameter twiddling. Small objects are hard because they cover few pixels and get erased as feature maps are downsampled through the backbone.

The full answer

Three distinct levers. First, input and feature resolution: increase the network input size, slice large images into overlapping tiles at inference and training, and detect on higher-resolution feature maps. Second, multi-scale architecture: use a Feature Pyramid Network so shallow, high-resolution layers carry strong semantics, and assign small objects to those finer levels. Third, data and anchor strategy: add anchors or query priors sized for tiny objects, rebalance the loss with focal loss, and use targeted augmentation such as small-object copy-paste, mosaic, and scale jitter so the model sees more small instances.

The mistakes people make

Saying just train longer or use a deeper backbone. Depth alone increases downsampling and can hurt small objects. Another weak answer is only collect more data without changing how scale is handled, since the architecture may still discard the relevant signal.

What usually comes next

How does an FPN actually help, and which pyramid level should detect a 12-pixel object. How do you set the IoU threshold and anchor scales for tiny boxes. What metric isolates small-object performance, and the answer is COCO AP small. How does tiling change non-maximum suppression at tile boundaries.

A concrete example

In aerial imagery of cars, a detector trained at 640 pixels misses vehicles that span only a handful of pixels. Tiling each 4000-pixel image into 640 patches with overlap, switching to an FPN-based detector, and adding copy-paste of cropped cars raises small-object recall substantially, while overlap plus global NMS reconciles boxes at the seams. You then track COCO AP small specifically rather than overall AP, so gains on tiny objects are not masked by easy large ones, and you confirm that the finer pyramid levels are the ones firing on these instances.

Interview question

Why do standard CNN detectors tend to miss very small objects more than large ones?

  • a.Small objects have lower contrast than large objects by definition
  • b.Small objects always appear at image edges where padding interferes
  • c.Loss functions cannot represent small bounding boxes numerically
  • d.Deep, downsampled feature maps lose the few pixels representing small objectsCorrect
Why?

Repeated downsampling shrinks small objects to sub-pixel size in deep layers, erasing their signal. Contrast and edge position are not inherent properties of small objects, so those options are false.

Just read this? Test yourself on what you have been reading.

Read the original → so-development.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles