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

https://github.com/naveenkumar48/imageclassification

CNN-based image classifier for dogs and cats using TensorFlow and Keras, trained on the Kaggle dataset with automated preprocessing, training, and prediction.
https://github.com/naveenkumar48/imageclassification

cnn computer-vision deep-learning keras tensorflow

Last synced: 2 months ago
JSON representation

CNN-based image classifier for dogs and cats using TensorFlow and Keras, trained on the Kaggle dataset with automated preprocessing, training, and prediction.

Awesome Lists containing this project

README

          

# 🐢🐱 Dog vs Cat Image Classifier using CNN

A deep learning project to automatically classify images of dogs and cats using a Convolutional Neural Network (CNN) built with TensorFlow and Keras.

---

## Project Overview

This project demonstrates an end-to-end workflow of:

- Downloading and preparing image data (from Kaggle).
- Building and training a CNN for binary classification.
- Evaluating performance with loss and accuracy metrics.
- Predicting and visualizing the classification of new images.

---

##Key Features

βœ… Download dataset automatically via Kaggle API
βœ… Preprocess and normalize images
βœ… Build a custom CNN with multiple convolutional and dense layers
βœ… Visualize training and validation metrics
βœ… Predict on custom test images

---

## Model Architecture

- **Input:** 256x256 RGB images
- **Layers:**
- 3 Γ— Conv2D layers with ReLU activation
- MaxPooling and BatchNormalization after each Conv2D
- Flatten + Dense layers with Dropout regularization
- Sigmoid output for binary classification
- **Optimizer:** Adam
- **Loss Function:** Binary Crossentropy
- **Metrics:** Accuracy

---

## πŸ› οΈ Technologies Used

- Python 3
- TensorFlow
- Keras
- OpenCV
- Matplotlib
- Kaggle API
- Jupyter Notebook / Google Colab

## πŸ“ˆ Training & Evaluation

The model is trained over **5 epochs** on the Kaggle "Dogs vs Cats" dataset.

### Sample Training Results:
- **Training Accuracy:** ~85% (depending on epochs and dataset splits)
- **Validation Accuracy:** ~80%

### Loss and Accuracy Graphs:

![Accuracy](Accuracy_output.png)

![Loss](Loss_output.png)

## πŸ–ΌοΈ Example Prediction

Test image loaded with OpenCV:

![Test Image](dog.jpg)

Model output: **Dog**