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

deep-learning fusion-techniques metadata metadata-fusion multi-modal multi-modal-learning wild-animal-classification wild-life-monitoring
Last synced: 5 months ago · JSON representation

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
  • Host: GitHub
  • Owner: ammarlodhi255
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 8.83 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
deep-learning fusion-techniques metadata metadata-fusion multi-modal multi-modal-learning wild-animal-classification wild-life-monitoring
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

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

  1. Installation
  2. Usage and Dataset
  3. File Descriptions
  4. Model Weights
  5. License
  6. Contributing

Installation

  1. Clone the repository: git clone https://github.com/ammarlodhi255/metadata-augmented-neural-networks-for-wild-animal-classification.git cd metadata-augmented-neural-networks-for-wild-animal-classification

  2. Create and activate a virtual environment: python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`

  3. 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

  1. 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.

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 bp variable in the scripts to point to your dataset location.
  • Image variety and challenges are shown in the following pictures.

IMG_CHALLENGES

  1. Run the main classification script: python viltkamera_classifier.py

  2. For metadata-only experiments: python metadata_classifier.py

  3. To 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Owner

  • Name: Ammar Ahmed
  • Login: ammarlodhi255
  • Kind: user
  • Location: Sukkur, Pakistan

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

requirements.txt pypi
  • 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