This project aims to automatically generate and classify high-quality melanoma images using the Denoising Diffusion Probabilistic Model (DDPM) and ResNet50 to facilitate early diagnosis and improve treatment outcomes. Through efficient and accurate image processing and analysis techniques, this project enables medical professionals to better understand and diagnose melanoma, and thus provide more personalized and effective treatment plans.
The dataset for this project comes from the International Skin Imaging Collaboration (ISIC), which provides a large collection of expert-reviewed melanoma images to support dermatology research and education. ISIC:https://challenge.isic-archive.com/data/
- Python 3.8+
- PyTorch 1.8+
- torchvision
- denoising_diffusion_pytorch (denoising diffusion modeling library)
- See
requirements.txt
for additional dependencies.
- Clone the repository locally:
git clone https://github.com/WuTao1103/Melanoma-Image-Generation-and-Classification.git
- Enter the project directory: ``bash cd Melanoma Image Generation and Classification cd Melanoma Image Generation and Classification
- Install the dependencies (make sure you have pip installed):
pip install -r requirements.txt
Please refer to README.md in the ddpm
folder for detailed prediction and training steps.
- Generate images directly using pre-trained weights or use your own training weights.
- The generated images will be saved in the
results/predict_out
directory.
- Place the expected image files in the
datasets
folder. - Run the
train.py
file for training. The images generated during training can be viewed in theresults/train_out
folder.
See README.md in the skin_two_classification
folder for detailed steps.
args.py
: holds the various parameters used for training and testing.data_gen.py
: implements dataset partitioning, data augmentation and data loading.main.py
: contains training, evaluation and testing.models/Res.py
: rewrites ResNet for various types of networks.
- Training mode:
python main.py --mode=train
. - Test mode:
python main.py --mode=test --model_path='path/to/your/model.pth'
We welcome all forms of contributions, including bug fixes, feature additions, or improvements to the project documentation. Please contact us via issue or pull request.
This project is under the MIT license. See the LICENSE
file for more details.
We thank the International Skin Imaging Collaboration (ISIC) for providing valuable datasets, as well as all the individuals and organizations that contributed to this project.