An automated defect classification system for semiconductor wafer maps using Convolutional Neural Networks (CNN) to identify and categorize spatial defect patterns.
This project develops an Automated Defect Classification system using Convolutional Neural Networks (CNN) to automatically categorize spatial defect patterns on semiconductor wafer maps. The system aims to:
- Replace manual inspection processes
- Reduce human error in defect classification
- Accelerate identification of process anomalies
- Enable faster Root Cause Analysis (RCA)
In semiconductor manufacturing, wafer map patterns provide critical insights into fabrication process health. This automated system delivers:
Rapid identification of defect clusters (e.g., Scratch, Edge-Ring) enables process engineers to perform Root Cause Analysis faster.
Automating classification reduces the "man-to-machine" ratio and minimizes misclassification risks due to operator fatigue.
Detecting systematic patterns vs. random defects helps pinpoint specific faulty process steps, such as:
- Etching uniformity issues
- CMP (Chemical Mechanical Planarization) handling errors
- Equipment-specific failures
Source: WM811K Wafer Map Dataset
- Scale: 811,000+ wafer maps
- Format: 2D images with pixel values representing die status
0: Background1: Good Die2: Defective Die
- Classes: 9 categories
- 8 defect patterns: Center, Donut, Edge-Loc, Edge-Ring, Loc, Random, Scratch, Near-full
- 1 normal class: None
- Challenge: Natural class imbalance (common in manufacturing data)
Please be aware that the original dataset (WM-811K) contains a typo in the column header:
trianTestLabelis used instead oftrainTestLabel. To maintain compatibility with the raw data, this project uses the original spelling (trianTestLabel) throughout the codebase.
The dataset exhibits significant class imbalance, with Edge-Ring and Edge-Loc being the most common defect types.
- Python 3.11+
- pip package manager
- Clone the repository
git clone https://github.com/NUSSETO/Semiconductor_Project.git
cd Semiconductor_Project- Create virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Download dataset
- Download the WM811K dataset from Kaggle
- Place
LSWMD.pklin the project root directory
- Analyze class distribution
- Visualize spatial defect patterns
- Understand data characteristics
- Resize wafer maps to standardized dimensions (64Ć64 and 96x96 for comparative analysis)
- Apply denoising techniques
- Handle class imbalance
Design and train CNN tailored for spatial pattern recognition:
- Convolutional layers for feature extraction
- MaxPooling for dimensionality reduction
- Dense layers for classification
- Dropout for regularization
- Monitor training/validation metrics
- Optimize hyperparameters
- Implement data augmentation
Investigate model performance through confusion matrices:
| Metric | Value |
|---|---|
| Overall Accuracy | ~78% |
| Macro Recall | ~79% |
| Training Time | ~28 minutes |
| Model Size | ~19 MB |
Sequential Model: āāā Input (96 x 96 x 3) āāā Conv2D (32 filters, 5Ć5) āāā MaxPooling2D (2Ć2) āāā Conv2D (64 filters, 3Ć3) āāā MaxPooling2D (2Ć2) āāā Conv2D (128 filters, 3Ć3) āāā MaxPooling2D (2Ć2) āāā Conv2D (256 filters, 3Ć3) āāā MaxPooling2D (2Ć2) āāā Flatten āāā Dense (128 units) āāā Dropout (0.5) āāā Dense (8 units, softmax)
Key Features:
- Input shape: 96Ć96Ć3
- Activation: ReLU for hidden layers, Softmax for output
- Optimizer: Adam
- Loss function: Categorical Crossentropy
- Note on Input Size: While the exploratory phase and initial training (as seen in
main.ipynb) experimented with 64x64 resolution for efficiency, the final deployed model architecture has been optimized for 96x96 resolution to capture finer details of defect patterns.
- Start Jupyter Notebook
jupyter notebook
-
Open
main.ipynb -
Run all cells or execute step-by-step:
# Load the trained model from tensorflow.keras.models import load_model # Option 1: Load the modern Keras format (Recommended) model = load_model('model/wafer_defect_model.keras') # Option 2: Load the legacy H5 format # model = load_model('model/wafer_defect_model.h5') # Predict on new wafer map prediction = model.predict(preprocessed_wafer_map) defect_class = np.argmax(prediction)
Semiconductor_Project/
āāā main.ipynb # Main analysis notebook
āāā main.html # For easy access
āāā LICENSE # MIT License
āāā requirements.txt # Python dependencies
āāā .gitignore # Git ignore rules
āāā README.md # This file
āāā img/ # Visualization images
ā āāā Defect_distribution.png
ā āāā Defect_size.png
ā āāā Resize_example.png
ā āāā Training_history.png
ā āāā Original_CM.png
ā āāā Second_CM.png
ā āāā Final_CM.png
āāā model/
ā āāā wafer_defect_model.h5
ā āāā wafer_defect_model.keras
āāā data/
āāā LSWMD.pkl # Dataset (not tracked in git)
- Dataset: WM811K Wafer Map Dataset
- Inspired by semiconductor manufacturing quality control practices
- Built with TensorFlow/Keras/Antigravity/Gemini
This project is open-source and available under the MIT License.
Author: Jason Huang
Focus: Semiconductor Manufacturing Quality Control, Machine Learning, Data Analysis