AI Logic

Datasets and Benchmarks

50Salads

Updated:

How 50Salads was built and how it is organized. The left shows the flow: recruit 27 people, give them a step order drawn from a probabilistic model, record each person twice with an overhead Kinect and accelerometers attached to utensils, exclude 2 people to get 50 videos (25 people × 2 sessions), and label segments for 17 kinds of actions. The right shows the action sequence of one video (an illustrative example), the label granularities (17 classes and 10 classes), the format of the data distributed with MS-TCN, and the split and evaluation conventions

Overview

50Salads is a dataset of 50 videos of 25 people each making a mixed salad twice, annotated with action segment labels. It was created by Stein and McKenna at the University of Dundee in the UK and published in a paper at UbiComp 2013.

In addition to video from an RGB-D camera (a Kinect, which captures color and depth at the same time) looking straight down at the worktop, it simultaneously records accelerometer signals from sensors attached to utensils such as a knife, a peeler, and spoons. It was built to recognize fine-grained "hand manipulation" activities such as cooking by combining video and acceleration. Within each video, the participant goes through steps such as making the dressing, cutting vegetables, putting them in a bowl, mixing, and serving.

In today's deep learning, it is mainly used with video alone as a benchmark for action segmentation (temporal segmentation). The task is to assign an action class such as "cut cucumber" or "place tomato into bowl" to every frame of a long video and determine which action spans which interval. Papers on TCN and MS-TCN compare performance on 50Salads alongside GTEA and Breakfast.

Among the three datasets, 50Salads is characterized by the longest videos (6.4 minutes on average). Because a similar number of segments is spread over a longer time, it tests the ability to capture relationships between frames far apart and to avoid fragmenting segments.

Contents: construction, classes, and splits

How it was built is as follows.

  1. The worktop is filmed from directly above. A wall-mounted Kinect recorded color and depth video at 640×480 and 30 fps. The area where participants could work was marked out with tape so that their hands stayed within the camera's field of view.
  2. Accelerometers are attached to utensils. They were embedded in the handles of the knife, the mixing spoon, and the peeler, and also attached to a small spoon, a glass, an oil bottle, and a pepper dispenser. They transmit 3-axis acceleration at 50 Hz. Video and acceleration were synchronized by performing a motion at the start and end of each recording that produces a strong signal in both.
  3. The order of steps is drawn from a probabilistic model and given to participants. Because people left to themselves follow biased orders, an order was drawn uniformly from a graph of salad-making steps (branches showing which step may follow which), and a different order was given each time. In practice, the authors report that few participants followed the instructions exactly.
  4. 27 people make the salad twice each. 27 people of varied ages, ethnic backgrounds, and cooking experience each made it twice, and after excluding 2 people whose recordings were incomplete, the result was 25 people × 2 sessions = 50 videos. Each person was recorded twice because they were expected to behave more naturally the second time than the first in an unfamiliar kitchen, and so that individual habits could be studied.
  5. Action segments are labeled. For each of the 17 kinds of action, start and end times were annotated. Each action is divided into three phases: a "pre" phase of picking up the utensil, a "core" phase of the action itself, and a "post" phase of putting the utensil back. For "add oil," for example, the pre phase starts the moment the bottle is touched, the core phase is tilting the bottle and pouring, and the post phase lasts until the cap is closed and the bottle is put down.

Size: Video and acceleration together exceed 4.5 hours. There are 966 action segments in total, and more than 500,000 labeled frames, of which about 300,000 are in the core phase. In the segmentation benchmark, a video is 6.4 minutes on average and contains about 20 segments on average.

Classes vary with the granularity used.

GranularityNumber of classesContentsMainly used by
Mid17Add oil, vinegar, salt, or pepper; mix dressing; peel cucumber; cut cucumber, cheese, lettuce, or tomato; place each into the bowl; mix ingredients; serve salad onto plate; add dressingMost current segmentation research, such as MS-TCN
High (eval)9 + backgroundIngredient distinctions removed, e.g., "cut tomato" and "cut cucumber" merged into "cut"Evaluation in the original paper, the TCN paper

