Skip to content

Detect defects in semiconductor materials based on infrared microscope images. Uses deep-learning-based machine vision algorithms.

License

Notifications You must be signed in to change notification settings

vpyykkonen/DefectDetection

Repository files navigation

DefectDetection

Detect defects in semiconductor materials based on infrared microscope images. By default, a bounding box is put around the found defect together with a label and likeness score.

Detected deffects

The program uses the YOLOv8 algorithm by Ultralytics. A pre-annotated dataset for training is given in test_examples.zip in the readily proper format for the YOLOv8 algorithm. The corresponding training configuration file is training_config.yaml. A custom dataset can also be annotated and used following the instructions below.

Installation

By Anaconda:

  1. Create an environment conda create -n defect_detection python=3.11.9 (PyTorch supports Python up to 3.11).
  2. Activate the environment conda activate defect_detection.
  3. Install PyTorch following the instructions at https://pytorch.org/get-started/locally/.
  4. Install Ultralytics by conda install conda-forge::ultralytics.

If you are using a system with GPU with CUDA, install PyTorch with the appropriate options.

Training the detection algorithm

Annotating a custom dataset for training

There are many tools for annotating image data but a good choice is LabelImg. This software is assumed in the instructions below.

  1. Download LabelImg and install it following the instructions.
  2. Follow the Steps (YOLO) instructions on the LabelImg GitHub page to annotate your image.
  3. Split the images into a train and a validation set and put them into their respective folders.
  4. Write a configuration file for the set following the example in training_config.yaml.

Train

  1. (Optional, if no custom dataset) Extract training data from training_data.zip.
  2. Set the paths to point to the train data in training_config.yaml.
  3. If using CPU for training, put device=CPU in the options model.train in the notebook train_yolo.ipynb. To use GPU put device=0 or e.g. device=[0,1] if multiple GPUs are available.
  4. Activate the environment conda activate defect_detection
  5. Run the train_yolo.ipynb Jupyter notebook in the environment to train the model.

Usage

  1. Make an output folder for the labeled images.
  2. Activate the environment conda activate defect_detection.
  3. Modify and run the Jupyter notebook predict_yolo.ipynb in the Anaconda environment to detect defects in images.

About

Detect defects in semiconductor materials based on infrared microscope images. Uses deep-learning-based machine vision algorithms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages