CAFE (Centralized And Federated Experiments) is a unified framework designed to run, compare, and analyze centralized and federated training experiments using YOLOv8 for object detection tasks.
The repository provides reproducible pipelines, environment-driven configuration, and evaluation workflows for benchmarking edge–cloud, distributed, and federated learning scenarios.
CAFE/
├── centralized_training/
│ ├── centralized_training.py
│ ├── example.env
│ ├── requirements.txt
│ └── README.md
│
├── federated_training/
│ ├── server.py
│ ├── client.py
│ ├── server.env
│ ├── client.env
│ ├── requirements.txt
│ └── README.md
│
└── README.md <-- (this file)
CAFE provides a controlled environment for comparing:
- Centralized vs Federated training performance
- CPU, GPU, and Jetson-edge devices
- Different federated learning strategies (FedAvg, FedAvgM, FedAdam, FedYogi)
- Training time, communication cost, accuracy, and scalability
The project enables reproducible experiments through:
.env-based configuration- deterministic training options
- unified logging and CSV output
- consistent dataset management for both approaches
The folder centralized_training/ contains:
centralized_training.py— YOLOv8 centralized training script.env— configuration file- automatic CSV metrics output
- training time profiling
cd centralized_training
python centralized_training.pyThe folder federated_training/ contains:
server.py— Flower federated learning serverclient.py— YOLOv8 federated clientserver.env— server configurationclient.env— client configuration- Jetson-safe operations
- final aggregated model + CSV logs
cd federated_training
python server.pypython client.pyTo launch multiple clients, duplicate client.env and modify:
CLIENT_ID=client2
DATA=dataset_client2/fasdd.yaml
Both centralized and federated modules generate:
- YOLOv8 model checkpoints (
.pt) - per-class and global metrics
- CSV logs
- timing information
- (Federated) final aggregated model
- (Federated) round-by-round time measurements