{"id":21073656,"url":"https://github.com/chouffe/udacity-nanodegree-deeplearning-foundation-dermatologist","last_synced_at":"2025-06-21T21:35:52.173Z","repository":{"id":148674749,"uuid":"114903034","full_name":"Chouffe/udacity-nanodegree-deeplearning-foundation-dermatologist","owner":"Chouffe","description":"Detect skin cancer","archived":false,"fork":false,"pushed_at":"2018-05-17T10:38:10.000Z","size":3896,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T03:22:19.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chouffe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-20T15:32:40.000Z","updated_at":"2018-05-17T10:38:11.000Z","dependencies_parsed_at":"2023-11-24T23:30:43.595Z","dependency_job_id":null,"html_url":"https://github.com/Chouffe/udacity-nanodegree-deeplearning-foundation-dermatologist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Chouffe/udacity-nanodegree-deeplearning-foundation-dermatologist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chouffe","download_url":"https://codeload.github.com/Chouffe/udacity-nanodegree-deeplearning-foundation-dermatologist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261197931,"owners_count":23123805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T19:01:30.613Z","updated_at":"2025-06-21T21:35:47.150Z","avatar_url":"https://github.com/Chouffe.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # (Image References)\n\n[image1]: ./images/skin_disease_classes.png \"Skin Disease Classes\"\n[image2]: ./images/cat_1.jpeg \"Category 1 Rankings\"\n[image3]: ./images/cat_2.jpeg \"Category 2 Rankings\"\n[image4]: ./images/cat_3.png \"Category 3 Rankings\"\n[image5]: ./images/sample_ROC_curve.png \"Sample ROC curve\"\n[image6]: ./images/sample_confusion_matrix.png \"Sample confusion matrix\"\n\n# Dermatologist AI\n\n## Introduction\n\nIn this mini project, you will design an algorithm that can visually diagnose [melanoma](http://www.skincancer.org/skin-cancer-information/melanoma), the deadliest form of skin cancer.  In particular, your algorithm will distinguish this malignant skin tumor from two types of benign lesions ([nevi](http://missinglink.ucsf.edu/lm/dermatologyglossary/nevus.html) and [seborrheic keratoses](https://www.aad.org/public/diseases/bumps-and-growths/seborrheic-keratoses)). \n\nThe data and objective are pulled from the [2017 ISIC Challenge on Skin Lesion Analysis Towards Melanoma Detection](https://challenge.kitware.com/#challenge/583f126bcad3a51cc66c8d9a).  As part of the challenge, participants were tasked to design an algorithm to diagnose skin lesion images as one of three different skin diseases (melanoma, nevus, or seborrheic keratosis).  In this project, you will create a model to generate your own predictions.\n\n![Skin Disease Classes][image1]\n\n## Getting Started\n\n1. Clone the [repository](https://github.com/udacity/dermatologist-ai) and create a `data/` folder to hold the dataset of skin images.  \n```text\ngit clone https://github.com/udacity/dermatologist-ai.git\nmkdir data; cd data\n```\n2. Create folders to hold the training, validation, and test images.\n```text\nmkdir train; mkdir valid; mkdir test\n```\n3. Download and unzip the [training data](https://s3-us-west-1.amazonaws.com/udacity-dlnfd/datasets/skin-cancer/train.zip) (5.3 GB).\n\n4. Download and unzip the [validation data](https://s3-us-west-1.amazonaws.com/udacity-dlnfd/datasets/skin-cancer/valid.zip) (824.5 MB).\n\n5. Download and unzip the [test data](https://s3-us-west-1.amazonaws.com/udacity-dlnfd/datasets/skin-cancer/test.zip) (5.1 GB).\n\n6. Place the training, validation, and test images in the `data/` folder, at `data/train/`, `data/valid/`, and `data/test/`, respectively.  Each folder should contain three sub-folders (`melanoma/`, `nevus/`, `seborrheic_keratosis/`), each containing representative images from one of the three image classes.\n\nYou are free to use any coding environment of your choice to solve this mini project!  In order to rank your results, you need only use a pipeline that culminates in a CSV file containing your test predictions.\n\n## Create a Model\n\nUse the training and validation data to train a model that can distinguish between the three different image classes.  (_After training, you will use the test images to gauge the performance of your model._)\n\nIf you would like to read more about some of the algorithms that were successful in this competition, please read [this article](https://arxiv.org/pdf/1710.05006.pdf) that discusses some of the best approaches.  A few of the corresponding research papers appear below.\n- Matsunaga K, Hamada A, Minagawa A, Koga H. [“Image Classification of Melanoma, Nevus and Seborrheic Keratosis by Deep Neural Network Ensemble”](https://arxiv.org/ftp/arxiv/papers/1703/1703.03108.pdf). International Skin Imaging Collaboration (ISIC) 2017 Challenge at the International Symposium on Biomedical Imaging (ISBI). \n- Daz IG. [“Incorporating the Knowledge of Dermatologists to Convolutional Neural Networks for the Diagnosis of Skin Lesions”](https://arxiv.org/pdf/1703.01976.pdf). International Skin Imaging Collaboration (ISIC) 2017 Challenge at the International Symposium on Biomedical Imaging (ISBI). ([**github**](https://github.com/igondia/matconvnet-dermoscopy))\n- Menegola A, Tavares J, Fornaciali M, Li LT, Avila S, Valle E. [“RECOD Titans at ISIC Challenge 2017”](https://arxiv.org/abs/1703.04819). International Skin Imaging Collaboration (ISIC)  2017 Challenge at the International Symposium on Biomedical Imaging (ISBI). ([**github**](https://github.com/learningtitans/isbi2017-part3))\n\nWhile the original challenge provided additional data (such as the gender and age of the patients), we only provide the image data to you.  If you would like to download this additional patient data, you may do so at the competition [website](https://challenge.kitware.com/#phase/5840f53ccad3a51cc66c8dab).\n\nAll three of the above teams increased the number of images in the training set with additional data sources.  If you'd like to expand your training set, you are encouraged to begin with the [ISIC Archive](https://isic-archive.com/#images).\n\n## Evaluation\n\nInspired by the ISIC challenge, your algorithm will be ranked according to three separate categories.\n\n#### Category 1: ROC AUC for Melanoma Classification\n\nIn the first category, we will gauge the ability of your CNN to distinguish between malignant melanoma and the benign skin lesions (nevus, seborrheic keratosis) by calculating the area under the receiver operating characteristic curve ([ROC AUC](http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html)) corresponding to this binary classification task.\n\nIf you are unfamiliar with ROC (Receiver Operating Characteristic) curves and would like to learn more, you can check out the documentation in [scikit-learn](http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html#sphx-glr-auto-examples-model-selection-plot-roc-py) or read [this Wikipedia article](https://en.wikipedia.org/wiki/Receiver_operating_characteristic).\n\nThe top scores (from the ISIC competition) in this category can be found in the image below.\n\n![Category 1 Rankings][image2]\n\n#### Category 2: ROC AUC for Melanocytic Classification\n\nAll of the skin lesions that we will examine are caused by abnormal growth of either [melanocytes](https://en.wikipedia.org/wiki/Melanocyte) or [keratinocytes](https://en.wikipedia.org/wiki/Keratinocyte), which are two different types of epidermal skin cells.  Melanomas and nevi are derived from melanocytes, whereas seborrheic keratoses are derived from keratinocytes. \n\nIn the second category, we will test the ability of your CNN to distinuish between melanocytic and keratinocytic skin lesions by calculating the area under the receiver operating characteristic curve ([ROC AUC](http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html)) corresponding to this binary classification task.\n\nThe top scores in this category (from the ISIC competition) can be found in the image below.\n\n![Category 2 Rankings][image3]\n\n#### Category 3: Mean ROC AUC\n\nIn the third category, we will take the average of the ROC AUC values from the first two categories.\n\nThe top scores in this category (from the ISIC competition) can be found in the image below.\n\n![Category 3 Rankings][image4]\n\n## Getting your Results\n\nOnce you have trained your model, create a CSV file to store your test predictions.  Your file should have exactly 600 rows, each corresponding to a different test image, **plus** a header row.  You can find an example submission file (`sample_submission.csv`) in the repository.\n\nYour file should have exactly 3 columns:\n- `Id` - the file names of the test images (in the **same** order as the sample submission file)\n- `task_1` - the model's predicted probability that the image (at the path in `Id`) depicts melanoma\n- `task_2` - the model's predicted probability that the image (at the path in `Id`) depicts seborrheic keratosis\n\nOnce the CSV file is obtained, you will use the `get_results.py` file to score your submission.  To set up the environment to run this file, you need to create (and activate) an environment with Python 3.5 and a few pip-installable packages:\n```text\nconda create --name derm-ai python=3.5\nsource activate derm-ai\npip install -r requirements.txt\n```\n\nOnce you have set up the environment, run the following command to see how the sample submission performed:\n```text\npython get_results.py sample_predictions.csv\n```\n\nCheck the terminal output for the scores obtained in the three categories:\n```text\nCategory 1 Score: 0.526\nCategory 2 Score: 0.606\nCategory 3 Score: 0.566\n```\n\nThe corresponding **ROC curves** appear in a pop-up window, along with the **confusion matrix** corresponding to melanoma classification.  \n\n![Sample ROC curve][image5]\n![Sample confusion matrix][image6]\n\nThe code for generating the confusion matrix assumes that the threshold for classifying melanoma is set to 0.5.  To change this threshold, you need only supply an additional command-line argument when calling the `get_results.py` file.  For instance, to set the threshold at 0.4, you need only run:\n```text\npython get_results.py sample_predictions.csv 0.4\n```\n\nTo test **your own** submission, change the code to instead include the path to **your** CSV file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchouffe%2Fudacity-nanodegree-deeplearning-foundation-dermatologist/lists"}