{"id":13422298,"url":"https://github.com/yaoyao-liu/meta-transfer-learning","last_synced_at":"2025-06-12T19:41:02.814Z","repository":{"id":41374849,"uuid":"161999774","full_name":"yaoyao-liu/meta-transfer-learning","owner":"yaoyao-liu","description":"TensorFlow and PyTorch implementation of \"Meta-Transfer Learning for Few-Shot Learning\" (CVPR2019)","archived":false,"fork":false,"pushed_at":"2025-06-02T03:47:15.000Z","size":3771,"stargazers_count":762,"open_issues_count":40,"forks_count":149,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-06-02T13:05:25.068Z","etag":null,"topics":["few-shot-learning","fewshot-cifar100","meta-learning","mini-imagenet","tiered-imagenet","transfer-learning"],"latest_commit_sha":null,"homepage":"https://lyy.mpi-inf.mpg.de/mtl/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaoyao-liu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-16T12:40:27.000Z","updated_at":"2025-06-02T03:47:18.000Z","dependencies_parsed_at":"2023-01-31T18:30:54.618Z","dependency_job_id":null,"html_url":"https://github.com/yaoyao-liu/meta-transfer-learning","commit_stats":null,"previous_names":["y2l/meta-transfer-learning-tensorflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yaoyao-liu/meta-transfer-learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyao-liu%2Fmeta-transfer-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyao-liu%2Fmeta-transfer-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyao-liu%2Fmeta-transfer-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyao-liu%2Fmeta-transfer-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaoyao-liu","download_url":"https://codeload.github.com/yaoyao-liu/meta-transfer-learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaoyao-liu%2Fmeta-transfer-learning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259520285,"owners_count":22870415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["few-shot-learning","fewshot-cifar100","meta-learning","mini-imagenet","tiered-imagenet","transfer-learning"],"created_at":"2024-07-30T23:00:41.265Z","updated_at":"2025-06-12T19:41:02.797Z","avatar_url":"https://github.com/yaoyao-liu.png","language":"Python","funding_links":[],"categories":["Meta-Transfer Learning for Few-Shot Learning. CVPR 2019","Python"],"sub_categories":["[CVPR19-Few-shot - 知乎](https://zhuanlan.zhihu.com/p/67402889)"],"readme":"# Meta-Transfer Learning for Few-Shot Learning\n[![LICENSE](https://img.shields.io/badge/license-MIT-green?style=flat-square)](https://github.com/y2l/meta-transfer-learning-tensorflow/blob/master/LICENSE)\n[![Python](https://img.shields.io/badge/python-2.7%20%7C%203.5-blue.svg?style=flat-square\u0026logo=python\u0026color=3776AB)](https://www.python.org/)\n[![TensorFlow](https://img.shields.io/badge/tensorflow-1.3.0-orange.svg?style=flat-square\u0026logo=tensorflow\u0026color=FF6F00)](https://github.com/y2l/meta-transfer-learning/tree/master/tensorflow)\n[![PyTorch](https://img.shields.io/badge/pytorch-0.4.0-%237732a8?style=flat-square\u0026logo=PyTorch\u0026color=EE4C2C)](https://pytorch.org/)\n[![Citations](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/yaoyao-liu/google-scholar/google-scholar-stats/gs_data_shieldsio_mtl.json\u0026logo=Google%20Scholar\u0026color=5087ec\u0026style=flat-square\u0026label=citations)](https://scholar.google.com/citations?view_op=view_citation\u0026hl=en\u0026user=Uf9GqRsAAAAJ\u0026citation_for_view=Uf9GqRsAAAAJ:bEWYMUwI8FkC)\n\u003c!--\n[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/yaoyao-liu/meta-transfer-learning?style=flat-square\u0026logo=codefactor\u0026color=F44A6A)](https://www.codefactor.io/repository/github/yaoyao-liu/meta-transfer-learning)\n--\u003e\n\nThis repository contains the TensorFlow and PyTorch implementation for the [CVPR 2019](http://cvpr2019.thecvf.com/) Paper [\"Meta-Transfer Learning for Few-Shot Learning\"](http://openaccess.thecvf.com/content_CVPR_2019/papers/Sun_Meta-Transfer_Learning_for_Few-Shot_Learning_CVPR_2019_paper.pdf) by [Qianru Sun](https://qianrusun1015.github.io),\\* [Yaoyao Liu](https://people.mpi-inf.mpg.de/~yaliu/),\\* [Tat-Seng Chua](https://www.chuatatseng.com/), and [Bernt Schiele](https://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal-computing/people/bernt-schiele/) (\\*=equal contribution).\n\nIf you have any questions on this repository or the related paper, feel free to [create an issue](https://github.com/yaoyao-liu/meta-transfer-learning/issues/new) or [send me an email](mailto:yaoyao.liu+github@mpi-inf.mpg.de). \n\n#### Summary\n\n* [Introduction](#introduction)\n* [Getting Started](#getting-started)\n* [Datasets](#datasets)\n* [Performance](#performance)\n* [Citation](#citation)\n* [Acknowledgements](#acknowledgements)\n\n\n## Introduction\n\nMeta-learning has been proposed as a framework to address the challenging few-shot learning setting. The key idea is to leverage a large number of similar few-shot tasks in order to learn how to adapt a base-learner to a new task for which only a few labeled samples are available. As deep neural networks (DNNs) tend to overfit using a few samples only, meta-learning typically uses shallow neural networks (SNNs), thus limiting its effectiveness. In this paper we propose a novel few-shot learning method called ***meta-transfer learning (MTL)*** which learns to adapt a ***deep NN*** for ***few shot learning tasks***. Specifically, meta refers to training multiple tasks, and transfer is achieved by learning scaling and shifting functions of DNN weights for each task. We conduct experiments using (5-class, 1-shot) and (5-class, 5-shot) recognition tasks on two challenging few-shot learning benchmarks: 𝑚𝑖𝑛𝑖ImageNet and Fewshot-CIFAR100. \n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://mtl.yyliu.net/images/ss.png\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n\u003e Figure: Meta-Transfer Learning. (a) Parameter-level fine-tuning (FT) is a conventional meta-training operation, e.g. in MAML. Its update works for all neuron parameters, 𝑊 and 𝑏. (b) Our neuron-level scaling and shifting (SS) operations in meta-transfer learning. They reduce the number of learning parameters and avoid overfitting problems. In addition, they keep large-scale trained parameters (in yellow) frozen, preventing “catastrophic forgetting”.\n\n## Getting Started\n\nPlease see `README.md` files in the corresponding folders:\n\n* TensorFlow: [\\[Document\\]](https://github.com/y2l/meta-transfer-learning/blob/master/tensorflow/README.md)\n* PyTorch: [\\[Document\\]](https://github.com/y2l/meta-transfer-learning/blob/master/pytorch/README.md)\n\n## Datasets\n\nDirectly download processed images: [\\[Download Page\\]](https://mtl.yyliu.net/download/)\n\n### 𝒎𝒊𝒏𝒊ImageNet\n\nThe 𝑚𝑖𝑛𝑖ImageNet dataset was proposed by [Vinyals et al.](http://papers.nips.cc/paper/6385-matching-networks-for-one-shot-learning.pdf) for few-shot learning evaluation. Its complexity is high due to the use of ImageNet images but requires fewer resources and infrastructure than running on the full [ImageNet dataset](https://arxiv.org/pdf/1409.0575.pdf). In total, there are 100 classes with 600 samples of 84×84 color images per class. These 100 classes are divided into 64, 16, and 20 classes respectively for sampling tasks for meta-training, meta-validation, and meta-test. To generate this dataset from ImageNet, you may use the repository [𝑚𝑖𝑛𝑖ImageNet tools](https://github.com/y2l/mini-imagenet-tools).\n\n### Fewshot-CIFAR100\n\nFewshot-CIFAR100 (FC100) is based on the popular object classification dataset CIFAR100. The splits were\nproposed by [TADAM](https://arxiv.org/pdf/1805.10123.pdf). It offers a more challenging scenario with lower image resolution and more challenging meta-training/test splits that are separated according to object super-classes. It contains 100 object classes and each class has 600 samples of 32 × 32 color images. The 100 classes belong to 20 super-classes. Meta-training data are from 60 classes belonging to 12 super-classes. Meta-validation and meta-test sets contain 20 classes belonging to 4 super-classes, respectively.\n\n### 𝒕𝒊𝒆𝒓𝒆𝒅ImageNet\n\nThe [𝑡𝑖𝑒𝑟𝑒𝑑ImageNet](https://arxiv.org/pdf/1803.00676.pdf) dataset is a larger subset of ILSVRC-12 with 608 classes (779,165 images) grouped into 34 higher-level nodes in the ImageNet human-curated hierarchy. To generate this dataset from ImageNet, you may use the repository 𝑡𝑖𝑒𝑟𝑒𝑑ImageNet dataset: [𝑡𝑖𝑒𝑟𝑒𝑑ImageNet tools](https://github.com/y2l/tiered-imagenet-tools). \n\n\n## Performance \n\n|          (%)           | 𝑚𝑖𝑛𝑖 1-shot  | 𝑚𝑖𝑛𝑖 5-shot  | FC100 1-shot | FC100 5-shot | \n| ---------------------- | ------------ | ------------ | ------------ | ------------ |\n| `MTL Paper`            | `60.2 ± 1.8` | `74.3 ± 0.9` | `43.6 ± 1.8` | `55.4 ± 0.9` |\n| `TensorFlow`           | `60.8 ± 1.8` | `74.3 ± 0.9` | `44.3 ± 1.8` | `56.8 ± 1.0` |\n* The performance for the PyTorch version is under checking.\n\n## Citation\n\nPlease cite our paper if it is helpful to your work:\n\n```bibtex\n@inproceedings{SunLCS2019MTL,\n  author    = {Qianru Sun and\n               Yaoyao Liu and\n               Tat{-}Seng Chua and\n               Bernt Schiele},\n  title     = {Meta-Transfer Learning for Few-Shot Learning},\n  booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition, {CVPR}\n               2019, Long Beach, CA, USA, June 16-20, 2019},\n  pages     = {403--412},\n  publisher = {Computer Vision Foundation / {IEEE}},\n  year      = {2019}\n}\n```\n\n## Acknowledgements\n\nOur implementations use the source code from the following repositories and users:\n\n* [Model-Agnostic Meta-Learning](https://github.com/cbfinn/maml)\n\n* [Optimization as a Model for Few-Shot Learning](https://github.com/gitabcworld/FewShotLearning)\n\n* [Learning Embedding Adaptation for Few-Shot Learning](https://github.com/Sha-Lab/FEAT)\n\n* [dragen1860/MAML-Pytorch](https://github.com/dragen1860/MAML-Pytorch)\n\n* [@icoz69](https://github.com/icoz69)\n\n* [@CookieLau](https://github.com/CookieLau)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaoyao-liu%2Fmeta-transfer-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaoyao-liu%2Fmeta-transfer-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaoyao-liu%2Fmeta-transfer-learning/lists"}