Above, the right image is the original input image to be segmented. The left image is the result of running my implementation of the expectation maximization algorithm to segment the image using k=2 clusters. The algorithm involves initializing some parameters and two randomly placed Gaussians. After initialization, the mixture of Gaussians weight calculations were performed along with pixel class assignment during the E-step. In the following M-step, Gaussians are adjusted according to parameter estimators. The E-step and M-step are iterated over until the error converges to a predetermined threshold.
Two randomly placed Gaussians and parameters were initialized before feeding the height data to the EM algorithm. Once initialization was completed, weights were calculated and the average log-likelihood function of the data was determined during the E-step. Next in the M-step, parameter estimates that maximize the log-likelihood function are calculated and the Gaussians are adjusted. The E-step and M-step are iterated over until the error converges to the desired precision.
Software: Matlab
Conceptual: Expectation Maximization Algorithm | Unsupervised learning | Color-based image segmentation