I refer to the model in the paper ‘Deep Learning for the Classification of Lung Nodules’ 7.
The model is like this:
    def forward(self, input_image):
        # (channels, height, width)
        ##
        out = self.conv_1(input_image) # 20 * 44 * 44
        out = self.bn_conv_1(out)

        out = self.pooling_1(out) # 20 * 22 * 22
        out = self.bn_pooling_1(out)

        ##
        out = self.conv_2(out) # 50 * 16 * 16
        out = self.bn_conv_2(out)

        out = self.pooling_2(out) # 50 * 8 * 8
        out = self.bn_pooling_2(out)

        ##
        out = self.conv_3(out) # 500 * 2 * 2
        out = self.bn_conv_3(out)

        out = self.pooling_3(out) # 500 * 1 * 1
        out = self.bn_pooling_3(out)

        out = F.relu(out)
        out = self.conv_4(out) # 2 * 1 * 1

        out = F.softmax(out)

My doubt is that:


This is a binary classification model, but the output has two nodes.
(Generally, there is only one output node in the binary classification model, and the prediction result is judged by greater than or less than 0.5.)


Although I don’t know if this is a key consideration, there is no fully connected layer in the model.


Considering the above, how should I design the code for the loss function?