Skip to content

git-disl/Fusion-Shot

Repository files navigation

Robust Few-Shot Ensemble Learning with Focal Diversity-Based Pruning

alt text We present FusionShot a focal diversity optimized few-shot ensemble learning framework with three steps.

  1. Obtain training and validation predictions for each base Few-shot Learning Model.
  2. Select the best ensemble set among the pool of Few-Shot Learners using Genetic Algorithm.
  3. Train FusionShot model on top of the base-models using training-val predictions and perform prediction for novel classes.

Installation

$ pip install requirements.txt

Datasets

Download the mini-Imagenet and CUB datasets at the following link and extract them under base_model_src/filelists/<datasetname>

Then run the python scripts create_split_jsons.py inside filelists/CUB/ and filelists/miniImagenet/ folders

Models

The trained base-models for each dataset can be found at the link on below.

Extract them under checkpoints/.

Running

Obtaining Predictions from Base Models

To obtain 5way 1shot predictions for miniImagenet

$ cd base_model_src/
$ ./inference_miniImagenet_5way_1shot.sh

Pruning the ensemble set

To perform bruteforce to see all the ensemble combinations

$ cd ens_pruning_src/
$ ./run_bruteforce.sh

To perform Genetic Algorithm to select the best performing combinations

$ cd ens_pruning_src/
$ ./run_ga.sh

Training and Running Fusionshot

After you observe the best ensemble set by runing the pruning scripts, you can train your FusionShot model by calling,

$ cd fusionshot_src/
$ ./run_train.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published