/ Модель

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

Лицензия
AGPL 3.0
Библиотека
segmentation-models-pytorch
Опубликована
21 окт 2026

lm3_specimen_segmenter__unetpp_effb7_1024_dinov3_vith16plus_2048

Сегментация изображенийИзображение → mask3 профессии
1скачиваний за 30 дней0лайковвеса обновлены24 окт 2026

Описание модели

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

UNet++ с энкодером EfficientNet-B7 выделяет растительный материал на гербарных листах для построения масок и удаления фона.

Модель создана для проекта LeafMachine3 и выделяет растительный материал на изображениях гербарных листов, формируя бинарную маску переднего плана для удаления фона. Она используется на этапе specimen_segmenter и обрабатывает целое изображение листа; результаты можно сохранять как маски и цветные вырезки.

Это сегментационная сеть UNet++ с энкодером EfficientNet-B7, предварительно обученным на ImageNet. Модель дообучена целиком; DINOv3 применялся для создания обучающих масок и не входит в состав самой сети. Для работы LeafMachine3 доступны сборки ONNX и Core ML; README также описывает ONNX-инференс при размере входа 1024 и порог маски по умолчанию 0,5.

Модель предназначена для гербарных изображений и удаления фона вокруг растительного материала. README отмечает, что обучающие целевые маски были автоматически получены из предсказаний детекторов и признаков DINOv3, без нарисованной вручную разметки для этой задачи. Репозиторий распространяется по лицензии AGPL-3.0.

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

  • выделение растения на скане гербарного листа
  • создание бинарной маски гербарного образца
  • удаление фона вокруг растения на гербарном листе
  • экспорт маски и цветной вырезки образца в LeafMachine3

Ограничения

Обучающие маски автоматически построены по предсказаниям детекторов и признакам DINOv3, а не по ручной попиксельной разметке. Модель специализирована на гербарных листах; качество на других типах изображений README не описывает.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

lm3_specimen_segmenter__unetpp_effb7_1024_dinov3_vith16plus_2048

UNet++ with an EfficientNet-B7 encoder that separates plant material from everything else on a herbarium specimen sheet (binary foreground mask, used for background removal). Same network and input as lm3_specimen_segmenter__unetpp_effb7_1024; trained on new targets: masks derived from detector boxes with DINOv3 features instead of from SAM 3. Was the default specimen_segmenter model in LeafMachine3 3.0.1042; from 3.0.1043 the default is lm3_specimen_segmenter__unetpp_effb7_1024_dinov3_vith16plus_2048_consensus (UNet++ v8), and this model stays available as an alternate (lm3 models install --model specimen_segmenter=unetpp_effb7_1024_dinov3_vith16plus_2048).

LM3 metadata

FieldValue
LM3 actionspecimen_segmenter
LM3_default_modelfalse (default in 3.0.1042, replaced by unetpp_effb7_1024_dinov3_vith16plus_2048_consensus from 3.0.1043)
LM3_version3.0.1042 (minimum; earlier releases do not know this model key)
Model keyunetpp_effb7_1024_dinov3_vith16plus_2048 (training run unetpp-v2-1024-dinov3_vith16plus_2048-full-unionneg-final_grabcut, epoch 28 of 50)
Inputwhole sheet image, letterboxed onto a white 1024 x 1024 square, RGB, ImageNet mean/std normalization; tensor input [1, 3, 1024, 1024] float32
Outputlogits [1, 1, 1024, 1024]; apply sigmoid, threshold 0.5, remove the letterbox pad, resize to the sheet
Classes (1)plant (foreground)
Trained2026-10-21
Iteration2 (replaces iteration 1, epoch 22 of the same run: same targets and regime, later checkpoint)

Architecture

