GithubHelp home page GithubHelp logo

kakumarabhishek / mask2lesion Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 534 KB

Code corresponding to our MICCAI SASHIMI 2019 paper on shape-constrained skin lesion image synthesis.

License: GNU Affero General Public License v3.0

generative-adversarial-network image-augmentation image-synthesis image-translation pix2pix skin-lesion-segmentation shape-analysis

mask2lesion's Introduction

Mask2Lesion: Mask-Constrained Adversarial Skin Lesion Image Synthesis

Overview

Mask2Lesion_Overview

This repository provides the code and the model weights for our MICCAI SASHIMI 2019 paper: Mask2Lesion, a GAN-based paired image translation approach for synthesizing skin lesion images from binary segmentation masks. If you use our code, please cite our papers:

[1] Kumar Abhishek, Ghassan Hamarneh, "Mask2Lesion: Mask-Constrained Adversarial Skin Lesion Image Synthesis", International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI) Workshop on Simulation and Synthesis in Medical Imaging (SASHIMI), 2019.

[2] Kumar Abhishek, "Input Space Augmentation for Skin Lesion Segmentation in Dermoscopic Images", Diss. Applied Sciences: School of Computing Science, 2020.

The corresponding bibtex entries are:

@InProceedings{Abhishek_2020_CVPRW,
    author = {Abhishek, Kumar and Hamarneh, Ghassan},
    title = {Mask2Lesion: Mask-Constrained Adversarial Skin Lesion Image Synthesis},
    booktitle = {International Conference on Medical Image Computing
    and Computer-Assisted Intervention (MICCAI) Workshop on Simulation and Synthesis in Medical Imaging (SASHIMI)},
    pages={71--80},
    month = {June},
    year = {2019}
}

@mastersthesis{Abhishek2020Input,
    author={Abhishek, Kumar},
    title={Input Space Augmentation for Skin Lesion Segmentation in Dermoscopic Images},
    school={Applied Sciences: School of Computing Science}
    year={2020},
}

This code uses affinelayer's pix2pix-tensorflow @ 0f21744 and junyanz's pytorch-CycleGAN-and-pix2pix @ 0442670. The former (TensorFlow implementation) is only used to prepare the data in the pix2pix image translation format (since the dataset creation functionality was not available in the PyTorch implementation at that time), and therefore only tools/process.py is used. The GAN training and inference relies on the PyTorch implementation.

Preparing the dataset

Since this is a paired image translation task, we need skin lesion image-lesion segmentation mask pairs.

(uses tools/process.py from pix2pix-tensorflow @ 0f21744)

CUDA_VISIBLE_DEVICES="0" python process.py --b_dir <SKIN_LESION_IMAGES_DIR> --input_dir <SKIN_LESION_SEGMENTATION_MASKS_DIR> --operation combine --output_dir <CREATED_DATASET_STORAGE_DIR>

Training and evaluating Mask2Lesion

python train.py --dataroot <Mask2Lesion_DATASET_DIR> --name Mask2Lesion --model pix2pix --direction AtoB --gpu_ids 0 --display_id 0 --norm instance

python test.py --dataroot <Mask2Lesion_DATASET_DIR> --name Mask2Lesion --model pix2pix --direction AtoB --gpu_ids 0 --num_test 1000

Sample outputs

Mask2Lesion_Outputs

(a) Segmentation masks from the ISIC dataset fed to Mask2Lesion and the corresponding generated lesion images.

(b) Simple geometric shapes as masks and the corresponding outputs.

(c) Elastic deformations applied to hand drawn masks using DeformIt and the corresponding synthesized lesion images.

(d),(e) PCA-based deformations applied to segmentation masks and the corresponding Mask2Lesion outputs.

Pre-trained Mask2Lesion weights

The model training details are provided in [2] in Chapter 2, Section 2.3 on page 25. The model weights are available on Google Drive for inference. Please download them and place them in pytorch-CycleGAN-and-pix2pix/checkpoints/Mask2Lesion/.

mask2lesion's People

Contributors

kakumarabhishek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.