Skip to content
ModelListedExternal
Browse files

Coral Models

Fine-tuned models for underwater coral individual re-identification across multiple years.

KindOtherVersionBest model 20260306 233824 fp16Cgrade

Model source

Kind
Other
File size
55.9–338 MB
Version
vBest model 20260306 233824 fp16
Updated
Oct 22, 2026
Source
Hugging Face

Source description

Coral Re-Identification Models

Fine-tuned models for underwater coral individual re-identification across multiple years.

This repository contains the two best models and standalone inference scripts. No dependency on the training codebase (coral_reid) is required.

Source code: GitHub

Best Models

Best Accuracy — E3-01b DINOv2 ViT-B/14

N-Benchmark Top-186.6% (110/127)
Top-3 / Top-5 / Top-1096.9% / 97.6% / 100.0%
Avg Rank / Worst Rank1.30 / 9
BackboneDINOv2 ViT-B/14 (86.6M params, timm 518×518)
LossTriplet (margin=0.3) + Hard Mining
SamplerAreaAwareSampler (area_ratio=0.75)
Training4-phase progressive unfreezing, 56 epochs, ~7.2h
Embedding1280-d, L2-normalized
Filese3_01b_dinov2_vitb_best/

Most Efficient — DINOv3 ViT-S+/16

N-Benchmark Top-181.1% (103/127)
Top-3 / Top-5 / Top-1092.1% / 95.3% / 99.2%
Avg Rank1.61
BackboneDINOv3 ViT-S+/16 (~22M params, timm 512×512)
LossTriplet (margin=0.3) + Hard Mining
SamplerMPerClassSampler (m=2)
Training4-phase progressive unfreezing, 63 epochs, ~2.0h
Embedding768-d, L2-normalized
Filesdinov3_vitsplus_efficient/

Comparison

MetricBest AccuracyMost EfficientDifference
Top-186.6%81.1%-5.5%
Parameters~86.6M~22M-75%
Model size (FP32)338 MB112 MB-67%
Model size (FP16)169 MB56 MB-67%
Training time~7.2h~2.0h-72%
Inference tokens1369 (patch14)1024 (patch16)-25%

Quantized Variants

Both models are available in FP16 with zero accuracy loss — recommended for GPU deployment.

ModelFormatSizeTop-1Avg Rank
DINOv2 ViT-BFP32338 MB86.6%1.30
DINOv2 ViT-BFP16169 MB86.6%1.30
DINOv3 ViT-S+FP32112 MB81.1%1.61
DINOv3 ViT-S+FP1656 MB81.1%1.61

FP16 inference requires CUDA. For CPU inference, use FP32.

Quick Start

# Install dependencies (standalone, no coral_reid needed)
uv sync

# Extract features from a single image
uv run python extract_features.py \
    --model e3_01b_dinov2_vitb_best/best_model_20260308_110634.pt \
    --input /path/to/image.jpg

# Extract features from a directory
uv run python extract_features.py \
    --model e3_01b_dinov2_vitb_best/best_model_20260308_110634.pt \
    --input /path/to/images/ \
    --output features.h5

N-Benchmark Per-Area Results

E3-01b DINOv2 ViT-B/14 (Best)

AreaQueriesTop-1Top-3Top-5Avg Rank
373293.8%96.9%96.9%1.28
383180.6%100.0%100.0%1.19
392785.2%92.6%96.3%1.44
403786.5%97.3%97.3%1.30
Overall12786.6%96.9%97.6%1.30

DINOv3 ViT-S+/16 (Efficient)

AreaQueriesTop-1Top-3Top-5Avg Rank
373281.2%93.8%96.9%1.56
383177.4%90.3%93.5%1.90
392785.2%92.6%96.3%1.37
403781.1%91.9%94.6%1.57
Overall12781.1%92.1%95.3%1.61

Full Model History

Model Comparison Table

