Zero-Shot Image Classification
OpenCLIP
clip
biomedical
vision-language
scientific-figures
panel2patch
Instructions to use KKYYKK/Panel2Patch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- OpenCLIP
How to use KKYYKK/Panel2Patch with OpenCLIP:
import open_clip model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:KKYYKK/Panel2Patch') tokenizer = open_clip.get_tokenizer('hf-hub:KKYYKK/Panel2Patch') - Notebooks
- Google Colab
- Kaggle
Panel2Patch release: ViT-L/14 checkpoint and model card
Browse files- README.md +64 -0
- panel2patch.pt +3 -0
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: open_clip
|
| 4 |
+
pipeline_tag: zero-shot-image-classification
|
| 5 |
+
tags:
|
| 6 |
+
- clip
|
| 7 |
+
- biomedical
|
| 8 |
+
- vision-language
|
| 9 |
+
- scientific-figures
|
| 10 |
+
- panel2patch
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Panel2Patch: From Panel to Pixel (ViT-L/14)
|
| 14 |
+
|
| 15 |
+
The released vision-language model of **"From Panel to Pixel: Zoom-In Vision-Language Pretraining from Biomedical Scientific Literature"**
|
| 16 |
+
(CVPR 2026, [arXiv:2512.02566](https://arxiv.org/abs/2512.02566)). Code, data index and evaluation:
|
| 17 |
+
[github.com/Flaick/Panel2Patch](https://github.com/Flaick/Panel2Patch).
|
| 18 |
+
|
| 19 |
+
Panel2Patch turns biomedical figures from the literature into three levels of image-text supervision without human annotation
|
| 20 |
+
(whole figure, sub-panel, marked region) and pretrains a CLIP model on all three. This checkpoint is the model reported as
|
| 21 |
+
"Ours" in Table 3 of the paper: OpenCLIP `ViT-L-14`, initialised from BMC-CLIP, text tower frozen, the last 5 image blocks trainable,
|
| 22 |
+
epoch 3 of the 20-epoch cosine schedule (run `unlock5_withrawdata`, every epoch of which is in
|
| 23 |
+
[KKYYKK/biomedica_fg_models](https://huggingface.co/KKYYKK/biomedica_fg_models)).
|
| 24 |
+
|
| 25 |
+
## Files
|
| 26 |
+
|
| 27 |
+
| file | content |
|
| 28 |
+
|---|---|
|
| 29 |
+
| `panel2patch.pt` | `{"state_dict", "epoch": 3, "name"}` plus the training optimizer states; identical to `biomedica_fg_models/unlock5_withrawdata/epoch_3.pt` |
|
| 30 |
+
|
| 31 |
+
## Loading
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
import open_clip, torch
|
| 35 |
+
model, _, preprocess = open_clip.create_model_and_transforms("ViT-L-14", pretrained=None)
|
| 36 |
+
sd = torch.load("panel2patch.pt", map_location="cpu")["state_dict"]
|
| 37 |
+
sd = {k[7:] if k.startswith("module.") else k: v for k, v in sd.items()}
|
| 38 |
+
missing, unexpected = model.load_state_dict(sd, strict=False) # training-only modules are ignored
|
| 39 |
+
assert not missing
|
| 40 |
+
tokenizer = open_clip.get_tokenizer("ViT-L-14")
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Zero-shot results (Table 3 of the paper, top-1 accuracy, %)
|
| 44 |
+
|
| 45 |
+
| model | Biology | Dermatology | Microscopy | Ophthalmology | Pathology | Radiology | Avg |
|
| 46 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 47 |
+
| BMC-CLIP | 34.08 | 65.81 | 50.09 | 36.74 | 41.21 | 59.15 | 47.85 |
|
| 48 |
+
| Panel2Patch (this checkpoint, paper) | 38.53 | 65.19 | 54.00 | 35.78 | 42.91 | 65.07 | 50.25 |
|
| 49 |
+
| Panel2Patch (this checkpoint, re-evaluated with the released code) | 38.58 | 65.16 | 54.01 | 35.77 | 43.68 | 65.01 | 50.37 |
|
| 50 |
+
|
| 51 |
+
The evaluation protocol (EVVLM closed VQA, two caption styles pooled) and the per-benchmark numbers are in the GitHub repository
|
| 52 |
+
(`eval/zeroshot_eval.py`, `eval/table3.py`).
|
| 53 |
+
|
| 54 |
+
## Citation
|
| 55 |
+
|
| 56 |
+
```bibtex
|
| 57 |
+
@inproceedings{yuan2026panel2pixel,
|
| 58 |
+
title = {From Panel to Pixel: Zoom-In Vision-Language Pretraining from Biomedical Scientific Literature},
|
| 59 |
+
author = {Yuan, Kun and others},
|
| 60 |
+
booktitle = {CVPR},
|
| 61 |
+
year = {2026},
|
| 62 |
+
note = {arXiv:2512.02566}
|
| 63 |
+
}
|
| 64 |
+
```
|
panel2patch.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3f310838284d36a88fd04872670849ad41da80dd7c09ced26631c66c6772d1c
|
| 3 |
+
size 3222346361
|