FCN代码及效果展示

1. 代码获取

代码地址: https://github.com/Le0v1n/ml_code/tree/main/Segmentation/FCN

2. 从头开始训练

2.1 测试平台

  • GPU:NVIDIA RTX 3070
  • CPU: Intel I5-10400F
  • RAM: 16GB
  • OS: Windows 11
  • Dataset: VOC2012
  • Class num: 21(20+1)
  • Batch size: 4
  • Learning Rate: 0.1
  • Epoch: 35

2.2 结果

[epoch: 35]
train_loss: 2.1653
lr: 0.073090
global correct: 73.2
average row correct: ['94.7', '43.9', '0.0', '0.1', '0.6', '0.0', '10.3', '4.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '2.0', '55.5', '0.0', '7.3', '0.1', '11.1', '0.9']
IoU: ['77.1', '18.3', '0.0', '0.1', '0.6', '0.0', '8.3', '3.7', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '1.9', '23.0', '0.0', '6.6', '0.1', '8.1', '0.8']
mean IoU: 7.1

自己的机器跑VOC确实有点慢,跑了35个就停了,感觉不怎么好训练。

3. 预训练

确切来说就是一个简单的断点续训

3.1 测试平台

  • GPU:NVIDIA RTX 3070
  • CPU: Intel I5-10400F
  • RAM: 16GB
  • OS: Windows 11
  • Dataset: VOC2012
  • Class num: 21(20+1)
  • Batch size: 4
  • Learning Rate: 0.0001
  • Epoch: 3

3.2 结果

[epoch: 0]
train_loss: 1.0305
lr: 0.000100
global correct: 92.9
average row correct: ['96.1', '90.7', '77.2', '83.4', '73.8', '61.4', '94.0', '82.9', '94.5', '61.6', '61.1', '67.4', '81.5', '88.6', '88.5', '94.8', '70.6', '86.4', '69.0', '91.8', '80.6']
IoU: ['93.0', '84.3', '38.2', '77.9', '66.1', '57.5', '88.6', '74.3', '77.4', '39.9', '59.5', '53.6', '67.6', '70.9', '76.9', '86.4', '55.5', '69.2', '48.8', '83.8', '72.4']
mean IoU: 68.7

[epoch: 1]
train_loss: 0.8678
lr: 0.000054
global correct: 92.7
average row correct: ['96.3', '87.2', '78.1', '82.4', '76.3', '74.9', '90.8', '84.7', '94.7', '59.5', '58.5', '67.1', '79.5', '73.4', '84.3', '94.5', '76.8', '81.8', '71.3', '84.5', '87.0']
IoU: ['93.0', '83.9', '38.4', '77.6', '67.2', '65.5', '85.1', '75.0', '75.9', '40.3', '54.5', '53.8', '62.3', '66.5', '76.8', '87.0', '56.3', '67.0', '49.7', '79.2', '67.4']
mean IoU: 67.7

[epoch: 2]
train_loss: 0.7631
lr: 0.000000
global correct: 93.0
average row correct: ['96.5', '90.7', '76.9', '73.4', '77.2', '78.9', '85.7', '84.2', '93.8', '58.0', '74.6', '67.0', '82.8', '63.5', '88.0', '94.8', '71.3', '85.2', '71.5', '87.1', '88.0']
IoU: ['93.2', '85.3', '38.8', '71.2', '68.4', '67.6', '83.0', '76.2', '79.1', '40.7', '63.4', '54.6', '67.3', '60.7', '78.3', '86.9', '57.4', '66.0', '50.3', '79.6', '69.0']
mean IoU: 68.4

4. 测试效果图展示

4.1 飞机

FCN代码及效果展示_第1张图片

4.2 人物

FCN代码及效果展示_第2张图片

4.3 街道中的人

FCN代码及效果展示_第3张图片

4.4 盆栽

FCN代码及效果展示_第4张图片

5. 总结

从测试效果图可以看到,FCN网络的效果还是不错的,但从头开始训练需要进一步训练,目前欠拟合比较严重,和PyTorch官方提供的权重文件效果差距很大!

你可能感兴趣的:(深度学习,PyTorch,语义分割,深度学习,pytorch,python)