Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wafer Map Defect Pattern Classification

以深度學習(CNN / Transfer Learning)對半導體晶圓圖進行瑕疵模式多分類, 並將分類結果串接 Power BI 製作製程瑕疵趨勢儀表板。

資料集

WM-811K — 811,457 張真實晶圓測試圖,其中約 172,950 張具人工標註,共 9 類瑕疵模式:

Label Pattern 常見物理成因
0 Center CMP 研磨壓力不均
1 Donut 薄膜沉積溫度分佈異常
2 Edge-Loc 邊緣局部製程異常
3 Edge-Ring 蝕刻/清洗邊緣效應
4 Loc 局部性缺陷
5 Random 隨機微粒污染
6 Scratch 機械搬運刮傷
7 Near-full 大面積失效
8 None 無特定模式

專案結構

├── data/               # 資料集(不進版控)
├── notebooks/          # EDA 探索性分析
├── src/
│   ├── preprocess.py   # 資料清理與影像前處理
│   ├── train.py        # CNN 模型訓練
│   └── export.py       # 預測結果輸出 → Power BI
├── models/             # 訓練完成的模型
└── output/             # 儀表板用資料

環境

python -m venv .venv
.venv\Scripts\pip install -r requirements.txt

執行順序

python src/explore_data.py    # EDA:類別分佈、尺寸統計
python src/plot_examples.py   # 9 類瑕疵範例圖
python src/preprocess.py      # resize 64x64、分層切分、npz 快取
python src/train.py           # CNN 訓練與評估
python src/plot_confusion.py  # 混淆矩陣熱圖
python src/export.py          # 預測結果 CSV → Power BI

Baseline 成果(簡單 CNN,11 萬參數,CPU 訓練)

測試集 34,590 筆,整體 accuracy 90.3%(macro-F1 0.712):

類別 Precision Recall F1 支持數
Edge-Ring 0.948 0.974 0.961 1,936
none 0.996 0.912 0.952 29,486
Near-full 0.853 0.967 0.906 30
Center 0.861 0.779 0.818 859
Random 0.732 0.884 0.801 173
Edge-Loc 0.509 0.870 0.642 1,038
Donut 0.471 0.883 0.614 111
Loc 0.444 0.586 0.505 718
Scratch 0.120 0.828 0.209 239

關鍵發現(混淆矩陣見 output/confusion_matrix.png):

  • 類別權重策略成功拉高了所有少數類的 recall(Near-full 96.7%、Donut 88.3%), 代價是 precision 下降——模型「寧可錯報、不願漏報」。
  • 最大誤判源:1,293 筆 none 被誤判為 Scratch(Scratch precision 僅 0.12)。 細刮痕與健康晶圓的零星壞點在 64×64 解析度下難以區分。
  • 製造業情境下高 recall 低 precision 通常是可接受的取捨: 漏掉真實瑕疵(流出成本)遠貴於誤報(複檢成本)。

改進方向

  • Transfer Learning(ResNet50V2)比較 baseline
  • 對 none 類欠採樣 + 提高輸入解析度(128×128)改善 Scratch 辨識
  • 63.8 萬張未標註圖做半監督學習

Power BI 串接

powerbi/WaferDefectDashboard.pbip 是可直接開啟的 Power BI 專案 (PBIP + TMDL 格式):語意模型已預先連接 output/predictions_for_powerbi.csv,並內建 9 個 DAX 量值 (Defect Rate、Model Accuracy、Low Confidence Count 等)。

  • 開啟方式:Power BI Desktop 開啟 WaferDefectDashboard.pbip
  • CSV 路徑以參數 CsvPath 管理,換機器時只需改參數
  • 三頁儀表板設計規劃見 powerbi/dashboard_design.md

About

CNN-based wafer map defect pattern classification on WM-811K, with Power BI dashboard integration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages