Skip to content

Fine Tuning for Image Recognition with a model trained with Reptile

License

Notifications You must be signed in to change notification settings

Bisonai/1-shot-classification-with-reptile

Repository files navigation

1-shot classification with Reptile

Unofficial implementation of fine-tuning phase for meta-learning algorithm Reptile applied on image classification problem with 1-shot 3-way settings.

This repository contains a 1-shot 3-way Reptile model pre-trained on Omniglot dataset. We provide simple demos (Omniglot demo, MNIST demo and OpenAI demo) on three different datasets (Omniglot, MNIST and OpenAI).

We characterized the performance of our pre-trained model by performing an evaluation on both Omniglot and MNIST datasets with 1-shot 3-way settings. Cross entropy loss was used as an evaluation metric. The results can be found in the table below (under construction).

Dataset Learning rate Average loss train Average loss test
MNIST 0.01 1.48e-04 1.43
MNIST 0.001 0.0154 0.685
Omniglot 0.01 3.03e-04 0.252
Omniglot 0.001 0.0191 0.294

Requirements

  • Python 3.6+
  • Tensorflow
  • skimage
  • matplotlib
pip install -r requirements.txt

Demos

In the following demos, we randomly sample three classes and take one image from each of them. Then, we fine-tune our pre-trained model using three previously sampled images and finally we test performance by classifying another image belonging to one of three sampled classes. We provide Jupyter notebooks version of our demos. The learning rate and the number of epochs for the fine-tuning can be changed within Jupyter notebooks. We used three following datasets:

License

MIT License