RetViM

Sequential Hybrid Vision Transformer with MedMamba for Retinal Disease Classification

Accepted for presentation at IEEE GSCon 2027.

Khamir Desai 路 Mayuri A. Mehta 路 Sree Saicharan Vadapalli

Code 路 Checkpoint details 路 Citation

Model

Property Value
Task Retinal OCT image classification
Labels, in order CNV, DME, DRUSEN, NORMAL
Architecture ViT-B/16 + 2 convolution/native-Mamba blocks
Parameters 101,223,557
Input RGB, 224 脳 224; OpenCV linear resize; ImageNet normalization
Weights Float32 safetensors, 404.95 MB

The supplied checkpoint uses native 1D Mamba, with pooling fusion and classifier dimensions that differ from the manuscript's summarized SS2D configuration. The linked implementation preserves the trained tensors and loads them strictly. It is a custom PyTorch model, not a Transformers AutoModel checkpoint.

Dataset and reported result

Kermany retinal OCT dataset, with CNV, DME, DRUSEN and NORMAL labels. Original dataset record.

The manuscript reports 99.90% accuracy (967/968 test images), the highest among the methods compared there. This is paper-reported, not an independently verified overall leaderboard ranking or a newly reproduced benchmark.

Standalone training and evaluation instructions are available with the source. New training runs use explicit, hashed patient-disjoint manifests and are not claimed to recreate the original split.

Inference

git clone https://github.com/khamirdesai/RetViM.git
cd RetViM
pip install -e .
retvim predict --image /path/to/oct.png

The first run downloads the pinned checkpoint. For offline inference, add --weights /path/to/model.safetensors.

The package verifies the pinned checkpoint's SHA-256:

45c2042229b00b8ac882722c092b5e99708b6ff1d8ab900ae7082972b01480fd

Scope and license

Strict tensor loading, scan equations, and example inference were checked. The full paper benchmark was not independently rerun. Intended for research; scores are uncalibrated and no prospective clinical validation is claimed.

Original code: MIT. Weights: license pending; rights reserved under LICENSE_WEIGHTS. The manuscript, publisher PDF, and paper figures are not included. Final publication metadata will be added when available.

Mentor: Prof. Mayuri A. Mehta. Upstream research: MedMamba, VMamba, and Mamba.

Downloads last month
61
Safetensors
Model size
0.1B params
Tensor type
F32
路
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support

Model tree for khamirdesai/RetViM

Finetuned
(3)
this model