As captured images for surface defect detection of a steel strip is vulnerable to lighting conditions, weaker defect characteristics and other factors, this paper proposes a new algorithm based on spectral residual visual attention mode to complete the strip surface defect detection in real time. Firstly, the homomorphic filtering method was proposed to preprocess the image to remove the influence of uneven illumination and to perfect the subsequent segmentation results. Then, a visual-attention model was constructed to obtain the defect saliency map by applying the subtraction to the logarithmic spectrum curve. Finally, the weighted Mahalanobis distance method was proposed to significantly enhance the saliency image thresholding. These locations of the defects in the original strip defect images were marked by using the connected-component labeling method. The proposed algorithm was verified by experiments. Experimental results show that the algorithm has a fast detection speed, and takes only 37.6 ms in the single image detection, meeting the requirements of the real-time detection. The comparative experiment with the gray projection method, multi-scale Gabor edge detection method and Markortree model was carried out in the same defect database, and the results show that average detection rate of the proposed algorithm reaches to 95.3% for 8 common types of defects. In the meantime, the missing rate and false positive rate are still low. These results validate the effectiveness of the algorithm. © 2016, Science Press. All right reserved.