The codes for the work "ACFL: Communication-Efficient adversarial contrastive federated learning for medical image segmentation". Our paper has been accepted by Knowledge-Based Systems. We provide both command-line interface and a user-friendly web interface for easy deployment and visualization.
-
🔥 Multiple Federated Learning Methods Implementation:
- FedAvg: Vanilla Federated Averaging
- FedProx: Federated Optimization with Proximal Terms
- SCAFFOLD: Stochastic Controlled Averaging
- RSC: Representation Self-Challenging
- ACFL: Our Proposed Adversarial Contrastive Method
-
📊 Three Dataset Support for Non-IID Scenarios:
- PACS: A domain generalization benchmark with 7 categories across 4 domains (Photo, Art, Cartoon, Sketch)
- OfficeHome: 65 categories across 4 diverse domains for domain adaptation
- TerraInc: Wildlife recognition dataset with 10 categories demonstrating real-world distribution shifts
-
🌈 Web Interface: Easy-to-use GUI for:
- Model training configuration
- real time gpu/cpu/memory monitor
- Real-time training visualization
- TensorBoard log management
-
📈 Non-IID Feature Distribution Bias:
- Handles domain shift challenges
- Addresses feature distribution skew
- Supports cross-domain generalization
-
🛠️ Easy Deployment: Simple setup and configuration
# Core Dependencies
torch==1.11.0
torchvision==0.12.0
flask==2.0.1
tensorboard==2.11.0- Create directories for log files
- Update dataset paths in
configs/default.py:datasetpathpacs_pathofficehome_pathterrainc_path
log_count_path
| Dataset | Description | Link |
|---|---|---|
| PACS | Domain Generalization | Download |
| OfficeHome | Domain Adaptation | Download |
| TerraInc | Wildlife Recognition | Download |
You can refer to the run command in the run.sh file for startup.
# Start training/testing
sh run.shOr use this simple app to start and log for visualization.
# Start the web server
python app.pyThen open your browser and visit: http://localhost:5000
- 🎯 Training Configuration
- Dataset selection
- Model parameter adjustment
- Training progress monitoring
- real time gpu/cpu/memory monitor
- 📊 TensorBoard Integration
- Real-time metrics visualization
- Log management
- Performance analysis
This project has benefited from the following excellent resources:
@article{liang2024acfl,
title={ACFL: Communication-Efficient adversarial contrastive federated learning for medical image segmentation},
author={Liang, Zhiwei and Zhao, Kui and Liang, Gang and Wu, Yifei and Guo, Jinxi},
journal={Knowledge-Based Systems},
volume={304},
pages={112516},
year={2024},
publisher={Elsevier}
}This project is licensed under the MIT License - see the LICENSE file for details.