A simple web-based image classification app built with Flask and Keras.
It allows users to upload an image, processes it with a trained CNN model, and returns the predicted class — all through an intuitive web interface.
This project integrates a Convolutional Neural Network (CNN) model, and precisely the VGG19 model (I might change it in the future since this model is kinda overkill for this use case), with a Flask backend to classify images in real-time.
It’s designed as a minimal full-stack machine learning application — a foundation for deploying deep learning models as web services.
- 2 trained Keras models (
vgg19.h5andsequential_model_cnn.h5) - A Flask API for serving predictions
- File upload and image preprocessing via OpenCV and NumPy
- Optional CORS setup for cross-origin frontend requests
- ✅ Upload any image through a browser or API request
- ✅ Preprocess image input using OpenCV (resize, normalize, reshape)
- ✅ Predict class probabilities with trained Keras models
- ✅ Return results as clean JSON or HTML
- ✅ Modular and easy to expand for other models or categories
- ✅ Runs locally with or without GPU (TensorFlow handles fallback)
Click to expand
cnn_app/
├── app.py
├── models/
│ ├── sequential_model_cnn.h5
│ └── vgg19.h5
├── templates/
│ ├── predictions.html
│ └── index.html
├── requirements.txt
└── README.md
NOTE: This repo uses Git LFS to store large model files. Make sure you have Git LFS installed:
- Clone the repository
git lfs install
git clone https://github.com/Sfeso13/Breast-Cancer-Classification-App.gitIf you already cloned without LFS:
git lfs pull- Create and activate a virtual environment
cd Breast-Cancer-Classification-App
python3 -m venv venvLinux/macos
source venv/bin/activateor windows
venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Run the app
python app.pyNow you can visit
http://127.0.0.1:5000
And upload an image to get its classification