I have used fcn8s model with vgg backbone for image segmentation task on the pascal VOC 2012 dataset but after training the model I am unable to get the desired results of segmentation. I have used this link

  
      github.com
  
  
    pochih/FCN-pytorch/blob/master/python/fcn.py 3
# -*- coding: utf-8 -*-

from __future__ import print_function

import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import models
from torchvision.models.vgg import VGG


class FCN32s(nn.Module):

    def __init__(self, pretrained_net, n_class):
        super().__init__()
        self.n_class = n_class
        self.pretrained_net = pretrained_net
        self.relu    = nn.ReLU(inplace=True)
        self.deconv1 = nn.ConvTranspose2d(512, 512, kernel_size=3, stride=2, padding=1, dilation=1, output_padding=1)
        self.bn1     = nn.BatchNorm2d(512)


  This file has been truncated. show original

  
  
    
    
  
  


for making the fcn model with the dataset that is available on torchvision.datasets

Screenshot_2020-04-19_12:11:371366×768 229 KB

These are some of the screenshots of my project. I couldn’t figure out where the problem is since the model has minimal loss but the segmentation is not working as I have wished.