dermoscopic-image-classification
Repository contain code for paper titled "Class Imbalanced Dermoscopic Image Classification using Data Augmentation and GAN"
https://github.com/mjan2021/dermoscopic-image-classification
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Repository
Repository contain code for paper titled "Class Imbalanced Dermoscopic Image Classification using Data Augmentation and GAN"
Basic Info
Statistics
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Dermoscopic Image Classification
This repository is corresponding to the paper Tackling Imbalance dermoscopic image classification using data augmentation and GAN and it contains the source code and implementation of published study.


Abstract
Dermoscopy is a noninvasive way to examine and diagnose skin lesions, e.g. nevus and melanoma, and is a critical step for skin cancer detection. Accurate classification of dermoscopic images can detect skin cancer at an early stage and bring social and economic impact to patients and communities. Using deep learning methods to classify dermoscopic images has shown superior performance, but existing research often overlooks the class imbalance in the data. In addition, although a handful of public datasets are available for skin cancer research, these datasets are generally not large enough for deep learning algorithms to produce accurate results. In this paper, we propose to use data augmentation and generative adversarial networks (GAN) to tackle class-imbalanced dermoscopic image classification. Our main objectives are to determine (1) how state-of-the-art fine-tuned deep learning models perform on class-imbalanced dermoscopic images, (2) whether data augmentation and GAN can help alleviate class imbalances to improve classification accuracy, and (3) which method is more effective in addressing the class imbalance. By using public datasets and a carefully designed framework to generate augmented images and synthetic images, our research provides clear answers to these questions
Quick Links
Dataset EDA
Data ReadMe file Data ReadMe describes the dataset used in this study and provides link to download the dataset needed to replicate our study.
We also show data distribution after augmentation and after synthetic image generation using AC-GAN.
Models
Models ReadMe file contains all the information about the models used in this study.
Implementation and training of AC-GAN
Setup
Clone GitHub Repository
git clone [repo link]Create Environment
We used conda environment for our virtual environment
conda create -n dermcv python=3.7 -yconda activate dermcvInstall Dependencies
pip install -r requirements.txtInstall Pytorch with GPU Verify that you pytorch is installed and cuda is configured.
pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
- Verify Pytorch has Cuda ``` import torch torch.cuda.is_available()
```
Repository Structure
├── README.md
├── csv
├── data
├── logs
├── models
├── notebooks
│ ├── GAN-Augmentation.ipynb
│ └── data_explration.ipynb
├── requirements.txt
├── save
└── src
├── GAN-PyTorch.py
├── config.py
├── dataset.py
├── imports.py
├── models.py
├── train.py
└── utils.py
Running
Training
train.py contain all the training scripts while the parameters used are located in the config.py. To make changes to the parameters just change the default values in the config.py or pass it with the training script.
python train.py
Preprocessing
- Augmentation
- Generative Adversarial Networks
GAN Training
We used AC-GAN to generate Images. It needs to be trained on the minority class image that needs to be extracted from the meta file on the HAM10k meta file. Data folder should contain a single folder named HAM10k that contains all the images, while the meta files should be placed in the csv folder as train/test.
python GAN-Pytorch.py --data your-data-folder --csv_files csv-files-folder --n_epochs epochs --batch_size 64 --n_classes minority-classes
Models to be used
- Efficientnet
- ViT
- ConvNext
- ResNet50
- CNN
Contribution
@malsaidi @mjan2021
Contact
mjan2021@fau.edu
Owner
- Name: Tanveer J.
- Login: mjan2021
- Kind: user
- Location: Boca Raton, FL
- Company: Florida Atlantic University
- Website: tjan90.github.io/code-blog/
- Repositories: 3
- Profile: https://github.com/mjan2021
PhD Computer Science, College of Engineering and Computer Science
Citation (CITATION.cff)
cff-version: 1.0.0
preferred-citation:
type: software
message: If you use this software, please cite it as below.
authors:
- family-names: Al-Saidi
given-names: Mostapha
orcid: "https://orcid.org/0000-0002-5390-4316"
- family-names: Jan
given-names: Muhammad Tanveer
orcid: "https://orcid.org/0000-0002-3870-0526"
title: "Dermoscopic Image Classification"
version: 1.0.0
doi: 10.1007/s11042-023-17067-1
date-released: 2023-1-10
license: GPL-3.0
url: "https://github.com/mjan2021/Dermoscopic-image-classification"
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Dependencies
- Babel ==2.11.0
- GitPython ==3.1.29
- Jinja2 ==3.1.2
- Keras-Preprocessing ==1.1.2
- Markdown ==3.4.1
- MarkupSafe ==2.1.1
- Pillow ==9.3.0
- PyYAML ==6.0
- Pygments ==2.13.0
- Send2Trash ==1.8.0
- Werkzeug ==2.2.2
- absl-py ==1.3.0
- anyio ==3.6.2
- argon2-cffi ==21.3.0
- argon2-cffi-bindings ==21.2.0
- asttokens ==2.1.0
- astunparse ==1.6.3
- attrs ==22.1.0
- backcall ==0.2.0
- beautifulsoup4 ==4.11.1
- bleach ==5.0.1
- cachetools ==5.2.0
- certifi ==2022.9.24
- cffi ==1.15.1
- charset-normalizer ==2.1.1
- click ==8.1.3
- colorama ==0.4.6
- contourpy ==1.0.6
- cycler ==0.11.0
- debugpy ==1.6.3
- decorator ==5.1.1
- defusedxml ==0.7.1
- docker-pycreds ==0.4.0
- entrypoints ==0.4
- executing ==1.2.0
- fastjsonschema ==2.16.2
- flatbuffers ==22.10.26
- fonttools ==4.38.0
- gast ==0.4.0
- gitdb ==4.0.9
- google-auth ==2.14.0
- google-auth-oauthlib ==0.4.6
- google-pasta ==0.2.0
- grpcio ==1.50.0
- h5py ==3.7.0
- idna ==3.4
- importlib-metadata ==5.0.0
- importlib-resources ==5.10.0
- ipykernel ==6.17.0
- ipython ==8.6.0
- ipython-genutils ==0.2.0
- jedi ==0.18.1
- joblib ==1.2.0
- json5 ==0.9.10
- jsonschema ==4.17.0
- jupyter-server ==1.21.0
- jupyter_client ==7.4.4
- jupyter_core ==4.11.2
- jupyterlab ==3.5.0
- jupyterlab-pygments ==0.2.2
- jupyterlab_server ==2.16.2
- keras ==2.10.0
- kiwisolver ==1.4.4
- libclang ==14.0.6
- matplotlib ==3.6.2
- matplotlib-inline ==0.1.6
- mistune ==2.0.4
- nbclassic ==0.4.8
- nbclient ==0.7.0
- nbconvert ==7.2.3
- nbformat ==5.7.0
- nest-asyncio ==1.5.6
- notebook ==6.5.2
- notebook_shim ==0.2.2
- numpy ==1.23.4
- oauthlib ==3.2.2
- opencv-python ==4.6.0.66
- opt-einsum ==3.3.0
- packaging ==21.3
- pandas ==1.5.1
- pandocfilters ==1.5.0
- parso ==0.8.3
- pathtools ==0.1.2
- pickleshare ==0.7.5
- pkgutil_resolve_name ==1.3.10
- prometheus-client ==0.15.0
- promise ==2.3
- prompt-toolkit ==3.0.32
- protobuf ==3.19.6
- psutil ==5.9.3
- pure-eval ==0.2.2
- pyasn1 ==0.4.8
- pyasn1-modules ==0.2.8
- pycparser ==2.21
- pyparsing ==3.0.9
- pyrsistent ==0.19.2
- python-dateutil ==2.8.2
- pytz ==2022.6
- pywin32 ==304
- pywinpty ==2.0.9
- pyzmq ==24.0.1
- requests ==2.28.1
- requests-oauthlib ==1.3.1
- rsa ==4.9
- scikit-learn ==1.1.3
- scipy ==1.9.3
- sentry-sdk ==1.10.1
- setproctitle ==1.3.2
- shortuuid ==1.0.9
- six ==1.16.0
- smmap ==5.0.0
- sniffio ==1.3.0
- soupsieve ==2.3.2.post1
- stack-data ==0.6.0
- tensorboard ==2.10.1
- tensorboard-data-server ==0.6.1
- tensorboard-plugin-wit ==1.8.1
- tensorflow ==2.10.0
- tensorflow-estimator ==2.10.0
- tensorflow-io-gcs-filesystem ==0.27.0
- termcolor ==2.1.0
- terminado ==0.17.0
- threadpoolctl ==3.1.0
- tinycss2 ==1.2.1
- tomli ==2.0.1
- tornado ==6.2
- tqdm ==4.64.1
- traitlets ==5.5.0
- typing_extensions ==4.4.0
- urllib3 ==1.26.12
- wandb ==0.13.5
- wcwidth ==0.2.5
- webencodings ==0.5.1
- websocket-client ==1.4.2
- wrapt ==1.14.1
- zipp ==3.10.0
- Babel ==2.11.0
- GitPython ==3.1.29
- Jinja2 ==3.1.2
- Keras-Preprocessing ==1.1.2
- Markdown ==3.4.1
- MarkupSafe ==2.1.1
- Pillow ==9.3.0
- PyYAML ==6.0
- Pygments ==2.13.0
- Send2Trash ==1.8.0
- Werkzeug ==2.2.2
- absl-py ==1.3.0
- anyio ==3.6.2
- argon2-cffi ==21.3.0
- argon2-cffi-bindings ==21.2.0
- asttokens ==2.1.0
- astunparse ==1.6.3
- attrs ==22.1.0
- backcall ==0.2.0
- beautifulsoup4 ==4.11.1
- bleach ==5.0.1
- cachetools ==5.2.0
- certifi ==2022.9.24
- cffi ==1.15.1
- charset-normalizer ==2.1.1
- click ==8.1.3
- colorama ==0.4.6
- contourpy ==1.0.6
- cycler ==0.11.0
- debugpy ==1.6.3
- decorator ==5.1.1
- defusedxml ==0.7.1
- docker-pycreds ==0.4.0
- entrypoints ==0.4
- executing ==1.2.0
- fastjsonschema ==2.16.2
- flatbuffers ==22.10.26
- fonttools ==4.38.0
- gast ==0.4.0
- gitdb ==4.0.9
- google-auth ==2.14.0
- google-auth-oauthlib ==0.4.6
- google-pasta ==0.2.0
- grpcio ==1.50.0
- h5py ==3.7.0
- idna ==3.4
- importlib-metadata ==5.0.0
- importlib-resources ==5.10.0
- ipykernel ==6.17.0
- ipython ==8.6.0
- ipython-genutils ==0.2.0
- jedi ==0.18.1
- joblib ==1.2.0
- json5 ==0.9.10
- jsonschema ==4.17.0
- jupyter-server ==1.21.0
- jupyter_client ==7.4.4
- jupyter_core ==4.11.2
- jupyterlab ==3.5.0
- jupyterlab-pygments ==0.2.2
- jupyterlab_server ==2.16.2
- keras ==2.10.0
- kiwisolver ==1.4.4
- libclang ==14.0.6
- matplotlib ==3.6.2
- matplotlib-inline ==0.1.6
- mistune ==2.0.4
- nbclassic ==0.4.8
- nbclient ==0.7.0
- nbconvert ==7.2.3
- nbformat ==5.7.0
- nest-asyncio ==1.5.6
- notebook ==6.5.2
- notebook_shim ==0.2.2
- numpy ==1.23.4
- oauthlib ==3.2.2
- opencv-python ==4.6.0.66
- opt-einsum ==3.3.0
- packaging ==21.3
- pandas ==1.5.1
- pandocfilters ==1.5.0
- parso ==0.8.3
- pathtools ==0.1.2
- pickleshare ==0.7.5
- pkgutil_resolve_name ==1.3.10
- prometheus-client ==0.15.0
- promise ==2.3
- prompt-toolkit ==3.0.32
- protobuf ==3.19.6
- psutil ==5.9.3
- pure-eval ==0.2.2
- pyasn1 ==0.4.8
- pyasn1-modules ==0.2.8
- pycparser ==2.21
- pyparsing ==3.0.9
- pyrsistent ==0.19.2
- python-dateutil ==2.8.2
- pytz ==2022.6
- pywin32 ==304
- pywinpty ==2.0.9
- pyzmq ==24.0.1
- requests ==2.28.1
- requests-oauthlib ==1.3.1
- rsa ==4.9
- scikit-learn ==1.1.3
- scipy ==1.9.3
- sentry-sdk ==1.10.1
- setproctitle ==1.3.2
- shortuuid ==1.0.9
- six ==1.16.0
- smmap ==5.0.0
- sniffio ==1.3.0
- soupsieve ==2.3.2.post1
- stack-data ==0.6.0
- tensorboard ==2.10.1
- tensorboard-data-server ==0.6.1
- tensorboard-plugin-wit ==1.8.1
- tensorflow ==2.10.0
- tensorflow-estimator ==2.10.0
- tensorflow-io-gcs-filesystem ==0.27.0
- termcolor ==2.1.0
- terminado ==0.17.0
- threadpoolctl ==3.1.0
- tinycss2 ==1.2.1
- tomli ==2.0.1
- tornado ==6.2
- tqdm ==4.64.1
- traitlets ==5.5.0
- typing_extensions ==4.4.0
- urllib3 ==1.26.12
- wandb ==0.13.5
- wcwidth ==0.2.5
- webencodings ==0.5.1
- websocket-client ==1.4.2
- wrapt ==1.14.1
- zipp ==3.10.0