How rapidonot/wafer-defect-classifier works
This repository builds a multi-label wafer-bin-map defect classifier and provides a Streamlit image-upload demo. The user workflow is upload an image, convert it to the model’s categorical input, run ResNet-18 inference, then view confidence scores and thresholded defect labels. Separate workflows prepare datasets, train ResNet-18 or Vanilla CNN models with BCE or focal loss, and benchmark predictions. The tree and excerpts support these major capabilities, but do not establish that training produces the dashboard’s bundled weights or that the evaluation model path exists.
Main entry points: split_data.py Dataset preparation · app.py Streamlit interface · modeltraining.py Model training · model_utils.py Wafer classifier
Components 16
Classifier demo
- Streamlit interface
dashboard/app.py - Image conversion
dashboard/app.py - Wafer classifier
dashboard/model_utils.py - ResNet weights
dashboard/resnet18_bce.pth - Scores and chart
dashboard/app.py
Data and training
- WM-811k source
- MixedWM38 source
- Dataset preparation
code /split_data.py - Training split
code /dataset_70_TRAIN.npz - Validation split
code /dataset_15_VAL.npz - Model training
code /modeltraining.py - Training checkpoints
code /modeltraining.py
Model evaluation
- Test split
code /dataset_15_TEST.npz - Benchmark evaluation
code /benchmarking.py - Metrics and plots
code /benchmarking.py
Other components
- Image uploader
Connections 16
- Image uploader → Streamlit interface: uploads image
- Streamlit interface → Image conversion: converts image
- Streamlit interface → Wafer classifier: calls predict
- Wafer classifier → ResNet weights: loads weights
- Wafer classifier → Scores and chart: returns scores
- Streamlit interface → Scores and chart: thresholds and charts
- WM-811k source → Dataset preparation: loads dataset
- MixedWM38 source → Dataset preparation: loads dataset
- Dataset preparation → Training split: writes split
- Dataset preparation → Validation split: writes split
- Dataset preparation → Test split: writes split
- Model training → Training split: loads training data
- Model training → Validation split: loads validation data
- Model training → Training checkpoints: saves best checkpoint
- Benchmark evaluation → Test split: loads test data
- Benchmark evaluation → Metrics and plots: reports metrics