zoukankan      html  css  js  c++  java
  • EM 算法 标签: clusteringalgorithm图像分割EM算法 2015-03-24 21:26 426人阅读 评论(0)


    1.      AlgorithmTheory

    1.1.    EMAlgorithm

    Suppose we have an estimation problem in which we have a training set .We wish to fit the parameters of a model  to the data, where the likelihood is given by

                                             (1)

    Because explicitly finding the maximum likelihood estimates of the parameter  may be hard, we choose EM algorithm as an efficient method for MLE. The algorithm is as follows:

    Repeat until convergence{

    (E-step)For each , set

                                             (2)

    (M-step)Set

                             (3)

    }

    1.2.    EMalgorithm in image segmentation

    原谅我在此处用中文继续:

    我们将输入的图片数据视作Mixture of Gaussian:

    对于输入的数据,我们可以得到其直方图分布,我们欲对这个灰度值进行聚类(注意到聚类算法是逐灰度值处理的)。设我们要分为k类,则有个k个Gaussian分布。

    在初始化的过程中,由图像数据我们可以得到


    至此我们可以求得初始化下的一个似然函数(即公式(1)),之后我们希望这个似然函数的值在迭代中不断增大,直至收敛。

    因此,在迭代中,我们选择:


    由上,将分布参数在迭代过程中不断改动,则值增大。

    我们记为新分布下的似然函数值。则


    当两者差值足够小时,收敛。

    这时大家应该发现了一个问题,如果我们按上表中Code部分计算,那么输入图像中出现1个255和出现n个255,迭代结果是一样的。这是错误的。原因在于我们没有统计各数字(灰度值)出现的频率。为了修正这个错误,我们在执行EM过程中,应在概率项前乘以“直方图分布”系数,即

    2.     Technological process


    3.     Experiment Results

    clc
    clear all;
    img = imread('brainweb91.tif');
    img = rgb2gray(img);
    k = 4;
    [mask,mu,v,p]=dcEMimSeg(img,k);
    figure,imshow(img),title('读入原图像');
    figure,imshow(mask./3),title('EMclustering结果');
    img2 = uint8(mask./3);
    [ri,gce,vi] = compare_segmentations(img,img2);
    ri
    gce
    vi

    ri = 0.6447
    gce = 0
    vi = 4.5362
    
    Published with MATLAB? R2014a


    4.     Compareto MICO

    EM algorithm

    MICO

    ri (Probabilistic Rand Index)

    0.6447

    0.9942

    gce (Global Consistency Error)

    0

    0.5791

    vi (Variation of Information)

    4.5362

    6.0720

    5.     Reference

    [1]. A Tutorialon Clustering Algorithms,http://home.deib.polimi.it/matteucc/Clustering/tutorial_html/mixture.html.

    [2]. CS229Lecture notes, Andrew Ng,Notes8.

  • 相关阅读:
    从零开始webpack4.x(十)区分不同环境
    从零开始webpack4.x(九)watch、resolve、小插件、跨域问题、环境变量
    从零开始webpack4.x(八)配置source-map
    从零开始webpack4.x(七)图片处理及打包文件分类
    浏览器:输入url,到页面加载的过程
    从零开始webpack4.x(六)全局变量引入
    JS 闭包
    PHP 回调函数call_user_func和 call_user_func_array()的理解
    面试总结之谈谈你对面向对象的理解
    maven私有库配置
  • 原文地址:https://www.cnblogs.com/helay/p/7133961.html
Copyright © 2011-2022 走看看