Skip to content

Implement Unet model from scratch and perform segmentation on ISIC 2018 dataset with Tensorflow

Notifications You must be signed in to change notification settings

duylebkHCM/SkinLesionSegmentation

Repository files navigation

Skin Lesion Segmentation

In this project I reimplement Unet model from srcatch base on Unet paper using Tensorflow and perform segmentation on ISIC 2018 dataset which a skin lesion dataset include 2594 training images. After that I create a app to serve the model using FastAPI as backend and Streamlit as frontend and combine them using Docker.

DATASET

For this project I will use ISIC 2018 dataset which can be downloaded here Link Download This dataset include 2594 image-mask pair for segmenting lesion on skin.

isic

UNET MODEL

Unet model contain 2 part: Encoder and Decoder.

  • Encoder: Use to extract features from the image, from low level features to high level features. It include 5 block, each block is a group of convolution, batchnorm and max-pooling layer
  • Decoder: High level features will go through the decoder to recover spatial information, each step the size of features will get double, also to prevent from loss spatial information it include the features from encoder through what call skip-connection.

unet

RESULT

I train the model for 60 epoch using Adam optimizer, combine loss between dice loss and binary cross entropy loss. The model achieves best dice coefficience of 81.49

loss

Some predicted images:

pred

WEB APP

I serve an Unet model for skin lesion segmentation using FastAPI for the backend service and streamlit for the frontend service. docker-compose orchestrates the two services and allows communication between them.

To run the example in a machine running Docker and docker-compose, run: docker-compose build docker-compose up

To visit the FastAPI documentation of the resulting service, visit http://localhost:8000 with a web browser.
To visit the streamlit UI, visit http://localhost:8501.

Some images from the app

x1 x2 x3

REFERENCE

O. Ronneberger, P. Fischer, and T. Brox, “U-net: Con-volutional networks for biomedical image segmentation,”vol. abs/1505.04597, 2015.

About

Implement Unet model from scratch and perform segmentation on ISIC 2018 dataset with Tensorflow

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages