ThomasDelteil / VisualSearch_MXNet

Visual Search using Apache MXNet and gluon
234 stars 54 forks source link

Fine tuned model #10

Open techietrader opened 5 years ago

techietrader commented 5 years ago

Hi Thomas, Great work!

I have a very fundamental question.

I understand that your idea behind the presentation and sharing codes is to spread knowledge, but do you think that instead of simply using the standard resnet model to get the features, one should first fine-tune the model on a specific dataset and then extract features?

For instance, If I intend to find features for fashion data, then I should first finetune the standard resnet model by unfreezing the initial layers and then extract features for new fashion images? Do you think this would improve accuracy in the search?

Thanks

Again, Great work!

ThomasDelteil commented 5 years ago

Thanks @techietrader, fine-tuning your network on a classification task on your own dataset is a good idea. Two things to keep in mind:

You can have a look at this tutorial on fine-tuning with MXNet here:

techietrader commented 5 years ago

Thanks, Thomas,

Links were helpful!

One more quick question, more related to MXNet-

Since we intend to extract the features of an image and that's why we are using this following line of code - net = vision.resnet18_v2(pretrained=True, ctx=ctx).features

But how do I figure out which layer is used? And suppose I wish to try a different layer, let's say a Fully Connected layer or a Pooling layer. Is it possible?

Thanks, BR

ThomasDelteil commented 5 years ago

@techietrader, sorry I missed that question:

yes you can easily pick which layer you want. Try to do:

print(net)

you should see every layer of the network then you can pick the one that you want like this:

subnet  = net.features[:10]