MATLAB:自组织地图(SOM)集群 [英] MATLAB: Self-Organizing Map (SOM) clustering

查看:305
本文介绍了MATLAB:自组织地图(SOM)集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据身体部位之间的角度对一些图像进行聚类.

I'm trying to cluster some images depending on the angles between body parts.

从每张图像中提取的特征是:

The features extracted from each image are:

angle1 : torso - torso
angle2 : torso - upper left arm
..
angle10: torso - lower right foot

因此,输入数据是大小为1057x10的矩阵,其中1057表示图像数,而10表示身体部位与躯干的角度. 同样,testSet是821x10矩阵.

Therefore the input data is a matrix of size 1057x10, where 1057 stands for the number of images, and 10 stands for angles of body parts with torso. Similarly a testSet is 821x10 matrix.

我希望输入数据中的所有行都以88个簇为簇. 然后,我将使用这些群集来查找TestData属于哪些群集?

I want all the rows in input data to be clustered with 88 clusters. Then I will use these clusters to find which clusters does TestData fall into?

在以前的工作中,我使用了 K均值聚类,它非常简单.我们只要求K-Means将数据聚类为88个聚类.并实现另一种方法,该方法计算测试数据中的每一行与每个群集的中心之间的距离,然后选择最小值.这是相应输入数据行的集群.

In a previous work, I used K-Means clustering which is very straightforward. We just ask K-Means to cluster the data into 88 clusters. And implement another method that calculates the distance between each row in test data and the centers of each cluster, then pick the smallest values. This is the cluster of the corresponding input data row.

我有两个问题:

  1. 是否可以在MATLAB中使用 SOM 来做到这一点? AFAIK SOM用于视觉集群.但是我需要知道每个群集的实际类,以便以后可以通过计算测试数据所属的群集来标记测试数据.

  1. Is it possible to do this using SOM in MATLAB? AFAIK SOM's are for visual clustering. But I need to know the actual class of each cluster so that I can later label my test data by calculating which cluster it belongs to.

您有更好的解决方案吗?

Do you have a better solution?

推荐答案

自组织地图(SOM )是一种群集方法,被视为人工神经网络(ANN).它使用竞争性学习技术来训练网络(节点相互竞争以显示对给定数据的最强激活)

Self-Organizing Map (SOM) is a clustering method considered as an unsupervised variation of the Artificial Neural Network (ANN). It uses competitive learning techniques to train the network (nodes compete among themselves to display the strongest activation to a given data)

您可以认为SOM好像是由相互连接的节点(正方形,六边形,..)组成的网格组成,其中每个节点都是权重的N维矢量(尺寸大小与我们想要的数据点相同)集群).

You can think of SOM as if it consists of a grid of interconnected nodes (square shape, hexagonal, ..), where each node is an N-dim vector of weights (same dimension size as the data points we want to cluster).

这个想法很简单;给定一个向量作为SOM的输入,我们找到它的节点 closet ,然后更新其权重和相邻节点的权重,使它们接近输入向量的权重(因此,名称自组织).对所有输入数据重复此过程.

The idea is simple; given a vector as input to SOM, we find the node closet to it, then update its weights and the weights of the neighboring nodes so that they approach that of the input vector (hence the name self-organizing). This process is repeated for all input data.

通过节点如何组织自身并形成具有相似权重的一组节点来隐式定义形成的群集.可以很容易地在视觉上看到它们.

The clusters formed are implicitly defined by how the nodes organize themselves and form a group of nodes with similar weights. They can be easily seen visually.

SOM与 K均值算法类似,不同之处在于我们并没有施加固定数量的集群,而是指定了网格中我们希望其适应数据的节点的数量和形状.

SOM are in a way similar to the K-Means algorithm but different in that we don't impose a fixed number of clusters, instead we specify the number and shape of nodes in the grid that we want it to adapt to our data.

基本上,当您拥有训练有素的SOM并希望对新的测试输入向量进行分类时,只需将其分配到网格(最佳匹配单元 > BMU),并给出属于该BMU节点的向量的[多数]类作为预测.

Basically when you have a trained SOM, and you want to classify a new test input vector, you simply assign it to the nearest (distance as a similarity measure) node on the grid (Best Matching Unit BMU), and give as prediction the [majority] class of the vectors belonging to that BMU node.

对于MATLAB,您可以找到许多实现SOM的工具箱:

For MATLAB, you can find a number of toolboxes that implement SOM:

  • The Neural Network Toolbox from MathWorks can be used for clustering using SOM (see the nctool clustering tool).
  • Also worth checking out is the SOM Toolbox

这篇关于MATLAB:自组织地图(SOM)集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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