Improving Nuclei/Gland Instance Segmentation in Histopathology Images by Full Resolution...论文源码笔记

该博客介绍了在病理组织图像中改进核/腺体实例分割的深度学习方法。通过对预测结果应用加权交叉熵和实例内部方差损失,以及在GlaS数据集上的应用,提高了分割精度。测试过程包括模型预测、后处理、连通区域标记和F1分数计算。训练阶段涉及数据加载、模型训练以及使用重叠裁剪策略来处理验证集图像。
摘要由CSDN通过智能技术生成

创新点:
softmax之后预测结果的形状为(b,3,208,208)
损失函数=加权的交叉熵+预测结果的实例内部方差(每通道方差求和。共3通道)
数据集:GlaS
输入:
在这里插入图片描述
Ternary label:inside、contours、background标记出来
Weighted map:通过matlab代码得到

test.py内容
1.定义和加载训练好的模型

# define model
model = FullNet(opt.model['in_c'], opt.model['out_c'], n_layers=opt.model['n_layers'],
                growth_rate=opt.model['growth_rate'], drop_rate=opt.model['drop_rate'],
                dilations=opt.model['dilations'], is_hybrid=opt.model['is_hybrid'],
                compress_ratio=opt.model['compress_ratio'], layer_type=opt.model['layer_type'])
model = torch.nn.DataParallel(model).cuda()
# ----- load trained model ----- #
print("=> loading trained model")
best_checkpoint = torch.load(model_path)
model.load_state_dict(best_checkpoint['state_dict'])
print("=> loaded model at epoch {}".format(best_checkpoint['epoch']))
model = model.module

2.读入测试图像并transform,得到图像input 大小(1,3,208,208)

for img_name in img_names:
	# load test image
	print('=> Processing image {:s}'.format(img_name))
	img_path = '{:s}/{:s}'.format(img_dir, img_name)
	img = Image.open(img_path)
	ori_h = img.size[1]
	ori_w = img.size[0]
	name = os.path.splitext(img_name)[0]
	if eval_flag:
	    if opt.dataset == 'MultiOrgan'</
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值