简体   繁体   English

使用Matlab仿真的神经网络中的模式识别

[英]Pattern recognition in Neural Network using matlab simulation

I am new to this neural network in matlab. 我是Matlab中这个神经网络的新手。 I wanted to create a Neural Network using matlab simulation. 我想使用Matlab仿真创建一个神经网络。

This matlab simulation is using pattern recognition. 这个Matlab仿真使用模式识别。 I am running on a windows XP platform. 我在Windows XP平台上运行。

For example, I have a sets of waveforms of circular shape. 例如,我有一组圆形的波形。 I have extracted out the poles. 我已经拔出了两极。 These poles will teach my Neural Network that it is circular in shape, hence whenever I input another set of slightly different circular shape waveform, the Neural Network is able to distinguish between the shape. 这些极点将告诉我的神经网络其形状是圆形的,因此,每当我输入另一组稍有不同的圆形波形时,神经网络就可以区分形状。

Currently, I have extracted the poles of these 3 shapes, cylinder, circle and rectangle. 目前,我已经提取了圆柱,圆形和矩形这三种形状的极点。 But I am clueless of how I should go about creating my Neural Network. 但是我对如何创建神经网络一无所知。

I'd recommend utilizing SOM (Self-organizing map) for pattern recognition since it's really robust. 我建议使用SOM(自组织映射)进行模式识别,因为它确实很健壮。 Also there's a Som Toolbox for Matlab you might be interested in. However, to make it learn waves while neglecting their offsets, you'd need to make some changes to the "similarity function". 另外,您可能会对MatlabSom工具箱感兴趣。但是,要使其在忽略波动的同时学习波动,则需要对“相似性函数”进行一些更改。 These changes will affect quite a lot on the SOM's training time but if that's not a problem, keep reading. 这些更改将极大地影响SOM的培训时间,但是如果那不是问题,请继续阅读。

For the SOM you'll have to sample your waves to constant sized vectors, let say: 对于SOM,您必须将波采样到恒定大小的矢量,让我们说:

  • sin x -> sin_vector = (a1, a2, a3, ..., aN) sin x-> sin_vector =(a1,a2,a3,...,aN)
  • cos x -> cos_vector = (b1, b2, b3, ..., bN) cos x-> cos_vector =(b1,b2,b3,...,bN)

Usually similarity of "SOM-vectors" is calculated with euclidian distance. 通常用欧几里得距离来计算“ SOM-矢量”的相似度。 Euclidian distance of those two vectors is huge since they have a different offset. 这两个向量的欧几里得距离很大,因为它们具有不同的偏移量。 In your case they should be considered to be similar ie. 在您的情况下,应将它们视为相似,即。 distance to be small. 距离要小。 So.. if you don't sample all the similar waves from the same starting point, they will be classified in different classes. 所以..如果您不从同一起点采样所有相似的波,则它们将被分类为不同的类。 That is probably a problem. 那可能是个问题。 But! 但! Similarity of vectors in SOM is calculated in order to find the BMU (best-matching unit) from the map and pulling the BMU's and its neigborhood's vectors torwards the values of the given sample. 计算SOM中向量的相似度是为了从图中找到BMU(最佳匹配单位),并将BMU及其近邻向量拉至给定样本的值。 So all you need to change is the way to compare those vectors and the way to pull the vectors' values torwards the sample so that both will be "offset-tolerent". 因此,您需要更改的是比较这些向量的方式以及将向量的值拉向样本的方式,以使两者都“具有偏移容忍度”。

Slow but working solution is first finding the best offset index for each vector. 缓慢但可行的解决方案是首先为每个向量找到最佳偏移索引。 Best offset index is the one that will produce the smallest value with euclidian distance for the sample. 最佳偏移指数是一个将产生最小距离且具有欧氏距离的样本的指数。 Smallest distance calculated with some node of the net will then be the BMU. 用网络的某个节点计算出的最小距离就是BMU。 Then the BMU's and its neigborhood's vectors are pulled torwards the given sample using the offset index calculated for each node just before. 然后,使用之前为每个节点计算的偏移索引,将BMU及其邻近向量推向给定样本。 Everything else should work out-of-the-box. 其他所有内容都应立即可用。

This solution is relatively slow but should work great. 该解决方案相对较慢,但效果很好。 I'd recommend studying the consept of SOM thoroughly and then reading this post (and angry comments) again :) 我建议您彻底研究SOM的概念,然后再次阅读这篇文章(和愤怒的评论):)

PLEASE comment if you know some mathematical solution that would be better than that previous one! 如果您知道一些比前一个更好的数学解决方案, 请发表评论

您可以尝试使用Matlab的神经网络模式识别工具nprtool因为它专门训练和测试用于模式识别的神经网络。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM