https://github.com/srepasup/cat-and-dog-image-classifier
A convolutional neural network (CNN) built with TensorFlow and Keras to classify images of cats and dogs with over 63% accuracy.
https://github.com/srepasup/cat-and-dog-image-classifier
cnn deep-learning image-classification keras machine-learning tensorflow
Last synced: 2 months ago
JSON representation
A convolutional neural network (CNN) built with TensorFlow and Keras to classify images of cats and dogs with over 63% accuracy.
- Host: GitHub
- URL: https://github.com/srepasup/cat-and-dog-image-classifier
- Owner: srepasup
- Created: 2025-05-06T03:26:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-08T02:36:58.000Z (about 1 year ago)
- Last Synced: 2025-05-08T02:51:54.687Z (about 1 year ago)
- Topics: cnn, deep-learning, image-classification, keras, machine-learning, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 1.85 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# πΆπ± Cat vs Dog Image Classifier


This project uses a Convolutional Neural Network(CNN) built with Keras and TensorFlow 2.0 to classify images as either a cat or a dog. It uses a dataset of 3,000+ labeled images and achieves over 70% accuracy.
β
Trained on 2,000 images
β
Validated on 1,000 images
β
Tested on 50 unlabeled images
## π― Objective
Train a CNN model that can classify cat and dog images with over 63% accuracy.
## π Dataset
The dataset is provided by freeCodeCamp and includes:
- 2,000 training images
- 1,000 validation images
- 50 test images (unlabeled)
The folder structure:
cats_and_dogs/
βββ train/
β βββ cats/
β βββ dogs/
βββ validation/
β βββ cats/
β βββ dogs/
βββ test/
βββ [unlabeled images]
## π§ͺ Model Summary
- Preprocessing with `ImageDataGenerator` (rescaling + augmentation)
- CNN with Conv2D, MaxPooling2D, and Dense layers
- Trained for 15 epochs with a batch size of 128
## π Results
- Achieved over **63% accuracy**
- Successfully passed the automated test
- Visualized predictions on test data
## π Tools Used
- Python 3.x
- TensorFlow 2.x
- Keras
- Google Colab
- Matplotlib & NumPy
## π How to Run
1. Open the `.ipynb` notebook in Google Colab.
2. Run all cells in order.
3. Make sure the dataset downloads and unzips correctly.
4. After training, evaluate and visualize predictions in Cells 10 & 11.
---