A blockchain-based federated learning platform built on NEAR Protocol that enables decentralized machine learning model training while preserving data privacy.
- Decentralized model training using federated learning
- Privacy-preserving data handling
- NEAR blockchain integration for transparency and incentives
- Real-time model status tracking
- Participant management system
- Reward distribution mechanism
graph TB
subgraph Frontend
UI[User Interface]
ML[TensorFlow.js Model]
WI[Wallet Integration]
subgraph ML Components
PP[Data Preprocessing]
TR[Model Training]
DP[Differential Privacy]
end
UI --> WI
UI --> ML
ML --> PP
ML --> TR
TR --> DP
end
subgraph Smart Contract
PR[Participant Registry]
MU[Model Updates]
RD[Reward Distribution]
MS[Model Status]
end
subgraph NEAR Protocol
BC[Blockchain]
WL[Wallet]
end
%% Frontend to Smart Contract Interactions
WI --> WL
DP --> MU
UI --> PR
UI --> MS
%% Smart Contract to Blockchain
PR --> BC
MU --> BC
RD --> BC
MS --> BC
%% Blockchain to Wallet
BC --> WL
style Frontend fill:#f9f9f9,stroke:#333,stroke-width:2px
style Smart Contract fill:#e6f3ff,stroke:#333,stroke-width:2px
style NEAR Protocol fill:#f0fff0,stroke:#333,stroke-width:2px?
- Frontend: Next.js, TypeScript, TailwindCSS
- Smart Contract: Rust, near-sdk
- Blockchain: NEAR
- Machine Learning: TensorFlow.js
- Node.js >= 16
- Rust toolchain
- NEAR CLI
- A NEAR testnet account
- Clone the repository:
git clone https://github.com/kamalbuilds/decentralised-federated-learning-platform
cd decentralised-federated-learning-platform
- Install frontend dependencies:
cd frontend
npm install
- Build the smart contract:
cd contract
cargo near build
- Login to your NEAR testnet account:
near login
- Deploy the contract:
near deploy --accountId your-testnet-account.testnet --wasmFile target/wasm32-unknown-unknown/release/contract.wasm
- Start the frontend development server:
cd frontend
npm run dev
- Open your browser and navigate to
http://localhost:3000
-
Connect Wallet: Click "Connect Wallet" to link your NEAR account
-
Register as Participant: Register to participate in the federated learning process
-
Train Model: Contribute to model training using your local data
-
View Status: Monitor training progress and model updates
-
Receive Rewards: Earn rewards for successful contributions
- Manages participant registration
- Handles model updates
- Distributes rewards
- Maintains training status
- User interface for model training
- Wallet integration
- Real-time status updates
- Training visualization
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details
- NEAR Protocol team
- Federated Learning community
- Open source contributors