◉CLAUDE LABJP
●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…
Articles/API & SDK
⬡ API & SDK/2026-07-10Advanced

Don't Trust the Confidence Score: Per-Class Calibration and Abstain Routing for Vision Classification

Overall accuracy looked fine while individual categories quietly collapsed. Here is how I calibrated Claude Vision's self-reported confidence per class and routed abstentions to a human queue.

Claude API128Vision4ClassificationEvaluationIndie Dev23

✦ Premium Article

I was staring at a spreadsheet of classification results when I stopped scrolling. Overall agreement read 92.3%. But when I filtered down to the "animal" category alone, it was 71% — and the model had returned confidence values around 0.9 on most of that wrong 29%.

Confidently wrong. That turned out to be the worst failure mode of all.

For the wallpaper app I run as an indie developer, newly added images are sorted into 30 categories by Claude Vision. I wrote about the initial setup in automating wallpaper category classification with the Claude Vision API. What emerged after months of actually running it was this pattern: the aggregate looks healthy while a handful of classes rot underneath.

This article is the cleanup. It covers calibrating confidence per class and routing everything below the line into a human review queue.

"Confidence: 0.9" Is Not a Probability

Let's get the premise straight. When you ask for structured output containing confidence: 0.92, that number is not a probability. It is a plausible-looking number the model generated as text.

NameWhat it actually isUsable as a probability?
Self-reported confidenceA number the model wrote as a stringNot as-is
Logprob-derived probabilityToken generation probabilityApproximately, after calibration
Calibrated scoreMapped to empirical accuracy on a validation setYes

That does not make it useless. Self-reported confidence is usually meaningful as an ordering. A prediction at 0.95 is more likely correct than one at 0.65. What fails is the reading "0.9 means 90% correct."

So trust only the ordering, and measure from a validation set where the line has to be drawn to hit your precision target. That is what calibration means in practice.

Is 400 Images Enough?

I relabeled 412 images by hand. The eight most frequent of the 30 categories account for just over half of them; tail categories like "retro" and "minimal" have only five to nine each.

Which raised an honest question: can a threshold learned from six images mean anything?

My answer is that it can, but you have to change how you pick it. For thin classes, fine-grained optimization just overfits the validation set. So I split the classes into two tiers by support.

TierValidation imagesHow the threshold is chosenCategories
Thick20 or moreSearched individually11
ThinFewer than 20Share one conservative threshold (0.93)19

Thin classes are poor candidates for auto-acceptance anyway. Give them a conservative shared line and send the rest to a human. That is enough.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Self-reported confidence used with a single global threshold silently breaks your smallest classes
✦How to search for the lowest threshold that still meets a precision target, per class, with working code
✦Routing abstentions into a prioritized human queue, and catching calibration drift week over week
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ API & SDK2026-09-17
I Send Images Twenty at a Time — The Day the 21st Image Changed the Rules for the Other 61
Sending 62 images in one request failed with invalid_request_error. The cause was the image count, not the payload size. Here is how I recounted visual tokens as 28px patches and built batches that respect count, dimensions, and payload at once.
⬡ API & SDK2026-05-15
Automating Wallpaper Classification with Claude Vision API — Accuracy, Cost, and a Batch Job That Survives Interruptions
A firsthand account of automating wallpaper category classification with the Claude Vision API. Honest numbers on accuracy and cost, plus the batch design that stopped me re-paying for the same images.
⬡ API & SDK2026-04-26
Building a Hard-to-Cancel Micro-SaaS with the Claude API — Six Implementation Patterns to Stabilize $1,000/Month
Hitting $1,000/month with a Claude-powered micro-SaaS is one challenge. Holding it for three months running is a much harder one. Here are six implementation patterns — with working Stripe and Cloudflare Workers code — that took my churn from above 10% to under 5%.