DermoGPT is a dermatology vision-language modeling project for morphology-first clinical reasoning. The release contains training, inference, and evaluation code for Qwen-VL-style multimodal models, together with DermoBench benchmark metadata and prompt documentation.
This codebase is built on top of Qwen-VL-Series-Finetune. We thank the original authors for their excellent open-source fine-tuning framework.
.
βββ dataset_final/
β βββ benchmark/ # Benchmark metadata, MCQA JSON files, and evaluation scripts
βββ scripts/ # Training, inference, and weight-merging wrappers
βββ src/
β βββ dataset/ # SFT/DPO/GRPO datasets
β βββ infer/ # Local, LoRA, and API inference code
β βββ loss/ # Classification losses
β βββ model/ # Classification model utilities
β βββ train/ # Training entrypoints and reward functions
β βββ trainer/ # SFT/DPO/GRPO trainers
βββ environment.yaml
βββ requirements.txt
βββ prompts.md
βββ README.md
DermoBench evaluates four clinical axes:
| Axis | Tasks | Description |
|---|---|---|
| Morphology | Task 1.1-1.4 | Open-ended morphology, morph-grounded description, Derm7pt MCQA, SkinCon MCQA |
| Diagnosis | Task 2.1-2.3 | 4/25-choice diagnosis, hierarchical diagnosis, modality-focused diagnosis |
| Reasoning | Task 3.1-3.2 | CoT diagnosis and morphology-grounded reasoning |
| Fairness | Task 4 | DDI-based skin-tone fairness evaluation |
The benchmark files included here are derived artifacts and metadata. Original images should be obtained from the corresponding public dataset providers according to their licenses.
Recommended environment:
transformersqwen-vl-utilsflash-attn installed after the base environmentUsing requirements.txt:
pip install -r requirements.txt -f https://download.pytorch.org/whl/cu128
pip install qwen-vl-utils
pip install flash-attn --no-build-isolation
Using environment.yaml:
conda env create -f environment.yaml
conda activate train
pip install qwen-vl-utils
pip install flash-attn --no-build-isolation
Full fine-tuning:
TRAIN_DATA_PATH=/path/to/train.json \
IMAGE_FOLDER=/path/to/images \
bash scripts/finetune.sh
LoRA fine-tuning:
TRAIN_DATA_PATH=/path/to/train.json \
IMAGE_FOLDER=/path/to/images \
bash scripts/finetune_lora.sh
Vision LoRA fine-tuning:
TRAIN_DATA_PATH=/path/to/train.json \
IMAGE_FOLDER=/path/to/images \
bash scripts/finetune_lora_vision.sh
Merge LoRA weights:
SOURCE_MODEL_PATH=/path/to/lora_checkpoint \
MERGED_MODEL_PATH=/path/to/merged_model \
bash scripts/merge_lora_weights.sh
Set DATASET_ROOT to the root containing dataset_final-style image paths.
MODEL_PATH=/path/to/model \
MODEL_FAMILY=qwen3-vl-8b \
DATASET_ROOT=dataset_final \
DEVICE=cuda:0 \
bash scripts/infer_baseline_local.sh all
BASE_URL=https://your-api-endpoint/v1 \
API_KEY=your_api_key \
API_MODEL=your_model_name \
DATASET_ROOT=dataset_final \
NUM_WORKERS=4 \
bash scripts/infer_baseline_api.sh all
Task-level runs are also supported:
bash scripts/infer_baseline_local.sh 1.1 1.2 3.1 3.2
bash scripts/infer_lora.sh 2.1
bash scripts/infer_baseline_api.sh 4.1
Open-ended morphology and reasoning tasks use LLM-as-a-Judge scripts:
python dataset_final/benchmark/task1/1_1_description_wo_morph/eval_task1_1_gemini_2-5_pro_judge.py
python dataset_final/benchmark/task1/1_2_description_w_morph/eval_task1_2_gemini_2-5_pro_judge.py
python dataset_final/benchmark/task3/3_1/eval_task3_1_gemini_2-5_pro_judge.py
python dataset_final/benchmark/task3/3_2/eval_task3_2_gemini_2-5_pro_judge.py
MCQA and fairness evaluation utilities are included under:
src/infer/mcq/
dataset_final/benchmark/task4/
Prompt details for model generation and judging are documented in prompts.md.
DermoGPT is a research project. It is not a medical device and should not be used as a substitute for professional clinical judgment, diagnosis, or treatment.
This project builds on:
If you find this repository useful, please cite the DermoGPT paper.
6 commits
Python
97.4%
Shell
2.6%
DermoGPT is a dermatology vision-language modeling project for morphology-first clinical reasoning. The release contains training, inference, and evaluation code for Qwen-VL-style multimodal models, together with DermoBench benchmark metadata and prompt documentation.
This codebase is built on top of Qwen-VL-Series-Finetune. We thank the original authors for their excellent open-source fine-tuning framework.
.
βββ dataset_final/
β βββ benchmark/ # Benchmark metadata, MCQA JSON files, and evaluation scripts
βββ scripts/ # Training, inference, and weight-merging wrappers
βββ src/
β βββ dataset/ # SFT/DPO/GRPO datasets
β βββ infer/ # Local, LoRA, and API inference code
β βββ loss/ # Classification losses
β βββ model/ # Classification model utilities
β βββ train/ # Training entrypoints and reward functions
β βββ trainer/ # SFT/DPO/GRPO trainers
βββ environment.yaml
βββ requirements.txt
βββ prompts.md
βββ README.md
DermoBench evaluates four clinical axes:
| Axis | Tasks | Description |
|---|---|---|
| Morphology | Task 1.1-1.4 | Open-ended morphology, morph-grounded description, Derm7pt MCQA, SkinCon MCQA |
| Diagnosis | Task 2.1-2.3 | 4/25-choice diagnosis, hierarchical diagnosis, modality-focused diagnosis |
| Reasoning | Task 3.1-3.2 | CoT diagnosis and morphology-grounded reasoning |
| Fairness | Task 4 | DDI-based skin-tone fairness evaluation |
The benchmark files included here are derived artifacts and metadata. Original images should be obtained from the corresponding public dataset providers according to their licenses.
Recommended environment:
transformersqwen-vl-utilsflash-attn installed after the base environmentUsing requirements.txt:
pip install -r requirements.txt -f https://download.pytorch.org/whl/cu128
pip install qwen-vl-utils
pip install flash-attn --no-build-isolation
Using environment.yaml:
conda env create -f environment.yaml
conda activate train
pip install qwen-vl-utils
pip install flash-attn --no-build-isolation
Full fine-tuning:
TRAIN_DATA_PATH=/path/to/train.json \
IMAGE_FOLDER=/path/to/images \
bash scripts/finetune.sh
LoRA fine-tuning:
TRAIN_DATA_PATH=/path/to/train.json \
IMAGE_FOLDER=/path/to/images \
bash scripts/finetune_lora.sh
Vision LoRA fine-tuning:
TRAIN_DATA_PATH=/path/to/train.json \
IMAGE_FOLDER=/path/to/images \
bash scripts/finetune_lora_vision.sh
Merge LoRA weights:
SOURCE_MODEL_PATH=/path/to/lora_checkpoint \
MERGED_MODEL_PATH=/path/to/merged_model \
bash scripts/merge_lora_weights.sh
Set DATASET_ROOT to the root containing dataset_final-style image paths.
MODEL_PATH=/path/to/model \
MODEL_FAMILY=qwen3-vl-8b \
DATASET_ROOT=dataset_final \
DEVICE=cuda:0 \
bash scripts/infer_baseline_local.sh all
BASE_URL=https://your-api-endpoint/v1 \
API_KEY=your_api_key \
API_MODEL=your_model_name \
DATASET_ROOT=dataset_final \
NUM_WORKERS=4 \
bash scripts/infer_baseline_api.sh all
Task-level runs are also supported:
bash scripts/infer_baseline_local.sh 1.1 1.2 3.1 3.2
bash scripts/infer_lora.sh 2.1
bash scripts/infer_baseline_api.sh 4.1
Open-ended morphology and reasoning tasks use LLM-as-a-Judge scripts:
python dataset_final/benchmark/task1/1_1_description_wo_morph/eval_task1_1_gemini_2-5_pro_judge.py
python dataset_final/benchmark/task1/1_2_description_w_morph/eval_task1_2_gemini_2-5_pro_judge.py
python dataset_final/benchmark/task3/3_1/eval_task3_1_gemini_2-5_pro_judge.py
python dataset_final/benchmark/task3/3_2/eval_task3_2_gemini_2-5_pro_judge.py
MCQA and fairness evaluation utilities are included under:
src/infer/mcq/
dataset_final/benchmark/task4/
Prompt details for model generation and judging are documented in prompts.md.
DermoGPT is a research project. It is not a medical device and should not be used as a substitute for professional clinical judgment, diagnosis, or treatment.
This project builds on:
If you find this repository useful, please cite the DermoGPT paper.
6 commits
Python
97.4%
Shell
2.6%