Dataset Viewer
Auto-converted to Parquet Duplicate
image
image
source_id
string
parent_id
string
is_mixed
int64
label_name
string
original_filename
string
augmentation
string
is_augmented
bool
veg_000
veg_000
0
single
p1.jpg
none
false
veg_001
veg_001
0
single
p2.jpg
none
false
veg_002
veg_002
0
single
p3.jpg
none
false
veg_003
veg_003
0
single
p4.jpg
none
false
veg_004
veg_004
0
single
p5.jpg
none
false
veg_005
veg_005
0
single
p6.jpg
none
false
veg_006
veg_006
0
single
p7.jpg
none
false
veg_007
veg_007
0
single
p8.jpg
none
false
veg_008
veg_008
0
single
p9.jpg
none
false
veg_009
veg_009
0
single
p10.jpg
none
false
veg_010
veg_010
0
single
p11.jpg
none
false
veg_011
veg_011
0
single
p12.jpg
none
false
veg_012
veg_012
0
single
p13.jpg
none
false
veg_013
veg_013
0
single
p14.jpg
none
false
veg_014
veg_014
0
single
p15.jpg
none
false
veg_015
veg_015
1
mixed
p16.jpg
none
false
veg_016
veg_016
1
mixed
p17.jpg
none
false
veg_017
veg_017
1
mixed
p18.jpg
none
false
veg_018
veg_018
1
mixed
p19.jpg
none
false
veg_019
veg_019
1
mixed
p20.jpg
none
false
veg_020
veg_020
1
mixed
p21.jpg
none
false
veg_021
veg_021
1
mixed
p22.jpg
none
false
veg_022
veg_022
1
mixed
p23.jpg
none
false
veg_023
veg_023
1
mixed
p24.jpg
none
false
veg_024
veg_024
1
mixed
p25.jpg
none
false
veg_025
veg_025
1
mixed
p26.jpg
none
false
veg_026
veg_026
1
mixed
p27.jpg
none
false
veg_027
veg_027
1
mixed
p28.jpg
none
false
veg_028
veg_028
1
mixed
p29.jpg
none
false
veg_029
veg_029
1
mixed
p30.jpg
none
false

Frozen Vegetables — Mixed vs. Single

Purpose

This dataset was built for Carnegie Mellon University course 24679 HW1. It is intended as an exercise in collecting and augmenting image data, which can be binarily classified. The dataset consists of images of mixed frozen vegetables, and a single type of frozen vegetables. It can therefore be utilized to train a model to distinguish these two binary categories (mixed or not mixed).

Composition

30 original photographs, all 224x224 RGB, plus 300 synthetic variants derived from the 21 training photographs.

column description
image 224x224 RGB image
is_mixed binary target — 1 if two or more vegetable types are visible
label_name mixed / single
source_id, parent_id identity and lineage
original_filename the source photo a row descends from
augmentation, is_augmented which transforms produced the row

Class balance in the original split: single 15, mixed 15. The training photographs are single 11, mixed 10, and their synthetic variants are single 157, mixed 143. The synthetic balance tracks training closely but not exactly, since 6 training photographs contribute one extra variant.

Collection

All photos were taken by me with an android phone camera. Aspect ratio was set to be 1:1 before pouring frozen vegetables onto a cutting board. Vegetables were arranged into various groups of mixed vegetables first, and photographed 15 times. The same was then done with vegetables arranged into groups featuring a single kind. A pan was also used in some photos and the angle of the camera changed to introduce variety (more surfaces were not used to reduce the number of dishes I needed to do when preparing dinner).

Preprocessing

As I set my phones camera to take photos in 1:1, no cropping of the images was necessary. After transferring them to my computer, I just edited the resolution of each image to 224x224 using the built in windows tool. Photos were also renamed to use a standard convention (p1, p2, ..., p30) rather than the long auto-generated android ones. This was done to make preparation of the corresponding csv of image names and the binary target simpler.

Augmentation

Applied to the 21 training photographs only: 14 variants per photograph, plus one extra free rotation for 6 randomly chosen photographs, 300 synthetic images total.

variants geometry photometric
8 the eight dihedral transforms of the square (lossless pixel permutations) brightness, contrast, saturation jitter
3 (+1 for 6 photographs) free rotation ±25° with expand=True and edge-median padding, resized back to 224 brightness, contrast, saturation jitter
3 a random dihedral transform jitter, Gaussian sensor noise, slight blur

Label preservation

The label is copied from the parent and never recomputed, so it cannot drift. The real risk is a transform that removes the evidence for the label, and two common augmentations were excluded for exactly that reason:

  • No zoom-in or random-resized crop. A crop that removes the single carrot cube from an otherwise all-broccoli plate turns a genuinely mixed image into a picture of a single vegetable while the inherited label still reads mixed. Every geometric transform used here is content-preserving: free rotation expands and pads rather than cropping, so no pixel ever leaves the frame.
  • No hue rotation. Shifting hue can collapse the colour distinction between an orange carrot and a piece of squash, which is precisely the evidence the label rests on. Brightness, contrast, and saturation are adjusted; hue is not.

The eight dihedral transforms are valid because the photographs are top-down and have no privileged orientation, and they are exactly lossless — pure pixel permutations with no resampling. Every synthetic image is verified to be 224x224 RGB and not pixel-identical to its parent.

Splits

  • original — all 30 photographs I took.
  • train — 21 photographs (~70%; single 11, mixed 10), followed by the 300 synthetic variants derived from them, for 321 rows.
  • test — 4 photographs (~13%; single 2, mixed 2), unaugmented.
  • validation — 5 photographs (~17%; single 2, mixed 3), unaugmented.

The real photographs in train, test, and validation partition original, stratified on is_mixed, so every photograph appears in exactly one of them. Every synthetic image descends from a train photograph via parent_id, so no rotated or flipped copy of a test or validation photo exists anywhere in train, and the held-out splits can be used for evaluation as-is. Filter train on is_augmented to train on the real photographs only.

Intended use and limits

This data is intended as an exercise for 24679 HW1 to build familiarity with collecting and augmenting image-based data. It can be used for practice creating models, or to observe how augmenting impacts model accuracy. It is not intended as data for a commercial vegetable classifier or similar "real-world" application.

  • The effective training sample size is 21, not 321. Fourteen or fifteen variants of one photograph are not that many independent observations.
  • Samples are limited to one camera in the same kitchen. Vegetables are from a single bag of mixed frozen vegetables so the variety is limited. The background surfaces are also limited, so as to reduce contamination and not waste food.
  • Vegetables were photographed immediately after removing the bag from the freezer, rather than allowing them to thaw first. As a result, their level of frozenness varies between photos, resulting in gloss, extra moisture, different amounts of frost, and some trails of thawed liquid in various photos.
  • As these vegetables came out of a bag of mixed frozen vegetables and not different bags, there are small pieces and bits of color transfer visible in some photos. Labeling as mixed vs non-mixed was therefore subjective as very small pieces of a different vegetable may be visibile in a phot labeled non-mixed.
  • Only a handful of vegetable types appear, so the model has no notion of any other produce.

Ethical notes

No people, faces, hands, or body parts appear in any image. No packaging, brand marks, logos, or printed text are visible, so no third-party intellectual property is included. No location metadata is published — the images are re-encoded through PIL during the resize step, which discards the original EXIF. The subject matter is frozen vegetables on a plate and carries no privacy or sensitivity concerns.

License

CC BY 4.0.

AI usage disclosure

All photos were manually taken, preprocessed, and organized by me. Both the original split and augmented split are free of artificially generated images.

Claude was used to assist with the accompanying code in accordance with CMU 24679s guidelines. I began by collecting my data, preparing the images in a zip file, and creating a csv with the binary classifiers for each image manually. Claude was then fed both of these along with the assignment description and in-class provided example code. It was specifically asked not to generate anything yet, so I could discuss augmentation methods first. I prompted it to rotate, resize, flip, adjust brightness, switch to black and white, etc. asking how many would be necessary to meet the required threshhold for augmented samples. Claude advised against resizing and adjusting colors, as some vegetables would be hard to distinguish based on geometry alone and some photos of mixed vegetables could crop out the unlike ones, resulting in an image of one vegetable type labeled mixed. After determining which augmentation methods it prescribed to proceed with, Claude generated the rest of the code. Claude also handled the label preservation as part of this, along with the generation of an initial Dataset Card (mostly for formatting) which was then heavily revised/rewritten by me, including this section.

To quickly adapt this to the updated assignment and new required splits, the .ipynb was given back to claude with the following prompt: "modify this code such that it instead creates the original split, a training split consisting of ~70% of the data, and test and validation splits each consisting of ~15% of the data. The 300 augmented samples should then be created from the training split and appended to it using the same methods (alert me to any issues arriving from this, such as if additional methods are required to meet the 300 samples). modify all comments and the dataset card to fit in the same style but do not edit the ai usage disclosure. The hugging face that it should reupload to can be found here: https://huggingface.co/datasets/yennik16/vegetable_dataset" and the output manually reviewed

Downloads last month
88

Models trained or fine-tuned on yennik16/vegetable_dataset