Model NameArchBackboneLossMiningSame Area NegImageTest AccTest LossVal LossN-Bench AvgA37A38A39A40Time
Pre-trained-DINOv2-B/14---bbox---29.48%28.12%35.48%29.63%24.32%-
20250812_152526oldDINOv2-B/14Tripletpre-composed❌bbox92.6%0.1659-48.25%50.00%51.61%48.15%43.24%~16h
20251007_133126oldDINOv2-B/14Tripletpre-composed✅bbox88.8%0.2523-39.32%46.88%41.94%33.33%35.14%~16h
20251008_094017oldDINOv2-B/14Tripletpre-composed✅bbox90.4%0.1636-40.19%37.50%48.39%37.04%37.84%~16h
20251014_183603oldDINOv2-B/14Tripletpre-composed❌bbox92.8%0.1012-40.97%37.50%38.71%44.44%43.24%~16h
Pre-trained-DINOv2-B/14---whole---50.88%34.38%54.84%62.96%51.35%-
20251015_165008oldDINOv2-B/14Tripletpre-composed✅whole92.7%0.13300.100664.43%62.50%61.29%55.56%78.38%~16h
20251016_133229oldDINOv2-B/14Tripletpre-composed❌whole97.9%0.0429-63.31%56.25%58.06%74.07%64.86%~16h
20260308_110634newDINOv2-B/14 (timm 518)Tripletdynamic (PML)AreaAware 0.75whole--0.160486.6%93.8%80.6%85.2%86.5%~7.2h
20260306_233824newDINOv3-S+/16 (timm 512)Tripletdynamic (PML)❌whole--0.160481.1%81.2%77.4%85.2%81.1%~2.0h

Column Descriptions

ColumnDescription
Archold = old_repo implementation, new = refactored modular architecture
BackboneFeature extractor (DINOv2-B/14, DINOv3-S+/16, etc.)
LossLoss function (Triplet, ArcFace, CosFace, Circle, Contrastive, etc.)
MiningSample mining: pre-composed = fixed triplets, dynamic (PML) = MPerClassSampler
Same Area NegWhether negatives restricted to same geographic area (AreaAware 0.75 = 75% same area)
Imagebbox = EXIF bounding box crop, whole = full image
Test AccTest set accuracy (old arch only, measures pos_dist < neg_dist)
Val LossBest validation loss during training
N-Bench AvgN-Benchmark Top-1 accuracy averaged across areas 37-40

Architecture Differences

FeatureOld ArchitectureNew Architecture
Dataset Output(anchor, pos, neg) - 3 images(image, label) - 1 image
Triplet FormationPre-composed before trainingDynamic mining per batch
Batch SamplerRandomMPerClassSampler (m=2)
Loss FunctionCustom TripletLossWithMiningPML TripletMarginLoss
Samples per Epoch~50,000 triplets x 3 images~4,000 images
Training Speed~23 min/epoch~1.5 min/epoch
Same Area NegativesImplementedImplemented (AreaAwareSampler)

N-Benchmark (Nearest Benchmark): Top-1 accuracy rate of identifying the correct coral when comparing specimens in areas 37-40 across 2022 and 2023.

Project Structure

coral_models/
├── pyproject.toml                        # uv environment (standalone)
├── extract_features.py                   # Feature extraction script
├── e3_01b_dinov2_vitb_best/              # Best accuracy model (86.6%)
│   ├── best_model_20260308_110634.pt      # FP32 (338 MB)
│   ├── best_model_20260308_110634_fp16.pt # FP16 (169 MB)
│   ├── final_model_20260308_110634.pt
│   ├── e3_01b_same_area_neg_075.yaml
│   ├── README.md
│   └── README(zh-tw).md
├── dinov3_vitsplus_efficient/            # Most efficient model (81.1%)
│   ├── best_model_20260306_233824.pt      # FP32 (112 MB)
│   ├── best_model_20260306_233824_fp16.pt # FP16 (56 MB)
│   ├── final_model_20260306_233824.pt
│   ├── dinov3_vitsplus_tune_02_p2lr5_4ph.yaml
│   ├── README.md
│   └── README(zh-tw).md
└── legacy/                              # Old architecture models (torch.hub, 224×224)
    ├── dinov2_coral_best_model_20251015_165008.pt      # 64.43% (old best, same area neg, whole image)
    └── dinov2_coral_best_model_20251016_133229.pt      # 63.31% (no same area neg, whole image)

License

This project is licensed under GPL-3.0.

Based on DINOv2 and DINOv3 by Meta Platforms, Inc. (Apache License 2.0).

Sources

1 source
Hugging FacePrimaryVersion b64ed2d6306fe92b83529b2f6f669e29ae79c923
huggingface.co/YuC13600/coral_models/tree/b64ed2d6306fe92b83529b2f6f669e29ae79c923

Verified Oct 22

Download files

Model artifacts

8 artifacts

dinov3_vitsplus_efficient/best_model_20260306_233824_fp16.pt

