WaferVision is a desktop application for semiconductor wafer defect detection and analysis. It combines classical computer vision techniques with an extensible AI inference pipeline to identify and classify surface defects on silicon wafers.
Based on KIPS Conference Paper: "웨이퍼 엣지 결함 검출 장비 연구개발" (Wafer Edge Defect Detection Equipment R&D) by Kim Sungjin. The edge analysis module implements the paper's 25-segment CNN approach for wafer edge crack detection.
- Real-time Defect Detection — OpenCV-based contour analysis with morphological classification
- 6 Defect Types — Scratch, Particle, Crack, Stain, Edge, Edge Crack
- 🆕 Wafer Edge Analysis — 25-segment angular division for edge crack detection (KIPS paper approach)
- Automatic wafer circle detection (Hough transform)
- Edge ring extraction and angular segmentation
- Per-segment CNN inference via ONNX or OpenCV fallback
- Visual overlay with defective segments highlighted in red
- Synthetic Data Generator — Built-in wafer image generator for demo and testing (including edge cracks)
- Statistical Dashboard — Pie charts and bar charts powered by LiveCharts2
- ONNX Runtime Ready — Extensible for custom ML model inference
- Dark Industrial Theme — Professional UI designed for manufacturing environments
Based on the KIPS conference paper, the edge analysis divides the wafer into 25 angular segments (14.4° each) and analyzes each independently:
Architecture per segment (from paper):
Input: Grayscale image (segment-specific size, e.g., 500×195)
Conv2d(1→32) → BN → ReLU → Conv2d(32→64) → BN → ReLU → MaxPool → Dropout
Conv2d(64→128) → BN → ReLU → Conv2d(128→256) → BN → ReLU → MaxPool → Dropout
Flatten → FC → Sigmoid (binary: crack / no-crack)
The application supports:
- ONNX models — Place
edge_model_1.onnxthroughedge_model_25.onnxin theModels/directory - OpenCV fallback — Canny edge detection + dark pixel analysis when no ONNX model is available
- .NET 8 SDK
- Windows 10/11 (WPF requirement)
git clone <repository-url>
cd wafer-defect-detector
dotnet restore
dotnet build
dotnet run --project WaferVision- Launch the application
- Surface defects: Click 🔬 Image Viewer → ▶ Generate Sample for surface defect detection
- Edge cracks: Click ⬡ Edge Analysis → ▶ Generate Edge Sample for 25-segment edge analysis
- Switch to 📊 Statistics for defect distribution charts
WaferVision/
├── Models/ # Data models (DefectType, DefectResult, WaferImage, EdgeSegmentResult, EdgeAnalysisResult)
├── Services/ # Business logic
│ ├── ImageService.cs # Image I/O and preprocessing
│ ├── DetectionService.cs # Surface defect detection (OpenCV)
│ ├── SyntheticDataGenerator.cs # Synthetic wafer generation
│ └── WaferEdgeAnalyzer.cs # 🆕 25-segment edge crack analysis
├── ViewModels/ # MVVM ViewModels
│ ├── MainViewModel.cs
│ ├── ImageViewerViewModel.cs
│ ├── EdgeAnalysisViewModel.cs # 🆕 Edge analysis view model
│ └── StatisticsViewModel.cs
├── Views/ # WPF Views
│ ├── MainWindow.xaml
│ ├── ImageViewerView.xaml
│ ├── EdgeAnalysisView.xaml # 🆕 Edge analysis view
│ └── StatisticsView.xaml
├── Themes/ # Dark theme resource dictionary
└── Converters/ # WPF value converters
Surface Defects:
- Preprocessing — Grayscale → Gaussian blur → Binary threshold
- Segmentation — Contour detection with circular wafer mask
- Classification — Shape-based feature analysis
- Confidence Scoring — Heuristic confidence
Edge Cracks (KIPS Paper):
- Circle Detection — Hough transform to find wafer boundary
- Edge Extraction — Ring mask (outer 8% of radius)
- Angular Segmentation — 25 equal segments (14.4° each)
- Per-Segment Analysis — ONNX CNN or OpenCV fallback
- Visualization — Color-coded overlay on wafer image
| Component | Technology |
|---|---|
| Framework | .NET 8, C# 12 |
| UI | WPF |
| MVVM | CommunityToolkit.Mvvm |
| Computer Vision | OpenCvSharp4 |
| AI Inference | Microsoft.ML.OnnxRuntime |
| Charts | LiveCharts2 (SkiaSharp) |
| DI | Microsoft.Extensions.DependencyInjection |
- Kim Sungjin, "웨이퍼 엣지 결함 검출 장비 연구개발", KIPS Conference Paper
- PyTorch reference implementation: 25 independent CNN models for binary edge crack classification
MIT License — see LICENSE for details.