All Projects → google-research → Meta Dataset

google-research / Meta Dataset

Licence: apache-2.0
A dataset of datasets for learning to learn from few examples

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Meta Dataset

Meta-SelfLearning
Meta Self-learning for Multi-Source Domain Adaptation: A Benchmark
Stars: ✭ 157 (-67.49%)
Mutual labels:  benchmark, meta-learning
Meta Blocks
A modular toolbox for meta-learning research with a focus on speed and reproducibility.
Stars: ✭ 110 (-77.23%)
Mutual labels:  meta-learning, benchmark
Sysbench
Scriptable database and system performance benchmark
Stars: ✭ 4,268 (+783.64%)
Mutual labels:  benchmark
Rspec Benchmark
Performance testing matchers for RSpec
Stars: ✭ 460 (-4.76%)
Mutual labels:  benchmark
Meta Transfer Learning
TensorFlow and PyTorch implementation of "Meta-Transfer Learning for Few-Shot Learning" (CVPR2019)
Stars: ✭ 439 (-9.11%)
Mutual labels:  meta-learning
Pyperformance
Python Performance Benchmark Suite
Stars: ✭ 406 (-15.94%)
Mutual labels:  benchmark
Reinforcement learning tutorial with demo
Reinforcement Learning Tutorial with Demo: DP (Policy and Value Iteration), Monte Carlo, TD Learning (SARSA, QLearning), Function Approximation, Policy Gradient, DQN, Imitation, Meta Learning, Papers, Courses, etc..
Stars: ✭ 442 (-8.49%)
Mutual labels:  meta-learning
Ffi Overhead
comparing the c ffi (foreign function interface) overhead on various programming languages
Stars: ✭ 387 (-19.88%)
Mutual labels:  benchmark
Awesome Papers Fewshot
Collection for Few-shot Learning
Stars: ✭ 466 (-3.52%)
Mutual labels:  meta-learning
Sympact
🔥 Stupid Simple CPU/MEM "Profiler" for your JS code.
Stars: ✭ 439 (-9.11%)
Mutual labels:  benchmark
Caliper
A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
Stars: ✭ 447 (-7.45%)
Mutual labels:  benchmark
Nanobench
Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20
Stars: ✭ 436 (-9.73%)
Mutual labels:  benchmark
Metaoptnet
Meta-Learning with Differentiable Convex Optimization (CVPR 2019 Oral)
Stars: ✭ 412 (-14.7%)
Mutual labels:  meta-learning
Completely Unscientific Benchmarks
Naive performance comparison of a few programming languages (JavaScript, Kotlin, Rust, Swift, Nim, Python, Go, Haskell, D, C++, Java, C#, Object Pascal, Ada, Lua, Ruby)
Stars: ✭ 440 (-8.9%)
Mutual labels:  benchmark
Blurtestandroid
This is a simple App to test some blur algorithms on their visual quality and performance.
Stars: ✭ 396 (-18.01%)
Mutual labels:  benchmark
Rpc Benchmark
java rpc benchmark, 灵感源自 https://www.techempower.com/benchmarks/
Stars: ✭ 463 (-4.14%)
Mutual labels:  benchmark
Benchmarks Of Javascript Package Managers
Benchmarks of JavaScript Package Managers
Stars: ✭ 388 (-19.67%)
Mutual labels:  benchmark
Smac
SMAC: The StarCraft Multi-Agent Challenge
Stars: ✭ 435 (-9.94%)
Mutual labels:  benchmark
Moses
Molecular Sets (MOSES): A Benchmarking Platform for Molecular Generation Models
Stars: ✭ 440 (-8.9%)
Mutual labels:  benchmark
Memtier benchmark
NoSQL Redis and Memcache traffic generation and benchmarking tool.
Stars: ✭ 480 (-0.62%)
Mutual labels:  benchmark

This repository contains accompanying code for the article introducing Meta-Dataset, arxiv.org/abs/1903.03096. It also contains accompanying code and checkpoints for CrossTransformers, https://arxiv.org/abs/2007.11498, a follow-up work which improves performance.

This code is provided here in order to give more details on the implementation of the data-providing pipeline, our back-bones and models, as well as the experimental setting.

See below for user instructions, including how to:

  1. install the software,
  2. download and convert the data, and
  3. train implemented models.

See this introduction notebook for a demonstration of how to sample data from the pipeline (episodes or batches).

In order to run the experiments described in the first version of the arXiv article, arxiv.org/abs/1903.03096v1, please use the instructions, code, and configuration files at version arxiv_v1 of this repository.

We are currently working on updating the instructions, code, and configuration files to reproduce the results in the second version of the article, arxiv.org/abs/1903.03096v2. You can follow the progess in branch arxiv_v2_dev of this repository.

This is not an officially supported Google product.

Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples

Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, Hugo Larochelle

Few-shot classification refers to learning a classifier for new classes given only a few examples. While a plethora of models have emerged to tackle it, we find the procedure and datasets that are used to assess their progress lacking. To address this limitation, we propose Meta-Dataset: a new benchmark for training and evaluating models that is large-scale, consists of diverse datasets, and presents more realistic tasks. We experiment with popular baselines and meta-learners on Meta-Dataset, along with a competitive method that we propose. We analyze performance as a function of various characteristics of test tasks and examine the models' ability to leverage diverse training sources for improving their generalization. We also propose a new set of baselines for quantifying the benefit of meta-learning in Meta-Dataset. Our extensive experimentation has uncovered important research challenges and we hope to inspire work in these directions.

CrossTransformers: spatially-aware few-shot transfer

Carl Doersch, Ankush Gupta, Andrew Zisserman

This is a Transformer-based neural network architecture which can find coarse spatial correspondence between the query and the support images, and then infer class membership by computing distances between spatially-corresponding features. The paper also introduces SimCLR episodes, which are episodes that require SimCLR-style instance recognition, and therefore encourage features which capture more than just the training-set categories. This algorithm is SOTA on Meta-Dataset (train-on-ILSVRC) as of NeurIPS 2020.

Configuration files for CrossTransformers with and without SimCLR episodes (CTX and CTX+SimCLR Eps from the paper) can be found in learn/gin/default/crosstransformer*. We also have pretrained checkpoints for these two configurations: CTX, and CTX+SimCLR Eps, as well as CTX+SimCLR Eps+BOHB Aug. Note that these were retrained from the versions reported in the paper, but their performance should be on-par. The network structure is the same for all three models, and so they can be loaded using either of the CrossTransformer config files.

Leaderboard (in progress)

The tables below were generated by this notebook.

Adding a new model to the leaderboard

  1. Gather accuracy results and 95% confidence intervals, as well as the number of episodes used for the CI (minimum 600).
  2. If you were affected by #54, make sure the evaluation on Traffic Sign is done on shuffled samples. We encourage you to re-train your best model (or at least perform validation again) as well.
  3. Create an issue, with the name of the model, results, as well as the article to cite or any other relevant information to include, and label it "leaderboard". Alternatively, submit a PR with an update to the notebook.

Training on ImageNet only

Method Avg rank ILSVRC (test) Omniglot Aircraft Birds Textures QuickDraw Fungi VGG Flower Traffic signs MSCOCO
k-NN [1] 9.7 41.03±1.01 (10) 37.07±1.15 (11) 46.81±0.89 (10) 50.13±1.00 (10.5) 66.36±0.75 (8) 32.06±1.08 (11) 36.16±1.02 (8) 83.10±0.68 (8) 44.59±1.19 (10) 30.38±0.99 (10.5)
Finetune [1] 6.15 45.78±1.10 (8) 60.85±1.58 (6.5) 68.69±1.26 (2) 57.31±1.26 (9) 69.05±0.90 (4.5) 42.60±1.17 (8.5) 38.20±1.02 (7) 85.51±0.68 (6) 66.79±1.31 (2) 34.86±0.97 (8)
MatchingNet [1] 8.65 45.00±1.10 (8) 52.27±1.28 (9) 48.97±0.93 (9) 62.21±0.95 (7.5) 64.15±0.85 (10) 42.87±1.09 (8.5) 33.97±1.00 (9) 80.13±0.71 (10) 47.80±1.14 (7.5) 34.99±1.00 (8)
ProtoNet [1] 6.45 50.50±1.08 (4.5) 59.98±1.35 (6.5) 53.10±1.00 (7.5) 68.79±1.01 (5.5) 66.56±0.83 (8) 48.96±1.08 (6) 39.71±1.11 (6) 85.27±0.77 (6) 47.12±1.10 (9) 41.00±1.10 (5.5)
fo-MAML [1] 7.45 45.51±1.11 (8) 55.55±1.54 (8) 56.24±1.11 (5.5) 63.61±1.06 (7.5) 68.04±0.81 (4.5) 43.96±1.29 (8.5) 32.10±1.10 (10) 81.74±0.83 (9) 50.93±1.51 (5.5) 35.30±1.23 (8)
RelationNet [1] 10.55 34.69±1.01 (11) 45.35±1.36 (10) 40.73±0.83 (11) 49.51±1.05 (10.5) 52.97±0.69 (11) 43.30±1.08 (8.5) 30.55±1.04 (11) 68.76±0.83 (11) 33.67±1.05 (11) 29.15±1.01 (10.5)
fo-Proto-MAML [1] 5.2 49.53±1.05 (6) 63.37±1.33 (4.5) 55.95±0.99 (5.5) 68.66±0.96 (5.5) 66.49±0.83 (8) 51.52±1.00 (4.5) 39.96±1.14 (3.5) 87.15±0.69 (3) 48.83±1.09 (7.5) 43.74±1.12 (4)
ALFA+fo-Proto-MAML [3] 3.25 52.80±1.11 (2.5) 61.87±1.51 (4.5) 63.43±1.10 (3) 69.75±1.05 (3.5) 70.78±0.88 (2) 59.17±1.16 (2) 41.49±1.17 (3.5) 85.96±0.77 (6) 60.78±1.29 (3) 48.11±1.14 (2.5)
ProtoNet (large) [4] 3.45 53.69±1.07 (2.5) 68.50±1.27 (2.5) 58.04±0.96 (4) 74.07±0.92 (2) 68.76±0.77 (4.5) 53.30±1.06 (3) 40.73±1.15 (3.5) 86.96±0.73 (3) 58.11±1.05 (4) 41.70±1.08 (5.5)
CTX [4] 1 62.76±0.99 (1) 82.21±1.00 (1) 79.49±0.89 (1) 80.63±0.88 (1) 75.57±0.64 (1) 72.68±0.82 (1) 51.58±1.11 (1) 95.34±0.37 (1) 82.65±0.76 (1) 59.90±1.02 (1)
BOHB [5] 4.15 51.92±1.05 (4.5) 67.57±1.21 (2.5) 54.12±0.90 (7.5) 70.69±0.90 (3.5) 68.34±0.76 (4.5) 50.33±1.04 (4.5) 41.38±1.12 (3.5) 87.34±0.59 (3) 51.80±1.04 (5.5) 48.03±0.99 (2.5)

Training on all datasets

Method Avg rank ILSVRC (test) Omniglot Aircraft Birds Textures QuickDraw Fungi VGG Flower Traffic signs MSCOCO
k-NN [1] 6.95 38.55±0.94 (6.5) 74.60±1.08 (8) 64.98±0.82 (9) 66.35±0.92 (4.5) 63.58±0.79 (6) 44.88±1.05 (9) 37.12±1.06 (5.5) 83.47±0.61 (6) 40.11±1.10 (8) 29.55±0.96 (7)
Finetune [1] 5.35 43.08±1.08 (4.5) 71.11±1.37 (9) 72.03±1.07 (5.5) 59.82±1.15 (7) 69.14±0.85 (2.5) 47.05±1.16 (8) 38.16±1.04 (5.5) 85.28±0.69 (5) 66.74±1.23 (1.5) 35.17±1.08 (5)
MatchingNet [1] 6.8 36.08±1.00 (8) 78.25±1.01 (6.5) 69.17±0.96 (7.5) 56.40±1.00 (8) 61.80±0.74 (7) 60.81±1.03 (5.5) 33.70±1.04 (8) 81.90±0.72 (7) 55.57±1.08 (3.5) 28.79±0.96 (7)
ProtoNet [1] 4.7 44.50±1.05 (4.5) 79.56±1.12 (6.5) 71.14±0.86 (5.5) 67.01±1.02 (4.5) 65.18±0.84 (4.5) 64.88±0.89 (4) 40.26±1.13 (4) 86.85±0.71 (4) 46.48±1.00 (6) 39.87±1.06 (3.5)
fo-MAML [1] 6.15 37.83±1.01 (6.5) 83.92±0.95 (4.5) 76.41±0.69 (3) 62.43±1.08 (6) 64.16±0.83 (4.5) 59.73±1.10 (7) 33.54±1.11 (8) 79.94±0.84 (8) 42.91±1.31 (7) 29.37±1.08 (7)
RelationNet [1] 7.8 30.89±0.93 (9) 86.57±0.79 (3) 69.71±0.83 (7.5) 54.14±0.99 (9) 56.56±0.73 (9) 61.75±0.97 (5.5) 32.56±1.08 (8) 76.08±0.76 (9) 37.48±0.93 (9) 27.41±0.89 (9)
fo-Proto-MAML [1] 3.2 46.52±1.05 (3) 82.69±0.97 (4.5) 75.23±0.76 (4) 69.88±1.02 (3) 68.25±0.81 (2.5) 66.84±0.94 (3) 41.99±1.17 (3) 88.72±0.67 (2) 52.42±1.08 (5) 41.74±1.13 (2)
CNAPs [2] 2.9 50.80±1.10 (2) 91.70±0.50 (2) 83.70±0.60 (2) 73.60±0.90 (2) 59.50±0.70 (8) 74.70±0.80 (2) 50.20±1.10 (2) 88.90±0.50 (2) 56.50±1.10 (3.5) 39.40±1.00 (3.5)
URT [6] 1.15 55.70±1.00 (1) 94.40±0.40 (1) 85.80±0.60 (1) 76.30±0.80 (1) 71.80±0.70 (1) 82.50±0.60 (1) 63.50±1.00 (1) 88.20±0.60 (2) 65.90±1.30 (1.5) 52.20±1.10 (1)

References

[1] Triantafillou et al. (2020)

Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, Hugo Larochelle; Meta-Dataset: A Dataset of Datasets for Learning to Learn from Few Examples; ICLR 2020.

[2] Requeima et al. (2019)

James Requeima, Jonathan Gordon, John Bronskill, Sebastian Nowozin, Richard E. Turner; Fast and Flexible Multi-Task Classification Using Conditional Neural Adaptive Processes; NeurIPS 2019.

[3] Baik et al. (2020)

Sungyong Baik, Myungsub Choi, Janghoon Choi, Heewon Kim, Kyoung Mu Lee; Meta-Learning with Adaptive Hyperparameters; NeurIPS 2020.

[4] Doersch et al. (2020)

Carl Doersch, Ankush Gupta, Andrew Zisserman; CrossTransformers: spatially-aware few-shot transfer; NeurIPS 2020.

[5] Saikia et al. (2020)

Tonmoy Saikia, Thomas Brox, Cordelia Schmid; Optimized Generic Feature Learning for Few-shot Classification across Domains; arXiv 2020.

[6] Liu et al. (2021)

Lu Liu, William Hamilton, Guodong Long, Jing Jiang, Hugo Larochelle; _ Universal Representation Transformer Layer for Few-Shot Image Classification_; ICLR 2021.

User instructions

Installation

Meta-Dataset is generally compatible with Python 2 and Python 3, but some parts of the code may require Python 3. The code works with TensorFlow 2, although it makes extensive use of tf.compat.v1 internally.

  • We recommend you follow these instructions to install TensorFlow.
  • A list of packages to install is available in requirements.txt, you can install them using pip.
  • Clone the meta-dataset repository. Most command lines start with python -m meta_dataset.<something>, and should be typed from within that clone (where a meta_dataset Python module should be visible).
  • To reproduce the CrossTransformers training, you will need data augmentation code from simclr, which is autimatically downloaded by setup.py.

Downloading and converting datasets

Meta-Dataset uses several established datasets, that are available from different sources. You can find below a summary of these datasets, as well as instructions to download them and convert them into a common format.

For brevity of the command line examples, we assume the following environment variables are defined:

  • $DATASRC: root of where the original data is downloaded and potentially extracted from compressed files. This directory does not need to be available after the data conversion is done.
  • $SPLITS: directory where *_splits.json files will be created, one per dataset. For instance, $SPLITS/fungi_splits.json contains information about which classes are part of the meta-training, meta-validation, and meta-test set. These files are only used during the dataset conversion phase, but can help troubleshooting later. To re-use the canonical splits instead of re-generating them, you can make it point to meta_dataset/dataset_conversion in your checkout.
  • $RECORDS: root directory that will contain the converted datasets (one per sub-directory). This directory needs to be available during training and evaluation.

Dataset summary

Dataset (other names) Number of classes (train/valid/test) Size on disk Conversion time
ilsvrc_2012 (ImageNet, ILSVRC) [instructions] 1000 (712/158/130, hierarchical) ~140 GiB 5 to 13 hours
omniglot [instructions] 1623 (883/81/659, by alphabet: 25/5/20) ~60 MiB few seconds
aircraft (FGVC-Aircraft) [instructions] 100 (70/15/15) ~470 MiB (2.6 GiB download) 5 to 10 minutes
cu_birds (Birds, CUB-200-2011) [instructions] 200 (140/30/30) ~1.1 GiB ~1 minute
dtd (Describable Textures, DTD) [instructions] 47 (33/7/7) ~600 MiB few seconds
quickdraw (Quick, Draw!) [instructions] 345 (241/52/52) ~50 GiB 3 to 4 hours
fungi (FGVCx Fungi) [instructions] 1394 (994/200/200) ~13 GiB 5 to 15 minutes
vgg_flower (VGG Flower) [instructions] 102 (71/15/16) ~330 MiB ~1 minute
traffic_sign (Traffic Signs, German Traffic Sign Recognition Benchmark, GTSRB) [instructions] 43 (0/0/43, test only) ~50 MiB (263 MiB download) ~1 minute
mscoco (Common Objects in Context, COCO) [instructions] 80 (0/40/40, validation and test only) ~5.3 GiB (18 GiB download) 4 hours
Total (All datasets) 4934 (3144/598/1192) ~210 GiB 12 to 24 hours

Training

Experiments are defined via gin configuration files, that are under meta_dataset/learn/gin/:

  • setups/ contain generic setups for classes of experiment, for instance which datasets to use (imagenet or all), parameters for sampling the number of ways and shots of episodes.
  • models/ define settings for different meta-learning algorithms (baselines, prototypical networks, MAML...)
  • default/ contains files that each correspond to one experiment, mostly defining a setup and a model, with default values for training hyperparameters.
  • best/ contains files with values for training hyperparameters that achieved the best performance during hyperparameter search.

There are three main architectures, also called "backbones" (or "embedding networks"): four_layer_convnet (sometimes convnet for short), resnet, and wide_resnet. These architectures can be used by all baselines and episodic models. Another backbone, relationnet_convnet (similar to four_layer_convnet but without pooling on the last layer), is only used by RelationNet (and baseline, for pre-training purposes). CrossTransformers use a larger backbone resnet34, which is similar to resnet but with more layers.

Reproducing results

See Reproducing best results for instructions to launch training experiments with the values of hyperparameters that were selected in the paper. The hyperparameters (including the backbone, whether to train from scratch or from pre-trained weights, and the number of training updates) were selected using only the validation classes of the ILSVRC 2012 dataset for all experiments. Even when training on "all" datasets, the validation classes of the other datasets were not used.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].