Ultralytics YOLO27: Join the waitlist.
License YOLO
Guides

Drone detection dataset guide: train Ultralytics YOLO on tiny UAVs

Compare DUT Anti-UAV, Drone-vs-Bird and thermal drone detection datasets, then train Ultralytics YOLO26 to find tiny drones and cut false alarms.

JIJing Qiu13 min read

Listen to this article

Compare DUT Anti-UAV, Drone-vs-Bird and thermal drone detection datasets, then train Ultralytics YOLO26 to find tiny drones and cut false alarms.

The UAV Detection and Tracking Benchmark reports an average drone size of 34 x 23 pixels in its Drone-vs-Bird data. Picture a drone that size in a hypothetical 3840 x 2160 frame: resized to the 640 pixels a detector uses by default, it would shrink to about 5.7 x 3.8 pixels.

Counter-drone teams have to keep that object visible from the dataset they choose to the model they deploy. This guide covers the four decisions that settle it with Ultralytics YOLO26: which drone detection dataset to train on, which image size to use, when to add SAHI tiled inference, and how to score the model by object size so a good overall mAP doesn't hide missed distant drones.

Illustration, not model output: a city skyline with a tiny quadcopter boxed as drone and two birds boxed as bird

Most "drone detection datasets" answer the wrong question#

People who search for a drone detection dataset usually mean one of two jobs:

  • Detecting drones (anti-UAV or counter-UAV): a ground or air camera looks for a small aircraft against sky, trees or buildings. You need images of drones, ideally with birds and other look-alikes.
  • Detecting from drones: a camera on the drone looks down at people, cars and buildings. VisDrone is the standard benchmark for this. It has 8,629 aerial images in 10 classes, from pedestrian to bus, and no drone class.

VisDrone still helps anti-UAV teams, because its objects are tiny and crowded. That makes it a good public dataset for testing small-object settings such as image size and slicing before your own data is ready. For aerial applications themselves, see our overview of computer vision in drone operations. The rest of this post covers the first job: detecting drones.

Choose a dataset for your camera and viewpoint#

The right public dataset depends on whether your camera sits on the ground or in the air, whether it records visible light or thermal infrared, and how far away your object fly:

DatasetImagerySizeBest for
Drone-vs-BirdRGB video, 720 x 576 to 3840 x 216077 annotated training sequencesGround cameras, drones with birds in the scene
DUT Anti-UAVRGB images, 240 x 160 to 5616 x 374410,000 images (5,200 train / 2,600 validation / 2,200 test), plus 20 tracking videosA first visible-light baseline
Det-FlyRGB, 3840 x 216013,271 imagesAir-to-air views of a DJI Mavic
Anti-UAVPaired RGB and thermal video318 video pairsDay and night tracking with both modalities
Anti-UAV410Thermal infrared video410 videos (200 train / 90 validation / 120 test)Thermal detection and tracking
LRDDv34K RGB and 640 x 512 IR, with range labels102,532 RGB images; 29,630 paired IR imagesRange-aware evaluation of distant drones

The Drone-vs-Bird count refers to the 77-sequence training set distributed for the challenge's 2021 and ICASSP 2023 editions, whose resolutions the SynDroneVision survey reports. That survey also covers Det-Fly and Anti-UAV, and the LRDDv3 paper describes its own dataset. Licenses and access terms differ between datasets, so check them before any commercial use.

Train on several datasets, and keep one aside for testing#

A model that does well on the dataset it trained on can still struggle on another. The LRDDv3 authors trained Ultralytics YOLO11m models on different datasets and tested each one on Det-Fly. The model trained on Drone-vs-Bird reached 0.484 mAP50 there, and the one trained on DUT Anti-UAV reached 0.431.

So combine two or three sources that match your camera and range, and convert them all to the YOLO detection format. Then remap class IDs consistently, complete missing bird annotations, and split by flight or video before extracting frames or tiles. Splitting by frame lets near-identical frames from one flight land in both train and test, which inflates scores. Keep one complete dataset, or footage from your own site, out of training as a test set, and include bird-only and empty-sky footage so you can measure false alarms.

Label birds as well as drones#

