参考文章:Introduction to Spectral Graph Theory and Graph Clustering
作者:Chengming Jiang,ECS 231 Spring 2016 University of California, Davis
本文的目的是进行计算机图像分割:
谱图(Spectral Graph Theory)理解(2)
图1 图像分割

一、预备知识

关于图(G)、度矩阵(D)、邻接矩阵(A)皆在上一篇理解中交代过,现补充一些新的定义:
1、权重矩阵
A weighted graph is a pair G=(V,W) where

  • V={vi}V=\{v_i\} is a set of vertices and V=n\vert V\vert=n;
  • WRn×nW\in \mathbb R^{n\times n} is called weight matrix with
    wij={wij0if ij0i=j w_{ij}=\begin{cases} w_{ij}\ge 0 & \text{if $i\neq j$}\\ 0 & \text{i=j}\end{cases}
    W是权重矩阵,V是顶点,它们构成对G=(V,W),即是权重图G。
    The underlying graph of G is G^=(V,E)\hat G=(V,E) with
    E={{vi,vj}wij>0}E=\{\{v_i,v_j\}\vert w_{ij}\gt 0\}
  • If wij{0,1},W=Aw_{ij}\in\{0,1\},W=A, the adjacency matrix of G^\hat G
  • Since wii=0w_{ii}=0, there is no self-loops in G^\hat G
    W是对A的一个扩展,当wij{0,1}w_{ij}\in\{0,1\},W即是A。定义W后,需要重新定义顶点的度(degree of a vertex)和度矩阵(degree matrix):
    d(vi)=j=1nwijdegree of vid(v_i)=\sum_{j=1}^n w_{ij} \qquad \text{degree of $v_i$}
    Let d(vi)=diD=D(G)=diag(d(v1), ,d(vn))=diag(d1, ,dn)\text{Let $d(v_i)=d_i$} \\D=D(G)=diag(d(v_1),\cdots,d(v_n))=diag(d_1,\cdots,d_n)
    2、A的体积(Volume)
    对于V的一个子集A(AVA\subseteq V),定义A的体积(Volume):
    vol(A)=viAd(vi)=viAj=1nwij vol(A)=\sum_{v_i \in A}d(v_i)=\sum_{v_i\in A}\sum_{j=1}^n w_{ij}
    即A中所有顶点的度和,若A中所有顶点都是孤立的(isolated),则vol(A)=0,举例如下:
    谱图(Spectral Graph Theory)理解(2)
    图2 vol(A)的计算方法
    3、顶点集间的连接(links)
    Given two subsets of vertices A,BVA,B\subseteq V, we define the links links(A,B)links(A,B) by
    links(A,B)=viA,vjBwijlinks(A,B)=\sum_{v_i\in A, v_j \in B} w_{ij}
    Remarks:
    • A and B are not necessarily distinct;
    • Since W is symmetric, links(A,B)=links(B,A)links(A,B)=links(B,A)
    • vol(A)=links(A,V)vol(A)=links(A,V)
      有了连接(links)定义,就可以定义分割(cut),它的定义如下:
      cut(A)=links(A,VA)cut(A)=links(A,V-A)
      在连接(links)基础上,还可以定义一个量assoc,如下:
      assoc(A)=links(A,A)assoc(A)=links(A,A)
      即A中顶点自己的连接。cut是A和外部的links,assoc是A与内部的links。因此有:cut(A)+assoc(A)=vol(A)cut(A)+assoc(A)=vol(A)
      4、Graph Laplacian
      对于权重图 G=(V,W),the (graph) Laplacian L of G is defined by
      L=DWL=D-W
      Laplacian具有以下的属性:
    • xTLx=12i,j=1nwij(xixj)2x^TLx=\frac{1}{2}\sum_{i,j=1}^n w_{ij}(x_i-x_j)^2 for xRn\forall x\in \mathbb R^n,这是一个二次型
    • L0L\ge 0 if wij0w_{ij}\ge 0 for all i,j;
    • L1=0L\cdot \mathbf 1=\mathbf 0
    • If the underlying graph of G is connected, then
      0=λ1λ2λ3λn0=\lambda_1\le\lambda_2\le\lambda_3\cdots \le\lambda_n
    • If the underlying graph of G is connected, then the dimension of the nullspace of L is 1.

图的聚类(Graph clustering)

1、k-way partitioning
给定一个权重图 G=(V,W),要找到一个对V的分割,使以下条件得到满足:

  • A1A2Ak=VA_1\cup A_2 \cdots\cup A_k=V
  • A1A2Ak=A_1\cap A_2 \cdots\cap A_k=\emptyset
  • for any i and j, the edges between (Ai,Aj)(A_i,A_j) have low weight and the edges within AiA_i have high weight.
    要使分割后各子集之间的edges的权重最小,对于2-way分割有:
    cut(A)=links(A,Aˉ)=viA,vjAˉwijcut(A)=links(A,\bar A)=\sum_{v_i\in A,v_j\in \bar A}w_{ij}, where Aˉ=VA\bar A = V-A
    分割问题转化成了优化问题:mincut(A)=minviA,vjAˉwij\min cut(A)=\min \sum_{v_i\in A,v_j \in \bar A}w_{ij}
    谱图(Spectral Graph Theory)理解(2)
    图3 通常最小化分割会得到不平衡的分割
    通常最小化分割会得到不平衡的分割,因而引入“Normalized cut”,定义如下:
    Ncut(A)=cut(A)vol(A)+cut(Aˉ)vol(Aˉ)Ncut(A)=\frac{cut(A)}{vol(A)}+\frac{cut(\bar A)}{vol(\bar A)}
    对图3采用归一化分割会得到:
    谱图(Spectral Graph Theory)理解(2)
    图4 采用Normailized cut
    定义一个示性矢量(indicator vector)x=(x1,x2, ,xn)\mathbf x=(x_1, x_2,\cdots,x_n),有:
    xi={1if viA1if viAˉx_i=\begin{cases}1&\text{if $v_i\in A$}\\ -1 & \text{if $v_i\in \bar A$} \end{cases}
    则有:
    • (1+x)TD(1+x)=4viAdi=4vol(A)(1+x)^TD(1+x)=4\sum_{v_i\in A}d_i=4\cdot vol(A)
    • (1+x)TW(1+x)=4viA,vjAwij=4assoc(A)(1+x)^TW(1+x)=4\sum_{v_i\in A,v_j\in A}w_{ij}=4\cdot assoc(A)
    • (1+x)TL(1+x)=4(vol(A)assoc(A))=4cut(A)(1+x)^TL(1+x)=4\cdot(vol(A)-assoc(A))=4\cdot cut(A)
      以下是处理(1-x)与上对应
    • (1x)TD(1x)=4viAˉdi=4vol(Aˉ)(1-x)^TD(1-x)=4\sum_{v_i\in \bar A}d_i=4\cdot vol(\bar A)
    • (1x)TW(1x)=4viAˉ,vjAˉwij=4assoc(Aˉ)(1-x)^TW(1-x)=4\sum_{v_i\in \bar A,v_j\in \bar A}w_{ij}=4\cdot assoc(\bar A)
    • (1x)TL(1x)=4(vol(Aˉ)assoc(Aˉ))=4cut(Aˉ)(1-x)^TL(1-x)=4\cdot(vol(\bar A)-assoc(\bar A))=4\cdot cut(\bar A)
      于是Ncut(A) 可以被写成(公式的书写太繁琐了,我直接贴了过来):
      谱图(Spectral Graph Theory)理解(2)
      谱图(Spectral Graph Theory)理解(2)
      谱图(Spectral Graph Theory)理解(2)
      要求解这个最优问题,需引入变分原则(Variational principle):
      谱图(Spectral Graph Theory)理解(2)
      谱图(Spectral Graph Theory)理解(2)
      由此,我们可以通过迭代的方法,求得由小到大排列的特征值和它对应的特征矢量。每个特征矢量就是一个分割。
      《Normalized cuts and image segmentation》的例子:
      谱图(Spectral Graph Theory)理解(2)
      图5 原图
      将原图看成是graph,并定义权重:
      谱图(Spectral Graph Theory)理解(2)
      谱图(Spectral Graph Theory)理解(2)
      图6 权重图G=(V,W)
      求Normailized cut 的第二个特征矢量,及对应分割:
      谱图(Spectral Graph Theory)理解(2)
      谱图(Spectral Graph Theory)理解(2)

相关文章:

  • 2021-08-21
  • 2022-01-13
  • 2021-09-11
  • 2021-11-05
  • 2021-09-26
  • 2021-09-25
  • 2021-12-15
猜你喜欢
  • 2021-08-27
  • 2022-02-08
  • 2021-10-21
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案