- 文章转自微信公众号:机器学习炼丹术
- 笔记:陈亦新
- 参考文章:Unsupervised Learning of Diffeomorphic Image Registration via TransMorph
- 参考代码:bit.ly/3EtYUFN.
文章贡献:新的配准方法,性能更好。
background on LDDMM
可以看到,其实就是类似voxelmorph的损失函数,前者是速度场的约束,后者是MSE或者NCC这样的损失函数。当然上面公式中应该是MSE的样式。
methods
【第一个贡献看起来是把backbone换成了swin transformer】 【第二个贡献看起来是让label也计算损失】
就是source image和target image都需要有label分割标签。
最终的loss就是这个样子:
其实他是这样描述的:
但是我并不知道这个非常常见的loss function有什么可说的,几年前的配准模型就是这个设计?
他的大致的解释为:发现过度的施加正则化,可能会导致图像过于像素,或者分割重叠测量的次优配准精度(简单说就是性能下降)。在这里,我们证明了通过积分速度场,我们可以隐式的增强变换的平滑性和性能。所以他们使用diffusion regularizer来仅仅约束end-point的velocity field。
我的重点
我要从文章张学习的是如何评测配准结果,用什么指标。
【SSIM】
- structural similarity index measure
- 衡量两张图像像素程度的指标。
- l:亮度比较,
- c:对比度比较,
- s:结构比较,
- 就是,均值、协方差、方差来计算的。
- 取值范围为-1到1.
from skimage.metrics import structural_similarity as ssim
ssim(img1,img2,multichannel=True)
【FSIM】 参考代码:mikhailiuk/pytorch-fsim: Differentiable implementation of the Feature Similarity Index Measure in Pytorch (github.com) 【DICE】
【SDlogJ】
- standard deviation of the logarithmic Jacobian
- 用来衡量变形场的合理性
def Get_Jac(displacement):
'''
the expected input: displacement of shape(batch, H, W, D, channel),
obtained in TensorFlow.
'''
D_y = (displacement[:,1:,:-1,:-1,:] - displacement[:,:-1,:-1,:-1,:])
D_x = (displacement[:,:-1,1:,:-1,:] - displacement[:,:-1,:-1,:-1,:])
D_z = (displacement[:,:-1,:-1,1:,:] - displacement[:,:-1,:-1,:-1,:])
D1 = (D_x[...,0]+1)*((D_y[...,1]+1)*(D_z[...,2]+1) - D_y[...,2]*D_z[...,1])
D2 = (D_x[...,1])*(D_y[...,0]*(D_z[...,2]+1) - D_y[...,2]*D_z[...,0])
D3 = (D_x[...,2])*(D_y[...,0]*D_z[...,1] - (D_y[...,1]+1)*D_z[...,0])
D = D1 - D2 + D3
return D
- 雅各比矩阵的log的标准差