small object detection
Faster R-CNN
TensorFlow
machine learning
computer vision

small object detection with faster-RCNN in tensorflow-models

ML System Design practice on Codemia

Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.

Practice ML system design

Introduction

Small object detection is difficult because the object may occupy only a few pixels, and important detail disappears quickly as the network downsamples the image. Faster R-CNN can still work well in the TensorFlow Models stack, but it usually needs better anchors, higher-resolution inputs, and data preparation that reflects the actual object scale.

Why Small Objects Are Hard

Faster R-CNN depends on feature maps and region proposals. Tiny targets suffer twice:

  • the backbone may downsample them away
  • the proposal anchors may be too large to overlap them well

That means the model can miss the object before classification even starts. By the time the region proposal network looks for candidate boxes, there may not be enough spatial evidence left.

Start with a Better Base Model

For small objects, multi-scale features matter more than usual. Faster R-CNN models with FPN-style feature pyramids are often a better starting point than simpler single-scale variants because they preserve information across several resolutions.

The goal is not only "use a stronger backbone." The goal is to keep fine-grained detail available long enough for the proposal stage to use it.

Increase Input Resolution Carefully

One of the most effective changes is increasing the input image size so small objects occupy more pixels.

In a TensorFlow Object Detection API pipeline config, that often looks like:

text
1image_resizer {
2  keep_aspect_ratio_resizer {
3    min_dimension: 1024
4    max_dimension: 1024
5  }
6}

Higher resolution can improve recall for tiny objects, but it also increases memory use and training time. The right value depends on your hardware budget and the object size distribution in the dataset.

Tune Anchors for Small Targets

Default anchor settings are usually chosen for more general object scales. If your targets are consistently small, the proposal generator needs smaller anchors.

A simplified configuration idea looks like this:

text
1anchor_generator {
2  multiscale_anchor_generator {
3    min_level: 2
4    max_level: 6
5    anchor_scale: 2.0
6    aspect_ratios: 0.5
7    aspect_ratios: 1.0
8    aspect_ratios: 2.0
9    scales_per_octave: 3
10  }
11}

The exact block varies by model configuration, but the principle stays the same: proposals work better when anchor sizes resemble the targets you actually care about.

Improve the Training Data, Not Only the Model

Small object detection is extremely sensitive to data quality. Helpful strategies include:

  • collecting more images where small objects are clearly visible
  • cropping large images into tiles so tiny objects occupy more pixels
  • using augmentations that preserve object visibility
  • checking small-box annotations carefully for accuracy

If the dataset contains inconsistent or noisy tiny boxes, the detector will struggle no matter how much you tune the backbone.

Evaluate by Size, Not Only by Overall mAP

A detector can look decent on overall metrics while still failing on the exact small targets you care about. That is why evaluation should include either size-specific metrics or at least a manual review of predictions on images dominated by tiny objects.

If large objects are detected well but small ones are consistently missed, the fix is usually about scale handling rather than "train for more epochs."

A Practical Fine-Tuning Flow

A sensible workflow is:

  1. start from a pretrained Faster R-CNN checkpoint
  2. raise input resolution within your memory budget
  3. adjust anchor settings for smaller proposals
  4. fine-tune on data with strong small-object labels
  5. evaluate specifically for small targets

This is usually more effective than searching for one magical model parameter in isolation.

Common Pitfalls

Keeping default input resolution and default anchors while expecting strong small-object recall is the most common setup mistake.

Resizing training images in a way that makes already-small targets even smaller can quietly destroy detection quality.

Relying only on aggregate metrics can hide the fact that the model still performs badly on tiny instances.

Improving architecture without fixing weak annotation quality usually produces disappointing results.

Assuming that more epochs alone will solve scale-related failures often wastes compute without addressing the real problem.

Summary

  • Faster R-CNN can detect small objects, but default settings often need adjustment.
  • Higher input resolution gives tiny targets more useful pixels.
  • Smaller or better-matched anchors improve proposal quality.
  • Multi-scale features and strong annotations matter heavily for small-object recall.
  • Evaluate specifically for small objects instead of trusting only global metrics.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

ML System Design practice on Codemia

Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.

Practice ML system design

All Rights Reserved.