Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一些关于分割任务的记录 #25

Open
ghost opened this issue Dec 13, 2018 · 5 comments
Open

一些关于分割任务的记录 #25

ghost opened this issue Dec 13, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 13, 2018

No description provided.

@lartpang
Copy link
Owner

lartpang commented Dec 15, 2018

FCN中deconv是初始化与前面的conv不同么?

        for m in self.modules():
            if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear):
                m.weight.data.normal_(0.0, 0.01)
                m.bias.data.fill_(0)
            if isinstance(m, nn.ConvTranspose2d):
                assert m.kernel_size[0] == m.kernel_size[1]
                initial_weight = get_upsampling_weight(
                    m.in_channels, m.out_channels, m.kernel_size[0])
                m.weight.data.copy_(initial_weight)

学姐的代码里这里的对于转置卷积的初始化操作有些特别, 不太理解。

def get_upsampling_weight(in_channels, out_channels, kernel_size):
    """Make a 2D bilinear kernel suitable for upsampling"""
    factor = (kernel_size + 1) // 2
    if kernel_size % 2 == 1:
        center = factor - 1
    else:
        center = factor - 0.5
    og = np.ogrid[:kernel_size, :kernel_size]
    filt = (1 - abs(og[0] - center) / factor) * \
           (1 - abs(og[1] - center) / factor)
    weight = np.zeros((in_channels, out_channels, kernel_size, kernel_size),
                      dtype=np.float64)
    weight[range(in_channels), range(out_channels), :, :] = filt
    return torch.from_numpy(weight).float()

我们将2x上采样初始化为双线性插值, 但允许按照3.3节所述学习参数( We initialize the upsampling tobilinear interpolation, but allow the parameters to be learnedas described in Section 3.3.)

这里使用的双线性插值的方式来进行的初始化.

@lartpang
Copy link
Owner

从某种意义上,伴随因子f的上采样是对步长为1/f的分数式输入的卷积操作。只要f是整数,一种自然的方法进行上采样就是向后卷积(有时称为去卷积)伴随输出步长为f。这样的操作实现是不重要的,因为它只是简单的调换了卷积的顺推法和逆推法。所以上采样在网内通过计算像素级别的损失的反向传播用于端到端的学习。

需要注意的是去卷积滤波在这种层面上不需要被固定不变(比如双线性上采样)但是可以被学习。一堆反褶积层和激励函数甚至能学习一种非线性上采样。在我们的实验中,我们发现在网内的上采样对于学习dense prediction是快速且有效的

@lartpang lartpang pinned this issue Dec 15, 2018
@ghost
Copy link
Author

ghost commented Dec 20, 2018

可以从最近的相关的论文中了解过去这些年的语义分割方法的发展历史.

https://www.groundai.com/project/pyramid-attention-network-for-semantic-segmentation/#section_3

@ghost
Copy link
Author

ghost commented Dec 20, 2018

总结:

  • 语义分割体系结构的另一个重要方面是使用学习好的deconvolutions对低分辨率分割图进行特征图上采样以获得输入图像分辨率的机制,或者在编码器中使用以计算为代价的扩张卷积来避免部分的分辨率下降。即使在现代GPU上,扩张卷积(Dilated convolutions )也非常昂贵。
    • 这篇关于distill.pub的文章解释了有关反卷积的更多细节。

不同的网络如何实现上采样

  • FCN 双线性插值初始化(虽然还不理解), 分数卷积实现上采样, 这个应该就是转置卷积.
  • SegNet 使用对应的最大值索引进行恢复, 变成稀疏的特征图, 再利用后接的卷积实现进一步的密集化 [unpooling]
    • 虽然这有助于保持高频信息的完整性,但是当从低分辨率特征图中unpooling时,它也会错过相邻的信息。
  • Deeplab 通过空洞卷积的组合来恢复全分辨率的特征映射,这种方法计算的特征映射更加密集,然后简单地对特征的响应进行双线性插值恢复到原始图像大小
  • U‐Net 2x2卷积外围补零, 实现的上采样
    • 通过其跳过concatenation连接的架构允许每个阶段的解码器学习在编码器中池化时丢失的相关特征。
  • RefineNet 上采样是在Multi-resolution fusion单元完成的, 这里感觉更像是使用的双线性插值
  • PSPNet 双线性插值直接对低维特征映射进行上采样,以获得与原始特征图相同的大小特征, 最后,不同级别的特征被连接为最终的金字塔池化全局特征。
    • image
  • Mask‐RCNN 不需要上采样, 因为它是基于Faster R-CNN的, 所有预测的结果都是针对于原始图像大小的.
  • Efficient Sub-Pixel Convolutional Neural Network: 亚像素卷积,
    • image
  • Decoders Matter for Semantic Segmentation:Data-Dependent Decoding Enables Flexible Feature Aggregation: DUpsample
    • image

@ghost
Copy link
Author

ghost commented Dec 21, 2018

条件随机场

image

image

image

image

image

image

image

image

image

image

维特比算法

维特比算法是基于当前所有存在的要考虑的节点中的最优子路径, 计算寻找出到达下一批节点的最优路径(每个下一批次的节点都有一个对应的最有结果).

image

最后总的从结果中取最优的路径.

这个算法在log-model, MEMMs, CRFs中都起到关键作用

@lartpang lartpang changed the title 阅读计划-图像分割 阅读计划 Mar 2, 2019
@lartpang lartpang changed the title 阅读计划 阅读计划-分割 Mar 2, 2019
@lartpang lartpang added the List Paper List label Mar 2, 2019
@lartpang lartpang unpinned this issue Mar 2, 2019
Repository owner deleted a comment Sep 14, 2019
@lartpang lartpang changed the title 阅读计划-分割 一些关于分割任务的记录 Sep 14, 2019
@lartpang lartpang removed the List Paper List label Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant