/ Модель

Характеристики

Лицензия
Своя лицензия
Базовая модель
vit_small_patch16_dinov3.lvd1689m
Библиотека
timm
Опубликована
17 сен 2026

fungitastic-dinov3-vits16-384

Классификация изображенийИзображение → label3 профессии

Компактный классификатор фотографий грибов, дообученный на FungiTastic для распознавания 2 827 видов, преимущественно в Северной и Центральной Европе.

43скачиваний за 30 дней0лайковвеса обновлены18 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

FungiTastic DINOv3 ViT-S/16 — модель классификации изображений грибов, созданная Paul Bauriegel дообучением компактного энкодера timm/vit_small_patch16_dinov3.lvd1689m. Она относит фотографию к одному из 2 827 видов, представленных в обучающей выборке FungiTastic, и предназначена для вспомогательного определения грибов в Северной и Центральной Европе, а также для дальнейшего дообучения. Модель содержит 22,7 млн параметров и принимает одно изображение размером 384×384 пикселя; доступны контрольная точка PyTorch и варианты TensorFlow Lite/LiteRT, включая версию с весами float16 и графом со встроенной предобработкой. В полном тестовом наборе точность top-1 составляет 72,6 %, а macro F1 — 45,9 %.

Модель компактна для классификатора такого уровня и поддерживает запуск на мобильных устройствах, в том числе через LiteRT GPU. Качество заметно зависит от количества примеров каждого вида: для редких видов оно низкое, а обучающие данные отражают частоты и географию Дании, поэтому за пределами Европы точность может снизиться. Классификация по одному снимку не всегда надёжна. Модель нельзя использовать для решения, безопасен ли гриб в пищу: она ошибается примерно в четверти случаев и не заменяет специалиста-миколога. Лицензия указана как other; конкретные условия использования в карточке не приведены.

Сценарии применения

  • предварительное определение вида гриба по фотографии
  • классификация грибов в мобильном приложении
  • вспомогательная идентификация грибов при полевых наблюдениях
  • классификация снимков грибов из датского атласа
  • дообучение классификатора грибов на новых данных

Ограничения

Качество низкое для видов с малым числом обучающих изображений; данные преимущественно отражают грибы Дании, поэтому за пределами Европы точность может быть ниже. Модель ошибается примерно на четверти тестовых изображений и не предназначена для оценки съедобности грибов.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

FungiTastic DINOv3 ViT-S/16 @ 384 px

A fine-grained fungi classifier over 2,827 species, built by fine-tuning the DINOv3 ViT-S/16 backbone on the FungiTastic closed-set benchmark. It ships as a PyTorch checkpoint and as a TensorFlow Lite / LiteRT model whose graph includes preprocessing, so mobile apps can feed raw camera pixels.

At 22.7M parameters it reaches 72.6 % top-1 on the full test set, within 2.7 points of the dataset paper's best baseline (BEiT-Base/16 at 384 px, 75.3 %), while being about four times smaller, and it beats that baseline's macro F1 (45.9 vs 44.5).

Results

Full FungiTastic closed-set test split, 91,832 images, 2,336 species present, single image, no test-time augmentation.

MetricValue
Top-10.7263
Top-30.8484
Macro F10.4593
Cross-entropy loss1.432

Validation (fixed 15,000-image subset) at the selected epoch: top-1 0.7327, top-3 0.855, macro F1 0.482.

Accuracy depends strongly on how many training images a species has, which is the main limitation of this model:

Training images per speciesSpeciesTest top-1
< 203250.272
20–505940.404
50–1004390.534
100–5007490.711
> 5002270.829

Example of a well-represented species, Imleria badia (bay bolete, 1,437 training images, 417 test images): precision 0.882, recall 0.861, F1 0.871.

Files

FileDescription
mushroom_model_dynamic.tfliteTFLite / LiteRT model, 91 MB float32, input [1,384,384,3], output [1,2827]
mushroom_model_fp16.tfliteSame graph with float16 weights (+ DEQUANTIZE), 46 MB; logits within 0.01 of the float32 file
labels.txt2,827 species names, one per line, index-aligned with the output
export_info.jsonExport metadata: source checkpoint, converter versions, tensor shapes, fp16-safety calibration scales
converter/The PyTorch → TFLite converter that produced these files: source snapshot, pinned requirements.txt, config.yaml, calibration.json, convert.sh

The PyTorch checkpoint (best.pt, 91 MB) stores model_state, model_name, img_size, num_classes and labels.

Usage

PyTorch / timm

import timm, torch
from PIL import Image

ckpt = torch.load("best.pt", map_location="cpu", weights_only=False)
labels = ckpt["labels"]
model = timm.create_model(ckpt["model_name"], pretrained=False,
                          num_classes=ckpt["num_classes"], img_size=ckpt["img_size"])
model.load_state_dict(ckpt["model_state"])
model.eval()

cfg = timm.data.resolve_model_data_config(model)
tf = timm.data.create_transform(**cfg, is_training=False)   # resize 439, center-crop 384, ImageNet mean/std
x = tf(Image.open("mushroom.jpg").convert("RGB")).unsqueeze(0)

with torch.no_grad():
    probs = model(x).softmax(-1)[0]
top = probs.topk(3)
print([(labels[i], round(p.item(), 3)) for p, i in zip(top.values, top.indices)])

TFLite / LiteRT

Preprocessing is baked into the graph. Feed raw pixels in [0, 255], NHWC, float32; the model does the normalisation internally. The output is logits, so apply softmax yourself.

import numpy as np
from ai_edge_litert.interpreter import Interpreter
from PIL import Image

