This Git repository contains the code for the Kaggle competition: Retail Products Classification 2023.
This repository presents a model for fine-grained product recognition, specifically based on leaflet images. The dataset comprises 41.6k manually annotated product images categorized into 832 classes. These images were extracted from advertisement leaflets collected over several years from various European retailers. The project explores three different approaches for fine-grained product classification: Classification by Image, by Text, and by Image and Text. The "Classification by Text" approach utilizes text extracted directly from the leaflet product images. The study demonstrates that combining image and text inputs improves the classification accuracy, particularly for visually challenging products. The final model achieves an impressive accuracy of 97.44% with a Top-3 score of 99.2%.
- image_model/train_model.ipynb: Jupyter notebook containing code for model training.
- image_model/test_model.ipynb: Jupyter notebook for testing the trained model and generating predictions.
- text_model/OCR_text_extraction.ipynb: Jupyter notebook for text extraction using Tesseract.
- text_model/OCR_pattern_extraction.ipynb: Jupyter notebook for text extraction using Tesseract with patterns.
- text_model/text_model.ipynb: Jupyter notebook to classify OCR (Optical Character Recognition) extracted text data into different product categories.
- /data/extracted_text_data: Extracted text data for different configurations.
Please review the README files located in the respective directories for information regarding the image and text models.
Execute train_model.ipynb to train the model.
Use test_model.ipynb for testing and predicting with the trained model.
Execute text_model.ipynb to train the model.
Top 5 accuracy: 97.08%
Number of misclassified images: 653
Accuracy on misclassified images from the image model: 67.38%
Top 5 accuracy on misclassified images: 93.85%
Overall accuracy: 85.06%
Overall top 5 accuracy: 93.85%
Overall estimated accuracy: 97.44%
This project is created for the Kaggle competition "Retail Products Classification 2023".
If you find this code helpful, consider giving it a star!
Fine-Grained Product Classification on Leaflet Advertisements