1
$\begingroup$

I have a question about the possible outcome of a trained model. Imagine that I would like to classify 2 different models of Ferrari and the dataset of these 2 models is small (for example, a few hundred images per model).

In the Keras blog, the issue was discussed but in the example, they are classifying dogs and cats, 2 class that are very general, distinct between them, and there are many cats and dogs already included in the original imagenet model (lets say the car/bus/truck are not included in the imagenet output classes).

Will it be better start training the model from Coco/Imagenet weights or start training using the weights of a model previously trained to classify cars only?

$\endgroup$
1
$\begingroup$

Using pretrained model as a starting point would give better results even classes you want to classify don't present in the original dataset. Because first layers of the CNN models just learn primitive features like lines, circles and they are relevant for other image classification tasks and classes that not present in the imagenet dataset too, so I don't think answers that stated if the class is not present then there is no transfer learning is true. Low level representations are just same for almost every object. It is the reason why transfer learning in image related tasks are successful.

But of course you should adapt pretrained network to your task by replacing original classification layer with a fully connected layer to classify your classes, a binary classifier in that case, and you should train layers close to end to extract high level representations from your dataset. As I said before low level representations already learned by first layers and they are okay, so make weights of last a few layers and fully connected layer trainable and just freeze anything else. It is called fine-tuning.

Model you already have also might have been trained in this way, so you should compare results of both to have an idea which one is better.

$\endgroup$
0
$\begingroup$

If you have a previously trained model to classify only cars, you can use it considering the fact that you have less data. The trained model for cars classification that you have already, would have been fine-tuned on the Imagenet or COCO in the first place. This way I think you would be able to train the model in less amount of time compared to fine tuning on Imagenet weights. Try both the methods once and try to find out the amount of performance increase in terms of time and accuracy over each other.

$\endgroup$
-1
$\begingroup$

I would rather suggest you to create your own CNN for this task and train it from scratch and then tune it's hyperparameters and i think that will give you much more better results as compared to using a pretrained model, these models have deep architectures and have millions of parameters which are learnt over a huge dataset, and these models are deep and they were made solely because of the fact that training such a deep network with so many parameters will require a good amount of data because i don't think so there any ferrari's in the coco dataset so doing training on top of that won't increase your model power upto what extent you may be wanting because you don't have that much data.So, why not build a CNN from your own hands your own network that should give you better results because as you said you have only two classes to classify.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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