Skip to content

Ishan-Kotian/Cats-vs-Dogs-Image-Classification-using-ResNet-50

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🐱🐢 Cats vs Dogs Image Classification using ResNet-50

This project applies deep learning and transfer learning techniques to classify images of cats and dogs. Leveraging the power of a pre-trained ResNet-50 model, the solution achieves high classification accuracy on the Kaggle Dogs vs. Cats dataset.

πŸ“Ž View Full Notebook on Kaggle:
Cats & Dogs Image Classification | ResNet-50


πŸ“‚ Project Structure

cats-dogs-resnet50/
β”œβ”€β”€ data/                 # Directory for training and validation images
β”œβ”€β”€ notebooks/
β”‚   └── cats_dogs_resnet50.ipynb   # Main training and evaluation notebook
β”œβ”€β”€ models/               # Saved model weights (optional)
β”œβ”€β”€ outputs/              # Logs, plots, and predictions
β”œβ”€β”€ requirements.txt      # Dependencies
└── README.md             # Project overview

🧠 Model Overview

  • Architecture: ResNet-50 (pre-trained on ImageNet)
  • Layers Modified: Top classification layer replaced with custom dense layer for binary classification
  • Loss Function: Binary Crossentropy
  • Optimizer: Adam
  • Metrics: Accuracy

πŸ§ͺ Key Steps

  1. Data Preparation

    • Downloaded the Dogs vs. Cats dataset
    • Resized images to 224x224 to match ResNet-50 input format
    • Applied train-validation split and data augmentation
  2. Model Building

    • Used Keras ResNet50 with include_top=False
    • Added custom fully-connected layers for binary classification
    • Compiled with Adam optimizer and binary_crossentropy loss
  3. Training

    • Used early stopping and model checkpoint callbacks
    • Trained for multiple epochs with real-time data augmentation
  4. Evaluation & Prediction

    • Evaluated on validation data
    • Visualized confusion matrix, classification report, and sample predictions

πŸ“Š Results

  • Achieved ~98% validation accuracy
  • Model generalizes well across different image types
  • Visualizations confirm robust prediction across classes

πŸ“Œ Requirements

  • TensorFlow / Keras
  • NumPy, Matplotlib, scikit-learn
  • Jupyter Notebook
  • PIL, tqdm

πŸ“ˆ Future Improvements

  • Hyperparameter tuning
  • Experiment with deeper architectures (e.g., EfficientNet, DenseNet)
  • Deploy model via Flask or Streamlit

πŸ“Ž References

About

Image classification of cats vs. dogs using transfer learning with ResNet-50. Achieved ~98% accuracy using Keras and TensorFlow on the Kaggle Dogs vs. Cats dataset.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published