pt · 55.9 MB · SHA-256 b50ba3da1185…6ef3 · Hugging Face

Download file

dinov3_vitsplus_efficient/best_model_20260306_233824.pt

pt · 112 MB · SHA-256 c4f525e9298f…d51f · Hugging Face

Download file

dinov3_vitsplus_efficient/final_model_20260306_233824.pt

pt · 112 MB · SHA-256 58150a259af0…d3df · Hugging Face

Download file

e3_01b_dinov2_vitb_best/best_model_20260308_110634_fp16.pt

pt · 169 MB · SHA-256 b4de6ebe39a3…d945 · Hugging Face

Download file

e3_01b_dinov2_vitb_best/best_model_20260308_110634.pt

pt · 338 MB · SHA-256 b77d102cabc4…3cc0 · Hugging Face

Download file

e3_01b_dinov2_vitb_best/final_model_20260308_110634.pt

pt · 338 MB · SHA-256 b65370223121…5996 · Hugging Face

Download file

legacy/dinov2_coral_best_model_20251015_165008.pt

pt · 338 MB · SHA-256 6eb998eb8a37…d47b · Hugging Face

Download file

legacy/dinov2_coral_best_model_20251016_133229.pt

pt · 338 MB · SHA-256 b3f8af48b28b…af26 · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: gpl-3.0 tags: - coral-reef - re-identification - metric-learning - dinov2 - dinov3 - pytorch datasets: - custom pipeline_tag: image-feature-extraction --- # Coral Re-Identification Models Fine-tuned models for underwater coral individual re-identification across multiple years. This repository contains the two best models and standalone inference scripts. No dependency on the training codebase (`coral_reid`) is required. > Source code: [GitHub](https://github.com/YuC13600/coral_models) ## Best Models ### Best Accuracy — E3-01b DINOv2 ViT-B/14 | | | |---|---| | **N-Benchmark Top-1** | **86.6%** (110/127) | | Top-3 / Top-5 / Top-10 | 96.9% / 97.6% / 100.0% | | Avg Rank / Worst Rank | 1.30 / 9 | | Backbone | DINOv2 ViT-B/14 (86.6M params, timm 518×518) | | Loss | Triplet (margin=0.3) + Hard Mining | | Sampler | AreaAwareSampler (area_ratio=0.75) | | Training | 4-phase progressive unfreezing, 56 epochs, ~7.2h | | Embedding | 1280-d, L2-normalized | | Files | `e3_01b_dinov2_vitb_best/` | ### Most Efficient — DINOv3 ViT-S+/16 | | | |---|---| | **N-Benchmark Top-1** | **81.1%** (103/127) | | Top-3 / Top-5 / Top-10 | 92.1% / 95.3% / 99.2% | | Avg Rank | 1.61 | | Backbone | DINOv3 ViT-S+/16 (~22M params, timm 512×512) | | Loss | Triplet (margin=0.3) + Hard Mining | | Sampler | MPerClassSampler (m=2) | | Training | 4-phase progressive unfreezing, 63 epochs, ~2.0h | | Embedding | 768-d, L2-normalized | | Files | `dinov3_vitsplus_efficient/` | ### Comparison | Metric | Best Accuracy | Most Efficient | Difference | |--------|--------------|----------------|------------| | Top-1 | 86.6% | 81.1% | -5.5% | | Parameters | ~86.6M | ~22M | **-75%** | | Model size (FP32) | 338 MB | 112 MB | **-67%** | | Model size (FP16) | **169 MB** | **56 MB** | **-67%** | | Training time | ~7.2h | ~2.0h | **-72%** | | Inference tokens | 1369 (patch14) | 1024 (patch16) | -25% | ## Quantized Variants Both models are available in FP16 with **zero accuracy loss** — recommended for GPU deployment. | Model | Format | Size | Top-1 | Avg Rank | |-------|--------|------|-------|----------| | DINOv2 ViT-B | FP32 | 338 MB | 86.6% | 1.30 | | DINOv2 ViT-B | **FP16** | **169 MB** | **86.6%** | **1.30** | | DINOv3 ViT-S+ | FP32 | 112 MB | 81.1% | 1.61 | | DINOv3 ViT-S+ | **FP16** | **56 MB** | **81.1%** | **1.61** | FP16 inference requires CUDA. For CPU inference, use...

Source context: 0 downloads · 0 likes · Pipeline image-feature-extraction · Repo YuC13600/coral_models