Image Classification
Transformers
TensorBoard
Safetensors
vit
food
fruits
junkfood
Generated from Trainer
Instructions to use gutkia01/vit-food-classification-gutkia01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gutkia01/vit-food-classification-gutkia01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="gutkia01/vit-food-classification-gutkia01") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("gutkia01/vit-food-classification-gutkia01") model = AutoModelForImageClassification.from_pretrained("gutkia01/vit-food-classification-gutkia01", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -26,19 +26,46 @@ It achieves the following results on the evaluation set:
|
|
| 26 |
- Model Preparation Time: 0.0034
|
| 27 |
- Accuracy: 0.9998
|
| 28 |
|
| 29 |
-
#
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
##
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
##
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
### Training hyperparameters
|
| 44 |
|
|
@@ -53,7 +80,19 @@ The following hyperparameters were used during training:
|
|
| 53 |
|
| 54 |
### Training results
|
| 55 |
|
|
|
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
### Framework versions
|
| 59 |
|
|
|
|
| 26 |
- Model Preparation Time: 0.0034
|
| 27 |
- Accuracy: 0.9998
|
| 28 |
|
| 29 |
+
# 🍎 Fruits vs. Junkfood Classifier – Vision Transformer (gutkia01)
|
| 30 |
|
| 31 |
+
This model is a fine-tuned version of [`google/vit-base-patch16-224`](https://huggingface.co/google/vit-base-patch16-224), trained on a custom binary dataset to distinguish between **healthy fruits** and **unhealthy fast food**.
|
| 32 |
|
| 33 |
+
## 🧠 Model Description
|
| 34 |
|
| 35 |
+
- **Architecture:** Vision Transformer (ViT)
|
| 36 |
+
- **Base model:** `google/vit-base-patch16-224`
|
| 37 |
+
- **Task:** Binary image classification: `Fruit` vs. `Junkfood`
|
| 38 |
+
- **Framework:** Hugging Face Transformers Trainer
|
| 39 |
+
- **Input format:** RGB images, 224×224, loaded via `imagefolder`
|
| 40 |
|
| 41 |
+
## ✅ Intended Use & Limitations
|
| 42 |
|
| 43 |
+
### Appropriate Use Cases
|
| 44 |
|
| 45 |
+
- Food classification in nutrition, health, or educational applications
|
| 46 |
+
- Interactive demos comparing healthy vs. unhealthy food
|
| 47 |
+
- Computer vision use cases with simple binary class structures
|
| 48 |
+
|
| 49 |
+
### Limitations
|
| 50 |
+
|
| 51 |
+
- Only supports binary classification (no subclass differentiation)
|
| 52 |
+
- Cannot recognize new or abstract dishes (e.g. salad, sushi)
|
| 53 |
+
- Cannot evaluate ingredients, calories, or portion sizes
|
| 54 |
+
|
| 55 |
+
## 📊 Training and Evaluation Data
|
| 56 |
+
|
| 57 |
+
The model was trained on a binary dataset composed of:
|
| 58 |
+
|
| 59 |
+
- **Fruits360 Dataset**: 137,000+ structured fruit images in a controlled studio setup ([Kaggle link](https://www.kaggle.com/datasets/moltean/fruits))
|
| 60 |
+
- **Fast Food Classification Dataset v2**: 20,000 fast food images, 10 categories (e.g., burger, pizza, fries) ([Kaggle link](https://www.kaggle.com/datasets/utkarshsaxenadn/fast-food-classification-dataset))
|
| 61 |
+
-
|
| 62 |
+
|
| 63 |
+
### Dataset Composition
|
| 64 |
+
|
| 65 |
+
The dataset is a combination of:
|
| 66 |
+
|
| 67 |
+
- **Fruits360 Dataset** ([Kaggle](https://www.kaggle.com/datasets/moltean/fruits))
|
| 68 |
+
- **Fast Food Classification Dataset v2** ([Kaggle](https://www.kaggle.com/datasets/utkarshsaxenadn/fast-food-classification-dataset))
|
| 69 |
|
| 70 |
### Training hyperparameters
|
| 71 |
|
|
|
|
| 80 |
|
| 81 |
### Training results
|
| 82 |
|
| 83 |
+
### Training results
|
| 84 |
|
| 85 |
+
| Epoch | Training Loss | Validation Loss | Accuracy |
|
| 86 |
+
|-------|---------------|------------------|----------|
|
| 87 |
+
| 1 | 0.0000 | 0.0215 | 0.9975 |
|
| 88 |
+
| 2 | 0.0000 | 0.00004 | 1.0000 |
|
| 89 |
+
| 3 | 0.0000 | 0.00008 | 1.0000 |
|
| 90 |
+
| 4 | 0.0000 | 0.00011 | 1.0000 |
|
| 91 |
+
| 5 | 0.0000 | 0.00011 | 1.0000 |
|
| 92 |
+
| 6 | 0.0000 | 0.00008 | 1.0000 |
|
| 93 |
+
|
| 94 |
+
Final training loss: **0.00047**
|
| 95 |
+
Evaluation accuracy: **0.9998**
|
| 96 |
|
| 97 |
### Framework versions
|
| 98 |
|