The Engineering Desk
Engineering, without the noise.

Lean Six SigmaMSA / Gage R&R

Your visual inspectors agree with each other. Are they right?

Attribute agreement analysis measures pass/fail inspection with percent agreement, kappa, miss rate and false alarm rate. A 40-part study with three inspectors shows how a system that passes on kappa can still let 17.5% of bad-part calls through.

A 1950s automated machine for assembling electronic modules, with chain conveyors, feed reels and wire stock
Photo: “ProjectTinkertoy 040” by National Institute of Standards and Technology, Public domain, via Wikimedia Commons

Most inspection in a factory is not done with a micrometer. It is done with eyes. An inspector turns a molded housing under a lamp and decides whether a flow line is a cosmetic defect. A technician looks at a solder joint and calls it good or bad. A receiving clerk checks a painted panel against a sample on the wall. Each of those decisions is a measurement, and like any measurement it has error. The difference is that the result is a category, not a number, so the usual gage R&R study does not apply.

Attribute agreement analysis is the tool for this kind of measurement system. It asks three questions. Does each inspector give the same answer when shown the same part twice? Do different inspectors give the same answer as each other? And do their answers match the truth? This article covers how to design the study, how to calculate percent agreement, kappa, miss rate and false alarm rate, and how to read the results. A full worked example with three inspectors and 40 parts shows every number, and the last sections cover the mistakes that make these studies look better than the inspection really is.

Why pass/fail inspection needs its own study

