Instructions to use adidukre/AFA-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use adidukre/AFA-LoRA with timm:
import timm model = timm.create_model("hf-hub:adidukre/AFA-LoRA", pretrained=True) - Notebooks
- Google Colab
- Kaggle
AFA-LoRA
Amplified fold-averaged low-rank adaptation with family-balanced logit fusion, for frame-level detection of neoplasia in Barrett's oesophagus. Final weights of Team GenMI's submission to the RARE 2026 challenge (MICCAI 2026).
Code: github.com/adinathdukre/AFA-LoRA
Model
25 binary frame classifiers, each a timm encoder with a linear head, initialised from the public GastroNet-5M self-supervised checkpoints.
| Members | Encoder | Input | Adaptation | Family |
|---|---|---|---|---|
| 15 | DINOv2 ViT-B/14, 4 registers | 336x336 | LoRA r16, merged (x1.5, fold-averaged) | dinov2_vitb |
| 5 | ResNet-50 (DINO) | 384x384 | full fine-tune | resnet50_dino |
| 5 | ResNet-50 (MoCo v2) | 384x384 | full fine-tune | resnet50_mocov2 |
The LoRA adapters are already merged, so every member is a plain timm state dict. Each member's
logit is standardised with the constants in ensemble.json, averaged within family, averaged
across families, and mapped to (0, 1) by 0.5 + arctan(x) / pi.
Files
ensemble.json fusion rule, member order, per-member temperature, bias and family
<run>_fold_<k>/meta.json timm architecture, input size, family
<run>_fold_<k>/model.safetensors weights
Usage
git clone https://github.com/adinathdukre/AFA-LoRA
cd AFA-LoRA
pip install -r requirements.txt huggingface_hub
huggingface-cli download adidukre/AFA-LoRA --local-dir /path/to/AFA-LoRA-weights
import sys
import numpy as np
import torch
sys.path.insert(0, "submission")
from ensemble import RareEnsemble
ensemble = RareEnsemble.from_directory("/path/to/AFA-LoRA-weights", torch.device("cuda"))
scores = ensemble.predict(np.zeros((4, 512, 640, 3), dtype=np.uint8), batch_size=32)
Input is a stack of uint8 RGB frames of shape (N, H, W, 3). The output is a ranking score, not a calibrated probability.
Training data
Only the official RARE release: 3,095 frames (158 neoplasia) from two centres.
Limitations
Research use only. Not a medical device and not validated for clinical decisions.
Licence
MIT. The GastroNet-5M checkpoints and the RARE data are subject to their own terms.
- Downloads last month
- -