Heavy Metals (HM) in soil pose a serious threat to environmental and public health, particularly in regions with extensive human activities. This study provides a comprehensive approach to evaluate the ecological and human health risks associated with eight key HM: copper (Cu), lead (Pb), nickel (Ni), chromium (Cr), zinc (Zn), cadmium (Cd), arsenic (As), and mercury (Hg). By utilizing advanced self-organizing maps (SOMs), this study identifies complex spatial patterns of HM contamination, pinpointing critical areas for targeted management interventions. The potential ecological risk index (PERI) highlights risks ranging from moderate to very high, with Cd, Pb, and Cr identified as the key contributors to ecological hazards due to their acute toxicity and extensive distribution. In addition, Monte Carlo simulations offer a comprehensive analysis of human health impacts, revealing significantly elevated non-carcinogenic and carcinogenic risks, particularly for children. The hazard indices (HI) and total cancer risk (TCR) values for Pb and As frequently exceed safety thresholds, indicating the need for protective measures for vulnerable groups. Structural equation modeling (SEM) further indicates that anthropogenic pressure and industrial activity significantly elevated soil concentrations of Cu and Cr, whereas agricultural activity was associated with increased Zn levels. By integrating advanced risk assessment methods, this study provided a practical, adaptable model for managing soil contamination risks, equipping policymakers and environmental managers with actionable insights to address the challenges of HM pollution and safeguard both ecosystems and public health.