The original paper's evaluation does not merge "mix dressing" and "mix ingredients" into a single "mix." It explains that because they use different utensils (a small spoon and glass versus a large spoon and bowl), merging them would remove the cue of telling them apart by utensil and would actually make the task harder.

Format: The official release consists of RGB and depth video, accelerometer recordings, and action segment labels (start and end times). Segmentation research commonly uses the format distributed by the MS-TCN authors. For each video, it contains 2048-dimensional features extracted with I3D (features/<video>.npy, 30 fps), ground truth with one class name per frame per line (groundTruth/<video>.txt), the mapping between indices and class names (mapping.txt), and the split lists (splits/). The official MS-TCN implementation reads every other feature frame to bring it to 15 fps.

Splits: 5-fold cross-validation in which 5 people (10 videos) are held out for evaluation and the remaining 20 are used for training. A person's two videos always fall on the same side, so robustness to unseen people (cross-subject generalization) can be measured. The original paper chose 5 folds because they are computationally lighter than 10.

Evaluation conventions

In action segmentation, it is standard to report the following three kinds of metrics side by side.

  • Frame accuracy: The fraction of all frames whose class matches the ground truth.
  • F1@k: An F1 score that counts a predicted segment as correct if its overlap (IoU) with a ground-truth segment is at least kk%; the three values k=10,25,50k = 10, 25, 50 are reported together.
  • Edit score: Extracts only the sequence of segment classes and computes a score from its edit distance to the ground-truth sequence. It counts errors from cutting segments too finely.

In 50Salads, where videos are long, it often happens that frame accuracy is high while F1@k and Edit score are low because segments are fragmented. In the MS-TCN paper, the single-stage model (SS-TCN) had a high frame accuracy of 78.2%, yet its F1@10 was only 27.0. For this reason, the three are looked at together.

Note that the evaluation in the original paper was not segmentation but classification of each segment's class, averaging per-class precision and recall. The conventions of today's segmentation benchmark were established by later work such as TCN.

Results on 50Salads (mid granularity, 17 classes) reported in papers are as follows (Table 10 of the MS-TCN paper; the ED-TCN, Bi-LSTM, and IDT+LM values match Table 2 of the ED-TCN paper).

ModelF1@{10, 25, 50}EditFrame accuracy (%)
IDT+LM44.4, 38.9, 27.845.848.7
Bi-LSTM62.6, 58.3, 47.055.655.7
ED-TCN68.0, 63.9, 52.659.864.7
TDRN72.9, 68.5, 57.266.068.1
MS-TCN76.3, 74.0, 64.567.980.7

Input features and settings are not the same across models. ED-TCN uses features from a small CNN trained on 50Salads, downsampled to about 1 fps, while MS-TCN uses I3D features at 15 fps. The ED-TCN paper also reports results at the high granularity (9 classes + background) separately (F1@10 of 76.5 and frame accuracy of 73.4% for ED-TCN), which cannot be compared with mid-granularity values.

50Salads numbers change greatly depending on which granularity (17 classes, or 9 classes + background) they were measured at. When comparing with numbers in papers, check that the granularity, whether results are averaged over the 5 splits, and the features and frame downsampling all match.

Uses and historical significance

50Salads is a dataset that laid the groundwork for research on segmenting long task videos into sequences of fine-grained actions.

  • Combining video and acceleration (2013): The original paper combined the two signals, for example by locating accelerometer-equipped utensils in the video, and showed that recognition was considerably better than with either signal alone.
  • Segmentation with grammars and segment models: Around the advent of deep learning, methods combining hidden Markov models with task grammars, and methods that cap the number of segments to prevent fragmentation, were tried on 50Salads (according to the related work section of the ED-TCN paper).
  • A benchmark for temporal convolutions (from around 2016): TCN (ED-TCN), TDRN, MS-TCN, and others reported F1@k, Edit, and frame accuracy on 50Salads alongside GTEA and Breakfast, establishing it as a place for comparison. The ED-TCN paper, which proposed the segment-level metric F1@k, also uses 50Salads for evaluation.

