🐢 AI Pet Classifier using CNN

A deep learning application that classifies images of cats and dogs using a Convolutional Neural Network (CNN) built with TensorFlow and Keras.

...

🐢🐱 AI Pet Classifier using Convolutional Neural Networks (CNN)

Overview

AI Pet Classifier is a deep learning project that classifies images as either Cat or Dog using a Convolutional Neural Network (CNN) built with TensorFlow and Keras. The model is trained on thousands of labeled pet images and predicts the class of unseen images with high accuracy.


Features

  • Binary Image Classification
  • TensorFlow & Keras Implementation
  • Data Augmentation
  • Batch Normalization
  • Image Preprocessing
  • Model Saving & Loading
  • Single Image Prediction
  • Beginner-Friendly Notebook
  • Google Colab Compatible

Project Pipeline

Dataset
   β”‚
   β–Ό
Image Preprocessing
   β”‚
   β–Ό
Data Augmentation
   β”‚
   β–Ό
CNN Model
   β”‚
   β–Ό
Training
   β”‚
   β–Ό
Evaluation
   β”‚
   β–Ό
Prediction

CNN Architecture

Input Layer (64Γ—64Γ—3)

↓

Conv2D (32 Filters)
↓

Batch Normalization
↓

MaxPooling

↓

Conv2D (64 Filters)
↓

MaxPooling

↓

Conv2D (128 Filters)
↓

MaxPooling

↓

Flatten

↓

Dense (128)

↓

Dense (1, Sigmoid)

↓

Prediction

Technologies Used

  • Python
  • TensorFlow
  • Keras
  • NumPy
  • Matplotlib
  • Pillow
  • Google Colab

Dataset Structure

Data/

β”œβ”€β”€ training_set/
β”‚   β”œβ”€β”€ cats/
β”‚   └── dogs/
β”‚
└── test_set/
    β”œβ”€β”€ cats/
    └── dogs/

Hyperparameters

Parameter Value
Image Size 64 Γ— 64
Batch Size 32
Epochs 25
Optimizer Adam
Loss Function Binary Crossentropy
Activation ReLU
Output Activation Sigmoid

Training

The model uses image augmentation to improve generalization by applying:

  • Rescaling
  • Random Zoom
  • Shear Transformation
  • Horizontal Flip

Prediction

The trained model predicts whether the uploaded image belongs to:

  • 🐱 Cat
  • 🐢 Dog

along with the prediction confidence.


Future Improvements

  • Early Stopping
  • Model Checkpoint
  • Transfer Learning (MobileNetV2 / EfficientNet)
  • Confusion Matrix
  • Classification Report
  • Accuracy & Loss Curves
  • Grad-CAM Visualization
  • Streamlit & Hugging Face Deployment

Repository Structure

β”œβ”€β”€ CNN_Model.ipynb
β”œβ”€β”€ cnn_model.keras
β”œβ”€β”€ Data.zip
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── LICENSE

Author

Sudheer Muthyala

B.Tech (ECE)

Aspiring AI & Data Science Engineer

GitHub: https://github.com/M-Sudheer18


License

This project is licensed under the MIT License.


⭐ If you found this project helpful, consider giving it a star.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support