Skip to content

TejasAnvekar/GPr-Net

Repository files navigation

GPr-Net: Geometric Prototypical Network for Point Cloud Few-Shot Learning @ DLGC 2023 (CVPRW)

[arXiv] [Paper]

PWC PWC PWC PWC

teaser We present an overview of the proposed GPr-Net framework, which processes point clouds in a few-shot episodic paradigm using the proposed IGI and Laplace vectors to generate geometric feature sets. These features are then mapped to a higher dimensional permutation invariant feature using the symmetric operation $\mathcal{A}$ and a single Multilayer Perceptron (MLP) $f_{\theta}$. The Prototypical network $f_{\theta}$, utilizes the support and query geometric embeddings $\vec{L}(\Psi(x_s))$ = $\mathcal{S}_e$ and $\vec{L}(\Psi(x_q))$ = $\mathcal{Q}_e$ to predict few-shot labels. To overcome the distribution drift challenge in Prototypical Networks, we employ the Hyperbolic Distance of Euclidean.



Running the code

This repository contains the code for the analysis experiments of Section 4.1. Few-Shot 3D object classification from the paper on the ModelNet40 benchmark and Table 1 (main paper) we use the original SS-FSL benchmarking.

On ModelNet40, GPr-Net achieves best result for 512 points and poincare manifold on tasks:

5 ways 10 shots ACC = 83.11
5 ways 20 shots ACC = 84.75
10 ways 10 shots ACC = 73.98
10 ways 20 shots ACC = 75.93

logs and pretrained models can be found [here].



Performance of GPr-Net for 6 expirements with different seeds Section 4.1. Few-Shot 3D object classification from the paper we show our results from Table 1 (main paper):

#Points Ways Shots OA (Euc) OA (Hyp)
512 5 10 74.04 ± 02.33 81.13 ± 01.51
512 5 20 74.98 ± 02.42 82.71 ± 01.28
512 10 10 62.31 ± 02.01 71.59 ± 01.16
512 10 20 63.33 ± 02.21 73.78 ± 01.99
1024 5 10 74.37 ± 02.00 80.40 ± 00.55
1024 5 20 75.12 ± 02.08 81.99 ± 00.91
1024 10 10 62.14 ± 01.91 70.42 ± 01.80
1024 10 20 63.43 ± 02.05 72.83 ± 01.78

Installation

# step 1. clone this repo
git clone https://github.com/TejasAnvekar/GPr-Net.git
cd GPr-Net

# step 2: install libs step by step
conda create -n GPrNet python=3.8 -y
conda activate GPrNet
conda install pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3.1 -c pytorch -y
pip install geoopt einops h5py pandas tqdm torch-summary

Usage

Few-Shot Classification on ModelNet40

Train and Evaluate: The dataset will be automatically downloaded, run following commands.

By default, it will create a folder structure:

├── Logs
│   ├── {Manifold}
|   |   |──seed_{#}
|   |   |   |──{args}
|   |   |   |   |──checkpoints                 <-data.pt 
|   |   |   |   |──CSV                         <-train.csv, val.csv, test.csv
|   |   |   |   |──{logname}.log               <-Experiment logs

# please check config.py to understand keywords and add other paramemters as you wish.

# train and evaluate GPR-Net Euclidean
python main.py --manifold "Euclidean" --num_points 512 --c 0.0 --LV --gpu --seed 0 --kways 5 --TrS 10 --TS 10 --TrQ 20 --TQ 20 --TrE 4 --TE 300  --logname "Euclidean_GPr-Net.log"


# train and evalaute  GPR-Net Hyperbolic (Poincare)
python main.py --num_points 512 --c 1.0 --LV --gpu --seed 0 --kways 5 --TrS 10 --TS 10 --TrQ 20 --TQ 20 --TrE 4 --TE 300

Re-Create Results

# recreate GPR-Net Euclidean
sh euclidean_ablation.sh

# recreate GPR-Net Hyperbolic (Poincare)
sh poincare_ablation.sh

Acknowledgment

Our implementation is mainly based on the following codebases. We gratefully thank the authors for their wonderful works.

Self-Supervised Few-Shot Learning on Point Clouds, and Hyperbolic Image Embeddings.

BibTeX

Please cite our paper if it is helpful to your research:

@InProceedings{Anvekar_2023_CVPR,
    author    = {Anvekar, Tejas and Bazazian, Dena},
    title     = {GPr-Net: Geometric Prototypical Network for Point Cloud Few-Shot Learning},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2023},
    pages     = {4178-4187}
}