// project · 79 commits · April to October 2026
Classifies defect patterns on semiconductor wafer maps and flags the uncertain ones for human review.
96.2%of wafers classified without a human
1.9% of those wrong, on production lots the model never saw
Real wafer maps from the public WM-811K dataset. The model runs live in your browser.
No pattern
98.9% sure
✓ no review needed
Donut
99.8% sure
✓ no review needed
Scratch
58.3% sure
⚑ sent to review
Each picture is one real silicon wafer seen from above. Every small square is one chip: blue passed its electrical test, red failed. Where the red chips sit tells an engineer which machine or step went wrong. Pick a wafer, or draw your own, and the model classifies it right here in your browser.
The model loads when you reach this section (about 8 MB the first time, then cached by your browser).
step 1
Each wafer map is resized to 64 by 64 squares with three layers: outside the wafer, chip passed, chip failed.
step 2
A convolutional neural network, a standard image-recognition model, scores nine known failure patterns such as Center, Edge-Ring and Scratch.
step 3
If the top score is below a threshold tuned on separate production lots, the wafer goes to an engineer instead of being classified automatically. This is about trusting the label, not about whether the wafer is good.
step 4
Conformal prediction gives the set of patterns that are still plausible, with a coverage target that holds for rare patterns too, not just on average.
| What | Result | Compared with |
|---|---|---|
| Pattern accuracy on lots the model never saw (macro-F1, every pattern weighted equally) | 0.858 | Random forest 0.717, graph neural network (GraphSAGE) 0.776 |
| Worst-covered pattern: how often the list of plausible patterns contains the true one (target 90%) | 86.2% | 54.5% with plain, one-size-fits-all calibration |
| Wafers classified without a human check | 96.2% | 1.9% of those wrong, against a 2% target |
| Time to classify one wafer on a CPU (ONNX Runtime) | 3.11 ms | 7.07 ms in PyTorch, 2.3 times slower |
| Expert-labelled real wafer maps used | 172,950 | out of 811,457 maps from 46,293 production lots in WM-811K |
results/ folder and serving/calibration.json.Data and split. WM-811K holds 811,457 wafer maps from 46,293 lots, of which 172,950 carry an expert label across 9 classes (85% "none"). Whole lots are assigned to train, validation or test so no lot spans two splits, because labels cluster strongly within a lot (92.7% of defective pairs in a lot share a pattern, against 23.7% by chance). Training caps "none" at 10,000 wafers. Every model is also scored on a random per-wafer split to measure the leakage; for the CNN it is small (0.857 random against 0.858 lot-disjoint).
Model. A 4-block CNN on 64 by 64 one-hot maps (outside, pass, fail), 1.18M parameters, trained with rotation and flip augmentation. Exported to ONNX and checked against PyTorch to within 1e-5. A random forest on radial density features and a GraphSAGE model on a die-level graph were trained as comparisons.
Uncertainty. Class-conditional split conformal prediction, calibrated on 25,903 wafers from 1,612 validation lots and tested on different lots: 89.3% coverage at a 90% target, worst class 86.2% (marginal calibration leaves Loc at 54.5%). The no-review rule (auto-accept in the code) is a selective-risk threshold on top-class confidence (0.688), chosen so the error among automatically classified wafers stays under 2% with 90% confidence; on unseen lots it classified 96.2% without review at 1.9% error. With only 50 calibration lots it accepted nothing, so the guarantee needs many lots.
A hypothesis that failed. A small transformer head that reads a wafer's lot neighbours was tested against a no-neighbour head and a random-other-lot control, at four label budgets. Real neighbours (0.877 ± 0.010 macro-F1, 3 seeds) did not beat the no-neighbour head (0.879 ± 0.002). Reported as a negative result.
This demo. The exact ONNX file FabEye serves (sha256 49d5a88c…) runs in onnxruntime-web on WebAssembly, single-threaded. Preprocessing (OpenCV nearest-neighbour resize, one-hot encoding), softmax, the review rule and the conformal sets are ported to TypeScript, and the thresholds are FabEye's calibration.json unchanged. A parity test runs 86 test-lot wafers through the browser pipeline and FabEye's Python pipeline: same class, verdict and prediction set for every wafer, probabilities within 7e-7.
Also in the repo. A FastAPI service with batch prediction, API-key auth, JSON request logs and Prometheus metrics, packaged as a Docker image. WaferLens calls it for every sorted wafer in its simulated fab.
Limits. Single seed for the model comparison. Rare classes are small (24 Near-full and 87 Donut test wafers). WM-811K has no timestamps, so no time-ordered split was possible. Guarantees assume new lots resemble the calibration lots.