Skip to content
forked from 00why00/Glocal

Implementation of CVPR'23 paper "Glocal Energy-based Learning for Few-Shot Open-Set Recognition"

License

Notifications You must be signed in to change notification settings

mala-lab/Glocal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glocal Energy-based learning

Official implementation of Glocal Energy-based Learning for Few Shot Open-Set Recognition (accepted by CVPR 2023).

[Paper] [BibTex]

Requirements

This repo is tested with Python 3.10, Pytorch 1.13, CUDA 11.6. More recent versions of Python and Pytorch with compatible CUDA versions should also support the code.

Getting Start

1. Prepare Dataset

Dataset Source can be downloaded here.

Download them and move datasets under data folder.

2. Prepare Pretrain Weights

Download pretrain weights here and move them under initialization folder.

3. Running

Just run main.py for training and testing

For example, to train and test the 5-way 1-shot/5-shot setting on MiniImageNet:

python main.py --gpu 0 --max_epoch 100 --attention --energy --energy_loss --open_loss --lr 0.0001 --energy_method sum --pixel_wise --distance pixel_sim --pixel_conv --init_weights [/path/to/pretrained/weights] --dataset MiniImageNet --shot [number of shots] --ahead_combine --top_k [number of k]

to train and test the 5-way 1-shot/5-shot setting on TieredImageNet:

python main.py --gpu 0 --max_epoch 200 --attention --energy --energy_loss --open_loss --lr 0.0002 --energy_method sum --pixel_wise --distance pixel_sim --pixel_conv --init_weights [/path/to/pretrained/weights] --dataset TieredImageNet --shot [number of shots] --ahead_combine --top_k [number of k]

to train and test the 5-way 1-shot/5-shot setting on CIFAR-FS:

python main.py --gpu 0 --max_epoch 100 --attention --energy --energy_loss --open_loss --lr 0.0001 --energy_method sum --pixel_wise --distance pixel_sim --pixel_conv --init_weights [/path/to/pretrained/weights] --dataset CIFAR-FS --shot [number of shots] --ahead_combine --top_k [number of k]

to train and test the 5-way 1-shot/5-shot setting on CIFAR-FS without pixel branch:

python main.py --gpu 0 --max_epoch 100 --attention --energy --energy_loss --open_loss --lr 0.0001 --energy_method sum --init_weights [/path/to/pretrained/weights] --dataset CIFAR-FS --shot [number of shots]

Citation

@article{wang2023glocal,
  title={Glocal Energy-based Learning for Few Shot Open-Set Recognition},
  author={Haoyu Wang and Guansong Pang and Peng Wang and Lei Zhang and Wei Wei and Yanning Zhang},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2023}
}

Acknowledgement

Part of the code is modified from FEAT, SnaTCHer, TANE and RFDNet.

About

Implementation of CVPR'23 paper "Glocal Energy-based Learning for Few-Shot Open-Set Recognition"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%