iBrokeTheCode commited on
Commit
dca1a4b
ยท
1 Parent(s): fca4028

chore: Add README

Browse files
Files changed (2) hide show
  1. README.md +88 -1
  2. assets/app-demo.png +3 -0
README.md CHANGED
@@ -11,4 +11,91 @@ license: mit
11
  short_description: Product classification using image and text
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  short_description: Product classification using image and text
12
  ---
13
 
14
+ # ๐Ÿ›๏ธMultimodal Product Classification with Gradio
15
+
16
+ ## Table of Contents
17
+
18
+ 1. [Project Description](#1-project-description)
19
+ 2. [Methodology & Key Features](#2-methodology--key-features)
20
+ 3. [Technology Stack](#3-technology-stack)
21
+ 4. [Model Details](#4-model-details)
22
+
23
+ ## 1. Project Description
24
+
25
+ This project implements a **multimodal product classification system** for Best Buy products. The core objective is to categorize products using both their text descriptions and images. The system was trained on a dataset of **almost 50,000** items.
26
+
27
+ The entire system is deployed as a lightweight, web application using **Gradio**. The app allows users to:
28
+
29
+ - Use both text and an image for the most accurate prediction.
30
+ - Run predictions using only text or only an image to understand the contribution of each data modality.
31
+
32
+ This project showcases the power of combining different data types to build a more robust and intelligent classification system.
33
+
34
+ > [!IMPORTANT]
35
+ >
36
+ > - Check out the deployed app here: ๐Ÿ‘‰๏ธ [Multimodal Product Classification App](https://huggingface.co/spaces/iBrokeTheCode/Multimodal_Product_Classification) ๐Ÿ‘ˆ๏ธ
37
+ > - Check out the Jupyter Notebook for a detailed walkthrough of the project here: ๐Ÿ‘‰๏ธ [Jupyter Notebook](https://huggingface.co/spaces/iBrokeTheCode/Multimodal_Product_Classification/blob/main/notebook_guide.ipynb) ๐Ÿ‘ˆ๏ธ
38
+
39
+ <br>
40
+
41
+ ![App](./assets/app-demo.png)
42
+
43
+ ## 2. Methodology & Key Features
44
+
45
+ - **Core Task:** Multimodal Product Classification on a Best Buy dataset.
46
+
47
+ - **Pipeline:**
48
+
49
+ - **Data:** A dataset of \~50,000 products, each with a text description and an image.
50
+ - **Feature Extraction:** Pre-trained models are used to convert raw text and image data into high-dimensional embedding vectors.
51
+ - **Classification:** A custom-trained **Multilayer Perceptron (MLP)** model performs the final classification based on the embeddings.
52
+
53
+ - **Key Features:**
54
+
55
+ - **Multimodal:** Combines text and image data for a more accurate prediction.
56
+ - **Single-Service Deployment:** The entire application runs as a single, deployable Gradio app.
57
+ - **Flexible Inputs:** The app supports multimodal, text-only, and image-only prediction modes.
58
+
59
+ ## 3. Technology Stack
60
+
61
+ This project was built using the following technologies:
62
+
63
+ **Deployment & Hosting:**
64
+
65
+ - [Gradio](https://gradio.app/) โ€“ interactive web app frontend.
66
+ - [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces) โ€“ for cost-effective deployment.
67
+
68
+ **Modeling & Training:**
69
+
70
+ - [TensorFlow / Keras](https://www.tensorflow.org/) โ€“ used to train the final MLP classification model.
71
+ - [Sentence-Transformers](https://www.sbert.net/) โ€“ for generating text embeddings.
72
+ - [Hugging Face Transformers](https://huggingface.co/docs/transformers/index) โ€“ for the image feature extractor (`TFConvNextV2Model`).
73
+
74
+ **Development Tools:**
75
+
76
+ - [Ruff](https://github.com/charliermarsh/ruff) โ€“ Python linter and formatter.
77
+ - [uv](https://github.com/astral-sh/uv) โ€“ fast Python package installer and resolver.
78
+
79
+ ## 4. Model Details
80
+
81
+ The final classification is performed by a custom-trained **Multilayer Perceptron (MLP)** model that takes the extracted embeddings as input.
82
+
83
+ - **Text Embedding Model:** `SentenceTransformer` (`all-MiniLM-L6-v2`)
84
+ - **Image Embedding Model:** `TFConvNextV2Model` (`convnextv2-tiny-22k-224`)
85
+ - **Classifier:** A custom MLP model trained on top of the embeddings.
86
+ - **Classes:** The model classifies products into a set of specific Best Buy product categories.
87
+
88
+ | Model | Modality | Accuracy | Macro Avg F1-Score | Weighted Avg F1-Score |
89
+ | :------------------ | :----------- | :------- | :----------------- | :-------------------- |
90
+ | Random Forest | Text | 0.90 | 0.83 | 0.90 |
91
+ | Logistic Regression | Text | 0.90 | 0.84 | 0.90 |
92
+ | Random Forest | Image | 0.80 | 0.70 | 0.79 |
93
+ | Random Forest | Combined | 0.89 | 0.79 | 0.89 |
94
+ | Logistic Regression | Combined | 0.89 | 0.83 | 0.89 |
95
+ | **MLP** | **Image** | **0.84** | **0.77** | **0.84** |
96
+ | **MLP** | **Text** | **0.92** | **0.87** | **0.92** |
97
+ | **MLP** | **Combined** | **0.92** | **0.85** | **0.92** |
98
+
99
+ > [!TIP]
100
+ >
101
+ > Based on the evaluation on the test set, the Multimodal MLP model achieved an excellent **92% accuracy** and a **92% weighted F1-score**, confirming its superior performance by leveraging both text and image data.
assets/app-demo.png ADDED

Git LFS Details

  • SHA256: ea5fbaa8183b0b8b506e62c72908b97bb7fd91e6f3b05ee2d34bea7c6a912955
  • Pointer size: 131 Bytes
  • Size of remote file: 241 kB