A variable gage R&R splits the spread of numeric readings into repeatability and reproducibility and compares that spread to the tolerance. A pass/fail decision has no spread to split. Every result is one of two values, so the questions become questions about agreement and about errors of two kinds:

  • A miss (also called an escape, or a type II error from the customer's point of view) is a bad part called good. It ships.
  • A false alarm (a false reject, or a type I error) is a good part called bad. It gets scrapped, reworked or sent to a review board.

These two errors cost very different amounts. A miss on a safety-critical feature can mean a recall. A false alarm costs scrap and inspection time, and it slowly teaches production that inspection is arbitrary. An attribute study measures both rates separately, because a single "accuracy" figure can hide an inspector who never rejects anything behind another who rejects everything.

There is also a quieter reason. Visual standards drift. Two inspectors who trained together five years ago may now draw the line in slightly different places, and nobody notices until a customer complaint lands on the shift that passes more. An attribute study puts a number on that drift.

Designing the study

Most of the value of an attribute study is decided before anyone looks at a part. A poorly designed study will report excellent agreement for an inspection that is failing in production.

Choose the parts

Use 30 to 50 parts. Fewer than 30 gives confidence intervals so wide that the results mean little (see the section on small samples below). Aim for a roughly even split between good and bad parts, and make sure about half of the parts are borderline: the scratch that is just under the limit, the void that is just over it, the color that is almost a match. Obvious rejects and pristine parts tell you nothing, because everyone gets them right. The study is only as hard as the hardest parts in it.

Pull the parts from real production and from the scrap bin, not from a drawer of "training samples" that inspectors have seen many times.

Establish the reference standard

Each part needs a known correct answer. This is the reference standard, and it should be set by the most expert judgment available: a quality engineer and the customer's representative agreeing together, a measurement with a better instrument (a microscope, a profilometer, a colorimeter), or a destructive test of a sample. If the reference cannot be agreed on for a part, that part is a finding in itself: the specification is unclear, and the study has already done useful work.

Without a reference standard, you can still measure whether inspectors agree with themselves and each other, but you cannot measure misses or false alarms. Three inspectors can agree perfectly and all be wrong.

Choose the appraisers and trials

Use the people who actually do the inspection, usually 2 or 3 appraisers, across shifts if the inspection runs on several shifts. Each appraiser inspects every part 2 or 3 times. Two trials is the minimum to measure repeatability; three gives a better estimate and shows whether one inconsistency was a fluke.

Run it blind and randomized

  • Label parts with codes that do not reveal their reference answer or their position in the study.
  • Present the parts in a different random order for each appraiser and each trial.
  • Separate the trials in time (hours, or a day) so appraisers cannot recall their first answer.
  • Do not let appraisers see each other's answers or talk about the parts during the study.
  • Use the same lighting, magnification, fixtures and time per part as in production.

The last point matters more than it seems. An inspector who gets 90 seconds per part in a quiet lab will outperform the same inspector who gets 8 seconds per part at the end of a line. The study should measure the second situation.

The four measures of agreement

An attribute study reports agreement at four levels. Each one is a count of parts, not of individual ratings.

MeasureA part counts as agreeing whenWhat it tells you
Within appraiserOne appraiser gives the same answer on every trialRepeatability: is each person consistent?
Each appraiser vs. standardOne appraiser's answers on every trial match the referenceAccuracy of each person
Between appraisersAll appraisers give the same answer on all trialsReproducibility: do people agree with each other?
All appraisers vs. standardEvery answer from every appraiser matches the referenceAccuracy of the inspection system as a whole

Each is reported as a percentage of parts:

Percent agreement=Number of parts in agreementNumber of parts inspected×100.\text{Percent agreement} = \frac{\text{Number of parts in agreement}}{\text{Number of parts inspected}} \times 100.

Each level is stricter than the one before it, so the percentages normally fall as you go down the table. The all-versus-standard figure is usually the lowest, because one slip by any appraiser on any trial removes that part from the count.

Miss rate and false alarm rate

Percent agreement counts parts. Miss and false alarm rates count individual decisions, and they are split by what the part really is:

Miss rate=Bad-part ratings called goodTotal ratings of bad parts,False alarm rate=Good-part ratings called badTotal ratings of good parts.\text{Miss rate} = \frac{\text{Bad-part ratings called good}}{\text{Total ratings of bad parts}}, \qquad \text{False alarm rate} = \frac{\text{Good-part ratings called bad}}{\text{Total ratings of good parts}}.

The denominator for each appraiser is the number of bad (or good) parts times the number of trials. Splitting the rates this way shows the direction of an appraiser's bias. Someone with a high miss rate is too lenient. Someone with a high false alarm rate is too strict. Both can have the same overall percent agreement.

Many automotive suppliers use the guidelines from the AIAG Measurement Systems Analysis manual as a starting point: effectiveness (agreement with the standard) of at least 90%, a miss rate of 2% or less, and a false alarm rate of 5% or less for an acceptable system. Those are guidelines, not laws. A cosmetic inspection on a low-cost part may tolerate more; a crack inspection on a pressure vessel weld should demand much less.

Kappa: agreement beyond chance

Percent agreement has a weakness: some agreement happens by luck. If 95% of parts are good and an inspector passes everything without looking, they will agree with the standard 95% of the time. Kappa corrects for this. It compares observed agreement with the agreement you would expect by chance, given how often each answer is used:

κ=Po−Pe1−Pe,\kappa = \frac{P_o - P_e}{1 - P_e},

where PoP_o is the observed proportion of agreement and PeP_e is the proportion expected by chance. For a pass/fail rating compared with a standard (Cohen's kappa),

Pe=ppass,A ppass,S+pfail,A pfail,S,P_e = p_{\text{pass,A}}\, p_{\text{pass,S}} + p_{\text{fail,A}}\, p_{\text{fail,S}},

with ppass,Ap_{\text{pass,A}} the share of the appraiser's ratings that are "pass" and ppass,Sp_{\text{pass,S}} the share of the standard that is "pass."

When several raters or trials rate the same parts, Fleiss' kappa does the same job. For each part ii rated mm times, with nin_i "pass" ratings, the agreement on that part is

Pi=ni(ni−1)+(m−ni)(m−ni−1)m(m−1),P_i = \frac{n_i(n_i - 1) + (m - n_i)(m - n_i - 1)}{m(m - 1)},

which is the share of all pairs of ratings on that part that agree. PoP_o is the average of PiP_i over all parts, and Pe=pˉ2+(1−pˉ)2P_e = \bar{p}^2 + (1 - \bar{p})^2, where pˉ\bar{p} is the overall share of "pass" ratings.

Kappa runs from 1 (perfect agreement) through 0 (no better than chance) to negative values (systematic disagreement). The common rules of thumb for inspection are:

  • κ≥0.9\kappa \ge 0.9: excellent agreement.
  • 0.75≤κ<0.90.75 \le \kappa < 0.9: good agreement, usually acceptable.
  • κ<0.75\kappa < 0.75: the inspection needs work; below about 0.4 it is close to guessing.

The chance correction matters most when the parts are unbalanced. Suppose 90% of the study parts are good, an appraiser passes 90% of them, and agrees with the standard 95% of the time. Chance agreement is 0.9×0.9+0.1×0.1=0.820.9 \times 0.9 + 0.1 \times 0.1 = 0.82, so

κ=0.95−0.821−0.82=0.130.18≈0.72.\kappa = \frac{0.95 - 0.82}{1 - 0.82} = \frac{0.13}{0.18} \approx 0.72.

A 95% agreement rate that sounds excellent turns out to be below the 0.75 line. This is one more reason to build the study with a roughly even split of good and bad parts.

A worked example: cosmetic inspection of molded covers

A plant inspects injection molded covers for sink marks, flow lines and scratches. Customer complaints about cosmetic defects have risen, and the quality engineer runs an attribute study before changing anything else.

The study uses 40 parts. A quality engineer and the customer's quality representative agree on the reference: 20 good (parts 1 to 20) and 20 bad (parts 21 to 40), with about half of each group borderline. Three inspectors, A, B and C, each inspect all 40 parts twice, a day apart, in random order, under the production lamp with the production time per part.

The results come back with these departures from the standard; every other rating matched the reference:

  • Inspector A failed good part 7 on the second trial and passed bad part 33 on the first trial.
  • Inspector B passed bad parts 24, 29 and 36 on both trials, failed good part 12 on the second trial, and passed bad part 31 on the first trial.
  • Inspector C failed good parts 3, 9 and 17 on both trials, failed good part 14 on the first trial, passed bad part 22 on the second trial, and passed bad part 38 on the first trial.

Within-appraiser agreement

A part counts when both of an inspector's trials give the same answer. Inspector A was inconsistent on parts 7 and 33, so A agrees with themself on 38 of 40 parts, or 95.0%. Inspector B was inconsistent on parts 12 and 31; the three consistent misses still count as consistent, so B also scores 38 of 40, or 95.0%. Inspector C was inconsistent on parts 14, 22 and 38, scoring 37 of 40, or 92.5%.

Note what this hides. Inspector B is very repeatable and repeatably wrong on three parts. Repeatability alone says nothing about accuracy.

Each appraiser against the standard

Now a part counts only when both trials match the reference. Inspector A loses parts 7 and 33 and scores 38 of 40 (95.0%). Inspector B loses parts 24, 29, 36, 12 and 31 and scores 35 of 40 (87.5%). Inspector C loses parts 3, 9, 17, 14, 22 and 38 and scores 34 of 40 (85.0%).

Miss and false alarm rates

Each inspector made 40 ratings of bad parts (20 parts times 2 trials) and 40 ratings of good parts.

  • Inspector A: 1 bad rating called good, so the miss rate is 140=2.5%\frac{1}{40} = 2.5\%; 1 good rating called bad, a false alarm rate of 2.5%.
  • Inspector B: 3 parts missed twice plus 1 missed once is 7 misses, 740=17.5%\frac{7}{40} = 17.5\%; 1 false alarm, 2.5%.
  • Inspector C: 2 misses, 240=5.0%\frac{2}{40} = 5.0\%; 3 parts failed twice plus 1 failed once is 7 false alarms, 17.5%.

B and C have almost the same agreement with the standard but opposite problems. B lets bad parts through. C scraps good ones.

Kappa against the standard

Take Inspector B, using all 80 of B's ratings against the reference. B matched the standard on 72 of 80 ratings (7 misses and 1 false alarm), so Po=0.90P_o = 0.90. B called 46 of 80 ratings "pass" (40 correct passes on good parts minus 1 false alarm, plus 7 misses), a pass share of 0.575. The standard is half pass. Chance agreement is

Pe=0.575×0.5+0.425×0.5=0.5,P_e = 0.575 \times 0.5 + 0.425 \times 0.5 = 0.5,

and

κB=0.90−0.51−0.5=0.80.\kappa_B = \frac{0.90 - 0.5}{1 - 0.5} = 0.80.

Because the study was balanced, PeP_e is 0.5 for every inspector, and the same arithmetic gives κA=0.95\kappa_A = 0.95 (78 of 80 ratings correct, Po=0.975P_o = 0.975) and κC≈0.78\kappa_C \approx 0.78 (71 of 80 correct, Po=0.8875P_o = 0.8875).

Between appraisers and the whole system

For the between-appraiser count, a part agrees only if all six ratings on it (three inspectors, two trials) are the same. Every part named in the lists above breaks that, and they are all different parts: 2 from A, 5 from B and 6 from C, 13 in total. That leaves 27 of 40 parts, or 67.5%, where everyone agreed. In this study every one of those 27 also matched the standard, so all appraisers versus the standard is also 27 of 40, 67.5%.

Fleiss' kappa across all six ratings per part comes to about 0.72. Across all 240 ratings, the system missed 10 of 120 bad-part ratings (8.3%) and raised 9 false alarms on 120 good-part ratings (7.5%).

MeasureInspector AInspector BInspector CAll
Within appraiser95.0%95.0%92.5%n/a
Vs. standard95.0%87.5%85.0%67.5%
Kappa vs. standard0.950.800.780.84 (pooled)
Miss rate2.5%17.5%5.0%8.3%
False alarm rate2.5%2.5%17.5%7.5%
Between appraisers27 of 40 parts67.5%

Reading the result

Every kappa against the standard clears 0.75, and a quick reading might call the system acceptable. The miss and false alarm rates say otherwise. Against the AIAG guidelines of a 2% miss rate and a 5% false alarm rate, Inspector A is close, Inspector B fails badly on misses, and Inspector C fails badly on false alarms. Only two thirds of the parts got a unanimous, correct answer.

The pattern also points to causes. B's three repeated misses (parts 24, 29 and 36) were all fine flow lines near a corner. B was not careless; B had a different idea of where the limit sits for flow lines, and applied it every time. C's three repeated false alarms (parts 3, 9 and 17) were all light scratches on the inside face, which the drawing treats as a non-cosmetic surface. C was rejecting a defect that does not count on that face. Neither is a training problem in the vague sense. Both are specific, fixable misunderstandings of the standard.

The arithmetic behind that comparison is simple. In 1,000 covers with 2% defective, 20 are bad and 980 are good. B misses 20×0.175=3.520 \times 0.175 = 3.5 of the bad ones. C rejects 980×0.175=171.5980 \times 0.175 = 171.5 of the good ones. The same error rate means very different things depending on which side of the decision it falls on, because good parts vastly outnumber bad ones.

Confidence intervals: why 40 parts is not much

Every percentage in an attribute study is an estimate from a small sample, and the uncertainty is large. An exact (Clopper-Pearson) 95% confidence interval for Inspector A's 38 of 40 runs from about 83.1% to 99.4%. For the system's 27 of 40, it runs from about 50.9% to 81.4%.

Even a perfect score is weaker evidence than it looks. The lower 95% confidence bound for a perfect result is about:

  • 88.4% with 30 of 30 parts,
  • 91.2% with 40 of 40 parts,
  • 92.9% with 50 of 50 parts.

So no study of this size can prove an inspector is better than about 90% effective. That is fine for finding problems, which is what attribute studies are best at. It is not fine for claiming a miss rate of a fraction of a percent. If the consequences of a miss are serious, the answer is not a bigger study of human inspection; it is a better detection method (a fixture, a gage, an automated check) or a design change that removes the judgment.

Report the intervals with the results. A table that says 95% with no interval invites a manager to compare it against 93% from last year and conclude something improved.

Common mistakes that flatter the inspection

  • Using easy parts. A study built from obvious good and obvious bad parts will show near-perfect agreement and tell you nothing about the borderline calls where real escapes happen. If your study has no borderline parts, it measured the wrong thing.
  • Appraisers knowing they are being tested. People look harder when they know a study is running. Where you can, mix the study parts into normal work with disguised labels. Where you cannot, at least match production time and conditions.
  • No reference standard. Without one, high agreement between inspectors can mean they share the same wrong idea. You will measure consistency and call it accuracy.
  • Letting appraisers recognize parts. A part with a memorable chip or a handwritten number on it will get the same answer twice because it is remembered, not because the judgment is repeatable. Randomize order, use neutral codes, and space the trials apart.
  • Using too few trials or appraisers. One trial per appraiser gives no repeatability measure at all. One appraiser gives no reproducibility.
  • Reporting only percent agreement. Without kappa, an unbalanced study hides chance agreement. Without miss and false alarm rates, a lenient inspector and a strict one look alike.
  • Running the study once. Inspection standards drift with staff turnover, new defect types and new materials. Repeat the study on a schedule, and after any change to the inspection method.

What to do when the study fails

A failed attribute study is useful. It usually points directly at the fix, if you look at which parts caused the disagreements rather than only at the summary numbers.

Start with the disputed parts

List every part where any appraiser disagreed with the standard and sort them by defect type and location. In the worked example, two clusters explained almost every error. Bring the appraisers together, show them those parts with the reference answers, and ask how they made each call. This conversation often finds the real problem in an hour.

Build boundary samples

For each defect type, create physical boundary samples: a part that is just acceptable and a part that is just rejectable, labeled and kept at the inspection station. A written description such as "no visible flow lines" invites each inspector to set their own limit. A pair of parts that shows the limit does not. Replace boundary samples when they wear, and control them like any other gage.

Write a defect catalog

Photograph each defect type at the limit, with notes on where it matters (which surfaces are cosmetic, which are not), how to view it (angle, distance, magnification) and how long to look. Inspector C's errors in the example came from not knowing which face was cosmetic. A catalog page with a marked-up photo of the part would have prevented them.

Fix the environment

Check the light level and color at the inspection point, glare, background color and the viewing angle. Many cosmetic standards specify illumination in lux and a viewing distance; measure them rather than assuming. Check how much time inspectors really get per part at production rate. Fatigue, poor light and rushed takt times cause misses that no amount of retraining will cure.

Reduce the judgment

If a defect can be measured, measure it: a depth gage for sink marks, a go/no-go pin for hole size, a template overlay for location. Each judgment that becomes a measurement moves out of the attribute study and into a variable one, where the tools are stronger. For high-risk features, consider automated vision or a process change that prevents the defect.

Then run the study again

After the fixes, repeat the study with a fresh set of parts, or at least a fresh random order and new codes so the appraisers cannot remember the first round. Compare the miss and false alarm rates with their confidence intervals, not just the headline percentages, and keep the before and after results with the inspection procedure as evidence that the measurement system is under control.

Putting it into practice

A first attribute study on a single inspection station takes about a day of setup and a few hours of inspection time spread over two days. The steps are:

  1. Collect 30 to 50 real parts, about half good and half bad, with about half of them borderline.
  2. Set the reference answer for each part with expert agreement or a better measurement, and record it away from the study area.
  3. Code the parts, randomize the order for each appraiser and trial, and run at least two trials per appraiser under production conditions.
  4. Calculate within-appraiser, appraiser-versus-standard, between-appraiser and all-versus-standard agreement, with confidence intervals.
  5. Calculate kappa, miss rate and false alarm rate for each appraiser and for the system.
  6. Review every disputed part, find the clusters, and fix the standard, the samples, the catalog or the environment.
  7. Repeat the study to confirm the fix, then schedule the next one.

Visual inspection will never be as repeatable as a good gage. But it can be far better than most plants assume, and the only way to know where yours stands is to test it with parts that are hard to judge.

More in MSA / Gage R&R