Presenting HelioSync, a comprehensive platform for running federated learning projects across multiple devices while preserving data privacy.
Here are a few snapshots of the platform in action:
- Privacy Preserving Learning: Train machine learning models without sharing raw data
- Multi-Framework Support: Use TensorFlow or PyTorch for model development
- Organization Management: Create and manage organizations with multiple users
- Client Management: Register and monitor client devices participating in training
- Project Dashboard: Track project progress, metrics, and model performance
- Model Deployment: Deploy trained models as APIs or download for local use
- Real-time Metrics: Monitor training progress with visualizations
- API Access: Programmatic access for client integration
The platform consists of the following components:
- Web Interface: Flask-based web application for managing federated learning projects
- Federated Server: Coordinates the training process and aggregates model updates
- Federated Clients: Run on devices with local data, train models without sharing data
- Examples: Pre-built examples for common datasets (MNIST, CIFAR-10, Sentiment Analysis)
- Python 3.8+
- pip (Python package manager)
- Virtual environment tool (recommended)
- Clone the repository:
git clone https://github.com/yourusername/federated-learning-platform.git
cd federated-learning-platform- Create and activate a virtual environment:
python -m venv <name_of_env>
source <name_of_env>/bin/activate # On Windows: venv\Scripts\activate- Install the dependencies:
pip install -r requirements.txt- Initialize the database:
python init_db.pyFollow the prompts to create an admin user and organization. Make sure to save the API key that is displayed after initialization.
To run the application in development mode:
python run.py --config development --debugThe application will be available at http://localhost:5000.
For production deployment:
python run.py --config production --host 0.0.0.0 --port 5000- Login: Access the web interface and login with the admin credentials created during setup
- Create Project: Set up a new federated learning project with the desired dataset and parameters
- Register Clients: Use the API key to register client devices that will participate in training
- Start Training: Launch the federated training process from the project dashboard
- Monitor Progress: Track metrics and model performance in real-time
- Deploy Model: Once training is complete, deploy the model as an API or download it
To configure a client to participate in federated learning:
- Ensure you have the required dependencies:
pip install requests- Run the federated client with your API key:
python -m fl_client.run_client --client_id client1_saurabh --api_key API_KEY --server_url http://localhost:5000 --batch_size 32 --epochs 5 --data_split 0.5- Command line options:
--server Server URL (default: http://127.0.0.1:5000)
--api_key API key for authentication
--name Client name (defaults to hostname)
--verbose Enable verbose logging
- Or import the client in your own code:
from federated_client import FederatedClient
# Initialize client
client = FederatedClient(
server_url="http://your-server-url:5000",
api_key="your-api-key",
client_name="my-device"
)
# Start and run the client
if client.start():
client.run()The platform includes an example federated learning project for MNIST digit recognition:
cd examples/mnist
python run_server.py # Start the federated server
python run_client.py --client-id 1 # Start a client instanceFor CIFAR-10 image classification:
cd examples/cifar10
python run_server.py
python run_client.py --client-id 1For text sentiment analysis:
cd examples/sentiment
python run_server.py
python run_client.py --client-id 1The platform provides a RESTful API for client integration:
All API requests require a valid API key, which should be included in the X-API-Key header.
/api/register_client: Register a new client (primary endpoint)/api/client/register: Alias for client registration/api/clients/register: Alias for client registration/api/register: Alias for client registration
/api/client/heartbeat: Update client status with heartbeat/api/clients/heartbeat: Alias for client heartbeat/api/clients/<client_id>/heartbeat: Update status for a specific client ID
/api/clients/tasks: Get available tasks for a client/api/projects: Get available projects/api/projects/<project_id>/server_info: Get server information for a project/api/projects/<project_id>/update_status: Update project status
/api/health: Check server status
For detailed API usage examples, see the documentation in the web interface.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.




