Knowledge Base Regulation Tracker Standards & Frameworks OSS Directory AI Incident Database Research Paper Library Case Studies Society Articles News Jobs About Charter Sign inBecome a Member
Home/OSS Directory/FederatedScope

FederatedScope

Federated learning

Event-driven federated learning platform supporting heterogeneous settings, personalised FL, federated hyperparameter tuning, LLM fine-tuning and privacy attack and defence simulations, for research and prototyping.

federated learningalibaba

Introduction

FederatedScope is an event-driven federated learning (FL) platform developed by Alibaba DAMO Academy. It is designed to support a wide range of FL tasks, including heterogeneous settings, personalized FL, federated hyperparameter tuning, large language model (LLM) fine-tuning, and simulations of privacy attacks and defenses. The platform is tailored for research and prototyping, offering flexibility and customization for both academic and industrial applications.

The platform operates on an event-driven architecture, which enhances its adaptability to diverse FL scenarios. FederatedScope integrates functionalities for secure and efficient learning while addressing challenges such as data heterogeneity, privacy preservation, and model personalization. It provides tools for benchmarking, algorithm development, and simulation of adversarial environments, making it a comprehensive resource for FL research.

Since its initial release in 2022, FederatedScope has evolved through multiple versions, incorporating advancements in tree-based models for vertical FL, asynchronous training strategies, and defense mechanisms against adversarial attacks.

How It Works

This design allows for modular and flexible implementation of FL algorithms, accommodating both synchronous and asynchronous training paradigms.

The platform supports standalone and distributed modes. In standalone mode, multiple participants are simulated on a single device, with data isolation and model sharing facilitated through message passing. Distributed mode, on the other hand, enables real-world deployment across multiple devices or servers, ensuring scalability and practical applicability.

The codebase is organized into directories such as core, cv, nlp, gfl, autotune, and verticalfl, each addressing specific FL applications. For instance, the core directory contains foundational components like workers, trainers, and aggregators, while domain-specific directories like cv and nlp provide implementations for computer vision and natural language processing tasks, respectively. This structure allows users to extend or customize the platform for specialized use cases without modifying the underlying architecture.

Use Cases

FederatedScope supports a broad spectrum of FL applications, including but not limited to personalized FL, federated hyperparameter tuning, and vertical FL. This capability is critical for real-world scenarios where data diversity is inherent, such as in healthcare or recommendation systems.

The platform includes benchmarks for personalized FL (pFL-Bench), federated hyperparameter optimization (FedHPO-Bench), and hetero-task FL (B-FHTL). These benchmarks provide standardized datasets and baselines, enabling fair comparisons and reproducible research.

FederatedScope also addresses privacy and security concerns through built-in defenses against adversarial attacks. It supports strategies such as Krum, Multi-Krum, Median, and NormBounding to mitigate data poisoning and backdoor attacks. Additionally, the platform includes simulations for privacy-preserving techniques like differential privacy (DP) and secure multi-party computation (SMPC), ensuring that researchers can test and validate their approaches in controlled environments.

Beyond traditional FL tasks, FederatedScope extends to advanced applications such as LLM fine-tuning and graph federated learning. The inclusion of tree-based models (e.g., XGBoost, GBDT) in vertical FL further broadens its applicability to structured data scenarios. These features are complemented by tools for training parallelization, message compression, and robust aggregators, which enhance computational efficiency and communication effectiveness in large-scale FL deployments.

