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
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
- 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
-
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
-
Model Building
- Used Keras
ResNet50
withinclude_top=False
- Added custom fully-connected layers for binary classification
- Compiled with
Adam
optimizer andbinary_crossentropy
loss
- Used Keras
-
Training
- Used early stopping and model checkpoint callbacks
- Trained for multiple epochs with real-time data augmentation
-
Evaluation & Prediction
- Evaluated on validation data
- Visualized confusion matrix, classification report, and sample predictions
- Achieved ~98% validation accuracy
- Model generalizes well across different image types
- Visualizations confirm robust prediction across classes
- TensorFlow / Keras
- NumPy, Matplotlib, scikit-learn
- Jupyter Notebook
- PIL, tqdm
- Hyperparameter tuning
- Experiment with deeper architectures (e.g., EfficientNet, DenseNet)
- Deploy model via Flask or Streamlit