0
$\begingroup$

If I am building a model where I need to predict the vehicle, color of it, and make of it, then can I use all the labels for a single image and build my model around it.

Like for a single image of a vehicle which is a car (car1.jpg) will have labels like - Sedan(Make), Blue(Color) and Car(Type of vehicle). Can I make a single model for this or I will have to make 3 separate models for this problem.

$\endgroup$

1 Answer 1

1
$\begingroup$

One model will work in this case. Lets put it this way, let's say we are trying to solve multi-class(lets say 5) classification problem in neural networks we will have 5 neurons in the final dense layer and ideally use softmax as activation function and categorical_crossentrophy as loss function. Now coming back to multi-label classification lets take an example: Your car1 has labels like Sedan,Blue,and Type(Good). Your car2 has labels like SUV,Black, and type(Bad). You will these many neurons in your final layer lets say here we have 6 different types of labels for 2 cars, and we do one hot encoding for the target variables.

The difference is we use sigmoid and binary_crossentrophy as activation and loss functions. This will give probabilities of the labels for which each image belong to. Any questions, please post.

$\endgroup$
1
  • $\begingroup$ Adrian Rosebrock explains it well on his blog. It comes with code as well. $\endgroup$ Dec 13, 2019 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.