I am quite confused about how to do multi-task training.
For example, I got a picture with an animal, I want to get four kinds of output:

Length of Nose / invisible, long, middle, short
Length of Tail / invisible, long, middle, short, no tail
Length of Hand / invisible, long, middle, short
Length of Leg / invisible, long, middle, short

What should I do, if I use ResNet pre-trained model, and do the 4-tasks classify in one network. The Struct like this:

image.jpg1726×580 97.3 KB

I search in google, but I can only get links as follow, but it does not work.

  
    
    
    Triplet vs Cross entropy loss for multi-label classification vision
  
  
    Hi, this is a general question about multi-label classification I have been thinking about: 
Multi-label classification for < 200 labels can be done in many ways, but here I consider two options: 


CNN (e.g. Resnet, VGG) + Cross entropy loss, the traditional approach, the final layer contains the same number of nodes as there are labels. Samples are taken randomly and compared to the known labels. 


CNN (e.g. Resnet, VGG) + Triplet loss, where the final layer is a “feature vector”. In the end …
  



  
    
    
    Multi Label Classification in pytorch 
  
  
    Let’s take ResNet finetuning as an example: 
class ResNet50(nn.Module):
    def __init__(self, num_classes):
        super(ResNet50, self).__init__()
        
        # Loading ResNet arch from PyTorch
        original_model = models.resnet50(pretrained=True)
        
        # Everything except the last linear layer
        self.features = nn.Sequential(*list(original_model.children())[:-1])
        
        # Get number of features of last layer
        num_feats = original_model.fc.in_feature…