Model Details

Model Description

MiewID-msv3 is a feature extractor trained for re-identification using contrastive learning on a large, high-quality dataset of 64 wildlife species - terrestrial and aquatic - including fins, flukes, flanks, faces.

  • Model Type: Wildlife re-identification feature backbone
  • Model Stats:
    • Params (M): 51.11
    • GMACs: 24.38
    • Activations (M): 91.11
    • Image size: 440 x 440

Model Sources [optional]

Usage

Intended use is re-identification of individuals from different species by matching against a database of grount-truth samples. Model features can also be used for species classification by retrieval.

Embedding Extraction

import numpy as np
from PIL import Image
import torch
import torchvision.transforms as transforms
from transformers import AutoModel

model_tag = f"conservationxlabs/miewid-msv3"
model = AutoModel.from_pretrained(model_tag, trust_remote_code=True)

def generate_random_image(height=440, width=440, channels=3):
    random_image = np.random.randint(0, 256, (height, width, channels), dtype=np.uint8)
    return Image.fromarray(random_image)

random_image = generate_random_image()

preprocess = transforms.Compose([
    transforms.Resize((440, 440)),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])

input_tensor = preprocess(random_image)
input_batch = input_tensor.unsqueeze(0) 

with torch.no_grad():
    output = model(input_batch)

print(output)
print(output.shape)

More Examples

View more usage examples at https://github.com/WildMeOrg/wbia-plugin-miew-id/tree/main/wbia_miew_id/examples

Training Details

Training Data

The dataset used for these experiments was a combination of data from Wildbook platforms (multiple users), Happywhale Kaggle competitions multi-species dataset and multiple publicly available datasets. A small subset of data from Wildbook platforms is available at https://lila.science/datasets.

Example Images

image/jpg

Evaluation Results

