Car-logo-classification

An image classification model from data collection, cleaning, model training, deployment and API integration.
The model can classify 20 different types of logos of cars
The types are following:

📌 Project Workflow

1️⃣ Problem Statement

Develop an AI-powered model to classify various car logos from images.

2️⃣ Data Collection

3️⃣ Data Preprocessing

4️⃣ Model Training

5️⃣ Model Evaluation

6️⃣ Model Deployment

7️⃣ Future Improvements

Data Collection and Preparation

Data Collection

The dataset was collected from DuckDuckGo using car brand names as search terms, ensuring diverse images for training.

DataLoader

The fastai DataBlock API was used to set up the DataLoader, organizing the data into training and validation sets.

Data Augmentation

fastai provides default GPU-accelerated data augmentations, improving the model’s generalization.

For more details, check the Data_prep_logo_classi.ipynb notebook.

Training, Data Cleaning, and Inference

Training

The model was fine-tuned using ResNet101 for 15 epochs, repeated 3 times, achieving an accuracy of approximately 94%. Details can be found in training.ipynb

Data Cleaning

Data cleaning was the most time-consuming part of the process. Since the data was collected from a browser, there was a significant amount of noise, and some images contained irrelevant content. To clean and update the dataset, I used the fastai ImageClassifierCleaner. Data cleaning was performed after each training or fine-tuning session, except for the final iteration, which represented the final model. Details can be found in data_cleaning.ipynb

Inference

For inference, the trained model is used to classify new car logo images. The fastai Learner was utilized to load the fine-tuned model and make predictions. This allows the model to classify unseen car logos accurately, based on the learned patterns during training. Details can be found in inference.ipynb

Model Deployment

I deployed to model to HuggingFace Spaces Gradio App. The implementation can be found in deployment folder or here.

API integration with GitHub Pages

The deployed model API is integrated here in GitHub Pages Website. Implementation and other details can be found in docs folder.

🚀 Project Usage Guide

Follow these steps to set up and run the project on your local machine.

1️⃣ Clone the Repository

git clone https://github.com/fayez94/Car-logo-classification.git
cd Car_Logo_Classification

2️⃣ Create and Activate a Virtual Environment

🔹 For Windows:

python -m venv myvenv
myvenv\Scripts\activate

🔹 For macOS/Linux:

python3 -m venv myvenv
source myvenv/bin/activate

3️⃣ Install Required Dependencies

pip install -r requirements.txt

4️⃣ Run the app file

python app.py

5️⃣ Deactivating the Virtual Environment

deactivate

Contributions

Contributions are always welcome! If you’d like to contribute to the Car Logo Classifier project, here’s how you can help:

How to Contribute:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-name)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add new feature')
  5. Push to the branch (git push origin feature-name)
  6. Open a Pull Request

Ways You Can Contribute:

Thank you for considering contributing! 🙏

📬 Contact

For any questions or suggestions, feel free to reach out!

📧 Email: mdfayezullah2624@gmail.com
🐙 GitHub: fayez94