SAVRN
Search Contact SAVRN

Open-weight model · Zero shot image classification

DermLIP_ViT-B-16

by Siyuan Yan redlessone/DermLIP_ViT-B-16

DermLIP is a vision-language model for dermatology, trained on the Derm1M dataset—the largest dermatological image-text corpus to date.

Parameters
Context
Weights1.2 GB
Licensecc-by-4.0
AccessOpen weights
Monthly Downloads3.8k

Model Card

By Siyuan Yan, published under cc-by-4.0, revision b7d427364122.

DermLIP is a vision-language model for dermatology, trained on the Derm1M dataset—the largest dermatological image-text corpus to date. python import openclip from PIL import Image import torch model,, preprocess = openclip.createmodelandtransforms( 'hf-hub:redlessone/DermLIPViT-B-16' model.eval() tokenizer = openclip.gettokenizer('hf-hub:redlessone/DermLIPViT-B-16') image = preprocess(Image.open("yourskinimage.png")).unsqueeze(0) PADCLASSNAMES = [ "nevus", "basal cell carcinoma", "actinic keratosis", "seborrheic keratosis", "squamous cell carcinoma", "melanoma" template = lambda c: f'This is a skin image of {c}' text = tokenizer([template(c) for c in PADCLASSNAMES]) with torch.nograd()…

Read Siyuan Yan's full model card

DermLIP: Dermatology Language-Image Pretraining

Model Description

DermLIP is a vision-language model for dermatology, trained on the Derm1M dataset—the largest dermatological image-text corpus to date.

Model Details

  • Model Type: Pretrained Vision-Language Model (CLIP-style)

  • Architecture:

  • Vision encoder: ViT-B16

  • Text encoder: GPT2

  • Resolution: 224×224 pixels

  • Paper: https://arxiv.org/abs/2503.14911

  • Repository: https://github.com/SiyuanYan1/Derm1M

  • license: cc-by-nc-nd-4.0

Training Details

  • Training data: 403,563 skin image-text pairs from Derm1M datasets. Images include both dermoscopic and clinical images.
  • Training objective: image-text contrastive loss
  • Hardware: 1 x Nvidia H200 (~40GB memory usage)
  • Hours used: ~5 hours

Intended Uses

Primary Use Cases

  • Zero-shot classification
  • Few-shot learning
  • Cross-modal retrieval
  • Concept annotation/explanation

How to Use

Installation

First, clone the Derm1M repository:

git clone [email protected]:SiyuanYan1/Derm1M.git
cd Derm1M
···

Then install the package following the instruction in the repository.


### Quick Start
```python
import open_clip
from PIL import Image
import torch

# Load model with huggingface checkpoint
model, _, preprocess = open_clip.create_model_and_transforms(
    'hf-hub:redlessone/DermLIP_ViT-B-16'
)
model.eval()

# Initialize tokenizer
tokenizer = open_clip.get_tokenizer('hf-hub:redlessone/DermLIP_ViT-B-16')

# Read example image
image = preprocess(Image.open("your_skin_image.png")).unsqueeze(0)

# Define disease labels (example: PAD dataset classes)
PAD_CLASSNAMES = [
    "nevus",
    "basal cell carcinoma",
    "actinic keratosis",
    "seborrheic keratosis",
    "squamous cell carcinoma",
    "melanoma"
]

# Build text prompts
template = lambda c: f'This is a skin image of {c}'
text = tokenizer([template(c) for c in PAD_CLASSNAMES])

# Inference
with torch.no_grad(), torch.autocast("cuda"):
    # Encode image and text
    image_features = model.encode_image(image)
    text_features = model.encode_text(text)

    # Normalize features
    image_features /= image_features.norm(dim=-1, keepdim=True)
    text_features /= text_features.norm(dim=-1, keepdim=True)

    # Compute similarity
    text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)

# Get prediction
final_prediction = PAD_CLASSNAMES[torch.argmax(text_probs[0])]
print(f'This image is diagnosed as {final_prediction}.')
print("Label probabilities:", text_probs)

Contact

For any additional questions or comments, contact Siyuan Yan ([email protected]),

Cite our Paper

@misc{yan2025derm1m,
  title        = {Derm1M: A Million‑Scale Vision‑Language Dataset Aligned with Clinical Ontology Knowledge for Dermatology},
  author       = {Siyuan Yan and Ming Hu and Yiwen Jiang and Xieji Li and Hao Fei and Philipp Tschandl and Harald Kittler and Zongyuan Ge},
  year         = {2025},
  eprint       = {2503.14911},
  archivePrefix= {arXiv},
  primaryClass = {cs.CV},
  url          = {https://arxiv.org/abs/2503.14911}
}

@article{yan2025multimodal,
  title={A multimodal vision foundation model for clinical dermatology},
  author={Yan, Siyuan and Yu, Zhen and Primiero, Clare and Vico-Alonso, Cristina and Wang, Zhonghua and Yang, Litao and Tschandl, Philipp and Hu, Ming and Ju, Lie and Tan, Gin and others},
  journal={Nature Medicine},
  pages={1--12},
  year={2025},
  publisher={Nature Publishing Group}
}

Identity and Version

Repository
redlessone/DermLIP_ViT-B-16
Publisher
Siyuan Yan
Task
Zero shot image classification
Modality
Other
Library
transformers
Parameters
Not stated by the source
Languages
en
Revision
b7d427364122927b0d19faf45cec05eea5469226
First published
2025-06-30
Last updated
2025-10-15

Files and Weights

10 files, 1.2 GB in total. The weights are 2 files totalling 1.2 GB in bin, safetensors.

Weights2 files · 1.2 GB
Configuration2 files · 1.1 KB
Tokenizer4 files · 5.0 MB
Documentation1 file · 3.8 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
open_clip_model.safetensorsWeights598.5 MB 727b22532b30
open_clip_pytorch_model.binWeights598.6 MB f876229c397d
open_clip_config.jsonConfiguration532 B
special_tokens_map.jsonConfiguration588 B
README.mdDocumentation3.8 KB
.gitattributesRepository1.5 KB
merges.txtTokenizer524.6 KB
tokenizer.jsonTokenizer3.6 MB
tokenizer_config.jsonTokenizer736 B
vocab.jsonTokenizer862.3 KB

License and Download

License
cc-by-4.0
Access
Open weights, no gate
Download size
1.2 GB
Download from Siyuan Yan

Released by Siyuan Yan through its official repository on Hugging Face. Read the license.

Built From

  • Described by arXiv:2503.14911

Memory Requirements

PrecisionWeights in memory
As published1.2 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About DermLIP_ViT-B-16

Can I use DermLIP_ViT-B-16 commercially?

Yes. DermLIP_ViT-B-16 is released under Creative Commons Attribution 4.0. CC BY 4.0 permits sharing and adapting the work, including commercially, provided the creator is credited and changes are indicated.

Similar Models

Model · Zero shot image classification

clip-vit-base-patch32

OpenAI

Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found here. The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within. January 2021 The model uses a ViT-B/32 Transformer architecture as an image encoder and uses a masked self-attention…

Open weights 77 tokens transformers

Model · Zero shot image classification

clip-vit-large-patch14-336

OpenAI

This model was trained from scratch on an unknown dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - trainingprecision: float32 - Transformers 4.21.3 - TensorFlow 2.8.2 - Tokenizers 0.12.1

Open weights 77 tokens transformers

Model · Zero shot image classification

clip-vit-base-patch16

OpenAI

Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found here. The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within. January 2021 The base model uses a ViT-B/16 Transformer architecture as an image encoder and uses a masked…

Open weights 77 tokens transformers

Model · Zero shot image classification

CLIP-convnext_base_w-laion2B-s13B-b82K-augreg

LAION eV

A series of CLIP ConvNeXt-Base (w/ wide embed dim) models trained on subsets LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/openclip). Explore an alternative to ViT and ResNet (w/ AttentionPooling) CLIP models that scales well with model size and image resolution First known ConvNeXt CLIP models trained at scale in the range of CLIP ViT-B/16 and RN50x4 models First released model weights exploring increase of augmentation + regularization for image tower via adding (greater scale range of RRC, random erasing, stochastic depth) The models utilize the timm ConvNeXt-Base model (convnextbase) as the image tower, and the same text tower as the RN50x4…

Open weights mit open_clip

Model · Zero shot image classification

DermFM-Zero

Siyuan Yan

DermFM-Zero is a dermatology vision–language foundation model. It pairs a PanDerm ViT-L/16 vision encoder with native-resolution input (NaViT patch-and-pack) and a PubMedBERT-256 text encoder pretrained on a Derm1M knowledge tree (KEP), aligned on 517,455 public dermatology image–text pairs with multi-aspect knowledge contrastive learning (MAKE) and knowledge distillation. It performs zero-shot diagnosis and cross-modal retrieval, serves as a backbone for multimodal fine-tuning and VQA, and yields interpretable concepts through sparse autoencoders. Across extensive benchmarks and three multinational reader studies, DermFM-Zero achieves state-of-the-art zero-shot performance while improving…

Open weights cc-by-nc-nd-4.0 transformers

Model · Zero shot image classification

CLIP-ViT-B-32-laion2B-s34B-b79K

LAION eV

A CLIP ViT-B/32 model trained with the LAION-2B English subset of LAION-5B (https://laion.ai/blog/laion-5b/) using OpenCLIP (https://github.com/mlfoundations/openclip). Model training done by Romain Beaumont on the stability.ai cluster. As per the original OpenAI CLIP model card, this model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such model. The OpenAI CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.…

Open weights mit 151M parameters 77 tokens open_clip