《FKD-Med 》论文与代码结构分析

本文介绍了一种名为FKD-Med的项目,它利用联邦学习和模型轻量化技术进行隐私保护的医疗图像分割。项目基于U-Net模型,使用Chest-Xray和CVC-ClinicDB数据集,并提供了联邦训练和知识蒸馏的详细指令。

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点点小星星⭐

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值