| --- |
| license: cc-by-nc-4.0 |
| tags: |
| - medical-imaging |
| - diabetic-retinopathy |
| - domain-generalization |
| - pytorch |
| pipeline_tag: image-classification |
| library_name: pytorch |
| --- |
| |
| # GradeEye baseline-3ch |
|
|
| This repository contains GradeEye CORN ordinal diabetic-retinopathy classifiers using three backbones (`convnext_tiny`, `deit3_small_patch16_384`, `maxvit_tiny_tf_384`) at 384x384 resolution, with 3-channel input and a 4-threshold ordinal head. The `_ema.safetensors` file is the **primary** artifact: the paper's reported evaluation metrics were generated using the EMA state dict. The unsuffixed `.safetensors` file is the corresponding raw `model_state_dict` secondary artifact. |
|
|
| ## Checkpoints |
|
|
| | Primary EMA weights | Raw secondary weights | Architecture | Held-out fold | Best QWK | Epoch | |
| |---|---|---|---|---:|---:| |
| | `lodo_aptos_convnext_tiny_best_ema.safetensors` | `lodo_aptos_convnext_tiny_best.safetensors` | `convnext_tiny` | aptos | 0.7614 | 6 | |
| | `lodo_aptos_deit3_small_patch16_384_best_ema.safetensors` | `lodo_aptos_deit3_small_patch16_384_best.safetensors` | `deit3_small_patch16_384` | aptos | 0.7064 | 6 | |
| | `lodo_aptos_maxvit_tiny_tf_384_best_ema.safetensors` | `lodo_aptos_maxvit_tiny_tf_384_best.safetensors` | `maxvit_tiny_tf_384` | aptos | 0.6558 | 11 | |
| | `lodo_ddr_convnext_tiny_best_ema.safetensors` | `lodo_ddr_convnext_tiny_best.safetensors` | `convnext_tiny` | ddr | 0.7506 | 3 | |
| | `lodo_ddr_deit3_small_patch16_384_best_ema.safetensors` | `lodo_ddr_deit3_small_patch16_384_best.safetensors` | `deit3_small_patch16_384` | ddr | 0.7252 | 3 | |
| | `lodo_ddr_maxvit_tiny_tf_384_best_ema.safetensors` | `lodo_ddr_maxvit_tiny_tf_384_best.safetensors` | `maxvit_tiny_tf_384` | ddr | 0.5483 | 14 | |
| | `lodo_eyepacs_convnext_tiny_best_ema.safetensors` | `lodo_eyepacs_convnext_tiny_best.safetensors` | `convnext_tiny` | eyepacs | 0.7820 | 1 | |
| | `lodo_eyepacs_deit3_small_patch16_384_best_ema.safetensors` | `lodo_eyepacs_deit3_small_patch16_384_best.safetensors` | `deit3_small_patch16_384` | eyepacs | 0.7684 | 8 | |
| | `lodo_eyepacs_maxvit_tiny_tf_384_best_ema.safetensors` | `lodo_eyepacs_maxvit_tiny_tf_384_best.safetensors` | `maxvit_tiny_tf_384` | eyepacs | 0.6500 | 17 | |
| | `lodo_messidor2_convnext_tiny_best_ema.safetensors` | `lodo_messidor2_convnext_tiny_best.safetensors` | `convnext_tiny` | messidor2 | 0.7615 | 10 | |
| | `lodo_messidor2_deit3_small_patch16_384_best_ema.safetensors` | `lodo_messidor2_deit3_small_patch16_384_best.safetensors` | `deit3_small_patch16_384` | messidor2 | 0.7253 | 5 | |
| | `lodo_messidor2_maxvit_tiny_tf_384_best_ema.safetensors` | `lodo_messidor2_maxvit_tiny_tf_384_best.safetensors` | `maxvit_tiny_tf_384` | messidor2 | 0.5182 | 8 | |
|
|
| ## Preprocessing |
|
|
| 1. Resize the RGB fundus image to 384x384 using the same offline preprocessing pipeline. |
| 2. Convert RGB to float in [0,1] and apply ImageNet normalization: mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225). |
|
|
| ## Loading |
|
|
| ```python |
| import json |
| from modeling import load_model |
| |
| config = json.load(open('config.json')) |
| model = load_model('lodo_eyepacs_convnext_tiny_best_ema.safetensors', config) |
| # model(x) returns CORN logits with shape (batch, 4) |
| ``` |
|
|
| Install `torch`, `timm`, and `safetensors`, and make the GradeEye source repository available on `PYTHONPATH`. |
|
|
| ## Intended use and limitations |
|
|
| These weights are released for research and reproducibility only. They are not validated for clinical diagnosis or treatment decisions. Performance varies substantially by held-out dataset and should not be interpreted as clinical-grade generalization. |
|
|
| Source code and paper materials: [https://github.com/ahmed-farhanur-rashid/gradeeye](https://github.com/ahmed-farhanur-rashid/gradeeye). |
|
|