I'm using Faster-RCNN, Yolo, and SSD models on GluonCV (mxnet) to predict on some medical images. However, the training result isn't ideal because the number of images in the dataset is small. As a result, I decide to use transfer learning and unfreeze the output layer with the 'reset_class' method to train my models. But the result is still below expectation. Thus, I'm trying to unfreeze more layers to improve the accuracy of the training result, but I couldn't find any build-in function to achieve this.
Basically, I have two questions as follow: First, is it possible to unfreeze more layers on GluonCV? Second, if not, is there any other way that I could use to further improve the accuracy of my result?
To be honest, I'm not sure why you believe that model parameters are frozen by default and
reset_class
will unfreeze an output layer. Still, if you want to unfreeze specific parameters, you need to choose them withcollect_params
method and set theirgrad_req
attribute to'write'
. For example, having the following convolutional networkyou can unfreeze convolution (features) block with
Also, if your model is not composed of
features
,output
, and/or other separate blocks (e.g. it's a single sequential block):to unfreeze the convolution block try this: