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

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

问题描述

我训练了一个深度学习模型,将给定的图像分为三类.现在,我想在模型中再添加一个类.我试图检查在线学习",但是它似乎在训练现有班级的新数据.我是否需要在所有四个班级上再次训练我的整个模型,或者有什么方法可以在新班级上训练我的模型?

I trained a deep learning model to classify the given images into three classes. Now I want to add one more class to my model. I tried to check out "Online learning", but it seems to train 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天全站免登陆