A full-stack, federated learning platform with a custom-built framework, web dashboard, and containerized client deployment.
Built from scratch by the Learning Optimization Group at Rochester Institute of Technology under Professor Haibo Yang.
FedLearn Platform is an open-source, end-to-end solution for federated learning that combines:
- Custom FL Framework - Built from the ground up (not Flower-based) with advanced features like parameter chunking and parallel heartbeat mechanisms
- Web Dashboard - Modern React interface for managing projects, monitoring training, and viewing real-time logs
- REST API - Spring Boot backend with JWT authentication and WebSocket streaming
- Docker Clients - Pre-packaged containers for zero-installation client deployment
- Production Deployment - Running on AWS EC2 with PostgreSQL database
π₯ Parameter Chunking - Handles models >300MB by automatically chunking parameters during gRPC transmission
β‘ Parallel Heartbeat - Dual gRPC stub architecture prevents server timeout during long training sessions
π‘οΈ DeComFL Integration - Byzantine-robust aggregation for secure federated learning
π Full-Stack Integration - Seamless orchestration from React UI β Spring Boot β Python FL Server β Docker Clients
| Component | Technology | Purpose | Deployment |
|---|---|---|---|
| Frontend | React 19 + Vite | Web dashboard, real-time logs | Vercel |
| Backend API | Spring Boot 3 | REST API, authentication, orchestration | AWS EC2 |
| Database | PostgreSQL | User data, projects, results | AWS EC2 |
| FL Framework | Python 3.10 + PyTorch | Custom federated learning server | AWS EC2 (spawned) |
| FL Clients | Docker + Python | Containerized training clients | Distributed |
1. User creates project in React Dashboard
β
2. Frontend sends REST API request to Spring Boot
β
3. Spring Boot saves project to PostgreSQL
β
4. Spring Boot spawns Python FL Server (via ProcessBuilder)
β
5. FL Server starts gRPC server on dynamic port
β
6. Docker/Native clients connect via gRPC
β
7. Training begins with chunked parameter transfer
β
8. Parallel heartbeat keeps connection alive
β
9. Server logs streamed to React via WebSocket
β
10. Results saved to PostgreSQL and displayed in UI
Built entirely from scratch without relying on existing FL frameworks like Flower.
Capabilities:
- FedAvg (Federated Averaging) aggregation
- DeComFL (Decomposed Federated Learning) with Byzantine robustness
- Support for CNNs, Transformers, and LLMs
- Non-IID data partitioning via Dirichlet distribution
- Mixed precision training
- Learning rate scheduling
See: framework/README.md
Challenge: Models like LLMs can exceed 300MB, causing gRPC transmission failures.
Solution: Automatic parameter chunking during serialization.
# Automatically chunks parameters >300MB
if model_size > 300_000_000: # 300MB threshold
chunks = chunk_parameters(parameters)
for chunk in chunks:
send_chunk(chunk)Benefits:
- Supports large language models (OPT-125M, GPT-2, etc.)
- Memory-efficient transmission
- Transparent to end users
Challenge: During local training, clients cannot respond to server pings β connection timeout.
Solution: Dual gRPC stub architecture.
Client has TWO gRPC stubs:
Stub 1 (Training): Stub 2 (Heartbeat):
- Send/receive parameters - Send periodic pings
- Blocked during training - Always responsive
- Heavy operations - Lightweight
Implementation:
# Training stub (blocking during fit)
training_stub.get_parameters() # Blocked for minutes
# Heartbeat stub (parallel thread)
while training:
heartbeat_stub.ping() # Responds immediately
time.sleep(1)Benefits:
- Prevents false timeouts
- Supports long training sessions (hours)
- Maintains connection stability
Live server logs displayed in React dashboard via STOMP/WebSocket.
// Frontend subscribes to logs
client.subscribe(`/topic/logs/${projectId}`, (message) => {
console.log(message.body); // Real-time log line
});Backend streams Python process output:
// Spring Boot captures Python stdout
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream())
);
String line;
while ((line = reader.readLine()) != null) {
webSocketService.sendLogs(projectId, line); // Broadcast via WebSocket
}Pre-packaged Docker images with framework + dependencies.
User workflow:
# 1. Pull Docker image
docker pull your-registry/fedlearn-client:latest
# 2. Run client (zero installation)
docker run -v /data:/data \
fedlearn-client:latest \
--server-address server.com:50051 \
--client-id 0Benefits:
- No Python/PyTorch installation required
- Consistent environment across clients
- Easy distribution to non-technical users
Secure REST API with Spring Security + JWT tokens.
Flow:
1. User logs in β Spring Boot validates credentials
2. JWT token generated and returned
3. Frontend stores token in localStorage
4. All API requests include token in Authorization header
5. Spring Boot validates token on each request
6. User can only access their own projects
- React 19 - Modern UI library
- Vite 6 - Fast build tool
- React Router v7 - Client-side routing
- Axios - HTTP client
- STOMP.js - WebSocket client
- React Icons - Icon library
- Deployment: Vercel
- Spring Boot 3 - Java framework
- Spring Security - Authentication/authorization
- JWT - Token-based auth
- WebSocket (STOMP) - Real-time communication
- JPA/Hibernate - ORM
- PostgreSQL - Relational database
- Deployment: AWS EC2 (Ubuntu)
- Python 3.10+ - Programming language
- PyTorch 2.0+ - Deep learning framework
- gRPC - RPC framework
- Protocol Buffers - Serialization
- NumPy - Numerical computing
- Transformers - HuggingFace library (for LLMs)
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- AWS EC2 - Cloud hosting
- GitHub Actions - CI/CD (optional)
- Nginx - Reverse proxy (optional)
FedLearn-Platform/
βββ framework/ # Custom FL framework (Python)
β βββ src/fedlearn/ # Core package
β β βββ client/ # Client implementations
β β βββ server/ # Server and strategies
β β βββ communication/ # gRPC + serialization
β β βββ data/ # Data utilities
β β βββ estimators/ # DeComFL estimators
β βββ examples/ # Example applications
β β βββ simple_federation/ # MNIST + CNN
β β βββ llm_federation/ # OPT-125M fine-tuning
β β βββ ecg_federation/ # ECG classification
β βββ setup.py # Pip installable
β βββ README.md # Framework documentation
β
βββ frontend/ # React web application
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ context/ # React Context (Auth)
β βββ package.json
β βββ README.md # Frontend documentation
β
βββ backend/ # Spring Boot API
β βββ fl-platform-api/
β βββ src/main/java/com/federated/fl_platform_api/
β β βββ config/ # Security, WebSocket
β β βββ controller/ # REST endpoints
β β βββ service/ # Business logic
β β βββ repository/ # JPA repositories
β β βββ model/ # Entities
β β βββ security/ # JWT provider
β β βββ flower/ # FlowerServerManager
β βββ src/main/resources/
β β βββ scripts/ # Python FL server scripts
β βββ README.md # Backend documentation
β
βββ client-docker/ # Docker client package
β βββ fedlearn/ # Framework copy
β βββ scripts/ # Client scripts
β βββ Dockerfile # Image definition
β βββ requirements.txt # Python dependencies
β βββ README.md # Docker documentation
β
βββ architecture.svg # System architecture diagram
βββ README.md # This file
βββ LICENSE # Apache 2.0 license
- Python 3.10+
- Java 17+
- Node.js 18+
- PostgreSQL 12+
- Docker (for client deployment)
cd framework
pip install -e .Documentation: framework/README.md
cd backend/fl-platform-api
# Configure database in application.properties
# spring.datasource.url=jdbc:postgresql://localhost:5432/fedlearn_db
mvn spring-boot:runDocumentation: backend/fl-platform-api/README.md
cd frontend
npm install
npm run devDocumentation: frontend/README.md
cd client-docker
docker build -t fedlearn-client:latest .
docker run -v /data:/data \
fedlearn-client:latest \
--server-address localhost:50051 \
--client-id 0Documentation: client-docker/README.md
Comprehensive documentation for each component:
| Component | Documentation |
|---|---|
| FL Framework | framework/README.md |
| Frontend | frontend/README.md |
| Backend API | backend/fl-platform-api/README.md |
| Docker Client | client-docker/README.md |
- Framework Development:
framework/CONTRIBUTING.md - Frontend Development:
frontend/DEVELOPMENT.md - Backend Development:
backend/fl-platform-api/DEVELOPMENT.md
This platform implements algorithms from:
DeComFL: Decomposed Federated Learning with Byzantine-Robust Aggregation
- Authors: Haibo Yang, et al.
- Institution: Rochester Institute of Technology
- Implementation:
framework/src/fedlearn/estimators/
If you use FedLearn Platform in your research, please cite:
@article{yang2024decomfl,
title={DeComFL: Decomposed Federated Learning},
author={Yang, Haibo and [Co-authors]},
journal={[Journal/Conference]},
year={2024},
institution={Rochester Institute of Technology}
}- Train medical diagnosis models across hospitals
- Preserve patient privacy
- Aggregate knowledge without sharing sensitive data
- Fraud detection across banks
- Credit risk modeling
- Regulatory compliance (GDPR, HIPAA)
- Distributed sensor networks
- Mobile device training (smartphones)
- Low-bandwidth environments
- Academic federated learning experiments
- Algorithm benchmarking
- Privacy-preserving ML research
- β Raw data never leaves client devices
- β Only model updates transmitted
- β Differential privacy support (optional)
- β Secure aggregation algorithms
- β JWT-based user authentication
- β Project-level access control
- β Secure WebSocket connections
- β TLS/SSL for gRPC (configurable)
- β CORS configuration
- β Input validation & sanitization
# Terminal 1: Backend
cd backend/fl-platform-api && mvn spring-boot:run
# Terminal 2: Frontend
cd frontend && npm run dev
# Terminal 3: FL Client
cd framework/examples/simple_federation
python run_server.py # Server
python run_client.py --id 0 # ClientBackend + FL Server:
- AWS EC2 instance (Ubuntu 22.04)
- PostgreSQL installed locally
- Spring Boot as systemd service
- Python FL servers spawned dynamically
Frontend:
- Deployed on Vercel
- Automatic deployments from
mainbranch
Configuration:
# Backend environment variables
DATABASE_URL=jdbc:postgresql://localhost:5432/fedlearn_db
JWT_SECRET=your-secret-key
FL_SCRIPTS_PATH=/path/to/scriptsWe welcome contributions! This is an open-source project under Apache 2.0 license.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See individual component documentation:
- Framework:
framework/CONTRIBUTING.md - Frontend:
frontend/DEVELOPMENT.md - Backend:
backend/fl-platform-api/DEVELOPMENT.md
- Be respectful and inclusive
- Provide constructive feedback
- Focus on collaboration
- Help newcomers
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2024 Learning Optimization Group, Rochester Institute of Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Principal Investigator: Professor Haibo Yang
Institution: Rochester Institute of Technology
Research Group: Learning Optimization Group
Developer: Chinmay (MS Computer Science, RIT)
- Rochester Institute of Technology for research support
- Learning Optimization Group for collaboration
- Open-source community for inspiration
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: haibo.yang@rit.edu (Professor Haibo Yang)
If you find this project useful, please consider giving it a βοΈ on GitHub!
Built with β€οΈ by the Learning Optimization Group at Rochester Institute of Technology
Open Source β’ Production Ready β’ Research Grade
