This document discusses the implementation of a pairwise binary label-observation Markov Random Field (MRF) model for image segmentation, utilizing two inference algorithms: Iterative Conditional Mode (ICM) and Gibbs Sampling. It details the theoretical framework of MRFs, including the Potts model for correlation among random variables, and the methodology to optimize label assignments based on pixel intensity in images. The results demonstrate that Gibbs Sampling generally yields better segmentation results compared to ICM after sufficient iterations.