How tjdghks994/fedpso works
Project type and purpose
• This is a Python-based federated-learning prototype that demonstrates two aggregation algorithms: FedAvg (baseline) and FedPSO (novel PSO-based aggregator).
• Its goal is to simulate clients training local models, then coordinate with a central server aggregator to update a global model under constrained communication (Docker+docker-compose orchestrates the environment).
File structure
• Top-level:
• Dockerfile + docker-compose.yaml: containerize & launch server/clients
• requirements.txt: Python dependencies (e.g., PyTorch, numpy)
• FedPSO/ directory:
– build_model.py: defines the neural network architecture
– fed_avg.py: FedAvg orchestration (send global model → clients train → return weights → average → update)
– fed_pso.py: FedPSO orchestration (send global model → clients train → return scores → server picks best → fetch that client’s weights → update)
• figure/: PNGs illustrating protocol & experimental results
README for additional insights
• README includes:
• Abstract: communicates data privacy & communication cost challenges
• Usage + docker-compose snippets: shows how to spin up FedAvg or FedPSO services
• Figures: protocol flowcharts for both FedAvg and FedPSO
Elements
• Clear labels:
• Docker Compose
• Aggregation Service (Server)
• Federated Clients (Client 1…Client K)
• Model Definition Module
• Network Link
• Global model → Clients
• Local updates (weights or scores) → Server
• Updated model feedback loop
• Blue rectangles for containers
• Green ovals for code modules
Detailed capture of essential elements
• Build_model.py as a shared library mounted into all containers (via volume in docker-compose)
• How commenting/uncommenting lines in docker-compose selects FedAvg vs FedPSO
• Data payload sizes: “model weights (~MB)” vs “score scalar (bytes)” to emphasize communication cost reduction in FedPSO