A decentralized federated learning framework with privacy guarantees, created by Jihad GARTI
Project description
DecentraLearn
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
Install via pip (Recommended)
You can install the latest release (v2.1.0) directly from PyPI:
pip install decentralearn
To upgrade to the latest version:
pip install --upgrade decentralearn
Note: If you encounter dependency issues (especially with eth-tester), try installing the beta version first:
pip install eth-tester==0.13.0b1
pip install decentralearn
Or install all dependencies manually:
pip install torch>=2.0.0 numpy>=1.21.0 scipy>=1.7.0 opacus>=1.1.0 phe>=1.5.0 web3>=6.0.0 eth-tester==0.13.0b1 eth-utils>=2.1.0
pip install decentralearn
Prerequisites
- Python 3.8 or higher
- Ethereum node (e.g., Ganache for development)
- PyTorch 1.7 or higher
Installation Steps (from source)
-
Clone the repository:
git clone https://github.com/ackerman23/decentralearn cd decentralearn
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -e .
🏁 Quick Start
-
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)
-
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
-
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.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
Creator: Jihad GARTI (jihad.garti2@gmail.com)
📧 Support
For questions and support:
- Check the FAQ
- Open an issue on GitHub
- 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 = {Jihad GARTI},
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decentralearn-2.1.1.tar.gz.
File metadata
- Download URL: decentralearn-2.1.1.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2422d6b628e7fb7f1eee82d0dd154e27debcb5961d59d6044d6765decaab0d8c
|
|
| MD5 |
ac4cc0b9751c47e09ef3eeb4af7c5bb6
|
|
| BLAKE2b-256 |
3af18aaaab3650c381dc09a3cfde555d81f1cfb5ba4bb425bbaf3855991e483d
|
File details
Details for the file decentralearn-2.1.1-py3-none-any.whl.
File metadata
- Download URL: decentralearn-2.1.1-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ed6f5b45e55d5147c9cb8cccad1524f8aa09236c61f7f6beb796bfe4071cb2
|
|
| MD5 |
c295a0865b40bedbec2b4f830c1a6fd8
|
|
| BLAKE2b-256 |
7199e9c60d15ff3f51e7b9fc1854c2a8c4330f13cd67d6caede5db0754d37e7d
|