AI Logic

Datasets and Benchmarks

Kinetics

Updated:

How Kinetics is built and its versions. Left: the pipeline that builds a list of action names, collects videos from YouTube, cuts 10-second clips with an image classifier, has humans verify them, and removes duplicates and confusable classes to produce Kinetics-400. Right: the format of one annotation line (an illustrative example), the class counts and training clip counts of Kinetics-400, 600, 700, and 700-2020, the evaluation metric, and a note that about 3% of the videos disappear each year.

Overview

Kinetics is a large-scale video classification dataset made by cutting roughly 10-second clips of human actions out of YouTube videos and assigning one action class to each clip. Kay, Carreira, Zisserman, and colleagues at DeepMind (Google) built it and released the paper on arXiv in 2017. The first version has 400 classes and is called Kinetics-400.

It was created because the previous standard action recognition datasets, HMDB-51 (51 classes, 6,766 clips) and UCF-101 (101 classes, 13,320 clips), were too small to train deep learning models from scratch. UCF-101's 13,320 clips were cut from only about 2,500 videos, so it contained many clips of the same person doing the same action in the same place. Kinetics takes only one clip from each YouTube video, so the actors, camera work, and backgrounds vary widely.

The paper states that the goal was for Kinetics to play the role for video that ImageNet played for images. In practice, using Kinetics-pretrained models for other video tasks became standard, and Kinetics became the benchmark for video models, starting with I3D.

Kinetics answers a classification question: "What is the person doing in these 10 seconds?" Determining which action occurs from where to where in a long video is a different task (temporal segmentation), and it uses datasets with segment labels such as GTEA.

Contents: construction, classes, and splits

Construction proceeds as follows (Section 3 of the Kinetics-400 paper).

  1. Build a list of action names. The authors combined classes from existing action datasets, titles of motion capture data, and names proposed by crowd workers. Verbs are normalized to the -ing form, as in "brushing hair".
  2. Collect videos from YouTube. Candidate videos are gathered by matching video titles against the action names.
  3. Cut 10-second clips. A per-action image classifier is run over the video frames, and 5 seconds on each side of the position with the strongest response are cut out (clips are shorter near the ends of a video).
  4. Have humans verify them. Amazon Mechanical Turk workers were asked "Can you see a person performing this action?", and only clips for which at least 3 of 5 workers answered "yes" were kept. Workers judged from the video alone, without audio.
  5. Remove duplicates and confusable classes. Only one clip per video was kept, and clips whose Inception-V1 features were too similar (footage reused from other videos) were removed. A Two-Stream classifier was used to find frequently confused classes, which were then merged, split, or deleted.

Classes cover single-person actions (drawing, laughing, etc.), person-person actions (shaking hands, hugging, etc.), and person-object actions (opening presents, mowing the lawn, etc.). Some classes are distinguished by the temporal pattern of motion, such as different swimming strokes, and others by objects, such as types of wind instruments. There is no deep hierarchy, only loose groupings such as music, personal grooming, dancing, and cooking.

Splits and sizes for each version are as follows (Table 1 of each paper).

VersionYearClassesPer class (train/val/test)Total trainTotal
Kinetics-4002017400250–1,000/50/100246,245306,245
Kinetics-6002018600450–1,000/50/100 (plus about 50 held-out test)392,622495,547
Kinetics-7002019700450–1,000/50/100545,317650,317
Kinetics-700-20202020700Small classes topped up so every class has at least 700 clips545,793—

Each new version largely contains the previous one. Kinetics-600 keeps 368 of the 400 classes unchanged, and 597 of Kinetics-700's classes are the same as in the 600-class version. Kinetics-700-2020 adds new clips to the 123 classes that had fewer than 700 clips.

The format is not the videos themselves but a CSV listing the class name, YouTube video ID, start and end seconds, and split (the Kinetics-400 CSV has the columns label,youtube_id,time_start,time_end,split,is_cc). Users download the videos from YouTube and cut the clips themselves. Today, CVDF (Common Visual Data Foundation) distributes the Kinetics-400, 600, and 700-2020 videos packaged as tar.gz files. Resolution and frame rate vary from clip to clip, and the clips include audio.

Evaluation rules

Evaluation uses top-1 and top-5 accuracy on the validation (or test) clips.

Even when a clip shows several actions (such as texting while driving), it has only one label. For this reason, the paper argues that top-5 is more appropriate, as with ImageNet. The Kinetics challenge at the ActivityNet workshop ranked entries by the average of the top-1 and top-5 error rates.

The baseline results reported in the papers are as follows (top-1/top-5 accuracy, %).

