Our main objective was to use machine learning methods to identify significant structural factors associated with pain severity in knee osteoarthritis patients. Additionally, we assessed the potential of various classes of imaging data using machine learning techniques to gauge knee pain severity. The data of semi-quantitative assessments of knee radiographs, semi-quantitative assessments of knee magnetic resonance imaging (MRI), and MRI images from 567 individuals in the Osteoarthritis Initiative (OAI) were utilized to train a series of machine learning models. Models were constructed using five machine learning methods: random forests (RF), support vector machines (SVM), logistic regression (LR), decision tree (DT), and Bayesian (Bayes). Employing tenfold cross-validation, we selected the best-performing models based on the area under the curve (AUC). The study results indicate no significant difference in performance among models using different imaging data. Subsequently, we employed a convolutional neural network (CNN) to extract features from magnetic resonance imaging (MRI), and class activation mapping (CAM) was utilized to generate saliency maps, highlighting regions associated with knee pain severity. A radiologist reviewed the images, identifying specific lesions colocalized with the CAM. The review of 421 knees revealed that effusion/synovitis (30.9%) and cartilage loss (30.6%) were the most frequent abnormalities associated with pain severity. Our study suggests cartilage loss and synovitis/effusion lesions as significant structural factors affecting pain severity in patients with knee osteoarthritis. Furthermore, our study highlights the potential of machine learning for assessing knee pain severity using radiographs.