**Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation**

P. K. Nanda and Sucheta Panda

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/50475

## **1. Introduction**

[21] Rodriguez, R., Suarez, A. G., & Sossa, J. H. (2011a). A Segmentation Algorithm based on an Iterative Computation of the Mean Shift Filtering. *Journal Intelligent & Robotic*

[22] Rodriguez, R., Torres, E., & Sossa, J. H. (2011b). Image Segmentation based on an Iterative Computation of the Mean Shift Filtering for different values of window

[23] Rodríguez, R., Torres, E., & Sossa, J. H. (2012). Image Segmentation via an Iterative Algorithm of the Mean Shift Filtering for Different Values of the Stopping Threshold.

[24] Salvatelli, A., Caropresi, J., Delrieux, C., Izaguirre, M. F., & Caso, V. (2007). Cellular Outline Segmentation using Fractal Estimators. Journal of Computer Science and

[25] Shen, C., & Brooks, M. J. (2007, May). Fast Global Kernel Density Mode Seeking: Ap‐ plications to Localozation and Tracking. *IEEE Transactions on Image Processing*, 16(5),

[26] Suyash P., Awate, & Ross T., Whitaker. (2006, March). Higher-Order Image Statistics for Unsupervised, Information-Theoretic, Adaptive, Image Filtering. *IEEE Trans. Pat‐*

[27] Vicent, L., & Soille, P. (1991, June). Watersheds in digital spaces: An efficient algo‐ rithm based on immersion simulations. *IEEE Transactins on Pattern Analysis and Ma‐*

[28] Zhang, H., Fritts, J. E., & Goldman, S. A. (2003). Paper presented at Proceeding of The SPIE. *A Entropy-based Objective Evaluation Method for Image Segmentation, Storage and Retrieval Methods and Applications for Multimedia 2004. Edited by Yeung, Minerva; Lien‐*

sizes. *International Journal of Imaging and Robotics*, 6(A11), 1-19.

*tern Analysis and Machine Intelligence (PAMI)*, 364-376, 28(3).

*chine Intelligence*, 13(6), 583-593, 0162-8828.

*hart, M., Rainer W.; Li, Choung-Sheng*, 5307, 38-49.

*International Journal of Imaging and Robotics*, 7(1).

*System*, 63(3-4), 447-463.

80 Advances in Image Segmentation

Technology ., 7(1), 14-22.

1457-1469, 1057-7149.

Image segmentation is a basic early vision problem which serves as precursor to many high level vision problems. Color image segmentation provides more information while solving high level vision problems such as, object recognition, shape analysis etc. Therefore, the problem of color image segmentation has been addressed more vigorously for more than one decade. Different color models such as RGB, HSV, YIQ, Ohta (I1, I2, I3), CIE(XYZ, Luv, Lab) are used to represent different colors [5]. From the reported study, HSV and (I1, I2, I3) have been extensively used for color image segmentation. Ohta color space is a very good approximation of the Karhunen-Loeve transformation of the RGB, and is very suitable for many image processing applications [1]. Image Modeling plays a crucial role in image anal‐ ysis. Stochastic models, particularly MRF models, have been successfully used as the image model for image restoration and segmentation [2], [3], [4]. MRF model has also been success‐ fully used as the image model while addressing the problem of color image segmentation both in supervised and unsupervised framework. Kato *et al* [6] have proposed a MRF model based unsupervised scheme for color image segmentation. In Kato 's method, the model pa‐ rameters have been estimated using Maximum Likelihood criterion and the only parameter identified by the user is the number of class. This algorithm could be validated using differ‐ ent color textures and real images. Another color texture unsupervised segmentation algo‐ rithm has been proposed by Deng *et al* [7] and the method has been retermed as JSEG method. Recently, an unsupervised image segmentation algorithm has been proposed by Guo *et al* [8] where K-means has been used to initialize the classification in the classification of numbers. Very recently Scarpa *et al.* [13] have proposed a multiscale texture model and a related algorithm for the unsupervised segmentation of color images. In this scheme, the feature vectors have been collected and based on the feature vector the textures are then re‐

© 2012 Nanda and Panda; licensee InTech. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. © 2012 Nanda and Panda; licensee InTech. This is a paper distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

cursively merged giving rise to larger and more complex textures. This algorithm could suc‐ cessfully be tested on real world natural and remote sensing images. The model parameters can be estimated in both supervised and unsupervised framework [6].

**2.** The neighboring relationship is mutual: *i* ∈ *Ni* ⇔*Ni*

*r* from i.

