A comparative deep learning project evaluating YOLOv8, YOLOv5, and Faster R-CNN for multi-class animal detection. This repository contains the complete training pipeline, trained models, evaluation notebooks, and benchmarking results on a custom 27-class animal detection dataset.
The project was developed as the computer vision component of an Animal Alert System, where accurate and real-time detection of wildlife and domestic animals is essential for timely monitoring and alerts.
- Comparative study of YOLOv8, YOLOv5, and Faster R-CNN
- Custom object detection dataset with 27 classes
- Complete training notebooks for all models
- Trained model weights
- Benchmark notebooks comparing model performance
- Training curves, PR curves, F1 curves, and confusion matrices
- Real-world inference examples
- Modular repository structure for reproducibility
Animal-Detection-Using-YOLO-and-Faster-RCNN/
│
├── dataset/
│
├── docs/
│ ├── images/
│ └── results/
│ ├── yolov8/
│ ├── yolov5/
│ └── faster_rcnn/
│
├── models/
│ ├── yolov8/
│ ├── yolov5/
│ └── faster_rcnn/
│
├── notebooks/
│ ├── train_yolov8.ipynb
│ ├── train_yolov5.ipynb
│ ├── train_faster_rcnn.ipynb
│ ├── YOLOv8_vs_YOLOv5_Final_Clean.ipynb
│ └── YOLOv8_vs_FasterRCNN_Comparison.ipynb
│
├── requirements.txt
└── README.md
The models were trained on a custom object detection dataset containing 27 classes, covering wildlife, domestic animals, and humans.
| Category | Classes |
|---|---|
| Wild Animals | Bear, Deer, Elephant, Fox, Gaur, Indian Pangolin, Leopard, Lion, Monitor Lizard, Monkey, Nilgai, Peacock, Rabbit, Rat, Tiger |
| Domestic Animals | Buffalo, Camel, Cat, Cow, Dog, Donkey, Goat, Hen, Horse, Sheep |
| Human | Person |
The dataset combines publicly available datasets with manually annotated images.
The complete training dataset is not included in this repository due to its size and licensing considerations.
If you are interested in obtaining the dataset for academic, educational, or research purposes, please contact:
Email: 970siddhant@gmail.com
- One-stage detector
- Optimized for real-time inference
- Highest overall benchmark performance
- Lightweight detector
- Strong baseline for comparison
- Faster than two-stage detectors
- Two-stage detector
- Strong localization capability
- Benchmark for high-accuracy detection
| Parameter | Value |
|---|---|
| Image Size | 640 × 640 |
| Classes | 27 |
| Training Images | 27,138 |
| Validation Images | 3,392 |
| Batch Size | 16 |
| Metric | YOLOv8m | YOLOv5 |
|---|---|---|
| Precision | 0.874 | 0.733 |
| Recall | 0.825 | 0.693 |
| mAP@0.50 | 0.885 | 0.746 |
| mAP@0.50:0.95 | 0.662 | 0.460 |
| Metric | YOLOv8m | Faster R-CNN |
|---|---|---|
| mAP@0.50 | 0.885 | 0.822 |
| mAP@0.50:0.95 | 0.662 | 0.539 |
| Average Recall | 0.825 | 0.664 |
| Inference Time | 14.6 ms | 44.6–125 ms |
- YOLOv8 achieved the highest overall detection performance.
- YOLOv8 consistently outperformed YOLOv5 in precision, recall, and mAP.
- Faster R-CNN produced competitive detection quality but required significantly longer inference time.
- YOLOv8 offered the best balance between accuracy and real-time performance, making it the preferred model for deployment in the Animal Alert System.
- YOLOv8 Training Notebook
- YOLOv5 Training Notebook
- Faster R-CNN Training Notebook
- YOLOv8 vs YOLOv5 Comparison
- YOLOv8 vs Faster R-CNN Comparison
- YOLOv8 Best Weights
- YOLOv5 Best Weights
- Faster R-CNN Best Checkpoint
This repository focuses exclusively on model development, benchmarking, and evaluation.
The complete Animal Alert System application (Flask backend, authentication, webcam detection, image/video processing, alerts, and user interface) is maintained separately.
- Python
- PyTorch
- Torchvision
- Ultralytics YOLO
- OpenCV
- NumPy
- Pandas
- Matplotlib
- Jupyter Notebook
The images included in this repository are provided solely for educational, research, and demonstration purposes. All rights to the original images remain with their respective copyright owners where applicable.
The sample images are included only to demonstrate the performance of the object detection models and are not intended for commercial use or redistribution. If you are the copyright holder of any image and have concerns regarding its use, please contact the repository owner.
This project is licensed under the MIT License.


