Cancer-Net SCa-Synth
Cancer-Net SCa-Synth是一个包含10,000张合成2D皮肤病变图像的数据集,图像模态为皮肤镜或临床照片,其中良性与恶性皮肤癌图像各5,000张,类别平衡。该数据集由滑铁卢大学利用Stable Diffusion和DreamBooth技术,基于少量真实图像生成,主要用于皮肤癌的自动检测与分类研究,旨在通过合成数据解决真实数据集的类别不平衡问题,以提升相关机器学习模型的诊断性能。

基本信息
资源简介
Cancer-Net SCa-Synth
【数据集背景】
本数据集源站标题为《catai9/Cancer-Net-SCa-Synth》。源站首次发布:2024-09-06。
【数据内容】
源站原始描述:# Cancer-Net-SCa-Synth This is the repo containing scripts and utilities for generating images of benign and malignant skin lesions using the Stable Diffusion model with DreamBooth. The latest version producing the best results uses scripts from HuggingFace which are licensed under the Apache 2.0 license (as of 2024-05-26). ## Project structure ## Setup The following setup should be done on a machine with a Nvidia GPU. 1. Download/prepare the ISIC 2020 skin lesion dataset The dataset can be down…
【获取与许可】
源站页面:https://github.com/catai9/Cancer-Net-SCa-Synth
【使用注意】
· 源站最后修改于 2024-09-08,引用时请注意版本时效。
下载信息
注册下载
需要注册 Kaggle 账号并登录后下载,适合需要跟踪下载记录和使用 API 的用户。
暂未开放公开下载
无需注册即可直接获取公开样本或文档,适合快速预览和评估数据集质量。
免登录有偿下载
公开数据集受托下载与技术交付服务。
提供高速下载与技术交付服务(收技术服务费,非数据销售)
暂未开放当前数据集主要来源为 Kaggle 公开托管,完整影像包建议通过原始链接或 Kaggle API 获取。
使用方式
数据集获取
git clone https://github.com/catai9/Cancer-Net-SCa-Synth.git
curl -L -o repo.zip https://github.com/catai9/Cancer-Net-SCa-Synth/archive/refs/heads/main.zip
unzip repo.zip
源站 README 摘录(使用方式)
Cancer-Net-SCa-Synth
This is the repo containing scripts and utilities for generating images of benign and malignant skin lesions using the Stable Diffusion model with DreamBooth. The latest version producing the best results uses scripts from HuggingFace which are licensed under the Apache 2.0 license (as of 2024-05-26).
Project structure
.
├── data # Training data, recommend symlinking
│ ├── jpeg # JPEG images
│ │ ├── test # Test set
│ │ └── train # Training set
│ ├── test.csv # Metadata CSV for test set
│ └── train.csv # Metadata CSV for training set
├── src # Python source code
│ └── create_training_dataset.py # Script to generate folder of images for training SD using DreamBooth trainer
│ └── train_dreambooth.py # HuggingFace Python script for training SD using DreamBooth trainer
│ └── generate_images.py # Generate images using the trained SD with DreamBooth trainer
│ └── create_generated_csv_file.py # Create a csv file for the generated images
│ └── prepreprocess_data.py # Preprocess data for model training
│ └── train_mobilenetv2_model.py # Train MobileNetV2 model
# Misc individual files
├── requirements.txt
└── README.md
Setup
The following setup should be done on a machine with a Nvidia GPU.
- Download/prepare the ISIC 2020 skin lesion dataset
The dataset can be downloaded here.
To download from Kaggle:
kaggle competitions download -c siim-isic-melanoma-classification # Need Kaggle CLI installed
then unzip the file and create a symlink to the folder under the name data/ in the project root:
ln -s <downloaded folder> data
- Create a directory containing the desired training instances. A helper script can be used to generate this directory, sampling random benign/malignant images as follows:
python src/create_training_dataset.py \
malignant \
source_csv data/train.csv \
source_dir data/jpeg/train \
target_dir data/generated/train-malignant \
subset_size 300
python src/create_training_dataset.py \
benign \
source_csv data/train.csv \
source_dir data/jpeg/train \
target_dir data/generated/train-benign \
subset_size 300
Please run python src/create_training_dataset.py -h for more information on the script usage and available flags.
数据加载示例(图像类)
from PIL import Image
import glob, os
files = (glob.glob(os.path.join(path, "**", "*.png"), recursive=True)
+ glob.glob(os.path.join(path, "**", "*.jpg"), recursive=True)
+ glob.glob(os.path.join(path, "**", "*.tif"), recursive=True))
print("图像文件数:", len(files))
img = Image.open(files[0]); print("尺寸/模式:", img.size, img.mode)
# torchvision Dataset 方式:
# from torchvision import datasets
# ds = datasets.ImageFolder(path) # 要求 子目录=类别
目录组织与标注格式以源站说明和下载后实际文件为准。
数据缺失?
依托陕西、四川两大基地,我们与超过十家三甲医院建立直接合作关系,覆盖合规授权、采集治理、专业标注、数据交付的全流程,为AI医疗团队提供即拿即用的高质量临床数据。
⚡️ 需要数据支持或标注服务?立即联系我们获取专业方案。




