Abstract:This study addresses long-term missing data in net ecosystem exchange (NEE) measurements by introducing the Adapter-Reverseformer (ARformer) model. Its primary goal is to improve NEE gap-filling accuracy, especially for extended data loss. NEE is crucial for understanding ecosystem carbon flux, yet data gaps from weather or sensor issues are common, with traditional interpolation methods often struggling with long-term gaps. This research leverages both environmental data and NEE’s temporal patterns to develop a model capable of handling prolonged data gaps effectively. The ARformer was designed to integrate a multi-layer perceptron (MLP) with a Reverseformer, creating a system capable of fusing the non-linear relationships between NEE and environmental factors while also modeling the time-dependent characteristics of NEE data. The model was tested using the FLUXNET 2015 dataset, which provides half-hourly carbon flux data from 65 sites across 10 different types of land use. Five artificial gap scenarios were generated by randomly removing data for continuous periods of 1, 7, 15, 30, and 90 days. The performance of ARformer was compared with marginal distribution sampling (MDS), random forest (RF), and three advanced deep learning models: Dlinear, PatchTST and iTransformer. The results showed that ARformer outperformed baseline methods, particularly with long-term data gaps. For 90-day gaps, RF’s performance dropped significantly, and MDS struggled to produce accurate estimates. ARformer, by contrast, maintained high accuracy with R2 values between 0.762 to 0.913. RMSE ranged from 0.668 to 2.724 μmol/(m2·s), MAE from 0.410 to 1.751 μmol/(m2·s), and bias values stayed between -0.024 to 0.067 μmol/(m2·s). Across land cover types like closed shrublands, deciduous and evergreen broadleaf forests, evergreen needleleaf forests, and mixed forests, ARformer captured the complex relationships between NEE and environmental drivers better than other models, and time-series deep learning models generally performed best on long-term gaps, with ARformer leading in accuracy. In conclusion, this study proves that deep learning models, particularly the ARformer, are highly effective in filling gaps in NEE data for various ecosystems. The ARformer is especially recommended when data gaps extend beyond 30 days, as its ability to capture both temporal dependencies and the relationship between NEE and environmental factors significantly improves interpolation accuracy. By applying this model, researchers can obtain more reliable NEE data, which is crucial for advancing our understanding of carbon flux dynamics across different ecosystems. The ARformer thus represents a significant advancement in addressing the challenges posed by long-term data gaps in NEE measurements.