## 2.2. Model establishment

According to the specific situation of agricultural carbon emissions in Henan Province and with reference to the relevant statistical data of Statistical Yearbook of Henan Province from 2000 to 2018, six factors that have an impact on the total carbon emissions are comprehensively selected: Chemical fertilizer, Pesticides, Agricultural film, Agricultural diesel, Irrigation and Ploughing. The carbon emission coefficient is calculated by referring to IPCC greenhouse gas emission inventory accounting (Tian et al., 2012). SPSS software was used to analyze the correlation between total carbon emissions and influencing factors. Multi-layer perceptron and radial basis function were used to establish the neural network prediction model of total carbon emissions, as shown in Fig. 2.

In Fig. 2(a), the hidden layer activation function of multilayer perceptron is hyperbolic tangent, namely:

$$tanhx=\frac{sinhx}{coshx}=\frac{{e}^{x}-{e}^{-x}}{{e}^{x}+{e}^{-x}}$$

4

The synaptic weight of the input layer of the multilayer perceptron is:

*ω* n T=(0.271, -0.059, -0.14, 0.442, 0.756, 0.814, -0.815)T

The deviation of the input layer is:

*b* 1=-0.815

The synaptic weight of the hidden layer is:

*v* 1 = 1.643

The deviation of the hidden layer is:

*b* 2=-0.382

Then the influencing factors of input layer after weight calculation are:

$$P=\left[\begin{array}{ccc}{x}_{1}& & \\ & \ddots & \\ & & {x}_{n}\end{array}\right]\times \left[\begin{array}{ccc}{w}_{1}& & \\ & \ddots & \\ & & {w}_{n}\end{array}\right]=\left[\begin{array}{ccc}{w}_{1}{x}_{1}& & \\ & \ddots & \\ & & {w}_{n}{x}_{n}\end{array}\right]=\left[\begin{array}{ccc}{X}_{1}& & \\ & \ddots & \\ & & {X}_{n}\end{array}\right]$$

5

The input layer deviation after weight calculation is:

$${B}_{1}=1\times {b}_{1}=-0.815$$

After calculation of hyperbolic tangent function, we can get:

$$\text{H}\left(1: 1\right)=tanh \left(\sum _{n=1}^{6}{X}_{n}\right)+tanh \left(\sum _{n=1}^{1}{B}_{n}\right)$$

$$=\text{tanh}({X}_{1}+{X}_{1}+\dots +{X}_{6})+\text{tanh}{B}_{1}$$

$$=\frac{exp\left({X}_{1}+{X}_{1}+\dots +{X}_{6}\right)-\text{e}\text{x}\text{p}[-\left({X}_{1}+{X}_{1}+\dots +{X}_{6}\right)]}{exp\left({X}_{1}+{X}_{1}+\dots +{X}_{6}\right)+\text{e}\text{x}\text{p}[-\left({X}_{1}+{X}_{1}+\dots +{X}_{6}\right)]}+\frac{exp\left({B}_{1}\right)-exp\left(-{B}_{1}\right)}{exp\left({B}_{1}\right)+exp\left(-{B}_{1}\right)}$$

6

Then, the total carbon emissions *Y* are:

$$Y={v}_{1}\times H(1: 1)+{b}_{2}$$

7

In Fig. 2(b), the hidden layer activation function of the radial basis function is SoftMax, that is:

$$Softmax\left({x}_{i}\right)=\text{exp}\left({x}_{i}\right)/\sum _{n=1}^{6}\text{e}\text{x}\text{p}\left({x}_{n}\right)$$

8

The synaptic weight of the radial basis function input layer is:

$$\left(\begin{array}{cc}{\omega }_{1n}& {\omega }_{2n}\end{array}\right)= {\left[\begin{array}{cc}0.269& 0.287\\ 0.889& 0.820\end{array}\begin{array}{cc}0.227& 0.216\\ 0.831& 0.821\end{array}\begin{array}{cc}0.156& 0.200\\ 0.695& 0.965\end{array}\right]}^{\text{T}}$$

The synaptic weight of the hidden layer is:

*v* n T=(0.227, 0.925)T

Then the influencing factors of input layer after weight calculation are:

