分割网络中的激活函数和度量计算
我有一个二进制分割任务:我必须预测图像的每个像素是或否。
因此,我使用二元交叉熵损失(在 Pytorch 中定义并结合了 sigmoid 和交叉熵损失)来训练网络。
为了计算指标,由于我需要每个像素的输出为 0 和 1,因此我使用了 sigmoid 函数,然后将所有小于 0.5 的数据视为 0,将所有大于 0.5 的数据视为 1。
但是我认为这种方法是不正确的,我应该使用像softmax这样的东西。您能解释一下我应该遵循什么方法以及为什么吗?
I had a binary segmentation task: I had to predict yes or no for each pixel of an image.
Therefore I used a binary cross entropy loss (which is defined in Pytorch and combines a sigmoid and a cross entropy loss) to train the network.
To compute the metrics, since I needed an output of 0 and 1 for each pixel, I used the sigmoid function and then consider everything smaller than 0.5 as 0 and everything bigger than 0.5 as 1.
However I think this approach is not correct and I should have used something like a softmax. Could you explain what approach I should have followed and why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论