Because the order of steps was drawn from a probabilistic model and given as instructions, the dataset consists of videos in which "the order differs from person to person even for the same dish." As a result, memorizing the order of steps is not enough to get the answers right; the model needs to read the actions from the video.

Caveats

License: The University of Dundee's research data registry page states that it is released under CC BY-NC-SA (Attribution, NonCommercial, ShareAlike). When using it, credit the authors and the source, and distribute modified data under the same license.

CC BY-NC-SA is a license restricted to non-commercial use, so the data cannot be used as is to train or evaluate commercial products. For commercial use, contact the authors at the University of Dundee and confirm permission. The features distributed by the MS-TCN authors are also derived from the 50Salads video.

Differences in granularity: Even within 50Salads, there are two evaluations: 17 classes (mid) and 9 classes + background (high). Some papers mention which one they used only briefly in the text, so check before comparing. Also check the contents of mapping.txt in the distributed data as the list of classes being used.

Frame downsampling: The video is 30 fps, but MS-TCN downsamples features to 15 fps and ED-TCN to about 1 fps. Downsampling changes the length of each video and therefore the time span the model can see at once. The official MS-TCN implementation stretches its predictions so that predictions made at 15 fps can be compared with the 30 fps ground truth.

Small size and bias: The only task is making salad, in a single lab kitchen. The camera is also fixed at a single overhead position. Good results here do not necessarily carry over to videos of other dishes, rooms, or camera angles.

Comparison with similar datasets

The three datasets commonly used side by side in action segmentation compare as follows from the same angles (counts from Section 4 of the MS-TCN paper).

DatasetRecording setupNumber of videosNumber of classesVideo length / segmentsSplitsLicense
GTEAEgocentric (head-mounted camera)28 (7 activities × 4 people)11 (including background)About 1 minute / 20 segments on average4-fold, leaving one person outNot stated (citation requested)
50SaladsOverhead view of the worktop (RGB-D) + utensil acceleration50 (25 people × 2 sessions)176.4 minutes on average / 20 segments on average5-fold, leaving 5 people outCC BY-NC-SA
BreakfastMaking breakfast (18 kitchens)1,712486 segments on average4-foldSee article

Rough guidelines for choosing:

  • To test the ability to handle long videos and fine-grained segments, use 50Salads. Because videos are long, differences in over-segmentation tend to show up in the Edit score.
  • To try out a segmentation model quickly, use the smallest one, GTEA.
  • To test robustness across many people and scenes, use the largest one, Breakfast.
  • For research combining video and acceleration, 50Salads is the only one of the three with accelerometer recordings.
  • For the task of classifying short trimmed video clips rather than segmenting, use an action recognition dataset such as Kinetics.

PyTorch example

Show code
python
import os

import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset

"""
Load 50Salads in the format distributed by the MS-TCN authors (data/50salads/)
  features/<video>.npy     : I3D features. Shape [2048, number of frames] (30 fps)
  groundTruth/<video>.txt  : one class name per frame per line (30 fps)
  mapping.txt              : "index class_name" mapping
  splits/train.split1.bundle, test.split1.bundle : video lists. Splits 1-5 (5 people held out for evaluation each)
"""

ROOT = 'data/50salads'
SAMPLE_RATE = 2  # as in MS-TCN, read every other frame to turn 30 fps into 15 fps


def read_lines(path):
  with open(path) as f:
    return [line for line in f.read().split('\n') if line]


actions = dict((name, int(idx)) for idx, name in (line.split() for line in read_lines(os.path.join(ROOT, 'mapping.txt'))))
print(len(actions))  # check the number of classes in mapping.txt