Birds are a common source of false alarms in vision-based drone detection. Drone-vs-Bird contains birds as distractors but doesn't label them as a class, so a two-class dataset needs those boxes added. A 2025 small-drone study trained YOLO11m on drone and bird classes and ignored the bird predictions at inference. In that experiment, the two-class model detected drones slightly better than a drone-only model.

Public data gets you a baseline, and your own footage gets you to production. Ultralytics Platform annotation lets you label drone and bird boxes on frames from your own cameras, and synthetic data can add rare backgrounds and angles. The first-place AVSS 2021 Drone-vs-Bird solution used an Ultralytics YOLOv5 detector fine-tuned on real plus synthetic images, with a Kalman-filter tracker that boosted confidence on faint, distant drones.

Image size decides whether the drone survives resizing#

YOLO26 resizes each image so its longest side matches imgsz, which is 640 by default. A drone with almost no pixels left after resizing gives any detector little to work with. Raising imgsz is the first fix, and the training docs and fine-tuning guide both recommend imgsz=1280 for datasets with small objects.

The cost grows roughly with pixel count, so 1280 needs about four times the compute of 640. For scale, the YOLO26 docs list YOLO26n at 1.7 ms and YOLO26s at 2.5 ms on an NVIDIA T4, with TensorRT 10, batch 1 and nms=False, at 640 pixels on COCO val2017. Those are not drone or 1280-pixel measurements, so time your own configuration.

Illustration, not model output: the same sky frame resized to 640, where the drone is a blurred smudge, beside a full-resolution crop showing it in a drone box

A useful starting rule comes from the Ultralytics Academy latency lesson: a size is worth trying if your smallest important object still spans about 10 pixels at it. When the budget is tight, compare a smaller model at higher resolution with a larger model at lower resolution on the same drone validation set, and keep whichever finds more small drones at your latency target.

YOLO26 keeps tiny objects in candidate selection#

At a sufficient image size, the model still has to learn from tiny boxes. YOLO26's Small-Target-Aware Label Assignment (STAL) helps here. In v8.4.199's standard P3 to P5 YOLO26 models, STAL expands candidate-selection box sides below 16 pixels to 16 pixels while preserving the original regression targets, so tiny drones are less likely to be left without candidate anchors.

For the smallest objects you can also change the architecture. YOLO26 ships a yolo26-p2.yaml variant that adds a stride-4 output level to the feature pyramid on top of P3 to P5. At 640 x 640 input, it raises YOLO26n's unfused compute from 6.1 to 9.5 GFLOPs. P2 is released as a YAML architecture without pretrained P2 weights, so you build it with YOLO("yolo26n-p2.yaml") and train it on your data.

SAHI tiled inference keeps 4K frames at full detail#

Even at 1280 pixels, a 4K frame loses two thirds of its width before the model sees it. SAHI (Slicing Aided Hyper Inference) integrates with Ultralytics YOLO26 to avoid that loss. It cuts the frame into overlapping slices, runs the model on each slice, and merges the boxes back onto the full image, so a drone split across neighboring slices counts once. The SAHI paper describes the method and its slicing-aided fine-tuning variant.

Illustration, not model output: a 4K skyline frame divided into eight overlapping slices, one highlighted with a small drone box

Set slice size and model input size separately, then test the resulting drone scale on held-out footage. A model trained on full 4K frames resized to 1280 learned drones three times smaller than they appear in native-resolution 1280-pixel slices. If that scale gap hurts results, try fine-tuning on crops cut from your full-resolution training frames, as the SAHI paper does, and compare it against the full-frame model on the same test set. Start with 20% overlap between neighboring slices and check slice-edge misses.

The workload is predictable. At 1280 x 1280 with 0.2 overlap, a 3840 x 2160 frame takes four columns and two rows, so eight forward passes instead of one, as long as you turn off SAHI's extra full-image prediction. That suits recorded footage, alarm review and powerful edge GPUs. For a camera that needs every frame at full rate, slice only the sky region, or run periodic sliced scans or trigger them from another sensor such as radar.

Score your detector by size and by class#

