AI Logic

Datasets and Benchmarks

GTEA

Updated:

How GTEA is built and organized. The left side shows the flow: kitchen tasks are recorded with a camera attached to a cap, frames are extracted at 15 fps, an action label is assigned to each frame, the result is compiled into 28 videos, divided into 7 kinds of tasks. The right side shows the sequence of per-frame labels in one video (an illustrative example), the file layout of the MS-TCN distribution, and the splits and evaluation protocol.

Overview

GTEA (Georgia Tech Egocentric Activities) is a dataset of 28 videos of kitchen tasks recorded with a head-mounted camera, labeled with an action for every frame. It was created by Fathi, Ren, and Rehg at the Georgia Institute of Technology and presented in a CVPR 2011 paper.

Video recorded from the viewpoint of the person doing the task is called "first-person (egocentric) video". Unlike a camera fixed in a room, it shows the hands and the objects they handle large in the center of the frame, so "what the person is doing now" is easy to read from the hands and objects. The dataset was originally created to learn which objects are being used from such video with weak labels (only the names of the objects that appear in each video). The same lab later added labels for each action.

In current deep learning, it is used mainly as a benchmark for action segmentation (temporal segmentation). The task is to assign an action class such as "take", "pour", or "stir" to every frame of a long video and answer which action spans from where to where. Papers on TCN and MS-TCN compare performance on GTEA alongside 50Salads and Breakfast.

Action segmentation resembles "transcribing" a video. Just as speech recognition turns a stream of sound into a sequence of words, segmentation turns a stream of video into a sequence of actions such as "take β†’ open β†’ scoop β†’ pour".

Contents: Construction, Classes, and Splits

Construction proceeds as follows.

  1. Record with a head-mounted camera. A GoPro camera was attached to a baseball cap and pointed to capture the area in front (the hands). The camera moves with the head. Recording is 1280Γ—720 at 30 fps.
  2. Extract frames. Frames were extracted from the recordings at 15 fps, for a total of 31,222 frames.
  3. 4 people each perform 7 kinds of tasks once. The 7 tasks are hot dog, instant coffee, peanut butter sandwich, jam and peanut butter sandwich, sweet tea, coffee with honey, and cheese sandwich, using 16 kinds of objects in total. 7 Γ— 4 gives 28 videos.
  4. Label actions. The first paper labeled only "the most prominent object" for each frame of the evaluation videos. The follow-up ICCV 2011 paper added action labels consisting of verb–object pairs (64 kinds, with 11 kinds of verbs including background).

Size: each video is about 1,200 frames (about 1 minute at 15 fps), with about 20 action segments per video on average.

Classes: for action segmentation, only the verbs, with object names removed, are used, giving 11 classes including background. The table in the ICCV 2011 paper lists pick, open, scoop, close, pour, stir, spread, put, fold, dip, and background. In mapping.txt of the MS-TCN distribution, however, the names are take instead of pick and shake instead of dip. The official page also distributes later re-annotated fine-grained action labels (a new version with 71 classes and an old version with 61 classes), but the segmentation benchmark uses the 11 classes.

Format: the official page distributes 15 fps videos, uncompressed frame PNGs, hand-region masks, and action labels. In segmentation research, the format distributed by the MS-TCN authors is commonly used. For each video, it contains 2048-dimensional features extracted with I3D (features/<video>.npy, shape 2048 Γ— number of frames), ground truth with one frame's class name per line (groundTruth/<video>.txt), the mapping between indices and class names (mapping.txt), and split lists (splits/).

Splits: cross-validation in which one person is held out for evaluation and the remaining 3 are used for training. The MS-TCN distribution has 4 splits, and the average of the 4 results is reported.

Evaluation Protocol

In action segmentation, the standard is 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 counting a predicted segment as a hit if its overlap (IoU) with a ground-truth segment is at least kk%, listed for the three values k=10,25,50k = 10, 25, 50.
  • Edit score: computed from the edit distance between the sequence of segment classes alone and the ground-truth sequence. It counts errors that cut segments too finely.

Frame accuracy is dominated by long segments and barely drops for errors that fragment segments. For this reason, F1@k and Edit score, which count in units of segments, are examined together.

Reported results on GTEA are as follows (Table 10 of the MS-TCN paper; the ED-TCN and Bi-LSTM values are the same as Table 4 of the ED-TCN paper).

ModelF1@{10, 25, 50}EditFrame accuracy (%)
Bi-LSTM66.5, 59.0, 43.6―55.5
ED-TCN72.2, 69.3, 56.0―64.0
TDRN79.2, 74.4, 62.774.170.1
MS-TCN85.8, 83.4, 69.879.076.3
MS-TCN (fine-tuned features)87.5, 85.4, 74.681.479.2

The input features and settings are not the same across models. ED-TCN uses features from a small CNN trained on GTEA at 3 fps, while MS-TCN uses I3D features at 15 fps.

GTEA has only 28 videos, and each split has 7 evaluation videos. Numbers vary greatly by split, so report the average of the 4 splits and check that the splits and features match those of the method you compare against.

Usage and Historical Significance

GTEA is an early dataset for research on reading actions from hand and object motion in first-person video.

  • Object recognition from weak labels (2011): the first paper showed a method that separates hands, objects, and background and finds objects using only the names of objects appearing in each video as cues.
  • Recognition of actions and activities (2011): the ICCV paper predicted per-frame actions and the activity of the whole video (which dish is being made) from hand shape and position and their relation to objects.
  • A benchmark for action segmentation (from around 2016): TCN (ED-TCN), TDRN, MS-TCN, and others reported F1@k, Edit, and frame accuracy on GTEA alongside 50Salads and Breakfast, establishing it as a venue for comparison.

