Datasets:
File size: 5,867 Bytes
65bd4a2 5e588da 65bd4a2 5e588da | 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | ---
license: cc-by-nc-nd-4.0
pretty_name: SimpleFood45
language:
- en
task_categories:
- image-classification
- object-detection
- image-to-3d
tags:
- food
- nutrition
- dietary-assessment
- portion-estimation
- volume-estimation
- energy-estimation
- 3d
size_categories:
- n<1K
configs:
- config_name: default
data_files:
- split: train
path:
- data/*.jpg
- data/metadata.csv
---
# SimpleFood45

**SimpleFood45** is a dataset for **image-based food portion estimation**. It contains 513 smartphone photos of 45 real food items from 12 food types. Each item was photographed from several camera poses. Annotations give the ground-truth **weight (g)**, **volume (mL)** and **energy (kcal)**.
The dataset was introduced with the paper [*Food Portion Estimation via 3D Object Scaling*](https://arxiv.org/abs/2404.12257) (Vinod, He, Shao & Zhu, CVPR Workshops 2024) from the Video and Image Processing Laboratory (VIPER), Purdue University.
## Dataset summary
| | |
|---|---|
| Images | 513 (JPEG, 4000 × 2252, about 2 MB each) |
| Food items | 45 |
| Food types | 12 |
| Annotations | Weight (g), volume (mL), energy (kcal) |
| Capture device | Samsung Galaxy S22 Ultra |
| Capture dates | September to December 2023 |
Most foods are photographed on a black calibration board with a white dot grid, next to a printed checkerboard that serves as a reference object of known size. Pizza is photographed on a white plate with the checkerboard beside it.
## Repository layout
```
data/
├── 20230927_102352.jpg # 513 images, named by capture timestamp
├── ...
└── metadata.csv # per-image annotations
weights/
└── yolo_vfn_filtered.pt # YOLOv8 food detector used in the paper
assets/
└── samples.jpg # preview image for this card
```
### `metadata.csv`
| Column | Type | Description |
|---|---|---|
| `file_name` | string | Image file name in `data/` |
| `label` | string | Food type (e.g. `bagel`, `apple`) |
| `weight_g` | float | Ground-truth weight in grams |
| `volume_ml` | float | Ground-truth volume in millilitres |
| `energy_kcal` | float | Ground-truth energy in kilocalories |
All images of the same physical item share the same weight, volume and energy values.
### Annotated food types
| Food type | Items | Images | Weight (g) | Volume (mL) | Energy (kcal) |
|---|---:|---:|---|---|---|
| apple | 4 | 40 | 186 – 196 | 240.9 – 253.9 | 109.7 – 115.6 |
| avocado | 4 | 40 | 190 – 243 | 196.7 – 251.6 | 304.0 – 388.8 |
| bagel | 4 | 40 | 92 – 100 | 281.1 – 308.2 | 242.9 – 264.0 |
| biscuit | 2 | 30 | 45 – 46 | 112.4 – 114.9 | 166.5 – 170.2 |
| blueberry_muffin | 4 | 40 | 98 – 102 | 218.4 – 232.7 | 367.5 – 382.5 |
| broccoli | 4 | 40 | 13 – 26 | 23.6 – 47.1 | 4.4 – 8.8 |
| chicken_nugget | 2 | 40 | 14 – 15 | 21.0 – 22.5 | 43.0 – 46.1 |
| cinnamon_roll | 4 | 40 | 65 – 96 | 189.8 – 280.4 | 293.8 – 433.9 |
| corn | 3 | 30 | 210 – 245 | 263.1 – 307.0 | 232.6 – 367.5 |
| croissant | 4 | 40 | 41 – 46 | 157.1 – 181.7 | 166.5 – 186.8 |
| strawberry | 3 | 40 | 16 – 23 | 18.0 – 25.9 | 5.8 – 8.3 |
### Images without annotations
93 images have empty annotation fields in `metadata.csv`:
- **53 images** (captured 2023-10-03) show **two foods together** on the calibration board, for example an avocado with a chicken nugget, or corn with a croissant.
- **40 images** (captured 2023-12-04) show a **slice of pizza** on a plate.
The current release does not include ground-truth values for these images.
## Usage
### Load with 🤗 Datasets
```python
from datasets import load_dataset
ds = load_dataset("purdueviperlab/SimpleFood45", split="train")
sample = ds[0]
sample["image"] # PIL.Image
sample["label"], sample["weight_g"], sample["volume_ml"], sample["energy_kcal"]
# Keep only annotated images
annotated = ds.filter(lambda x: x["label"] is not None)
```
### Download the raw files
```python
from huggingface_hub import snapshot_download
path = snapshot_download("purdueviperlab/SimpleFood45", repo_type="dataset")
```
Or with the CLI:
```bash
hf download purdueviperlab/SimpleFood45 --repo-type dataset --local-dir SimpleFood45
```
### Food detector weights
`weights/yolo_vfn_filtered.pt` is the [Ultralytics](https://github.com/ultralytics/ultralytics) YOLOv8 detection model used in the paper's pipeline. It was trained on a filtered subset of the VIPER-FoodNet (VFN) dataset and saved with `ultralytics==8.0.188`.
```python
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
ckpt = hf_hub_download("purdueviperlab/SimpleFood45", "weights/yolo_vfn_filtered.pt", repo_type="dataset")
model = YOLO(ckpt)
results = model("data/20230927_102352.jpg")
```
## Intended use
SimpleFood45 is intended for research on:
- Estimating food portion size, volume and energy from a single image or from multiple views
- 3D food reconstruction and object scaling
- Image-based dietary assessment
The dataset is small and was captured in a controlled lab setting, with single items or pairs of items on a uniform background. Results on SimpleFood45 may not carry over to real-world meal images with mixed dishes, clutter or different lighting.
## License
Released under [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/). You may use it for non-commercial research with attribution. You may not distribute modified versions.
## Citation
If you use SimpleFood45, please cite:
```bibtex
@article{vinod2024food,
title={Food Portion Estimation via 3D Object Scaling},
author={Vinod, Gautham and He, Jiangpeng and Shao, Zeman and Zhu, Fengqing},
journal={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={3741--3749},
year={2024}
}
```
|