class FiftySalads(Dataset):
  def __init__(self, split=1, train=True):
    name = ('train' if train else 'test') + '.split%d.bundle' % split
    self.videos = read_lines(os.path.join(ROOT, 'splits', name))

  def __len__(self):
    return len(self.videos)

  def __getitem__(self, i):
    vid = self.videos[i].split('.')[0]
    feats = np.load(os.path.join(ROOT, 'features', vid + '.npy'))  # [2048, T]
    labels = [actions[c] for c in read_lines(os.path.join(ROOT, 'groundTruth', vid + '.txt'))]
    t = min(feats.shape[1], len(labels))  # trim features and labels to the shorter length
    feats = feats[:, :t:SAMPLE_RATE]
    labels = labels[:t:SAMPLE_RATE]
    return torch.from_numpy(feats).float(), torch.tensor(labels)


def collate(batch):
  # videos differ in length, so pad to the longest and set padded labels to -100 (ignored by the loss)
  t_max = max(x.shape[1] for x, _ in batch)
  feats = torch.stack([F.pad(x, (0, t_max - x.shape[1])) for x, _ in batch])
  labels = torch.stack([F.pad(y, (0, t_max - y.shape[0]), value=-100) for _, y in batch])
  return feats, labels


def upsample(pred, rate=SAMPLE_RATE):
  # to compare 15 fps predictions with 30 fps ground truth, repeat each frame's prediction rate times
  return pred.repeat_interleave(rate, dim=-1)


# repeat training and evaluation over the 5 splits and average the results
for split in range(1, 6):
  train_loader = DataLoader(FiftySalads(split, train=True), batch_size=1, shuffle=True, collate_fn=collate)
  test_loader = DataLoader(FiftySalads(split, train=False), batch_size=1, collate_fn=collate)
  # train with model.train(), and evaluate test_loader with model.eval() and torch.no_grad()
  # in evaluation, restore 30 fps with upsample() and compute frame accuracy, F1@{10, 25, 50}, and Edit score

FAQ

Q. Does 50Salads have 17 classes or 10?
A.

Both exist. Most current segmentation research (such as MS-TCN) uses the mid granularity of 17 classes, which distinguishes ingredients. The original paper's evaluation and part of the TCN paper use 9 classes + background, with ingredient distinctions removed. When comparing numbers, check which granularity was used.

Q. Can 50Salads be used to develop commercial products?
A.

The University of Dundee's registry page releases it under CC BY-NC-SA (non-commercial), so it cannot be used commercially as is. For commercial use, contact the authors and confirm permission.

Q. Is the accelerometer data used in the segmentation benchmark?
A.

Usually not. Segmentation research such as MS-TCN uses only features extracted from the video as input. The acceleration was recorded for research combining video with utensil motion, and the original paper shows that combining them improves recognition.

References

  1. Stein, S., & McKenna, S. J. (2013). Combining Embedded Accelerometers with Computer Vision for Recognizing Food Preparation Activities. Proceedings of the 2013 ACM International Joint Conference on Pervasive and Ubiquitous Computing (UbiComp 2013), pp. 729–738.
  2. McKenna, S., & Stein, S. (2012). 50 Salads (University of Dundee research data registry page; license CC BY-NC-SA). doi:10.15132/10000120.
  3. Lea, C., Flynn, M. D., Vidal, R., Reiter, A., & Hager, G. D. (2017). Temporal Convolutional Networks for Action Segmentation and Detection. CVPR 2017. arXiv:1611.05267.
  4. Abu Farha, Y., & Gall, J. (2019). MS-TCN: Multi-Stage Temporal Convolutional Network for Action Segmentation. CVPR 2019. arXiv:1903.01945.
  5. yabufarha/ms-tcn (official MS-TCN implementation, and distribution of 50Salads features, ground truth, and splits).