value. The Fig 1 shows (*η<sup>1</sup>*

a lattice of regular sites.

and C3 respectively, where

(s, N) is defined as a subset of sites c={i, i'

(( ) ( )) <sup>2</sup> / , ,, , *N i S dist x y x y r i i <sup>i</sup> i i ii* ¢ ¢

For a regular lattice S, the set of neighbors of i is defined as the set of sites within a radius of

Where dist (A, B) denotes the Euclidean distance between A and B and r takes an integer

**Figure 1.** (a) Figure showing first order (η*<sup>1</sup>*), second order (η*<sup>2</sup>*) and third order(η3)neighborhood structure (b) Cliques on

The pair (S, N) = G constitutes a graph in the usual sense; s contains the nodes and N deter‐ mines the links between the nodes according to the neighboring relationship. A clique c for

on. The collections of single-site, pair-site and triple-site cliques will be denoted by C1, C2,

), or a triple of neighboring sites c = {i, i'

<sup>1</sup> *C iiS* = Î {/ } (3)

<sup>ì</sup> = Î <sup>í</sup> ¢ ¢ é ù £ ¹ ë û <sup>î</sup> (2)

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

).

http://dx.doi.org/10.5772/50475

83

, i''), and so

) the first order and second order neighborhood system (*η<sup>2</sup>*

In this piece of work, a Constrained Compound MRF model based color image segmenta‐ tion scheme is proposed in unsupervised framework. We have used Ohta (I1, I2, I3) color space to model the color images. In the proposed scheme, the Constrained Compound MRF model parameters and the image labels are estimated concurrently. Since the image label es‐ timates and the estimates of model parameters are dependent on each other, obtaining glob‐ al estimates of label as well as model parameters is very hard. Hence, we have proposed a recursive scheme for estimation of image labels and model parameters. The recursive scheme yields partial optimal solutions as opposed to optimal solutions. The MRF model parameter estimation problem is formulated in Maximum Conditional Pseudo Likelihood (MCPL) framework and the MCPL estimates are obtained using homotopy continuation bases algorithm. The MCPL estimation strategy results in a set of nonlinear equations which need to be solved to determine the model parameter estimates. Determination of the esti‐ mates is tantamount to determine the zeros of the unknown function. Homotopy continua‐ tion methods [14], [15] are globally convergent methods that have been used to trace the zeros of a function and hence determines the solution of functions. We have developed the fixed point based homotopy continuation method to estimate the model parameters. The image label estimation problem is formulated in Maximum a Posteriori (MAP) framework and the MAP estimates are obtained using the proposed hybrid algorithm [10]. The pro‐ posed supervised algorithm has been successfully tested on different images, however, for the sake of illustration we have presented three results and a comparison is made with [9].

## **2. MRF model**

MRF theory is a branch of probability theory for analyzing the spatial or contextual depend‐ encies of physical phenomena. It is used in visual labeling to establish probabilistic distribu‐ tions of interacting labels.

#### **2.1. Neighborhood system and cliques**

The sites in S are related to one another via a neighborhood system. A neighborhood system for S is defined as

$$\mathcal{N} = \left\{ \mathcal{N}\_i \mid \forall i \in \mathcal{S} \right\} \tag{1}$$

Where Ni is the set of sites neighboring i. The neighboring relationship has the following properties:

**1.** A site is not neighboring to itself: *i* ∈ *Ni*

**2.** The neighboring relationship is mutual: *i* ∈ *Ni* ⇔*Ni*

cursively merged giving rise to larger and more complex textures. This algorithm could suc‐ cessfully be tested on real world natural and remote sensing images. The model parameters

In this piece of work, a Constrained Compound MRF model based color image segmenta‐ tion scheme is proposed in unsupervised framework. We have used Ohta (I1, I2, I3) color space to model the color images. In the proposed scheme, the Constrained Compound MRF model parameters and the image labels are estimated concurrently. Since the image label es‐ timates and the estimates of model parameters are dependent on each other, obtaining glob‐ al estimates of label as well as model parameters is very hard. Hence, we have proposed a recursive scheme for estimation of image labels and model parameters. The recursive scheme yields partial optimal solutions as opposed to optimal solutions. The MRF model parameter estimation problem is formulated in Maximum Conditional Pseudo Likelihood (MCPL) framework and the MCPL estimates are obtained using homotopy continuation bases algorithm. The MCPL estimation strategy results in a set of nonlinear equations which need to be solved to determine the model parameter estimates. Determination of the esti‐ mates is tantamount to determine the zeros of the unknown function. Homotopy continua‐ tion methods [14], [15] are globally convergent methods that have been used to trace the zeros of a function and hence determines the solution of functions. We have developed the fixed point based homotopy continuation method to estimate the model parameters. The image label estimation problem is formulated in Maximum a Posteriori (MAP) framework and the MAP estimates are obtained using the proposed hybrid algorithm [10]. The pro‐ posed supervised algorithm has been successfully tested on different images, however, for the sake of illustration we have presented three results and a comparison is made with [9].

MRF theory is a branch of probability theory for analyzing the spatial or contextual depend‐ encies of physical phenomena. It is used in visual labeling to establish probabilistic distribu‐

The sites in S are related to one another via a neighborhood system. A neighborhood system

is the set of sites neighboring i. The neighboring relationship has the following

*N N iS* = "Î { *<sup>i</sup>* / } (1)

can be estimated in both supervised and unsupervised framework [6].

**2. MRF model**

82 Advances in Image Segmentation

for S is defined as

Where Ni

properties:

tions of interacting labels.

**2.1. Neighborhood system and cliques**

**1.** A site is not neighboring to itself: *i* ∈ *Ni*

$$\mathcal{N}\_i = \left\{ \mathbf{i}^r \in \mathcal{S} \,/\Big[ \operatorname{dist} \left( (\mathbf{x}\_{i^r}, y\_{i^r}), (\mathbf{x}\_{i^r}, y\_i) \right) \right\}^2 \le r\_r \mathbf{i}^r \ne \mathbf{i} \tag{2}$$

For a regular lattice S, the set of neighbors of i is defined as the set of sites within a radius of *r* from i.

Where dist (A, B) denotes the Euclidean distance between A and B and r takes an integer value. The Fig 1 shows (*η<sup>1</sup>* ) the first order and second order neighborhood system (*η<sup>2</sup>* ).

**Figure 1.** (a) Figure showing first order (η*<sup>1</sup>*), second order (η*<sup>2</sup>*) and third order(η3)neighborhood structure (b) Cliques on a lattice of regular sites.

The pair (S, N) = G constitutes a graph in the usual sense; s contains the nodes and N deter‐ mines the links between the nodes according to the neighboring relationship. A clique c for (s, N) is defined as a subset of sites c={i, i' ), or a triple of neighboring sites c = {i, i' , i''), and so on. The collections of single-site, pair-site and triple-site cliques will be denoted by C1, C2, and C3 respectively, where

$$\mathbb{C}\_1 = \{i \mid i \in \mathbb{S}\} \tag{3}$$

$$\mathbf{C}\_2 = \{ \{i, i'\} / i' \in \mathbb{N}\_{i'}, i \in \mathbb{S} \} \tag{4}$$

The concept of MRF is a generalization of that of Markov processes (MPs) which are widely used in sequence analyisis. An MP is defined on a domain of time rather than space. It is a sequence of random variables Z1, Z2, …., Zm defined in the time indices 1, 2, …, m. It is gen‐

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

http://dx.doi.org/10.5772/50475

85

Capturing salient spatial properties of an image lead to the development of image models. MRF theory provides a convenient and consistent way to model context dependent entities for e.g. image pixels and correlated features [6]. Though the MRF model takes into account the local spatial interactions, it has its limitations in modeling natural scenes of distinct re‐ gions. In case of color models, it is known that there is a correlation among the color compo‐ nents of RGB model. In our formulation, we have decorrelated the color components and introduced an interaction process to improve the segmentation accuracy. We have em‐ ployed inter-color-plane interaction (Ohta *I1, I2, I3* color model) process which reinforces par‐

In this work, a compound MRF model has been proposed and the proposed model is based on the following notion. The prior MRF model takes care of (i)Intra-color-plane *I1 or I2 or I3 I1, I2, and I3* entities of each color plane(ii)Inter-color-plane interactions of pixels of different col‐ or planes for e.g. *I1 and I2, and I3*. The MRF prior model takes care of the spatial interactions in any given color plane and also interaction of a pixel of a given color plane with the pixel of other color planes. Thus the intra color plane and inter color plane interactions could be modeled by the compound MRF model. Motivation behind this modeling is as follows. It is known that strong correlation exists among different color planes of RGB model and there‐ fore not suitable for image segmentation. On the other hand Ohta model is suitable for im‐ age segmentation because of the existing weak correlation among color planes. In order to develop an appropriate color model, we develop a model with controlled correlation among the different color planes. Therefore, the a prior compound MRF model takes care of the controlled correlation among the different planes of Ohta colorspace. The degree of correla‐ tion is controlled by the associated parameters of the clique potential function *I1, I2, I3*. The values of these parameters are quite low and hence provide a controlled weak correlation

We assume all images to be defined on discrete rectangular lattice MxN. In the following the Compound MRF model is developed. Let the observed image *X* be modeled as a random field and x is a realization which is the given image. Let *Z* denote the label process associat‐ ed with the segmented image Fig.2(a) shows the three planes of Ohta color model. Each col‐ or plane is modeled by a MRF model. Let *L* denote the number of labels. For a given plane for example Z, if the spatial interactions are modeled by MRF, then the prior probability dis‐

eralized into MRFs when the time indices are considered as spaial indices.

**3. Compound Markov Random Field (COMRF) model**

among the inter planes making it suitable for image segmentation.

tribution *P*(*Z)* is Gibbs distributed and can be expressed as

tial correlation among different color components.

$$\mathbb{C}\_3 = \{ \{i, \dot{i}, \ddot{i} \; \} \; \middle| \; \{i, \dot{i} \; \} \; \dot{i} \; \} \in \mathbb{S} are neighbors to one another \} \tag{5}$$

The sites in a clique are ordered, and {i, i' } is not the same clique as {i' , i}, and so on. The collection of all cliques for (S, N) is

$$\mathbf{C} = \mathbf{C}\_1 \cup \mathbf{C}\_2 \cup \mathbf{C}\_3 \cup \dots \tag{6}$$

The type of a clique for (S, N) of a regular lattice is detetrmined by its size, shape and orien‐ tation. Fig. 1 shows the clique types for the first order and second order neighborhood sys‐ tems for a lattice [2] [3].

Let *Z* = {*Z*1, *Z*2, ..., *Zm*} be a family of random variables defined on the set S, in which each random variable Zi takes a value zi in L. The family Z is called a random field. We use the notion *Zi* = *zi* to denote the event that Zi takes the value zi and the notion (*Z*<sup>1</sup> = *z*1, *Z*<sup>2</sup> = *z*2, ...., *Zm* = *zm*).

To denote the joint event. For simplicity a joint event is abbreviated as Z = z where *z* = {*z*1, *z*2, ...} is a configuration of z, corresponding to realization of a field. For a discrete label set L. the probability that random variable Zi takes the value zi is denoted *P*(*Zi* = *zi* ), abbreviated *P*(*zi* ) and the joint probability is denoted as *P*(*Z* = *z*) = *P*(*Z*<sup>1</sup> = *z*1, *Z*<sup>2</sup> = *z*2, ..., *Zm* = *zm*) and abbreviated P(z).

F is said to be a Markov Random Field on S with respect to a neighborhood system N if and only if the following two conditions are satisfied:

$$\mathbf{P(Z=z)} > \mathbf{0}, \forall z \in Z \tag{Positivity} \tag{7}$$

$$P(z\_i \mid z\_{S-i}) = P(z\_i \mid z\_{N\_i}) \qquad (Markov viability) \tag{8}$$

Where S-i is the set difference, zS-I denotes the set of labels at the sites in S-i and

$$z\_{N\_l} = \{ z\_{\underline{i}\_l} \mid \underline{i}' \in \mathbb{N}\_l \} \tag{9}$$

Stands for the set of labels at the sites neighboring i.

The positivity is assumed for some technical reasons and can usually be satisfied in practice. The Markovianity depicts the local characteristics of Z. In MRF, only neighboring labels have direct interactions with each other[2][3].

The concept of MRF is a generalization of that of Markov processes (MPs) which are widely used in sequence analyisis. An MP is defined on a domain of time rather than space. It is a sequence of random variables Z1, Z2, …., Zm defined in the time indices 1, 2, …, m. It is gen‐ eralized into MRFs when the time indices are considered as spaial indices.

## **3. Compound Markov Random Field (COMRF) model**

''

The type of a clique for (S, N) of a regular lattice is detetrmined by its size, shape and orien‐ tation. Fig. 1 shows the clique types for the first order and second order neighborhood sys‐

Let *Z* = {*Z*1, *Z*2, ..., *Zm*} be a family of random variables defined on the set S, in which each

To denote the joint event. For simplicity a joint event is abbreviated as Z = z where *z* = {*z*1, *z*2, ...} is a configuration of z, corresponding to realization of a field. For a discrete

F is said to be a Markov Random Field on S with respect to a neighborhood system N if and

Where S-i is the set difference, zS-I denotes the set of labels at the sites in S-i and

'

'

The positivity is assumed for some technical reasons and can usually be satisfied in practice. The Markovianity depicts the local characteristics of Z. In MRF, only neighboring labels

' '' ' ''

The sites in a clique are ordered, and {i, i'

takes a value zi

label set L. the probability that random variable Zi

only if the following two conditions are satisfied:

Stands for the set of labels at the sites neighboring i.

have direct interactions with each other[2][3].

to denote the event that Zi

*P*(*Z* = *z*) = *P*(*Z*<sup>1</sup> = *z*1, *Z*<sup>2</sup> = *z*2, ..., *Zm* = *zm*) and abbreviated P(z).

collection of all cliques for (S, N) is

tems for a lattice [2] [3].

84 Advances in Image Segmentation

(*Z*<sup>1</sup> = *z*1, *Z*<sup>2</sup> = *z*2, ...., *Zm* = *zm*).

random variable Zi

abbreviated *P*(*zi*

notion *Zi* = *zi*

<sup>2</sup> {{ , }/ , } *C ii i N i S <sup>i</sup>* = ÎÎ (4)

12 3 *CC C C* = UUU..... (6)

in L. The family Z is called a random field. We use the

) and the joint probability is denoted as

*P Z z z Z Positivity* ( ) 0, = > "Î ( ) (7)

(/ ) (/ ) ( ) *<sup>i</sup> i Si i N P z z P z z Markovianity* - <sup>=</sup> (8)

{/ } *N i <sup>i</sup> <sup>i</sup> z ziN* = Î (9)

takes the value zi and the notion

takes the value zi is denoted *P*(*Zi* = *zi*

, i}, and so on. The

),

<sup>3</sup> *C i i i i i i Sareneighborstoone another* ={{ , , }/ , , Î } (5)

} is not the same clique as {i'

Capturing salient spatial properties of an image lead to the development of image models. MRF theory provides a convenient and consistent way to model context dependent entities for e.g. image pixels and correlated features [6]. Though the MRF model takes into account the local spatial interactions, it has its limitations in modeling natural scenes of distinct re‐ gions. In case of color models, it is known that there is a correlation among the color compo‐ nents of RGB model. In our formulation, we have decorrelated the color components and introduced an interaction process to improve the segmentation accuracy. We have em‐ ployed inter-color-plane interaction (Ohta *I1, I2, I3* color model) process which reinforces par‐ tial correlation among different color components.

In this work, a compound MRF model has been proposed and the proposed model is based on the following notion. The prior MRF model takes care of (i)Intra-color-plane *I1 or I2 or I3 I1, I2, and I3* entities of each color plane(ii)Inter-color-plane interactions of pixels of different col‐ or planes for e.g. *I1 and I2, and I3*. The MRF prior model takes care of the spatial interactions in any given color plane and also interaction of a pixel of a given color plane with the pixel of other color planes. Thus the intra color plane and inter color plane interactions could be modeled by the compound MRF model. Motivation behind this modeling is as follows. It is known that strong correlation exists among different color planes of RGB model and there‐ fore not suitable for image segmentation. On the other hand Ohta model is suitable for im‐ age segmentation because of the existing weak correlation among color planes. In order to develop an appropriate color model, we develop a model with controlled correlation among the different color planes. Therefore, the a prior compound MRF model takes care of the controlled correlation among the different planes of Ohta colorspace. The degree of correla‐ tion is controlled by the associated parameters of the clique potential function *I1, I2, I3*. The values of these parameters are quite low and hence provide a controlled weak correlation among the inter planes making it suitable for image segmentation.

We assume all images to be defined on discrete rectangular lattice MxN. In the following the Compound MRF model is developed. Let the observed image *X* be modeled as a random field and x is a realization which is the given image. Let *Z* denote the label process associat‐ ed with the segmented image Fig.2(a) shows the three planes of Ohta color model. Each col‐ or plane is modeled by a MRF model. Let *L* denote the number of labels. For a given plane for example Z, if the spatial interactions are modeled by MRF, then the prior probability dis‐ tribution *P*(*Z)* is Gibbs distributed and can be expressed as

$$P\left(Z^1 = z^1 \middle| \theta\right) = \left(1 \mid z'\right) e^{-lZ\left(z^1, \theta\right)} \tag{10}$$

Let z denote the labels of pixels taking care of all three color planes. In otherwords, z de‐ notes the labels for pixels of the color image. For example, z{i, j} corresponds to the (i, j) th pixel label consisting of three color components. The prior probability of z has been contrib‐ uted by the intra color plane interactions and inter color plane interactions of pixels. hence, the prior model of z consists of the clique potential functions Vcs(z) and Vct(z) corresponding to intra color plane interactions and inter color plane interactions respectively. The vertical and horizontal line fields for different color planes (k=1, 2, 3) are denoted as v{k} and h{k} re‐

> *i*, *j* , *z <sup>k</sup> i*, *j*−1 )

*i*, *j* − *z <sup>k</sup> i*−1, *j* |

http://dx.doi.org/10.5772/50475

87

*i*, *j* −1) = | *z <sup>k</sup>*

*i*, *j* − *z <sup>k</sup> i*−1, *j* |.

*i*, *j* , *z <sup>k</sup>*

*i*, *j* , *z <sup>k</sup>*

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

) >*threshold*, else v {i, j} {k}=0. Similarly, in case of hori‐

= + (12)

<sup>=</sup> å (13)

<sup>=</sup> å (14)

k for k=1, 2, 3 denote the horizontal line field for

k for k=1, 2, 3 denote the vertical line fields for

*i*, *j* −1) = | *z <sup>k</sup>*

spectively. The horizontal and vertical line fields are defined as follows. Let *<sup>f</sup> <sup>v</sup>*(*<sup>z</sup> <sup>k</sup>*

) >*threshold*. Vertical line field for each plane is set i.e.

) be defined as *<sup>f</sup> <sup>h</sup>* (*<sup>z</sup> <sup>k</sup>*

( ,,, ) ( ) ( ) *Uz U z U z s t* qqq

> ( ) ( ) , , , *<sup>s</sup> s c i j Uz V z* q

> ( ) ( ) , , , *<sup>t</sup> t c i j Uz V z* q

plane respectively. Vcs (zi, j) corresponds to the intra-color-plane pixels and Vct (zi, j) corre‐

inter-color-plane directions. Thus the compound MRF model will have the energy function

*kk k k k k k*

é ù = - -+- - ê ú ë û


( ) ( ) ( ) ( ) ( ) <sup>3</sup> 2 2 , , ,1 , , 1, ,

*c ij ij ij ij ij i j ij*

1 1 *<sup>s</sup>*

*Vz z z v z z h*

 q

 q

(z, *θ*) refers to the energy function of intra-color-plane and inter-color-

<sup>å</sup> (15)

Horizontal line field for k th plane is set, i.e. h {i, j} {k} =1 for k=1, 2, 3, if else h {i, j} {k} =1. Since the compound MRF model takes care of intra color plane as well as inter color plane interac‐ tions the prior probability distribution is given by (10), where the energy function can be ex‐

for the kth color plane be defined as *<sup>f</sup> <sup>v</sup>*(*<sup>z</sup> <sup>k</sup>*

*i*, *j* , *z <sup>k</sup> i*, *j*−1

*i*−1, *j* , *z <sup>k</sup> i*, *j*

*<sup>f</sup> <sup>h</sup>* (*<sup>z</sup> <sup>k</sup> i*, *j* , *z <sup>k</sup> i*, *j*−1

pressed as,

Where,

Here, Us(z, *θ*) and Ut

sponds to inter-color-plane pixels. Let hs

each color plane in intra-color-plane and ht

given by (12). Equation (13) can be written as,

1 , ,

=

a

*k*

*ij ij*

*v h*

+ + é ù ë û

*k*

b

v{i, j} {k}=1 for k=1, 2, 3, if *<sup>f</sup> <sup>v</sup>*(*<sup>z</sup> <sup>k</sup>*

zontal line field let *<sup>f</sup> <sup>h</sup>* (*<sup>z</sup> <sup>k</sup>*

where *Z* ′ =∑ *z* ′ *e* <sup>−</sup>*<sup>U</sup>* (*<sup>z</sup>* ′ ,*θ*) is the partition function, *U* (*z* <sup>1</sup> , *θ*) is the energy function and is of the form *U* (*z* ' , *θ*) = ∑ *c*∈*C Vc*(*z* ' , *θ*) being referred to as cliqe potential function, *θ* denotes the cli‐ que parameter vector. Analogously the spatial interactions of *I*2 and I3 planes can be defined. This prior MRF model taking care of all the three spatial planes would result in the energy function of the following form

$$\begin{aligned} P\left(Z = z \, \middle| \, \theta\right) &= \left(1 \, \middle| \, z' \right) e^{-tL\left(z, \theta\right)} \\ z' &= \sum\_{z} e^{-tL\left(z, \theta\right)} \\ L\left(z, \theta\right) &= \sum\_{c \in C} V\_{c}\left(z, \theta\right) \end{aligned} \tag{11}$$

where, *Vc* (*z*, *θ*) denotes the clique potential function for the three spatial planes I1, I2 and I3 respectively. However, the model is not complete for the color model. We model Z as a com‐ pound MRF, where the spatial interactions of individual color planes are taken care together with the inter color plane interactions of pixels. The inter color plane interactions of pixels of one plane with the other is shown in Fig.1(a). For the sake of illustration, Fig.1(b) shows in‐ teraction of (i, j) {th} pixel of I2 plane with the pixels of I1 plane with the first order neighbour‐ hood structure in the inter color plane direction. If this inter color plane interactions need to modeled with the MRF prior, we can express

$$\begin{aligned} \mathbf{P}(\mathbf{Z}^{\operatorname{I}\_{2}}\_{\operatorname{i},j}=\mathbf{z}^{\operatorname{I}\_{2}}\_{\operatorname{i},j}\Big|\mathbf{Z}^{\operatorname{I}\_{1}}\_{\operatorname{k},l},\mathbf{z}^{\operatorname{I}\_{1}}\_{\operatorname{k},l'}\Big|\mathbf{k},\operatorname{l}\big)\in\operatorname{I}\_{1}\big) = \\\mathbf{P}(\mathbf{Z}^{\operatorname{I}\_{2}}\_{\operatorname{i},j}=\mathbf{z}^{\operatorname{I}\_{2}}\_{\operatorname{i},j}\Big|\mathbf{Z}^{\operatorname{I}\_{1}}\_{\operatorname{i},l}=\mathbf{z}^{\operatorname{I}\_{1}}\_{\operatorname{i},l'}\Big|\mathbf{k},\operatorname{l}\big)\neq\big(\mathbf{i},\operatorname{i}\big),\text{ (k,l)}\in\operatorname{\eta}^{\operatorname{I}\_{1}}\_{\operatorname{i},j}\Big|\mathbf{k}\big)\end{aligned}$$

**Figure 2.** (a) I1, I2, I3 Plane Interaction (b) Interaction of one pixel of I1 –plane with I2 -plane.

Let z denote the labels of pixels taking care of all three color planes. In otherwords, z de‐ notes the labels for pixels of the color image. For example, z{i, j} corresponds to the (i, j) th pixel label consisting of three color components. The prior probability of z has been contrib‐ uted by the intra color plane interactions and inter color plane interactions of pixels. hence, the prior model of z consists of the clique potential functions Vcs(z) and Vct(z) corresponding to intra color plane interactions and inter color plane interactions respectively. The vertical and horizontal line fields for different color planes (k=1, 2, 3) are denoted as v{k} and h{k} re‐ spectively. The horizontal and vertical line fields are defined as follows. Let *<sup>f</sup> <sup>v</sup>*(*<sup>z</sup> <sup>k</sup> i*, *j* , *z <sup>k</sup> i*, *j*−1 ) for the kth color plane be defined as *<sup>f</sup> <sup>v</sup>*(*<sup>z</sup> <sup>k</sup> i*, *j* , *z <sup>k</sup> i*, *j* −1) = | *z <sup>k</sup> i*, *j* − *z <sup>k</sup> i*−1, *j* | *<sup>f</sup> <sup>h</sup>* (*<sup>z</sup> <sup>k</sup> i*, *j* , *z <sup>k</sup> i*, *j*−1 ) >*threshold*. Vertical line field for each plane is set i.e.

v{i, j} {k}=1 for k=1, 2, 3, if *<sup>f</sup> <sup>v</sup>*(*<sup>z</sup> <sup>k</sup> i*, *j* , *z <sup>k</sup> i*, *j*−1 ) >*threshold*, else v {i, j} {k}=0. Similarly, in case of hori‐ zontal line field let *<sup>f</sup> <sup>h</sup>* (*<sup>z</sup> <sup>k</sup> i*−1, *j* , *z <sup>k</sup> i*, *j* ) be defined as *<sup>f</sup> <sup>h</sup>* (*<sup>z</sup> <sup>k</sup> i*, *j* , *z <sup>k</sup> i*, *j* −1) = | *z <sup>k</sup> i*, *j* − *z <sup>k</sup> i*−1, *j* |.

Horizontal line field for k th plane is set, i.e. h {i, j} {k} =1 for k=1, 2, 3, if else h {i, j} {k} =1. Since the compound MRF model takes care of intra color plane as well as inter color plane interac‐ tions the prior probability distribution is given by (10), where the energy function can be ex‐ pressed as,

$$\mathcal{U}\mathcal{U}\left(z,\theta\right) = \mathcal{U}\_s\left(z,\theta\right) + \mathcal{U}\_t\left(z,\theta\right) \tag{12}$$

Where,

( ) ( ) ( ) <sup>1</sup> , 1 1 1 / *U z PZ z z e*

que parameter vector. Analogously the spatial interactions of *I*2 and I3 planes can be defined. This prior MRF model taking care of all the three spatial planes would result in the energy

,

(*z*, *θ*) denotes the clique potential function for the three spatial planes I1, I2 and I3

*I*1 *i*, *j* )

q

*U z*


( ) ( ) ( ) ( )

> *c c C*

 q

respectively. However, the model is not complete for the color model. We model Z as a com‐ pound MRF, where the spatial interactions of individual color planes are taken care together with the inter color plane interactions of pixels. The inter color plane interactions of pixels of one plane with the other is shown in Fig.1(a). For the sake of illustration, Fig.1(b) shows in‐ teraction of (i, j) {th} pixel of I2 plane with the pixels of I1 plane with the first order neighbour‐ hood structure in the inter color plane direction. If this inter color plane interactions need to

( ) ( )

, ,

å

Î

*Uz V z*

=

, 1 /

= = ¢

q

*U z*

*PZ z z e*

q


*z*

å

q

*z e*

¢ =

, (*k*, *l*) ∈ *I*1) =

**Figure 2.** (a) I1, I2, I3 Plane Interaction (b) Interaction of one pixel of I1 –plane with I2 -plane.

, (*k*, *l*) ≠ (*i*, *j*), (*k*, *l*) ∈ *η*

q-

is the partition function, *U* (*z* <sup>1</sup>

where *Z* ′

form *U* (*z* '

where, *Vc*

*P*(*Z <sup>I</sup>*<sup>2</sup>

*P*(*Z <sup>I</sup>*<sup>2</sup>

*<sup>i</sup>*, *<sup>j</sup>* <sup>=</sup> *<sup>z</sup> I*2 *<sup>i</sup>*, *<sup>j</sup>* / *<sup>Z</sup> <sup>I</sup>*<sup>1</sup> *k* ,*l z I*1 *k* ,*l*

*<sup>i</sup>*, *<sup>j</sup>* <sup>=</sup> *<sup>z</sup> I*2 *<sup>i</sup>*, *<sup>j</sup>* / *<sup>Z</sup> <sup>I</sup>*<sup>1</sup>

=∑ *z* ′

86 Advances in Image Segmentation

*e* <sup>−</sup>*<sup>U</sup>* (*<sup>z</sup>* ′ ,*θ*)

*Vc*(*z* '

modeled with the MRF prior, we can express

*<sup>k</sup>* ,*<sup>l</sup>* <sup>=</sup> *<sup>z</sup> I*1 *k* ,*l*

, *θ*) = ∑ *c*∈*C*

function of the following form

q

= = ¢ (10)

, *θ*) being referred to as cliqe potential function, *θ* denotes the cli‐

, *θ*) is the energy function and is of the

(11)

$$\mathcal{U}\_s\left(z,\theta\right) = \sum\_{i,j} V\_{c\_s}\left(z,\theta\right) \tag{13}$$

$$\text{U}\,\mathcal{U}\_t\left(z,\theta\right) = \sum\_{i,j} V\_{c\_i}\left(z,\theta\right) \tag{14}$$

Here, Us(z, *θ*) and Ut (z, *θ*) refers to the energy function of intra-color-plane and inter-colorplane respectively. Vcs (zi, j) corresponds to the intra-color-plane pixels and Vct (zi, j) corre‐ sponds to inter-color-plane pixels. Let hs k for k=1, 2, 3 denote the horizontal line field for each color plane in intra-color-plane and ht k for k=1, 2, 3 denote the vertical line fields for inter-color-plane directions. Thus the compound MRF model will have the energy function given by (12). Equation (13) can be written as,

$$\begin{split} V\_{c\_i} \left( \mathbf{z}\_{i,j} \right) &= \sum\_{k=1}^{3} \alpha^k \left[ \left( \mathbf{z}^k\_{\ i,j} - \mathbf{z}^k\_{\ i,j-1} \right)^2 \left( \mathbf{1} - \mathbf{v}^k\_{\ i,j} \right) + \left( \mathbf{z}^k\_{\ i,j} - \mathbf{z}^k\_{\ i-1,j} \right)^2 \left( \mathbf{1} - \mathbf{h}^k\_{\ i,j} \right) \right] \\ &+ \rho^k \left[ \mathbf{v}\_{i,j} + \mathbf{h}\_{i,j} \right] \end{split} \tag{15}$$

Here, z1 , z2 , z3 correspond to I1, I2, I3 planes respectively. The equation (14) can be written as,

i.e., the conditional expected value of the next observation, given all of the past bservations,

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

Capturing the salient spatial properties of an image lead to the development of image mod‐ els [3]. Though the MRF model takes into account the local spatial interactions, it has its lim‐ itations in modeling natural scenes of distinct regions. In order to incorporate a stronger local dependence, we constrain this model based on the notion of martingale.The motivation

MRF model takes care of the local spatial interactions, nevertheless it has limitation in mod‐ eling natural scenes. In the following we propose new model with a view to take care of in‐ tra as well as inter plane interactions. In this research work, we employed the notion of martingale to reinforce the local dependence. Let *Z*(*i*), *i* =1, 2, ......*n* be a martingale se‐

and *E Z*(*n* + 1) / *Z*(1), .....*Z*(*n*) =*Z*(*n*). Now, let *Z*1, *Z*2, .....*Zn* be the random variables associ‐

, , , , ,, , | ,, , | ,, ,

, , ,,,,, ,

*ij kl ij ij ij kl kl ij*


*i j i j*

, ,

,, , ( ) , , *i j i j*

*kl ij ij U z z L z L <sup>e</sup> z kl z <sup>e</sup>* h

*z L z L*

, where *ηi*, *<sup>j</sup>*

é ùé ¹= = = ¹ <sup>ù</sup> ë ûë å <sup>û</sup> (17)

( ) ( ) , ,

<sup>=</sup> é ù ¹ = ë û <sup>=</sup> <sup>å</sup> <sup>å</sup> (19)

, *k*, *l* ≠*i*, *j* = *zk* ,*<sup>l</sup>* ∀ *k*, *l* ∈ *ηi*, *<sup>j</sup>*

Î = <sup>å</sup> <sup>å</sup> (20)

*PZ z*

( )

*U z*


for any *k*, *l* ∈*ηi*, *<sup>j</sup>*

,

*i j ij kl ij ij ij kl kl z L E Z Z kl ij z P Z z Z z kl ij* Î

,

*z L*

, , , | ,, ,

*ij kl i j*

*E Z Z kl ij z PZ z* <sup>Î</sup> <sup>Î</sup>

å

Î

*E Z Z kl i j z PZ z Z z kl*

é ù ¹= = = Î ë û

*i j*

and *G* is the predefined number of class labels. Therefore,

h

is the neighborhood of *i*, *j*. Con‐

http://dx.doi.org/10.5772/50475

89

(18)

is equal to the last observation.

behind the new model is as follows.

ated with the image of size *n* = *N* <sup>2</sup>

, *k*, *l* ≠*i*, *j* =*Zi*−1, *<sup>j</sup>*

*E Zi*, *<sup>j</sup>* / *Zk* ,*<sup>l</sup>*

Since Z is a MRF,

sider,

quence, namely for all *i* =1, 2, ......*n E* |*Z*(*n*)| <*∞*

Assuming further that Z is a Markov process, we have

, ,

Î Î

*i j i j*

,

<sup>å</sup> <sup>å</sup>

Since Zi, j is a martingle sequence *E Zi*, *<sup>j</sup>* |*Zk* ,*<sup>l</sup>*

*i j z L z L*

( ) ( )

= =

*PZ z <sup>z</sup> PZ z*

$$\begin{split} \mathbb{V}\_{c\_{i}}\{z\_{i,j}\} &= \alpha^{1} \Big[ (\boldsymbol{z}^{1}\_{\boldsymbol{i},j} - \boldsymbol{z}^{2}\_{\boldsymbol{i},j-1})^{2} \Big( \mathbb{1} - \boldsymbol{v}^{1}\_{\boldsymbol{i},j} \Big) + \Big( \boldsymbol{z}^{1}\_{\boldsymbol{i},j} - \boldsymbol{z}^{2}\_{\boldsymbol{i},j-1} \Big) \Big] \mathbb{1} + \beta^{1} \Big[ \boldsymbol{v}^{1}\_{\boldsymbol{i},j} + \boldsymbol{h}^{1}\_{\boldsymbol{i},j} \Big] \\ &+ \alpha^{2} \Big[ (\boldsymbol{z}^{2}\_{\boldsymbol{i},j} - \boldsymbol{z}^{3}\_{\boldsymbol{i},j-1})^{2} \Big( \mathbb{1} - \boldsymbol{v}^{2}\_{\boldsymbol{i},j} \Big) + \Big( \boldsymbol{z}^{2}\_{\boldsymbol{i},j} - \boldsymbol{z}^{3}\_{\boldsymbol{i},j-1} \Big) \Big] \mathbb{1} + \boldsymbol{h}^{2} \Big[ \boldsymbol{v}^{2}\_{\boldsymbol{i},j} + \boldsymbol{h}^{2}\_{\boldsymbol{i},j} \Big] \\ &+ \alpha^{3} \Big[ \big( \boldsymbol{z}^{3}\_{\boldsymbol{i},j} - \boldsymbol{z}^{1}\_{\boldsymbol{i},j-1} \Big) \Big( \mathbb{1} - \boldsymbol{v}^{3}\_{\boldsymbol{i},j} \Big) + \Big( \boldsymbol{z}^{3}\_{\boldsymbol{i},j} - \boldsymbol{z}^{1}\_{\boldsymbol{i},j-1} \Big) \Big[ \mathbb{1} - \boldsymbol{h}^{3}\_{\boldsymbol{i},j} \Big] \Big] + \beta^{3} \Big[ \boldsymbol{v}^{3}\_{\boldsymbol{i},j} + \boldsymbol{h}^{3}\_{\boldsymbol{i},j} \Big] \end{split} \tag{16}$$

Where z1 denotes the interaction between I1-I2 color planes, z2 denotes the interaction be‐ tween I2-I3 color planes and z3 denotes the interaction between I3-I1 color planes respectively. Here we have assumed, *α*<sup>1</sup> <sup>=</sup>*α*<sup>2</sup> <sup>=</sup>*α*<sup>3</sup> <sup>=</sup>*α* and *β*<sup>1</sup> <sup>=</sup>*β*<sup>2</sup> <sup>=</sup>*β*<sup>3</sup> <sup>=</sup> *<sup>β</sup>*. The *α*, *<sup>β</sup> <sup>T</sup>* is the set of unknown parameter vector that are selected on *ad hoc* basis. Since the line fields correspond to the edge pixels and in turn the boundary of a given segment. The similarity measure in case of boundary pixels for k=1, 2, 3 is not required and hence for boundary pixels, i.e. when hi, j=1 and vi, j=1, for k=1, 2, 3 the clique potential function of (16) consists of only the penalty func‐ tion. Therefore the boundary pixels should not participate in the formation of regions with similarity measure.

## **4. Constrained Markov Random Field (MRF) model**

In probability theory, a martingale is a stochastic process (i.e., a sequence of random varia‐ bles) such that the conditional expected value of an observation at some time t, given all the observations up to some earlier time s, is equal to the observation at that earlier time s. Pre‐ cise definitions are given below.

Originally, martingale referred to a class of betting strategies popular during 18th century, in France. The simplest of these strategies was designed for a game in which the gambler wins his stake if a coin comes up heads and loses it if the coin comes up tails. The strategy had the gambler double his bet after every loss, so that the first win would recover all previ‐ ous losses plus win a profit equal to the original stake. Since as a gambler's wealth and avail‐ able time jointly approach infinity his probability of eventually flipping heads approaches 1. The martingale betting strategy was seen as a sure thing by those who practiced it. Of course in reality the exponential growth of the bets would eventually bankrupt those foolish enough to use the martingale for a long time. The concept of martingale in probability theo‐ ry was introduced by Paul Pierre Lévy, and much of the original development of the theo‐ ry was done by Joseph Leo Doob. Part of the motivation for that work was to show the impossibility of successful betting strategies.

A discrete-time martingale is a discrete-time stochastic process (i.e., a sequence of random variables X1, X2, X3 that satisfies for all n,

$$\begin{aligned} E(\mid X\_n \mid ) &< \infty \\ E(X\_{n+1} / X\_{1\prime} \mid X\_{2\prime} \mid X\_{3\prime} \dots \mid X\_n) &= X\_n \end{aligned}$$

i.e., the conditional expected value of the next observation, given all of the past bservations, is equal to the last observation.

Capturing the salient spatial properties of an image lead to the development of image mod‐ els [3]. Though the MRF model takes into account the local spatial interactions, it has its lim‐ itations in modeling natural scenes of distinct regions. In order to incorporate a stronger local dependence, we constrain this model based on the notion of martingale.The motivation behind the new model is as follows.

MRF model takes care of the local spatial interactions, nevertheless it has limitation in mod‐ eling natural scenes. In the following we propose new model with a view to take care of in‐ tra as well as inter plane interactions. In this research work, we employed the notion of martingale to reinforce the local dependence. Let *Z*(*i*), *i* =1, 2, ......*n* be a martingale se‐ quence, namely for all *i* =1, 2, ......*n E* |*Z*(*n*)| <*∞*

and *E Z*(*n* + 1) / *Z*(1), .....*Z*(*n*) =*Z*(*n*). Now, let *Z*1, *Z*2, .....*Zn* be the random variables associ‐ ated with the image of size *n* = *N* <sup>2</sup> and *G* is the predefined number of class labels. Therefore, *E Zi*, *<sup>j</sup>* / *Zk* ,*<sup>l</sup>* , *k*, *l* ≠*i*, *j* =*Zi*−1, *<sup>j</sup>* for any *k*, *l* ∈*ηi*, *<sup>j</sup>* , where *ηi*, *<sup>j</sup>* is the neighborhood of *i*, *j*. Con‐ sider,

$$\mathbb{E}\left[Z\_{i,j} \mid Z\_{k,l'}, k, l \neq i, j\right] = \sum\_{z\_{i,j} \in L} z\_{i,j} \mathbb{P}\left[Z\_{i,j} = z\_{i,j} \mid Z\_{k,l} = z\_{k,l'}, k, l \neq i, j\right] \tag{17}$$

Assuming further that Z is a Markov process, we have

$$\begin{aligned} \mathbb{E}\left[\mathbb{Z}\_{i,j} \mid Z\_{\mathbf{z}\_{i,l}}, k, l \neq i, j\right] &= \sum\_{z\_{i,j} \in L} z\_{i,j} \mathbb{P}(Z\_{z\_{i,j}} = z\_{i,j} \mid Z\_{\mathbf{z}\_{i,l}} = z\_{\mathbf{z}\_{k,l}}, k, l \in \eta\_{i,j}) \\ \sum\_{z\_{i,j} \in L} z\_{i,j} \frac{\mathbb{P}(Z = \mathbf{z})}{\sum\_{z\_{i,j} \in L} \mathbb{P}(Z = \mathbf{z})} \end{aligned} \tag{18}$$

Since Z is a MRF,

Here, z1

*Vct* (*zi*, *<sup>j</sup>*

Where z1

+*α* <sup>2</sup> (*z* <sup>2</sup>

+*α* <sup>3</sup> (*z* <sup>3</sup>

, z2 , z3

88 Advances in Image Segmentation

) =*α* <sup>1</sup> (*z* <sup>1</sup>

*i*, *j* − *z* <sup>3</sup> *i*, *j*−1 )2 (1−*v* <sup>2</sup> *i*, *j* ) + (*z* <sup>2</sup> *i*, *j* − *z* <sup>3</sup> *i*, *j*−1 )2 (1−*h* <sup>2</sup> *i*, *j*

*i*, *j* − *z* <sup>1</sup> *i*, *j*−1 )2 (1−*v* <sup>3</sup> *i*, *j* ) + (*z* <sup>3</sup> *i*, *j* − *z* <sup>1</sup> *i*, *j*−1 )2 (1−*h* <sup>3</sup> *i*, *j*

similarity measure.

cise definitions are given below.

impossibility of successful betting strategies.

variables X1, X2, X3 that satisfies for all n,

*E*(*Xn*+1 / *X*1, *X*2, *X*3, ..., *Xn*) = *Xn*

*E*(| *Xn* |)<*∞*

*i*, *j* − *z* <sup>2</sup> *i*, *j*−1 )2 (1−*v* <sup>1</sup> *i*, *j* ) + (*z* <sup>1</sup> *i*, *j* − *z* <sup>2</sup> *i*, *j*−1 )2 (1−*h* <sup>1</sup> *i*, *j*

denotes the interaction between I1-I2 color planes, z2

**4. Constrained Markov Random Field (MRF) model**

tween I2-I3 color planes and z3 denotes the interaction between I3-I1 color planes respectively. Here we have assumed, *α*<sup>1</sup> <sup>=</sup>*α*<sup>2</sup> <sup>=</sup>*α*<sup>3</sup> <sup>=</sup>*α* and *β*<sup>1</sup> <sup>=</sup>*β*<sup>2</sup> <sup>=</sup>*β*<sup>3</sup> <sup>=</sup> *<sup>β</sup>*. The *α*, *<sup>β</sup> <sup>T</sup>* is the set of unknown parameter vector that are selected on *ad hoc* basis. Since the line fields correspond to the edge pixels and in turn the boundary of a given segment. The similarity measure in case of boundary pixels for k=1, 2, 3 is not required and hence for boundary pixels, i.e. when hi, j=1 and vi, j=1, for k=1, 2, 3 the clique potential function of (16) consists of only the penalty func‐ tion. Therefore the boundary pixels should not participate in the formation of regions with

In probability theory, a martingale is a stochastic process (i.e., a sequence of random varia‐ bles) such that the conditional expected value of an observation at some time t, given all the observations up to some earlier time s, is equal to the observation at that earlier time s. Pre‐

Originally, martingale referred to a class of betting strategies popular during 18th century, in France. The simplest of these strategies was designed for a game in which the gambler wins his stake if a coin comes up heads and loses it if the coin comes up tails. The strategy had the gambler double his bet after every loss, so that the first win would recover all previ‐ ous losses plus win a profit equal to the original stake. Since as a gambler's wealth and avail‐ able time jointly approach infinity his probability of eventually flipping heads approaches 1. The martingale betting strategy was seen as a sure thing by those who practiced it. Of course in reality the exponential growth of the bets would eventually bankrupt those foolish enough to use the martingale for a long time. The concept of martingale in probability theo‐ ry was introduced by Paul Pierre Lévy, and much of the original development of the theo‐ ry was done by Joseph Leo Doob. Part of the motivation for that work was to show the

A discrete-time martingale is a discrete-time stochastic process (i.e., a sequence of random

correspond to I1, I2, I3 planes respectively. The equation (14) can be written as,

) + *β* <sup>1</sup> *v* <sup>1</sup>

*i*, *j* + *h* <sup>2</sup> *i*, *j*

*i*, *j* + *h* <sup>3</sup> *i*, *j*

) + *β* <sup>2</sup> *v* <sup>2</sup>

) + *β* <sup>3</sup> *v* <sup>3</sup>

*i*, *j* + *h* <sup>1</sup> *i*, *j*

denotes the interaction be‐

(16)

$$\mathbb{E}\left[Z\_{i\_{\cdot,j}} \mid Z\_{k,l}, k, l \neq i\_{\cdot}; j\right] = \sum\_{z\_{i\_{\cdot,j}} \in L} z\_{i\_{\cdot,j}} \frac{P\left(Z = z\right)}{\sum\_{z\_{i\_{\cdot,j}} \in L} P\left(Z = z\right)}\tag{19}$$

Since Zi, j is a martingle sequence *E Zi*, *<sup>j</sup>* |*Zk* ,*<sup>l</sup>* , *k*, *l* ≠*i*, *j* = *zk* ,*<sup>l</sup>* ∀ *k*, *l* ∈ *ηi*, *<sup>j</sup>*

$$z\_{k,l}, k, l \in \eta\_{i,j} = \sum\_{z\_{i,j} \in L} z\_{i,j} \frac{e^{-lI(z)}}{\sum\_{z\_{i,j} \in L} e^{-lI(z)}} \tag{20}$$

Considering first order neighbourhood and choosing one of the neighbourhood pixels for example *zi-1, j,* equation(20) can be expressed as

$$z\_{i-1,j} = \sum\_{z\_{i,j}\in L} z\_{i,j} \frac{e^{-\mathcal{U}(z)}}{\sum\_{z\_{i,j}\in L} e^{-\mathcal{U}(z)}}$$

Instead of taking a given pixel from the neighbourhood *zi-1, j*, we take the average of the neighborhood pixels. The *a priori* model of *Z* takes care of this constraint and the *U*(*Z*) is modified as (for∀ (*i*, *j*))

$$LL(\mathbf{z}) = \sum\_{i,j} LL(z\_{i,j}) + \lambda\_{\mathbf{c}} \| z\_{i,j\_{avg}} - \sum\_{z\_{i,j} \in L} z\_{i,j} \frac{e^{-lI(\mathbf{z})}}{\sum\_{z\_{i,j} \in L} e^{-lI(\mathbf{z})}} \| ^2 \tag{21}$$

Where Usc denote the energy function corresponding to intra color plane interactions and

el parameter. The energy function taking care of both intra-color-plane and inter-color-plane

( ) ( , , , , ) ( ) *c c UZ U z U z s ij t ij* = + q

(*zi*, *<sup>j</sup>*

In unsupervised scheme, the MAP estimates of the labels and the estimates of the model pa‐ rameters are carried out concurrently. Thus, an estimation strategy need to be developed, which using the observed image, X, will yield an optimal pair (Zopt, *θ*opt). The following joint

The estimated pair satisfying (26) is the global optima of P(Z=z/X=x, *θ*) with respect to Z and *θ*. Since both the entities Z and *θ* are unknown, and interdependent the problem is a very hard problem. Therefore, it is necessary to opt for strategies for suboptimal solution. In (26), z, *θ*could be viewed as a set of parameter of the given function P(Z=z/X=x, *θ*). For such kind of problems in deterministic framework, Wendell and Horter have proposed an alternate approach that would yield suboptimal solutions instead of optimal solution. Their approach is based on splitting the variables followed by recursively estimating the parameters. The fi‐ nal estimate in this process is called as the partial optimal solution. In our case, in stochastic framework, we in the same spirit venture to split the original problem into estimation of la‐ bels (z) and parameters estimate *θ* to obtain the partial optimal solutions. The splitting of

( , arg max ) , ( , ) *opt opt <sup>z</sup> z P Z zX x* q

( ) ( ) \* \* arg max , *<sup>z</sup> <sup>z</sup>* = == *P Z zX x*

( ) ( ) \* \* \* arg max*PZ z X x*.

q

q

q

 q

= == (28)

q

*e* −*U* (*z i*, *j* )

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

 q

, *θ*) is defined by (14).

 q

= == (26)

(27)

) and λc is the constrained mod‐

http://dx.doi.org/10.5772/50475

91

(25)

∑*z i*, *j* <sup>∈</sup>*<sup>L</sup> e* −*U* (*z i*, *j*

*avg* = ∑ *zi*, *<sup>j</sup>* ∈*L zi*, *<sup>j</sup>*

) are given by (15) and (16) respectively.

Vcs(zi, j) is defined by (15). Where, *Zi*, *<sup>j</sup>*

Where *Usc*

*Vcs* (*zi*, *<sup>j</sup>* (*zi*, *<sup>j</sup>*

(*zi*, *<sup>j</sup>*

**5. Unsupervised framework**

optimality criterion is considered,

the variables can be expressed as follows

) and *Vct*

interactions with intra plane constraints is given by

, *θ*) is defined by (24) and *Utc*

Where *zi*, *<sup>j</sup> avg* = ∑ *zi*, *<sup>j</sup>* ∈*L zi*, *<sup>j</sup> e* <sup>−</sup>*<sup>U</sup>* (*z*) ∑*zi*, *<sup>j</sup>* <sup>∈</sup>*<sup>L</sup> <sup>e</sup>* <sup>−</sup>*<sup>U</sup>* (*z*) and λc is the constrained model parameter. The energy

function consists of two terms

$$\mathcal{L}\mathcal{L}(\mathbf{z}) = \sum\_{c \in \mathcal{C}\_{\gg}} V\_c(\mathbf{z}\_s^1, \mathbf{z}\_s^2, \mathbf{z}\_s^3) \quad + \sum\_{c \in \mathcal{C}\_{\gg}} V\_c(\mathbf{z}\_t^1, \mathbf{z}\_t^2, \mathbf{z}\_t^3) \tag{22}$$

Where *Vc*(*zs* 1 , *zs* 2 , *zs* 3 ) and *Vc*(*zt* 1 , *zt* 2 , *zt* 3 ) are given by (15) and (16) respectively.

#### **4.1. Constrained Compound Markov Random Field (CCMRF) model**

The notions of the Constrained model has been fused with the notion of Compound Model to develop a new model known as Constrained Compound Model [10].

The model is given by

$$\mathrm{LI}\_{sc}\left(Z\right) = \sum\_{i,j} \mathrm{LI}\left(z\_{i,j}\right) + \lambda\_{\varepsilon} \left\{ z\_{i,j\_{\mathrm{avg}}} - \sum\_{z\_{i,j} \in \mathcal{L}} z\_{i,j} \frac{e^{-\mathrm{LI}\left(z\_{i,j}\right)}}{\sum\_{z\_{i,j} \in \mathcal{L}} e^{-\mathrm{LI}\left(z\_{i,j}\right)}} \right\}^2 \tag{23}$$

Where,

$$\mathcal{U}\_{sc}\left(Z\right) = V\_{c\_s}\left(z\_{i,j}\right) + \lambda\_c \left| z\_{i,j\_{avg}} - \sum\_{z\_{i,j} \in L} z\_{i,j} \frac{e^{-\mathcal{U}\left(z\_{i,j}\right)}}{\sum\_{z\_{i,j} \in L} e^{-\mathcal{U}\left(z\_{i,j}\right)}}\right| \tag{24}$$

Where Usc denote the energy function corresponding to intra color plane interactions and Vcs(zi, j) is defined by (15). Where, *Zi*, *<sup>j</sup> avg* = ∑ *zi*, *<sup>j</sup>* ∈*L zi*, *<sup>j</sup> e* −*U* (*z i*, *j* ) ∑*z i*, *j* <sup>∈</sup>*<sup>L</sup> e* −*U* (*z i*, *j* ) and λc is the constrained mod‐ el parameter. The energy function taking care of both intra-color-plane and inter-color-plane interactions with intra plane constraints is given by

$$\text{CLI}\left(Z\right) = \text{LI}\_{s\_i}\left(z\_{i,j}, \theta\right) + \text{LI}\_{t\_i}\left(z\_{i,j}, \theta\right) \tag{25}$$

Where *Usc* (*zi*, *<sup>j</sup>* , *θ*) is defined by (24) and *Utc* (*zi*, *<sup>j</sup>* , *θ*) is defined by (14).

*Vcs* (*zi*, *<sup>j</sup>* ) and *Vct* (*zi*, *<sup>j</sup>* ) are given by (15) and (16) respectively.

## **5. Unsupervised framework**

Considering first order neighbourhood and choosing one of the neighbourhood pixels for

Instead of taking a given pixel from the neighbourhood *zi-1, j*, we take the average of the neighborhood pixels. The *a priori* model of *Z* takes care of this constraint and the *U*(*Z*) is

> ,, , ( ) , () ( ) { } *avg*

*ij c ij i j U z i j z L z L <sup>e</sup> Uz Uz z z <sup>e</sup>* l

> <sup>123</sup> <sup>123</sup> () ( , , ) ( , , ) *in ir*

*c C c C Uz V z z z V z z z* Î Î

*css s ct t t*

The notions of the Constrained model has been fused with the notion of Compound Model

( ) ( ) ( )

*<sup>e</sup> U Z Uz z z*

l

å å

*sc ij c ij i j U z i j z L*

,, ,

( ) ( ) ( )

*<sup>e</sup> UZ Vz z z*

l

,, ,

*sc c i j c i j i j U z z L*

*<sup>s</sup> avg i j i j*

å

ï ï =+ - í ý

ï ï = +- í ý

, ,

*i j i j*

( ) <sup>2</sup>

= +- å å <sup>å</sup> (21)

<sup>∈</sup>*<sup>L</sup> <sup>e</sup>* <sup>−</sup>*<sup>U</sup>* (*z*) and λc is the constrained model parameter. The energy

= + å å (22)

) are given by (15) and (16) respectively.

( ) ,

( ) ,

*i j*

*U z*

*e*

*i j*

*U z*

*e*

2

(23)

(24)

, , ,

, , ,


å

ì ü

ï ï î þ

*i j*

*z L*


*z L*


*avg i j i j i j*

ï ï î þ

ì ü


å

*U z*


example *zi-1, j,* equation(20) can be expressed as

*e* <sup>−</sup>*<sup>U</sup>* (*z*)

<sup>∈</sup>*<sup>L</sup> e* <sup>−</sup>*<sup>U</sup>* (*z*)

*e* <sup>−</sup>*<sup>U</sup>* (*z*)

∑*zi*, *<sup>j</sup>*

) and *Vc*(*zt*

,

1 , *zt* 2 , *zt* 3

**4.1. Constrained Compound Markov Random Field (CCMRF) model**

to develop a new model known as Constrained Compound Model [10].

∑*zi*, *<sup>j</sup>*

modified as (for∀ (*i*, *j*))

90 Advances in Image Segmentation

*avg* = ∑ *zi*, *<sup>j</sup>* ∈*L zi*, *<sup>j</sup>*

function consists of two terms

1 , *zs* 2 , *zs* 3

The model is given by

*zi*−1, *<sup>j</sup>* <sup>=</sup> ∑ *zi*, *<sup>j</sup>* ∈*L zi*, *<sup>j</sup>*

Where *zi*, *<sup>j</sup>*

Where *Vc*(*zs*

Where,

In unsupervised scheme, the MAP estimates of the labels and the estimates of the model pa‐ rameters are carried out concurrently. Thus, an estimation strategy need to be developed, which using the observed image, X, will yield an optimal pair (Zopt, *θ*opt). The following joint optimality criterion is considered,

$$\mathbb{P}\left(\mathbf{z}^{opt}, \theta^{opt}\right) = \arg\_{\mathbf{z}, \theta} \max \mathbf{P}\left(\mathbf{Z} = \mathbf{z} \, \middle| \, \mathbf{X} = \mathbf{x}, \theta\right) \tag{26}$$

The estimated pair satisfying (26) is the global optima of P(Z=z/X=x, *θ*) with respect to Z and *θ*. Since both the entities Z and *θ* are unknown, and interdependent the problem is a very hard problem. Therefore, it is necessary to opt for strategies for suboptimal solution. In (26), z, *θ*could be viewed as a set of parameter of the given function P(Z=z/X=x, *θ*). For such kind of problems in deterministic framework, Wendell and Horter have proposed an alternate approach that would yield suboptimal solutions instead of optimal solution. Their approach is based on splitting the variables followed by recursively estimating the parameters. The fi‐ nal estimate in this process is called as the partial optimal solution. In our case, in stochastic framework, we in the same spirit venture to split the original problem into estimation of la‐ bels (z) and parameters estimate *θ* to obtain the partial optimal solutions. The splitting of the variables can be expressed as follows

$$P\left(z^\*\right) = \arg\max\_z P\left(Z = z \middle| X = x, \theta^\*\right) \tag{27}$$

$$P\left(\boldsymbol{\theta}^{\*}\right) = \arg\_{\boldsymbol{\theta}} \max \mathbf{P}\left(Z = \mathbf{z}^{\*} \, \middle| \, \mathbf{X} = \mathbf{x}. \boldsymbol{\theta}^{\*}\right) \tag{28}$$

These partial optimal solutions Z \* and *θ*\* are not global maxima, rather they are almost al‐ ways local optimal solutions. But with *θ*=*θ*\* , the estimate z\* is global optimal satisfying equation (27) and analogously for z=z\* , *θ*\* is global optimal satisfying equation (28). Since neither *θ*\* nor z\* is known, a recursive scheme is adopted where the model parameter esti‐ mation and segmentation is alternated. Let at the kth iteration *θ <sup>k</sup>* = *α <sup>k</sup>* , *φ <sup>k</sup> <sup>T</sup>* be the estimate of model parameters and zk be the estimate of the labels of the observed image. We adopt the following recursion

$$P\left(z^{k+1}\right) = \arg\max\_z \max P\left(Z = z \left| X = \ge \theta^k\right.\right) \tag{29}$$

The observed image X is given and hence the denominator *P*(*X* = *x* | *θ*) of (32) is a constant quantity. P(Z = z) is the *a priori* probability distribution of the labels. The degradation proc‐ ess is assumed to be Gaussian and hence *P*(*X* = *x* | *Z* = *z*, *θ*) of (32) can be written as *P*( *X* = *x* | *Z* = *z*, *θ* ) = *P*(*X* = *z* + *w* | *Z*, *θ*) = *P*(*W* = *x* − *z* | *Z*, *θ*). Since, W is a Gaussian

( )

p

2 det

*K*

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

é ù ë û

( ) ( )

<sup>=</sup> åå + + (34)

*k k*

) are given by (15) and (16) respectively. Solving (34) yields the MAP esti‐

2 , ,

(33)

93

http://dx.doi.org/10.5772/50475

*n*

<sup>1</sup> ,

process, and there are three spectral components present in a color image, we have,

q

( )

*P W x zZ*

*T*


3

, 1

=

*ijk*

*Vcs* (*zi*, *<sup>j</sup>* ) and *Vct*

components.

following

Since, Z is a MRF, we have,

(*zi*, *<sup>j</sup>*

**7. Model parameter estimation**

1 2

( ) ( ) <sup>1</sup>

=- =


Where K is the covariance matrix. Hence, this minimization can be expressed as,

( ) ( ) ( )


*x z z vz vz*

<sup>ˆ</sup> arg min <sup>2</sup> *s t i i*

s

2

*z c ij c ij*

mates of the image labels and hence segmentation. The color image has three spectral com‐ ponents xk, zk, k=1, 2, 3, Vc is the clique potential function for all the three spectral

We estimate the *a priori* model parameter using the ground truth image z. The associated MRF parameters of this ground truth image is θ. We also assume the number of labels asso‐ ciated with the original image to be known. The parameter estimation problem is formulat‐ ed using Maximum Likelihood criterion. Here the image label available at the (k+1)th iteration is used to estimate θ at (k+1)th iteration. Therefore, the problem can be stated as the

1 1 arg max ( / ) *k k*

<sup>1</sup> <sup>1</sup> exp( ( , )) arg max exp( ( , )) *<sup>k</sup> U z <sup>k</sup>*

z

å

q *U*

z q

 q

q

*PZ z* + + = = (35)

<sup>+</sup> <sup>+</sup> - <sup>=</sup> - (36)

j

j *xzK xz*

$$P\left(\boldsymbol{\theta}^{k+1}\right) = \arg\max\_{\boldsymbol{\theta}^\*} \max P\left(Z = \boldsymbol{z}^{k+1} \Big| \boldsymbol{X} = \boldsymbol{x}, \boldsymbol{\theta}^\*\right) \tag{30}$$

The first problem of equation (29) is solved using Bayesian approach [2]. The optimal value of *θ* k is obtained by the proposed Homotopy Continuation method [6]. The MAP estimates are obtained by the proposed hybrid algorithm. One estimate of zk and *θ*k constitute one combined iteration. this recursion is continued for finite number of steps to obtain zk and *θ*k. Thus, the partial optimal solutions are obtained.

## **6. Image label estimation**

The segmentation problem is cast as the pixel labeling problem. Each pixel can assume a la‐ bel from the set of labels {0 − L}. In a given image of size L = M1 x M2, let Zi, j denote the random variable for (i, j)th pixel, ∀(i, j) є L = M1 x M2. Z denotes the label process and z denotes a realization of the process. The label estimates *z* ^ is obtained by maximizing the posterior probability *P*(*Z* = *z* | *X* = *x*, *θ*). Thus, the optimality criterion can be expressed as follows,

$$\hat{\mathbf{z}} = \arg\_{\mathbf{z}} \max P\left(Z = \mathbf{z} \, \middle| \, \mathbf{X} = \mathbf{x}. \hat{\boldsymbol{\theta}}\right) \tag{31}$$

where, *θ* denotes the associated parameter vector of the double MRF model Z. Since z is un‐ known the above equation can not be computed. So, by using Baye's theorem, hence (31) can be expre ssed as

$$\hat{\mathbf{z}} = \arg\_{\mathbf{z}} \max \frac{P\left(\mathbf{X} = \mathbf{x} \, \middle| \, \mathbf{Z} = \mathbf{z}, \theta\right) P\left(\mathbf{Z} = \mathbf{z}\right)}{P\left(\mathbf{X} = \mathbf{x} \, \middle| \, \theta\right)}\tag{32}$$

The observed image X is given and hence the denominator *P*(*X* = *x* | *θ*) of (32) is a constant quantity. P(Z = z) is the *a priori* probability distribution of the labels. The degradation proc‐ ess is assumed to be Gaussian and hence *P*(*X* = *x* | *Z* = *z*, *θ*) of (32) can be written as *P*( *X* = *x* | *Z* = *z*, *θ* ) = *P*(*X* = *z* + *w* | *Z*, *θ*) = *P*(*W* = *x* − *z* | *Z*, *θ*). Since, W is a Gaussian process, and there are three spectral components present in a color image, we have,

$$\begin{aligned} P\left(W = x - z \, \middle| Z, \theta\right) &= \frac{1}{\sqrt{\left(2\pi\right)^{n} \det\left[\, \overline{K}\right]}} \\ &- \frac{1}{2} \left(x - z\right)^{\overline{I}} \, \overline{K}^{-1} \left(x - z\right) \end{aligned} \tag{33}$$

Where K is the covariance matrix. Hence, this minimization can be expressed as,

$$\hat{\mathbf{z}} = \arg\min\_{i,j} \sum\_{k,j} \sum\_{k=1}^{3} \frac{\left(\mathbf{x}^{(i)} - \mathbf{z}^{(i)}\right)^2}{\mathbf{2}\sigma^2} + \upsilon\_{c\_s} \left(\mathbf{z}^{k}\_{\ i,j}\right) + \upsilon\_{c\_i} \left(\mathbf{z}^{k}\_{\ i,j}\right) \tag{34}$$

*Vcs* (*zi*, *<sup>j</sup>* ) and *Vct* (*zi*, *<sup>j</sup>* ) are given by (15) and (16) respectively. Solving (34) yields the MAP esti‐ mates of the image labels and hence segmentation. The color image has three spectral com‐ ponents xk, zk, k=1, 2, 3, Vc is the clique potential function for all the three spectral components.

#### **7. Model parameter estimation**

These partial optimal solutions Z \*

nor z\*

92 Advances in Image Segmentation

the following recursion

neither *θ*\*

equation (27) and analogously for z=z\*

ways local optimal solutions. But with *θ*=*θ*\*

and *θ*\*

mation and segmentation is alternated. Let at the kth iteration *θ <sup>k</sup>* = *α <sup>k</sup>*

are not global maxima, rather they are almost al‐

, *θ*\* is global optimal satisfying equation (28). Since

is global optimal satisfying

^ is obtained by maximizing the

(31)

, *φ <sup>k</sup> <sup>T</sup>* be the estimate

, the estimate z\*

is known, a recursive scheme is adopted where the model parameter esti‐

q

 q

<sup>+</sup> = == (29)

+ + = == (30)

of model parameters and zk be the estimate of the labels of the observed image. We adopt

( ) ( ) <sup>1</sup> arg max . *k k <sup>z</sup> z P Z zX x*

( ) ( ) <sup>1</sup> 1 \* arg max , *k k PZ z X x*

The first problem of equation (29) is solved using Bayesian approach [2]. The optimal value of *θ* k is obtained by the proposed Homotopy Continuation method [6]. The MAP estimates are obtained by the proposed hybrid algorithm. One estimate of zk and *θ*k constitute one combined iteration. this recursion is continued for finite number of steps to obtain zk and *θ*k.

The segmentation problem is cast as the pixel labeling problem. Each pixel can assume a la‐ bel from the set of labels {0 − L}. In a given image of size L = M1 x M2, let Zi, j denote the random variable for (i, j)th pixel, ∀(i, j) є L = M1 x M2. Z denotes the label process and z

posterior probability *P*(*Z* = *z* | *X* = *x*, *θ*). Thus, the optimality criterion can be expressed as

where, *θ* denotes the associated parameter vector of the double MRF model Z. Since z is un‐ known the above equation can not be computed. So, by using Baye's theorem, hence (31)

> ( ) ( ) ( )

q

q

== = <sup>=</sup> <sup>=</sup> (32)

q

( )<sup>ˆ</sup> <sup>ˆ</sup> arg max . *<sup>z</sup> z P Z zX x* = ==

, <sup>ˆ</sup> arg max *<sup>z</sup> P X xZ z P Z z <sup>z</sup> PX x*

q

q

denotes a realization of the process. The label estimates *z*

Thus, the partial optimal solutions are obtained.

**6. Image label estimation**

follows,

can be expre ssed as

We estimate the *a priori* model parameter using the ground truth image z. The associated MRF parameters of this ground truth image is θ. We also assume the number of labels asso‐ ciated with the original image to be known. The parameter estimation problem is formulat‐ ed using Maximum Likelihood criterion. Here the image label available at the (k+1)th iteration is used to estimate θ at (k+1)th iteration. Therefore, the problem can be stated as the following

$$
\varphi^{k+1} = \arg\max P(Z = z^{k+1} / \theta) \tag{35}
$$

Since, Z is a MRF, we have,

$$\rho^{k+1} = \underset{\theta}{\text{arg max}} \frac{\exp(-\mathcal{U}(z^{k+1}, \theta))}{\sum\_{\substack{\Sigma \\ \zeta}} \exp(-\mathcal{U}(\zeta, \theta))}\tag{36}$$

where *ζ* ranges over all realizations of the image z. Because of the denominator of (36), compu‐ tation of the joint probability *P*(*Z* = *z <sup>k</sup>* +1 / *θ*) is extremely difficult task. We maximize the pseu‐ dolikelihood function *P* ^ (*Z* = *z <sup>k</sup>* +1 / *θ*) instead of the likelihood function *P*(*Z* = *z* / *θ*) where

$$\prod\_{\{i,j\} \in L} \mathbb{P}(Z\_{\hat{\mathbf{i}}\_{\prime}, \hat{\mathbf{j}}} = \mathbb{z}\_{\hat{\mathbf{i}}\_{\prime}, \hat{\mathbf{j}}}^{k+1} \mid Z\_{m,n} = \mathbb{z}\_{m,n}^{k+1}(m,n) \in \eta\_{\hat{\mathbf{i}}\_{\prime}, \hat{\mathbf{j}}}, \theta) = \mathbb{P}(Z = \mathbb{z}^{k+1} \mid \theta) \tag{37}$$

In (41), the summation is over all possible labels M. (41) is highly nonlinear in nature and no a priori knowledge of the solution is available. Solving the resulting non-linear equations is hard and hence we developed a globally convergent based Homotopy Continuation meth‐ od. We carry out the maximization process and obtain the estimate of parameter vector *θ*

, pixel label estimates z0

^*k* , if |*θ*

, obtain the MCPL estimate of the parameter vector *θ*

=*θ* ^*k* +1

**8. Parameter estimation using homotopy continuation method**

maps are (i) Linear Homtopy (ii) Newton Homotopy (iii) Fixed Point Homotopy.

, *z* ^*k* +1

Often, a wide variety of practical problems reduces to finding solution to a system of nonlinear equations. The problem becomes difficult when we have little knowledge about the solutions of the system. In such situations, the popular Newton algorithm may fail to con‐ verge to a solution. Such examples can be found in [19]. Therefore, we need a method which, irrespective of the starting point always converges to a solution of the given system of equations. Homotopy continuation methods under some conditions always converges to a solution with probability one. Such methods are called globally convergent homotopy con‐ tinuation methods [14]. The homotopy function is defined as follows :Let X, Y be two topo‐ logical spaces and I be the unit interval *λ* / 0 ≤ *λ* ≤ 1. The two maps f, g be maps from a space X to a space Y *f* , *g* : *X* → *Y* , then f is said to be homotopic to g if there exists a map *H* : *X* → *Y* such that H(x, 0) = f(x) and H(x, 1) = g(x) for *x* ∈ 0, 1 , such a map H is called a homotopy from f to g. In the above definition, H represents a continuous deformation of the map f to g as the parameter *λ* is varied from 0 to 1. There is no unique homotopy map that will continuously deform from a trivial map to any map. Depending upon the problem at hand the path has to be accurately tracked and hence, a suitable homotopy function has to be chosen for the existence of a path leading to the solution. The commonly used Homotopy

, observed image x and initial segmented image zk, obtain the MAP estimate of

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

^*<sup>k</sup>* +1 <sup>−</sup>*<sup>θ</sup>*

and observed image x

for k=0, 1, 2, ..., N do

, using homotopy con‐

http://dx.doi.org/10.5772/50475

go

95

^*<sup>k</sup>* <sup>|</sup> <sup>&</sup>lt; *threshold* , set *<sup>θ</sup> <sup>k</sup>* +1 <sup>=</sup>*<sup>θ</sup> <sup>k</sup>*

^*k* +1

with the help of homotopy continuation method based algorithm.

with the previous estimate of *θ*

(segmented image) using *θ* \*

**7.1. Salient steps of the unsupervised algorithm**

**1.** Initialize parameter vector as *θ* <sup>0</sup>

^*k* +1

tinuation based algorithm

^*k* +1

to step 2 else go to step 5

**5.** Set estimate of parameter vector *θ* \*

**8.1. Homotopy continuation method**

**2.** Using *θ <sup>k</sup>*

**3.** With *z*

**4.** Compare *θ*

**6.** Estimate *z* \*

the labels *z*

^*k* +1

From the definition of marginal conditional probability, we can write

$$\begin{aligned} \Pi \begin{array}{c} \Pi \\ (i,j) \in L \end{array} P(Z\_{i,j} = z\_{i,j}^{k+1} \mid Z\_{k,l} = z\_{k,l}^{k+1}, (k,l) \neq (i,j), \forall (i,j) \in L, \theta) \\\ \frac{P(Z = z^{k+1} \mid \theta)}{\sum\_{\substack{\sum \ \mathbf{P} \in \mathbf{X} = \mathbf{x} \ \theta \neq \mathbf{0}}}} \\ z\_{i,j} \in M \end{aligned} \tag{38}$$

Because of MRF assumption,

$$\begin{aligned} \min\_{\{i,j\} \in L} P(Z\_{i,j} = \underline{z}\_{i,j}^{k+1} \mid Z\_{m,n} = \underline{z}\_{m,n}^{k+1}, m, n \in \eta\_{i,j}, \theta) \\ \text{exp}(-\sum\_{c \in \mathbb{C}} V\_c(\underline{z}^{k+1}, \theta)) \\ = \frac{\sum\_{c \in \sum\_{c'} V\_c(\underline{z}^{k+1}, \theta)}}{\sum\_{i,j} \in Mc \in \mathbb{C}} \, V\_c(\underline{z}^{k+1}, \theta) \end{aligned} \tag{39}$$

Substituting equation (39) in (37) we have

$$\begin{aligned} \Pr^{\tilde{P}(Z = z^{k+1}/\theta)} \\ \approx \begin{array}{c} \exp(-\sum\_{c \in \mathbb{C}} V\_c(z^{k+1}, \theta)) \\ \frac{\sum}{\sum} \exp(V\_c(z^{k+1}, \theta)) \\ z\_{i,j} \in M \end{array} \tag{40} \end{aligned} \tag{40}$$

Therefore, the maximization problem (41) reduces to

$$\begin{aligned} \underset{\theta}{\text{arg}\,\text{max}} & \,\hat{P}(Z = z^{k+1}/\theta) \\ \text{arg}\,\text{max} & \prod\_{(i,j)=L} \underbrace{\exp\{-\,\,\Sigma\,\,V\_{c}\{z^{k+1},\theta\}\}}\_{\begin{subarray}{c}\Sigma \quad \text{exp}\{-\,\,\Sigma\,\,V\_{c}(z^{k+1},\theta)\} \\ z\_{\hat{i},\hat{j}} \in M \end{subarray}} \tag{41} \\ & \quad \underbrace{\exp\{-\,\,\Sigma\,\,V\_{c}(z^{k+1},\theta)\}}\_{\begin{subarray}{c}\{\pi\} \quad \text{exp}\{-\,\,\} \\ \text{c.t.} \end{subarray}} \tag{41} \end{aligned} \tag{41}$$

In (41), the summation is over all possible labels M. (41) is highly nonlinear in nature and no a priori knowledge of the solution is available. Solving the resulting non-linear equations is hard and hence we developed a globally convergent based Homotopy Continuation meth‐ od. We carry out the maximization process and obtain the estimate of parameter vector *θ* with the help of homotopy continuation method based algorithm.

#### **7.1. Salient steps of the unsupervised algorithm**

where *ζ* ranges over all realizations of the image z. Because of the denominator of (36), compu‐ tation of the joint probability *P*(*Z* = *z <sup>k</sup>* +1 / *θ*) is extremely difficult task. We maximize the pseu‐

> 1 ,, , ,( , ) , ) <sup>1</sup> <sup>1</sup> ( / ( /) , , (,) *<sup>k</sup> Z z mn mn mn i j <sup>k</sup> <sup>k</sup> PZ z PZ z ij ij ij L*

From the definition of marginal conditional probability, we can write

<sup>+</sup> <sup>=</sup>

( /)

=

q

q

<sup>1</sup> exp( ( , ))

<sup>+</sup> - Î

<sup>+</sup> <sup>=</sup>

*<sup>k</sup> V z <sup>c</sup> c C*

*<sup>k</sup> V z <sup>c</sup> z Mc C*

ˆ <sup>1</sup> ( /)

<sup>+</sup> =

*<sup>k</sup> PZ z*

»

Therefore, the maximization problem (41) reduces to

q

arg max

=

,

å

Î

1

+

q

*k*

,

*i j*

(,)

*ij L*

Î

ˆ arg max ( / )

*PZ z*

=

å å

Î Î

å

<sup>1</sup> ( /)

<sup>+</sup> <sup>=</sup>

*PX x*

*<sup>k</sup> PZ z ij ij ij L*

*<sup>k</sup> PZ z ij ij ij L*

*<sup>k</sup> PZ z*

,

=

Substituting equation (39) in (37) we have

*i j*

Î

<sup>+</sup> <sup>Õ</sup> = Î= <sup>+</sup> <sup>+</sup> = =

1 , , ,( , ) ( , ), ( , ) , ) <sup>1</sup> ( / , , (,)

<sup>+</sup> Õ = ¹ "Î

,, , , , ,) <sup>1</sup> ( / , , (,)

<sup>+</sup> Õ = Î

<sup>1</sup> ( ,)

+

<sup>1</sup> exp( ( , ))

<sup>+</sup> - Î

*<sup>k</sup> V z <sup>c</sup> c C*

*<sup>k</sup> V z <sup>c</sup> z M i j*

å

q

<sup>1</sup> exp( ( , ))

<sup>1</sup> exp( ( , ))

<sup>+</sup> - Î

*<sup>k</sup> V z <sup>c</sup> c C*

*<sup>k</sup> V z <sup>c</sup> z M cC*

å å

Î Î

å

<sup>1</sup> exp( ( , ))

<sup>+</sup> -

q

q

Õ (41)

+

q

q

q

q

(*Z* = *z <sup>k</sup>* +1 / *θ*) instead of the likelihood function *P*(*Z* = *z* / *θ*) where

<sup>Î</sup> (37)

q

(38)

(39)

(40)

q

h q

*<sup>k</sup> Z z kl ij ij L kl kl*

1

*<sup>k</sup> Z z mn mn mn ij*

h q

dolikelihood function *P*

94 Advances in Image Segmentation

^

,

Because of MRF assumption,

<sup>=</sup> <sup>å</sup>

Î

*z M i j*

Î


## **8. Parameter estimation using homotopy continuation method**

#### **8.1. Homotopy continuation method**

Often, a wide variety of practical problems reduces to finding solution to a system of nonlinear equations. The problem becomes difficult when we have little knowledge about the solutions of the system. In such situations, the popular Newton algorithm may fail to con‐ verge to a solution. Such examples can be found in [19]. Therefore, we need a method which, irrespective of the starting point always converges to a solution of the given system of equations. Homotopy continuation methods under some conditions always converges to a solution with probability one. Such methods are called globally convergent homotopy con‐ tinuation methods [14]. The homotopy function is defined as follows :Let X, Y be two topo‐ logical spaces and I be the unit interval *λ* / 0 ≤ *λ* ≤ 1. The two maps f, g be maps from a space X to a space Y *f* , *g* : *X* → *Y* , then f is said to be homotopic to g if there exists a map *H* : *X* → *Y* such that H(x, 0) = f(x) and H(x, 1) = g(x) for *x* ∈ 0, 1 , such a map H is called a homotopy from f to g. In the above definition, H represents a continuous deformation of the map f to g as the parameter *λ* is varied from 0 to 1. There is no unique homotopy map that will continuously deform from a trivial map to any map. Depending upon the problem at hand the path has to be accurately tracked and hence, a suitable homotopy function has to be chosen for the existence of a path leading to the solution. The commonly used Homotopy maps are (i) Linear Homtopy (ii) Newton Homotopy (iii) Fixed Point Homotopy.

It is clear from Section 7 that the parameter estimation problem has been reduced to maximi‐ zation of (41) with respect to *θ* . Towards this end let

$$f(\theta) = \frac{\partial}{\partial \theta} \langle \log \| \hat{P}(X = x^{k+1} \,/ \, Y = y, \theta) \|\,\tag{42}$$

The derivation of (45) is analogous to the derivation of Stonick and Alexander [15] for our homotopy map (43). Equation (45) corresponds to the prediction of the next point by taking a step in the direction of the path's slope. For the fixed point homotopy map considered, (45)

1 1

*k* estimated by (45) is not on the path then it is taken as the initial point in the cor‐

*k* is considered as the next point on the path. Suppose


 ll

q qq

Where I is the identity matrix. The intermediate steps for arriving at (46) is given in [16] and

^*<sup>k</sup>* <sup>=</sup> *<sup>θ</sup><sup>k</sup>* +1.

In simulation, two images with weak edges and two images having both weak as well as strong edges have been considered. The first original image, a liver image with ill defined

*k kk*

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

(46)

97

http://dx.doi.org/10.5772/50475

0 2

ll

= -D - - +D - +D

( ) [ ] }{ ( ) ( )} ( )1( )

<sup>+</sup> - - +D - +D

1 ( ) (1 ( ))

*I I*

*k k*

1

q

*<sup>M</sup> <sup>k</sup>* | ≤ *γ* then we set *θ*

**8.2. Homotopy continuation algorithm**


*k k*

qq

ˆ {

*k*

q

ll

*k k*

^ 0

*k* using equation (38)

*k* the initial point for Newton algorithm

^ *<sup>M</sup> <sup>k</sup>* = *θ*

 l

*<sup>F</sup> <sup>I</sup> <sup>f</sup>*

 ll

becomes

[17]. If *θ* ^ 0


do{

if ()

else

*θ* ^ *i k to θ* ^ *k* +1

if ()

take *θ*<sup>0</sup>

Update:

else go to update: }

(Until *λ* = 1).

rection step (44). Otherwise *θ*

Initialize: (*θ* =*θ* 0 *and λ* =0)

Increment *λ <sup>k</sup>* +1 = *λ <sup>k</sup>* + *Δλ*

^ 0

*k* using (40)

**9. Results and discussions**

Update *θ k* to *θ*

Now the homotopy method is employed to solve *f* (*θ*) = 0. In the following, we develop a general framework for solving *f* (*θ*) = 0 using homotopy continuation method where *θ* is the unknown parameter vector to be determined.

In the continuation method we need to trace the homotopy path from a solution of a known system to that of the desired solution. In this regard, we have considered the fixed point ho‐ motopy map [14] which offers the advantage of arbitrary starting point for the path. This fixed point map is given by

$$h(\theta, \lambda, q) = \lambda f(\theta) + (1 - \lambda)(\theta - q) \tag{43}$$

where 0 ≤ *λ* ≤ 1 and q is an arbitrary starting point. Here the predictor-corrector method is employed to track the path defined by the homotopy in (43). The procedure can be briefly outlined as follows:

Let (*θ <sup>k</sup>* , *λ <sup>k</sup>* , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup> ) be a point that satisfies (43). Therefore, the point considered is on the path. Tracking the path involves computing the adjacent point on the path. This is deter‐ mined in the following way. Increment *λ <sup>k</sup>* by some small value *Δλ* thus giving the next point *λ <sup>k</sup>* +1 = *λ <sup>k</sup>* + *Δλ* and evaluate equation (43) at (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup> ). If the value of the map *h* (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup> ) is not equal to zero, then the point (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup> ) is not on the path. Since*h* (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup> ) ≠ 0, we try to obtain an estimate of *θ <sup>k</sup>* , say *θ* ^*<sup>k</sup>* corresponding to *λ <sup>k</sup>* +1 such that *h* (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup> ) ≈ 0. To achieve this one could use Newton's algorithm, namely,

$$\hat{\boldsymbol{\theta}}\_{i+1}^{k} = \hat{\boldsymbol{\theta}}\_{i}^{k} - \mathbf{J}\_{\hat{\boldsymbol{\theta}}}^{-1} \{ \mathbf{h}(\hat{\boldsymbol{\theta}}\_{i}^{k}, \mathcal{X}^{k+1}, \boldsymbol{\theta}^{k-1}) \} \mathbf{h}(\hat{\boldsymbol{\theta}}\_{i}^{k}, \mathcal{X}^{k+1}, \boldsymbol{\theta}^{k-1}) \tag{44}$$

Where the superscript i denotes the ith Newton iteration and is the inverse of the Jacobian of h with respect to the coefficient of the parameter vector *θ* . But if *θ* ^ 0 *k* is too far from *θ* ^*<sup>k</sup>* the value which makes, *h* (*θ* ^*<sup>k</sup>* , *<sup>λ</sup> <sup>k</sup>* +1 , *<sup>θ</sup> <sup>k</sup>* <sup>−</sup><sup>1</sup> ) ≈ 0 then (44) may not converge. To improve the con‐ vergence of (44), we select the initial point as *θ* ^ 0 *<sup>k</sup>* = *θ <sup>k</sup>* . A further improvement in the con‐ vergence is obtained by considering

$$
\hat{\theta}\_0^k = \hat{\theta}^k - \Delta \mathbb{X} \mathbb{J}\_{\hat{\theta}}^{-1} [h(\theta^{\ k}, \mathbb{X}^{k+1}, \theta^{k-1})] \frac{\partial h}{\partial \mathcal{X}} h(\theta^{\ k}, \mathbb{X}^{k+1}, \theta^{k-1}) \tag{45}
$$

The derivation of (45) is analogous to the derivation of Stonick and Alexander [15] for our homotopy map (43). Equation (45) corresponds to the prediction of the next point by taking a step in the direction of the path's slope. For the fixed point homotopy map considered, (45) becomes

$$\begin{split} \hat{\theta}\_{0}^{k} &= \theta^{k} - \Lambda \lambda \{ \frac{I}{1 - (\boldsymbol{\lambda}^{k} + \Lambda \boldsymbol{\lambda})} - \frac{I}{(1 - (\boldsymbol{\lambda}^{k} + \Lambda \boldsymbol{\lambda}))^{2}} \\ \mathbb{I}\{\frac{F\_{\theta}^{-1}(\theta^{k})}{\left(\boldsymbol{\lambda}^{k} + \Lambda \boldsymbol{\lambda}\right)} + \frac{I}{1 - (\boldsymbol{\lambda}^{k} + \Lambda \boldsymbol{\lambda})} \}^{-1} \| \{f(\theta^{\text{-}k}) - (\theta^{k} - \theta^{k-1})\} \| \end{split} \tag{46}$$

Where I is the identity matrix. The intermediate steps for arriving at (46) is given in [16] and [17]. If *θ* ^ 0 *k* estimated by (45) is not on the path then it is taken as the initial point in the cor‐ rection step (44). Otherwise *θ* ^ 0 *k* is considered as the next point on the path. Suppose |*θ* ^ *M* +1 *k* −*θ* ^ *<sup>M</sup> <sup>k</sup>* | ≤ *γ* then we set *θ* ^ *<sup>M</sup> <sup>k</sup>* = *θ* ^*<sup>k</sup>* <sup>=</sup> *<sup>θ</sup><sup>k</sup>* +1.

## **8.2. Homotopy continuation algorithm**

Initialize: (*θ* =*θ* 0 *and λ* =0) do{ Increment *λ <sup>k</sup>* +1 = *λ <sup>k</sup>* + *Δλ* Update *θ k* to *θ* ^ 0 *k* using equation (38) if ()

else

It is clear from Section 7 that the parameter estimation problem has been reduced to maximi‐

*PX x Y y*

Now the homotopy method is employed to solve *f* (*θ*) = 0. In the following, we develop a general framework for solving *f* (*θ*) = 0 using homotopy continuation method where *θ* is

In the continuation method we need to trace the homotopy path from a solution of a known system to that of the desired solution. In this regard, we have considered the fixed point ho‐ motopy map [14] which offers the advantage of arbitrary starting point for the path. This

> l q

) be a point that satisfies (43). Therefore, the point considered is on the

where 0 ≤ *λ* ≤ 1 and q is an arbitrary starting point. Here the predictor-corrector method is employed to track the path defined by the homotopy in (43). The procedure can be briefly

path. Tracking the path involves computing the adjacent point on the path. This is deter‐ mined in the following way. Increment *λ <sup>k</sup>* by some small value *Δλ* thus giving the next

) is not equal to zero, then the point (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup>

) ≠ 0, we try to obtain an estimate of *θ <sup>k</sup>* , say *θ*

1 11 11 <sup>1</sup> <sup>ˆ</sup> ˆˆ ˆ ˆ [ ( , , )] ( , , ) *k k kk k kk k ii i <sup>i</sup> J h h* q


Where the superscript i denotes the ith Newton iteration and is the inverse of the Jacobian of

^ 0 *<sup>k</sup>* = *θ <sup>k</sup>*

1 11 1 1

l

 ql

<sup>0</sup> <sup>ˆ</sup> ˆ ˆ [ ( , , )] ( , , ) *k k kk k <sup>h</sup> kk k J h <sup>h</sup>*


 q  ql  q

<sup>+</sup> = - (44)

 q

 q

*h qf q* ( , , ) ( ) (1 )( )

 l q  q

¶ (42)

= +- - (43)

) ≈ 0. To achieve this one could use Newton's algorithm,

^ 0

) ≈ 0 then (44) may not converge. To improve the con‐

). If the value of the map

*k* is too far from *θ*

. A further improvement in the con‐

¶ (45)

^*<sup>k</sup>* the

) is not on the path.

^*<sup>k</sup>* corresponding to

ˆ <sup>1</sup> ( ) {log[ ( / , )]} *<sup>k</sup> f*

¶ <sup>+</sup> = ==

zation of (41) with respect to *θ* . Towards this end let

the unknown parameter vector to be determined.

fixed point map is given by

96 Advances in Image Segmentation

outlined as follows:

Let (*θ <sup>k</sup>* , *λ <sup>k</sup>* , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup>

*h* (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup>

namely,

Since*h* (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup>

value which makes, *h* (*θ*

*λ <sup>k</sup>* +1 such that *h* (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup>

q q

vergence of (44), we select the initial point as *θ*

q q l

vergence is obtained by considering

q

q

ql

point *λ <sup>k</sup>* +1 = *λ <sup>k</sup>* + *Δλ* and evaluate equation (43) at (*θ <sup>k</sup>* , *λ <sup>k</sup>* +1 , *θ <sup>k</sup>* <sup>−</sup><sup>1</sup>

 ql

h with respect to the coefficient of the parameter vector *θ* . But if *θ*

q  ql

^*<sup>k</sup>* , *<sup>λ</sup> <sup>k</sup>* +1 , *<sup>θ</sup> <sup>k</sup>* <sup>−</sup><sup>1</sup>

take *θ*<sup>0</sup> *k* the initial point for Newton algorithm

Update: *θ* ^ *i k to θ* ^ *k* +1 *k* using (40) if ()

else go to update: }

(Until *λ* = 1).

## **9. Results and discussions**

In simulation, two images with weak edges and two images having both weak as well as strong edges have been considered. The first original image, a liver image with ill defined edges, is shown in Fig. 3(a). In order to compute the percentage of misclassification error, the Ground Truth image, as shown in Fig. 3(b), has been constructed manually. The estimat‐ ed MRF model parameters are, *α*= 0.005601, *β* = 2.34 and *σ* = 0.55. However *σ* is chosen by trial and error and is fixed at 0.5. The Percentage of Misclassification Error (PME) with re‐ spect to Ground Truth image is defined as PME = {number of misclassified pixels in all the classes}/{total number of pixels of the image}. The MAP estimates in each recursion has been obtained by our proposed hybrid algorithm [10]. The results obtained by basic MRF model is shown in Fig. 3(c), where it is observed that one of the weaker edge could be preserved while the ill defined edge adjacent to it is completely lost. In case of the CMRF model, some portions could be sharper but the adjacent ill defined edge could not be recovered as shown in Fig. 3(d). However, as seen from Fig. 3(e), the use of the proposed CCMRF model could preserve well the weak edge as well as the adjacent ill defined edges. In case of Yu 's [9] ap‐ proach, the inside weak edge could not be preserved even though the outer edge could be preserved. The adjacent ill defined edge is completely lost as seen in Fig. 3(f). Thus, the pro‐ posed CCMRF model with bi-level line field with Gaussain weighted penalty function could preserve well the ill defined edges together with strong edges.

weak and strong edges are 0.91 and 0.25 respectively. The degradation process parameter is chosen to be 0.5 and the value k of the edge penalty function is chosen to be 0.2. This has also reflected in the misclassification error that is the PME is 22.72 for MRF model which re‐ duced to 14.86 for CMRF model and further reduced to 3.11 for CCMRF model. As seen from Fig.4(f) Yu 's method preserved both weak and strong edges. The PME for Yu 's meth‐ od is 6.21. It is found that the CCMRF model with bi-level line field proved to be the most

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

http://dx.doi.org/10.5772/50475

99

**Figure 4.** (a) Cell image (491x370) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimized using Hybrid

In order to demonstrate the unifying modeling property of the CMRF and CCMRF model, a third example as shown in Fig. 5(a) is considered where the background has texture like at‐ tributes. The estimated MRF model parameters are *α* = 0.01842, *β*= 2.79 and *σ* = 0.42. As ob‐ served from Fig.5(e) that the CCMRF model could segment the image and preserved many poorly defined edges. This observation is absent in case of use of the MRF and CMRF mod‐ el. Use of CCMRF model could preseve the sharp features while Yu 's method could not pre‐ seve all the weak edges. This is observed from Fig. 5(f). The percentage of misclassification error also reflect the observation. Thus, in case of all the three examples, the use of CCMRF model could segment the image and preserve both the strong as well as weak edges. This proposed model could perform better than that of Yu 's approach [9] in the context of weak

effective among other methods.

(e) CCMRF optimized using Hybrid (f) Clausi's result.

edge preservation and hence misclassfication error.

**Figure 3.** (a) Liver Abscess image (468x345) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimized us‐ ing Hybrid (e) CCMRF optimized using Hybrid (f) Clausi's result.

Fig.4(a) shows a cell image where the outer boundary of the cell is a strong edge while the inner portion of the cell contains weak edge or poorly defined edge. In order to compute the classification error, the corresponding ground truth image is manually constructed and is shown in Fig.4(b) and Fig.4(c) shows the result obtained with MRF model and it may be ob‐ served that the strong edges could be preserved but the weak edges could not be preserved. The poorly defined edges improved with CMRF model as shown in Fig.4(d). With CCMRF model, as observed from Fig.4(e), the outer edges of the cells could be preserved and the edges inside the different cells also have been well defined. The threshold considered for weak and strong edges are 0.91 and 0.25 respectively. The degradation process parameter is chosen to be 0.5 and the value k of the edge penalty function is chosen to be 0.2. This has also reflected in the misclassification error that is the PME is 22.72 for MRF model which re‐ duced to 14.86 for CMRF model and further reduced to 3.11 for CCMRF model. As seen from Fig.4(f) Yu 's method preserved both weak and strong edges. The PME for Yu 's meth‐ od is 6.21. It is found that the CCMRF model with bi-level line field proved to be the most effective among other methods.

edges, is shown in Fig. 3(a). In order to compute the percentage of misclassification error, the Ground Truth image, as shown in Fig. 3(b), has been constructed manually. The estimat‐ ed MRF model parameters are, *α*= 0.005601, *β* = 2.34 and *σ* = 0.55. However *σ* is chosen by trial and error and is fixed at 0.5. The Percentage of Misclassification Error (PME) with re‐ spect to Ground Truth image is defined as PME = {number of misclassified pixels in all the classes}/{total number of pixels of the image}. The MAP estimates in each recursion has been obtained by our proposed hybrid algorithm [10]. The results obtained by basic MRF model is shown in Fig. 3(c), where it is observed that one of the weaker edge could be preserved while the ill defined edge adjacent to it is completely lost. In case of the CMRF model, some portions could be sharper but the adjacent ill defined edge could not be recovered as shown in Fig. 3(d). However, as seen from Fig. 3(e), the use of the proposed CCMRF model could preserve well the weak edge as well as the adjacent ill defined edges. In case of Yu 's [9] ap‐ proach, the inside weak edge could not be preserved even though the outer edge could be preserved. The adjacent ill defined edge is completely lost as seen in Fig. 3(f). Thus, the pro‐ posed CCMRF model with bi-level line field with Gaussain weighted penalty function could

**Figure 3.** (a) Liver Abscess image (468x345) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimized us‐

Fig.4(a) shows a cell image where the outer boundary of the cell is a strong edge while the inner portion of the cell contains weak edge or poorly defined edge. In order to compute the classification error, the corresponding ground truth image is manually constructed and is shown in Fig.4(b) and Fig.4(c) shows the result obtained with MRF model and it may be ob‐ served that the strong edges could be preserved but the weak edges could not be preserved. The poorly defined edges improved with CMRF model as shown in Fig.4(d). With CCMRF model, as observed from Fig.4(e), the outer edges of the cells could be preserved and the edges inside the different cells also have been well defined. The threshold considered for

preserve well the ill defined edges together with strong edges.

98 Advances in Image Segmentation

ing Hybrid (e) CCMRF optimized using Hybrid (f) Clausi's result.

**Figure 4.** (a) Cell image (491x370) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimized using Hybrid (e) CCMRF optimized using Hybrid (f) Clausi's result.

In order to demonstrate the unifying modeling property of the CMRF and CCMRF model, a third example as shown in Fig. 5(a) is considered where the background has texture like at‐ tributes. The estimated MRF model parameters are *α* = 0.01842, *β*= 2.79 and *σ* = 0.42. As ob‐ served from Fig.5(e) that the CCMRF model could segment the image and preserved many poorly defined edges. This observation is absent in case of use of the MRF and CMRF mod‐ el. Use of CCMRF model could preseve the sharp features while Yu 's method could not pre‐ seve all the weak edges. This is observed from Fig. 5(f). The percentage of misclassification error also reflect the observation. Thus, in case of all the three examples, the use of CCMRF model could segment the image and preserve both the strong as well as weak edges. This proposed model could perform better than that of Yu 's approach [9] in the context of weak edge preservation and hence misclassfication error.

the CCMRF model with bi-level linefield could preserve many weak edges together with the strong edges. This may be seen from Fig.6(e) and it can be observed from Fig.6(d) that many weak edges have been preserved even using CCMRF model. Thus, in this example the per‐ formance of CCMRF model is found to be better than that of CMRF model in the context of

Constrained Compound MRF Model with Bi-Level Line Field for Color Image Segmentation

http://dx.doi.org/10.5772/50475

101

1 Department of Electronics and Comm. Engg., I.T.E.R, Siksha 'O' Anusandhan University,

[1] Y. I. Ohta, T. Kanade, T. Sakai.: "Color information for region segmentation." *Comp.*

[2] S. Geman, D. Geman.: "Stochastic relaxation, Gibbs distributions and the Bayesian

[4] J. Besag: "On the statistical analysis of dirty pictures", J.Roy. Statist.Soc.B. 62, 1986,

[5] H. D. Cheng, X. H. Jiang, Y. Sun, Wang.J.: "Color Image Segmentation: Advances

[6] Z. Kato, T. C. Pong, J.C>M Lee, .: "Color image segmentation and parameter estima‐ tion in a morkovian framework". *Pattern Recognition Letters, vol.22, pp309-321, 2001*. [7] Y. Deng, B. S. Manjunath, : "Unsupervised Segmentation of Color-Texture Regions in Images and Video". IEEE Transactions on Pattern Analysis and Machine Intelligence,

restoration of images." *IEEE. Tranaction. PAMI*, vol 6, pp.721—741, 1984. [3] S.Z.Li, *Markov Random Field modeling in computer vision*, Springer, Berlin, 1995.

Our sincere thanks for anonymous reviewers for accepting this chapter.

2 Dept. of Computer Science & Engg., Padmanava College of Engg., India

and prospects." *Pattern. Recog.,* vol 34, pp. 2259-2281, 2001.

misclassification error.

**Acknowledgment**

**Author details**

and Sucheta Panda2\*

\*Address all correspondence to: pandasucheta06@gmail.com

*Grap. Image. Process.,* vol 62, pp. 222-241, 1980.

P. K. Nanda1

Orissa, India

**References**

pp.259-302

vol. 23, no. 8, pp.800-810, 2001.

**Figure 5.** (a) Hand Ring (Indoor) image (303x243) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimize dusing Hybrid (e) CCMRF optimize dusing Hybrid (f) Clausi'sresult.

**Figure 6.** (a) MANASA SOROVER (Remote Sensing) image (500x500) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimized using Hybrid (e) CCMRF optimized using Hybrid (f) Clausi's result.

Similar observations have also been made in case of the Manasa Sorover image as shown in Fig.6(a). As observed from Fig.6(a) there are many weak edges to be preserved. In this case, the CCMRF model with bi-level linefield could preserve many weak edges together with the strong edges. This may be seen from Fig.6(e) and it can be observed from Fig.6(d) that many weak edges have been preserved even using CCMRF model. Thus, in this example the per‐ formance of CCMRF model is found to be better than that of CMRF model in the context of misclassification error.

## **Acknowledgment**

Our sincere thanks for anonymous reviewers for accepting this chapter.

## **Author details**

P. K. Nanda1 and Sucheta Panda2\*

\*Address all correspondence to: pandasucheta06@gmail.com

1 Department of Electronics and Comm. Engg., I.T.E.R, Siksha 'O' Anusandhan University, Orissa, India

2 Dept. of Computer Science & Engg., Padmanava College of Engg., India

## **References**

**Figure 5.** (a) Hand Ring (Indoor) image (303x243) (b) Ground Truth (c) MRF optimized using Hybrid (d) CMRF optimize

**Figure 6.** (a) MANASA SOROVER (Remote Sensing) image (500x500) (b) Ground Truth (c) MRF optimized using Hybrid

Similar observations have also been made in case of the Manasa Sorover image as shown in Fig.6(a). As observed from Fig.6(a) there are many weak edges to be preserved. In this case,

(d) CMRF optimized using Hybrid (e) CCMRF optimized using Hybrid (f) Clausi's result.

dusing Hybrid (e) CCMRF optimize dusing Hybrid (f) Clausi'sresult.

100 Advances in Image Segmentation


[8] L.Guo, Y.M.HouandX.M.Lun, An unsupervised color image segmentation algorithm based on context information *Pattern Recognition and Arti*fi*cial Intelligence* vol.21, pp. 82-87, 2008.

**Chapter 5**

**Cognitive and Statistical Pattern Recognition Applied**

**in Color and Texture Segmentation for Natural Scenes**

In this approach, cognitive and statistical classifiers were implemented in order to verify the estimated and chosen regions on unstructured environments images. As inspection of crops for natural scenes demands and requires complex analysis of image processing and segmen‐ tation algorithms, since these computational methods evaluate and predict environment physical characteristics, such as color elements, complex objects composition, shadows, brightness and inhomogeneous region colors for texture, JSEG segmentation algorithm was approached to segment these ones, and ANN and Bayes recognition models to classify im‐ ages into predetermined classes (e.g. fruits, plants and general crops). The intended ap‐ proach to segment classification deploys a customized MLP topology to classify and characterize the segments, which deals with a supervised learning by error correction – propagation of pattern inputs with changes in synaptic weights in a cyclic processing, with accurate recognition as well as easy parameter adjustment, as an enhancement of iRPROP algorithm (*improved resilient back-propagation*) (Igel and Hüsken, 2003) derived from *Backpropagation* algorithm, which has a faster identification mapping process, that verifies what region maps have similar matches through the explored environment. Bayes statistical mod‐ els had the addiction of process variable as set parameters of predictive error correction.

To carry through this task, a feature vector is necessary for color channels histograms (layers of primary color in a digital image with a counting graph that measures how many pixels are at each level between black and white). After training process, the mean squared error

> © 2012 Cássio Lulio et al.; licensee InTech. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

> © 2012 Cássio Lulio et al.; licensee InTech. This is a paper distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Luciano Cássio Lulio, Mário Luiz Tronco,

Additional information is available at the end of the chapter

Arthur José Vieira Porto,

http://dx.doi.org/10.5772/51862

**1. Introduction**

Carlos Roberto Valêncio and

Rogéria Cristiane Gratão de Souza

