Small Object Detection with YOLO: Tiling Step by Step

Aerial road view split into overlapping tile windows with green detection boxes around very small cars, with the headline Find Tiny Objects with YOLO Tiling

Your detector scores well on the test set. Then you point it at a drone frame, and it finds a handful of cars out of dozens. The model is not broken. The frame was shrunk before the model ever looked at it, and the small objects shrank with it.

This guide is about small object detection with YOLO. You will learn how to check whether resizing is your problem, four ways to fix it, how image tiling works, and a fair test plan so you only pay for tiling when it helps.

Why Small Object Detection Fails After Resizing

A 15 by 15 pixel object shrinks to 5 by 5 pixels when a 1920 px image is resized to 640 px
A 15 px object in a 1920 px frame is only about 5 px wide after the resize to imgsz=640.

An object only has the pixels it has. A YOLO model learns shapes from those pixels. If a pedestrian is 15 pixels tall in the original frame, there is not much to learn from, even before any resizing.

Then comes the resize. Ultralytics YOLO scales the whole image so its longest side matches imgsz, which is 640 by default. According to the Ultralytics guide on image tiling, a 1920 x 1080 frame is shrunk three times at that setting, so a pedestrian 15 pixels tall ends up about 5 pixels tall. At that size, a person looks a lot like noise.

You see this most in drone and satellite images, wide-angle traffic and security cameras, and high-resolution photos of whole boards, panels or shelves. In all of them, the frame is big and the things you care about are small.

A Two-Minute Pixel Check

Before you change anything, find out how small your objects really are when the model sees them. The rule is plain arithmetic:

Size the model sees = original size x (imgsz / longest side of the image)

Here are three worked examples. The first row matches the Ultralytics example above. The other two are our own arithmetic, so swap in your own numbers.

Image width Object size in original Seen at imgsz=640 Seen at imgsz=1280
1920 px 15 px 5 px 10 px
3840 px 30 px 5 px 10 px
4000 px 24 px about 3.8 px about 7.7 px

There is no official cutoff that says “too small”. So here is a simple eye test. Resize ten of your own images to your imgsz and look at them yourself. If you cannot point to the object in the shrunken picture, the model will struggle too.

Practical tip: do this check on your hardest images, not your average ones. Pick the frame with the farthest cars or the smallest defect. If those survive the resize, you may not need tiling at all.

Four Ways to Give Tiny Objects More Pixels

If the pixel check shows a problem, you have four options. The table is built from the numbers in the Ultralytics guide, for a 1920 x 1080 frame.

Option Model inputs per frame What the model sees Use it when
Whole image, imgsz=640 1 Frame shrunk 3x Objects are still clear after resizing
Whole image, imgsz=1280 1, at roughly 4x the compute of 640 Frame shrunk 1.5x Your memory and latency budget can take a bigger input
tile=True with imgsz=640 8 Native-resolution 640 px windows Images are several times larger than the model input
tile=400 with imgsz=640 More than 8 Smaller windows, enlarged to 640 Objects are only a few pixels wide even at full resolution

Notice the trade. Every option that helps small objects costs more compute. Raising imgsz costs about four times as much for one pass. Tiling costs one model input per window. Neither is free, so you want to know it works before you ship it.

How Image Tiling Works

A 1920 by 1080 frame covered by eight overlapping 640 px tile windows
At tile=640, a 1920 x 1080 frame runs as eight overlapping windows, and duplicate boxes are merged afterwards.

Tiling cuts the big image into overlapping windows, runs the detector on each window, and maps the boxes back onto the original image. Each window is a normal-sized input, so the model sees the objects at full size. The idea comes from a 2022 paper called Slicing Aided Hyper Inference and Fine-tuning for Small Object Detection, better known as SAHI.

How many windows will you run?

The Ultralytics guide says windows overlap by a base 20 percent, and the last row and column line up with the image edge. That makes the cost easy to predict:

  • A 1920 x 1080 frame with tile=640 runs 8 windows: 4 across and 2 down.
  • A 3840 x 2160 frame with tile=1280 also runs 8 windows.
  • A 3840 x 2160 frame with tile=640 runs 32 windows. Halving the window size on a 4K frame quadruples the work.

What happens at the seams

Because windows overlap, an object near a seam can be found twice. Duplicate boxes are removed with non-maximum suppression, using your usual iou setting. A box cut off by a window edge is dropped when another window sees the same object whole. If no better box exists, the cut one is kept.

