Age-related macular degeneration (AMD) is the leading cause of blindness in older people in developed countries. It has been suggested that heavy metal exposure may be associated with the development of AMD, but most studies have focused on the effects of a single metal with traditional methods. In this study, we analyzed the relationship between 13 urinary heavy metal concentrations and AMD using NHANES data between 2005 and 2008. We constructed and compared 11 machine learning models to identify the best model for predicting AMD risk. We further interpreted the models by Permutation Feature Importance (PFI), Partial Dependence Plot (PDP) analysis, and SHapley Additive exPlanations (SHAP) analysis. 216 AMD patients out of 2380 participants. The random forest (RF) model performed optimally in predicting the risk of AMD, with an AUC value of 0.970. PFI analyses revealed that age and urinary cadmium (Cd) were the main factors influencing the risk of AMD. SHAP analyses further confirmed the significance of Cd concentration in predicting the risk of AMD, and we revealed a significant interaction with significant interaction of race. Our study firstly explored the relationship between heavy metal exposure levels and AMD based on machine learning techniques, found that urinary Cd concentration had the greatest impact on AMD, and revealed the superior predictive performance of machine learning methods. Furthermore, our study provided a new perspective for early screening and intervention of AMD.