Skip to content

HS991023/ACFL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 ACFL - Adversarial Contrastive Federated Learning

Python PyTorch License

ACFL Framework

πŸ“– Overview

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.

πŸš€ Features

  • πŸ”₯ 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 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

πŸ”§ Requirements

# Core Dependencies
torch==1.11.0
torchvision==0.12.0
flask==2.0.1
tensorboard==2.11.0

πŸ“‚ Dataset Preparation

  1. Create directories for log files
  2. Update dataset paths in configs/default.py:
    • datasetpath
      • pacs_path
      • officehome_path
      • terrainc_path
    • log_count_path

Download Official Datasets:

Dataset Description Link
PACS Domain Generalization Download
OfficeHome Domain Adaptation Download
TerraInc Wildlife Recognition Download

πŸ’» Usage

Command Line Interface

You can refer to the run command in the run.sh file for startup.

# Start training/testing
sh run.sh

Web Interface

Or use this simple app to start and log for visualization.

# Start the web server
python app.py

Then open your browser and visit: http://localhost:5000

Web Interface Features:

  • 🎯 Training Configuration
    • Dataset selection
    • Model parameter adjustment
    • Training progress monitoring
  • πŸ“Š TensorBoard Integration
    • Real-time metrics visualization
    • Log management
    • Performance analysis

πŸŽ‰ Results Visualization

sample_start
Sample Start
tensorborad_vis1
Tensorborad Visualization
tensorborad_vis
Tensorborad Visualization

πŸ™ Acknowledgement

This project has benefited from the following excellent resources:

πŸ“ Citation

@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}
}

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.3%
  • HTML 10.2%
  • Shell 1.5%