Skip to content

About

AI-powered Wildlife Conservation system using YOLOv8 and Streamlit. Features real-time multi-class animal detection (90+ species), secure authentication, and automated SMTP email alerts for anti-poaching surveillance.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WildlifeGuard: AI-Powered Anti-Poaching & Animal Detection System

A real-time intelligent surveillance system designed to protect endangered species through automated detection and instant remote alerting.

Python YOLOv8 Streamlit Status

📌 Overview

Poaching remains a critical threat to global biodiversity. WildlifeGuard leverages state-of-the-art computer vision to provide a 24/7 monitoring solution. The system identifies over 90 species of animals in real-time and immediately dispatches email alerts to conservation authorities upon detection, bridging the gap between surveillance and rapid response.

✨ Key Features

  • Multi-Modal Detection: Supports static images, recorded video files, and live webcam/CCTV streams.
  • High-Precision AI: Powered by a custom-trained YOLOv8 model (main.pt) capable of identifying 90+ distinct animal classes.
  • Automated Alerting: Integrated SMTP protocol to send instant email notifications with the specific animal species detected.
  • Secure Infrastructure: User authentication backed by SQLite3, with passwords stored using PBKDF2-SHA256 hashing (via passlib) rather than in plain text.

🛠️ Tech Stack

  • Model: YOLOv8 (Ultralytics)
  • Frontend: Streamlit
  • Backend/Database: Python, SQLite3
  • Security: Passlib (PBKDF2-SHA256), python-dotenv
  • Image Processing: OpenCV, CVZone

📊 Class Coverage

The system is trained to recognize a wide range of wildlife, including:

Antelope, Bison, Cheetah, Elephant, Lion, Leopard, Rhinoceros, Tiger, Zebra, and many more (91 total classes).

🚀 Installation & Usage

Prerequisites

  • Python 3.9 or higher
  • Trained YOLOv8 weights file, main.pt, placed in the project root
  • A Gmail (or other SMTP) account with an app password for sending alerts, see the security note below before doing anything else

1. Clone the repository

git clone https://github.com/nabeelmohd-dev/Poaching-Detection-YOLOv8.git
cd Poaching-Detection-YOLOv8

2. Set up a virtual environment (recommended)

python -m venv venv
source venv/bin/activate      # On Windows: venv\Scripts\activate

3. Install dependencies

pip install streamlit ultralytics opencv-python cvzone numpy passlib python-dotenv

Or, if you maintain a requirements.txt:

pip install -r requirements.txt

4. Configure email alerts ⚠️ required security step

The alerting code currently expects an SMTP login and a recipient address. Do not hardcode these values in the source file. Create a .env file in the project root instead:

SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SENDER_EMAIL=your_email@example.com
SENDER_PASSWORD=your_gmail_app_password
RECIPIENT_EMAIL=ranger_or_authority@example.com

Then load these with os.getenv(...) (via the python-dotenv import already in the app) instead of passing literal strings to smtplib. Add .env to .gitignore so it is never committed.

If credentials were ever hardcoded and pushed to a repo, rotate that app password immediately in your Google Account's App Passwords settings, even after removing it from the code it remains recoverable from git history otherwise.

5. Run the app

streamlit run app.py

The app opens in your browser. Sign up for a ranger/admin account (or log in if you already have one), then choose an input type, image, video, or webcam, to start detection. Any detected animal above the confidence threshold triggers an email alert to the configured recipient.

🔒 Security Notes

  • Passwords are hashed with PBKDF2-SHA256 before being stored in SQLite, never stored or compared in plain text.
  • SMTP credentials must be supplied via environment variables (see step 4), not hardcoded.
  • The SQLite database file (user_database.db) and any .env file should be excluded from version control via .gitignore.

⚠️ Disclaimer

This project is a prototype developed for educational and demonstration purposes. Detection accuracy is not guaranteed, and it should not be relied upon as a sole safeguard for anti-poaching operations without further testing, validation, and integration with existing conservation infrastructure.

About

AI-powered Wildlife Conservation system using YOLOv8 and Streamlit. Features real-time multi-class animal detection (90+ species), secure authentication, and automated SMTP email alerts for anti-poaching surveillance.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages