Views
No views yet
📢 Domain & Email Migration NoticeFrom May 30th, 2026, Fundusnap will transition to new domains as
fundusnap.com will not be renewed:🌐 Website: fundusnap.faizath.com (formerly fundusnap.com)
⚙️ API: fundusnap-api.faizath.com (formerly api.fundusnap.com) 📧 Email: contact@fundusnap.faizath.com (formerly contact@fundusnap.com) 🛰️ CDN: fundusnap-cdn.faizath.com (formerly cdn.fundusnap.com) 📈 Status Pages: https://status.faizath.com/status/fundusnap (formerly status.fundusnap.com) |

yolo11m.pt checkpoint at 640×640 —
roughly 20M parameters, hence the name: lesiondet (lesion detection) + yolo11m (YOLO11
medium) + 20m (parameter count).best.pt checkpoint, ready for inference or further fine-tuning,
together with the FastAPI service Fundusnap uses to serve it.model.names order:| Index | Class | What it is |
|---|---|---|
| 0 | Artefact | Image capture artefact (dust, glare, reflection) — not retinal pathology |
| 1 | Atrophic Scar | Healed atrophic scarring of the retina/choroid |
| 2 | Atrophy | Retinal or chorioretinal atrophy |
| 3 | Disc | Anatomical landmark — the optic disc |
| 4 | Flame R-hemorrhage | Flame-shaped retinal haemorrhage (nerve fibre layer) |
| 5 | Fovea | Anatomical landmark — the fovea / macular centre |
| 6 | H-exudate | Hard exudate (lipid deposit) |
| 7 | IRMA | Intraretinal microvascular abnormality |
| 8 | Laser Scar | Photocoagulation scar from prior laser treatment |
| 9 | Microaneurysm | Microaneurysm — the earliest visible DR lesion |
| 10 | R-hemorrhage | Retinal haemorrhage (dot/blot) |
| 11 | S-exudate | Soft exudate / cotton-wool spot |
Disc, Fovea, and Artefact are not lesions. Disc and Fovea are normal anatomy
present in essentially every gradable image, and Artefact marks image-quality problems. Any
downstream logic that counts detections as evidence of disease must exclude these three.| Path | What it is |
|---|---|
models/fundus_artifacts.pt | The model. Ultralytics best.pt, stripped of optimiser/EMA state (~40 MB, stored via Git LFS). |
main.py | FastAPI service that loads the checkpoint and exposes JSON and annotated-image endpoints. |
Dockerfile | Container build for that service (python:3.10-slim, port 8000). |
requirements.txt | Runtime dependencies for the service. |
pip install ultralytics1from ultralytics import YOLO
2
3model = YOLO("models/fundus_artifacts.pt")
4
5# conf/iou default to 0.25 / 0.7 — lower conf if you would rather over-detect than miss lesions.
6results = model("fundus.jpg", conf=0.25, iou=0.7, imgsz=640)
7
8for r in results:
9 for box in r.boxes:
10 x1, y1, x2, y2 = map(int, box.xyxy[0])
11 cls_id = int(box.cls[0])
12 conf = float(box.conf[0])
13 print(f"{model.names[cls_id]:20s} {conf:.2f} [{x1}, {y1}, {x2}, {y2}]")
14
15# Annotated image as a BGR numpy array (what /visualize/fundus-artifacts/ returns):
16annotated = results[0].plot()(N, H, W, 3) array.model.export(format="onnx", opset=14, dynamic=True) # also: torchscript, tflite, coreml, engineepoch: -1, no optimiser or EMA state), so it resumes as a starting
point, not as a paused run:1model = YOLO("models/fundus_artifacts.pt")
2model.train(data="your_dataset/data.yaml", epochs=50, imgsz=640, batch=16)data.yaml must keep the same twelve class names in the same order, or retrain the head.FUNDUS-3/data.yaml. The dataset itself is not published with this model, and its
provenance was not recorded in the checkpoint — image counts, split sizes, source cameras,
annotator count, and licensing terms are all unknown from the artefacts in this repository. Treat
every number below as a description of that run, not as an evaluation on any known public benchmark.train_args)| Base model | yolo11m.pt, COCO-pretrained |
| Architecture | yolo11m.yaml, scale m (depth 0.5, width 1.0), nc=12, anchor-free Detect head |
| Input | 640×640, letterboxed |
| Epochs | 35 (patience=100, so no early stop) |
| Batch size | 16 (nbs=64 nominal) |
| Optimizer | auto, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005 |
| Warmup | 3 epochs, warmup_momentum=0.8 |
| Loss weights | box 7.5, cls 0.5, dfl 1.5 |
| Augmentation | mosaic 1.0 (disabled for the last 10 epochs), fliplr=0.5, scale=0.5, translate=0.1, HSV (0.015/0.7/0.4), erasing=0.4, RandAugment |
| Not used | flipud, degrees, shear, perspective, mixup, copy_paste |
| Precision | AMP |
| Seed | 0, deterministic=True |
| Ultralytics | 8.3.165 (run object_detection_model_v1, 2025-07-13) |
| Epoch | box_loss | cls_loss | dfl_loss | Precision | Recall | mAP@50 | mAP@50-95 |
|---|---|---|---|---|---|---|---|
| 1 | 2.3819 | 3.0624 | 1.4673 | 0.2534 | 0.2641 | 0.2048 | 0.0955 |
| 5 | 1.9664 | 1.4739 | 1.1881 | 0.3955 | 0.4270 | 0.4079 | 0.1925 |
| 10 | 1.8575 | 1.3348 | 1.1310 | 0.4918 | 0.4582 | 0.4587 | 0.2325 |
| 15 | 1.7731 | 1.2301 | 1.1132 | 0.5443 | 0.4606 | 0.4961 | 0.2575 |
| 20 | 1.7162 | 1.1354 | 1.0861 | 0.5211 | 0.5088 | 0.5289 | 0.2639 |
| 27 | — | — | — | 0.5354 | 0.5252 | 0.5343 | 0.2819 |
| 30 | 1.5557 | 0.9660 | 1.0399 | 0.5279 | 0.5054 | 0.5132 | 0.2633 |
| 35 | 1.4925 | 0.8980 | 1.0153 | 0.5573 | 0.5154 | 0.5300 | 0.2744 |
models/fundus_artifacts.pt.| Metric | Value |
|---|---|
| Precision | 0.5354 |
| Recall | 0.5252 |
| mAP@50 | 0.5343 |
| mAP@50-95 | 0.2819 |
Fitness (0.1·mAP50 + 0.9·mAP50-95) | 0.3071 |
results.csv, confusion matrix, and PR curves
were not retained, and the checkpoint stores aggregates only. Since the twelve classes are very
unevenly difficult — the optic disc is a large, high-contrast, always-present object, while a
microaneurysm is a handful of pixels — the aggregate almost certainly hides a wide spread, with the
landmark classes propping the average up and the small-lesion classes well below it. Do not read
mAP@50 ≈ 0.53 as "roughly half-right on lesions".model-index metadata at the top of this card, which is why the Hub
labels them as such.Disc, Fovea)
are large, high-contrast anatomy present in nearly every image, and detecting them is close to
trivial. They are pooled into the same mAP as microaneurysms.Atrophy vs Atrophic Scar or R-hemorrhage vs Flame R-hemorrhage
depend on the annotator's convention rather than a published grading standard.Artefact. A blurred, over-exposed, or non-fundus image still
yields plausible-looking boxes; the Artefact class flags local capture problems, not
whole-image ungradability.main.py is what the Fundusnap backend calls (FUNDUSNAP_AI_HOST).| Method | Path | Returns |
|---|---|---|
POST | /inspect/fundus-artifacts/ | JSON: filename, model_used, and detections[] with class_name, confidence, and integer box.{x1,y1,x2,y2} |
POST | /visualize/fundus-artifacts/ | image/jpeg — the input with red boxes and labels drawn on |
GET | / | Health check with the list of loaded models |
POST endpoints take a multipart/form-data upload under the field name file.1# JSON detection results
2curl -X POST "http://localhost:8000/inspect/fundus-artifacts/" \
3 -H "accept: application/json" \
4 -F "file=@fundus_image.jpg"
5
6# Annotated image
7curl -X POST "http://localhost:8000/visualize/fundus-artifacts/" \
8 -H "accept: image/jpeg" \
9 -F "file=@fundus_image.jpg" \
10 --output detection_result.jpg1docker build -t fundusnap-lesiondet .
2docker run -p 8000:8000 fundusnap-lesiondet
3curl http://localhost:8000/1pip install -r requirements.txt
2uvicorn main:app --host 0.0.0.0 --port 8000http://localhost:8000/docs. The model is loaded once at import time; if
models/fundus_artifacts.pt is missing (e.g. Git LFS was not fetched), the service still starts but
both detection endpoints return HTTP 500 — check GET / for an empty loaded_models.license: AGPL-3.0 (https://ultralytics.com/license). Ultralytics treats derivative
weights as covered by AGPL-3.0 unless you hold an Ultralytics Enterprise licence, so review
Ultralytics' licensing terms before redistributing or building on
this model. The training data carries its own separate terms, which are not published here.1@software{fundusnap_lesiondet_yolo11m_20m,
2 title = {fundusnap-v1-lesiondet-yolo11m-20m: YOLO11m retinal lesion detector},
3 author = {Fundusnap},
4 url = {https://huggingface.co/fundusnap/fundusnap-v1-lesiondet-yolo11m-20m},
5 license = {CC-BY-NC-4.0}
6}