Flower Federated Learning Framework

repository·main·Indexed 27 days ago

https://github.com/flwrlabs/flower

A highly customizable and framework-agnostic federated learning framework for AI research and production systems. Flower supports diverse machine learning ecosystems including PyTorch, TensorFlow, and scikit-learn. The framework includes various baselines such as DASHA, DepthFL, and FedAvgM for evaluating federated AI applications across different data distributions and model configurations.

Tokens
207.7K
Snippets
457
Records
900
Agent score
91%

What's inside Flower

  1. Overview of Flower with TensorFlow and Multiple Strategies Testing

    main

    This testing suite validates Flower's integration with TensorFlow using a Convolutional Neural Network (CNN) trained on the CIFAR10 dataset.

    Test Configuration:

    • Training Data: A subset of 1000 samples from CIFAR10.
    • Testing Data: 10 data points.

    Supported Strategies Tested:

    • FedMedian
    • FedTrimmedAvg
    • QFedAvg
    • FaultTolerantFedAvg
    • FedAvgM
    • FedAdam
    • FedAdagrad
    • FedYogi
  2. Overview of Bare Flower testing

    main
    The e2e-bare directory contains tests designed to verify Flower's core functionality in a minimal environment. These tests use dummy models and dummy operations to ensure the framework operates correctly independently of any specific machine learning framework (like PyTorch or TensorFlow). This setup serves as a baseline that can be extended to test more complex communication configurations.
  3. Overview of Flower Federated Learning Framework

    main

    Flower (flwr) is a customizable, extendable, and framework-agnostic framework designed for building federated AI systems. It is built with AI research in mind and supports a wide variety of machine learning frameworks, including:

    • Deep Learning: PyTorch, TensorFlow, PyTorch Lightning, JAX, fastai, MONAI, TFLite, CoreML.
    • Classical ML & Analytics: scikit-learn, XGBoost, CatBoost, Pandas.
    • Specialized/Other: Hugging Face Transformers, MLX, LeRobot (for federated robots), and raw NumPy.
  4. Overview of Flower with Opacus testing

    main
    This testing suite is designed to verify the compatibility and integration of Flower with Opacus (a library for Differential Privacy in PyTorch). The test implementation utilizes a Convolutional Neural Network (CNN) architecture trained on the CIFAR10 dataset, employing the FedAvg strategy.
  5. Overview of Flower with PyTorch testing

    main

    This testing suite validates Flower integration with PyTorch using a Convolutional Neural Network (CNN) trained on the CIFAR10 dataset.

    Key testing configurations include:

    • Strategy: Uses the FedAvg strategy.
    • Metrics: Employs an evaluate_metrics_aggregation_fn for metric aggregation.
    • Data Scale: Uses a subset of 1000 samples for training and 10 samples for testing.
  6. Overview of FedMLB Baseline

    main

    FedMLB (Multi-Level Branched Regularization for Federated Learning) is a baseline implementation designed to address data heterogeneity and imbalance in federated learning. It uses architectural regularization by constructing auxiliary branches in local models and applying online knowledge distillation to ensure local representations are congruent with hybrid pathways.

    This implementation reproduces results for:

    • FedMLB
    • FedAvg
    • FedAvg+KD

    Supported Datasets: CIFAR-100 and Tiny-ImageNet. Task: Image classification using ResNet-18. Hardware Note: Tested on Linux with 64GB RAM. Default configurations may exceed 10GB of memory usage.

  7. Overview of Flower Datasets features

    main

    The flwr-datasets library is designed for the quick creation of datasets for federated learning, analytics, and evaluation. Key features include:

    • Downloading datasets: Directly use any dataset available on the Hugging Face Hub.
    • Partitioning datasets: Implement heterogeneity (non-IIDness) using various partitioning schemes or custom ones.
    • Creating centralized datasets: Keep portions of the dataset unpartitioned for centralized evaluation.
    • Visualization: Visualize label distributions of partitioned datasets to compare different parameters, datasets, or partitioning schemes.

    The library integrates with popular formats and frameworks including Hugging Face, PyTorch, TensorFlow, Numpy, Pandas, Jax, and Arrow.