Overall mean average precision (mAP) averages class AP. In this two-class dataset, bird performance can hide weak drone detection, and within the drone class a strong overall score can hide poor recall in the smallest size bins. Break the score down by class and by size before you trust it.

Validation with save_json=True adds small-, medium- and large-object AP for detection datasets, computed with faster-coco-eval on COCO's bins: under 32 x 32 pixels of box area, up to 96 x 96, and larger. Those numbers cover both classes together. The SynDroneVision survey reports that most annotated drones in Drone-vs-Bird are smaller than 32 x 32, so watch drone-only AP_small and recall.

To get them, evaluate predictions.json against matching ground-truth annotations, using box area in original-image pixels. Ultralytics writes boxes in original-image coordinates, uses the image file stem as the image ID, and numbers custom classes from 1, so drone is category 1 and bird is category 2 here. Convert your test labels to a COCO-format JSON with the same image IDs and category IDs, then restrict the evaluation to catIds=[1].

COCO's small bin is coarse for long-range work, because a 12-pixel drone and a 30 x 30 drone share it. Define finer area ranges the same way, such as under 64 pixels of area (8 x 8), 64 to 256 (16 x 16) and 256 to 1,024 (32 x 32), and read drone AP and recall for each. If your labels carry range, as LRDDv3's do, report recall by distance too. Put precision next to it, with a separate count of drone predictions on bird-only and empty-sky frames.

Illustration, not model output: drones at different distances, each boxed and color-coded into tiny, small and medium size groups

Two habits keep the numbers honest:

  • Validate at the deployment size. A model trained at 1280 and validated at 640 sees drones at half their trained size, so its scores drop for reasons unrelated to the model.
  • Read mAP50-95 with care. A 2-pixel shift on a 10-pixel box costs a large share of IoU, so strict thresholds punish tiny targets. Track recall for missed drones and AP50 for correctly classified detections meeting IoU 0.5.

Train, slice and evaluate a YOLO26 drone detector#

These steps take you from a merged drone and bird dataset to a comparison of full-image and sliced inference on the same held-out test set.

  1. Install the packages with pip install -U ultralytics sahi.

  2. Write a dataset YAML with birds as a second class and a held-out test split:

path: datasets/drones
train: images/train
val: images/val
test: images/test
names:
  0: drone
  1: bird
  1. Train at 1280 from pretrained weights. batch=-1 lets AutoBatch choose a batch size that uses about 60% of GPU memory:
from ultralytics import YOLO

model = YOLO("yolo26s.pt")
model.train(data="drones.yaml", epochs=100, imgsz=1280, batch=-1, name="drone_1280")
  1. Score the full-image baseline on the test split at the same resolution. This writes predictions.json in the run folder:
best = YOLO("runs/detect/drone_1280/weights/best.pt")
metrics = best.val(data="drones.yaml", split="test", imgsz=1280, save_json=True)
  1. Export sliced predictions for the same test images in original-image coordinates, with SAHI's extra full-image pass turned off:
import json
from pathlib import Path

from sahi import AutoDetectionModel
from sahi.predict import get_sliced_prediction

detector = AutoDetectionModel.from_pretrained(
    model_type="ultralytics",
    model_path="runs/detect/drone_1280/weights/best.pt",
    confidence_threshold=0.001,
    image_size=1280,
    device="cuda:0",
)
preds = []
for img in sorted(Path("datasets/drones/images/test").glob("*.jpg")):
    result = get_sliced_prediction(
        str(img),
        detector,
        slice_height=1280,
        slice_width=1280,
        overlap_height_ratio=0.2,
        overlap_width_ratio=0.2,
        perform_standard_pred=False,
    )
    image_id = int(img.stem) if img.stem.isnumeric() else img.stem
    for p in result.to_coco_predictions(image_id=image_id):
        p["category_id"] += 1  # match the 1-based IDs in predictions.json
        preds.append(p)
Path("sahi_predictions.json").write_text(json.dumps(preds))
  1. Evaluate both prediction files against the same ground truth, drone class only:
from faster_coco_eval import COCO, COCOeval_faster