VersionModelValidationTest
Kinetics-400ConvNet + LSTM (RGB)—57.0/79.0
Kinetics-400Two-Stream (RGB + optical flow)—61.0/81.3
Kinetics-4003D ConvNet (a C3D variant, RGB)—56.1/79.5
Kinetics-600I3D (RGB)71.9/90.171.7/90.4
Kinetics-700I3D (RGB)58.7/81.757.3/79.9
Kinetics-700-2020I3D (RGB, evaluated on 8 clips)59.3/82.058.2/80.9

The three Kinetics-400 models were trained on Kinetics alone, without ImageNet pretraining. The challenge winners' error (the average of the top-1 and top-5 error rates) was 12.4% on Kinetics-400 in 2017, 11.0% on Kinetics-600 in 2018, and 17.9% on Kinetics-700 in 2019.

Reported numbers vary greatly depending on how many temporal crops are taken from each clip and averaged (a single center crop, or 8 or 10 crops along time) and how many spatial crops are used. In addition, the evaluation set shrinks as videos disappear from YouTube. When comparing with other papers, match the version used, the number of clips actually available, and the test-time cropping scheme.

Usage and historical significance

As the first large-scale action dataset on which video models could be trained from scratch, Kinetics became the foundation of video recognition research.

  • Comparing video architectures: Video models such as I3D, SlowFast, X3D, TimeSformer, ViViT, and Video Swin Transformer report Kinetics-400 top-1 accuracy as their main metric.
  • Pretraining: Transferring features from Kinetics-trained models to small datasets such as UCF-101 and HMDB-51 became standard practice. A companion paper released alongside the Kinetics-400 paper studied the effect of this pretraining.
  • Evaluating building blocks: Kinetics serves as a testbed for applying image techniques to video. Papers on Group Normalization, Switchable Normalization, and Octave Convolution, among others, report results on Kinetics.
  • A base for other annotations: Annotations built on Kinetics-700 videos, such as AVA-Kinetics and Countix, are also distributed by CVDF.

Caveats

License: DeepMind's official page states that Google provides the Kinetics dataset under CC BY 4.0. However, what is distributed is mainly the video locations (YouTube IDs), timestamps, and labels; the copyright of each video belongs to its uploader.

CC BY 4.0 covers the annotations; it does not make the YouTube videos free to use. When downloading, storing, or redistributing the videos, or using them to train commercial models, check YouTube's Terms of Service and the rights to each video.

Videos disappear over time: YouTube videos vanish at a rate of about 3% per year as they are deleted or made private. As of October 2020, only 220,033 of the 246,245 Kinetics-400 training videos (89%) remained. Reporting the number of clips you actually have in your paper, and using a fixed set of videos such as the CVDF distribution, makes comparisons easier.

Do not mix versions: Each new version contains most clips from the previous one, and much of the Kinetics-400 validation set is in the Kinetics-700 training set. Evaluating a Kinetics-700-pretrained model on the Kinetics-400 validation set means evaluating on clips seen during training.

One label per clip: Even clips showing several actions have only one label. Some top-1 errors may be other correct actions.

Bias: According to the paper's analysis, 340 of the 400 classes showed no gender bias or could not be judged, but some classes are skewed, such as shaving (mostly male) and cheerleading (mostly female). Geographically, more than half of the clips come from North America (56.6% in Kinetics-700-2020).

Comparison with similar datasets

Representative video datasets of human actions compare as follows from the same perspective (values for HMDB-51, UCF-101, and ActivityNet are from Table 1 of the Kinetics-400 paper; GTEA is from the MS-TCN paper).

DatasetYearTaskClassesClips/videosLength per item
HMDB-512011Classification516,766 clips (from 3,312 videos)—
UCF-1012012Classification10113,320 clips (from about 2,500 videos)—
ActivityNet-2002015—20028,108 clips (from 19,994 videos)—
Kinetics-4002017Classification400306,245 clips (one per video)About 10 s
Kinetics-7002019Classification700650,317 clipsAbout 10 s
GTEA2011Action segmentation1128 videosAbout 1 min

Rough guidelines for choosing:

  • To train and compare video classification models, use Kinetics-400. It has the most reported results, so comparisons are easiest.
  • To pretrain on more classes, use Kinetics-700 (or Kinetics-700-2020 if you want balanced counts per class).
  • To test pretrained models on small data, fine-tuning on UCF-101 or HMDB-51 is the standard choice.
  • To handle where and what happens in long videos, use datasets with segment labels such as GTEA.

PyTorch example

Show code
python
import csv
import os

import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
from torchvision.io import read_video

"""
Load the Kinetics-400 annotations (val.csv, etc.; columns label,youtube_id,time_start,time_end,split,is_cc) and
pre-cut clips (this example assumes files named <youtube_id>_<6-digit start sec>_<6-digit end sec>.mp4)
Videos that have disappeared from YouTube are not available locally, so only existing files are used
"""

