Magnetic flux leakage (MFL) detection of rail surface defects is an important research field for railway traffic safety. Due to factors such as magnetization and material, it can generate background noise and reduce detection accuracy. To improve the detection signal strength and enhance the detection rate of more minor defects, a signal filtering method based on minimum entropy deconvolution is proposed to denoise. By using the objective function method, the optimal inverse filter parameters are calculated, which are applied to the filtering detection of MFL signals of the rail surface. The detection results show that the peak-to-peak ratio of the defect signal and noise signal detected by this algorithm is 2.01, which is about 1.5 times that of the wavelet transform method and median filtering method. The defect signal is significantly enhanced, and the detection rate of minor defects on the rail surface can be effectively improved.