/ Модель

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

Лицензия
MIT
Базовая модель
mobilenetv2
Библиотека
pytorch
Опубликована
16 июн 2026

seaturtle_reid_mobilenetv2-quadruplet-random-combined_datasets

Эмбеддинги изображенийИзображение → embedding3 профессии

Модель извлекает эмбеддинги фотографий морских черепах для поиска особей по сходству в размеченной галерее.

1 243скачиваний за 30 дней0лайковвеса обновлены20 авг 2026

Бенчмарки

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

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

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

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

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

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

Модель marcmarais-ru/seaturtle_reid_mobilenetv2-quadruplet-random-combined_datasets разработана для повторной идентификации отдельных морских черепах по фотографиям. Она извлекает 512-мерный вектор признаков, который сравнивают с векторами размеченной галереи по косинусному или евклидову расстоянию; типичный сценарий — поиск ближайшего совпадения в закрытом наборе известных особей.

Архитектура включает полностью дообученный MobileNetV2, обучаемый GeM-пулинг, линейный слой, LayerNorm, ReLU и Dropout. Модель обучена с quadruplet loss на головных кропах SeaTurtleID2022 и данных популяций Амвракикоса и Реюньона. Для оценки указаны вход 384×384 и аугментация из десяти кропов. Репозиторий использует PyTorch и формат safetensors; лицензия — MIT.

По опубликованной оценке на случайном закрытом разбиении средний Recall@1 составил 0,7166, а Recall@5 — 0,7722; результаты относятся к заданному протоколу и трём сиду обучения. Модель предназначена для исследований и бенчмарков повторной идентификации животных. Она обучена только на трёх популяциях морских черепах, не предназначена для открытого поиска незнакомых особей или идентификации людей; качество на других видах и условиях съёмки не проверено. Закрытый протокол предполагает, что особь из запроса присутствует в галерее.

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

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

Ограничения

Обучение охватывает только три популяции морских черепах, поэтому перенос на другие виды и условия съёмки не проверен. Закрытый поиск предполагает наличие особи в галерее; качество на временных разбиениях существенно ниже.

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

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

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

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

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

Открыть на Hugging Face

MobileNetV2 + GeM + Batch-Hard Quadruplet — Turtle Re-Identification (Combined Datasets)

A re-identification embedding model for individual sea-turtle recognition. It maps a turtle photo to a 512-d L2-normalisable embedding; identity is decided by nearest-neighbour retrieval (cosine / Euclidean on the unit sphere) against a labelled gallery. Trained jointly on the heads-crop SeaTurtleID2022 set plus two additional sea-turtle datasets (Amvrakikos, Reunion) so the learned embedding generalises across photography conditions and populations.

This is a reproduction of the SeaTurtleID2022 re-id protocol using a MobileNetV2 backbone (not the paper's Swin-B/ArcFace), trained with batch-hard quadruplet loss and WeightedMPerClassSampler — deliberately a small, fully-trainable backbone with a metric loss, to show how far that recipe reaches.

This checkpoint corresponds to the combined multi-species (Experiment 2) model in the accompanying paper. It is the only released checkpoint; the single-species Experiment 1 model is not released. Every number reported on this card is reproducible from the shipped eval.py and model.py (no project code required): load the weights from the Hub with MobileNetV2ReID.from_pretrained and run python eval.py to recompute the Results table below under the closed-set train-gallery k-NN protocol with 10-crop TTA at 384.

Model

  • Architecture: MobileNetV2 (fully unfrozen) → Generalized Mean pooling (GeM, p=3.0 learnable) → Linear(1280→512) → LayerNorm → ReLU → Dropout(0.3)
  • Embedding dim: 512 (L2-normalise before retrieval)
  • Input resolution: 384×384 (centre-crop at eval; resize→random-crop at train)
  • Loss: batch-hard quadruplet (top-k=6 soft-hard mining; alpha=0.3, beta=0.1)
  • Sampler: WeightedMPerClassSampler (m=4 instances per identity per batch)
  • Batch size: 128 (32 classes/batch → 124 negatives/anchor; larger batch both lifted R@1 and collapsed seed variance ~8× vs the v7 batch-64 config)
  • Schedule: 150 epochs, LinearLR 5-epoch warmup → CosineAnnealingWarmRestarts(T_0=75, T_mult=2), base LR 1.4e-4 (scaled ~√2 from 1e-4 to offset fewer optimizer steps at batch 128), AMP (fp16)
  • Eval-time augmentation: 10-crop TTA (FiveCrop + horizontal flip → 10 passes, averaged on the unit sphere)

Loading

The model class ships with the repo as model.py (self-contained, no project dependency). PyTorchModelHubMixin reconstructs the model from config.json; only embedding_dim is a constructor kwarg, the rest are metadata. The pretrained backbone weights are re-fetched at construction, then overwritten by the Hub state_dict on from_pretrained.

import torch
from model import MobileNetV2ReID   # model.py ships on this repo

# Load weights straight from the Hub:
model = MobileNetV2ReID.from_pretrained(
    "marcmarais-ru/seaturtle_reid_mobilenetv2-quadruplet-random-combined_datasets",
    embedding_dim=512,            # must match the trained dim
)
model.eval().cuda()

# Eval transform: resize so the shorter/a side hits 384, then centre-crop.
eval_transform = T.Compose([
    T.Resize((384, 384)),          # SeaTurtleID2022 heads are near-square; resize is fine
    T.ToTensor(),
    T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])

Retrieval recipe

Closed-set re-id, k-NN against a labelled gallery (gallery = train split, query = test split). Embeddings are not pre-normalised, so normalise before any distance:

with torch.no_grad():
    emb = model(eval_transform(image).unsqueeze(0).cuda())
emb = torch.nn.functional.normalize(emb, p=2, dim=1)   # L2-normalise -> cosine == dot product
# gallery_emb likewise L2-normalised; nearest neighbour = argmax(emb @ gallery_emb.T)

For the full test-time setup (10-crop TTA, closed-set guard dropping unclosed query identities, Recall@1/5), see the Project_Code.py source: compute_embeddings_tta and compute_recall_at_k.

Datasets used (training)

The model is trained on the union of three sea-turtle re-id datasets, all drawn from the wildlifedatasets loader under Data/wildlifedatasets/:

Dataset (folder)RoleNotes
seaturtleidheads (v3)Heads-crop SeaTurtleID2022Primary; 233 identities, heads only
amvrakikosturtles (v1)Amvrakikos Gulf turtlesGreek population, distinct photography
reunionturtles (v1)Reunion Island turtlesIndian-Ocean population, distinct photography

Identities are merged across datasets via a global_id mapping so an individual in one dataset never collides with one in another. The split is the published split_closed_random column (random closed-set split — no identity appears in both train and test).

Reference for the SeaTurtleID2022 protocol: SeaTurtleID2022: A Large-Scale Re-Identification Benchmark for Sea Turtles (arXiv 2211.10307). The paper reports results with a Swin-B + ArcFace backbone; this model is the MobileNetV2 + quadruplet reproduction of that protocol.

Results (test, random split, 384-res + 10-crop TTA)

Reported as mean ± std over 3 seeds (batch 128, top-k=6, lr 1.4e-4); the published checkpoint is the best seed of that sweep (seed 2026, Overall R@1 0.7200). The data split is held fixed across seeds (SeaTurtleID2022 published split_closed_random + deterministic ClosedSetSplit for Amvrakikos/Reunion), so variance reflects weight-init / augmentation / sampler draw only.

Target splitR@1 (mean ± std, n=3)R@5 (mean ± std, n=3)
Overall Cross-Dataset0.7166 ± 0.00360.7722 ± 0.0056
Sea Turtle (Heads Crop)0.7344 ± 0.00510.7880 ± 0.0051
Amvrakikos0.3267 ± 0.04620.4400 ± 0.0200
Reunion0.4762 ± 0.01190.5516 ± 0.0182

All numbers are closed-set Recall@1/5 with the closed-set guard applied (unclosed query identities dropped from scoring). Compare to the paper's Swin-B + ArcFace on the heads random split (R@1 0.872); this MobileNetV2 + quadruplet model reaches 0.734 on heads under the same protocol — a deliberately smaller backbone reaching a large fraction of the Swin-B result.

Variance note: the batch-128 config collapsed seed variance ~8× vs the earlier batch-64 config (Overall R@1 std 0.029 → 0.004). R@5 is near its ceiling (R@5−R@1 gap ≈ 0.06, matching the paper's ~0.07): doubling the negative pool and mined negatives (top-k 3→6) lifted R@1 but moved R@5 by only ~0.002, indicating R@5 is backbone/loss-capacity-limited rather than mining-limited. See the source for the full per-seed breakdown and the v7 batch-64 baseline.

Per-species breakdown (published seed, 10-crop TTA @384)

Recall@1/5 partitioned by species within the combined test query set, against the same combined 10-crop TTA gallery used for the headline numbers above (comparable to the headline table; NOT multi-seed means). Loggerhead is the heads-crop SeaTurtleID2022 test set plus the Amvrakikos test set; Green and Hawksbill are the Reunion test set filtered by its Species column.

Speciesn imagesR@1R@5
Loggerhead22810.72900.7849
Green500.50000.5600
Hawksbill340.44120.5882

Green (n=50) and Hawksbill (n=34) are small per-species partitions, so their per-species R@1/R@5 are noisy point estimates (one image ≈ 0.020 / 0.029 of R@1 respectively); Loggerhead (n=2281) is the trustworthy per-species figure. The per-species R@1 values are lower-bounded by — and aggregate up to — the headline Overall R@1: weighted across species they reconstruct the published Overall R@1 (0.721 for seed 2026).

Intended use & limitations

  • Intended: individual animal re-identification research / benchmarks, closed-set retrieval.
  • Not intended: open-set detection of unseen individuals, human identification, or any use outside wildlife research.
  • Limitations: trained on three sea-turtle populations only; generalisation to other taxa or unseen photography conditions is unverified. Closed-set protocol assumes the query individual is present in the gallery. Time-aware split performance is much lower (time-overfitting); see the source paper and code for that regime's caveats.

Citation

If you use this model, please cite the SeaTurtleID2022 and WildlifeDatasets papers and this reproduction:

@INPROCEEDINGS {10484106,
author = { Adam, Lukas and Cermak, Vojtech and Papafitsoros, Kostas and Picek, Lukas },
booktitle = { 2024 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV) },
title = {{ SeaTurtleID2022: A long-span dataset for reliable sea turtle re-identification }},
year = {2024},
volume = {},
ISSN = {},
pages = {7131-7141},
doi = {10.1109/WACV57701.2024.00699},
url = {https://doi.ieeecomputersociety.org/10.1109/WACV57701.2024.00699},
publisher = {IEEE Computer Society},
address = {Los Alamitos, CA, USA},
month =Jan}

@inproceedings{vcermak2024wildlifedatasets,
    author = {Cermak, Vojtech and Picek, Lukas and Adam, Lukas and Papafitsoros, Kostas},
    booktitle = {2024 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
    title = {WildlifeDatasets: An open-source toolkit for animal re-identification},
    year = {2024},
    pages = {5941-5951},
    doi = {10.1109/WACV57701.2024.00585},
    publisher = {IEEE Computer Society}
}
@misc{mobilenetv2-quadruplet-turtles,
  title        = {MobileNetV2 + GeM + batch-hard quadruplet turtle re-identification (combined datasets)},
  author       = {Marc Marais},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/marcmarais-ru/seaturtle_reid_mobilenetv2-quadruplet-random-combined_datasets}}
}

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

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

GPU в ailist

Универсальный рантайм · pytorch · image-feature-extraction

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

Архитектура ? неизвестна transformers в образе рантайма.

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

0 моделей