前言
本文是基于pytorch_unet训练多类别数据集的分割,并完成测试;
操作步骤:
问题:
1. 数据集的mask部分标签类别不正确;
原因:
制作标签的时候保存的图像标签文件时jpg,因为jpg格式会在存储时对图像进行压缩,导致mask图像不准确。
所以,保存标签mask图像的时候一定要注意保存为png格式的标签图像。
2. 分割的结果类别标签全部为0;
原因:这个原因有很多种;
1)数据集的标签信息或者图像预处理过程有问题;
2)损失函数选取不合适;比如如果数据集中背景占比多,目标占比很少,就不能简单使用交叉熵损失函数,交叉熵损失函数容易受到类别不平衡影响;
等等。。。。
参考
2. UNet/UNet++多类别分割;
完