Update README.md
Browse files
README.md
CHANGED
@@ -1,55 +1,67 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
-
|
8 |
-
|
9 |
-
-
|
10 |
-
|
11 |
-
-
|
12 |
-
|
13 |
-
-
|
14 |
-
|
15 |
-
- **
|
16 |
-
|
17 |
-
##
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
-
|
48 |
-
-
|
49 |
-
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
- Optimized for: Image Classification
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- ethz/food101
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
metrics:
|
7 |
+
- accuracy
|
8 |
+
base_model:
|
9 |
+
- google/efficientnet-b0
|
10 |
+
tags:
|
11 |
+
- food
|
12 |
+
---
|
13 |
+
# Food-101 Image Classification with EfficientNet
|
14 |
+
|
15 |
+
This project focuses on fine-tuning the **EfficientNet-B0** model for image classification using the **Food-101** dataset. The model is trained to classify images into 101 different food categories.
|
16 |
+
|
17 |
+
## Model Summary
|
18 |
+
|
19 |
+
- **Model Architecture**: EfficientNet-B0
|
20 |
+
- **Dataset**: Food-101
|
21 |
+
- **Number of Classes**: 101
|
22 |
+
- **Input Image Size**: 224x224
|
23 |
+
- **Normalization**: Mean - `[0.485, 0.456, 0.406]`, Std - `[0.229, 0.224, 0.225]`
|
24 |
+
- **Optimizer**: Adam
|
25 |
+
- **Loss Function**: CrossEntropyLoss
|
26 |
+
- **Learning Rate**: 0.001
|
27 |
+
- **Epochs**: 10
|
28 |
+
|
29 |
+
## Dataset
|
30 |
+
|
31 |
+
The **Food-101** dataset consists of 101 food categories, with 1,000 images for each category. The dataset is already split into training (75,750 images) and validation (25,250 images).
|
32 |
+
|
33 |
+
- Dataset link: [Food-101 on Hugging Face](https://huggingface.co/datasets/ethz/food101)
|
34 |
+
|
35 |
+
## Model Training
|
36 |
+
|
37 |
+
The model is based on **EfficientNet-B0**, a state-of-the-art architecture for image classification. The pretrained model is fine-tuned on the Food-101 dataset using PyTorch.
|
38 |
+
|
39 |
+
### Training Process
|
40 |
+
|
41 |
+
- Images are resized to 256x256 and center-cropped to 224x224.
|
42 |
+
- Data augmentation techniques such as random horizontal flip and random rotation were applied to increase the variety of training images.
|
43 |
+
- The Adam optimizer was used with a learning rate of 0.001, and cross-entropy loss was used for classification.
|
44 |
+
|
45 |
+
|
46 |
+
## Model Performance
|
47 |
+
- Loss: 1.0926
|
48 |
+
- Validation Accuracy: 0.6944
|
49 |
+
- Test Accuracy: 0.8088
|
50 |
+
|
51 |
+
These metrics were achieved after 10 epochs of training
|
52 |
+
|
53 |
+
## How to use the model
|
54 |
+
You can use the model directly in your own projects by loading it from hugging face.
|
55 |
+
|
56 |
+
### Requirements
|
57 |
+
- Python 3.7+
|
58 |
+
- PyTorch 1.9+
|
59 |
+
- torchvision 0.10+
|
60 |
+
- PIL (Pillow)
|
61 |
+
- Hugging Face transformers library
|
62 |
+
|
63 |
+
## Model Card
|
64 |
+
- ModelType: EfficientNet-B0
|
65 |
+
- Dataset: Food-101
|
66 |
+
- Framework: Pytorch
|
67 |
- Optimized for: Image Classification
|