Key Features & Capabilities

  • Event-Driven Architecture: FederatedScope’s event-driven design allows for dynamic interactions between participants, supporting both synchronous and asynchronous FL workflows. This flexibility is particularly useful for handling heterogeneous and dynamic environments, where participants may join or leave the system at varying times.
  • Benchmarking and Reproducibility: The platform provides multiple benchmarks, including pFL-Bench for personalized FL, FedHPO-Bench for hyperparameter optimization, and B-FHTL for hetero-task learning. These benchmarks include datasets, baselines, and evaluation metrics, ensuring reproducibility and facilitating comparative studies across different algorithms.
  • Privacy and Security: FederatedScope incorporates defenses against adversarial attacks, such as backdoor attacks (e.g., BadNet, Blend) and data poisoning. It also supports privacy-preserving mechanisms like differential privacy and secure aggregation, enabling researchers to evaluate the robustness of their models under real-world threats. The platform’s attack and defense simulations are particularly valuable for testing the resilience of FL systems.
  • Modular and Extensible Design: The codebase is organized into modular components, allowing users to customize or extend functionality for specific use cases. For example, users can integrate custom datasets or models by registering them with the platform, while the event-driven architecture ensures compatibility with existing workflows. This modularity is further supported by documentation, tutorials, and a FederatedScope Playground for hands-on experimentation.
  • Support for Diverse FL Applications: FederatedScope covers a wide range of FL applications, including computer vision (CV), natural language processing (NLP), graph learning, and recommendation systems.
  • Efficiency Optimizations: The platform includes features for improving computational and communication efficiency, such as training parallelization, message compression, and robust aggregators.
  • Tree-Based Models for Vertical FL: FederatedScope supports tree-based models like XGBoost, GBDT, and RandomForest in vertical FL settings. These models are equipped with privacy protection mechanisms such as differential privacy, order-preserving encryption (OP_Boost), and homomorphic encryption (HE), allowing users to balance model performance with privacy requirements.
  • Asynchronous Training: The platform enables asynchronous FL training, where clients can update the global model at different times and with varying degrees of staleness. FederatedScope provides configurations for aggregation conditions, staleness toleration, and broadcasting manners to support diverse asynchronous strategies.
  • Visualization and Monitoring: FederatedScope includes visualization tools for monitoring training metrics, evaluation results, and client-wise performance.
  • Research Contributions and Publications: The platform’s development is closely tied to academic research, with contributions published in top-tier conferences such as KDD, ICML, and NeurIPS. Notable publications include papers on federated graph learning (KDD 2022 Best Paper Award), personalized FL benchmarks, and federated hyperparameter optimization. These publications underscore FederatedScope’s role in advancing the state of FL research and practice.

Installation and Setup

FederatedScope supports two primary installation methods: Docker and Conda. Users are recommended to use Python 3.9 for compatibility. The Docker method involves building a custom image with specified versions of CUDA and PyTorch (e.g., CUDA 11 and PyTorch 1.10) and running it in a containerized environment. Alternatively, the Conda method allows for installation in a virtual environment, with options to customize the PyTorch version based on the user’s hardware (e.g., NVIDIA GPUs or Apple M1 chips).

Once installed, users can prepare datasets and models using FederatedScope’s DataZoo and ModelZoo. DataZoo automates the download and preprocessing of public datasets for applications in CV, NLP, graph learning, and recommendation systems. Users specify the dataset type in the configuration file (e.g., cfg.data.type = 'femnist'), while custom datasets can be integrated by adhering to the platform’s data format requirements. Similarly, ModelZoo provides pre-implemented model architectures (e.g., cfg.model.type = 'convnet2'), with support for custom models through registration mechanisms.

Running an FL task in FederatedScope involves configuring parameters such as the number of training rounds (cfg.federated.totalroundnum), batch size (cfg.dataloader.batchsize), and learning rate (cfg.train.optimizer.lr). Users can execute tasks in standalone mode, which simulates multiple participants on a single device, or in distributed mode for real-world deployment. The platform’s unified interface simplifies the transition between these modes, and real-time monitoring provides insights into metrics like training loss, accuracy, and communication overhead.

For advanced use cases, such as graph FL or NLP, additional dependencies can be installed via scripts provided in the environment directory.

Sources

Contribute

Spot an error, or know a record we should add? Members can propose additions and submit corrections.