Skip to content

sjsr-0401/wafer-vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WaferVision — Wafer Defect Detection Desktop Application

.NET 8 WPF OpenCV License

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.

Features

  • 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

25-Segment Edge Crack Detection

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:

  1. ONNX models — Place edge_model_1.onnx through edge_model_25.onnx in the Models/ directory
  2. OpenCV fallback — Canny edge detection + dark pixel analysis when no ONNX model is available

Getting Started

Prerequisites

Build & Run

git clone <repository-url>
cd wafer-defect-detector
dotnet restore
dotnet build
dotnet run --project WaferVision

Quick Demo

  1. Launch the application
  2. Surface defects: Click 🔬 Image Viewer▶ Generate Sample for surface defect detection
  3. Edge cracks: Click ⬡ Edge Analysis▶ Generate Edge Sample for 25-segment edge analysis
  4. Switch to 📊 Statistics for defect distribution charts

Architecture

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

Detection Pipeline

Surface Defects:

  1. Preprocessing — Grayscale → Gaussian blur → Binary threshold
  2. Segmentation — Contour detection with circular wafer mask
  3. Classification — Shape-based feature analysis
  4. Confidence Scoring — Heuristic confidence

Edge Cracks (KIPS Paper):

  1. Circle Detection — Hough transform to find wafer boundary
  2. Edge Extraction — Ring mask (outer 8% of radius)
  3. Angular Segmentation — 25 equal segments (14.4° each)
  4. Per-Segment Analysis — ONNX CNN or OpenCV fallback
  5. Visualization — Color-coded overlay on wafer image

Tech Stack

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

References

  • Kim Sungjin, "웨이퍼 엣지 결함 검출 장비 연구개발", KIPS Conference Paper
  • PyTorch reference implementation: 25 independent CNN models for binary edge crack classification

License

MIT License — see LICENSE for details.

About

Wafer edge defect detection system - C#/.NET 8/WPF/OpenCvSharp/ONNX with synthetic data and real-time visualization

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages