In order to explore the heavy metal pollution risk in the farmland soil of the middle and lower watershed of the Zhengshui River, a tributary of the Xiangjiang River, sampling analysis and pollution source identification of the farmland soil in this area were conducted. The results are as follows: 1) There is a relatively high Cd pollution risk in the soil of this region, and some areas also face pollution risks from As, Pb, and Cu. 2) The spatial distribution patterns of Cd and Zn in the soil are similar. The spatial distribution patterns of Cr, Cu, and Ni are also similar, and they all have strong correlations. The spatial distribution patterns of Hg and As are partially similar. The spatial distribution pattern of Pb differs significantly from those of other elements. 3) The PMF model identified four pollution sources, namely the natural-atmospheric deposition mixed source, the natural source, the atmospheric deposition source, and the industrial source, with contribution rates of 30.8%, 27.0%, 22.6%, and 19.6% respectively. 4) The results of source identification by the SOM model are highly consistent with those of the PMF model. The results of the LightGBM model indicate that the distance from the main stream of the Zhengshui River has a significant impact on Cd, Pb, Ni, and Zn. PM2.5 has a great influence on Cd and Pb. The parent rock type is the most influential factor for As, Hg, and Cr. Traffic-related factors have a greater impact on Cu and Zn. The research shows that the farmland soil in this study area has a certain risk of heavy metal pollution, and the pollution sources are complex, and the receptor model combined with the machine learning model can more reasonably identify the main pollution sources of each soil heavy metal. |