$ cd ../
Federated Learning — bash

user@devops:~$ cat README.md

Federated Learning

# Description

Federated Learning simulation implementing FedAvg (Federated Averaging) from scratch with PyTorch. 5 clients receive non-IID partitions (Dirichlet α=0.5) of Fashion-MNIST (4 classes: T-shirt, Trouser, Pullover, Dress). Each client trains a local CNN (Conv16→Conv32→FC64→FC4, 114K params) for 3 local epochs, then a central server averages the weights (FedAvg). 12 communication rounds. The centralized model achieves 95.25% test accuracy; the federated model 93.20% (only 2.05% gap), demonstrating that collaborative learning preserves privacy without sacrificing accuracy. 5 visualizations: non-IID distribution, convergence curves, final comparison, per-round evolution, and t-SNE embeddings.

# Key features

$ FedAvg (Federated Averaging): average local model weights

$ Non-IID partitioning with Dirichlet (α=0.5): each client has heterogeneous data

$ Privacy by design: data never leaves the client device

$ Comparison Centralized (95.25%) vs Federated (93.20%) — only 2.05% gap

$ CPU-optimized small CNN: Conv16→Conv32→FC64, 114K params

$ 5 visualizations: distribution, convergence, comparison, evolution, t-SNE

# Gallery

Desktop view
Federated Learning - Desktop view
Mobile view
Federated Learning - Mobile view

# Technologies used

Python PyTorch scikit-learn matplotlib seaborn