Skip to main content

A decentralized federated learning framework with privacy guarantees

Project description

DecentraLearn

Python Version License Documentation Tests

A decentralized federated learning framework with strong privacy guarantees, built on blockchain technology.

🚀 Features

  • Federated Learning

    • Decentralized model training
    • Secure model aggregation
    • Incentive mechanisms
    • Smart contract-based coordination
  • Privacy Mechanisms

    • Differential Privacy
    • Homomorphic Encryption
    • Zero-Knowledge Proofs
    • Secure Aggregation
  • Blockchain Integration

    • Smart contract-based verification
    • Transparent model tracking
    • Decentralized coordination
    • Incentive distribution
  • Advanced Security

    • End-to-end encryption
    • Model integrity verification
    • Access control
    • Audit logging

📦 Installation

Prerequisites

  • Python 3.8 or higher
  • Ethereum node (e.g., Ganache for development)
  • PyTorch 1.7 or higher

Installation Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/decentralearn.git
    cd decentralearn
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies:

    pip install -e .
    

🏁 Quick Start

  1. Initialize blockchain connection:

    from decentralearn.blockchain.client import BlockchainClient
    from decentralearn.config.blockchain_config import BlockchainConfig
    
    config = BlockchainConfig(
        rpc_url="http://localhost:8545",
        chain_id=1337
    )
    client = BlockchainClient(config)
    
  2. Create and train a model:

    from decentralearn.models.base import BaseModel
    from decentralearn.privacy import DifferentialPrivacy
    
    model = BaseModel()
    dp = DifferentialPrivacy(epsilon=0.1)
    # Train model with privacy
    
  3. Upload to blockchain:

    client.upload_model(model)
    

📚 Documentation

Comprehensive documentation is available in the docs/ directory:

🧪 Testing

Run the test suite:

pytest tests/

For detailed test output:

pytest -v tests/

🤝 Contributing

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

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📝 License

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

📧 Support

For questions and support:

  1. Check the FAQ
  2. Open an issue on GitHub
  3. Contact the maintainers

🙏 Acknowledgments

  • PyTorch team for the deep learning framework
  • Ethereum community for blockchain infrastructure
  • Privacy research community for privacy-preserving techniques

📄 Citation

If you use DecentraLearn in your research, please cite:

@software{decentralearn2024,
  author = {Jihad GARTI},
  title = {DecentraLearn: A Decentralized Federated Learning Framework},
  year = {2024},
  publisher = {ackerman23},
  url = {https://github.com/ackerman23/decentralearn}
}

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

decentralearn-0.1.0.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

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

decentralearn-0.1.0-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file decentralearn-0.1.0.tar.gz.

File metadata

  • Download URL: decentralearn-0.1.0.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for decentralearn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 351a766b35c5a413224742e1dcc7070b74bace06f40ff370266fac13861c699e
MD5 0c96f1013787bb02dff5c13744b28e39
BLAKE2b-256 c16948b588b84c900dbe4a57379e32f87cef774d014c6344441b97c0fd423766

See more details on using hashes here.

File details

Details for the file decentralearn-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: decentralearn-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for decentralearn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80a84bca5a7adbcc3daba82524d2422460706806e95c117ed8ac6d0340429ae5
MD5 a9d1a38b80a9b2ce5f9f3c7357abe45e
BLAKE2b-256 189f9a28cdb32facbf91909160c49db334c55b58c92fe99693cab879c682c250

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