docs: model card and links
Browse files- README.md +100 -0
- best_metadata.json +0 -8
- config_resolved.yaml +0 -0
README.md
CHANGED
|
@@ -1,3 +1,103 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: image-feature-extraction
|
| 5 |
+
datasets:
|
| 6 |
+
- Made-In-Alexandria-AI/ApexID-Dataset
|
| 7 |
+
tags:
|
| 8 |
+
- animal-re-identification
|
| 9 |
+
- re-identification
|
| 10 |
+
- wildlife
|
| 11 |
+
- metric-learning
|
| 12 |
+
- apexid
|
| 13 |
+
- convnext
|
| 14 |
---
|
| 15 |
+
# ApexID ConvNeXt-Small encoder
|
| 16 |
+
|
| 17 |
+
[Project page](https://mia-ai-team.github.io/ApexID-Hierarchical-Learning-for-Multi-Species-Animal-Re-Identification-Official-Repo/) 路 [Code](https://github.com/MIA-AI-Team/ApexID-Hierarchical-Learning-for-Multi-Species-Animal-Re-Identification-Official-Repo) 路 [Dataset](https://huggingface.co/datasets/Made-In-Alexandria-AI/ApexID-Dataset) 路 Paper: arXiv link coming soon
|
| 18 |
+
|
| 19 |
+
This is the ConvNeXt-Small image encoder from *ApexID: Hierarchical Learning for Multi-Species Animal Re-Identification*, trained with the ApexID Hierarchical Loss. It maps a segmented animal image to an L2-normalized embedding, so individuals of any species can be matched by cosine similarity. In the paper it gives the highest dataset-averaged Rank-1 (64.89%) and the best ELPephants transfer (17.69% Rank-1, 6.63% mAP) of all fourteen configurations in the paper.
|
| 20 |
+
|
| 21 |
+
The other ApexID encoders are [ApexID_MiewID_Backbone](https://huggingface.co/Made-In-Alexandria-AI/ApexID_MiewID_Backbone) and [ApexID_MegaDescriptor_Backbone](https://huggingface.co/Made-In-Alexandria-AI/ApexID_MegaDescriptor_Backbone).
|
| 22 |
+
|
| 23 |
+
## Model details
|
| 24 |
+
|
| 25 |
+
| | |
|
| 26 |
+
| --- | --- |
|
| 27 |
+
| Architecture | ConvNeXt-Small |
|
| 28 |
+
| Initialization | ImageNet-1k weights from TorchVision (`ConvNeXt_Small_Weights.IMAGENET1K_V1`) |
|
| 29 |
+
| Parameters | 49.45M |
|
| 30 |
+
| Embedding | 2048-d, L2-normalized |
|
| 31 |
+
| Input | 440 脳 440 RGB, normalized with mean (0.485, 0.456, 0.406) and std (0.229, 0.224, 0.225) |
|
| 32 |
+
| File | `best_backbone.pt` (PyTorch state dict) |
|
| 33 |
+
| Matching config | [`configs/default.yaml`](https://github.com/MIA-AI-Team/ApexID-Hierarchical-Learning-for-Multi-Species-Animal-Re-Identification-Official-Repo/blob/main/configs/default.yaml) |
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
Install the [ApexID repository](https://github.com/MIA-AI-Team/ApexID-Hierarchical-Learning-for-Multi-Species-Animal-Re-Identification-Official-Repo) and run from its root:
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import numpy as np
|
| 41 |
+
import torch
|
| 42 |
+
from PIL import Image
|
| 43 |
+
from huggingface_hub import hf_hub_download
|
| 44 |
+
|
| 45 |
+
from apexid.data import build_eval_transforms
|
| 46 |
+
from apexid.evaluation.embeddings import ApexIDModelAdapter
|
| 47 |
+
from apexid.utils.config import load_config
|
| 48 |
+
|
| 49 |
+
config = load_config(config_path="configs/default.yaml")
|
| 50 |
+
weights = hf_hub_download("Made-In-Alexandria-AI/ApexID_ConvNext_Backbone", "best_backbone.pt")
|
| 51 |
+
|
| 52 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 53 |
+
model = ApexIDModelAdapter.from_checkpoint(config, weights, device).model
|
| 54 |
+
transform = build_eval_transforms(config=config)
|
| 55 |
+
|
| 56 |
+
rgb = np.asarray(Image.open("animal.png").convert("RGB")) # a segmented foreground works best
|
| 57 |
+
with torch.inference_mode():
|
| 58 |
+
embedding = model(transform(image=rgb)["image"][None].to(device)) # shape (1, 2048)
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Results
|
| 62 |
+
|
| 63 |
+
Closed-set retrieval, averaged over four external datasets (ELPephants, GCN-ID, Bristol Gorillas and private jaguar data) and five observation-disjoint split seeds, in percent. All rows use the ConvNeXt-Small backbone.
|
| 64 |
+
|
| 65 |
+
| Model | Rank-1 | mAP | mINP |
|
| 66 |
+
| --- | ---: | ---: | ---: |
|
| 67 |
+
| ArcFace | 62.24 | 29.54 | 14.57 |
|
| 68 |
+
| Dynamic ArcFace | 61.75 | 29.23 | 14.51 |
|
| 69 |
+
| SphereFace2 | 63.60 | 30.24 | 15.31 |
|
| 70 |
+
| **ApexID Hierarchical (this model)** | 64.89 | 30.84 | 15.71 |
|
| 71 |
+
|
| 72 |
+
Transfer to ELPephants, a category absent from all animal Re-ID training, in percent:
|
| 73 |
+
|
| 74 |
+
| Model | Rank-1 | mAP |
|
| 75 |
+
| --- | ---: | ---: |
|
| 76 |
+
| ApexID Hierarchical (this model) | 17.69 | 6.63 |
|
| 77 |
+
|
| 78 |
+
The [project page](https://mia-ai-team.github.io/ApexID-Hierarchical-Learning-for-Multi-Species-Animal-Re-Identification-Official-Repo/) has the full fourteen-configuration comparison, the open-set evaluation and ScoreCAM maps.
|
| 79 |
+
|
| 80 |
+
## Intended use and limitations
|
| 81 |
+
|
| 82 |
+
The encoder is meant for research on individual animal re-identification: ranking a gallery of known individuals against a query image, or clustering images of unknown individuals. It works best on segmented foregrounds like those it was trained on. Absolute scores on unseen species remain low, and open-set results vary by dataset, so verify matches with an expert before acting on them.
|
| 83 |
+
|
| 84 |
+
## Training data
|
| 85 |
+
|
| 86 |
+
The encoder was trained on the ApexID corpus: 132,533 curated images of 13,348 identities from 19 public animal re-identification datasets. See the [dataset card](https://huggingface.co/datasets/Made-In-Alexandria-AI/ApexID-Dataset) for sources, licenses and splits.
|
| 87 |
+
|
| 88 |
+
## License
|
| 89 |
+
|
| 90 |
+
The weights and code are released under the MIT License.
|
| 91 |
+
|
| 92 |
+
## Citation
|
| 93 |
+
|
| 94 |
+
```bibtex
|
| 95 |
+
@article{elkerdany2026apexid,
|
| 96 |
+
title = {ApexID: Hierarchical Learning for Multi-Species Animal Re-Identification},
|
| 97 |
+
author = {Elkerdany, Seifeldin and ElBassat, Mohamed and Abouelhamd, Gamal and
|
| 98 |
+
Elkady, Assem and Ghoneim, Jana and Mahmood, Matin and
|
| 99 |
+
Martin, Abigail Allen and de Melo, Gerard and Rueda-Toicen, Antonio},
|
| 100 |
+
journal = {arXiv preprint},
|
| 101 |
+
year = {2026}
|
| 102 |
+
}
|
| 103 |
+
```
|
best_metadata.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"backbone_path": "outputs/apexid_convnext_small_bhca_scsf2_ablation_e6_v2_rgb/checkpoints/best_backbone.pt",
|
| 3 |
-
"best_epoch": 149,
|
| 4 |
-
"best_metric": 0.39405210630076487,
|
| 5 |
-
"full_model_path": "outputs/apexid_convnext_small_bhca_scsf2_ablation_e6_v2_rgb/checkpoints/best_full_model.pt",
|
| 6 |
-
"mode": "max",
|
| 7 |
-
"monitor": "known/mAP"
|
| 8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_resolved.yaml
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|