2
$\begingroup$

i have trained my deep learning model initially with 5 classes now i want to add another class without training the whole model over again for those 5 classes. How can I do that?

$\endgroup$
  • $\begingroup$ How would you just freeze the original 5 outputs (neurons) without freezing the whole layer? $\endgroup$ – Skier Aug 5 '19 at 16:31
  • $\begingroup$ We just need to freeze the output dense layer with softmax activation. $\endgroup$ – Subham Tiwari Aug 6 '19 at 11:40
  • $\begingroup$ Did you find any solution to it? $\endgroup$ – Verma Ashish Sep 25 '19 at 6:23
3
$\begingroup$

You cannot do that without re-training at least part of the model.

You will have to replace the existing output layer with a new output layer that has the desired number of neurons. That, of course, means that you will have to retrain at least the last layer or the last few layers. But you can freeze the weights of all the other layers.

In keras you can freeze the weights of a specific layer by setting its trainable property to False.

| improve this answer | |
$\endgroup$
1
$\begingroup$

How to add more class to trained model without complete training for other classes:

  • Transfer Learning Twice
  • Continual learning approaches
    • Regularization
    • Expansion
    • Rehearsal
| improve this answer | |
$\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.