This project implements a Convolutional Neural Network (CNN) to classify images of cats and dogs. The model is trained on labeled images and predicts whether a given image contains a cat or a dog.
- Uses a deep learning model (CNN) for image classification.
- Processes images of cats and dogs and predicts their category.
- Provides performance evaluation using Confusion Matrix, ROC, and precision-recall curves.
The dataset consists of images of cats and dogs. You can use publicly available datasets such as:
As the dataset contains 25,000 images, they are not included in the repository. Below is the directory structure to organize the images after downloading from Kaggle:
| Cats-and-Dogs-Classification-using-CNN
|
| database
| |
| | train
| | |
| | | dogs
| | | |
| | | |dog.1.jpg
| | |
| | | cats
| | | |
| | | |cat.1.jpg
| |
| | test
| | |
| | | dogs
| | | |
| | | |dog.1.jpg
| | |
| | | cats
| | | |
| | | |cat.1.jpg
The CNN model consists of the following layers:
- Convolutional Layers - Extracts features from images.
- Pooling Layers - Reduces dimensionality.
- Fully Connected Layers - Classifies images into cats or dogs.
- Output Layer - Uses softmax/sigmoid for final classification.
- Clone the repository:
git clone https://github.com/mr-mahmood/Cats-and-Dogs-Classification-using-CNN.git cd Cats-and-Dogs-Classification-using-CNN
- Install dependencies:
pip install -r requirements.txt
run the following file and test model:
python gui.py
- The model achieves high accuracy in classifying cats and dogs around 95%.
- Performance metrics such as confusion matrix, precision, recall are used for evaluation.
For any questions or suggestions, feel free to reach out!