Skip to content

amit77t/Cat-vs.-Dog-Image-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Cat vs. Dog Image Classification using CNN

Project Overview

This project implements a Convolutional Neural Network (CNN) model to classify images of cats and dogs. The model is trained on an image dataset and utilizes deep learning techniques to accurately distinguish between the two categories.

Tech Stack

  • Programming Language: Python
  • Libraries & Frameworks: TensorFlow, Keras, OpenCV, NumPy, Matplotlib
  • Deployment: Flask/FastAPI (Optional)

Features

  • Preprocesses images using resizing, normalization, and data augmentation
  • Builds and trains a CNN model for classification
  • Evaluates performance using accuracy, precision, recall, and confusion matrix
  • Supports real-time image classification via a web API

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/cat-vs-dog-classification.git
    cd cat-vs-dog-classification
  2. Install dependencies:
    pip install tensorflow numpy opencv-python matplotlib flask
  3. Download and prepare the dataset (Kaggle or other sources).
  4. Train the model by running the Jupyter Notebook:
    jupyter notebook cats_v_dogs_classification.ipynb
  5. (Optional) Deploy the model using Flask/FastAPI.

Dataset

The model is trained on the Dogs vs. Cats dataset, which consists of labeled images of cats and dogs. The dataset is preprocessed for efficient training.

Model Architecture

  • Conv2D layers with ReLU activation
  • MaxPooling for feature reduction
  • Fully connected layers for classification
  • Softmax activation for final output

Results

The model achieves high classification accuracy with optimized hyperparameters. Performance is evaluated using:

  • Accuracy Score
  • Confusion Matrix
  • Precision, Recall, and F1-score

Deployment

The trained model can be deployed as an API for real-time classification. Flask or FastAPI is used to serve the model, allowing users to upload images and receive predictions.

Usage

Run the Flask API and send an image for classification:

python app.py

Send a POST request with an image:

curl -X POST -F "[email protected]" http://127.0.0.1:5000/predict

Future Improvements

  • Implementing Transfer Learning using pre-trained models like VGG16 or ResNet
  • Enhancing dataset size for better generalization
  • Deploying the model using cloud services like AWS or Google Cloud

Contributors

Amit Chaurasia - GitHub Profile


This project demonstrates deep learning concepts and computer vision techniques to build a robust classification model.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published