https://github.com/ammarlodhi255/metadata-augmented-neural-networks-for-wild-animal-classification
This repository contains the implementation code for the paper "Metadata Augmented Neural Networks For Wild Animal Classification": https://www.sciencedirect.com/science/article/pii/S1574954124003479.
https://github.com/ammarlodhi255/metadata-augmented-neural-networks-for-wild-animal-classification
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.1%) to scientific vocabulary
Keywords
Repository
This repository contains the implementation code for the paper "Metadata Augmented Neural Networks For Wild Animal Classification": https://www.sciencedirect.com/science/article/pii/S1574954124003479.
Basic Info
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Metadata Augmented Deep Neural Networks for Wild Animal Classification
This repository contains code for classifying camera trap images using various deep learning models and metadata fusion techniques.
Table of Contents
Installation
Clone the repository:
git clone https://github.com/ammarlodhi255/metadata-augmented-neural-networks-for-wild-animal-classification.gitcd metadata-augmented-neural-networks-for-wild-animal-classificationCreate and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`Install the required packages:
pip install -r requirements.txt
Note: If you're using GPU acceleration, ensure you have the appropriate CUDA toolkit installed.
Usage and Dataset
- Preparing the dataset:
- The dataset is collected from NINA Viltkamera dataset. It contains 170,000 sample images along with metadata from the NINA website. The webscrapping code is located inside of the file webscrapper.js. Following is the NINA web interface.

- The dataset is highly imbalanced and many classes contained no images. Our curated dataset can be accessed from two links. The first link contains imagespart1.zip file and the second contains rest of images in a file named imagespart2.zip.
- Ensure your camera trap images are organized in the expected directory structure. Download the important json files from JSON Files. Each entry in the json "annotations" is a single image file. To get the associated image, append the "filename" of the json entry with the path to the image files. So say your images are stored at C:\NINA\images, and you have a filename "96624a46-4bc6-46c9-9770-370bf6d84718.jpg", then the correct image would be C:\NINA\images\96624a46-4bc6-46c9-9770-370bf6d84718.jpg.
- Update the
bpvariable in the scripts to point to your dataset location. - Image variety and challenges are shown in the following pictures.

Run the main classification script:
python viltkamera_classifier.pyFor metadata-only experiments:
python metadata_classifier.pyTo evaluate metadata models:
python evaluate_metadata_models.py
Modify the scripts as needed to adjust model configurations, data preprocessing steps, or evaluation metrics.
Model Weights
All the model weights can be downloaded from the URL model-weights. You can load the weights and directly perform classification and inference on animal species.
Source Files Descriptions
viltkamera_classifier.py: Main script for training and evaluating image classifiers.metadata_classifier.py: Implements a metadata-only classifier for experiments.fusion_model_v2.py: Defines fusion models combining image and metadata features.conventional_models.py: Implements various deep learning architectures.evaluate_metadata_models.py: Analyzes results from metadata-only experiments.- Additional code related to UMAP, extraction of scene attributes, and other processes described in the paper can be found in src and notebooks folders.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Owner
- Name: Ammar Ahmed
- Login: ammarlodhi255
- Kind: user
- Location: Sukkur, Pakistan
- Website: https://www.youtube.com/channel/UCAh8QVO85NLQGj_RhYoTU1w/videos
- Repositories: 9
- Profile: https://github.com/ammarlodhi255
A computer scientist at heart, interested in AI, software development, and space.
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- albumentations ==1.4.2
- imbalanced-learn ==0.12.0
- matplotlib ==3.8.3
- numpy ==1.26.4
- scikit-learn ==1.4.1
- torch ==2.2.1
- torchvision ==0.17.1
- vit-pytorch ==1.6.3