Abstract Background and Aims Acute kidney injury (AKI) is a common complication of acute myocardial infarction (AMI) with high morbidity, mortality and lack of effective treatment, so prevention is particularly important. This study intends to use machine learning to establish a precise prediction model for AKI after AMI. Method AMI patients were consecutively collected from July 2011 to December 2016 in Beijing Anzhen Hospital, Capital Medical University. First, SelectFromModel and Lasso regression model were used to select features. A predictive model (Model A) was then created using a multivariate logistic regression model in the training set and validated in the test set. At the same time, the prediction model (Model B) is created by machine learning algorithm in the training set. The process of model construction and evaluation is implemented by Python. The algorithm includes MLP, SVM, KNN and SimpleRNN, from which the model with the largest area under the ROC curve (Model B) is selected and verified in the test set. DeLong method was used to compare the model B with model A to compare whether the area under the ROC curve was better than multivariate logistic regression model and select the best model. Results A total of 6014 AMI patients were included in this study, 70% were randomly selected as the training set, and the remaining 30% were used as the test set. Males comprised 80.5% of the total population with a mean age of 58.4 ± 11.7 years. The incidence of AKI in the overall population was 11.2% (674/6014) (Fig. 1). A total of 12 important characteristics were included in the model, including the number of myocardial infarctions, ST-segment elevation myocardial infarction, ventricular tachycardia, third-degree atrioventricular block, decompensated heart failure at admission, admission serum creatinine value, admission urea nitrogen value, admission CK-MB peak value, whether diuretics were used, maximum daily dose of diuretics, days of diuretic use, and whether statins were used. Logistic regression analysis resulted in an area under the ROC curve of 0.80 (95% CI, 0.76-0.84) in the test set (Fig. 2). The models were constructed by MLP, SVM, KNN and SimpleRNN algorithms, respectively, and validated in the test set to calculate the area under the ROC curve of each model in the test set (Fig. 3), and finally the model constructed by MLP algorithm was selected as model B, and its area under the ROC curve was 0.82 (95% CI, 0.78–0.85). The area under the ROC curve of the two models was compared at p=0.363, but the machine learning algorithm constructed models with higher absolute values (Fig. 4). Conclusion The prediction model of AKI risk after AMI constructed based on machine learning is similar to that constructed by logistic regression analysis in terms of prediction ability, but the model constructed by machine learning algorithm has a better trend, indicating that the machine learning algorithm may improve the prediction ability of prediction model and provide an effective tool for early identification of these high-risk patients in clinical practice, early preventive measures, and reduction of morbidity.