# Modeling Terrestrial Net Ecosystem Exchange Based on Deep Learning in China
## 2 Methods
### Explanation Method  
Data-driven approaches have been widely used in recent years for net ecosystem exchange, soil moisture modeling, and remote sensing-related applications [26; 34; 35]. Shallow machine learning or deep learning models (hereafter collectively referred to as data-driven models) are also known as black box models, where the data and the ideas and internal logic used to solve the task are hidden in a complex model and do not provide explanations at the physical level. Data-driven models may consist of millions of parameters, and their internal processes cannot be clearly revealed [36]. A data-driven model behaves as a black box and cannot explain the relationship between input and predictor variables [37]. Tree models (random forest or random gradient boosting) provide a feature importance evaluation based on the Gini coefficient, reflecting the importance of the input features in the model as a whole [3; 18]; however, this overall importance fails to account for the relevance of each weather variable in a specific observation. In other words, it overlooks the importance of weather variables at a particular pixel and moment in the time series [37].  
SHAP (SHapley Additive exPlanations) is an explanatory model based on game theory principles. It quantifies the contributions of each feature towards the output of the model [38], and belongs to a model-independent explanation approach. The magnitude of the SHAP value reflects the strength of the impact that the input variable has on the predicted value. The larger the absolute SHAP value, the greater the influence of the input variable on the model's predictions [37]. SHAP assigns an importance value, known as the SHAP value, to each feature in the model. These SHAP values indicate the extent to which each feature influences the model's predictions, as well as whether the impact is positive or negative. It is important to note that the positive or negative impact here does not necessarily imply an increase or decrease in overall model performance. A positive (or negative) impact means that, for a given observation (or sample), an increase in the feature value tends to drive the model's prediction upward (or downward). When assessing feature contributions in a machine learning model, the SHAP method adheres to a key principle: if a feature's contribution to the model's prediction increases, its corresponding SHAP value will also increase. This property ensures the consistency and reliability of SHAP values as a measure of feature importance, making them a robust tool for model interpretation and analysis.  
Interpretability evaluation of various data-driven models can be implemented in Python by calling the SHAP package. In this research, we utilized the DeepExplainer tool from the SHAP package, which is specifically designed to estimate SHAP values in deep learning models. We employed it as an interpreter for the Attention-DMLP model, allowing us to analyze the input features and interpret the corresponding output results of the model. DeepExplainer is based on the DeepLIFT algorithm [39], and supports the TensorFlow and Pytorch frameworks. SHAP has the capability to assess the importance of variables for both individual prediction results of NEE values and the overall model output. It can provide insights into the relative significance of variables in predicting NEE values on an individual level, as well as their contribution to the overall output of the model.