Skip to content
Other

TRACE

энкодер снимков сетчатки без разметки болезней

2 min readupdated

Модель извлекает информативные признаки из цветных фотографий глазного дна и помогает находить патологии сетчатки, оценивать качество снимка и контролировать достоверность предсказаний. В основе лежит замороженный бэкбон ResNet-50 (выходной вектор размерностью 2048 с L2-нормализацией), обученный методом самообучения MoCo v2 без меток заболеваний на 22 500 снимках с симуляцией артефактов камер. В отличие от моделей с классическим обучением с учителем, TRACE устойчивее работает на новых камерах, снимках низкого качества и редких диагнозах с малым числом примеров. Решение создано командой div4maxxers (BMSIT Bengaluru) в рамках хакатона ZEISS India Campus Hackathon «Beyond Code 2026» и пригодится исследователям в области медицинской компьютерной диагностики.

Ключевые особенности

  • Обучение без разметки диагнозов с использованием безопасных для сетчатки аугментаций и симулятора артефактов камер.
  • В комплект входят 20 калиброванных детекторов находок (отёк диска зрительного нерва, кровоизлияния, друзы и др.).
  • Слой доверия trust.joblib включает 7-классовый классификатор с температурным масштабированием, конформные пороги под конкретные камеры и детекцию выхода за пределы распределения (OOD).
  • Отдельный фильтр качества quality.joblib отсеивает неудачные снимки, а банк прототипов bank.npz помогает распознавать редкие заболевания.

Что можно сделать

  • Извлекать 2048-мерные эмбеддинги изображений глазного дна для обучения собственных лёгких классификаторов или поиска похожих клинических случаев.
  • Запустить локальное интерактивное демо из связанного репозитория на порту 7860 для тестирования детекторов находок и оценки качества фото.
  • Использовать готовые веса как устойчивый к смене оборудования экстрактор признаков при работе с данными с разных фундус-камер.

Пример

import cv2
from encoder.export import load_trace_encoder, preprocess

enc = load_trace_encoder("checkpoints/trace_v2/encoder.pt")
x = preprocess(cv2.cvtColor(cv2.imread("fundus.jpg"), cv2.COLOR_BGR2RGB))   # (3, 384, 384)
features = enc(x[None])                                                       # (1, 2048)
Подробнее Метрики: linear probe AUROC на RFMiD — 0.917; на незнакомых камерах (Kowa / Topcon OCT-2000) — 0.921 / 0.858; top-1 на JSIEC-1000 (39 болезней по 5 фото) — 0.628; стресс-тест ошибок относительно ImageNet — 0.67.
Обучение: 22 500 публичных снимков глазного дна (EyePACS, APTOS, RFMiD), разрешение входа 384×384.
Ограничения: только для исследовательских целей, не является медицинским изделием; файлы .joblib являются Python pickle и требуют загрузки только из доверенного источника.
Discuss Telegram 0

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 0.1 GB · ready files0.6 GB
  • FP8 / INT8recommendedweights 0.0 GB0.5 GB
  • 4-bitweights 0.0 GB0.5 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · BF16 — from RTX 2060

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # higgsboson25/trace-retinal-encoder
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download higgsboson25/trace-retinal-encoder --local-dir ~/models/trace-retinal-encoder
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to trace-retinal-encoder
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of trace-retinal-encoder (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

higgsboson25/trace-retinal-encoder
Author
higgsboson25
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments