<p>Your kind of task belongs to dense classification tasks, e.g. segmentation. In those tasks, we use fully convolution nets (see <a href="https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf" rel="nofollow noreferrer">here</a> for the original paper). In the FCNs you don't have any fully-connected layers, because when applying fully-connected layers you lose spatial information which you need for the dense prediction. Also have a look at the <a href="https://arxiv.org/pdf/1505.04597.pdf" rel="nofollow noreferrer">U-Net paper</a>. All state-of-the art architectures use some kind of encoder-decoder architecture extended for example with a pyramid pooling module.</p>

<p>There are some implementations in the pytorch model zoo <a href="https://pytorch.org/docs/stable/torchvision/models.html#semantic-segmentation" rel="nofollow noreferrer">here</a>. Search also Github for pytorch implementations for other networks.</p>
Resolution preserving Fully Convolutional Network
<p>I am new to ML and Pytorch and I have the following problem:</p>

<p>I am looking for a Fully Convolutional Network architecture in Pytorch, so that the input would be an RGB image (HxWxC or 480x640x3) and the output would be a single channel image (HxW or 480x640). In other words, I am looking for a network that will preserve the resolution of the input (HxW), and will loose the channel dimension. All of the networks that I've came across (ResNet, Densenet, ...) end with a fully connected layer (without any upsampling or deconvolution). This is problematic for two reasons:</p>

<ol>
<li>I am restricted with the choice of the input size (HxWxC).</li>
<li>It has nothing to do with the output that I expect to get (a single channel image HxW).</li>
</ol>

<p>What am I missing? Why is there even a FC layer? Why is there no up-sampling, or  some deconvolution layers after feature extraction? Is there any build-in torchvision.model that might suit my requirements? Where can I find such pytorch architecture? As I said, I am new in this field so I don't really like the idea of building such a network from scratch.</p>

<p>Thanks.</p>