File size: 2,023 Bytes
33cc76a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
574019b
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
56
57
58
59
60
61
62
63
64
65
66
67
---
datasets:
- ethz/food101
language:
- en
metrics:
- accuracy
base_model:
- google/efficientnet-b0
tags:
- food
---
# Food-101 Image Classification with EfficientNet

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.

## Model Summary

- **Model Architecture**: EfficientNet-B0
- **Dataset**: Food-101
- **Number of Classes**: 101
- **Input Image Size**: 224x224
- **Normalization**: Mean - `[0.485, 0.456, 0.406]`, Std - `[0.229, 0.224, 0.225]`
- **Optimizer**: Adam
- **Loss Function**: CrossEntropyLoss
- **Learning Rate**: 0.001
- **Epochs**: 10

## Dataset

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).

- Dataset link: [Food-101 on Hugging Face](https://huggingface.co/datasets/ethz/food101)

## Model Training

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.

### Training Process

- Images are resized to 256x256 and center-cropped to 224x224.
- Data augmentation techniques such as random horizontal flip and random rotation were applied to increase the variety of training images.
- The Adam optimizer was used with a learning rate of 0.001, and cross-entropy loss was used for classification.


## Model Performance
- Loss: 1.0926
- Validation Accuracy: 0.6944
- Test Accuracy: 0.8088

These metrics were achieved after 10 epochs of training

## How to use the model
You can use the model directly in your own projects by loading it from hugging face.

### Requirements 
- Python 3.7+
- PyTorch 1.9+
- torchvision 0.10+
- PIL (Pillow)
- Hugging Face transformers library

## Model Card
- ModelType: EfficientNet-B0
- Dataset: Food-101
- Framework: Pytorch
- Optimized for: Image Classification