Skip to main content

Federated Learning for Metaverse Infrastructures with MARL, Privacy, and Sustainability

Project description

MetaFed-FL: Federated Learning for Metaverse Systems

Build Status Python Version PyTorch Code Quality

License Version Platform

Paper Conference Framework


๐Ÿ”ฌ Research Overview

MetaFed is a cutting-edge federated learning (FL) framework specifically designed for Metaverse infrastructures. This research addresses the critical challenges of privacy, performance, and sustainability in distributed AI systems.

Paper: MetaFed: Advancing Privacy, Performance, and Sustainability in Federated Metaverse Systems
Authors: Muhammet Anil Yagiz, Zeynep Sude Cengiz, Polat Goktas (2025)

๐ŸŒ Visit Project Website - Interactive demos, tutorials, and detailed documentation


๐Ÿ› ๏ธ Installation

Prerequisites

  • Python 3.9+
  • PyTorch 2.2.2+
  • CUDA (optional, for GPU acceleration)

Dependencies

# Core dependencies
pip install torch>=2.2.2 torchvision>=0.17.2
pip install numpy>=1.26.4 pandas>=2.2.2
pip install matplotlib>=3.9.2 timm>=1.0.8

# Development dependencies
pip install -r requirements-dev.txt

Package Installation

# Install as editable package
pip install -e .

# Or install from PyPI (when available)
pip install metafed-fl

๐Ÿš€ Quick Start

# Clone the repository
git clone https://github.com/afrilab/MetaFed-FL.git
cd MetaFed-FL

# Install dependencies
pip install -r requirements.txt

# Run MNIST experiment
python -m experiments.mnist.run_experiment

# Run CIFAR-10 experiment
python -m experiments.cifar10.run_experiment

๐Ÿ“Š Key Features

๐Ÿค– Multi-Agent Reinforcement Learning (MARL)

  • Dynamic client orchestration and selection
  • Adaptive resource allocation
  • Intelligent scheduling algorithms

๐Ÿ”’ Privacy-Preserving Techniques

  • Homomorphic encryption for secure aggregation
  • Differential privacy for data protection
  • Zero-knowledge proof mechanisms

๐ŸŒฑ Carbon-Aware Scheduling

  • Real-time carbon intensity tracking
  • Renewable energy-aligned orchestration
  • Sustainable resource management

๐Ÿ“ˆ Comprehensive Benchmarks

  • MNIST with ResNet-18 architecture
  • CIFAR-10 with ResNet-18 architecture
  • Multiple federated learning algorithms
  • Extensive performance metrics

๐Ÿ“ˆ Performance Metrics

Dataset Algorithm Accuracy Improvement CO2 Reduction Efficiency Gain
MNIST FedAvg+MARL +15% -35% +20%
CIFAR-10 FedProx+MARL +20% -45% +25%
CIFAR-10 SCAFFOLD+MARL +18% -40% +22%

Compared to baseline federated learning algorithms


๐Ÿ“‚ Project Structure

MetaFed-FL/
โ”œโ”€โ”€ src/metafed/              # Core package
โ”‚   โ”œโ”€โ”€ core/                 # FL core components
โ”‚   โ”œโ”€โ”€ algorithms/           # FL algorithms
โ”‚   โ”œโ”€โ”€ orchestration/        # MARL orchestration
โ”‚   โ”œโ”€โ”€ privacy/              # Privacy mechanisms
โ”‚   โ”œโ”€โ”€ green/                # Carbon-aware features
โ”‚   โ””โ”€โ”€ utils/                # Utilities
โ”œโ”€โ”€ experiments/              # Experiment runners
โ”‚   โ”œโ”€โ”€ mnist/                # MNIST experiments
โ”‚   โ””โ”€โ”€ cifar10/              # CIFAR-10 experiments
โ”œโ”€โ”€ tests/                    # Test suite
โ”œโ”€โ”€ docs/                     # Documentation
โ””โ”€โ”€ scripts/                  # Utility scripts

๐Ÿงช Running Experiments

Command Line Interface

# MNIST with FedAvg + MARL
metafed-mnist --algorithm fedavg --orchestrator rl --rounds 100

# CIFAR-10 with privacy preservation
metafed-cifar10 --algorithm fedprox --privacy differential --epsilon 1.0

# Green-aware scheduling
metafed-mnist --green-aware --carbon-tracking

Configuration Files

# Using YAML configuration
python -m experiments.mnist.run_experiment --config configs/fedavg_privacy.yaml

Jupyter Notebooks (Legacy)

# For research and exploration
jupyter notebook experiments/notebooks/

๐Ÿ”ง Advanced Configuration

Algorithm Selection

  • FedAvg: Standard federated averaging
  • FedProx: Proximal federated optimization
  • SCAFFOLD: Stochastic controlled averaging

Orchestration Methods

  • Random: Random client selection
  • RL-based: Multi-agent reinforcement learning
  • Green-aware: Carbon-optimized selection

Privacy Settings

  • Homomorphic Encryption: Secure aggregation
  • Differential Privacy: ฮต-differential privacy
  • Hybrid: Combined privacy mechanisms

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone and setup development environment
git clone https://github.com/afrilab/MetaFed-FL.git
cd MetaFed-FL
pip install -e ".[dev]"

# Run tests
pytest tests/

# Run linting
flake8 src/ tests/
black src/ tests/

Code Style

  • Black for code formatting
  • Flake8 for linting
  • isort for import sorting
  • Type hints for better code documentation

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ“ Citation

If you use MetaFed-FL in your research, please cite:

@misc{yagiz2025metafedadvancingprivacyperformance,
  title={MetaFed: Advancing Privacy, Performance, and Sustainability in Federated Metaverse Systems},
  author={Muhammet Anil Yagiz and Zeynep Sude Cengiz and Polat Goktas},
  year={2025},
  eprint={2508.17341},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2508.17341}
}

๐ŸŒŸ Acknowledgments

  • AFRI Lab for supporting this research
  • PyTorch Team for the excellent deep learning framework
  • Federated Learning Community for inspiration and collaboration

๐ŸŒ Website

Built with โค๏ธ for the Federated Learning Community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metafed_fl-1.0.0.tar.gz (55.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metafed_fl-1.0.0-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file metafed_fl-1.0.0.tar.gz.

File metadata

  • Download URL: metafed_fl-1.0.0.tar.gz
  • Upload date:
  • Size: 55.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metafed_fl-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ff37b92fdc8f9a4a0682b10bf54e1d826203d2c924f0af916a363bce07a6114e
MD5 0d69af46c2f1794df3c1a4bd24631cb6
BLAKE2b-256 231dc641ad9fb69296ff6be687f95b0d962df812ba7fae8d8f1667bca1d4ae50

See more details on using hashes here.

File details

Details for the file metafed_fl-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: metafed_fl-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metafed_fl-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7b936fcb424ff065531e40ef8561973a2ebefaef40570fe7a0367cdaa94f401
MD5 671eefeeae4b06dde2db86ffdd20301c
BLAKE2b-256 64ef2ec98fd354408a05c67851819aa9810ce69db65d347da5fbfef7825ca057

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page