Because it is small and its videos are short, training and evaluation can be run in a short time when trying a new segmentation model, which is another reason it is used.

Caveats

License: the official page does not state license terms. It only asks users to cite two papers (Fathi et al. 2011 and Li et al. 2015) when using the data.

Since no license is stated, contact the authors at Georgia Tech and confirm permission before using it for anything other than research (such as commercial products or redistributing the data). The official page strongly recommends switching to the newer, larger EGTEA Gaze+.

Differences in evaluation procedures: even on the same GTEA, papers differ in frame subsampling (3 fps vs. 15 fps), the number of splits, and features. Even the first two papers held out different people for evaluation (the CVPR paper the first person, the ICCV paper the second). When comparing with other work, align the procedures.

Label versions: the action labels on the official page come in a new version (71 classes) and an old version (61 classes), which differ from the 11 classes of the segmentation benchmark. When comparing with numbers in papers, check which labels were used.

Video quality: the videos are heavily compressed, and the ED-TCN paper states that because optical flow was full of noise, frame differences were used as the motion input instead.

Small size and bias: there are only 4 people performing the tasks, and the tasks are limited to 7 simple dishes. Good results here do not necessarily carry over to videos of other people or settings.

Comparison with Similar Datasets

The three datasets commonly used together for action segmentation, compared from the same perspectives, are as follows (counts are from Section 4 of the MS-TCN paper).

DatasetRecordingVideosClassesLength / segments per videoSplitsLicense
GTEAEgocentric (head-mounted camera)28 (7 tasks Γ— 4 people)11 (including background)About 1 minute, 20 segments on average4 splits, leaving one person outNot stated (citation requested)
50SaladsPeople making salads (25 people)50 (25 people Γ— 2)176.4 minutes on average, 20 segments on average5 splits―
BreakfastPeople making breakfast (18 kitchens)1,712486 segments on average4 splits―

For the licenses of 50Salads and Breakfast, see their respective articles.

Rough guidelines for choosing are as follows.

  • To quickly try out a segmentation model, use GTEA. It is small, so running all 4 splits does not take long.
  • To assess the ability to handle long videos and fine segments, use 50Salads.
  • To assess robustness across many people and settings, use the largest, Breakfast.
  • To learn egocentric action recognition on large data, use EGTEA Gaze+ (32 people, 86 sessions, about 28 hours, 10,325 action instances), which the official page recommends.
  • For the task of classifying short trimmed videos 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 GTEA in the format distributed by the MS-TCN authors (data/gtea/)
  features/<video>.npy      : I3D features. Shape [2048, num_frames] (15 fps)
  groundTruth/<video>.txt   : one frame's class name per line
  mapping.txt              : 11 lines of "index class_name" (including background)
  splits/train.split1.bundle, test.split1.bundle : video lists. Splits 1-4 (one person held out for evaluation each)
"""

ROOT = 'data/gtea'


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))  # 11


class GTEA(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))  # truncate features and labels to the shorter length
    return torch.from_numpy(feats[:, :t]).float(), torch.tensor(labels[:t])


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 frame_accuracy(pred, target):
  # frame accuracy. F1@k and Edit score are computed separately after converting to segments
  mask = target != -100
  return (pred[mask] == target[mask]).float().mean().item()


# repeat training and evaluation over the 4 splits and average the results
for split in range(1, 5):
  train_loader = DataLoader(GTEA(split, train=True), batch_size=1, shuffle=True, collate_fn=collate)
  test_loader = DataLoader(GTEA(split, train=False), batch_size=1, collate_fn=collate)
  # train with model.train(), then evaluate test_loader with model.eval() and torch.no_grad()

FAQ

Q. What actions are in GTEA's 11 classes?
A.

They are verbs, with object names removed, plus background. The table in the ICCV 2011 paper lists pick, open, scoop, close, pour, stir, spread, put, fold, dip, and background. Check the class names actually used in mapping.txt of the distributed data.

Q. Can GTEA be used to develop commercial products?
A.

The official page does not state license terms, so this cannot be decided as is. For uses other than research, contact the authors at Georgia Tech and confirm permission.

Q. Why do GTEA numbers differ so much between papers?
A.

Because evaluation procedures are not aligned. Frame subsampling (3 fps vs. 15 fps), input features (a CNN trained on the dataset vs. I3D), and the number of splits differ between papers. Also, with only 28 videos, differences between splits are large. When comparing, look at the average of the 4 splits with the same splits and features.

References

  1. Fathi, A., Ren, X., & Rehg, J. M. (2011). Learning to Recognize Objects in Egocentric Activities. CVPR 2011, pp. 3281–3288.
  2. Fathi, A., Farhadi, A., & Rehg, J. M. (2011). Understanding Egocentric Activities. ICCV 2011.
  3. Georgia Tech Egocentric Activity Datasets (official page; distributes GTEA, GTEA Gaze, GTEA Gaze+, and EGTEA Gaze+).
  4. 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.
  5. Abu Farha, Y., & Gall, J. (2019). MS-TCN: Multi-Stage Temporal Convolutional Network for Action Segmentation. CVPR 2019. arXiv:1903.01945.
  6. yabufarha/ms-tcn (official MS-TCN implementation and distribution of GTEA features, ground truth, and splits).