Soil salinization is a global issue confronting humanity, imposing significant constraints on agricultural production in the irrigated regions along the southern bank of the Yellow River. This, in turn, leads to the degradation of the ecological environment and inadequate grain yields. Hence, it is essential to explore the magnitude and spatial patterns of soil salinization to promote efficient and sustainable agricultural development. This study carried out a two-year surface soil sampling experiment encompassing the periods before spring irrigation and the budding, flowering, and maturity stages of sunflower fields in the irrigated area along the southern bank of the Yellow River. It employed deep learning in conjunction with multispectral remote sensing conducted by UAV to estimate soil salinity levels in the sunflower fields. Following the identification of sensitive spectral variables through correlation analysis, we proceeded to model and compare the accuracy and stability of various models, including the deep learning Transformer model, traditional machine learning BP neural network (BPNN), random forest model (RF), and partial least squares regression model (PLSR). The findings indicate that the precision of soil salinity content (SSC) retrieval in saline–alkali land can be significantly enhanced by incorporating the RE band of UAV data. Four SSC inversion models were developed using the most suitable spectral variables, resulting in precise soil salinity inversion. The model order based on accuracy and stability was Transformer > BPNN > RF > PLSR. Notably, the Transformer model achieved a prediction accuracy exceeding 0.8 for both the training and test datasets, as indicated by R2 values. The precision order of the soil salinity inversion model in each period is as follows: before spring irrigation > budding period > maturity period > flowering stages. Additionally, the accuracy is higher in the bare soil stage compared to the crop cover stage. The Transformer model exhibited RMSE and R2 values of 2.41 g kg−1 and 0.84 on the test datasets, with the salt inversion results aligning closely with field-measured data. The results showed that the Transformer deep learning model integrated with RE band data significantly enhances the precision and efficiency of soil salinity inversion within the irrigated regions along the south bank of the Yellow River.