ComponentDetail
NetworkUNet++ (nested, densely connected skip pathways), segmentation_models_pytorch.UnetPlusPlus
EncoderEfficientNet-B7, initialized from ImageNet weights (encoder_weights="imagenet")
Head1 output channel, no activation (logits)
Parameters66.4 M
Exported weightsthe exponential-moving-average copy (decay 0.9998, with warm-up) at epoch 28, the best validation epoch of the run

The whole network is fine-tuned; only the encoder starts from pretrained weights. DINOv3 is not part of this model: it only produced the training targets.

Credits

  • segmentation_models.pytorch (Pavel Iakubovskii, MIT): the UNet++ implementation and the pretrained encoder loader. https://github.com/qubvel-org/segmentation_models.pytorch
  • UNet++: Zhou et al., "UNet++: A Nested U-Net Architecture for Medical Image Segmentation", 2018.
  • EfficientNet-B7: Tan and Le, "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks", 2019; ImageNet weights from EfficientNet-PyTorch (Apache-2.0).
  • DINOv3 (Meta): Siméoni et al., "DINOv3", 2025. The frozen ViT-H+/16 backbone whose features turned boxes into training masks (see Training data).
  • GrabCut: Rother, Kolmogorov and Blake, "GrabCut: Interactive Foreground Extraction using Iterated Graph Cuts", 2004 (OpenCV implementation); guided filter: He, Sun and Tang, 2013.

Files

FolderFileUse
pytorch/best.pttraining checkpoint (model + EMA weights); retraining
onnx/model.onnxLM3 default runtime (onnxruntime), opset 17
torchscript/model.torchscript.ptlibtorch
coreml/model.mlpackage/Apple devices (float16 input/output, iOS 16 / macOS 13)
docs/compare_*.jpg, failure_*.jpgexample panels (see Examples)

SHA-256 of every file is in manifest.json; training_metadata.json records the full training and dataset chain.

Training data

