A modern and highly accurate Cat vs Dog Image Classification System built using:
- Transfer Learning (97% accuracy)
- TensorFlow / Keras
- Flask Backend API
- HTML + CSS + JavaScript Frontend
This version provides a full UI where users can upload an image and instantly get predictions — no Postman required.
- 🧠 Transfer Learning Model (97% test accuracy)
- 🖼️ Upload image directly from browser
- ⚡ Real-time prediction using Flask API
- 🎨 Clean and simple web frontend
- 🔥 Automatically loads and preprocesses images
- 📦 Easy to deploy anywhere (local / cloud / VPS)
/project
│── models
| |── transfer_learning_model.keras
│── notebooks
| |── transfer_learning.ipynb
│── templates
| |── index.html
│── static
| |── style.css
│── img
| |── home.png
| |── prediction.png
│── main.py
│── requirements.txt
│── README.md
│── License
-
Backend
- Python
- Flask
- TensorFlow / Keras
- NumPy
- Pillow (PIL)
-
Fronend
- HTML5
- HTML5
- JavaScript
-
ML Model
- Transfer Learning using: Xception
- Transfer Learning using: Xception
-
Clone the repository:
git clone https://github.com/YourUsername/CNN-Image-Classification-System.git cd CNN-Image-Classification-System -
Create virtual environment (optional but recommended):
python -m venv venv venv\Scripts\activate # For Windows # OR source venv/bin/activate # For macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask server:
python main.py
Server will start at:
👉http://127.0.0.1:5000
- Open your browser
→
http://127.0.0.1:5000 - Click Choose Image
- Select a
.jpg,.jpeg, or.png - Click Predict
- You will see:
{
"prediction": "dog",
"confidence": 0.9123
}
or
{
"prediction": "cat",
"confidence": 0.7344
}
The requirements.txt file includes all necessary packages:
- flask
- tensorflow
- numpy
- pillow
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to improve.
This project is licensed under the MIT License – see the LICENSE file for details.