group map rank-1 rank-5 rank-10 rank-20 source
amur_tiger 88.9 97.4 99.6 99.6 100.0 lila.science (cleaned)
beluga_whale 60.6 72.0 81.5 84.8 87.9 lila.science
blue_whale 37.8 39.5 56.3 63.0 69.7 Kaggle (HappyWhale)
bottlenose_dolphin 83.5 92.4 95.2 96.3 97.0 Flukebook.org
brydes_whale 65.9 71.4 90.5 95.2 100.0 Kaggle (HappyWhale)
capuchin 32.2 49.0 63.9 74.0 84.1 Susan Perry\UCLA
cheetah 53.5 70.8 81.1 85.9 89.3 African Carnivore Wildbook
chimp 33.9 50.8 66.1 70.7 76.0 Chimpanzee CTai & CZoo
chimpanzee 66.6 80.7 88.8 91.6 95.6 PrimFace
chimpanzee_chimpface 71.0 83.2 89.7 92.8 95.4 ChimpFace
cuviers_beaked_whale 50.1 51.4 72.9 85.7 91.4 Kaggle (HappyWhale)
dog 70.9 78.7 87.5 90.5 92.9 DogFaceNet
dolphin_humpback+fin_dorsal 48.6 56.5 79.2 87.7 92.9 Flukebook.org
dusky_dolphin 88.8 87.3 93.0 94.9 95.6 Kaggle (HappyWhale)
eurasianlynx 57.7 69.8 79.3 84.2 88.7 Whiskerbook.org
finwhale 68.1 78.3 88.9 92.7 94.6 Flukebook.org
giraffe 98.7 98.8 99.1 99.1 99.1 GiraffeSpotter.org
giraffe_whole 67.3 81.0 86.9 88.6 90.3 GiraffeSpotter.org
golden_monkey 75.7 89.8 95.9 97.0 97.7 GoldenMonkeyFace
green_turtle 74.5 89.0 92.8 94.1 96.4 iot.wildbook.org
greywhale 84.0 90.8 95.0 97.1 98.4 Flukebook.org
grouper_nassau/potato_cod 80.9 84.0 96.0 97.3 100.0 REEF/Rowan Watt-Pringle/GrouperSpotter.org
hawksbill_turtle 70.3 85.2 90.9 93.3 95.5 iot.wildbook.org
horse_wild_tunisian+face 78.5 98.5 99.5 100.0 100.0 THoDBRL2015
humpbackwhale 70.5 70.3 83.3 88.2 92.1 Flukebook.org
hyena 65.8 80.9 89.8 92.9 94.8 African Carnivore Wildbook
hyperoodon_ampullatus 86.8 95.0 96.8 97.4 97.7 Flukebook.org
jaguar 64.7 78.5 89.1 91.1 93.9 Whiskerbook.org
japanese_monkey 83.9 90.8 92.3 96.9 98.5 PrimFace
lemur 77.4 91.8 96.7 97.9 98.4 LemurFace
leopard 59.1 77.6 88.6 90.6 93.3 African Carnivore Wildbook
leopard_shark 82.9 92.1 95.5 96.0 97.1 Sharkbook.ai
lion 77.9 93.2 96.3 97.6 97.9 African Carnivore Wildbook
loggerhead_turtle 58.6 82.4 90.1 92.4 94.4 iot.wildbook.org
lynx_pardinus 47.1 57.4 70.2 76.4 83.3 lynx.wildbook.org
macaque_face 86.8 94.7 97.4 98.5 100.0 MacaqueFaces
melon_headed_whale 89.7 92.1 95.4 97.4 98.0 Flukebook.org
mobula_birostris 79.9 88.9 93.3 94.5 95.5 MantaMatcher.org
nyala 47.4 63.9 79.7 87.8 90.9 wildlife-datasets
orca 77.7 86.0 91.4 93.6 94.8 Flukebook.org
pilotwhale 90.0 92.6 96.8 97.3 97.7 Flukebook.org
pygmy_killer_whale 90.4 84.6 100.0 100.0 100.0 Kaggle (HappyWhale)
rhesus_monkey 73.6 86.4 95.1 97.3 98.9 PrimFace
salamander_fire_adult 97.5 98.1 99.4 99.4 100.0 Amphibian-Reptile Wildbook
salamander_fire_juvenile 73.6 67.6 84.3 86.3 88.2 Amphibian-Reptile Wildbook
seadragon_leafy 95.1 97.1 100.0 100.0 100.0 SeadragonSearch
seadragon_leafy+head 92.8 92.1 95.2 98.4 98.4 SeadragonSearch
seadragon_weedy 83.8 89.8 97.7 98.3 98.3 SeadragonSearch
seadragon_weedy+head 91.3 97.0 98.5 98.5 99.0 SeadragonSearch
seal 38.9 64.6 78.8 85.6 90.5 seals.wildme.org
sei_whale 69.5 75.9 87.9 91.4 96.6 Kaggle (HappyWhale)
snow_leopard 55.5 75.7 86.7 90.1 93.4 Whiskerbook.org
spinner_dolphin 98.8 98.8 100.0 100.0 100.0 Flukebook.org
spotteddolphin 78.5 80.6 91.3 94.2 98.1 Flukebook.org
whale_sperm+fluke 94.8 97.4 98.0 98.2 98.8 Flukebook.org
whaleshark 44.0 65.2 76.4 79.6 84.2 Sharkbook.ai
white_shark+fin_dorsal 87.1 90.4 96.3 97.5 98.8 Sharkbook.ai
white_sided_dolphin 84.2 84.0 88.0 92.0 100.0 Flukebook.org
wilddog 74.6 86.1 90.7 92.8 94.0 African Carnivore Wildbook
zebra_grevys 91.1 96.1 97.3 97.6 97.8 zebra.wildme.org
Downloads last month
8
Safetensors
Model size
51.4M params
Tensor type
F32
·
Inference Examples
Inference API (serverless) does not yet support model repos that contain custom code.