Instructions to use Deliver0/postgd-dinov3-student with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use Deliver0/postgd-dinov3-student with timm:
import timm model = timm.create_model("hf-hub:Deliver0/postgd-dinov3-student", pretrained=True) - Notebooks
- Google Colab
- Kaggle
PostGD: pretrained ViT-B/16 student
PostGD learns transferable representations of post-photocoagulation fundus images through prior-guided synthetic image generation and teacher–student distillation. This release provides the pretrained student backbone for downstream adaptation.
Code and task heads · Training and usage guides
Model details
| Property | Value |
|---|---|
| Architecture | DINOv3 ViT-B/16 |
| Parameters | 85,641,216 |
| Patch size / embedding dimension | 16 / 768 |
| Teacher | Frozen DINOv3 ViT-L/16 |
| Initialization | Released DINOv3 weights, pretrained on LVD-1689M |
| Pretraining images | 200,000 prior-guided synthetic postoperative fundus images |
| Training input | RGB, 224 × 224 |
| Released artifact | Raw student weights, without task-specific heads |
The backbone supports adaptation to laser-scar, vessel, optic-disc and optic-cup segmentation, laser-scar presence classification, and optic-disc/fovea localization. Task heads require separate training on real annotated images; the backbone alone does not produce those task predictions.
Load and extract image embeddings
pip install "timm>=1.0.31" torch torchvision huggingface_hub safetensors Pillow
from PIL import Image
import timm
import torch
model = timm.create_model("hf-hub:Deliver0/postgd-dinov3-student", pretrained=True)
model.eval()
data_config = timm.data.resolve_model_data_config(model)
transform = timm.data.create_transform(**data_config, is_training=False)
image = Image.open("fundus.png").convert("RGB")
with torch.inference_mode():
embedding = model(transform(image).unsqueeze(0))
print(embedding.shape) # [1, 768]
To use the original PyTorch checkpoint with the PostGD downstream scripts:
from huggingface_hub import hf_hub_download
path = hf_hub_download("Deliver0/postgd-dinov3-student", "student_final.pth")
print(path) # pass this file to --student-weights in the PostGD repository
Preprocessing resizes the RGB image to 224 × 224 with bilinear interpolation,
then normalizes with mean (0.485, 0.456, 0.406) and standard deviation
(0.229, 0.224, 0.225). Use the task guide's preprocessing when adapting at
other resolutions.
Training
The student is aligned with a frozen teacher using feature MSE through a 768-to-1024 linear projection and cosine consistency between student embeddings of two augmented views. The student and teacher start from pretrained DINOv3 weights. Synthetic images supply the distillation data; manual task labels are not used during this stage.
The configuration associated with this checkpoint records:
| Setting | Value |
|---|---|
| Epochs / synthetic images | 200 / 200,000 |
| Global batch size | 640 |
| Optimizer / learning rate | AdamW / 0.0002 |
| Weight decay / warm-up | 0.05 / 500 steps |
| Layer-wise learning-rate decay | 0.75 |
| EMA decay | 0.999 |
| Seed | 42 |
This download is the raw student checkpoint; EMA and downstream head weights
are not included. The source-associated configuration is provided in
training_config.json.
The manuscript specifies β=0.1 for the method. The source configuration associated with this released candidate records β=0.01; these are separate descriptions and the candidate is not presented as a verified reproduction of all manuscript settings.
Files and verification
model.safetensors: the student state dict in Safetensors format for timm Hub loading.student_final.pth: the original PyTorch state dict for the PostGD scripts.config.json: architecture and inference preprocessing.training_config.json: training settings without machine-specific paths.SHA256SUMS: file checksums.LICENSE.mdandNOTICE.md: DINOv3 terms and attribution.
The original checkpoint SHA-256 is
3de942cfab4657d05c201207b4760ce07cd1537a49bccbb7565d930ed04d8544.
Both weight formats contain the same tensors. Strict state-dict loading and
finite 768-dimensional embeddings have been checked on CPU.
Intended use and limitations
This model is intended for research on postoperative fundus representations and few-shot adaptation. It requires task-specific annotations and validation for each new task, camera and patient population. It is not a validated diagnostic or treatment-planning system. This backbone release does not include clinical data or task heads, and its loading checks do not establish downstream clinical performance. See the PostGD manuscript and code for the evaluation protocols.
License and attribution
These DINOv3-derived weights are distributed under the DINOv3 License, which accompanies this release. They are not licensed under the MIT license used for the original PostGD source code. DINOv3 was developed by Meta; this model is a PostGD adaptation and is not an official Meta release. The student initialization is described in the upstream model card.
Citation
Please cite A Generation–Distillation Foundation Model for Post-Photocoagulation Fundus Images and acknowledge DINOv3. Citation information is maintained in the PostGD repository.
- Downloads last month
- -
Model tree for Deliver0/postgd-dinov3-student
Base model
timm/vit_base_patch16_dinov3.lvd1689m