/ Модель

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

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

lm3_specimen_segmenter__unetpp_effb7_1024_dinov3_vith16plus_2048_selftrain

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

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

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

UNet++ v9 выделяет растительные образцы на гербарных листах и создаёт маску для удаления фона в LeafMachine3.

Модель UNet++ v9 разработана для LeafMachine3 и отделяет растительный материал от фона на изображениях гербарных листов, формируя бинарную маску для удаления фона. Это сегментационная сеть с энкодером EfficientNet-B7, предобученным на ImageNet; она выдаёт одноканальные логиты. Модель обучена с нуля относительно весов предыдущей версии на самосгенерированных масках UNet++ v8, очищенных этапом удаления бумаги в LeafMachine3. Она стала моделью specimen_segmenter по умолчанию в LeafMachine3 начиная с версии 3.0.1044 и предназначена для обработки целого изображения листа; для запуска доступны ONNX и Core ML варианты.

В тестах на случайных листах следующий этап удаления бумаги убирал медианно 0,08% пикселей маски v9. Для использования требуется LeafMachine3 версии не ниже 3.0.1044. Изображения, маски и веса, использованные для обучения, не распространяются вместе с моделью. Лицензия репозитория — AGPL-3.0.

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

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

Ограничения

Для работы с моделью требуется LeafMachine3 версии 3.0.1044 или выше. Обучающие изображения, маски и веса не входят в поставку.

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

lm3_specimen_segmenter__unetpp_effb7_1024_dinov3_vith16plus_2048_selftrain

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). This is UNet++ v9: the network and training recipe of UNet++ v8, trained again on v8's own masks after LeafMachine3's paper cleanup (self-training). It produces the cleaned result directly: the paper-removal step that follows it in LeafMachine3 now removes a median 0.08% of its mask on random test sheets, against 1.2% of v8's. Default specimen_segmenter model in LeafMachine3 >= 3.0.1044, replacing v8.

LM3 metadata

FieldValue
LM3 actionspecimen_segmenter
LM3_default_modeltrue (replaces unetpp_effb7_1024_dinov3_vith16plus_2048_consensus)
LM3_version3.0.1044 (minimum; earlier releases do not know this model key)
Model keyunetpp_effb7_1024_dinov3_vith16plus_2048_selftrain (training run unetpp-v9-1024-dinov3_vith16plus_2048-v5targets-v8ep7llr-tta-30ep, epoch 30 of 30)
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-25
Iteration1

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 30 of 30

The whole network is trained from the ImageNet encoder; it does not start from v8's weights. v8 and the paper-removal step 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 behind the original targets of this model line.
  • Generalized cross-entropy: Zhang and Sabuncu, "Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labels", 2018.

Files

FolderFileUse
pytorch/best.ptthe exported weights (EMA copy at epoch 30, key ema) with the training config; 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)
coreml_fp32/model.mlpackage/, model.jsonLM3 on macOS: Core ML on the Apple GPU, float32
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

Self-training: the targets are the released UNet++ v8 (revision 112f2da, epoch 7) run over all 27,772 sheets, then LeafMachine3's paper cleanup. For every sheet, on the 2,048-pixel grid every earlier target set used:

  1. v8 three times: as is, flipped horizontally, and with the sheet scaled to 0.75 inside the 1024 canvas.
  2. Target: the first pass thresholded at 0.5, then LeafMachine3's LLR_Hyst_KeepBlobs paper removal (15.75% of a sheet is plant before it, 15.15% after).
  3. Pixels where the three passes disagree are left out of training (weight 0; 0.58% of a sheet on average), so v9 does not learn v8's least certain calls.

v8's own targets (DINOv3 masks, context cleaning, Leafsnap leaf union, consensus weights) are described on its card. The result is dataset LM3_Specimen_Segmentation-dense-weak-bbox-from-plant-archival, masks pseudolabels_v5-unetpp_v8ep7-llr/final_v8llr and weights pseudolabels_v5-unetpp_v8ep7-llr/weights. Sheets whose mask is empty are skipped. Images, masks and weights are not distributed.

SplitSheetsEmpty masks (skipped)
train22,277147
val2,78223
test2,71319

The splits are the ones v1, v2 and v8 were trained with.

Training

v8's recipe unchanged: 30 epochs, batch 5, 1024 x 1024 letterbox, AdamW (lr 1e-4, weight decay 1e-4), cosine schedule, mixed precision, EMA with warm-up; generalized cross-entropy (q 0.7) + Dice + 0.5 x image-edge term (alpha 10), weighted per pixel; a 6-pixel band around every target outline is not learned unless the image has an edge there; the white letterbox pad is trained as background. Augmentation: flips, 90-degree rotations, transpose, brightness/contrast 0.2, hue/saturation/value 10/15/10.

Checkpoint. This is the last epoch. v8 was released at epoch 7 because its machine-made targets drop pale and thin plant, and plant recall fell as training went on; v9's targets do not have that bias, and plant recall on hand-placed points stayed between 0.91 and 0.93 for all 30 epochs. Label-free checks (full-sheet input, threshold 0.5) against the released v8 pipeline:

CheckUNet++ v8 + paper removal (released pipeline)UNet++ v9, no cleanupUNet++ v9 + paper removal
Plant recall on hand-placed points (12 hard sheets)0.9090.9140.914
Background points correct (same sheets)0.9890.9790.989
Fill precision (24 sheets with thin stems on white paper)0.8310.8260.840
Thin-structure recall (same sheets)0.7090.7090.696
Petiole recall (50 Leafsnap photos)0.6810.6910.671

