Ultralytics YOLO27:
License YOLO
Back to Ultralytics Glossary

Active Learning

Active learning lets a model choose which unlabeled samples people label next, reaching a target accuracy with fewer labels. Query strategies and code.

Active learning is a machine learning approach in which the model chooses which unlabeled examples a person should label next. Instead of labeling a random sample of the data, a team trains a model on a small labeled set, uses it to score a large pool of unlabeled examples, sends the most informative ones to annotators, retrains on the enlarged set, and repeats. The person who supplies labels is called the oracle. The goal is to reach a target accuracy with as few labels as possible, which matters most when labeling needs experts, such as radiologists reading scans, or when the pool is far too large to label in full, such as the video an autonomous vehicle fleet records every day.

How the Active Learning Loop Works#

Computer vision projects usually run pool-based active learning, where a fixed collection of unlabeled images waits to be scored. Each round has four steps:

  1. Train: Fit a model, such as an object detection model, on the labeled examples collected so far.
  2. Score: Run the model over the unlabeled pool and give each example an informativeness score.
  3. Query: Send the top-scoring batch to annotators for data labeling.
  4. Update: Add the new labels to the training data and retrain.

The loop ends when the labeling budget runs out or accuracy on a fixed validation set stops improving. Comparing each round against a model trained on the same number of randomly chosen labels shows whether the selection is helping.

Query Strategies#

The query strategy decides what counts as informative:

  • Uncertainty sampling: Picks the examples the model is least sure about, measured by the lowest top-class confidence, the smallest margin between the top two classes, or the highest entropy of the predicted class distribution.
  • Query by committee: Trains several models and picks the examples they disagree on most. Monte Carlo dropout gives a cheap committee from a single network.
  • Diversity sampling: Picks examples that cover the embedding space, so a batch does not fill up with near-duplicates such as consecutive video frames. The core-set approach frames batch selection this way after finding that many uncertainty heuristics were not effective for CNNs in the batch setting.
  • Hybrid strategies: Combine both signals. BADGE picks examples that are both uncertain and diverse in a gradient embedding space without hand-tuned weights.

Detectors produce many boxes per image, so their box scores have to be combined into one score per image, for example by averaging the confidence of every detection. The script below ranks a small pool by mean detection confidence with a pretrained YOLO26 model and queries the least confident image first:

from ultralytics import YOLO

# Model trained on the current labeled set
model = YOLO("yolo26n.pt")

# Unlabeled pool, usually thousands of images
pool = ["https://ultralytics.com/images/bus.jpg", "https://ultralytics.com/images/zidane.jpg"]
results = model(pool, conf=0.1)

# Least-confidence sampling: score each image by its mean detection confidence
scores = {}
for image, result in zip(pool, results):
    if len(result.boxes):
        scores[image] = result.boxes.conf.mean().item()

# Query the lowest-scoring images first, within a labeling budget of one image
query = sorted(scores, key=scores.get)[:1]
print(f"Label next: {query}")

The low conf=0.1 threshold keeps weak detections in the score, since those are the boxes the model is unsure about. The Ultralytics Platform annotation editor closes the rest of the loop: its Smart mode loads your own fine-tuned YOLO models, so each retrained model pre-labels the next queried batch for annotators to correct.

Practical Pitfalls#

  • Cold start: Uncertainty scores from a model trained on a few dozen examples are unreliable, so the first rounds often use random or diversity-based selection.
  • Redundant batches: Picking the k most uncertain images independently tends to return clusters of near-identical images, which is the problem diversity and hybrid strategies address.
  • Sampling bias: The labeled set drifts away from the real data distribution because it over-represents hard cases, so validation and test sets are drawn at random from the full pool to keep their scores unbiased.
  • Outliers: Corrupt, blurry, or out-of-domain images look uncertain to every model and can waste labeling budget unless they are filtered out.
  • Semi-supervised learning: Also uses unlabeled data, but the model assigns pseudo-labels to its own confident predictions instead of asking a person about its uncertain ones. The two are often combined.
  • Curriculum learning: Orders already-labeled examples from easy to hard during training. Active learning decides which examples get labeled at all.
  • Hard negative mining: Picks the labeled negatives that the model gets most wrong and trains on them more. It works on existing labels and adds no new ones.
  • Data flywheel: A production loop in which deployed models surface new data that improves the next model. Active learning is a common selection step inside it.

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

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

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
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
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

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

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
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
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

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

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
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