Tool

Enter the validation results

Recall = TP ÷ (TP + FN)

Run the AI on items whose true status is known and enter the four counts. The calculator gives recall, specificity, precision, accuracy, and kappa with exact 95% intervals, shows what the results mean at your real defect rate, and compares the tool with a baseline such as your human inspectors. Load the example to see an AI inspection assist tested on 400 parts.

The AI tool: counts on the test set

Real conditions (optional)

Baseline for comparison (optional): same parts, scored by the current method

Everything runs in your browser. Nothing is sent to a server, and entries are not saved between visits. The example is made-up data. The intervals are exact (Clopper-Pearson) 95% intervals and assume the test items were chosen independently.

Results

How good is the tool?

Recall (defects caught)
--
Specificity (good passed)
--
Precision in the test set
--
Accuracy
--
Kappa
--
Defect share in the test set
--
Enter the four counts to see the results.

Picture

Measures with 95% intervals

Intervals

At your real defect rate

Enter the items per month and the real defect rate to see escapes, false alarms, and cost.

Instructions

How to use this calculator

  1. Build a test set whose true status is agreed by independent experts, with enough defects and every defect type, and run the tool on it blind.
  2. Enter the four counts. Read recall and specificity with their intervals, not just the percentages.
  3. Enter your real volume and defect rate. Precision falls when defects are rare, and the table shows how many flags would be false.
  4. Enter the cost of an escape and of a false alarm to see the monthly cost, and a baseline such as your inspectors to compare.
  5. Set a target recall to see how many defects a validation needs if none are missed.

What This AI Classifier Validation Calculator Does

Any AI tool that sorts items into good and bad, such as an inspection assist, a document checker, or a complaint classifier, is a measurement system. This calculator takes the four counts from a validation test and gives recall (the share of defects it catches), specificity (the share of good items it passes), precision, accuracy, and kappa, with exact 95% intervals, so that you see how uncertain the results are.

It then shows what the results mean at your real defect rate. Because precision falls as defects become rarer, a tool that looks good on a test set rich in defects may raise mostly false alarms on the line. It also works out the monthly cost of escapes and false alarms, compares the tool with a baseline such as your inspectors, and tells you how many defects a validation needs to prove a target recall. It matches the worked example in the AI for Quality and Inspection guide.

The Calculations

OutputCalculationNote
Recall (sensitivity)TP ÷ (TP + FN)Share of defects caught; one minus recall is the escape rate
SpecificityTN ÷ (TN + FP)Share of good items passed; one minus specificity is the false alarm rate
PrecisionTP ÷ (TP + FP)In the test set. Depends on how common defects are
Precision at your defect raterecall × p ÷ (recall × p + (1 − specificity) × (1 − p))p is the real defect rate
Kappa(observed agreement − chance agreement) ÷ (1 − chance agreement)Agreement with the standard beyond chance
95% intervalExact (Clopper-Pearson) binomial intervalWide when there are few defects or few good items
Defects neededln(0.05) ÷ ln(target recall)With no misses, to show recall is at least the target at 95% confidence
Monthly error costdefects × (1 − recall) × cost of an escape + good items × (1 − specificity) × cost of a false alarmUses your volume and defect rate

Worked Example

The pre-loaded example is an AI visual inspection assist tested on 400 parts: 54 true positives, 6 false negatives, 17 false positives, and 323 true negatives. Recall is 90% (95% interval 79.5% to 96.2%), specificity 95%, and kappa 0.79. At 1.5% defective, only 22% of the tool’s flags would be real. Against the human inspectors the AI saves about $2,131 a month, but raises about 493 false alarms.

Limits and Good Practice

AI Classifier Validation Calculator Frequently Asked Questions

What is the difference between recall and precision?

Recall is the share of real defects the tool catches. Precision is the share of its flags that are real defects. A tool can catch most defects and still raise many false alarms, which matters most when defects are rare.

Why does the calculator ask for my real defect rate?

Because precision depends on how common defects are. A validation set usually contains many more defects than production does, so the precision measured in the test overstates the precision you will see on the line. The real defect rate lets the calculator work out how many flags would be false.

What does kappa tell me?

How well the tool agrees with the standard beyond what chance would produce. Values near 1 mean strong agreement; values near 0 mean agreement no better than chance. It is useful alongside recall and specificity, especially for comparing a tool with human inspectors.

How many defects do I need in the test?

To show that recall is at least a target at 95% confidence when the tool misses none, you need ln(0.05) divided by ln(target) defects: 29 for 90%, 59 for 95%, 149 for 98%, and 299 for 99%. If you expect some misses, you need more, or use the exact interval on what you observe.

Is my data stored anywhere?

No. The calculator runs entirely in your browser, nothing is sent to a server, and your entries are not saved when you leave the page.