File size: 6,021 Bytes
c32be55
 
3311cb5
 
 
 
 
 
 
 
 
c32be55
3311cb5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
license: apache-2.0
pipeline_tag: image-feature-extraction
tags:
  - computer-vision
  - image-retrieval
  - animal-re-identification
  - cat-identification
  - pytorch
  - onnx
  - tensorrt
---

<p align="center">
  <img src="assets/logo.png" alt="MeowID" width="420">
</p>

<h1 align="center">MeowID: A Dual-Expert Retrieval System for Individual Cat Identification</h1>

<p align="center">
  <img alt="Version" src="https://img.shields.io/badge/version-0.3.0-11bfae">
  <img alt="Embedding" src="https://img.shields.io/badge/embedding-512D-0875c1">
  <img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-supported-ee4c2c">
  <img alt="ONNX" src="https://img.shields.io/badge/ONNX-supported-005ced">
  <img alt="TensorRT" src="https://img.shields.io/badge/TensorRT-supported-032b4a">
</p>

<p align="center">
  <strong>TL;DR:</strong> MeowID prioritizes fine-grained facial evidence, augments it with whole-cat context, and falls back to whole-cat retrieval when a usable face is unavailable.
</p>

<div align="center">
  Zhangchi Hu<sup>1,2,*,†</sup>,
  Yi Shang<sup>2,*</sup>,
  Haocheng Yang<sup>4,2,*</sup>,
  Qiwei Hu<sup>5,*</sup>,
  and Yuzheng Li<sup>3,*</sup>
</div>

<p></p>

<div align="center"><sub>
  <sup>1</sup> Department of Electronic Engineering and Information Science, University of Science and Technology of China<br>
  <sup>2</sup> School of Intelligent Software Engineering, Hefei University of Technology<br>
  <sup>3</sup> School of Software Engineering, Sun Yat-sen University<br>
  <sup>4</sup> School of Computer Science, Northwestern Polytechnical University<br>
  <sup>5</sup> College of Biological Sciences and Technology, Beijing Forestry University
</sub></div>

<p align="center">
  <sup>*</sup> Equal contribution &nbsp;&nbsp; <sup></sup> Project leader
</p>

## Model overview

MeowID is a face-priority, dual-expert retrieval system for identifying individual cats in unconstrained photographs. It combines separately parameterized face and whole-cat encoders while keeping their embedding galleries route-specific.

- When a usable aligned face is available, the face expert produces the primary representation and receives a gated whole-cat correction.
- When facial evidence is unavailable, the system falls back to the whole-cat expert.
- New identities can be enrolled through embedding extraction and gallery insertion without retraining the recognition models.
- All retrieval embeddings are L2-normalized, 512-dimensional vectors.

## Method pipeline

<p align="center">
  <img src="assets/meowid-pipeline.png" alt="MeowID method pipeline" width="100%">
</p>

The whole-cat expert produces an embedding for every image. A valid ECPose detection activates PetFace-style face alignment, the face expert, and validation-guided whole-cat hint fusion. Queries are compared only with the gallery associated with their selected route.

## Repository contents

| Path | Contents | Intended use |
| --- | --- | --- |
| `artifacts/MeowID-Base/` | MeowID-Base and ECPose weights in PyTorch, ONNX, and TensorRT formats | End-to-end identification and deployment |
| `artifacts/ECSeg/` | ECSeg-X segmentation weights | Whole-cat instance extraction and cropping |
| `artifacts/training_init/` | Whole-cat and face expert initialization checkpoints | Training and reproduction |
| `artifacts/**/SHA256SUMS` | Published SHA256 checksums | Artifact integrity verification |

The TensorRT engines were built for the reference RTX 3090 environment. Rebuild them from the ONNX artifacts when the GPU architecture, TensorRT version, or batch profile changes.

## Inference capabilities

| Capability | Details |
| --- | --- |
| Face localization | ECPose with 9 cat-face landmarks |
| Face alignment | PetFace-style three-point similarity alignment with a landmark-crop fallback |
| Recognition | Separate DINOv3-based face and whole-cat experts |
| Fusion | Validation-guided, gated whole-cat residual for the face route |
| Retrieval | Route-specific galleries with normalized inner-product similarity |
| Backends | PyTorch, ONNX Runtime CPU/CUDA, and TensorRT FP16/FP32 |
| Whole-cat cropping | ECSeg-X instance segmentation with masks, boxes, and padded crops |

## Minimal Python usage

```python
from cat_recognition import MeowID

model = MeowID(
    "artifacts/MeowID-Base",
    backend="tensorrt",
    device="cuda:0",
    registry="registries/demo",
)

model.register(
    "cat_001",
    ["images/cat_001_a.jpg", "images/cat_001_b.jpg"],
)

prediction = model.search("images/query.jpg", top_k=5)[0]
print("route:", prediction.embedding.route)
for match in prediction.matches:
    print(match.cat_id, match.score)
```

The package accepts file paths, directories, glob patterns, PIL images, RGB NumPy arrays, and iterables of supported inputs.

## Reference results

Offline retrieval on the ICW test set:

| Route | Top-1 | mAP |
| --- | ---: | ---: |
| Whole-cat expert | 51.34% | 59.00% |
| Cat-face expert | 78.80% | 83.32% |
| MeowID-Base hard routing | **75.93%** | **80.45%** |

End-to-end batch-1 measurements on one RTX 3090 over 2,846 ICW test images include image decoding, preprocessing, ECPose, alignment, embedding extraction, and routing:

| Backend | Mean latency | Throughput |
| --- | ---: | ---: |
| PyTorch FP32 | 94.23 ms | 10.61 images/s |
| ONNX Runtime CPU | 478.67 ms | 2.09 images/s |
| ONNX Runtime CUDA | 79.88 ms | 12.51 images/s |
| TensorRT FP16 | **60.00 ms** | **16.66 images/s** |

These results describe the reference evaluation environment and do not guarantee production performance.

## Model mirrors

- [Hugging Face — RicePasteM/MeowID-Base](https://huggingface.co/RicePasteM/MeowID-Base)
- [ModelScope — RicePasteM/MeowID-Base](https://modelscope.cn/models/RicePasteM/MeowID-Base)


## Citation

```bibtex
@misc{hu2026meowid,
  title  = {MeowID: A Dual-Expert Retrieval System for Individual Cat Identification},
  author = {Zhangchi Hu and Yi Shang and Haocheng Yang and Qiwei Hu and Yuzheng Li},
  year   = {2026}
}
```