Skip to content

robot-perception-group/Real-time_Animal_reID

Repository files navigation

Version 2.0 released — installation and usage have changed.


RAPID: Real-time Animal Pattern re-Identification on edge-Devices

Concept_image

What is RAPID?

RAPID is a patterned animal re-identification (reID) tool. It is easy-to-use, fast and accurate. Furthermore, suitable for edge deployment (e.g. drones) and integration into larger pipelines (e.g. autonomous monitoring).

The tool has two main features: 1) RAPID predicts IDs (with confidence scores) for query animals based on a set of database images, and 2) FalseTagFinder supports researchers to identify potentially wrong ID labels within ground truth databases.

As images should strictly follow the naming convention: animalID_viewpoint_frameID.filetype (e.g. jaguar7_left_23.jpg, tiger18_unknownvp_54.png, unknownID74_right_32.jpg), we also provide a Rename tool that automatically renames images based on a simple Excel or CSV file.

For more, read our preprint and watch the video abstract.

🎉 Benefits:

  • accurate ID predictions + confidence scores 🎯
  • real-time processing (even without GPU) ⚡
  • optimal for edge devices, e.g. drones 🌿
  • works with multiple species 🌎
  • no need for large training data 📷
  • localizable keypoints for visual verification 👀

❗ Limitations:

  • works with patterned animals
  • needs cropped bounding boxes (however, not necessarily very tight)
  • not automated for open-set scenarios (however, can be used as a supporting tool)

📈 Performance:

Top-1 accuracies on publicly available benchmark datasets:

Accuracy (Top-1) Species Dataset
99% 🦓 Plains and Grevy's zebra StripeSpotter
95% 🐅 Amur tiger ATRW
99% 🐄 Holstein Friesian Cattle AerialCattle
89% 🦒 🦓 Masai giraffe and Plains zebra GiraffeZebraID
99% 🦓 Grevy's zebra dataset coming soon...
100% 🐆 Jaguar dataset coming soon...

Query processing speed (FPS). Query processing time meant time spent from loading the raw bounding box until ID prediction and confidence score calculation.

Hardware Speed (FPS)
🖥️PC ~60 FPS
💻Laptop ~50 FPS
🌿Edge ~12 FPS

Hardware used for tests: 1) PC - DELL Precision 3630 Tower with Intel(R)492 Xeon(R) E-2174G@ 3,80GHz CPU, 8 cores, 63 GB RAM; 2) Laptop - VivoBook-ASUSLaptop X513UA-M513UA with AMD Ryzen 7 5700U, Radeon Graphics, 16 cores, 16 GB RAM; 3) Edge - Texas Instruments SK-TDA4VM with ARM Cortex-A72, 2 cores, 2.25 GB RAM

⚙️ How to install

LINUX:

  1. Click on Download ZIP under Code and extract the file. Or in terminal: git clone https://github.com/robot-perception-group/Real-time_Animal_reID.git
  2. Go to scripts directory, right click and open a terminal, so you see .../scripts$
  3. In terminal, type: chmod +x install_on_linux.sh
  4. To install RAPID, type: ./install_on_linux.sh

WINDOWS

  1. Click on Download ZIP under Code and extract the file. Or in command prompt: git clone https://github.com/robot-perception-group/Real-time_Animal_reID.git
  2. Go to scripts folder and double-click on install_on_windows to install RAPID

🚀 How to rename images

Note: images should be cropped bounding box images, and named as animalID_viewpoint_frameID.filetype. This section helps you to rename your images, if they are named differently.

LINUX:

  1. Set config
    1. prepare a metadata Excel or CSV with columns filename, img-ID, animal-ID and side-info (more info in .../config/config_Rename.yaml)
    2. provide metadata path and the directory of the images you want to rename in .../config/config_Rename.yaml
    3. make sure that your paths do not end with /
    4. save changes
  2. Activate virtual environment
    1. in Real-time_Animal_reID directory open a terminal, so you see .../Real-time_Animal_reID$
    2. in terminal: source .venv/bin/activate, as a result, you should see (.venv) at the beginning of the command line
  3. Run
    1. in terminal, run: Rename
    2. check renamed_images directory, next to original image directory

WINDOWS:

  1. Set config
    1. prepare a metadata Excel or CSV with columns filename, img-ID, animal-ID and side-info (more info in ...\config\config_Rename.yaml)
    2. provide metadata path and the directory of the images you want to rename in ...\config\config_Rename.yaml
    3. in provided paths, change every \ to double \\ or single /
    4. make sure that your paths do not end with \, \\, or /
    5. save changes
  2. Activate virtual environment
    1. open command prompt and type: conda activate rapid_env, as a result, you should see (rapid_env) at the beginning of the command line
  3. Run
    1. in terminal, type: Rename
    2. check renamed_images folder, next to original image folder

🚀 How to run

LINUX:

  1. Prepare images
    1. If images are not named as animalID_viewpoint_frameID.filetype, rename them (see above)
  2. Set config
    1. provide database and query paths in .../config/config_RAPID.yaml (or config_FalseTagFinder.yaml)
    2. make sure that your paths do not end with /
    3. save changes
  3. Activate virtual environment
    1. in Real-time_Animal_reID directory open a terminal, so you see .../Real-time_Animal_reID$
    2. in terminal: source .venv/bin/activate, as a result, you should see (.venv) at the beginning of the command line
  4. Run
    1. in terminal, run: RAPID (or FalseTagFinder)
    2. check results under .../saved_RAPID (or .../saved_FalseTagFinder) next to your database directory

WINDOWS:

  1. Prepare images
    1. If images are not named as animalID_viewpoint_frameID.filetype, rename them (see above)
  2. Set config
    1. provide database and query paths in ...\config\config_RAPID.yaml (or ...\config_FalseTagFinder.yaml)
    2. in provided paths, change every \ to double \\ or single /
    3. make sure that your paths do not end with \, \\, or /
    4. save changes
  3. Activate virtual environment
    1. open command prompt and type: conda activate rapid_env, as a result, you should see (rapid_env) at the beginning of the command line
  4. Run
    1. in command prompt, run: RAPID (or FalseTagFinder)
    2. check results under ...\saved_RAPID (or ...\saved_FalseTagFinder) next to your database folder

📝 How to interpret results csv

  • In general, use only first 5 columns
    • query_img column helps you identify the given image
    • provided_ID is the first part of the query image filename (see above How to run section)
    • predicted_ID is the prediction of RAPID
    • confidence_score is the confidence of the prediction
    • ID_matching checks if provided query animal ID from the filename is the same as the prediction. This is only meaningful, if you used proper animal IDs in the query image filenames that are part of your database
  • other columns provide information about top 5 predictions and their weights that can be used for deeper analysis

📚 Cite

Zábó, A., Nagy, M., & Ahmad, A. (2025). RAPID: Real-time Animal Pattern re-Identification on edge Devices. bioRxiv: https://doi.org/10.1101/2025.07.07.663143

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published