Skip to content

robot-perception-group/RAPID-animal-reidentification

Repository files navigation

RAPID animal re-identification


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 (example for Excel is also provided).

In case of feature requests, bugs or errors, please raise an issue on GitHub. We are happy to help you with the setup and running the tool on your own computer and own data.

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)
  • similar viewpoint to the query should be in the database for successful reID

📈 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-TOs ON WINDOWS

⚙️ How to install

  1. At the top of the page, click on Code, then Download ZIP and extract the file. Another option is, if you have git installed, to navigate to your desired folder in cmd and: 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 (if needed, right-click, and run as administrator). That's all, you are all set.

🚀 How to run (try the demo)

You can use the demo images provided in ...\data\demo_database and ...\data\demo_query folders to quickly test the tool.
When using your own data, do the same, but provide folder paths pointing to your own images.

  1. Prepare images
    1. If images are not named as animalID_viewpoint_frameID.filetype, rename them (see below section). Demo images are named properly.
  2. Set config
    1. Provide the database and query paths in ...\config\config_RAPID.yaml (or ...\config_FalseTagFinder.yaml)
    2. Save changes
  3. Run
    1. Just double-click on run_RAPID_windows (or run_FalseTagFinder_windows) and check results under ...\saved_RAPID (or ...\saved_FalseTagFinder) next to your database folder

🚀 How to rename images (try the demo)

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. We provide demo data (...\demo\example_rename and ...\demo\examle_rename.xlsx) to test renaming.

  1. Set config
    1. Prepare your metadata Excel or use the demo provided in ...\demo\rename_example.xlsx
    2. Provide the paths in ...\config\config_Rename.yaml
    3. Save changes
  2. Run
    1. Go to scripts and double-click on \scripts\run_Rename_windows
    2. Check renamed_images directory, next to original image directory

📝 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

HOW-TOs ON LINUX

⚙️ How to install

  1. At the top of the page, click on Code, then Download ZIP and extract the file. Another option is, if you have git installed, to navigate to your desired folder in terminal and: 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

🚀 How to run

You can use the demo images provided in .../data/demo_database and .../data/demo_query folders to quickly test the tool. When using your own data, do the same, but provide folder paths pointing to your own images.

  1. Prepare images
    1. If images are not named as animalID_viewpoint_frameID.filetype, rename them (see below section). Demo images are named properly.
  2. Set config
    1. Provide database and query paths in .../config/config_RAPID.yaml (or config_FalseTagFinder.yaml)
    2. 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

🚀 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. We provide demo data (...\demo\example_rename and ...\demo\examle_rename.xlsx) to test renaming.

  1. Set config
    1. Prepare your metadata Excel or use the demo provided in .../data/rename_example.xlsx
    2. Provide the paths in .../config/config_Rename.yaml
    3. 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

📚 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