More about Belief Propagation

首先,以3x3的MRF为例。


MRF for a 3x3 image

上图中的一些概念:
蓝色节点:观察量。在Stereo Matching问题中是pixel intensity;
粉色节点:隐变量。在Stereo Matching中表示待求视差值,即labels;
无向边: 表示节点之间的依赖关系。根据MRF Assumption - 一个节点的状态仅取决与其相邻的节点,那么一个隐节点的标签值只和其4个相邻隐节点以及观察节点有关系。

MRF formulation

energy function

变量Y和X分别表示观察量和隐藏量。
其物理意义 - sums up all the cost at each link given an image Y and some labeling X. The aim is to find a labeling for X that produces the lowest energy.

DataCost - matching cost in stereo matching.
SmoothnessCost - pairwise energy/term/potential. 用来约束两个相邻节点之间labels的关系。常用的有一下几种:

smoothness - Potts model
smoothness - Truncated linear model
smoothness - truncated quadratic model

Solve the Energy Function - Loopy Belief Propagation
从Belief Propagation演变而来,原本BP是针对Tree结构的算法。当变成可以出现loop的无向图(MRF)之后,出现了LBP。不一定收敛。

message passing

LBP is a message passing algorithm.
如图,节点x1传递给x2的message包括所有incoming message,除了x2到x1的message。
定义节点i到节点j的消息量为:

message

node i sends a message to node j about label l. It's node i's belief about node j regarding label l. - 是节点i关于节点j取值l时候的belief。
Belief 取值为cost/penalty/probabilities 依赖于MRF energy formulation。
message passing is only performed on the hidden nodes。

Implementation of the LBP algorithm

function LoopyBeliefPropgation
    initialise all messages

    for t iterations
        at every pixel pass messages right
        at every pixel pass messages left
        at every pixel pass messages up
        at every pixel pass messages down
    end for

    find the best label at every pixel i by calculating belief
end

对于存在loop的无向图,message passing 理论上会是一个无限等待的过程,实现的时候可以将所有message初始化为0/1;
每次迭代都会更新每个节点的belief的值,通过最优(大/小)选择每个节点的标签值。
LBP细节上可以分为3个部分:

  • message update
  • message initialization
  • belief

Three Different Algorithm for LBP

  • sum-product
  • max-product
  • min-sum
1. Sum-Product

message update

message update

其中, exp函数将Datacost/Smoothness转换为0-1之间的valid probability
the outer summation is a marginalization of the variable l';
the inner product is the joint probability of DataCost, SmoothnessCost and all the incoming messages for a given label l';
算法复杂度是: O(L^2)

normalization

normalization

initialization
all messages are initialized as 1.

belief
a product of all incoming messages

belief

it presents the belief that node i takes on label l. 计算每个标签的belief值,得到最大belief所对应的标签值。

2. Max-Product

sum-product计算并最大化每个节点的Belief,考察的是节点的marginal probability。But, what we are really interested in is the max joint probability -- i.e. maximum a posterior (MAP) assignment problem.
digression : 可以理解posterior为条件概率

message update

message update

belief calculation 是相同的

3. Min-Sum

算法同Max-Product,转换到log空间,从而求解最大乘积转换为最小和。

message update

message update in log space

message initialization
due to minimization - all messages should be initialized as 0

message normalization
in log space:

normalization in log space

**belief”


小结:
Min-Sum 算法效率最高,无exp() and all operations are addition
Sum-Product 算法中,为了避免overflow,可以使用scaling
实际上,能量最小也不一定对应了最优的结果。可以做一个实验,用ground-truth disparity来计算energy,会发现energy的值比最终LBP计算的能量值要更大。应该更多的考虑occlusion。

最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 谁还在流浪 谁还在欣赏 谁会在祈祷 未知的彷徨 谁还在反抗 谁还在疯狂 谁会在信仰 孤独或远方 莫名的话 在心间缠...
    一抹忧郁漂偏天际阅读 448评论 0赞 1
  • 面试的事儿在经过几日的时间流逝后,显然已不是那么的重要。 心里释然了已七八分,剩下的两分以烙印的方式永存于心,成为...
    茉小菁阅读 209评论 0赞 0
  • 雪韵 (散文) 季节的轮子又转到了冬。 落雪无声,情在人间。又一个冬季,又一个轮回。冬的洁白,滤去一切世俗的尘埃,...
    笔耕心田阅读 929评论 1赞 2

友情链接更多精彩内容