Skip to content

Repository files navigation

Private Channel Perturbation for CNN Split Federated Learning

This repository contains the experimental scripts for a manuscript on client-private channel perturbation in CNN-based split federated learning. The method combines a private perturbation with a private bridge module so that the server-side model does not directly observe a client-aligned smashed representation.

The code was developed and run in Google Colab with the default Colab Python environment and a T4 GPU. The scripts are intentionally kept compact and correspond to the experiments reported in the paper.

Files

File Purpose
sanity_shuffled_bridge.py Main ResNet-18 split federated learning experiments across datasets.
sanity_shuffled_bridge_vgg11bn.py Cross-architecture experiments with VGG11-BN.
sanity_shuffled_bridge_mobilenetv2.py Cross-architecture experiments with MobileNetV2.
plot_comm_overhead_panel.py Communication-overhead figure generation from finished JSON result files.

Experimental Setup

  • Platform: Google Colab default environment
  • GPU: NVIDIA T4
  • Framework: PyTorch / torchvision
  • Datasets: CIFAR-10, CIFAR-100, SVHN, and PathMNIST
  • Backbones: ResNet-18, VGG11-BN, and MobileNetV2
  • Split federated setting: 20 clients, 10 clients per round, Dirichlet non-IID partition with alpha = 0.3
  • Main private mechanism: --defense shuffled_bridge --shuffled_bridge_cut A

The reconstruction attack results use two paper-aligned scenarios:

  • Scenario A: private perturbation unknown to the attacker
  • Scenario B: private perturbation known to the attacker

Baselines without private perturbation are reported as baseline_reconstruction.

Installation

In Colab, clone the repository and install the extra dependencies:

git clone https://github.com/EpiphanyMoment/split-sfl-channel-perturbation.git
cd split-sfl-channel-perturbation
pip install -r requirements.txt

Colab already provides PyTorch and torchvision. The requirements file also lists them for local reproduction.

Example Commands

Run the main ResNet-18 method on CIFAR-10:

python sanity_shuffled_bridge.py \
  --dataset cifar10 \
  --experiment_preset main20 \
  --defense shuffled_bridge \
  --shuffled_bridge_cut A \
  --stage both

Run baseline methods by changing --defense:

python sanity_shuffled_bridge.py --dataset cifar10 --experiment_preset main20 --defense none --stage both
python sanity_shuffled_bridge.py --dataset cifar10 --experiment_preset main20 --defense bottleneck --public_channels 24 --stage both
python sanity_shuffled_bridge.py --dataset cifar10 --experiment_preset main20 --defense pm --pm_group_size 4 --pm_init_prob 0.7 --stage both
python sanity_shuffled_bridge.py --dataset cifar10 --experiment_preset main20 --defense gaussian --noise_sigma 4 --stage both

Run the cross-architecture experiments:

python sanity_shuffled_bridge_vgg11bn.py --dataset cifar10 --defense shuffled_bridge --stage both
python sanity_shuffled_bridge_mobilenetv2.py --dataset cifar10 --defense shuffled_bridge --stage both

Generate the communication-overhead panel after the result JSON files are available:

python plot_comm_overhead_panel.py \
  --project_root . \
  --out_dir ./results_comm_overhead

Notes

  • Dataset files, trained checkpoints, result JSON files, reconstruction images, and generated figures are not included in this repository.
  • PathMNIST requires the medmnist package. For final PathMNIST runs, pass the same normalization statistics used in the paper experiments via --norm_json when available.
  • LPIPS is optional at runtime. If the lpips package is unavailable, the scripts skip LPIPS and keep the other reconstruction metrics.

License

This project is released under the MIT License.

About

Code for private channel perturbation in CNN-based split federated learning.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages