Image Segmentation
ultralytics
object-detection
instance-segmentation
oriented-bounding-box
yolo
computer-vision
computational-biology
rodent-monitoring
experimental-biology
Instructions to use kaopanboonyuen/DeepRodent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use kaopanboonyuen/DeepRodent with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("kaopanboonyuen/DeepRodent") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
๐ feat(repro): add official implementation of DeepRodent
Browse files
README.md
CHANGED
|
@@ -1,3 +1,169 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- object-detection
|
| 5 |
+
- instance-segmentation
|
| 6 |
+
- oriented-bounding-box
|
| 7 |
+
- yolo
|
| 8 |
+
- computer-vision
|
| 9 |
+
- computational-biology
|
| 10 |
+
- rodent-monitoring
|
| 11 |
+
- experimental-biology
|
| 12 |
+
library_name: ultralytics
|
| 13 |
+
pipeline_tag: image-segmentation
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
<div align="center">
|
| 17 |
+
|
| 18 |
+
# ๐ญ DeepRodent
|
| 19 |
+
|
| 20 |
+
### A Robust and Generalizable Vision Framework for Automated Rodent Monitoring in Experimental Biology
|
| 21 |
+
|
| 22 |
+
**Teerapong Panboonyuen** ([@kaopanboonyuen](https://github.com/kaopanboonyuen))
|
| 23 |
+
|
| 24 |
+
Department of Computer Science, Khon Kaen University ยท PBYAIL ยท Chulalongkorn University
|
| 25 |
+
|
| 26 |
+
๐ง teerapong.panboonyuen@gmail.com
|
| 27 |
+
|
| 28 |
+
[](https://github.com/kaopanboonyuen/DeepRodent)
|
| 29 |
+
[](https://kaopanboonyuen.github.io/DeepRodent)
|
| 30 |
+
[](https://huggingface.co/spaces/kaopanboonyuen/DeepRodent-Demo)
|
| 31 |
+
[](LICENSE)
|
| 32 |
+
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## โจ Overview
|
| 38 |
+
|
| 39 |
+
**DeepRodent** is a unified, detector-agnostic deep learning framework built for **precise, generalizable, multi-task rodent monitoring** in laboratory environments. It jointly predicts:
|
| 40 |
+
|
| 41 |
+
- ๐ฆ **Standard object detection**
|
| 42 |
+
- ๐ **Oriented Bounding Boxes (OBB)** โ captures rotation during grooming, rearing, and huddling
|
| 43 |
+
- ๐จ **Pixel-level instance segmentation** โ accurate boundary masks even under occlusion
|
| 44 |
+
- ๐งญ **Temporal-consistent behavioral embeddings** โ stable identity tracking across video frames
|
| 45 |
+
|
| 46 |
+
Rather than bolting these on separately, DeepRodent fuses them into a single-stage, multi-head architecture โ so one forward pass gives you everything downstream biology pipelines need.
|
| 47 |
+
|
| 48 |
+
<div align="center">
|
| 49 |
+
|
| 50 |
+
| ๐ฏ Metric | ๐ฅ DeepRodent | Best Baseline (YOLO12-Seg) | ๐ Gain |
|
| 51 |
+
|:---:|:---:|:---:|:---:|
|
| 52 |
+
| mAPโ
โ | **96.2** | 94.4 | +1.8 |
|
| 53 |
+
| mAPโ
โโโโ
| **84.6** | 78.2 | **+6.4** |
|
| 54 |
+
| Cross-domain (Lab C) | **91.5** | 87.2 | +4.3 |
|
| 55 |
+
| FPS (real-time) | 154 | 156 | โ |
|
| 56 |
+
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## ๐ Quick Start
|
| 62 |
+
|
| 63 |
+
```bash
|
| 64 |
+
pip install ultralytics
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
from ultralytics import YOLO
|
| 69 |
+
|
| 70 |
+
# ๐ญ Load DeepRodent
|
| 71 |
+
model = YOLO("DeepRodent_WEIGHT.pt")
|
| 72 |
+
|
| 73 |
+
# ๐ Run inference
|
| 74 |
+
results = model.predict("your_cage_image.jpg", save=True)
|
| 75 |
+
|
| 76 |
+
# ๐จ Visualize instance masks + OBB
|
| 77 |
+
results[0].show()
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
### ๐ฅ Download directly
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from huggingface_hub import hf_hub_download
|
| 84 |
+
|
| 85 |
+
weight_path = hf_hub_download(
|
| 86 |
+
repo_id="kaopanboonyuen/DeepRodent",
|
| 87 |
+
filename="DeepRodent_WEIGHT.pt"
|
| 88 |
+
)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
+
|
| 93 |
+
## ๐ง Why DeepRodent?
|
| 94 |
+
|
| 95 |
+
| Challenge in the Lab ๐ฌ | How DeepRodent Solves It ๐ก |
|
| 96 |
+
|---|---|
|
| 97 |
+
| Rodents curl, rear, and huddle | Oriented Bounding Boxes capture true rotation |
|
| 98 |
+
| Axis-aligned boxes overlap during interaction | Instance segmentation isolates each animal precisely |
|
| 99 |
+
| Lighting/cage geometry varies across labs | Cross-domain robustness constraint for generalization |
|
| 100 |
+
| Jittery masks across video frames | Temporal consistency loss stabilizes identity tracking |
|
| 101 |
+
| Need for downstream analytics | Direct output โ trajectories, heatmaps, behavior states |
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## ๐๏ธ Architecture Snapshot
|
| 106 |
+
|
| 107 |
+
```
|
| 108 |
+
Input Frame โ Shared Backbone โ โฌโโ Detection Head
|
| 109 |
+
โโโ OBB Head (ฮธ-aware)
|
| 110 |
+
โโโ Instance Seg Head
|
| 111 |
+
โโโ Temporal Embedding Head
|
| 112 |
+
โ
|
| 113 |
+
Trajectory Tracking ยท Behavior States ยท Occupancy Heatmaps
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
Detector-agnostic: plug into **YOLOv8 โ YOLO12** families and gain **+2.6 to +3.1 mAP** consistently. ๐
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## ๐ Benchmarks
|
| 121 |
+
|
| 122 |
+
Evaluated on a private multi-setting laboratory rodent dataset (~30K annotated frames, 60/20/20 split):
|
| 123 |
+
|
| 124 |
+
- ๐ฅ Outperforms **RT-DETR** by **+6.7 mAPโ
โโโโ
**
|
| 125 |
+
- ๐ฅ Outperforms **Mask R-CNN** by **+13.5 mAPโ
โโโโ
**
|
| 126 |
+
- โก Maintains **154 FPS** โ real-time, deployment-ready
|
| 127 |
+
|
| 128 |
+
Full ablation, cross-domain, and SOTA comparison tables are in the [paper](https://kaopanboonyuen.github.io/DeepRodent).
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## ๐ Repository Links
|
| 133 |
+
|
| 134 |
+
| Resource | Link |
|
| 135 |
+
|---|---|
|
| 136 |
+
| ๐ป Code | [github.com/kaopanboonyuen/DeepRodent](https://github.com/kaopanboonyuen/DeepRodent) |
|
| 137 |
+
| ๐ Project Page | [kaopanboonyuen.github.io/DeepRodent](https://kaopanboonyuen.github.io/DeepRodent) |
|
| 138 |
+
| ๐ค Weights (this repo) | `DeepRodent_WEIGHT.pt` |
|
| 139 |
+
| ๐ฎ Interactive Demo | [Hugging Face Spaces](https://huggingface.co/spaces/kaopanboonyuen/DeepRodent-Demo) |
|
| 140 |
+
|
| 141 |
+
---
|
| 142 |
+
|
| 143 |
+
## ๐พ Ethical Use
|
| 144 |
+
|
| 145 |
+
DeepRodent is an **assistive research tool** โ it does not replace veterinary oversight or trained behavioral experts. Developed following **ARRIVE guidelines** and the **3Rs principles** (Replacement, Reduction, Refinement). Please validate performance before deployment in a new laboratory setting.
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
## ๐ Citation
|
| 150 |
+
|
| 151 |
+
If DeepRodent helps your research, please cite:
|
| 152 |
+
|
| 153 |
+
```bibtex
|
| 154 |
+
@article{panboonyuen2026deeprodent,
|
| 155 |
+
title = {DeepRodent: A Robust and Generalizable Vision Framework for Automated Rodent Monitoring in Experimental Biology},
|
| 156 |
+
author = {Panboonyuen, Teerapong},
|
| 157 |
+
year = {2026}
|
| 158 |
+
}
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
---
|
| 162 |
+
|
| 163 |
+
<div align="center">
|
| 164 |
+
|
| 165 |
+
Made with ๐งก for open, reproducible science.
|
| 166 |
+
|
| 167 |
+
โญ **If this helped your research, consider starring the [GitHub repo](https://github.com/kaopanboonyuen/DeepRodent)!**
|
| 168 |
+
|
| 169 |
+
</div>
|