Ultralytics YOLO27:
License YOLO
Back to Ultralytics Glossary

Training Data

Training data is the set of examples a model learns its weights from. How it differs from validation and test data, and why label quality rivals volume.

Training data is the set of examples a machine learning model learns from. During training, an optimizer repeatedly adjusts the model's weights to reduce its error on these examples, so these examples define what the model can learn. In supervised learning, each example pairs an input with its correct answer, such as a street photo with a bounding box and class name for every car and pedestrian. Self-supervised and unsupervised learning train on raw inputs without labels. Training set is a synonym, and in most projects it is the largest split of the available data, often 70 to 80 percent of it.

How Models Use Training Data#

A model sees its training data in batches. For each batch it makes predictions, a loss function measures how far they are from the labels, backpropagation computes how each weight contributed to the error, and the optimizer nudges the weights to shrink it. One full pass over the training set is an epoch, and training usually runs for tens to hundreds of epochs.

Because the model is optimized on these exact examples, its score on them overstates how well it will do on new data. Two held-out splits correct for that. Validation data is scored during development to choose hyperparameters and checkpoints, and test data is scored once at the end to estimate real-world performance. A large gap between training and validation scores signals overfitting, where the model memorizes training examples instead of learning patterns that generalize. Poor scores on both signal underfitting. The splits must not share images: near-duplicate frames from one video or scans from one patient on both sides of the split cause data leakage and inflate every held-out score.

Quantity, Quality, and Coverage#

Three properties of a training set decide how well a model can generalize:

  • Quantity: More examples help, with diminishing returns. Starting from a pretrained model through transfer learning cuts the number of labeled examples a new task needs.
  • Quality: Every wrong, missing, or inconsistently drawn label teaches the model something false. Consistent data labeling guidelines matter as much as the label count.
  • Coverage: The examples must span the conditions the model will face, such as lighting, weather, camera angles, backgrounds, and rare classes. A detector trained only on daytime images fails at night, and when gaps follow demographic lines, such as skin tones missing from a face dataset, they become dataset bias.

The scikit-learn script below trains the same classifier on the bundled handwritten digits dataset with different training sets and scores each model on one fixed test split:

import numpy as np
from sklearn.datasets import load_digits
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split

# 1,797 labeled 8x8 digit images; hold out 30% to score every model
X, y = load_digits(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0, stratify=y)

# Reassign 30% of the training labels at random to simulate careless labeling
rng = np.random.default_rng(0)
y_noisy = y_train.copy()
flip = rng.random(len(y_train)) < 0.3
y_noisy[flip] = rng.integers(0, 10, flip.sum())

# Train the same model on three different training sets
for name, n, labels in [("50 clean", 50, y_train), ("1,257 clean", 1257, y_train), ("1,257 noisy", 1257, y_noisy)]:
    model = LogisticRegression(max_iter=5000).fit(X_train[:n], labels[:n])
    print(f"{name}: test accuracy {model.score(X_test, y_test):.3f}")

Growing the clean training set from 50 to 1,257 images raises test accuracy from 0.863 to 0.961. The noisy run, in which 315 of the 1,257 labels (25%) end up wrong, scores 0.861, no better than the model trained on 50 clean images.

Building a Training Set#

Teams assemble training data from public datasets, their own cameras and logs, and increasingly synthetic data. Public benchmarks give a strong starting point: the COCO dataset provides 118,287 training images labeled for detection, segmentation, and captioning. Raw collections then go through data cleaning to remove duplicates, corrupt files, and off-target images, followed by labeling and review. Data augmentation multiplies the variety of the result during training with flips, crops, color shifts, and mosaics, but it can only recombine what was collected, so a missing condition still has to be photographed.

Ultralytics YOLO reads training data from the train path of a dataset YAML file and pairs each image with a .txt label file that holds one row per object: a class index followed by the box center, width, and height, normalized to the image size. The same YOLO dataset format serves every split, so rebalancing splits means moving images and their label files between folders.

from ultralytics import YOLO

# Load a pretrained YOLO26 nano model
model = YOLO("yolo26n.pt")

# coco8.yaml lists the training images (train: images/train) and validation images (val: images/val)
results = model.train(data="coco8.yaml", epochs=5)

The YOLO26 model fine-tunes on the four training images of COCO8, a tiny sample used to check that a training pipeline runs end to end.

  • Validation data: A held-out split that guides decisions during development, such as when to stop training. The model never updates its weights on it.
  • Test data: A held-out split scored once at the end, so its result is an unbiased estimate of performance on new data.
  • Ground truth: The correct answers attached to examples. Training data includes ground truth in supervised learning, but every split needs it for scoring.
  • Golden dataset: A small, expert-checked set used as a trusted reference for evaluation and labeler quality checks.
  • Benchmark dataset: A public dataset with fixed splits used to compare models. Its training split often doubles as pretraining data, and its held-out split becomes the scoreboard, as with the 5,000-image COCO val2017 split on which many detection papers report mAP.

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