袋子词训练样品 [英] Bag of words training samples

查看:251
本文介绍了袋子词训练样品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实施了Bag of Words,一切工作顺利。但是,我对某些步骤和如何实现它感到困惑。

I have implemented Bag Of Words, everything is working smoothly. But, I'm confused about some steps and how to implement it.

我可以创建弓描述符作为Bag中的最后一步来创建样本,它显示在这里 bowDE.compute(img,keypoints,bow_descriptor); ..事情是,我困惑的后续步骤。

I could create the bow descriptors as the last step in Bag of words to create the samples, as it shown here bowDE.compute(img, keypoints, bow_descriptor); .. The things is that i'm confused about the next steps.

我知道在BOW中,我必须训练和测试类(汽车)与非类(可乐),我在bow_descriptor向量中创建的只是类汽车,所以我有矢量的样品,只属于汽车。这里是我训练我的系统和测试它的问题。

I know that in BOW that I have to train and test a class (car) with non-class (cola), what I created in bow_descriptor vector is only for the class car, so I have vector for samples that belong only to the car. here are the questions that I have for training my system and test it.

1-我将bow_descriptor的向量作为类(cola)的一半,对于非类(可乐),或者我必须为非类(cola)创建一个新的bow_descriptor?

1- Shall I make the vector of bow_descriptor half of it for the class(cola) and the rest for non-class(cola) , or I have to create a new bow_descriptor for the non-class(cola) ?

2-我需要做多类分类,在完成第一个类(车)系统后,我需要训练一个新类(巴士+火车等),我应为他们创建一个新的训练模型,或者
是可能的做训练程序与以前的训练(即训练班巴士,列车与类车在同一系统)?

2- I need to do multi-class classification, after finishing the first system for class (car), and I need to train a new class (Buses+trains and so on), shall I create a new training model for each of them, or it is possible to do the training procedure with the previous training (i.e. training class BUS,train with the class car in the same system)?

推荐答案

无论是为所有类创建一个对象还是为每个类创建一个对象,所有类的相同字典。
只创建一个对象可能更经济。但是提取的图像描述符应该是相同的。

It does not matter whether you create one object for all classes or one object for each class, as long as you use the same dictionary for all classes. Creating only one object might be more economical. But the extracted image descriptors should be the same.

关于多类SVM:

所以我假设你想使用SVM。存在着用SVM显式地做多类分类的方法,更常见的是训练几个二进制SVM并将它们组合以获得多类结果。

You used the SVM tag. So I assume you want to use SVM. There do exist ways to do multiclass classifications explicitly with SVMs it is more common to train several binary SVMs and combine them to get a multiclass results.

您可以使用1-vs-1设置,其中每个类对训练一个SVM。对于测试,您可以在每个SVM上评估测试示例。

You can either use the 1-vs-1 setting, where you train one SVM per class pair. For testing you evaluate your test example on each SVM. The class which wins those duels the most often then becomes your final result.

另一个流行的方法是1-vs-all SVMs。在这里,您训练每个类别一个SVM,其中来自当前类的样本标记为正,所有其他样本为负。

The other popular approach is 1-vs-all SVMs. Here you train one SVM per class where samples from the current class are labeled positive and all other samples negative. During testing the class with the highest score wins.

所以,如果你想使用1-vs-1设置,你可以重复使用一些二进制SVMs,当你添加新类。 1-vs-All设置是不可能的,因为您需要为每个SVM的负样本添加新类。

So if you want to use the 1-vs-1 setting you might be able to reuse some binary SVMs when you add new classes. It is not possible for the 1-vs-All setting, as you need to add the new class to the negative samples for each SVM.

这篇关于袋子词训练样品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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