Mid_channels in U2NET

Hi, Doing Depth Estimation Task with U2NET.

I read the Paper but still don’t get it.

What are the mid_channels? why they use it?
and why they use that in every conv Layer after first Conv.

class RSU7(nn.Module):#UNet07DRES(nn.Module):

    def __init__(self, in_ch=3, mid_ch=12, out_ch=3):
        super(RSU7,self).__init__()

        self.rebnconvin = REBNCONV(in_ch,out_ch,dirate=1)

        self.rebnconv1 = REBNCONV(out_ch,mid_ch,dirate=1)
        self.pool1 = nn.MaxPool2d(2,stride=2,ceil_mode=True)

        self.rebnconv2 = REBNCONV(mid_ch,mid_ch,dirate=1)
        self.pool2 = nn.MaxPool2d(2,stride=2,ceil_mode=True)

I don’t know what is mentioned in the paper, but based on the posted code snippet it seems to be an architecture choice which would simplify the model creation by defining the input, mid, and output channels only.

1 Like

Yes, makes sense.

Thanks for your reply.