Multiple sclerosis is a chronic, autoimmune disease that mainly affects the central nervous system, including the brain, spinal cord, and optic nerve. This disease can cause clinical symptoms such as cognitive decline, muscle weakness, spasms, and fatigue in patients, and the onset tends to be younger. Current medication can only prevent or alleviate symptoms, so early diagnosis of this disease can increase patients' chances of treatment. Although the use of nuclear magnetic resonance detection can improve the efficiency of early auxiliary diagnosis, it still requires experienced doctors to spend too much time and energy on comprehensive judgment. To reduce the time cost and improve the efficiency of multiple sclerosis diagnosis, this article proposes a detection and recognition algorithm for multiple sclerosis based on wavelet entropy and self-adaptive particle swarm optimization. Firstly, a triple discrete wavelet transform is performed on the brain image of multiple sclerosis, and then 10 wavelet entropies are extracted from the decomposed wavelet subbands, which can reduce the feature dimensions of the image; Then, the algorithm of self-adaptive particle swarm optimization is used to optimize the feedforward neural network, in order to obtain the optimal connection weights and thresholds during the training process. The result of the model is with an average sensitivity of 92.29±1.89, specificity of 92.54±0.67, precision of 92.48±0.59, accuracy of 92.42±0.88, and F1 score of 84.85±1.74, Matthews correlation coefficient of 92.37±0.96, and Fowlkes223 Mallows Index of 92.38±0.96. The experimental results indicate that this algorithm has a very important data support role in detecting multiple sclerosis.