I am attempting to learn how to use Markov Random Fields to segment regions in an image. I do not understand some of the parameters in the MRF or why the expectation maximisation I perform fails to converge to a solution sometimes.
Starting from Bayes' theorem, I have $p(x|y) = p(y|x) p(x) / p(y)$, where $y$ is the pixel's gray-scale value and $x$ is a class label. I have chosen to use a Gaussian distribution for $p(y|x)$, while $p(x)$ is modelled using the MRF.
I use a potential function for the MRF that has both pairwise clique potentials and a potential value for the class label of the pixel being classified. The single pixel potential value is some constant $\alpha$ that depends on the class label $x$. The pairwise potential functions are evaluated for the 4-connected neighbours and return positive $\beta$ if the neighbour has the same class label as this pixel and $-\beta$ if the labels differ.
At the point in the expectation maximisation where I have to find the values of $\alpha(x)$ and $\beta$ that maximise the expected value of the log-likelihood I used a numerical optimisation method (tried conjugate gradient, BFGS, Powell's method) but would always find that the value of $\beta$ would become negative, the $\alpha$s would increase dramatically and an iteration or two later the whole image would be assigned to one label only (background: assigning class labels given MRF parameters was done using ICM). If I removed the alphas, i.e. only using pairwise clique potentials, then the expectation maximisation would work just fine.
Please explain what is the purpose of the alphas for each class? I thought they would be related to the amount of that class that is present in the image, but it appears not. Once I got the MRF working with only pairwise potentials, I compared it to a straight forward Gaussian Mixture Model and found that they produced almost identical results. I was expecting the pairwise potentials to smooth out the classes a bit, but that didn't happen. Please advise where I went wrong.