In this study, surface roughness is analyzed within a supervised pattern recognition framework using machine learning methods to present a robust technique for the quantitative determination of surface roughness of rocks. To reach this goal, rock surfaces are classified based on statistical, fractal, geostatistical, directional, and spectral features obtained from the surface profiles as well as the results of direct shear tests. In this way, after the calculation of the features in more than 9000 profiles collected from 84 natural rock samples, a representative vector containing representative features of the surface profiles was introduced for each surface, and joint roughness coefficient (JRC) was back-calculated from 84 direct shear tests on the rock samples. Then, principal component analysis and linear discriminant analysis of the representative vectors were performed in order to prepare the inputs for the classification. Multilayer perceptron (MLP) and radial basis function (RBF) artificial neural networks and support vector machine (SVM) were trained for the classification of rock surfaces. On the other hand, convolutional neural network (CNN) in which features are automatically extracted from the image data of representative surface profiles was the other method for the classification of rock surfaces. The comparison of the results shows RBF is a robust and reliable classifier yielding the least classification error among the investigated methods. Furthermore, comparing the results of machine learning methods with those of traditional equations proves that the SVM, MLP, and RBF yield superior performance.