Having a robust image segmentation strategy is very important in magnetic resonance image (MRI) processing for an effective and early disease detection and diagnosis. Since MRI can present tissues of interest in both morphological and functional images, various segmentation techniques have been employed for this. The algorithms based on Markov random field (MRF) have shown strong abilities in dealing with noisy image segmentation compared to other methods. In this article, inspired by the random drift particle swarm optimization (RDPSO) algorithm, we propose a novel hybrid framework based on a combination of the RDPSO with the hidden MRF model and the expectation–maximization algorithm (HMRF‐EM), to be used for MRI segmentation in real‐time environments. The proposed hybrid framework is compared with the standalone HMRF‐EM method, two other MRF‐based stochastic relaxation algorithms, and two widely used brain tissue segmentation toolboxes on both simulated and real MRI datasets. The experimental results prove that the proposed hybrid framework can obtain better segmentation results than most of its competitors and has faster convergence speed than the compared stochastic optimization algorithms.