Skip to content

THU-AIR Vertical Federated Learning general, extensible and light-weight framework

Notifications You must be signed in to change notification settings

yooopan/FHE-VFLAIR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VFLAIR

Overview

Basic Introduction

VFLAIR is a general, extensible and light-weight VFL framework that provides vanilar VFL training and evaluation process simulation alonging with several effective communication improvement methods as well as attack and defense evaluations considering data safety and privacy. Aside from NN serving as local models for VFL systems, tree-based VFL is also supported.

Code Structure

VFLAIR

VFLAIR
├── src
│   ├── evaluates           
│   |   ├── attacks                    # Attack Simulator,Implementation of attacks
│   │   |   ├── ...                    # Multiple Attack Implementation
│   |   ├── defenses                   # Implementation of defenses
│   │   |   ├── Trained CAE momdels    # Trained encoder-decoder models for CAE and DCAE
│   │   |   ├── ...                    # Defense Implementation & Functions
│   |   ├── MainTaskVFL                # Pipeline for BasicVFL & VFL with LI/FR/NTB
│   |   ├── MainTaskVFLwithBackdoor    # Pipeline for VFL with TB     
│   |   ├── MainTaskTVFL               # Pipeline for Tree-based VFL
│   ├── load                           # Load Configurations into training pipeline
│   |   ├── LoadConfigs.py             # Load basic parameters   
│   |   ├── LoadDataset.py             # Load dataset and do data partition
│   |   ├── LoadModels.py              # Initialize models
│   |   ├── LoadParty.py               # Initialized parties with data and model
│   ├── configs                        # Customizable configurations    
│   |   ├── standard_configs           # Standard configurations for reference
│   │   │   ├── ...   
│   |   ├── README.md                  # Guidance for configuration files 
│   |   ├── README_TREE.md             # Guidance for testing tree-based VFL
│   ├── models                         # bottom models & global models     
│   |   ├── model_parameters           # Some pretrained models
│   │   ├── ...                        # Implemented bottome models & global models
│   ├── party                          # party simulators   
│   |   ├── ...
│   ├── dataset                        # Dataset preprocessing functions       
│   |   ├── ...
│   ├── utils                          # Basic functions and Customized functions for attack&defense
│   |   ├── ...
│   ├── exp_result                     # Store experiment results
│   |   ├── ...
│   ├── metrics                        # Benchmark and Defense Capability Score (DCS) definition
│   |   ├── ...
│   ├── main_separate.py               # Main VFL(launch this file for NN based VFL)  
│   ├── main_tree.py                   # Main Tree-based VFL(launch this file for tree-based VFL)  
├── usage_guidance                     # Detailed Usage  
│   ├── figures
│   |   ├── ...
│   ├── Add_New_Algorithm.md           # Guidance on how to add user defined attacks and defenses algorithms
│   ├── Dataset_Usage.md               # Guidance on how to achieve dataset for experiments
├── README.md

Quick Start

Zero. Environment Preparation

Use pip install -r requirements.txt to install all the necessary requirements.

One. Basic Benchmark Usage: A Quick Example

  1. Customize your own configurations
  • Create a json file for your own evaluation configuration in /src/configs folder. Name it whatever you want, like my_configs.json.
  • /src/configs/basic_configs.json is a sample configuration file. You can copy it and modify the contents for your own purpose.
  • For detail information about configuration parameters, see /src/configs/README.md for detail information.
  1. Use cd src and python main_separate.py --seed 0 --gpu 0 --configs <Your_Config_file_name> to start the evaluation process. A quick example can be launched by simplying using cd src and python main_separate.py (a vanilar VFL training and testing process is launched). For more detail descriptions, see Section Two.

Two. Advanced Usage: Implement Your Own Algorithm

  • How to add new attack/defense?
    • usage_guidance/Add_New_Evaluation.md
  • Dataset Usage?
    • usage_guidance/Dataset_Usage.md
  • How to write Configuration files and how to specify hyper-parameters for evaluation?
    • src/config/README.md and src/config/README_TREE.md
  • What is Defense Capability Score (DCS)?
    • Refer to src/metrics for details.

Contributing

We greatly appreciate any contribution to VFLAIR!

Please feel free to contact us if there's any problem with the code base!

About

THU-AIR Vertical Federated Learning general, extensible and light-weight framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 83.3%
  • Python 15.2%
  • Shell 1.5%