it = Interpreter(model_path="mushroom_model_dynamic.tflite", num_threads=4)
it.allocate_tensors()
inp, out = it.get_input_details()[0], it.get_output_details()[0]

img = Image.open("mushroom.jpg").convert("RGB").resize((384, 384), Image.BILINEAR)
it.set_tensor(inp["index"], np.asarray(img, dtype=np.float32)[None])   # 0..255, no normalisation
it.invoke()

logits = it.get_tensor(out["index"])[0]
probs = np.exp(logits - logits.max()); probs /= probs.sum()
labels = open("labels.txt").read().splitlines()
print(sorted(zip(probs, labels))[-3:][::-1])

On Android, resize the bitmap to 384×384 and pass the float buffer straight to the interpreter. Measured latency on an Apple M2 CPU with XNNPACK and 4 threads is about 0.13 s per image on an idle machine.

Android GPU (LiteRT CompiledModel, Accelerator.GPU)

The graph is prepared for the LiteRT GPU accelerator: no tensor above 4-D, no BROADCAST_TO, uniform FULLY_CONNECTED ranks, and LayerNorm/softmax calibrated so fp16 activations cannot overflow (export_info.json: fp16_safe). Measured on a Pixel 7 Pro (Mali-G710, LiteRT 2.2, medians of 10 runs):

PrecisionPer imageMax logit difference vs CPU
FP32209 ms2e-5
FP16_WITH_FP32_ACCUM (recommended)126 ms0.012
FP16118 ms0.11

The stock timm graph, without these rewrites, fails to compile on this GPU and returns NaN in fp16.

Reproducing the conversion

converter/ holds the exact converter source and versions. With the checkpoint next to it:

cd converter && pip install -r requirements.txt && ./convert.sh ../best.pt ../reproduced

This regenerates both .tflite files byte-for-byte (the fp16-safety scales are replayed from calibration.json, so the dataset is not needed). The rewrites applied at export, all exact in float32: 4-D-only attention, constant RoPE tables and prefix tokens, LayerNorm and softmax prescales for fp16, LayerNorm/layer-scale/attention-scale folding, keep_num_dims on every FULLY_CONNECTED, and float16 weight compression for the second file. See converter/fungi_dinov3/export.py.

Training

Backbone: timm/vit_small_patch16_dinov3.lvd1689m (DINOv3, 21.6M params, self-supervised on LVD-1689M).

The model was trained as a resolution ladder, each stage warm-started from the previous best checkpoint:

StageDataResolutionResult (val top-1)
1FungiTastic-Mini, 214 species224 px0.731
2FungiTastic full, 2,827 species (backbone reused, new head)320 px0.719
3FungiTastic full384 px0.733

Final stage: 4 epochs over 433,702 training images, AdamW, head LR 2.5e-4, backbone LR 1e-5 with layer-wise decay 0.8, cosine schedule with warmup, weight decay 0.05, label smoothing 0.1, gradient clipping 1.0, batch 16 with gradient accumulation 2, fp32 on Apple Silicon (MPS). Augmentation: random resized crop (scale 0.5–1.0), horizontal flip, mild brightness/contrast jitter, Mixup 0.2 / CutMix 1.0 on half the batches. Class-balanced sampling with sqrt-inverse frequency weights for the long tail, and an exponential moving average of the weights (decay 0.9999) evaluated each epoch; the released checkpoint is the better of the raw and EMA weights.

Training took about 19 hours per epoch on an Apple M2 laptop.

Intended use and limitations

Intended for assisted identification of fungi in Northern and Central Europe, and as a starting point for further fine-tuning.

  • Not safe for deciding what to eat. Many deadly species have edible look-alikes, and the model is wrong on roughly one image in four. Never use it to judge edibility. Consult a qualified mycologist.
  • Long tail is weak. 325 species with fewer than 20 training images reach only 27 % top-1, and 302 species in the test set are never predicted correctly. They account for 1.4 % of test images.
  • Geographic and seasonal bias. The data comes from the Atlas of Danish Fungi, so species frequencies reflect Denmark. Accuracy elsewhere, especially outside Europe, will be lower.
  • Single-image predictions. Accuracy improves when several photos of the same specimen are averaged.
  • Labels are binomials (genus species). Species sharing a binomial under different authorities were merged, so the label space has 2,827 classes rather than the benchmark's 2,829.
  • Input must be 384×384, batch 1. The graph has static shapes; resize before inference. (The converter can export other static batch sizes; batching did not improve per-image latency on a Pixel 7 Pro GPU.)

Licensing

  • Weights derive from DINOv3, which is covered by the DINOv3 License. Distribute a copy of that license with the model and pass it on to downstream users; its use restrictions apply.
  • Training data, FungiTastic, is published under CC BY-NC-SA 4.0. Whether trained weights count as an adaptation of the images is legally unsettled; the conservative reading is that this model inherits the non-commercial and share-alike terms. For commercial use, obtain permission from the dataset authors.

Citation

@InProceedings{Picek_2025_CVPR,
  author    = {Picek, Lukas and Janouskova, Klara and Cermak, Vojtech and Matas, Jiri},
  title     = {FungiTastic: A Multi-Modal Dataset and Benchmark for Image Categorization},
  booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR) Workshops},
  year      = {2025},
  pages     = {2046--2056}
}

@article{simeoni2025dinov3,
  title   = {DINOv3},
  author  = {Sim{\'e}oni, Oriane and others},
  journal = {arXiv preprint arXiv:2508.10104},
  year    = {2025}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · timm · image-classification

Можно запустить

Подбираем GPU…

Ревизия весов
4043bd3

0 моделей