Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

Confidence

A confidence score is a model's 0-to-1 estimate that a prediction is correct. How detectors compute it, how thresholds work, and why calibration matters.

A confidence score is the number between 0 and 1 that a model attaches to a prediction to express how likely that prediction is to be correct. Classifiers attach one to each class label, and object detection models attach one to each bounding box, where it answers a narrower question: how likely is it that this box contains an object of this class? Applications use confidence to decide which predictions to keep, in what order to rank them, and which ones to send to a person for review.

How Models Produce Confidence#

Confidence comes from the network's final layer. A single-label classifier passes its raw outputs, called logits, through softmax, which makes the class scores sum to 1, and reports the top value. Detectors usually apply a sigmoid to each class independently, so one box can score high for two related classes and the scores need not sum to 1. Detectors with a separate objectness output, such as YOLOv5, multiplied it by the class probability. Many anchor-free detectors, including recent YOLO models, drop objectness and use the highest class score as the box's confidence.

Confidence Thresholds#

A confidence threshold turns scores into decisions: predictions above it are kept and the rest are discarded. Raising the threshold removes false positives and raises precision. Lowering it recovers faint, small, or partly hidden objects and raises recall, at the cost of more false alarms. The threshold where the F1-score curve peaks balances the two. YOLO26 keeps boxes scoring above 0.25 at prediction time by default, and validation lowers the threshold to 0.001 so that its precision-recall curves cover nearly every possible operating point.

from ultralytics import YOLO

# Load a pretrained YOLO26 nano detector
model = YOLO("yolo26n.pt")
image = "https://ultralytics.com/images/bus.jpg"

# Run the same image at a low and a high confidence threshold
for threshold in (0.1, 0.6):
    results = model(image, conf=threshold)
    scores = results[0].boxes.conf.tolist()
    print(f"conf={threshold}: {len(scores)} boxes, scores {[round(s, 2) for s in scores]}")

The 0.1 run returns every box from the 0.6 run plus any weaker candidates, so raising the threshold only ever removes detections, starting with the least certain.

Using Confidence in Applications#

Many systems use two thresholds. Predictions below a low bar are discarded, predictions above a high bar trigger automatic action, and the band in between goes to a person, a second model, or another sensor. A medical screening tool can flag high-confidence findings at once and queue uncertain ones for a radiologist, and an active learning loop sends the uncertain band to annotators, a strategy called uncertainty sampling.

Confidence and Calibration#

A score of 0.9 is a usable probability only if the model is calibrated, meaning that among all predictions scored 0.9, about 90% are correct. Modern deep networks tend to be overconfident, with scores that run above their real hit rate. Temperature scaling corrects much of this by dividing the logits by one constant fitted on held-out data, and scikit-learn's calibration tools fit Platt (sigmoid) or isotonic mappings and plot reliability curves. Calibration matters whenever a score is read as a probability, such as a risk cutoff. Ranking metrics such as mean average precision (mAP) depend only on the order of the scores.

  • Accuracy: a dataset-level rate of correct predictions. In a calibrated model, average confidence equals accuracy.
  • Statistical confidence intervals: a separate idea that shares the name. A 95% confidence level describes how often an interval-building procedure captures a true value across repeated samples.
  • Conformal prediction: turns raw scores into prediction sets with a coverage guarantee, so that for a 90% target the set contains the true label at least 90% of the time on exchangeable data.

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