A modern deep learning–powered web application that identifies brand logos from images using a trained Xception CNN model.
Built with Flask, TensorFlow, and a clean, interactive UI.
Trained on the Flickr Logos 27 Dataset, deployed via a clean Flask interface.
- 📋 Table of Contents
- ✨ Introduction
- ⚙️ Tech Stack
- 🔋 Features
- 📁 Dataset
- 🤖 Model Architecture
- 🚀 Project Workflow
- 🤸 Quick Start
- 🧱 Project Structure
- 🖥️ App Flow
- 🧠 Architecture Overview
- 🚀 Future Enhancements
- 🤝 Contribution
- 🔗 Contacts
- 📄 License
- 🙏 Acknowledgements
AI Logo Detection is an end-to-end deep learning project that identifies brand logos in images.
This project consists of:
- A deep learning model (Xception + custom CNN head) trained via transfer learning.
- A Flask web app where users upload an image.
- The model predicts:
- Logo Name
- Confidence Score
- Displays the uploaded image.
Built for accuracy, performance, and clean UI.
- TensorFlow 2.x
- Keras
- Xception (pretrained on ImageNet)
- OpenCV
- NumPy
- Pandas
- Flask
- Werkzeug
- HTML5
- CSS3
- JavaScript (for image preview)
- Upload any image (JPG/PNG)
- Model returns:
- Predicted brand
- Confidence %
- Raw probability vector
- Drag-and-drop upload
- Live image preview
- Clean dark theme
- Result preview panel
- 27 logo classes
- Transfer learning using Xception
- High accuracy model stored in
logo.h5
- Handles uploads
- Saves files to
static/uploads/ - Renders predictions dynamically
This project uses the Flickr Logos 27 Dataset, which contains:
- 27 brand classes
- Training + validation annotations
- Bounding box coordinates
- Distractor images
Dataset includes brands such as:
Adidas, Apple, BMW, CocaCola, Ferrari, Ford, Google, Intel, Nike,
Pepsi, Porsche, Puma, RedBull, Starbucks, Yahoo, Vodafone, McDonalds, etc.
Built using Transfer Learning:
- Backbone: Xception (pretrained on ImageNet)
- Custom classification head:
- AveragePooling
- Flatten
- Dense (128)
- Dropout (0.5)
- Dense (27 softmax)
Loss: categorical_crossentropy
Optimizer: Adam
The model is exported as:
logo.h5
1️⃣ Dataset extraction → bounding box cropping
2️⃣ Data augmentation using ImageDataGenerator
3️⃣ Transfer learning with Xception
4️⃣ Model training on 224×224 images
5️⃣ Evaluation & classification report
6️⃣ Model exported to project
7️⃣ Flask app built for real-time inference
8️⃣ User uploads an image
9️⃣ Prediction displayed in browser
- Python 3.8+
- pip
- Virtual environment recommended
git clone https://github.com/itssanthoshhere/Logo-Detection.git
cd Logo-Detectionpython3 -m venv venv
source venv/bin/activatepip install -r requirements.txt(or manually)
pip install flask tensorflow pillow numpypython app.pyNavigate to:
Upload an image → get prediction 🎉
logo_flask_full/
├── app.py
├── classes.txt
├── logo.h5
├── logo_detection_flickr27.ipynb
├── logos/
│ ├── Ferrari.jpg
│ ├── McDonald's.jpg
│ └── ford.jpg
├── static/
│ ├── style.css
│ └── uploads/
├── templates/
│ └── index.html
└── venv/
-
User opens web page
-
Uploads image (drag & drop or file picker)
-
Flask receives file
-
Model processes image
-
Prediction returned
-
UI displays:
- Logo name
- Confidence
- Image preview
- Loads TensorFlow model at startup
- Handles
/predictendpoint - Saves uploaded images
- Returns prediction + confidence
- Styled HTML/CSS
- Image preview before upload
- Displays prediction results
- Transfer learning
- 27-class softmax classifier
- Preprocessed with normalization
- 🔲 Bounding box logo localization
- 🔲 Support for multiple logos in one image
- 🔲 Convert model to TensorFlow Lite (TFLite)
- 🔲 Deploy on Render / Railway / AWS
- 🔲 Add API-only mode (REST endpoints)
- 🔲 Add history of predictions
- 🔲 Add brand logo icons in UI
Contributions are welcome!
- Fork repo
- Create a feature branch
- Commit changes
- Open a PR 🎉
- GitHub: Itssanthoshhere
- LinkedIn: Santhosh VS
For educational and research purposes only. Logos belong to their respective brands.
- Flickr Logos 27 Dataset
- TensorFlow / Keras
- Flask
- Kaggle
- OpenCV
If you like this project, give it a star ⭐ on GitHub — it motivates me to build more awesome ML apps!