maryzhang commited on
Commit
0af9868
·
verified ·
1 Parent(s): 90af7c8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +176 -0
README.md CHANGED
@@ -22,3 +22,179 @@ configs:
22
  - split: augmented
23
  path: data/augmented-*
24
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  - split: augmented
23
  path: data/augmented-*
24
  ---
25
+
26
+ # Asian vs Western Food Image Classification Dataset
27
+
28
+ ## Dataset Description
29
+
30
+ This dataset contains food images for binary classification between Asian and Western cuisine styles, with both original and augmented versions available for training robust computer vision models for food recognition tasks.
31
+
32
+ ### Dataset Summary
33
+
34
+ - **Task**: Binary Food Classification (Asian vs Western)
35
+ - **Total Images**: 360 (40 original + 320 augmented)
36
+ - **Image Size**: 224x224 pixels
37
+ - **Format**: RGB images
38
+ - **Labels**: Binary (0 or 1)
39
+ - **Course**: CMU 24-679 Homework 1
40
+
41
+ ## Dataset Structure
42
+
43
+ ### Data Splits
44
+
45
+ The dataset contains two splits:
46
+
47
+ | Split | Number of Images | Description |
48
+ |-------|-----------------|-------------|
49
+ | `original` | 40 | Original food images at 224x224 resolution |
50
+ | `augmented` | 320 | Augmented versions of original images (8x augmentation) |
51
+
52
+ ### Data Fields
53
+
54
+ - **`image`**: PIL Image object (224x224 RGB)
55
+ - **`label`**: Binary integer label (0 or 1)
56
+ - 0: Western cuisine
57
+ - 1: Asian cuisine
58
+
59
+ ## Usage
60
+
61
+ ### Loading the Dataset
62
+
63
+ ```python
64
+ from datasets import load_dataset
65
+
66
+ # Load the entire dataset
67
+ dataset = load_dataset("maryzhang/hw1-24679-image-dataset")
68
+
69
+ # Access specific splits
70
+ original_data = dataset['original']
71
+ augmented_data = dataset['augmented']
72
+
73
+ # Get a single example
74
+ example = original_data[0]
75
+ image = example['image']
76
+ label = example['label']
77
+ ```
78
+
79
+ ## Data Augmentation Details
80
+
81
+ The augmented split was created using the following transformations:
82
+
83
+ - **Geometric Transformations**:
84
+ - Random Resized Crop (scale: 0.7-1.0, ratio: 0.75-1.33)
85
+ - Random Horizontal Flip (p=0.5)
86
+ - Random Vertical Flip (p=0.1)
87
+ - Random Rotation (±15 degrees)
88
+
89
+ - **Color Transformations**:
90
+ - Color Jitter (brightness=0.2, contrast=0.2, saturation=0.15, hue=0.05)
91
+ - Random Adjust Sharpness (factor=1.5, p=0.3)
92
+ - Random Auto Contrast (p=0.2)
93
+
94
+ - **Advanced Augmentations**:
95
+ - RandAugment (num_ops=2, magnitude=7)
96
+ - Random Erasing (p=0.2, scale=0.02-0.08)
97
+
98
+ Each original image generated 7 augmented variants plus the resized original, resulting in 8 images per original sample.
99
+
100
+ ## Dataset Creation
101
+
102
+ ### Source Data
103
+
104
+ The original 40 food images were captured specifically for this Asian vs Western cuisine classification task. Images were collected ensuring:
105
+ - Clear representation of distinct cuisine styles
106
+ - Variety in dishes, plating styles, and presentations
107
+ - No personally identifiable information
108
+ - Consistent image quality
109
+ - Balanced representation between both cuisine types
110
+
111
+ ### Preprocessing
112
+
113
+ 1. All images resized to 224x224 pixels using bilinear interpolation
114
+ 2. Converted to RGB format
115
+ 3. Normalized to standard PIL Image format
116
+
117
+ ### Collection Process
118
+
119
+ Images were collected from:
120
+ - Personal food photography
121
+ - Restaurant meals representing authentic cuisine styles
122
+ - Home-cooked dishes from both culinary traditions
123
+
124
+ ## Considerations for Using this Data
125
+
126
+ ### Recommended Use Cases
127
+
128
+ - Training binary food classifiers
129
+ - Transfer learning experiments with food recognition
130
+ - Educational projects for computer vision courses
131
+ - Cross-cultural food analysis studies
132
+
133
+ ### Limitations
134
+
135
+ - Small dataset size (40 original samples) - transfer learning strongly recommended
136
+ - Binary classification only - doesn't capture cuisine diversity within each category
137
+ - May not represent all regional variations within Asian or Western cuisine
138
+ - Augmentation may not cover all real-world food photography variations
139
+
140
+ ### Best Practices
141
+
142
+ 1. **Use pre-trained models**: Given the small dataset size, transfer learning from ImageNet or food-specific models is recommended
143
+ 2. **Cross-validation**: Use k-fold cross-validation to maximize training data usage
144
+ 3. **Split usage strategy**:
145
+ - Use `original` split for validation/testing to assess real-world performance
146
+ - Use `augmented` split for training to improve model robustness
147
+ 4. **Consider food-specific preprocessing**: Food images may benefit from specific color normalization
148
+ 5. **Monitor class balance**: Ensure both cuisine types are equally represented during training
149
+
150
+ ## Model Recommendations
151
+
152
+ For best results with this small dataset:
153
+
154
+ ```python
155
+ # Example: Using a pre-trained ResNet model
156
+ import torchvision.models as models
157
+ import torch.nn as nn
158
+
159
+ # Load pre-trained model
160
+ model = models.resnet50(pretrained=True)
161
+
162
+ # Freeze early layers
163
+ for param in model.parameters():
164
+ param.requires_grad = False
165
+
166
+ # Replace final layer for binary classification
167
+ model.fc = nn.Sequential(
168
+ nn.Linear(model.fc.in_features, 256),
169
+ nn.ReLU(),
170
+ nn.Dropout(0.5),
171
+ nn.Linear(256, 2) # 2 classes: Asian vs Western
172
+ )
173
+ ```
174
+
175
+ ## Citation
176
+
177
+ If you use this dataset, please cite:
178
+
179
+ ```bibtex
180
+ @dataset{zhang2025food,
181
+ author = {Mary Zhang},
182
+ title = {Asian vs Western Food Image Classification Dataset},
183
+ year = {2025},
184
+ publisher = {Hugging Face},
185
+ note = {CMU 24-679 Homework 1},
186
+ url = {https://huggingface.co/datasets/maryzhang/hw1-24679-image-dataset}
187
+ }
188
+ ```
189
+
190
+ ## License
191
+
192
+ This dataset is created for educational purposes as part of CMU 24-679 coursework.
193
+
194
+ ## Contact
195
+
196
+ For questions or issues with this dataset, please [open an issue](https://huggingface.co/datasets/maryzhang/hw1-24679-image-dataset/discussions) on the Hugging Face repository.
197
+
198
+ ## Acknowledgments
199
+
200
+ This dataset was created as part of the requirements for CMU 24-679. Thanks to the course instructors for the assignment guidelines and framework.