Skip to content

JessPress0/Animal-ID-Vision-Transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

This project included myself and Mastoorah Faizi

Programming Language: This project was developed in Python, using the following key libraries:

  • torch (PyTorch)
  • torchvision
  • timm (for loading the pretrained MegaDescriptor model)
  • pandas, numpy, matplotlib
  • scikit-learn
  • wildlife_datasets (custom dataset API)
  • kagglehub (for dataset download)

Code Structure: The project consists of a single Jupyter Notebook:

  • 4_23_MegaDesc_Animals_Subset.ipynb This notebook includes:
    • Dataset filtering and preprocessing
    • Custom TripletDataset class definition
    • MegaDescriptor model loading
    • Triplet loss training loop
    • Evaluation using cosine similarity, balanced accuracy, and confusion matrix
    • Visualization of results

Additional files for submission:

  • Wildlife CNN Report.pdf (project report)
  • demo.mp4 or equivalent (recorded demonstration)
  • readme.txt (this file)

How to Run the Code (with detailed steps):

  1. Set up a Python environment

  2. Install dependencies pip install torch torchvision timm pandas numpy matplotlib scikit-learn pip install git+https://github.com/WildlifeDatasets/wildlife-datasets@develop pip install kagglehub

  3. Download and extract the dataset (run code at beginning of notebook)

  4. GPU Use (Recommended)

    • This notebook is computationally intensive. For training and evaluation to complete in a reasonable time, a CUDA-enabled GPU is highly recommended.
    • In Colab, go to Runtime > Change runtime type > GPU before running.
  5. Run the rest of the notebook

    • Open 4_23_MegaDesc_Animals_Subset.ipynb

About

Wildlife Re-ID with MegaDescriptor & Triplet Loss Deep learning pipeline for animal re-identification using MegaDescriptor-T-224 and triplet loss. Handles open-set recognition where test animals may be unseen. Features comprehensive evaluation on WildlifeReID-10k dataset with BAKS/BAUS metrics. PyTorch implementation with transformer backbone.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors