Coder Social home page Coder Social logo

milad-ahmadi / gaid Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 3.0 3.26 MB

Tensorflow implementation of GAID

License: MIT License

Python 100.00%
anomaly-detection generative-adversarial-network mammogram-images adversial tensorflow dcgan anogan gan anomalydetection mias-dataset

gaid's Introduction

GAID: Generative Adversarial Irregularity Detection

Tensorflow implementation of GAID [Download]

This model detect irregular part in mammography images, after training GAID with normal dataset.

Model Description

Recognizing irregular tissues in mammography images can be defined as discovering regions that does not comply with normal (healthy) tissues present in the training set. To this end, we propose a method based on adversarial training composed of two important modules. The first module, denoted by R (Reconstructor), discovers the distribution of the healthy tissues, by learning to reconstruct them. The second module, M (Representation matching), learn to detect if its input is healthy or irregular.

Prerequisites (my environments)

  • Python 3.6
  • Tensorflow
  • SciPy = 1.0.0
  • Pillow
  • Pandas
  • matplotlib
  • scikit-learn
  • seaborn
  • OpenCV
  • mritopng (Convert DICOM Files to PNG)
  • CPU or NVIDIA GPU + CUDA CuDNN

Datasets

- Mias: This dataset contains of 322 mammography images in MLO view with 1024*1024 resolution. The data is categorized into 3 classes: Benign, Malignant, and normal. The ground-trust of abnormal (Benign and Malignant tumor) regions are indicated by center and diameter of those regions

- INbreast: This dataset contains 410 mammography images in mediolateraloblique (MLO) and cranial-caudal (CC) views with a 3000*4000 resolution.We consider all the mass cases in this dataset as irregular versus the normal class present in the dataset.

- CBIS-DDSM: This dataset contains 2,620 scanned film mammography studies from both CC and MLO views. The labels in this dataset also include benign, malignant, and normal with verified pathology information. We use this dataset only in a testing scenario and qualitatively evaluate the pretrained model on MIAS and INbreast on this data.

Data Structures

data 
  └── DATASET Name
        ├── test
        │     ├── normal
        │     │      ├── normal-0.png
        │     │      ├── normal-1.png
        │     │      ├── .
        │     │      ├── .
        │     │      └── .
        │     ├── abnormal
        │     │      ├── mass-0.png
        │     │      ├── mass-1.png
        │     │      ├── .
        │     │      ├── .
        │     │      └── .
        │     └── full image
        │            ├── mask
        │            │      ├── full image 0_mask.png
        │            │      ├── full image 1_mask.png
        │            │      ├── .
        │            │      ├── .
        │            │      └── .
        │            ├── full image 0.png
        │            ├── full image 1.png
        │            ├── .
        │            ├── .
        │            └── .
        └── train
              ├── normal-0.png
              ├── normal-1.png
              ├── .
              ├── .
              └── .

Training

To train the model on the MIAS or INBreast datasets with preparing patches and create train and test datasets, run the following:

python main.py --dataset=DATASET_NAME --input_height=INPUT_HEIGHT --output_height=OUTPUT_HEIGHT --patch_size=PATCH_SIZE --preparing_data --train

Testing

To evaluate the model on the MIAS or INBreast datasets prepared in train step, run the following:

python main.py --dataset=DATASET_NAME --input_height=INPUT_HEIGHT --output_height=OUTPUT_HEIGHT --test

To evaluate the generalizability of GAID, we train it on MIAS and INBreast, and test it on the CBIS-DDSM dataset:

python main.py --dataset=DATASET_NAME --input_height=INPUT_HEIGHT --output_height=OUTPUT_HEIGHT --test_with_patch=False --test

Results

fig 1 Examples of patches (denoted by X) and their reconstructed versions using AnoGAN, GANomaly ,and GAID.

fig 2 Testing results of the proposed irregularity detector on the CBIS-DDSM dataset, trained on MIAS and INBreast datasets. Brighter areas of heat-map indicate higher likelihood of irregularity; The heat-map1 and heat-map2 are for training the GAID on MIAS and INBreast datasets, respectively.

Contact

For questions about our paper or code, please contact Milad Ahmadi.

Acknowledgement

Thanks for LeeDoYup 's implementation of AnoGAN. I implemented GAID based on his implementation.

gaid's People

Contributors

milad-ahmadi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.