paper:Boundary loss for highly unbalanced segmentation
Introduction
在医学图像分割中任务中通常存在严重的类别不平衡问题,目标前景区域的大小常常比背景区域小几个数量级,比如下图中前景区域比背景区域小500倍以上。 分割通常采用的交…
先给numpy版本的代码,注意 图片的 shape 都是(w, h)
# General util function to get the boundary of a binary mask.
# 该函数用于获取二进制 mask 的边界
def mask_to_boundary(mask, dilation_ratio0.02):"""Convert binary mask to boundary m…