Background: Type 2 diabetes mellitus (T2DM) is a crucial risk factor for cognitive impairment. Accurate assessment of patients’ cognitive function and early intervention is helpful to improve patient’s quality of life. At present, neuropsychiatric screening tests is often used to perform this task in clinical practice. However, it may have poor repeatability. Moreover, several studies revealed that machine learning (ML) models can effectively assess cognitive impairment in Alzheimer’s disease (AD) patients. We investigated whether we could develop an MRI-based ML model to evaluate the cognitive state of patients with T2DM.Objective: To propose MRI-based ML models and assess their performance to predict cognitive dysfunction in patients with type 2 diabetes mellitus (T2DM).Methods: Fluid Attenuated Inversion Recovery (FLAIR) of magnetic resonance images (MRI) were derived from 122 patients with T2DM. Cognitive function was assessed using the Chinese version of the Montréal Cognitive Assessment Scale-B (MoCA-B). Patients with T2DM were separated into the Dementia (DM) group (n = 40), MCI group (n = 52), and normal cognitive state (N) group (n = 30), according to the MoCA scores. Radiomics features were extracted from MR images with the Radcloud platform. The variance threshold, SelectKBest, and least absolute shrinkage and selection operator (LASSO) were used for the feature selection. Based on the selected features, the ML models were constructed with three classifiers, k-NearestNeighbor (KNN), Support Vector Machine (SVM), and Logistic Regression (LR), and the validation method was used to improve the effectiveness of the model. The area under the receiver operating characteristic curve (ROC) determined the appearance of the classification. The optimal classifier was determined by the principle of maximizing the Youden index.Results: 1,409 features were extracted and reduced to 13 features as the optimal discriminators to build the radiomics model. In the validation set, ROC curves revealed that the LR classifier had the best predictive performance, with an area under the curve (AUC) of 0.831 in DM, 0.883 in MIC, and 0.904 in the N group, compared with the SVM and KNN classifiers.Conclusion: MRI-based ML models have the potential to predict cognitive dysfunction in patients with T2DM. Compared with the SVM and KNN, the LR algorithm showed the best performance.