The prevention and control of heavy metal pollution in soil has become one of the important tasks in improving the quality of cultivated land and protecting the ecological security of the land. In order to scientifically predict the relationship between heavy metal contents in soil and staple crops (rice and wheat) in China and reduce the collaborative monitoring of a large number of agricultural products and soil form unpolluted agricultural land, as well as realize the safe use of heavy metal contaminated agricultural land, we studied heavy metal Cd as an example. We selected soil Cd content, pH value, cation exchange capacity (CEC) and organic carbon (OC) as inputs and the Cd contents of rice and wheat as outputs to build the multiple regression and neural network models through simulation. The results showed that the Cd content in rice or wheat was positively correlated with soil Cd content. The predictive abilities of the simulated multiple linear regression model for Cd in rice or wheat and soil were 67.8% and 83.8%, respectively. But the corresponding prediction model based on neural network had higher R-values in the training, validation and test sets than the multiple linear regression model, and the MSE value was small. Thus, the prediction accuracy of the neural network was better than that of the multivariate model for predicting Cd contents in rice and wheat. The research results can provide a theoretical basis and reference for the safety evaluation and optimal allocation of contaminated agricultural land. © 2021, Editorial Office of Earth Science Frontiers. All right reserved.