Skip to content

Real-time Al animal detector using TensorFlow + OpenCV. Identifies elephants, lions, tigers, and more plays alert sounds when danger is detected. Perfect for forest safety & wildlife monitoring.

Notifications You must be signed in to change notification settings

mohammedarshad3/Animal_Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Animal Detector – Wildlife Monitoring System


🐘 Animal Detector – Wildlife Monitoring AI System

A smart and powerful AI-based wildlife monitoring system that detects wild animals like elephants, lions, tigers, and more using your webcam β€” and instantly plays an alert sound πŸ”Š when one is detected.


🎯 Overview

This project helps forest officers and wildlife teams monitor real-time video feeds to detect wild animals automatically.
If a dangerous animal appears, the system raises an alert β€” preventing potential harm to humans or property.

Built Using:

  • 🧠 TensorFlow + Keras – Deep learning for animal classification
  • πŸŽ₯ OpenCV – Capturing and processing camera frames
  • 🎡 Playsound – Triggering instant alerts
  • βš™ Teachable Machine – Quick and easy model training

βš™ Features

βœ… Detects multiple wild animals (Elephant, Lion, Tiger, etc.)
βœ… Ignores humans, pets, and background motion
βœ… Plays sound alerts for wild animals only
βœ… Real-time detection via webcam
βœ… Easy to customize with your own trained model


🧩 How It Works

1️⃣ Model Training

Trained on Google’s Teachable Machine using custom classes:

  • 🐘 Elephant
  • 🦁 Lion
  • 🐯 Tiger
  • πŸ† Cheetah
  • 🐻 Bear
  • 🦍 Gorilla
  • 🦏 Rhino
  • 🐺 Hyena
  • 🚫 Non-Targets (humans, cats, dogs, etc.)
  • 🌿 Background

2️⃣ Model Prediction

  • Captures live frames from the webcam
  • Resizes and normalizes images
  • Predicts animal type and confidence
  • If confidence > 80% and class is wild β†’ plays alert sound

3️⃣ Alert System

When a target animal is detected, alert.mp3 plays instantly πŸ”Š


πŸ’» Setup Instructions

1️⃣ Install Requirements

pip install opencv-python tensorflow playsound==1.2.2 numpy

2️⃣ Folder Structure

Animal_Detector/ β”‚ β”œβ”€β”€ main.py β”œβ”€β”€ keras_model.h5 β”œβ”€β”€ labels.txt β”œβ”€β”€ alert.mp3 └── banner.png ← (upload this image file here later)

3️⃣ Run the Project

python main.py

Press β€˜Q’ to stop the camera feed.


πŸš€ Future Enhancements

πŸ“± Send alerts to phone via SMS or WhatsApp ☁ Upload detections to a cloud dashboard πŸ•Ή Integration with drones or CCTV 🧠 Improve accuracy with transfer learning


πŸ‘¨β€πŸ’» Author

Mohammed Arshad πŸ’» Wildlife AI Enthusiast | Data & AI Learner 🌍 GitHub Profile

About

Real-time Al animal detector using TensorFlow + OpenCV. Identifies elephants, lions, tigers, and more plays alert sounds when danger is detected. Perfect for forest safety & wildlife monitoring.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages