FKD-Med
目前已在IEEE2024出版,Paper地址FKD-Med.
代码地址FKD-Med.
感谢大家点一点Star⭐

以下是原代码Readme.md:
FKD-Med: Privacy-Aware, Communication-Optimized Medical Image Segmentation via Federated Learning and Model Lightweighting through Knowledge Distillation
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
FKD-Med Framework
Overview
This repository contains code for training and testing U-Net for image semantic segmentation tasks. It contains both traditional and Federated Traning using the FedAvg algorithm in the Flower framework.
All operations of the user are done in this directory

Getting Datastes
CVC-ClinicDB Datasets
https://paperswithcode.com/dataset/cvc-clinicdb
Chest Xray Masks and Labels Datasets
https://www.kaggle.com/datasets/nikhilpandey360/chest-xray-masks-and-labels
Framework
Model
In the /model/Unet_model,training on different Unet models,
Loss
In the Loss.py,choosing different loss functions for training
Dataset
In the DataSet.py,selecting different medical data for training
使用了Chest-Xray胸片数据集和CVC-ClinicDB数据集。
Unified Unet Commands(CVC-ClinicDB)
The model is customized in the command line for the reader to choose from
python3 train.py --client client1 --cuda cuda1 --model resUnet --num_epochs 50 --dataset CVC --picFormat .tif
python3 train.py --client client2 --cuda cuda2 --model resUnet --num_epochs 50 --dataset CVC --picFormat .tif
python3 train.py --client client3 --cuda cuda3 --model resUnet --num_epochs 50 --dataset CVC --picFormat .tif
Unified Unet Commands(Chest Xray)
The model is customized in the command line for the reader to choose from
python3 train.py --client client1 --cuda cuda1 --model resUnet --num_epochs 50 --dataset Chest --picFormat .png
python3 train.py --client client2 --cuda cuda2 --model resUnet --num_epochs 50 --dataset Chest --picFormat .png
python3 train.py --client client3 --cuda cuda3 --model resUnet --num_epochs 50 --dataset Chest --picFormat .png
联邦实验中,使用Flwr模拟联邦环境,需要打开4个终端Terminal

Federated Train Commands(CVC-ClinicDB)
python3 server.py
python3 client.py --client client1 --cuda cuda1 --model resUnet --num_epochs 10 --dataset CVC --picFormat .tif
python3 client.py --client client2 --cuda cuda2 --model resUnet --num_epochs 10 --dataset CVC --picFormat .tif
python3 client.py --client client3 --cuda cuda3 --model resUnet --num_epochs 10 --dataset CVC --picFormat .tif
Federated Train Commands(Chest Xray)
python3 server.py
python3 client.py --client client1 --cuda cuda1 --model resUnet --num_epochs 10 --dataset Chest --picFormat .png
python3 client.py --client client2 --cuda cuda2 --model resUnet --num_epochs 10 --dataset Chest --picFormat .png
python3 client.py --client client3 --cuda cuda3 --model resUnet --num_epochs 10 --dataset Chest --picFormat .png
FedKD Train Commands
Teacher Modeling Training Prior to Federal Learning
The teacher model has been trained in the train.py file according to client,line 202,weights are found inside saved_models/ folder Eg.
torch.save(model.state_dict(),PATH)
The trained teacher model was used at line 129 of clientFKD.py
teacher.load_state_dict(torch.load(PATH))
Student Model Commands(CVC-ClinicDB)
python3 server.py
python3 clientFKD.py --client client1 --cuda cuda1 --model resUnet --num_epochs 10 --dataset CVC --picFormat .tif
python3 clientFKD.py --client client2 --cuda cuda2 --model resUnet --num_epochs 10 --dataset CVC --picFormat .tif
python3 clientFKD.py --client client3 --cuda cuda3 --model resUnet --num_epochs 10 --dataset CVC --picFormat .tif
实验结果图如下:

Student Model Commands(Chest Xray)
python3 server.py
python3 clientFKD.py --client client1 --cuda cuda1 --model resUnet --num_epochs 10 --dataset Chest --picFormat .png
python3 clientFKD.py --client client2 --cuda cuda2 --model resUnet --num_epochs 10 --dataset Chest --picFormat .png
python3 clientFKD.py --client client3 --cuda cuda3 --model resUnet --num_epochs 10 --dataset Chest --picFormat .png
实验结果图如下:
感谢各位阅读,如果有收获的话请前往Github点点小星星⭐
本文介绍了一种名为FKD-Med的项目,它利用联邦学习和模型轻量化技术进行隐私保护的医疗图像分割。项目基于U-Net模型,使用Chest-Xray和CVC-ClinicDB数据集,并提供了联邦训练和知识蒸馏的详细指令。


被折叠的 条评论
为什么被折叠?



