PPT

August 30, 2024 · View on GitHub

PWC PWC

Positional Prompt Tuning for Efficient 3D Representation Learning. ArXiv

In this work, we rethink the effect of position embedding in Transformer-based point cloud representation learning methods, and present a novel method of Parameter-Efficient Fine-Tuning(PEFT) tasks based on this as well as a new form of prompt and adapter structure. With less than 5% of the trainable parameters, our method, namely PPT, outperforms its PEFT counterparts in classification tasks on ModelNet40 and ScanObjectNN datasets. Our PPT also gets better or on par results in few-shot learning on ModelNet40 and in part segmentation on ShapeNetPart.

1. Requirements

PyTorch >= 1.7.0; python >= 3.7; CUDA >= 9.0; GCC >= 4.9; torchvision;

Quick Start

conda create -n ppt python=3.10 -y
conda activate ppt

conda install pytorch==2.0.1 torchvision==0.15.2 cudatoolkit=11.8 -c pytorch -c nvidia
# pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 -f https://download.pytorch.org/whl/torch_stable.html

pip install -r requirements.txt
# PointNet++
pip install "git+https://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib"

2. Datasets

We use ScanObjectNN, ModelNet40 and ShapeNetPart in this work. See DATASET.md for details.

3. PPT Models on Point-MAE

TaskDatasetConfigAcc.Download
Pre-trainingShapeNetN.A.N.A.here
ClassificationScanObjectNNfinetune_scan_hardest.yaml89.00%here
ClassificationScanObjectNNfinetune_scan_objbg.yaml93.63%here
ClassificationScanObjectNNfinetune_scan_objonly.yaml92.60%here
ClassificationModelNet40(1k)finetune_modelnet.yaml93.68%here
ClassificationModelNet40(8k)finetune_modelnet_8k.yaml93.88%here
Part segmentationShapeNetPartsegmentation85.7% mIoUhere

4. PPT Models on ReCon

TaskDatasetConfigAcc.Download
Pre-trainingShapeNetN.A.N.A.here
ClassificationScanObjectNNfinetune_scan_hardest.yaml89.52%here
ClassificationScanObjectNNfinetune_scan_objbg.yaml95.01%here
ClassificationScanObjectNNfinetune_scan_objonly.yaml93.28%here
ClassificationModelNet40(1k)finetune_modelnet.yaml93.76%here
ClassificationModelNet40(8k)finetune_modelnet_8k.yaml93.84%here
Part segmentationShapeNetPartsegmentation85.6% mIoUhere
TaskDatasetConfig5w10s Acc. (%)5w20s Acc. (%)10w10s Acc. (%)10w20s Acc. (%)
Few-shot learningModelNet40fewshot.yaml97.0 ± 2.798.7 ± 1.692.2 ± 5.095.6 ± 2.9

5. PPT Fine-tuning

Fine-tuning Point-MAE on ScanObjectNN, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --config cfgs/pointmae_configs/finetune_scan_hardest.yaml \
--finetune_model --exp_name <output_file_name> --ckpts <path/to/pre-trained/model>

Fine-tuning Point-MAE on ModelNet40, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --config cfgs/pointmae_configs/finetune_modelnet.yaml \
--finetune_model --exp_name <output_file_name> --ckpts <path/to/pre-trained/model>

Voting Point-MAE on ModelNet40, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --test --config cfgs/pointmae_configs/finetune_modelnet.yaml \
--exp_name <output_file_name> --ckpts <path/to/best/fine-tuned/model>

Few-shot learning of Point-MAE, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --config cfgs/pointmae_configs/fewshot.yaml --finetune_model \
--ckpts <path/to/pre-trained/model> --exp_name <output_file_name> --way <5 or 10> --shot <10 or 20> --fold <0-9>

Fine-tuning ReCon on ScanObjectNN, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --config cfgs/recon_configs/finetune_scan_hardest.yaml \
--finetune_model --exp_name <output_file_name> --ckpts <path/to/pre-trained/model>

Fine-tuning ReCon on ModelNet40, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --config cfgs/recon_configs/finetune_modelnet.yaml \
--finetune_model --exp_name <output_file_name> --ckpts <path/to/pre-trained/model>

Voting ReCon on ModelNet40, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --test --config cfgs/recon_configs/finetune_modelnet.yaml \
--exp_name <output_file_name> --ckpts <path/to/best/fine-tuned/model>

Few-shot learning of ReCon, run:

CUDA_VISIBLE_DEVICES=<GPUs> python main.py --config cfgs/recon_configs/fewshot.yaml --finetune_model \
--ckpts <path/to/pre-trained/model> --exp_name <output_file_name> --way <5 or 10> --shot <10 or 20> --fold <0-9>

Part segmentation on ShapeNetPart, run:

cd segmentation
python main.py --ckpts <path/to/pre-trained/model> --root path/to/data --learning_rate 0.0002 --epoch 300

Acknowledgements

Our codes are built upon Point-MAE, ReCon, ICCV23-IDPT and DAPT

Reference