Giter VIP home page Giter VIP logo

fedcl's Introduction

FedCL: Federated Contrastive Learning for Multi-center Medical Image Classification

This is the code for paper FedCL: Federated Contrastive Learning for Multi-center Medical Image Classification.

Abstract: Federated learning, which allows distributed medical institutions to train a shared deep learning model with privacy protection, has become increasingly popular recently. However, in practical application, due to data heterogeneity between different hospitals, the performance of the model will be degraded in the training process. In this paper, we propose a federated contrastive learning (FedCL) approach. FedCL integrates the idea of contrastive learning into the federated learning framework. Specifically, it combines the local model and the global model for contrastive learning, so that the local model gradually approaches the global model with the increase of communication rounds, which improves the generalization ability of the model. We validate our method on two public datasets. Extensive experiments show that our method is superior to other federated learning algorithms in medical image classification.

Keywords: Federated Learning, Contrastive Learning, Image Classification.

Dependencies

  • python >= 3.6.13
  • PyTorch >= 1.8.1
  • torchvision >= 0.8.2

Parameters

Parameter Description
model neural network used in training.
batch_size batch_size per gpu.
drop_rate dropout rate.
base_lr maximum epoch number to train.
seed random seed.
gpu GPU to use.
local_ep local epoch.
num_users numbers of users.
rounds communication rounds.
num_workers num_workers.
mu the mu parameter for Contrastive loss.
temperature the temperature parameter for contrastive loss.
out_dim the output dimension for the projection layer.

Datasets

You can download the dataset for Task 1: Skin disease classification in here and Task 2: COVID-19 detection in here.

Usage

Here is an example to run the model FedCL.

python train_main.py --model=densenet121 \
  --batch_size=8 \
  --base_lr=1e-4 \
  --local_ep=1 \
  --num_users=1 \
  --rounds=200 \
  --num_workers=8 \
  --mu=1 \
  --temperature=0.5 \

Citation

Please cite our paper if you find this code useful for your research.

@article{Wu2023FedCLFC,
  title={FedCL: Federated Contrastive Learning for Multi-center Medical Image Classification},
  author={Zhenbing Liu and Fengfeng Wu and Yumeng Wang and Mengyu Yang and Xipeng Pan},
  journal={Pattern Recognit.},
  volume={143},
  year={2023},
  pages={109739}
}

fedcl's People

Contributors

sulley-boo avatar

Stargazers

 avatar 朗姆酒 avatar  avatar Shi Yukun avatar  avatar leo1 avatar  avatar  avatar Yuxi Zhou avatar Seouk avatar  avatar Shiina_Mashiro                  avatar Yanlin Fei avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

fedcl's Issues

分布问题

我看论文划分客服端数据集符合迪利克雷分布,好像实现的代码是随机划分!可否提供划分后的数据集

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.