如何在深度学习中向现有分类器添加新类? [英] how to Add new class to existing classifier in deep learning?

查看:345
本文介绍了如何在深度学习中向现有分类器添加新类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我训练了一个深度学习模型,将给出的图像分为三类。现在,我想在模型中添加一个类。我试图检查有关在线学习的内容-但它会为现有课程提供新数据的训练。我是否需要在所有四个班上再次训练我的整个模型,或者有什么方法可以在新班上训练我的模型?

I trained a deep learning model to classify the give images into three classes. Now i want to add one more class to my model. I tried to about checked about "Online learning" - but it trains on new data for existing classes. Do i need to train my whole model again on all four classes or is there any way i can just train my model on new class ?

推荐答案

您可能在体系结构末端使用了3个神经元密集层之后的softmax来分为3类。添加一个类将导致在4个神经元密集层上进行softmax运算,因此将无法通过冻结的权重在当前图中容纳额外的神经元,基本上是在修改该图,因此您必须训练整个图从头开始模型

You probably have used a softmax after 3 neuron dense layer at the end of the architecture to classify into 3 classes. Adding a class will lead to doing a softmax over 4 neuron dense layer so there will be no way to accommodate that extra neuron in your current graph with frozen weights, basically you're modifying the graph and hence you'll have to train the whole model from scratch

-----或-----

-----or-----

一种方式是加载建模并删除最后一层,将其更改为4个神经元,然后再次训练网络!基本上,这将从头开始训练最后一层的权重。我不认为在添加新类时要保持这些(最后一层的权重)权重不变。

one way would be loading the model and removing the last layer , changing it to 4 neurons and training the network again! This will basically train the weights of the last layer from scratch . I don't think there is anyway to keep these(weights of the last layer) weights intact while adding a new class .

这篇关于如何在深度学习中向现有分类器添加新类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