This repository showcases a structured and progressive approach to training a Convolutional Neural Network (CNN) for binary image classification (cats vs dogs). The project demonstrates the impact of various training techniques such as data augmentation, batch normalization, and weight initialization on model performance.
This project contains the following key Jupyter notebooks:
A standalone demonstration of common image augmentation techniques using Keras' ImageDataGenerator
. This includes:
- Rotation
- Horizontal/vertical flipping
- Zooming
- Shifting
- Brightness adjustments
Trains a simple CNN model on the Cats vs Dogs dataset with only data augmentation applied. Includes performance analysis using training/validation accuracy and loss.
Builds upon the previous model by incorporating batch normalization after convolutional layers to improve convergence and stability during training.
The most advanced notebook in the repository. It applies:
- Data Augmentation
- Batch Normalization
- He Normal Weight Initialization (
kernel_initializer='he_normal'
)
This approach boosts model generalization and speeds up convergence.
Loads the trained CNN model and evaluates it on a set of test images. Includes visualization of predictions with labels.
- Data Augmentation: Mitigates overfitting by artificially expanding the training dataset.
- Batch Normalization: Stabilizes training and allows for higher learning rates.
- Weight Initialization: Helps prevent vanishing/exploding gradients and accelerates convergence.
- Model Evaluation: Uses accuracy and loss plots, along with prediction visualization, to assess model performance.
Using ImageDataGenerator
, input images are augmented with:
- Random flips
- Brightness shifts
- Zoom and rotation
This enhances model robustness to real-world image variations.
- Clone the repository:
git clone https://github.com/rusiru-erandaka/Data-Augmentation_Batch-Normalization_Weight-Initialization_Deeplearning.git
cd Data-Augmentation_Batch-Normalization_Weight-Initialization_Deeplearning