Giter VIP home page Giter VIP logo

privatefl's Introduction

PrivateFL: Accurate, Differentially Private Federated Learning via Personalized Data Transformation

This is the Pytorch implementation of our paper, PrivateFL: Accurate, Differentially Private Federated Learning via Personalized Data Transformation.

Experiment Setup

First enter the following path:

cd script

We use miniconda to create a virtual environment with python 3.8, you can install miniconda use the following script if you are using Linux-x86-64bit machine:

(Optional for install miniconda)

bash install_conda.sh

Then use the following script to download the requirements:

bash setup.sh

Code Usage

Train from scratch

You can use the following script to train from scratch.

bash fedavg.sh

You can also change the parameters in script/train.sh, e.g., --data --nclient --nclass --ncpc --model --mode --round --epsilon --sr --lr, following the choices listed in parse_arguments() of FedAverage.py. The value of the parameters can be found in our paper.

Train with frozen encoder

Run the following script to extract features from [ResNeXt, SimCLR, CLIP] and train a one-layer classifier, you may need to download ResNext using this link:

bash fedtransfer.sh

Please reduce the value of --physical_bs if facing CUDA out of memory.

Citation

@inproceedings{yangprivatefl,
  title={PrivateFL: Accurate, Differentially Private Federated Learning via Personalized Data Transformation},
  author={Yang, Yuchen and Hui, Bo and Yuan, Haolin and Gong, Neil and Cao, Yinzhi}
  booktitle = {Proceedings of the USENIX Security Symposium (Usenix'23)},
  year = {2023}
}

privatefl's People

Contributors

yuchen413 avatar bhui97 avatar

Stargazers

 avatar rainSpring avatar Yiwei avatar scpy007 avatar  avatar Weiyu avatar Abdenour SOUBIH avatar  avatar Ahmed M. A. Sayed avatar  avatar Lan avatar Gauri Gupta avatar Masterchef avatar Christopher Webb avatar  avatar Fang Mingliang avatar  avatar  avatar  avatar  avatar  avatar Eric.yue avatar Nuo avatar xie yingqiang avatar  avatar  avatar Zhifeng Jiang avatar Yi Liu avatar EnanaShinonome avatar Kubao avatar Yizhe Li avatar Rui Zeng avatar

Watchers

 avatar

privatefl's Issues

Accuracy mismatches the paper figure.

First of all, thank you for your generous sharing. I am a new FL learner and trying to experiment with your code. However, I encountered some accuracy mismatches between my results and yours from Figure5.(f) in the paper. I haven't used the local data transformation yet, just a FedAVG+LDP setting.

I ran the command python FedAverage.py --data='cifar10' --nclient=100 --nclass=10 --ncpc=2 --model='resnet18' --mode='LDP' --round=100 --epsilon=4 --sr=1 --lr=5e-2 --flr=1e-1 --physical_bs=3 --E=1 twice, which is from E1_avg_cifar10.sh. The best accuracies I could get are 0.3337 and 0.3598. But Figure5.(f) shows I was supposed to get a 0.6?

I use Anaconda instead of miniconda and once a client finishes her training, I run self.optim.zero_grad(set_to_none=True) to release GPU memory.

Should I just run the command a few times more and compute an accuracy average? But the gap to 0.6 is a little big now.
Could you please give me some advice on how to reproduce your results from Figure5.(f)? Many thanks.

Where is the data transformation function in FedUser.py?

I am very interested in your work and I'm trying to run the code, but I am confused, because the data transformation function mentioned in the paper is suppose to be in the FedUser.py but I can't find it. Did I overlook or did the code miss this part?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.