Protecting forest resources and preventing forest fires are vital for social development and public well-being. However, current research studies on forest fire warning systems often focus on extensive geographic areas like states, counties, and provinces. This approach lacks the precision and detail needed for predicting fires in smaller regions. To address this gap, we propose a Transformer-based time series forecasting model aimed at improving the accuracy of forest fire predictions in smaller areas. Our study focuses on Quanzhou County, Guilin City, Guangxi Province, China. We utilized time series data from 2021 to 2022, along with remote sensing images and ArcGIS technology, to identify various factors influencing forest fires in this region. We established a time series dataset containing twelve influencing factors, each labeled with forest fire occurrences. By integrating these data with the Transformer model, we generated forest fire danger level prediction maps for Quanzhou County. Our model’s performance is compared with other deep learning methods using metrics such as RMSE, and the results reveal that the proposed Transformer model achieves higher accuracy (ACC = 0.903, MAPE = 0.259, MAE = 0.053, RMSE = 0.389). This study demonstrates that the Transformer model effectively takes advantage of spatial background information and the periodicity of forest fire factors, significantly enhancing predictive accuracy.