gt = COCO("test_coco.json")  # your test labels in COCO format
for name in ["runs/detect/val/predictions.json", "sahi_predictions.json"]:
    ev = COCOeval_faster(gt, gt.loadRes(name), "bbox")
    ev.params.catIds = [1]  # drone
    ev.evaluate()
    ev.accumulate()
    ev.summarize()

Compare drone AP by size, drone predictions on bird-only and empty-sky frames, and end-to-end latency per frame on the deployment hardware. Keep slicing only if its gain on small drones is worth its extra passes.

  1. Track across frames as a separate, full-image example: best.track(source="perimeter.mp4", imgsz=1280, tracker="bytetrack.yaml") uses track mode and doesn't consume the SAHI predictions above. ByteTrack can reactivate a lost track when a later detection matches it before the track expires.

  2. Export for the edge. For an NVIDIA Jetson at the camera, export to TensorRT with best.export(format="engine", imgsz=1280, half=True) and follow the Jetson guide. Measure latency on the device at your deployment resolution.

If your GPU can't handle 1280-pixel training, the same dataset and arguments run on cloud training in Ultralytics Platform.

Who should build a drone detector this way#

This workflow fits teams protecting a fixed site, such as an airport perimeter, a prison, a stadium or critical infrastructure, with RGB or thermal cameras watching the sky. It also fits integrators who add vision to radar or RF sensors in security deployments. In both cases, the camera has to recognize a drone at distances where it covers only a few dozen pixels.

Start with DUT Anti-UAV and Drone-vs-Bird for a baseline, add bird labels and your own footage, train YOLO26 at 1280, and judge every change by drone-only AP_small, recall and bird false alarms. Add SAHI when frames are 4K or larger and your sliced evaluation shows a gain on small drones. For the wider problem, see our guide to small object detection and the small-object mAP checklist.

Frequently asked questions

  • It depends on your camera and viewpoint. DUT Anti-UAV, with 10,000 RGB images, is a practical first visible-light baseline. Drone-vs-Bird adds ground-camera video with birds in the scene, Det-Fly covers air-to-air views at 3840 x 2160, Anti-UAV410 covers thermal infrared, and LRDDv3 adds range labels. Train on more than one and hold one out for testing.

  • No. VisDrone contains images taken from drones, labeled with 10 classes such as pedestrian, car and bus, and it has no drone class. It's useful for testing small-object settings like image size and SAHI slicing, but to detect drones you need an anti-UAV dataset such as DUT Anti-UAV or Drone-vs-Bird.

  • Try imgsz=1280 if your drones would drop below about 10 pixels at the default 640. YOLO26 resizes the longest side of each image to imgsz, so a larger value keeps more of each drone's pixels, at roughly four times the compute of 640. Validate and deploy at the size you trained at.

  • Yes. SAHI loads YOLO26 weights through AutoDetectionModel.from_pretrained(model_type="ultralytics", image_size=1280, ...) and runs the model on overlapping slices before merging the boxes. With perform_standard_pred=False, a 3840 x 2160 frame cut into 1280-pixel slices at 0.2 overlap takes eight forward passes. Evaluate the sliced output against the full-image baseline on the same test set.

  • Run validation with save_json=True on a detection dataset to get small-, medium- and large-object AP for all classes together. For drone-only results, evaluate the saved predictions.json against COCO-format ground truth with matching image and category IDs, restrict the evaluation to the drone category, and use box areas in original-image pixels for any finer bins.

  • Yes, as a labeled class and as part of your false-alarm test. Birds are a common source of false alarms, and in a 2025 YOLO11m experiment, a drone and bird model detected drones slightly better than a drone-only model. Drone-vs-Bird doesn't label its birds, so add those boxes yourself, and ignore bird predictions at inference if you only need drone alerts.

Written by

Jing Qiu
JI
Jing Qiu

Senior Machine Learning Engineer · Ultralytics

Jing Qiu is a Senior Machine Learning Engineer at Ultralytics, focused on improving the performance, scalability, and real-world applicability of state-of-the-art computer vision models. His work spans model architecture, training optimization, and deployment, helping ensure Ultralytics YOLO delivers industry-leading accuracy and efficiency for developers and enterprises worldwide.

Comments

Ask a question, share your results, or help someone else.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning