Skip to main content

Silicon wafer image processing with AI-powered ellipse detection

Project description

Silicrop

A PyQt5-based application for silicon wafer image processing, featuring AI-powered ellipse detection and correction.

Overview

Silicrop is designed to process images of silicon wafers by:

  • Detecting wafer boundaries using deep learning (DeepLabV3 segmentation)
  • Fitting ellipses to wafer contours
  • Correcting perspective distortion to produce circular images
  • Detecting and handling "meplat" (flat edge) regions on 150mm wafers
  • Supporting batch processing for multiple images

Features

  • AI-Powered Detection: Uses a DeepLabV3 model with ResNet-18 backbone for wafer segmentation
  • Interactive GUI: PyQt5 interface with drag-and-drop image loading
  • Manual Adjustment: Click to add/move/remove ellipse fitting points
  • Notch Detection: Mark notch regions with 3-point triangles (press 'N' to toggle mode)
  • Batch Processing: Process multiple images in parallel
  • Mask Export: Save segmentation masks for training data

Installation

Requirements

  • Python 3.8+
  • PyQt5
  • PyTorch
  • OpenCV (cv2)
  • NumPy
  • Pillow
  • segmentation-models-pytorch
  • matplotlib
  • scipy
  • joblib
  • psutil

Install

pip install -e .

Or install dependencies directly:

pip install PyQt5 torch torchvision opencv-python numpy pillow segmentation-models-pytorch matplotlib scipy joblib psutil

Usage

Launch the Application

python -m silicrop.main

Or if installed:

silicrop

Basic Workflow

  1. Select a Model: Click "Select a model" to load a trained .pth model file
  2. Load Images: Drag and drop images into the left panel
  3. Select Scale Mode: Choose "<=150" for wafers with flat edges, ">200" for full circular wafers
  4. Process:
    • Single image: Select image and click "Run AI"
    • Batch: Click "Select All" then "Run AI (batch)"
  5. Save Results: Use "Save Image" or "Save Mask" buttons

Keyboard Shortcuts

  • N: Toggle notch drawing mode (for marking notch regions)
  • Ctrl + Drag: Pan the image view
  • Scroll: Zoom in/out

Project Structure

silicrop/
├── __init__.py          # Package version
├── main.py              # Application entry point
├── assets/
│   └── icon.png         # Application icon
├── layout/
│   ├── components.py    # Main GUI (ImageProcessorApp)
│   ├── dragdrop.py      # File drop list widget
│   ├── how_to.py        # Help popup
│   ├── styles.py        # UI stylesheets
│   └── theme.py         # Application theme
└── processing/
    ├── crop.py          # Ellipse fitting (FitAndCrop)
    ├── meplat.py        # Flat edge detection
    ├── prediction.py    # AI model (EllipsePredictor)
    ├── prediction_batch.py  # Batch processing
    ├── rotate.py        # Image rotation (Rotate)
    └── utils.py         # Mouse navigation handler

Key Classes

ImageProcessorApp

Main application window containing:

  • File list with drag-and-drop
  • Original image viewer (FitAndCrop widget)
  • Processed image viewer (Rotate widget)
  • Control buttons for processing and saving

EllipsePredictor

AI inference engine that:

  • Loads DeepLabV3 segmentation model
  • Predicts wafer masks from images
  • Extracts contours and fits ellipses
  • Handles meplat detection for 150mm wafers

FitAndCrop

Interactive widget for:

  • Displaying original images
  • Manual 5-point ellipse fitting
  • Notch region marking (3 points)
  • Perspective transformation to circular output

Rotate

Widget for:

  • Displaying processed (circular) images
  • Interactive rotation by clicking
  • Line-based rotation (150mm mode)
  • Point-to-bottom rotation (200mm mode)

Model Training

The application expects a trained DeepLabV3 model. Training code is available in training/model.py (not used at runtime).

Model Architecture

  • Encoder: ResNet-18 (pretrained on ImageNet)
  • Decoder: DeepLabV3
  • Output: Binary segmentation mask

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

silicrop-1.0.15.tar.gz (59.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silicrop-1.0.15-py3-none-any.whl (59.4 MB view details)

Uploaded Python 3

File details

Details for the file silicrop-1.0.15.tar.gz.

File metadata

  • Download URL: silicrop-1.0.15.tar.gz
  • Upload date:
  • Size: 59.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for silicrop-1.0.15.tar.gz
Algorithm Hash digest
SHA256 19d02ec6c43e0d67a916a0b8ac2012f7773363b834d756a7cf01dd69dd2463dd
MD5 8b1590d6e7baca7d294627fdf8e0515e
BLAKE2b-256 e00b53f82a8ccf5e15ac7b8bff7a6797d4a52969f8c1aa59012064434ad6707c

See more details on using hashes here.

File details

Details for the file silicrop-1.0.15-py3-none-any.whl.

File metadata

  • Download URL: silicrop-1.0.15-py3-none-any.whl
  • Upload date:
  • Size: 59.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for silicrop-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 08106e429cc67a86e7a27bb54ca84d7c79fa733613560835b1b0df2eb5a6e59f
MD5 d1d75f6a820f70d2061c695c0d0470ca
BLAKE2b-256 18799b5269e14f99a757566efc1e544c4433cf8eeff941ea0c9375be098ec9fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page