There is one limit to remember. A window only sees part of a very large object, and merging does not stitch separate fragments back together. That is why tiling can hurt when objects are big. More on that in the mistakes section.

Tiled Inference in a Few Lines of Python

Tiling is built into the Ultralytics Python package. According to the guide, the tile argument arrived in version 8.4.204 on November 6, 2026, and you do not need SAHI or any extra package. Check that your install is at least that version. This sketch follows the pattern in the docs:

from ultralytics import YOLO

model = YOLO("yolo26s.pt")

# Baseline: the whole frame shrunk to 640 px
whole = model.predict("drone_frame.jpg", imgsz=640)

# Tiled: 640 px windows at native resolution, 8 per batch
tiled = model.predict("drone_frame.jpg", imgsz=640, tile=640, batch=8)

print("whole frame:", len(whole[0].boxes), "boxes")
print("tiled:      ", len(tiled[0].boxes), "boxes")

Passing tile=True uses imgsz as the window size. Passing a number sets the window size on its own. For video, add stream=True to keep memory under control.

The guide shows what this can do on one VisDrone frame. YOLO26s found 35 objects on the whole image and 161 with tile=640. Read that carefully. Those are prediction counts, not a scored test. More boxes can mean more real objects found, or more false alarms. You only know which after you score them against labels. If you are choosing a model for this job, our YOLO26 vs YOLO11 comparison covers the speed and accuracy numbers.

Train and Validate the Way You Will Predict

If your images are much larger than imgsz, the same argument also works in training and validation. This matters because a model trained on whole, shrunken images has never seen objects at the scale it meets during tiled prediction. The SAHI paper makes the same point with what it calls slicing-aided fine-tuning.

These are the details from the Ultralytics guide:

  • Train on tiles: model.train(data="aerial.yaml", tile=True, imgsz=640). Labels are clipped to each window. Objects with less than 10 percent of their original box area left are dropped. Empty windows stay in as negative examples.
  • Validate on merged results: model.val(data="aerial.yaml", tile=True, imgsz=640). Boxes are merged first and then scored against the original labels, so the mAP reflects what you will deploy.
  • Cache big images: use cache="ram", because training shuffles tiles and would otherwise decode the same large file again and again.

If you need a refresher on what mAP, precision and recall mean, the same guide links to a glossary. The short version: precision tells you how many boxes were right, and recall tells you how many real objects you found. For tiny objects you want to watch both.

A Fair Test Plan Before You Switch It On

Four steps in order: pixel check, larger image size, tiling, then validation, from cheapest to most compute
Try the cheap fixes first, and keep tiling only where validation numbers show a real gain.

Tiling is not a default setting you should leave on. It is an experiment you run. Here is a simple order of work, with the cheapest fix first.

  1. Freeze one validation set. Use images from your real cameras, with every small object labeled. Never train on them. Every setting below is scored on this same set.
  2. Score the baseline. Whole image, imgsz=640. Write down mAP, precision, recall and time per image.
  3. Try a bigger imgsz. Run the same set at imgsz=1280. If recall recovers and the speed is fine, you may be done.
  4. Try tile=True. Validate with tiling, and train with tiling too if your images are large.
  5. Try one smaller tile. A window of about 400 pixels enlarged to 640 can help with objects only a few pixels wide. It also enlarges background clutter, so watch precision for new false alarms.
  6. Compare on the same confidence threshold. Look at recall, false positives and latency together. Keep tiling only where the gain is worth the extra work.

Here is a short script sketch for steps 2 to 4. It is our own loop built from the arguments above. Attribute names can change between versions, so print the result object once and check.

from ultralytics import YOLO

model = YOLO("best.pt")   # your trained weights
settings = {
    "whole_640":  dict(imgsz=640),
    "whole_1280": dict(imgsz=1280),
    "tiled_640":  dict(imgsz=640, tile=True),
}

for name, args in settings.items():
    m = model.val(data="aerial.yaml", **args)
    print(name, "mAP50-95:", round(m.box.map, 3),
          "precision:", round(m.box.mp, 3),
          "recall:", round(m.box.mr, 3),
          "inference ms:", round(m.speed["inference"], 1))

Remember that a tiled run does more model inputs per image, so the time per image will go up. Time it on the real device you plan to use, not on your laptop.

Common Mistakes and Their Fixes

  1. Mistake: tiling when objects are large. A window sees only part of a truck that fills half the frame. Fix: tile only when objects are small compared to the frame. The SAHI paper found that adding a full-image pass helped large objects, with a small cost for small ones, so mixed scenes may need both.
  2. Mistake: training on whole images and predicting on tiles. The model never saw objects at the tiled scale. Fix: train and validate with the same tile setting you will deploy.
  3. Mistake: treating box counts as accuracy. The jump from 35 to 161 boxes is not a score. Fix: always compare against labels on a validation set.
  4. Mistake: double boxes at the seams. Overlap means the same object can appear twice. Fix: tune the iou setting used for non-maximum suppression, and look at a few seam areas by eye.
  5. Mistake: picking the smallest window to be safe. Tiny windows multiply the work and enlarge background texture. Fix: test two or three sizes and stop at the first one that works.
  6. Mistake: forgetting the speed budget. Eight windows per frame is eight times the inputs. Fix: measure latency on the target device before you promise a frame rate.

Do Not Forget the Labels

Tiling cannot fix bad labels. The Ultralytics guide on improving mAP on small objects makes two points that are easy to miss. First, small objects are very sensitive to box placement, so a box that is a few pixels off can drop below the IoU threshold and count as a miss. Second, if an object is in the image but missing from the labels, a correct detection is scored as a false positive.

So label tiny objects with care, and label all of them. Write one rule for partly visible objects and one rule for the edge of the box, then stick to both. Auto-labeling can speed this up, and our guide on SAM 3 auto-labeling shows a review process for checking machine-made labels. If you do not have the time to label thousands of small objects yourself, a data annotation service such as Annotationera can label images for you. Whoever does it, check a sample before you train.

If you are still deciding what kind of label your project needs at all, read image classification vs object detection vs segmentation first.

Our Take

Tiling is a strong tool for one specific situation: big frames and small objects. In that case it can recover objects that resizing throws away, and the evidence for the idea is solid. The SAHI paper reports gains of 6.8, 5.1 and 5.3 AP for three different detectors on the VisDrone and xView aerial sets, and larger gains when the model is also fine-tuned on slices.

But those numbers come from aerial benchmarks and older detectors. They are not a promise for your cameras. And Ultralytics itself says tiling stays off by default, because every window is another model input.

Our advice is to follow the cheap-first order. Run the pixel check. Try a larger imgsz. Only then add tiling, and keep it where the validation numbers show a real gain. Do not turn it on everywhere just because it sounds like an upgrade.

One more note: the tooling here belongs to Ultralytics, which uses the AGPL-3.0 license and also sells an Enterprise license. If you plan to ship a closed-source product, read the license terms before you build on it. This is general information, not legal advice.

Questions People Ask

What is small object detection?

It is finding objects that take up only a tiny part of an image, such as distant cars in a drone frame or a small defect on a large panel. Whether an object counts as small depends on how many pixels it covers, not on how small it looks to you.

How do I improve small object detection with YOLO?

First check whether resizing is the cause, using the pixel check above. Then test a larger imgsz and tiling on a frozen validation set. Train with the same setting you will predict with, and make sure your labels for small objects are tight and complete.

Does tiling slow down inference?

Yes, it adds one model input per window. A 1920 x 1080 frame at tile=640 runs eight windows instead of one image. Running several windows in one batch can improve throughput, but measure the time on your own hardware.

Do I still need SAHI with YOLO26?

Not for Ultralytics models on version 8.4.204 or later. Ultralytics says the built-in tile argument does the same job without an extra package, and that its older SAHI guide is deprecated. The two do not produce identical boxes, so re-check your thresholds if you switch.

What tile size should I use?

Start with tile=True, which uses your imgsz as the window size. Go smaller when objects are only a few pixels wide even at full resolution, and larger when objects risk being cut at the seams. Compare two or three sizes and watch both recall and false alarms.

Does tiling work with exported ONNX or TensorRT models?

According to the Ultralytics guide, yes in Python. An exported model keeps its normal input graph, and you pass tile to predict as usual. The guide also describes a Rust inference tool with a matching tile option, if you need to run without Python.

Final Thoughts

Small object detection is mostly a pixel problem. Do the pixel check, try the cheap fix first, and add tiling when big frames and tiny objects leave you no other choice. Then prove it on a validation set you froze before you started.

For more guides on models, tools and labeling, browse our computer vision section.

Sources: Ultralytics: Small object detection with image tiling, Slicing Aided Hyper Inference and Fine-tuning for Small Object Detection (arXiv), Ultralytics: How to improve model mAP on small objects.

Leave a Reply

Your email address will not be published. Required fields are marked *