Get Demo

Quick Start Guide

for the Demo Version of the Software

value

Easy start with Python

01

value

Vertical federated learning of a logistic regression model with built-in cryptographic protection

02

value

Includes a training dataset to explore features and capabilities

03

value

The project is ready for application to solve your practical tasks

04

The provided Demo enables Vertical Federated Learning among multiple participants (two or more) without needing to share the actual data for:

The exchange of metadata required for model training is cryptographically secured, ensuring the confidentiality of each participant's data and target labels.

Linear regression model

Linear regression model

Logistic regression model for binary classification

Logistic regression model for binary classification

Softmax regression for multiclass classification

Softmax regression for multiclass classification

Downloading the project and
installing dependencies

1.  Make sure that Python 3 version 3.9 or higher is installed on your computer

2.  Make sure that the standard pip package manager is installed on the computer

3.  Download the project hosted on GitHub from the link: https://github.com/guardora-ai/Guardora-VFL-demo

4.  Go to the project folder

5.  Install requirements

6.  For questions and feedback, please use the #federated-learning channel in Guardora's Discord Community or email iam@guardora.ai

python violet

SSL/TLS Usage
(available only for two participants, in other cases, use the -ns flag)

By default, communication channels between participants are protected using SSL/TLS encryption based on certificates. This feature can be disabled by specifying the appropriate command-line parameter during training initialization. For encryption, certificates are required.

Examples are provided in the folder, suitable for experimental training on localhost. Custom certificates for other participants can also be used by specifying their paths in the command line.

If no ready-made certificates are available, self-signed certificates and keys can be generated using the script, executed with the command:

Here, represents an IP address or domain name. Generated certificate and key file paths must then be provided in the training initialization command.

12345

// Type some code ->

Training Process

Passive Participants 
(No Target Labels)

Each participant without the target label should execute the VFL_server.py script with the following parameters

-i

<Participant ID (e.g., sequential number); default: 1>

-p

<Port number for network connections during training; default: 50055>

-t

<Path to the participant's training dataset (CSV format); default: train file in the 'data' folder>

-v

<Path to the participant's test/validation dataset (CSV format); default: test file in the 'data' folder>

-d 

<Name of the column containing record IDs; default: 'ID'>

-f

<Fraction of randomly selected records from the training and test datasets for model training; default: 0.5>

-ns

<Flag to disable SSL/TLS encryption (optional); by default, SSL/TLS encryption is enabled>

-cp 

<Path to the server certificate for SSL/TLS encryption; default: 'cert/127.0.0.1.crt'>

-kp 

<Path to the server key for SSL/TLS encryption; default: 'cert/127.0.0.1.key'>

Active Participant 
(With Target Labels)

The participant possessing the target labels must configure the training parameters in a configuration file (example provided in the config folder). Steps include:

01

Define Passive Participants:

Specify id, IP address (or domain name), and port for each passive participant. Ensure the port matches the one used when running VFL_server.py for the corresponding participant, and the IP address/domain matches the certificate (if SSL/TLS is enabled).

02

Set Training Parameters:

Specify the learning_rate and number of epochs.

03

Set Binary Classification Threshold:

Define the threshold values for
inference.

04

Set Encryption Key Length:

Specify the key length (in bits) for the Paillier cryptosystem.

05

Run Training Script:

Execute the VFL_client.py script with the following parameters:

-c

<Path to the configuration file; default: 'config/config.conf'>

-m

<Type of model: 'linear', 'logistic', or 'softmax'; default: 'softmax'>

-t

<Path to the training dataset (CSV format); default: train file in 'data' folder>

-v

<Path to the test/validation dataset (CSV format); default: test file in 'data' folder>

-d

<Name of the column containing record IDs; default: 'ID'>

-y

<Name of the column containing the target labels; default: 'y'>

-f

<Fraction of randomly selected records for training/testing; default: 0.5>

-ns

<Flag to disable SSL/TLS encryption (optional); by default, SSL/TLS encryption is enabled>

-cp

<Path to the server certificate for SSL/TLS encryption; default: 'cert/127.0.0.1.crt'>

-kp

<Path to the server key for SSL/TLS encryption; default: 'cert/127.0.0.1.key'>

-rp

<Path to the root certificate for SSL/TLS encryption; default: 'cert/rootCA.crt'>

Inference

After training, each participant retains the parameters of the global model relevant to their data. During inference, each participant loads their respective model parameters and performs inference on their records.