Giter Site home page Giter Site logo

imoleayomideajay / sem_size_analysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lwang94/sem_size_analysis

0.0 0.0 0.0 21.89 MB

This is a repository for using deep learning to segment SEM images for easier and faster analysis of sample structures and properties

License: Apache License 2.0

Jupyter Notebook 98.94% Python 0.84% Dockerfile 0.01% CSS 0.21%

sem_size_analysis's Introduction

SAEMI

Description

SAEMI (Size Analysis for Electron Microscopy Images) is a tool for obtaining the size distribution of nanoparticles in electron microscopy images. It uses an image segmentation model trained through a neural network to detect nanoparticle sizes and locations. The neural network used is a u-net with a resnet downsample created through the fastai library. From there, it then obtains a histogram of the sizes of each particle, providing important information such as mean particle size, median particle size etc. This tool can be used for characterizing new materials, analyzing environmental effects on chemical systems, ensure quality control for routine synthesis and much more.

Dependencies

  • Python == 3.6
  • dash == 1.9.1
  • dash-canvas == 0.1.0
  • fastai == 1.0.60
  • gdown == 3.10.1

Website

You can find the app hosted on Heroku here

To Run Locally

Using Docker

The easiest way to run the app locally is to run it as a docker container. If you wish to use this method, please ensure you have docker installed on your local machine. You can get docker from: https://docs.docker.com/get-docker/

After obtaining docker, simply clone the repo into a local directory and run the following command:

docker-compose up

Without Docker

If you wish to run the app locally without using docker, first clone the repo into a local directory. As well, please ensure you have the above dependencies installed. If you already have Python 3.6 installed, you can install the rest of the dependencies by running pip install -r requirements.txt after cloning the repo.

Once the dependencies have been succesfully installed, go into the cloned repo and from the command line run:

python -m src.backend_api

This will run the backend server on http://0.0.0.0:8000. To run the frontend server, run the following in a separate command line (also from the cloned repo directory):

python -m app

This will run the frontend server on http://127.0.0.1:8050/. Copy and paste the link into your web browser and you can use the app from there.

Using the App

Please check the user docs for more details. Below is a summary of the steps a user would take to obtain the size distribution of an electron microscopy image using this app.

  1. Preprocess the image: before using the app, remove any metadata such as the scale bar that may interfere with the deep learning prediction

  2. Upload the image: upload the image to the app using the buttons on the homepage. The image will then be segmented by the model and a size distribution calculated from the segmentation

  3. Postprocess the image: After tbe size distribution is calculated, the user can edit the prediction to give more accurate results in case the model did not satisfactorily segment the image. Check the user docs for more details on post processing

  4. Download the calculated particle sizes as a .csv file using the Download link provided. Keep in mind that the particle sizes are in units of pixels so it is up to the user to convert that to a physical distance.

sem_size_analysis's People

Contributors

lwang94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.