Meet YOLO26: next-gen vision AI.
Ultralytics
Back to Ultralytics Glossary

Conformal Prediction

Discover how conformal prediction provides distribution-free uncertainty for AI. Implement prediction sets with Ultralytics YOLO26 to ensure reliable model results.

Conformal prediction is a statistical framework in machine learning (ML) that provides distribution-free measures of uncertainty for model predictions. Instead of outputting a single point prediction—such as one specific class label—a conformal predictor outputs a prediction set or interval that contains the true value with a user-specified probability (e.g., 90% or 95%). This framework wraps around any artificial intelligence (AI) model to provide formal statistical guarantees without requiring changes to the model's architecture. For an exhaustive list of up-to-date tools and research, you can explore the Awesome Conformal Prediction repository.

Link to this sectionHow Conformal Prediction Works#

The fundamental mechanism relies on evaluating how unusual a new prediction is compared to past examples using a nonconformity score.

  • Model Training: First, train a baseline model using a standard training dataset.
  • Calibration Phase: Pass a separate, held-out calibration dataset through the trained model. Calculate a nonconformity score for each prediction, such as the inverse probability in image classification.
  • Quantile Calculation: Determine the target confidence level (e.g., 95%) and find the corresponding quantile of these calibration scores to construct the prediction sets.
  • Inference Application: During live inference, evaluate new inputs and include all possible labels whose scores fall below the calibration quantile.

You can explore mathematical proofs of this approach in the A Gentle Introduction to Conformal Prediction tutorial or learn about time-series forecasting approaches to handle temporal uncertainties.

It is crucial to distinguish this framework from standard metrics used during model testing:

Link to this sectionReal-World Applications#

Conformal prediction is indispensable in high-stakes fields where knowing the model's blind spots is critical.

  • Medical Diagnostics: When leveraging AI in healthcare to analyze scans, a model might output a set of plausible diagnoses instead of a single, potentially incorrect class. This ensures clinicians investigate all viable possibilities, supporting recent studies on reliable genomic medicine and imaging.
  • Autonomous Driving: In AI in automotive systems, applying prediction intervals to object detection generates a spatial confidence region around a pedestrian, allowing the vehicle's braking systems to account for worst-case movements safely.

Link to this sectionImplementing Prediction Sets#

Libraries like MAPIE (Model Agnostic Prediction Interval Estimator) provide built-in tools for Python, and regression tasks often utilize conformal quantile regression. You can also implement a basic conformal prediction logic using probabilities from advanced models like Ultralytics YOLO26. The following example builds a prediction set using YOLO26 classification probabilities, mimicking the logic of including top classes until a cumulative threshold is met.

from ultralytics import YOLO

# Load an Ultralytics YOLO26 classification model
model = YOLO("yolo26n-cls.pt")

# Perform inference on an image
results = model("https://ultralytics.com/images/bus.jpg")

# Simple conformal-style prediction set logic based on cumulative probability
target_coverage = 0.95
prediction_set = []
cumulative_prob = 0.0

# Sort probabilities in descending order using the results object
probs = results[0].probs
sorted_indices = probs.top5

for idx in sorted_indices:
    class_name = results[0].names[idx]
    class_prob = probs.data[idx].item()

    prediction_set.append((class_name, round(class_prob, 3)))
    cumulative_prob += class_prob

    # Stop adding to the set once we reach the 95% coverage threshold
    if cumulative_prob >= target_coverage:
        break

print(f"95% Prediction Set: {prediction_set}")

Developing reliable systems requires robust data practices to prevent data drift from ruining calibration. Tools like the Ultralytics Platform simplify the process of gathering fresh classification datasets, retraining models, and securely managing model deployment. You can read more about curating balanced data in our guide on understanding dataset bias, or track the latest advancements presented at the annual COPA conference.

Explore solutions

Real-time defect detection with Ultralytics YOLO

Defect Detection

YOLO-based vision AI detects defects in steel, PCBs, fabric, solar panels, and welds, with peer-reviewed accuracy up to 99.4% and up to 94.5% lower inspection cost.
Learn more
Real-time AI that works with your team

AI 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
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI 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
Real-time AI tailored to your operation

AI 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
Real-time defect detection with Ultralytics YOLO

Defect Detection

YOLO-based vision AI detects defects in steel, PCBs, fabric, solar panels, and welds, with peer-reviewed accuracy up to 99.4% and up to 94.5% lower inspection cost.
Learn more
Real-time AI that works with your team

AI 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
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI 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
Real-time AI tailored to your operation

AI 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
Real-time defect detection with Ultralytics YOLO

Defect Detection

YOLO-based vision AI detects defects in steel, PCBs, fabric, solar panels, and welds, with peer-reviewed accuracy up to 99.4% and up to 94.5% lower inspection cost.
Learn more
Real-time AI that works with your team

AI 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
Real-time AI that works with your team

AI in Logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Real-time AI that works with your team

AI in Retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Real-time AI that works with your team

AI in Healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Real-time AI that works with your team

AI in Manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Real-time AI that works with your operation

AI 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
Real-time AI tailored to your operation

AI 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