BackgroudTo predict the malignancy of 1–5 cm gastric gastrointestinal stromal tumors (GISTs) by machine learning (ML) on CT images using three models - Logistic Regression (LR), Decision Tree (DT) and Gradient Boosting Decision Tree (GBDT).Methods231 patients from Center 1 were randomly assigned into the training cohort (n = 161) and the internal validation cohort (n = 70) in a 7:3 ratio. The other 78 patients from Center 2 served as the external test cohort. Scikit-learn software was used to build three classifiers. The performance of the three models were evaluated by sensitivity, specificity, accuracy, positive predictive value (PPV), negative predictive value (NPV) and area under the curve (AUC). Diagnostic differences between ML models and radiologists were compared in the external test cohort. Important features of LR and GBDT were analyzed and compared.ResultsGBDT outperformed LR and DT with the largest AUC values (0.981 and 0.815) in the training and internal validation cohorts and the greatest accuracy (0.923, 0.833 and 0.844) across all three cohorts. However, LR was found to have the largest AUC value (0.910) in the external test cohort. DT yielded the worst accuracy (0.790 and 0.727) and AUC values (0.803 and 0.700) in both the internal validation cohort and the external test cohort. GBDT and LR performed better than radiologists. Long diameter was demonstrated to be the same and most important CT feature for GBDT and LR.ConclusionsML classifiers, especially GBDT and LR with high accuracy and strong robustness, were considered to be promising in risk classification of 1–5 cm gastric GISTs based on CT. Long diameter was found the most important feature for risk stratification.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12880-023-01053-y.