In order to detect multiple sclerosis (MS) subjects from healthy controls (HCs) in magnetic resonance imaging, we developed a new system based on machine learning. The MS imaging data was downloaded from the eHealth laboratory at the University of Cyprus, and the HC imaging data was scanned in our local hospital with volunteers enrolled from community advertisement. Inter-scan normalization was employed to remove the gray-level difference. We adjust the misclassification costs to alleviate the effect of unbalanced class distribution to the classification performance. We utilized two-level stationary wavelet entropy (SWE) to extract features from brain images. Then, we compared three machine learning based classifiers: the decision tree, k-nearest neighbors (kNN), and support vector machine. The experimental results showed the kNN performed the best among all three classifiers. In addition, the proposed SWE+kNN approach is superior to four state-of-the-art approaches. Our proposed MS detection approach is effective.