# How to add a new category to a existing trained deep learning model?

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?

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

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.

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

• Transfer Learning Twice
• Continual learning approaches
• Regularization
• Expansion
• Rehearsal