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
Training in progress, step 500
Browse files- README.md +14 -67
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -12,21 +12,7 @@ metrics:
|
|
| 12 |
- accuracy
|
| 13 |
model-index:
|
| 14 |
- name: vit-food-classification-gutkia01
|
| 15 |
-
results:
|
| 16 |
-
- task:
|
| 17 |
-
type: image-classification
|
| 18 |
-
name: Image Classification
|
| 19 |
-
dataset:
|
| 20 |
-
name: Custom Fruits vs. Junkfood
|
| 21 |
-
type: image
|
| 22 |
-
split: test
|
| 23 |
-
metrics:
|
| 24 |
-
- name: Accuracy
|
| 25 |
-
type: accuracy
|
| 26 |
-
value: 0.9998
|
| 27 |
-
- name: Loss
|
| 28 |
-
type: loss
|
| 29 |
-
value: 0.00047
|
| 30 |
---
|
| 31 |
|
| 32 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -34,53 +20,24 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 34 |
|
| 35 |
# vit-food-classification-gutkia01
|
| 36 |
|
| 37 |
-
This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the food-classification dataset.
|
| 38 |
It achieves the following results on the evaluation set:
|
| 39 |
-
- Loss: 0.
|
| 40 |
-
-
|
| 41 |
-
- Accuracy: 0.9998
|
| 42 |
|
| 43 |
-
#
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
##
|
| 48 |
|
| 49 |
-
|
| 50 |
-
- **Base model:** `google/vit-base-patch16-224`
|
| 51 |
-
- **Task:** Binary image classification: `Fruit` vs. `Junkfood`
|
| 52 |
-
- **Framework:** Hugging Face Transformers Trainer
|
| 53 |
-
- **Input format:** RGB images, 224×224, loaded via `imagefolder`
|
| 54 |
|
| 55 |
-
##
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
| 60 |
-
- Interactive demos comparing healthy vs. unhealthy food
|
| 61 |
-
- Computer vision use cases with simple binary class structures
|
| 62 |
-
|
| 63 |
-
### Limitations
|
| 64 |
-
|
| 65 |
-
- Only supports binary classification (no subclass differentiation)
|
| 66 |
-
- Cannot recognize new or abstract dishes (e.g. salad, sushi)
|
| 67 |
-
- Cannot evaluate ingredients, calories, or portion sizes
|
| 68 |
-
|
| 69 |
-
## 📊 Training and Evaluation Data
|
| 70 |
-
|
| 71 |
-
The model was trained on a binary dataset composed of:
|
| 72 |
-
|
| 73 |
-
- **Fruits360 Dataset**: 137,000+ structured fruit images in a controlled studio setup ([Kaggle link](https://www.kaggle.com/datasets/moltean/fruits))
|
| 74 |
-
- **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))
|
| 75 |
-
|
| 76 |
-
### Dataset Composition
|
| 77 |
-
|
| 78 |
-
The dataset is a combination of:
|
| 79 |
-
|
| 80 |
-
- **Fruits360 Dataset** ([Kaggle](https://www.kaggle.com/datasets/moltean/fruits))
|
| 81 |
-
- **Fast Food Classification Dataset v2** ([Kaggle](https://www.kaggle.com/datasets/utkarshsaxenadn/fast-food-classification-dataset))
|
| 82 |
-
|
| 83 |
-
## ⚙️ Training Procedure
|
| 84 |
|
| 85 |
### Training hyperparameters
|
| 86 |
|
|
@@ -95,21 +52,11 @@ The following hyperparameters were used during training:
|
|
| 95 |
|
| 96 |
### Training results
|
| 97 |
|
| 98 |
-
| Epoch | Training Loss | Validation Loss | Accuracy |
|
| 99 |
-
|-------|---------------|------------------|----------|
|
| 100 |
-
| 1 | 0.0000 | 0.0215 | 0.9975 |
|
| 101 |
-
| 2 | 0.0000 | 0.00004 | 1.0000 |
|
| 102 |
-
| 3 | 0.0000 | 0.00008 | 1.0000 |
|
| 103 |
-
| 4 | 0.0000 | 0.00011 | 1.0000 |
|
| 104 |
-
| 5 | 0.0000 | 0.00011 | 1.0000 |
|
| 105 |
-
| 6 | 0.0000 | 0.00008 | 1.0000 |
|
| 106 |
|
| 107 |
-
Final training loss: **0.00047**
|
| 108 |
-
Evaluation accuracy: **0.9998**
|
| 109 |
|
| 110 |
-
##
|
| 111 |
|
| 112 |
- Transformers 4.52.3
|
| 113 |
- Pytorch 2.6.0+cu124
|
| 114 |
-
- Datasets
|
| 115 |
-
- Tokenizers 0.21.1
|
|
|
|
| 12 |
- accuracy
|
| 13 |
model-index:
|
| 14 |
- name: vit-food-classification-gutkia01
|
| 15 |
+
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 20 |
|
| 21 |
# vit-food-classification-gutkia01
|
| 22 |
|
| 23 |
+
This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the food-classification dataset.
|
| 24 |
It achieves the following results on the evaluation set:
|
| 25 |
+
- Loss: 0.0000
|
| 26 |
+
- Accuracy: 1.0
|
|
|
|
| 27 |
|
| 28 |
+
## Model description
|
| 29 |
|
| 30 |
+
More information needed
|
| 31 |
|
| 32 |
+
## Intended uses & limitations
|
| 33 |
|
| 34 |
+
More information needed
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
## Training and evaluation data
|
| 37 |
|
| 38 |
+
More information needed
|
| 39 |
|
| 40 |
+
## Training procedure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
### Training hyperparameters
|
| 43 |
|
|
|
|
| 52 |
|
| 53 |
### Training results
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
### Framework versions
|
| 58 |
|
| 59 |
- Transformers 4.52.3
|
| 60 |
- Pytorch 2.6.0+cu124
|
| 61 |
+
- Datasets 3.6.0
|
| 62 |
+
- Tokenizers 0.21.1
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 343223968
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19820b501077699aa97265cfa4fc6c6f2513dca77dd1fe80575c58ea8eaae0bd
|
| 3 |
size 343223968
|