As an important part of the intelligent transportation system (ITS), short-term traffic prediction has become a hot research topic in the field of traffic engineering. In recent years, with the emergence of rich traffic data and the development of deep learning technologies, neural networks have been widely used in short-term traffic forecasting. Among them, the Recurrent Neural Networks (RNN), especially the Long Short-Term Memory network (LSTM) shows the excellent ability of time-series tasks. To improve the prediction accuracy of the LSTM, some research uses the spatial-temporal matrix or Convolutional Neural Network (CNN) to extract the spatial features of the data for the LSTM network to use. In this article, we propose an attention CNN to predict traffic speed. The model uses three-dimensional data matrices constructed by traffic flow, speed, and occupancy. The spatial-temporal features extraction and the attention models are all performed by the convolution unit. Experiments on traffic data at 15-minute intervals show that the proposed algorithm has considerable advantages in predicting tasks compared to other commonly used algorithms, and the proposed algorithm has an improvement effect for cases with missing data. At the same time, by visualizing the weights generated by the attention model, we can see the influence of different spatial-temporal data on the forecasting task. C 2018 Computer-Aided Civil and Infrastructure Engineering.