Buried pipelines is easily subjected to external corrosion affected by complex underground environment, such as soil resistivity, pH, dissolved ion concentration, water content and coatings condition. Therefore, external corrosion rate prediction is essential to ensure pipelines intrinsic safety. Generally numerous researches focused on mathematical models and degradation analysis are limited to considering comprehensive corrosion factors. In this work, a novel proposed deep learning method involves a deep neural network (DNN) and attention mechanism which has good robust generalization ability. DNN was used to predict external corrosion rate of buried pipelines with extracting corrosion characteristics data, and attention mechanism is carried on weighting operations of corrosion factors furtherly. The results show that main controlling factors are pipeline age and soil bulk density, sulfate ion concentration and redox potential have less effect by analyzing external corrosion factors dataset, and data reduction and standardization of DNN-attention mechanism model are carried out. The external corrosion rate value predicted by the DNN-attention mechanism model is the closest prediction with the real truth, which the evaluation index root mean square error (RMSE) is 0.0064, and prediction accuracy is 91.91 % compared with convolutional neural network (CNN), CNN-residual, DNN. It proves that it is reasonable to predict pipeline external corrosion rate using DNN-attention mechanism based on publicly pipeline corrosion dataset.