Different diseases occur in the brain. For instance, hereditary and progressive diseases affect and degenerate the white matter. Although addressing, diagnosing, and treating complex abnormalities in the brain is challenging, different strategies have been presented with significant advances in medical research. With state‐of‐art developments in artificial intelligence, new techniques are being applied to brain magnetic resonance images. Deep learning has been recently used for the segmentation and classification of brain images. In this study, we classified normal and pathological brain images using pretrained deep models through transfer learning. The EfficientNet‐B5 model reached the highest accuracy of 98.39% on real data, 91.96% on augmented data, and 100% on pathological data. To verify the reliability of the model, fivefold cross‐validation and a two‐tier cross‐test were applied. The results suggest that the proposed method performs reasonably on the classification of brain magnetic resonance images.