如果您使用冲浪特征,那么就意味着您将设置一个浮点集向量[128]或[64],具体取决于您的冲浪配置,然后设置神经网络如下:
- 创建一个包含模型的数据库:
-bikes
-cars
-autobus
-truck
-对于每种类型的物体,例如不同款式的汽车、自行车和卡车等,需要拍摄10张不同的照片,并从每张照片中提取出其SURF特征向量。
-每种类型的物体将在神经网络中代表一个物体类。
-car ;object class 1 =binary representaation in 4 bits= 0 0 0 1
-bikes ;obejct class 2 =binary representaation in 4 bits= 0 0 1 0
-truck ;obejct class 3 =binary representaation in 4 bits= 0 0 1 1
-ball ;obejct class 4 =binary representaation in 4 bits= 0 1 0 0
-二进制表示中的每个位都将对应于网络输出层中的一个神经元,并代表要识别的一个物体类别
-现在,神经网络的配置将基于特征向量的大小和您想要以此识别的对象类型的数量;
-输入层中的神经元数为64或128,具体取决于您配置和使用的surf特征向量的大小
-神经网络输出层中的神经元数将是您想要识别的对象类别数,在此示例中为4
-每个神经元所需的激活函数是sigmoid或tanh函数(
http://www.learnartificialneuralnetworks.com/),因为surf特征由浮点数表示,如果您使用freak特征或其他二进制本地特征描述符(Brisk、ORB、BRief),则将使用二进制激活函数到每个神经元,如步进函数或sigm函数
-用于训练网络的算法是反向传播
-在继续之前,您需要设置和准备数据集以训练神经网络
-例子
-all feature vector extracted from picture belong a car will be label or asociated to class 1
-all feature vector extracted from picture belong a bike will be label or asociated to class 2
-all feature vector extracted from picture belong a truk will be label or asociated to class 3
-all feature vector extracted from picture belong a ball will be label or asociated to class 4
针对这个示例,您的输出层将有4个神经元,输入层将有128或64个神经元。
在识别模式下,神经网络的输出将是这4个神经元中具有最高值的神经元。
在开始训练阶段之前,必须对数据集中的所有特征进行归一化处理,使其处于[0,1]的区间内,因为神经网络的输出是输入向量属于数据集中一个对象类别的概率。
用于训练网络的数据集需要按以下方式拆分:
-70% off the data used to train
-15% off the data used to validate the network arquitecture (number of neurons in the hidden layyer)
-15% off the data used to test the final network
训练神经网络时,停止标准是识别率,当接近85-90%时。为什么使用神经网络而不是SVM机器?SVM机器工作良好,但在像这样的非线性分类问题或具有许多不同对象类或对象类型的情况下,它无法制作最佳分离类映射,这种缺乏在识别阶段结果中得到体现。我建议您阅读一些关于神经网络理论的内容,以了解它们的工作原理。
http://link.springer.com/chapter/10.1007%2F11578079_10
OpenCV拥有机器学习类来实现神经网络MLP模块。
希望这可以帮助你。