This is the code for ECCV Submission - Paper ID: 3755.
We strongly recommend working with Docker Engine and Nvidia-Docker. At this moment, the container can only run on a CUDA (linux/amd64) enabled machine due to specific compiled ops from Pointnet2_PyTorch.
docker pull asafmanor/pytorch:samplenetreg_torch1.4
docker run --runtime nvidia -v $(pwd):/workspace/ -it --name samplenetreg asafmanor/pytorch:samplenetreg_torch1.4
docker build -t samplenetreg_torch1.4_image .
docker run --runtime nvidia -v $(pwd):/workspace/ -it --name samplenetreg samplenetreg_torch1.4_image
cd /root/Pointnet2_PyTorch
git checkout 5ff4382f56a8cbed2b5edd3572f97436271aba89
pip install -r requirements.txt
pip install -e .
cd /workspace
Download the facescape data from this website to a desired folder to read from. Run data/Preprocess_Data_v2.ipynb
to sample pointclouds (.npy
) from mesh (.obj
) files and generate annotations for the same.
Kindly change the read/write paths in the notebook for proper execution.
For a quick start please use the scripts provided in scripts/
directory. Run all scripts from the root directory of this repository. Note that a temporary --base-name
is added to all scripts to maintain anonymity and needs be modified before running the scripts (parent directory containing annotation file and npy data after preprocessing).
-
Train base pointnet classifiers + finetune samplers:
bash ./facescape/scripts/baseline/gender.sh
bash ./facescape/scripts/baseline/exp.sh
-
Train with proxy attacker model for privacy + finetune worst case attacker: a. CBSN (Our Method)
bash ./facescape/scripts/cbns/exp_gender_best.sh
b. Line Cloudbash ./facescape/scripts/line/exp_gender_best.sh
c. AS-ANbash ./facescape/scripts/as_an/exp_gender_best.sh
d. AS-ONbash ./facescape/scripts/as_on/exp_gender_best.sh
e. OS-ANbash ./facescape/scripts/os_an/exp_gender_best.sh
Results for the experiment will be collected in the provided log-directory (eg: ./facescape/log/cbns/finetune/test.log
). In order to reproduce the normalized hypervolume, a sweep over the hyperparameters to regulate privacy-utility is required which may take a long time to compute. For those interested, the parameters can easily be regulated by modifying the arguments the bash scripts (./facescape/scripts/
).
The resulting point clouds can be visualized using results/plot_pointclouds.ipynb
with appropriate paths to trained model files.
If you use our work in your project kindly cite:
@article{chopra2022learning,
title={Learning to Censor by Noisy Sampling},
author={Chopra, Ayush and Java, Abhinav and Singh, Abhishek and Sharma, Vivek and Raskar, Ramesh},
journal={arXiv preprint arXiv:2203.12192},
year={2022}
}
This code builds upon the code provided in Samplenet, PointNetLK, Pointnet2_PyTorch and KNN_CUDA. We thank the authors for sharing their code.