Skip to content

csivitu/snake-spotter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

🐍 Snake vs Background Image Classifier

🎯 Project Goal

This project was initiated to support wildlife conservation efforts in snake-rich ecosystems. By accurately distinguishing between snake images and background images, we aim to assist researchers and field workers in cataloging snake populations and understanding their habitats. This tool could potentially be integrated into mobile applications for quick snake identification, enhancing both research capabilities and safety measures for people working in or visiting snake-inhabited areas.

🔬 Project Overview

This project implements a binary classifier to distinguish between snake images and background images using a VGG16 model with a modified head. The classifier is built using PyTorch and is designed to be a learning exercise for participants interested in deep learning and computer vision.

📊 Dataset

The dataset consists of images divided into two classes:

  1. Snake images
  2. Background images (non-snake images)

🏗️ Project Structure

The main components of the project are:

  1. Data preparation and loading
  2. Model architecture (VGG16 with custom classifier)
  3. Training and validation loops
  4. Evaluation metrics and visualization

🛠️ Setup and Dependencies

The project requires the following main libraries:

  • PyTorch
  • torchvision
  • matplotlib
  • numpy
  • scikit-learn
  • seaborn
  • pandas Additional dependencies are listed in the import statements at the beginning of the script.

🚂 Training

The model is trained for 15 epochs using SGD optimizer and CrossEntropyLoss. The training process includes both training and validation steps, with results logged for each epoch.

📊 Evaluation

The model's performance is evaluated on a separate test set. Evaluation metrics include:

  • Accuracy
  • Precision
  • Recall
  • F1 Score Additionally, a confusion matrix and classification report are generated and visualized.

👁️ Visualization

The project includes functions to visualize:

  • Sample images from the dataset
  • Training and validation loss/accuracy curves
  • Predictions on individual images
  • Confusion matrix and classification report

🏋️ Pre-trained Weights Option

An option for loading Pre-trained weights is available and can be loaded using the load_with_pretrained_weights function.

🧠 Challenges for Participants

This project contains several issues that participants are challenged to identify and fix. These issues range from data preprocessing to model architecture and training process. Participants should carefully review the code, run it, and improve its performance. By working on these challenges, you'll also enhance your deep learning skills on the way.😄

NOTE: This repository is supposed to be run on colab using the github integration of colab (use this as a reference and use File -> Save a copy in github to push your code). If you think your laptop has enough GPU power (i.e., >=Tesla T4 GPU), you are free to use your laptop (compare using this).

Good luck, and happy coding! 🚀🐍

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published