There is no hand-drawn ground truth for this task. The training targets are machine-generated from boxes, in five steps:

  1. Images. The training images of the LeafMachine3 plant detector (LM3_Plant, 23,726) and archival detector (LM3_Archival, 8,470), deduplicated (4,424 duplicates removed): 27,772 sheets from 100 labeling projects.
  2. Boxes. LeafMachine3's own detectors, run on every sheet the way a LeafMachine3 run does: the plant detector (lm3_plant_detector__yolo26x_det_1280, conf 0.3) and the archival detector (lm3_archival_detector__yolo26x_det_1280, conf 0.25). Both were trained on hand-drawn Labelbox boxes; these are their predictions. LeafMachine3's plant detector has no Specimen class, so Specimen boxes come from lm3_specimen_detector__yolo26n_det_640 (conf 0.35).
  3. Weak labels. Plant boxes mark plant (weight 2), Specimen boxes mark plant (weight 1), archival boxes mark background (weight 2), and 20 random boxes per sheet placed clear of every other box mark background (weight 1). Archival Envelope and Attached_Item boxes count as Specimen boxes, since packets hold plant material. Archival overrules plant; plant overrules Specimen. Everything else is unlabeled.
  4. DINOv3 probe. Each sheet, resized to a 2,048-pixel long edge, goes through a frozen DINOv3 ViT-H+/16 (one 1,280-dimensional feature per 16 x 16 pixel patch). Inside the plant and Specimen boxes, patches that look like the paper or the mounting are flagged by two filters (per sheet: closer to the sheet's background clusters than to its plant-box mean; across the training set: Gaussian mixtures of plant and background features) and treated as background. A small head (LayerNorm, Linear 1280 to 256, GELU, Linear 256 to 1) learns from the background patches directly and from each box as a multiple-instance bag: the top 40% of a plant box's patches, and the top 15% of a Specimen box's, should be plant. Validation: 99.7% of background patches correct, 99.4% of plant boxes satisfied.
  5. Masks. The head's per-patch plant probability (with a horizontal-flip average), upsampled with a guided filter, seeds GrabCut at 2,048 pixels: confident patches (p >= 0.5) are sure plant, the other kept patches and a two-patch ring are probable background, everything else (and every archival, random-background or flagged patch) is sure background. The result is a binary mask; on average 16.4% of a sheet is plant.

The result is dataset LM3_Specimen_Segmentation-dense-weak-bbox-from-plant-archival with masks pseudolabels_dinov3_vith16plus_2048-full-unionneg/final_grabcut. Sheets whose mask came out empty (239, mostly calibration photos, label-only sheets and Leafsnap leaves inside an archival box) are skipped. 9,934 of the sheets are Leafsnap lab and field photographs. Images and masks are not distributed.

SplitSheetsEmpty masks (skipped)
train22,277196
val2,78224
test2,71319

The splits are LM3_Plant's (sheets only in LM3_Archival keep its split), the same splits unetpp_effb7_1024 was trained with, so no sheet is held out from one model and trained on by the other.

Training

50 epochs planned (this is epoch 28, the best validation epoch of the run), batch 5, 1024 x 1024 letterbox, AdamW (lr 1e-4, weight decay 1e-4), cosine schedule over the planned epochs, mixed precision, EMA with warm-up. Loss: binary cross-entropy + Dice + 0.5 x boundary (Sobel edge) term, all weighted per pixel; the white letterbox pad is trained as background. Augmentation: horizontal and vertical flips, 90-degree rotations, transpose, brightness/contrast 0.2, hue/saturation/value 10/15/10. Same network and regime as unetpp_effb7_1024 apart from the loss weighting, the pad and the batch size (4 there). The run was stopped during epoch 50 after validation Dice against the pseudo masks had peaked at epoch 28 (0.939) and drifted down slowly afterward (0.937 at epoch 49).

Evaluation

Scores are agreement with machine-generated masks, not with human annotation, and the two target sets below have opposite biases: the DINOv3 masks this model trains on, and the SAM 3-derived masks unetpp_effb7_1024 trains on. Each model is favored on its own targets. Read them as consistency checks and judge quality from the examples. In the tables, UNet++ v1 is unetpp_effb7_1024 and UNet++ v2 is this model.

During training (validation, 2,758 sheets, against the DINOv3 masks, best epoch): Dice 0.939, IoU 0.901, boundary F 0.750.

Exported ONNX run the way LeafMachine3 runs it (the ingest working image, at most 3,200 pixels on the long side; threshold 0.5; scored at that resolution), on random samples (seed 7) of held-out sheets, both UNet++ models, with and without LeafMachine3's paper-removal step:

Against the DINOv3 masks (this model's targets; dense-weak test and val splits):

SplitModelSheetsDice (mean)Dice (median)PrecisionRecallDice < 0.5
testUNet++ v1 raw150 of 2,7130.8380.9060.8870.8407%
testUNet++ v1 + paper removal150 of 2,7130.8310.9100.9110.8248%
testUNet++ v2 raw150 of 2,7130.9300.9680.9300.9392%
testUNet++ v2 + paper removal150 of 2,7130.8640.9460.9640.8306%
valUNet++ v1 raw150 of 2,7820.8560.9200.8870.8635%
valUNet++ v1 + paper removal150 of 2,7820.8230.9110.8920.8219%
valUNet++ v2 raw150 of 2,7820.9290.9740.9350.9432%
valUNet++ v2 + paper removal150 of 2,7820.8560.9580.9530.8288%

Against the SAM 3-derived masks (unetpp_effb7_1024's targets; the same samples its card is scored on). These targets were themselves cleaned with the paper-removal rule, which favors the "+ paper removal" rows:

SplitModelSheetsDice (mean)Dice (median)PrecisionRecallDice < 0.5
testUNet++ v1 raw150 of 1,8400.9490.9770.9520.9592%
testUNet++ v1 + paper removal150 of 1,8400.9360.9790.9760.9273%
testUNet++ v2 raw150 of 1,8400.8710.9170.8710.9135%
testUNet++ v2 + paper removal150 of 1,8400.9160.9550.9540.9012%
valUNet++ v1 raw150 of 1,9100.9420.9790.9530.9503%
valUNet++ v1 + paper removal150 of 1,9100.9400.9810.9670.9353%
valUNet++ v2 raw150 of 1,9100.8710.9300.8800.9015%
valUNet++ v2 + paper removal150 of 1,9100.9160.9600.9620.8902%

Hand-placed points. On 12 sheets where unetpp_effb7_1024 failed, plant and background points were placed by hand (10 sheets are in this model's training split, 2 in test; 2 sheets hold no plant and have background points only):

ModelPlant points inside the maskBackground points outside the mask
UNet++ v1 raw2.5% of 441100.0% of 624
UNet++ v1 + paper removal1.1% of 441100.0% of 624
UNet++ v2 raw73.5% of 44195.0% of 624
UNet++ v2 + paper removal22.9% of 441100.0% of 624

The training loader decodes JPEGs at reduced size before the 1024 resize; LeafMachine3 decodes the full image. On 50 test sheets the two give masks with IoU 0.988 (minimum 0.961): the differences are boundary pixels.

Against its own targets and on the hand-placed points, paper removal lowers this model's recall a lot (it deletes plant that matches the paper); against the SAM 3 targets it raises precision (it deletes paper this model kept). Known weaknesses: on white paper the model can fill the paper between sparse stems and branches (panels 13 and 16 below), which paper removal partly cleans up; where the plant and the paper are close in color, paper removal deletes plant (see the last set of examples).

Examples

Background removal on the 20 sheets of the unetpp_effb7_1024 card, by that model (UNet++ v1) and this one (UNet++ v2). Black marks what each model removed; the percentage is the share of the sheet kept. Raw model masks, before LeafMachine3's paper-removal step. File names give each sheet's dataset split. Panels 1 to 12 are a standing comparison set that includes deliberately hard sheets (several from the training split); panels 13 to 20 are random test sheets.

Sheets the earlier UNet++ failed on

Held-out sheets on which unetpp_effb7_1024 removed most of the plant: tan, brown or gray-green material on paper or card of a similar color. Original | UNet++ v1 | UNet++ v2, raw model masks.

The same sheets with paper removal

LeafMachine3 follows the model with a paper-removal step (paperclean: true, the default): it samples the paper around the mask and deletes large regions inside the mask that match its color. Red marks what it deleted. On the first 4 sheets (the ones above) the plant and the paper are close in color, so the step removes plant as well as paper. On the last 4 it does what it is for: it removes paper the model kept, such as the paper between leaf lobes, and pale holes in leaves.

Use in LeafMachine3

Stage specimen_segmenter (no dependencies; runs on the whole working image, independent of the plant boxes). ONNX at 1024, sigmoid threshold conf (default 0.5), then the paper-removal step (paperclean: true). One mask per specimen is stored; the Reporter draws it as Overlay_Specimen_Segmentation and exports it under Specimen_Masks (binary mask and RGB cutout). lm3 models install puts it in models/specimen_segmenter/unetpp_effb7_1024_dinov3_vith16plus_2048/; the settings name it by key:

specimen_segmenter:
  model: {key: unetpp_effb7_1024_dinov3_vith16plus_2048, path: models/specimen_segmenter/unetpp_effb7_1024_dinov3_vith16plus_2048/model.onnx, format: onnx}
  paperclean: true
from huggingface_hub import hf_hub_download
path = hf_hub_download("phyloforfun/lm3_specimen_segmenter__unetpp_effb7_1024_dinov3_vith16plus_2048", "onnx/model.onnx")

Citation

Weaver, W. N. (2026) LeafMachine3. https://leafmachine.org

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

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

GPU в ailist

Универсальный рантайм · segmentation-models-pytorch

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
64a9ffc

0 моделей