Regarding Multi-label transfer learning with googlenet

B
Balakrishnan_rajan · May 25, 2021 · 2K views
Question
I have a dataset with pictures with presence of objects of different classes. I want to perform a multilabel classification, which means I need to classify the pictures into different classes with the picture belonging to more than one class at the same time. That is, for pictures with objects of type A and type B, the net should output both the labels A and B.   If I am designing a  CNN for this from scratch, I will have a sigmoid activation at the last layer. The number of output neurons will be equal to the number of classes with the output of each neuron giving 1 if the picture belongs to the particular class or 0 if not. However, there seems to be no provision for adding a sigmoid function and the Image datastore cannot hold binary vectors as the label. How do I overcome this?
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Nov 20, 2025
We do not support sigmoid activation. You can use the softmax activation function. You don't need to define the neurons in the softmaxLayer. Define the no of neurons (= no of classes) you want in the fullyConnectedLayer. So, your network structure would be like:
 
inputLayer -- -- fullyConnectedLayer softmaxLayer ClassificationLayer
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!