Magnetic Resonance Imaging plays an important role in diagnosing the brain tumor accurately, but it requires the approach to enhance the magnetic resonance images to assist physicians in brain tumor detection and making the treatment plan precisely to reduce the mortality rate. Therefore, in this proposed work, a comprehensive learning-based elephant herding optimization technique has been introduced to select the optimal value of smoothness factor in Bi-Histogram Equalization with Adaptive Sigmoid Function that enhances the visual quality as well as the appearance of the suspicious regions in magnetic resonance images. Further, the enhancement performance has been evaluated by the enhancement quality metrics. The metrics used include mean square error, peak signal to noise ratio, mean absolute error, structural similarity index metric, feature similarity index metric, Riesz transformed based feature similarity index metric, spectral residual-based similarity index metric, and absolute mean brightness error. The outcomes of this proposed work have a remarkable impact on enhancing magnetic resonance images and providing visual assistance for diagnosing brain tumors. The performance of the evaluation metrics is verified with Friedman's mean rank test, which strongly indicates a statistical difference between the proposed method and state-of-the-art methods.