Evaluation

Scores are agreement with machine-generated masks, not with human annotation, and each target set has its own bias. Read them as consistency checks and judge quality from the examples. UNet++ v1 is unetpp_effb7_1024, UNet++ v2 is unetpp_effb7_1024_dinov3_vith16plus_2048, UNet++ v8 is unetpp_effb7_1024_dinov3_vith16plus_2048_consensus and UNet++ v9 is this model; "+ paper removal" is LeafMachine3's paper-removal step with its default method (LLR_Hyst_KeepBlobs).

During training (validation, 2,759 sheets, epoch 30): Dice 0.984, IoU 0.970, boundary F 0.913 -- against v8's own masks, so this measures how closely v9 reproduces its teacher, not quality.

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 test sheets; the validation split is in evaluation_metrics.json.

Against v8's training targets (DINOv3 masks after context cleaning and the Leafsnap leaf union):

ModelSheetsDice (mean)Dice (median)PrecisionRecallDice < 0.5
UNet++ v1 raw150 of 2,7130.8730.9270.8830.8955%
UNet++ v1 + paper removal150 of 2,7130.8810.9390.9050.8884%
UNet++ v2 raw150 of 2,7130.9100.9650.8830.9644%
UNet++ v2 + paper removal150 of 2,7130.9210.9690.9300.9323%
UNet++ v8 raw150 of 2,7130.9380.9700.9280.9651%
UNet++ v8 + paper removal150 of 2,7130.9270.9640.9380.9351%
UNet++ v9 raw150 of 2,7130.9260.9650.9310.9361%
UNet++ v9 + paper removal150 of 2,7130.9250.9630.9330.9311%

Against the SAM 3-derived masks (unetpp_effb7_1024's targets; the samples its card is scored on). These targets were themselves cleaned with the original paper-removal rule:

ModelSheetsDice (mean)Dice (median)PrecisionRecallDice < 0.5
UNet++ v1 raw150 of 1,8400.9490.9770.9520.9592%
UNet++ v1 + paper removal150 of 1,8400.9340.9640.9620.9202%
UNet++ v2 raw150 of 1,8400.8710.9170.8710.9135%
UNet++ v2 + paper removal150 of 1,8400.9030.9510.9290.9074%
UNet++ v8 raw150 of 1,8400.9070.9510.9110.9312%
UNet++ v8 + paper removal150 of 1,8400.9190.9650.9390.9242%
UNet++ v9 raw150 of 1,8400.9190.9640.9390.9243%
UNet++ v9 + paper removal150 of 1,8400.9200.9650.9420.9223%

Hand-placed points. On 12 sheets where unetpp_effb7_1024 failed, plant and background points were placed by hand (10 sheets are in the 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 removal2.5% of 441100.0% of 624
UNet++ v2 raw73.5% of 44195.0% of 624
UNet++ v2 + paper removal73.5% of 44196.0% of 624
UNet++ v8 raw90.5% of 44198.1% of 624
UNet++ v8 + paper removal90.5% of 44199.0% of 624
UNet++ v9 raw90.9% of 44197.9% of 624
UNet++ v9 + paper removal90.9% of 44198.9% 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.985 (minimum 0.916).

Known weaknesses: v9 learned the paper cleanup's decisions along with its benefits, so on sheets where a leaf is nearly the color of the paper (very pale or whitish leaves on tan paper) it can leave out part of that leaf even before any cleanup runs; thin, pale stems and roots on white paper are the other place it is cautious. Against the leaf segmenter's petioles on Leafsnap photos it matches v8 raw (0.69) and is slightly lower after the cleanup (0.67).

Examples

Background removal on the 20 sheets of the unetpp_effb7_1024 card (the same sheets as the v2 and v8 cards). Top row: Original | UNet++ v1 | UNet++ v2 | UNet++ v8; bottom row: UNet++ v8 + paper removal (the released v8 pipeline) | UNet++ v9 | UNet++ v9 + paper removal. Black marks what each model removed, red what paper removal deleted; the percentage is the share of the sheet kept. 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 v1 UNet++ failed on

The held-out sheets of the v8 card on which unetpp_effb7_1024 removed most of the plant. Original | UNet++ v1 | UNet++ v2 | UNet++ v8 | UNet++ v9, raw model masks.

The same sheets with paper removal

LeafMachine3's paper-removal step (paperclean: true, default method LLR_Hyst_KeepBlobs) after each model. Red marks what it deleted. The last 4 sheets are ones where the step has paper to remove.

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, method LLR_Hyst_KeepBlobs while LLR_Hyst_KeepBlobs: true; false selects the original HSV method). Both masks are saved by default: the Reporter exports this model's own mask under Specimen_Masks/*_Specimen and the paper-cleaned one under *_Specimen_PaperCleaned, each as a binary mask, an RGB cutout and their inverses, and draws the cleaned mask as Overlay_Specimen_Segmentation. lm3 models install puts the model in models/specimen_segmenter/unetpp_effb7_1024_dinov3_vith16plus_2048_selftrain/; the settings name it by key:

On macOS, LM3 runs coreml_fp32/ with Core ML on the Apple GPU instead; its output matches this ONNX model to float32 rounding.

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

Citation

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

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

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

GPU в ailist

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

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

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

Ревизия весов
e98803c

0 моделей