YangParky / BASeg

MIT License
7 stars 2 forks source link

Curious about the fusing step #2

Closed Billy-ZTB closed 3 months ago

Billy-ZTB commented 3 months ago

Hello! I have had the chance to read your paper and your code, your work is pretty innovative ! However, I have a question about your context aggregation module which according to your code, takes the f4 from resnet and edge from boundary stream as input. The parameter edge comming from Edge_Detection has the same height and width as f4, which has low spatial resolution. Would utilizing the low spatial resolution edge information lead to inaccuracy of the boundary of objects in images? If your input image is 256x256, the edge feature you are actually utilizing would be 33x33, it is quite blurry, I am curious about how this edge information is making contribution to the improvement of segmentaion eventually. Looking forward to your reply! 😊

YangParky commented 3 months ago

Hi, thanks for your interest in our work, I have reuploaded the baseg.py ~

The challenge lies in the scarcity of boundary information compared to body information. To fully utilize the available boundary data, we considering that boundary information contains long-range dependencies, thus adopt attention-based mechanism to guide context aggregation. The aggregated context is then interpolated to generate the segmentation.

Actually, after training our BASeg model, you'll see that it produces remarkably clear boundary segmentation~

Billy-ZTB commented 3 months ago

Thanks for your reply!

Billy-ZTB commented 3 months ago

您好,我还有一个问题想请教,我看到您的论文中用了多个损失函数,损失值都用weight来平衡他们的大小,这些weight怎样设置?比如说一个模型的总损失Loss = a LossA + b LossB, a和b的值是应该多做几次实验多试几次找到最好的组合还是根据LossA和LossB的来定?如果说在训练过程中发现lossA的值通常是LossB的20倍,是不是就得把b设为a的20倍来把这两个值放到同一个尺度?

YangParky commented 3 months ago

一般来说,多个目标不好同时优化。可以先加到同一数量级,然后根据各项Loss训练速度再调整权重;

对于两个相近的任务,你可以选择Loss = a Loss_a + (1-a) Loss_b;对于你这个任务,任务差异较大的情况下,可以尝试手动将Loss缩放到相似尺度,或者Loss = Loss_a / Loss_a.detach() + Loss_b / Loss_b.detach()使得每个Loss的贡献差不多。

Billy-ZTB commented 3 months ago

谢谢!我前段时间在做融合边界特征的网络,边界的二元交叉熵损失值在几千几万,语义分割的dice loss值是个位数,差距太离谱了😂,然后训练的效果就不太好。后来用了Loss = Loss_a / Loss_a.detach() + Loss_b / Loss_b.detach()这种方法就会好一些。

YangParky commented 3 months ago

谢谢!我前段时间在做融合边界特征的网络,边界的二元交叉熵损失值在几千几万,语义分割的dice loss值是个位数,差距太离谱了😂,然后训练的效果就不太好。后来用了Loss = Loss_a / Loss_a.detach() + Loss_b / Loss_b.detach()这种方法就会好一些。

你这个有点奇怪。按理来说,边界的损失数值上应该是要比语义分割要小一些,因为包含的信息更稀疏。建议检查一下边界的标签值和该网络所做任务的输出,BASeg的边界损失值在不放大的情况下都只有零点几~

Billy-ZTB commented 3 months ago

好的好的,谢谢!

---- 回复的原邮件 ---- | 发件人 | Yang @.> | | 日期 | 2024年04月18日 21:23 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [YangParky/BASeg] Curious about the fusing step (Issue #2) |

谢谢!我前段时间在做融合边界特征的网络,边界的二元交叉熵损失值在几千几万,语义分割的dice loss值是个位数,差距太离谱了😂,然后训练的效果就不太好。后来用了Loss = Loss_a / Loss_a.detach() + Loss_b / Loss_b.detach()这种方法就会好一些。

你这个有点奇怪。按理来说,边界的损失数值上应该是要比语义分割要小一些,因为包含的信息更稀疏。建议检查一下边界的标签值和该网络所做任务的输出,BASeg的边界损失值在不放大的情况下都只有零点几~

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Billy-ZTB commented 2 months ago

您好,我想运行一下您的代码,请问如果在cityscapes数据集上训练的话可以用单卡吗?我看到您在readme中写的需求是4到8卡。

还有一个问题想请教,就是同一个模型在不同的数据集上效果的提升差异会很大吗?我把其他论文中添加边界检测分支,融合边界信息的方法用在我的模型上试了试,但是效果与Deeplab相比没有提升。我用的是一个遥感数据集,会不会是那些模型在这个数据集上无效呢?

YangParky commented 2 months ago

您好,我想运行一下您的代码,请问如果在cityscapes数据集上训练的话可以用单卡吗?我看到您在readme中写的需求是4到8卡。

还有一个问题想请教,就是同一个模型在不同的数据集上效果的提升差异会很大吗?我把其他论文中添加边界检测分支,融合边界信息的方法用在我的模型上试了试,但是效果与Deeplab相比没有提升。我用的是一个遥感数据集,会不会是那些模型在这个数据集上无效呢?

1、cityscape数据集虽然不大,但由于任务是dense prediction,对GPU显存要求其实还是蛮大的。如果你是单卡的话,推荐至少32G显存的卡,如V100,A100,显存小了效果不会很好; 2、直接移植其他工作的方法,可能不一定适用于自己的模型。一些方法可能已经在自己的数据集上调最优,或者两者任务甚至数据集差异较大,方法也不一定work。在计算资源紧张的情况下,建议你结合自己的数据集和任务,多调研相关的方法~

Billy-ZTB commented 2 months ago

好的,谢谢!

---- 回复的原邮件 ---- | 发件人 | Yang @.> | | 日期 | 2024年04月22日 18:15 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [YangParky/BASeg] Curious about the fusing step (Issue #2) |

您好,我想运行一下您的代码,请问如果在cityscapes数据集上训练的话可以用单卡吗?我看到您在readme中写的需求是4到8卡。

还有一个问题想请教,就是同一个模型在不同的数据集上效果的提升差异会很大吗?我把其他论文中添加边界检测分支,融合边界信息的方法用在我的模型上试了试,但是效果与Deeplab相比没有提升。我用的是一个遥感数据集,会不会是那些模型在这个数据集上无效呢?

1、cityscape数据集虽然不大,但由于任务是dense prediction,对GPU显存要求其实还是蛮大的。如果你是单卡的话,推荐至少32G显存的卡,如V100,A100,显存小了效果不会很好; 2、直接移植其他工作的方法,可能不一定适用于自己的模型。一些方法可能已经在自己的数据集上调最优,或者两者任务甚至数据集差异较大,方法也不一定work。在计算资源紧张的情况下,建议你结合自己的数据集和任务,多调研相关的方法~

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Billy-ZTB commented 1 month ago

您好!我还有个问题想问,就是在context aggregation module里,Q和K是从aspp输出的特征计算得到的,V是从边界计算得到的,为什么这样设计?K可以从边界生成吗?