7
$\begingroup$

I am training a convolutional neural network for object detection. Apart from the learning rate, what are the other hyperparameters that I should tune? And in what order of importance? Besides, I read that doing a grid search for hyperparameters is not the best way to go about training and that random search is better in this case. Is random search really that good?

$\endgroup$
6
  • $\begingroup$ 1. Learning rate schedule (decrease rate, cyclic etc) 2.Momentum if used(including 0) 3. augmentation (random transformations values) if used $\endgroup$ Jan 15, 2020 at 15:03
  • $\begingroup$ @mirror2image momentum is fixed to 0.9 (it appears that it's common practice to fix it to this value if you want to focus on other hyperparameters). Augmentations are done, but I'm mostly talking about other hyperparameters : regularizarion, weight decay... AND MOST IMPORTANTLY: from where to start $\endgroup$
    – S.E.K.
    Jan 15, 2020 at 15:14
  • $\begingroup$ Weight decay is useless in most cases. There are a lot of different regularizations, use common sense for them. Fixed momentum is bad practice. Always good idea to check momentum 0, 0.6, 0.9 Start with different learning rate schedules $\endgroup$ Jan 15, 2020 at 15:18
  • $\begingroup$ @mirror2image so you say: I start with trying out different lr scheduling policies, and during each policy, I do a grid search of the learning rate, momentum and the parameters of regulatization ? $\endgroup$
    – S.E.K.
    Jan 15, 2020 at 16:32
  • $\begingroup$ First - schedule and learning rate with grid search. After that momentum and regularization separately - it's highly likely they are independent. $\endgroup$ Jan 15, 2020 at 17:55

3 Answers 3

1
$\begingroup$

It depends a lot on what type of architecture you are using. However, most of the standard architectures are quite stable and there is no need for much hypreparameter tuning.

  1. Choose whether you want to use a standard CNN architecture or a more advanced one like a ResNet.
  2. Size? How many conv layers will you be using.
  3. Number of filters in each of the layers. This is where you might need a bit of tuning.
  4. You can try tuning the other parameters that are not specific to the problem, e.g. learning rate, regularization, dropout. If you already have a lot of feel for what works good and what not, then grid search according to your intuition would probably work pretty well. No need for random search in this case.
$\endgroup$
0
$\begingroup$

Firstly when you say an object detection CNN, there are a huge number of model architectures available. Considering that you have narrowed down on your model architecture a CNN will have a few common layers like the ones below with hyperparameters you can tweak:

  1. Convolution Layer:- number of kernels, kernel size, stride length, padding
  2. MaxPooling Layer:- kernel size, stride length, padding
  3. Dense Layer:- size
  4. Dropout:- Percentage to keep/drop
$\endgroup$
1
  • $\begingroup$ Thanks for your answer! Actually I do not intend to change the architecture, so the kernel size, the stride... are not concerned. The main goal of my question is HOW TO GO ABOUT THE TRAINING. What to strat from? $\endgroup$
    – S.E.K.
    Jan 23, 2020 at 14:15
0
$\begingroup$

You can play around with batch Size, epochs, learning rate.

Start with a batch size of 8 and gradually increase two folds => 8,16,32

Start with a higher learning rate to find the direction towards global minima, then reduce learning rate to avoid bouncing around and reach local minima

Start with a low number of epochs to get quick feedback on the rest of hyperparameters. Once you have the optimal direction for hyperparameters move to higher number of epochs

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .