readme.md
December 20, 2025 ยท View on GitHub
On the Out-of-Distribution Backdoor Attack for Federated Learning
This is the official implementation for MobiHoc'25 paper "On the Out-of-Distribution Backdoor Attack for Federated Learning".
You can find the paper here.
Related Methods
If you found our methods SoDa and BNGuard are interesting, you may also refer to our other related works on robust federated learning systems:
- AlignIns (CVPR 2025, Highlight): https://github.com/JiiahaoXU/AlignIns
- MASA (WACV 2025): https://github.com/JiiahaoXU/MASA
- LASA (WACV 2025, Oral presentation): https://github.com/JiiahaoXU/LASA
All these methods are based on simple and effective ideas for protecting federated learning systems. They are easy to implement and can be directly integrated into this codebase or into existing federated learning frameworks.
Usage
If you have any issues using this repo, feel free to contact Jiahao @ jiahaox@unr.edu.
Environment
Our code does not rely on special libraries or tools, so it can be easily integrated with most environment settings.
If you want to use the same settings as us, we provide the conda environment we used in env.yaml for your convenience.
Dataset
All tested datasets are available on torchvision and will be downloaded automatically.
Example
Generally, to run a case with default settings, you can easily use the following command:
python federated.py --aggr bnguard --attack soda --data cifar10 --ood_data mnist
If you want to run a case with non-IID settings, you can easily use the following command:
python federated.py --aggr bnguard --attack soda --data cifar10 --ood_data mnist --non_iid --alpha 0.5
Here,
| Argument | Type | Description | Choice |
|---|---|---|---|
aggr | str | Defense method applied by the server | avg, mkrum, flame, rfa, foolsgold, deepsight, mmetric, rlr, signguard, bnguard |
data | str | ID data for all clients | cifar10, cifar100 |
ood_data | str | OOD data for malicious clients | mnist, fmnist, svhn |
non_iid | store_true | Enable non-IID settings or not | N/A |
alpha | float | Data heterogeneous degree | from 0.1 to 1.0 |
For other arguments, you can check the federated.py file where the detailed explanation is presented.
Citation
We provide the following BibTeX entry for citation for your convenience.
@inproceedings{Xu_2025_MobiHoc_SoDa_BNGuard,
title={On the Out-of-Distribution Backdoor Attack for Federated Learning},
author={Xu, Jiahao and Zhang, Zikai and Hu, Rui},
booktitle={Proceedings of the Twenty-sixth International Symposium on Theory, Algorithmic Foundations, and Protocol Design for Mobile Networks and Mobile Computing},
pages={181--190},
year={2025}
}