https://github.com/busrarafa/dog-vs-cat-custom-cnn-classification-model
https://github.com/busrarafa/dog-vs-cat-custom-cnn-classification-model
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/busrarafa/dog-vs-cat-custom-cnn-classification-model
- Owner: BusraRafa
- Created: 2025-06-21T14:24:22.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-21T15:04:25.000Z (12 months ago)
- Last Synced: 2025-06-21T15:30:29.079Z (12 months ago)
- Language: Jupyter Notebook
- Size: 1.15 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# πΆπ± Dog vs Cat Classification with Custom CNN
This project is a binary image classification model that distinguishes between **cats** and **dogs** using a **custom-built Convolutional Neural Network (CNN)** in TensorFlow/Keras.
## π Dataset
For this used the [Microsoft Dogs vs Cats Dataset](https://www.kaggle.com/datasets/microsoft/catsvsdogs), available on Kaggle, which contains 25,000 labeled images of cats and dogs.
```bash
https://www.kaggle.com/datasets/microsoft/catsvsdogs
```
- Preprocessing:
- Corrupt images removed
- Normalized and resized to 224x224
- Data augmentation applied (rotation, zoom, flip, shift, etc.)
---
## π§ Model Overview
- **Type**: Binary Image Classification (Cat = 0, Dog = 1)
- **Framework**: TensorFlow/Keras
- **Architecture**:
- 4 Convolutional layers
- Batch Normalization after each conv layer
- MaxPooling layers
- Dropout before the dense layers
- Final sigmoid activation
- **Loss**: Binary Crossentropy
- **Optimizer**: Adam
- **Input Size**: 224x224 RGB Images
---
## π Evaluation Results (on Validation Set)
| Metric | Cat (0) | Dog (1) |
|------------|----------|----------|
| Precision | 0.85964 | 0.95723 |
| Recall | 0.96242 | 0.84261 |
| F1-score | 0.90813 | 0.89627 |
| Support | 2501 | 2497 |
- **Accuracy**: 90.26%
- **Macro Avg F1-score**: 90.22%
- **Weighted Avg F1-score**: 90.22%
β
The model shows high performance with balanced precision and recall for both classes.
---
## Sample Predictions