ROOT = 'kinetics400'


def read_annotations(split):
  rows = []
  with open(os.path.join(ROOT, 'annotations', split + '.csv')) as f:
    for r in csv.DictReader(f):
      name = '%s_%06d_%06d.mp4' % (r['youtube_id'], int(r['time_start']), int(r['time_end']))
      path = os.path.join(ROOT, split, name)
      if os.path.exists(path):
        rows.append((path, r['label']))
  return rows


train_rows = read_annotations('train')
classes = sorted({label for _, label in train_rows})
class_to_idx = {c: i for i, c in enumerate(classes)}  # 400 classes
val_rows = read_annotations('val')
print(len(train_rows), len(val_rows))  # record how many clips are actually available


class KineticsClips(Dataset):
  def __init__(self, rows, num_frames=16, size=112, train=True):
    self.rows, self.num_frames, self.size, self.train = rows, num_frames, size, train

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

  def __getitem__(self, i):
    path, label = self.rows[i]
    video, _, _ = read_video(path, pts_unit='sec', output_format='TCHW')  # [T, 3, H, W], uint8
    t = video.shape[0]
    if t < self.num_frames:  # loop short clips (same handling as the Kinetics-400 paper)
      video = video.repeat((self.num_frames + t - 1) // t, 1, 1, 1)
      t = video.shape[0]
    # random start for training, num_frames from the center for evaluation
    start = torch.randint(0, t - self.num_frames + 1, ()).item() if self.train else (t - self.num_frames) // 2
    clip = video[start:start + self.num_frames].float() / 255
    clip = F.interpolate(clip, size=(self.size, self.size), mode='bilinear', align_corners=False)
    if self.train and torch.rand(()) < 0.5:
      clip = clip.flip(-1)  # apply the same horizontal flip to the whole clip
    return clip.permute(1, 0, 2, 3), class_to_idx[label]  # [3, T, H, W] (input shape for 3D convolution)


val_loader = DataLoader(KineticsClips(val_rows, train=False), batch_size=8, num_workers=8)


@torch.no_grad()
def evaluate(model):
  model.eval()  # put BN and dropout in inference mode
  top1 = top5 = n = 0
  for x, y in val_loader:
    pred = model(x).topk(5, dim=1).indices
    top1 += (pred[:, 0] == y).sum().item()
    top5 += (pred == y[:, None]).any(dim=1).sum().item()
    n += y.numel()
  return top1 / n, top5 / n

FAQ

Q. Where do I get the Kinetics videos?
A.

The official release is a CSV of YouTube video IDs, timestamps, and labels, so originally you download and cut the videos from YouTube yourself. Because deleted videos can no longer be retrieved, CVDF now distributes the Kinetics-400, 600, and 700-2020 videos as a package; using it keeps your set of clips more consistent with other studies.

Q. Should I use Kinetics-400 or Kinetics-700?
A.

To compare performance with other papers, use Kinetics-400, which has the most reported results. If you want more classes and clips for pretraining, use Kinetics-700 (or Kinetics-700-2020 for balanced counts per class). However, much of the Kinetics-400 validation set is in the Kinetics-700 training set, so do not evaluate a Kinetics-700-pretrained model on Kinetics-400.

Q. Why also look at top-5 accuracy?
A.

Because each clip has only one label even when it shows several actions. For example, a clip of "texting while driving" belongs to only one of the two classes, so answering the other counts as an error under top-1. The paper argues that top-5 is more appropriate for the same reason as with ImageNet.

References

  1. Kay, W., Carreira, J., Simonyan, K., Zhang, B., Hillier, C., Vijayanarasimhan, S., Viola, F., Green, T., Back, T., Natsev, P., Suleyman, M., & Zisserman, A. (2017). The Kinetics Human Action Video Dataset. arXiv:1705.06950.
  2. Carreira, J., Noland, E., Banki-Horvath, A., Hillier, C., & Zisserman, A. (2018). A Short Note about Kinetics-600. arXiv:1808.01340.
  3. Carreira, J., Noland, E., Hillier, C., & Zisserman, A. (2019). A Short Note on the Kinetics-700 Human Action Dataset. arXiv:1907.06987.
  4. Smaira, L., Carreira, J., Noland, E., Clancy, E., Wu, A., & Zisserman, A. (2020). A Short Note on the Kinetics-700-2020 Human Action Dataset. arXiv:2010.10864.
  5. cvdfoundation/kinetics-dataset (CVDF distribution of Kinetics-400, 600, and 700-2020 videos and annotations).
  6. Google DeepMind. Kinetics (official page; dataset license).