BAMresearch / automatic-sem-image-segmentation

Workflow for Simulation and Automatic Semantic Segmentation of Electron Microscopy Images
Other
41 stars 10 forks source link
cyclegan deep-learning electron-microscopy neural-networks segmentation sem simulation tem unet

Automatic SEM Image Segmentation

The files and images in this repository accompany the following publication:

B. Ruehle, J. F. Krumrey, V.-D. Hodoroaba, Scientific Reports, Workflow towards Automated Segmentation of Agglomerated, Non-Spherical Particles from Electron Microscopy Images using Artificial Neural Networks, 2020, DOI: 10.1038/s41598-021-84287-6

If you use the files, data, or code in your own work, please cite the above article.

Image

Folder Structure:

How to use:

  1. To train your own network for fully automated segmentation, download the python scripts of the desired version from the Releases folder and place them in a new directory.
  2. Create the following sub directories:
    • Input_Images
    • Input_Masks
  3. Place the SEM images in the Input_Images folder and some exemplary particle outlines (white on a black background, see Archive/Automatic_SEM_Image_Segmentation/Input_Masks for examples) in the Input_Masks directory.
  4. Install the required packages for the version you downloaded by running
     pip install -r requirements.txt

    The requirements are different for the different releases of the workflow. Please also make sure that your python version, as well as the CUDA and cuDNN versions are compatible with the packages from requirements.txt (especially the tensorflow version)

  5. Open the StartProcess.py file and choose the options and parameters you want for training (or skip this step and use the standard options). You probably want to at least set the tile size, and the cycleGAN and UNet batch sizes, though. The tile size should be large enough to fit roughly 100-150 particles (if there are significantly more or less, you might also have to adjust the minimum and maximum number of particles in the simulated masks), and the batch sizes can then usually just be increased until you run out of GPU memory).
  6. Start the process by running python StartProcess.py

Releases:

Examples:

The following images illustrate a few examples of particles consisting of different materials (Au, TiO2, BaSO4, SiO2, FeOx) and imaged with different techniques (SEM, eSEM, TEM), and their segmentation masks that were obtained automatically using the above algorithm (or slight variations thereof). Image

Licenses:

The files of this project are provided under different licenses, please refer also to the license file in the root directory for details. In short, the following licenses are used:

Parts of the code used in this project are based on code published under the following licenses:

  1. Versions 1.0.x
  2. Versions 1.1.x and 1.2.x
    • The Python implementation of the workflow is published under the MIT license.
    • The WGAN implementation used in these versions are based on the work by A. K. Nain published on the Keras website under the Apache License v2.0.
    • The cycleGAN implementation used in these versions are based on the work by A. K. Nain published on Keras website under the Apache License v2.0 and J. Y. Zhu et al. published on GitHub under the BSD license.
    • The MultiRes UNet implementation used in these versions are based on the work by N. Ibtehaz published on GitHub under the MIT license.