ansonantony_
  • Home
  • Projects
  • Blog
  • CV
  • Guestbook
  • Newsletter
  • Contact

// stay updated

new posts and project updates, by email

© 2026 Anson Antony

githubinstagramcoffeerss

built with next.js + supabase · privacy

← all projects

// project · 79 commits · April to October 2026

FabEye

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

Try the demo ↓View code on GitHub ↗

●Real wafer maps from the public WM-811K dataset. The model runs live in your browser.

  • Python
  • PyTorch
  • CNN
  • Conformal prediction
  • ONNX
  • No pattern

    98.9% sure

    ✓ no review needed

  • Donut

    99.8% sure

    ✓ no review needed

  • Scratch

    58.3% sure

    ⚑ sent to review

Three real wafers from production lots the model never saw. Red chips failed, blue passed. The tick means the model's label is trusted without a human check. It does not mean the wafer is good.

01 Live demo

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).

// pick a wafer from production lots the model never saw

Pick a wafer to classify it.

02 How it works

  1. step 1

    Turn the wafer into a small picture

    Each wafer map is resized to 64 by 64 squares with three layers: outside the wafer, chip passed, chip failed.

  2. step 2

    Recognise the pattern

    A convolutional neural network, a standard image-recognition model, scores nine known failure patterns such as Center, Edge-Ring and Scratch.

  3. step 3

    Decide if a human should look

    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.

  4. step 4

    List what else it could be

    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.

03 Summary

WhatResultCompared with
Pattern accuracy on lots the model never saw (macro-F1, every pattern weighted equally)0.858Random 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 check96.2%1.9% of those wrong, against a 2% target
Time to classify one wafer on a CPU (ONNX Runtime)3.11 ms7.07 ms in PyTorch, 2.3 times slower
Expert-labelled real wafer maps used172,950out of 811,457 maps from 46,293 production lots in WM-811K
All figures are from the lot-disjoint test split: whole production lots are kept out of training, so the model is scored on lots it has never seen. Single training seed. Sources: the FabEye repo's results/ folder and serving/calibration.json.
04 Technical details, for engineers›

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.

// other projects

WaferLens →Spots when a chip factory's yield starts dropping and points to the machine that caused it.WaferEdge →Watches wafer results at the machine in real time and stops a bad lot before more wafers are processed.Robot Navigation →Drives a small robot to its goals in simulation, steering around the obstacles its laser scanner sees.