Visual saliency detection is useful in carrying out image compression, image segmentation, image retrieval, and other image processing applications. Majority of existing saliency detection algorithms are presented for distortion-free images. However, this situation is not always the case. In this paper, we first evaluate the performances of state-of-the-art saliency detection algorithms against different distortion types and levels. A machine learning-based framework for saliency detection is proposed for two common types of distortions, noise and JPEG compression. First, a machine learning method is proposed to predict the distortion level, and then the distortion is removed using the parameter setting that is tuned for that distortion level. Finally, the saliency map is calculated by using saliency detection algorithms. We evaluate the saliency detection algorithms on Tampere Image Database (TID2013), which is proposed for image quality assessment application. We manually label the salient objects in each image and obtain its ground truth saliency map in order to adapt TID2013 for visual saliency detection application. Experimental results demonstrate that the distortions usually decrease the performances of the saliency detection algorithms, particularly in high levels of distortions. The performance rankings of the saliency detection algorithms for the distortion-free images and distorted images are different. Moreover, our proposed machine learning-based framework for saliency detection improves the performances of saliency detection algorithms in distorted images in most of the distortion levels, particularly in high levels of distortions.