Plan a pilot box
Menu

Quality control sample size calculator

How many images to check from each batch so that the defect rate you measure means something.

Calculator

Fictional example values are filled in. Replace them with your own; results update as you type. Nothing you enter leaves your browser.

From your pilot. If you have no idea, use 50.

Results

z for the confidence level
1.960
Sample size at your expected rate
71 images
Share of the lot
3.5%
Sample size if the rate is unknown (50%)
323 images

Uses the normal approximation with a finite population correction: n₀ = z²p(1 − p) ÷ e², then n = n₀ ÷ (1 + (n₀ − 1) ÷ N). Draw the sample at random across the whole lot, not from the first box.

Checking every image in a batch by eye is thorough and slow. Checking a few is fast, but it only tells you something if the sample is large enough and drawn fairly. The calculator above gives the number of images to inspect from a batch, called the lot, to estimate its defect rate within a margin you choose.

The formula in plain words

The calculator uses Cochran’s sample size formula for a proportion, in two steps.

  1. Sample size for a very large lot: n₀ = z² × p × (1 − p) ÷ e². Here z comes from the confidence level (1.960 for 95 percent), p is the expected defect rate and e is the margin of error, both written as decimals.
  2. Finite population correction: n = n₀ ÷ (1 + (n₀ − 1) ÷ N), where N is the number of images in the lot. The result is rounded up and never exceeds the lot.

The term p × (1 − p) is largest when p is 50 percent, so the last row of results shows the most cautious sample size, for when you have no idea of the rate. Section508.gov, which uses the same formula for sampling web pages, recommends p = 0.5 when the rate is unknown as the “most conservative assumption”.

Before you inspect anything, write down what counts as a defect: cropped edges, soft focus, glare, a missing page, a wrong file name, a color target out of tolerance. The image QC checklist is a starting list.

Draw the sample at random across the whole lot

  • Number the images from 1 to N in file order, have a spreadsheet generate the required count of random numbers, and inspect those images.
  • Spread the sample across the whole lot. Defects cluster by day, station, operator and type of material, so the first box or the first morning tells you little about the rest.
  • Taking every tenth image from a random starting point is acceptable only if the lot has no repeating pattern. Cabinet cards captured front, back, front, back will give you nothing but backs at any even interval.
  • Draw the sample after the lot is complete, and do not let the person who captured the images choose which ones are checked.

When defects exceed the expected rate

  1. Recalculate. A higher defect rate needs a larger sample for the same margin. Enter the rate you observed, and draw more images at random until you reach the new size.
  2. Look for a pattern. If the defects share a day, a station, a series or a kind of fault, inspect every image in that part of the lot and recapture what fails.
  3. Apply the agreed limit. If the rate is above the acceptance level agreed in writing for the work, the batch goes back: inspect it in full, fix it, then sample it again.
  4. Fix the cause and update the next lot. Use the new rate as the expected rate for the following batches, and log every defect with its file name and the action taken.

Reading the results

The margin of error is in percentage points. With a 5 percent expected rate and a 5-point margin, a sample that finds 5 percent tells you the lot is probably somewhere between 0 and 10 percent. If you need to tell a 2 percent lot from an 8 percent lot, reduce the margin: at 2 points, the same 2,000-image lot needs 372 images.

Limits

  • The normal approximation is rough when few defects are expected in the sample. In the default example, only three or four are, so treat the result as a guide, and ask a statistician for exact figures where a decision carries real cost.
  • This is an estimate of the defect rate, not a formal acceptance sampling plan with set accept and reject numbers.
  • Some checks belong on every file, not a sample. Image counts against the inventory, file names and checksums can be checked by script for the whole batch.

Worked example

Example (fictional). The Aster County Historical Society’s first capture batch holds 2,000 images, the 500 items from the budget calculator example at four images each. Its pilot box showed about 5 percent of images with defects. The society wants 95 percent confidence and a margin of 5 percentage points.

Step Arithmetic Result
z for 95 percent confidence 1.960
Sample for a very large lot 1.960² × 0.05 × 0.95 ÷ 0.05² about 73
Corrected for a 2,000-image lot 73 ÷ (1 + 72 ÷ 2,000) about 70.5, rounded up to 71 images
Share of the lot 71 ÷ 2,000 3.5%
If the rate were unknown (50%) same steps with p = 0.5 323 images

A volunteer numbers the files 1 to 2,000, draws 71 random numbers in a spreadsheet and checks those images against the image QC checklist.

How we work shows where quality control sits between capture and delivery, and document scanning describes how images are checked during capture. The same sampling idea applies to measuring text recognition with the OCR accuracy calculator. For more on capture standards and checking images, see the Reading Room’s capture and imaging section.

Send one box first.

A pilot box shows you the images, the recognized text and the catalog records before you commit a whole collection. Tell us what is in the box and what you want people to find.

See batch quality control on a pilot box

Studio and contacts

24 South Weber Street, Suite 225
Colorado Springs, CO 80903
(719) 244-8450sales@dastok.com