The simulation and prediction of coastline changes are of great significance for the development and scientific management of coastal zones. Coastline changes are difficult to capture completely but appear significantly periodic over a long time series. In this paper, the transformer model is used to learn the changing trend of the coastline so as to deduce the position of the coastline in the coming year. First, we use the distance regularization level set evolution (DRLSE) model for instantaneous waterline extraction (IWE) from preprocessed Landsat time-series images from 2010–2020 in Weitou Bay, China. Then, tidal correction (TC) is performed on the extracted instantaneous waterline dataset to obtain coastlines projected to a single reference tidal datum. Finally, the coastline datasets from 2010–2019 are used for model training, and the coastline in 2020 is used for accuracy assessment. Three precision evaluation methods, including receiver operating characteristic curve matching, the mean offset, and the root mean square error, were used to verify the predicted coastline data. The receiver operating characteristic curve was specifically designed and improved to evaluate the accuracy of the obtained coastline. Compared with the support vector regression (SVR) and long–short-term memory (LSTM) methods, the results showed that the coastline predicted by the transformer model was the closest to the accurate extracted coastline. The accuracies of the correct values corresponding to SVR, LSTM, and transformer models were 88.27%, 94.08%, and 98.80%, respectively, which indicated the accuracy of the coastline extraction results. Additionally, the mean offset and root mean square error were 0.32 pixels and 0.57 pixels, respectively. In addition, the experimental results showed that tidal correction is important for coastline prediction. Moreover, through field investigations of coastlines, the predicted results obtained for natural coastlines were more accurate, while the predicted results were relatively poor for some artificial coastlines that were intensely influenced by human activities. This study shows that the transformer model can provide natural coastline changes for coastal management.