An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# 🐢🐱 Cat vs Dog Image Classifier

![Model Accuracy](https://img.shields.io/badge/accuracy-70%25-brightgreen)
Cat and Dog

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.

---