Conformal Prediction
Conformal prediction이 어떻게 AI에 대해 분포 자유(distribution-free) 불확실성을 제공하는지 알아보십시오. 신뢰할 수 있는 모델 결과를 보장하기 위해 Ultralytics YOLO26와 함께 예측 세트를 구현하십시오.
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 section등각 예측의 작동 원리#
기본 메커니즘은 비적합성 점수(nonconformity score)를 사용하여 새로운 예측이 과거 예제와 비교하여 얼마나 특이한지를 평가하는 것에 의존합니다.
- 모델 학습: 우선 표준 학습 데이터셋을 사용하여 베이스라인 모델을 학습합니다.
- 보정 단계: 별도로 분리된 보정 데이터셋을 학습된 모델에 통과시킵니다. 이미지 분류에서의 역확률과 같이 각 예측에 대한 비적합성 점수를 계산합니다.
- 분위수 계산: 목표 신뢰 수준(예: 95%)을 결정하고, 해당 보정 점수의 분위수를 찾아 예측 세트를 구성합니다.
- 추론 적용: 실시간 추론 중에 새로운 입력을 평가하고, 점수가 보정 분위수보다 낮은 모든 가능한 레이블을 포함합니다.
이 접근 방식에 대한 수학적 증명은 A Gentle Introduction to Conformal Prediction 튜토리얼에서 탐색하거나, 시간적 불확실성을 처리하기 위한 시계열 예측 접근 방식에 대해 알아볼 수 있습니다.
Link to this section등각 예측과 관련 용어의 차이점#
이 프레임워크를 모델 테스트 중에 사용되는 표준 지표와 구분하는 것이 중요합니다.
- 등각 예측 vs. 신뢰 점수: 표준 신뢰 점수는 모델의 내부 확실성을 반영하지만, 종종 보정이 제대로 이루어지지 않고 수학적 보장이 부족합니다. 등각 예측은 이러한 원시 점수를 보장된 세트로 변환합니다. 기존 조정 방식에 대해서는 scikit-learn의 확률 보정을 참조하십시오.
- 등각 예측 vs. 정확도: 정확도는 전체 데이터셋에 걸쳐 모델이 얼마나 자주 정확한지를 설명하는 전역적 역사 지표인 반면, 등각 추론(conformal inference)은 모든 새로운 개별 예측에 대해 로컬하고 인스턴스별 구간을 제공합니다.
Link to this section실제 애플리케이션 사례#
등각 예측은 모델의 맹점을 아는 것이 중요한 고위험 분야에서 필수적입니다.
- 의료 진단: 헬스케어 분야에서 AI를 활용하여 스캔을 분석할 때, 모델은 잠재적으로 잘못될 수 있는 단일 클래스 대신 타당한 진단 세트를 출력할 수 있습니다. 이는 임상의가 모든 실행 가능한 가능성을 조사하도록 보장하며, 신뢰할 수 있는 유전체 의학 및 이미징에 관한 최근 연구를 뒷받침합니다.
- 자율 주행: 자동차 시스템의 AI에서 예측 구간을 객체 탐지에 적용하면 보행자 주위에 공간적 신뢰 영역이 생성되어, 차량 제동 시스템이 최악의 상황 움직임까지 안전하게 고려할 수 있게 합니다.
Link to this section예측 세트 구현#
MAPIE (Model Agnostic Prediction Interval Estimator)와 같은 라이브러리는 Python용 내장 도구를 제공하며, 회귀 작업은 종종 등각 분위수 회귀(conformal quantile regression)를 활용합니다. Ultralytics YOLO26과 같은 고급 모델의 확률을 사용하여 기본적인 등각 예측 로직을 구현할 수도 있습니다. 다음 예제는 YOLO26 분류 확률을 사용하여 누적 임계값에 도달할 때까지 상위 클래스를 포함하는 로직을 모방하여 예측 세트를 구성합니다.
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.