$$\left\{\begin{array}{c}{Q}_{1}=\left[\begin{array}{ccc}{x}_{1}& & \\ & \ddots & \\ & & {x}_{n}\end{array}\right]\times \left[\begin{array}{ccc}{w}_{11}& & \\ & \ddots & \\ & & {w}_{1n}\end{array}\right]=\left[\begin{array}{ccc}{w}_{11}{x}_{1}& & \\ & \ddots & \\ & & {w}_{1n}{x}_{n}\end{array}\right]=\left[\begin{array}{ccc}{X}_{11}& & \\ & \ddots & \\ & & {X}_{1n}\end{array}\right]\\ {Q}_{2}=\left[\begin{array}{ccc}{x}_{1}& & \\ & \ddots & \\ & & {x}_{n}\end{array}\right]\times \left[\begin{array}{ccc}{w}_{21}& & \\ & \ddots & \\ & & {w}_{2n}\end{array}\right]=\left[\begin{array}{ccc}{w}_{21}{x}_{1}& & \\ & \ddots & \\ & & {w}_{2n}{x}_{n}\end{array}\right]=\left[\begin{array}{ccc}{X}_{21}& & \\ & \ddots & \\ & & {X}_{2n}\end{array}\right]\end{array}\right.$$

9

After SoftMax calculation, the following results are obtained:

$$\left\{\begin{array}{c}H\left(1\right)=\text{exp}\left({X}_{11}+{X}_{12}+\dots +{X}_{16}\right)/\sum _{n=1}^{6}\text{exp}\left({x}_{n}\right)\\ H\left(2\right)=\text{exp}\left({X}_{21}+{X}_{22}+\dots +{X}_{26}\right)/\sum _{n=1}^{6}\text{exp}\left({x}_{n}\right)\end{array}\right.$$

10

Then, the total carbon emission Y is:

$${Y}_{1}=\left[H\left(1\right), H\left(2\right)\right]\times {\left[{v}_{1}{v}_{2}\right]}^{T}$$

11

The comparison between the carbon emission results calculated from the neural network model in Fig. 2 and Equations (7) and (11) and the original data of carbon emission is shown in Fig. 3.

As can be seen from Fig. 3, the carbon emission prediction results obtained by the two neural network models of multi-layer perceptron and radial basis function have a high similarity with the original recovery result. In order to analyze the fitting degree of the two models in detail, the residual and correlation coefficients of the two prediction results should be calculated. The residual error can be calculated as follows:

$${\delta }_{i}={Y}_{i}-{y}_{i}$$

12

$${\delta }_{i}^{*}=\frac{{\delta }_{i}-\stackrel{-}{\delta }}{\sigma }$$

13

Where, *δ*i is the residual, *Y*i is the predicted value of the neural network, *y*i is the original value, *δ*i* is the standardized residual, \(\stackrel{-}{\delta }\) is the average value of the residual, and σ is the standard deviation.

Then, the correlation coefficient *R*2 between the total carbon emissions prediction curve and the original curve can be calculated as follows:

$${R}^{2}=\frac{\sum _{i=1}^{n}{\delta }_{i}^{2}}{\sum _{i=1}^{n}{\left({Y}_{i}-\stackrel{-}{y}\right)}^{2}}$$

14

According to Equations (4), (5) and (6), the residual, standardized residual and correlation coefficients of the prediction curve are calculated, as shown in Table 1.

Table 1

Neural network prediction pair ratio

Total Carbon Emissions | Multilayer perceptron (*R*2 = 0.998) | Radial basis function (*R*2 = 0.933) |

Predictive value | *δ*i | *δ*i* | Predictive value | *δ*i | *δ*i* |

3.97 | 4 | 0.03 | 2.18 | 4.16 | 0.19 | 2.42 |

4.12 | 4.11 | -0.01 | -0.78 | 4.16 | 0.04 | 0.48 |

4.09 | 4.09 | 0.00 | -0.04 | 4.16 | 0.07 | 0.87 |

4.13 | 4.12 | -0.01 | -0.78 | 4.16 | 0.03 | 0.35 |

4.17 | 4.16 | -0.01 | -0.78 | 4.16 | -0.01 | -0.17 |

4.22 | 4.21 | -0.01 | -0.78 | 4.16 | -0.06 | -0.81 |

4.26 | 4.26 | 0.00 | -0.04 | 4.16 | -0.10 | -1.33 |

4.31 | 4.31 | 0.00 | -0.04 | 4.16 | -0.15 | -1.97 |

4.66 | 4.68 | 0.02 | 1.44 | 4.76 | 0.10 | 1.26 |

4.7 | 4.72 | 0.02 | 1.44 | 4.76 | 0.06 | 0.74 |

4.73 | 4.74 | 0.01 | 0.70 | 4.76 | 0.03 | 0.35 |

4.76 | 4.77 | 0.01 | 0.70 | 4.76 | 0.00 | -0.04 |

4.71 | 4.68 | -0.03 | -2.26 | 4.76 | 0.05 | 0.61 |

4.75 | 4.75 | 0.00 | -0.04 | 4.76 | 0.01 | 0.09 |

4.81 | 4.81 | 0.00 | -0.04 | 4.76 | -0.05 | -0.68 |

4.82 | 4.81 | -0.01 | -0.78 | 4.76 | -0.06 | -0.81 |

4.81 | 4.81 | 0.00 | -0.04 | 4.76 | -0.05 | -0.68 |

4.81 | 4.81 | 0.00 | -0.04 | 4.76 | -0.05 | -0.68 |

It can be seen preliminarily from Table 1 that the prediction result of multi-layer perceptron is superior to the radial basis function. In order to further analyze the fitting effect of the two, the variance and standardized variance curves of prediction results are drawn, as shown in Fig. 4.

The Fig. 4 shows that the absolute value of multilayer perceptron residual \(\left|{\delta }_{i}\right|\)∈[0,0.03], the absolute value of radial basis function residual \(\left|{\delta }_{i}\right|\)∈[0,0.19], multi-layer perceptron accuracy obviously due to the radial basis function. It shows that the multilayer perceptron has a better effect on the regression and prediction of total carbon emissions.

Figure 5 shows the importance of each influence factor under the two neural network models, and the sum of the weight of each influence factor is 1. Figure 5 shows that in the multi-layer perceptron model, the order of importance of influencing factors is Ploughing > Irrigation > Agricultural diesel > Chemical fertilizer > Agricultural film > Pesticides. In the RBF model, the order of importance of influencing factors is Ploughing > Chemical fertilizer > Agricultural diesel > Agricultural film > Pesticides > Irrigation.

The importance of influencing factors reflects their role in the neural network model. In the multi-layer perceptron model, the weight of each influencing factor is relatively balanced, and each factor plays an important role in the results of the model, so the prediction of the model is relatively accurate. The RBF model mostly relies on the influence factor of Ploughing, the weight of four factors such as pesticide and Agricultural film is less than 10%, and the weight of the single influence factor of Irrigation is even as low as 1%, which indicates that the model cannot make effective use of all the influence factors, leading to a low accuracy of regression prediction.