This is an hobby project to design an algorithm that can visually diagnose 3 classes of skin cancer using PyTorch's C++ frontend.
Disclaimer: Melanoma is one of the most deadliest forms of skin cancer, so definetly don't use anything on this repo to diagnose yourself.
These classes include:
- Melanoma
- Nevus
- Seborrheic keratosis
The algorithm will distinguish this malignant skin tumor from two types of benign lesions (nevi and seborrheic keratoses).
- C++
- CMake (minimum version 3.14)
- LibTorch v1.8.0
- Conda
- Clone this repo and cd into the cloned directory
https://github.com/mrdvince/dermatologist.git
cd dermatologist
- Create a build and cd into it. Then build the project using cmake.
The build process will download the training, testing and validation datasets (it's a large dataset)
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=~/libtorch ..
- Build
cmake --build . --config Release
Note: if the a data folder is not created and the dataset downloaded modify the CMakelists.txt file
and set the download option to ON
- Run the python convert file included in the cloned folder. This file will download the resnet18 pretrained model and "trace" it and save on disc without the final fully connected layer.
python ../convert.py
- Finally train the model
./dermatologist resnet18_without_last_layer.pt
That's pretty much it.