# A Total Crop-Diagnosis Platform Based on Deep Learning Models in a Natural Nutrient Environment
## 2 Related Works
### A Design of a Crop Self-Diagnosis Module (CSM) Based on Deep Learning
#### 3.4.2 A Design of the TEDS  
The TEDS performs deep learning based on the multi-layered deep belief network model (DBN). If the number of input layer nodes in the DBN is the same as that of the output layer nodes, unsupervised learning is possible. However, because the number of input layer nodes in the TEDS is different from that of the output layer nodes, unsupervised learning based on the restricted Boltzmann machine (RBM) is done from the input layer to the last hidden layer and supervised learning based on back-propagation is done between the last hidden layer and the output layer. Figure 10 shows the example of the integrated model in the TEDS. The six outputs of the APDS are used for the six inputs of the TEDS. This is represented in Formula (14). \[\mathrm{X}=\{x_{1},x_{2},x_{3},x_{4},x_{5},x_{6}|0<x<1\} \tag{14}\]  
y is the output of the TEDS and represents how suitable the current environmental state is for the growing crops. The size of y is between 0 and 1 and the threshold values of y are 0.4 and 0.6. If the output of y is equal to or greater than 0.6, it means that the current environmental state is in a good condition for farming. If the output of y is between 0.6 and 0.4, it means that the current environmental state should be checked. If the output of y is less than 0.4, the current environmental state is not in a good condition for farming. Figure 11 shows the structure of the TEDS. The number of hidden layers is set as 4. Because the  
Figure 10: The example of the integrated model in the total environment diagnosis sub-module (TEDS). number of input and output layer nodes is smaller, the correlation between parts is computed with the four hidden layers by the TEDS. The hidden layers of the TEDS are represented in the Formula (15). \[\mathrm{H}^{\mathrm{a}}=\{h_{1}^{a},h_{2}^{a},h_{3}^{a},h_{4}^{a},\ldots,h_{k}^{ a}|1\leq a\leq 4\} \tag{15}\]  
where \(k\) means the number of hidden layer nodes and \(a\) means the number of hidden layers. For example, the 1 st hidden layer and the nodes of the 1 st hidden layer are represented as \(\mathrm{H}^{1}=\{h_{1}^{1},h_{2}^{1},h_{3}^{1},h_{4}^{1},\ldots,h_{k}^{1}\}\) and the 2 nd hidden layer and the nodes of the 2 nd hidden layer are represented as \(\mathrm{H}^{2}=\{h_{1}^{2},h_{2}^{2},h_{3}^{2},h_{4}^{2},\ldots,h_{k}^{2}\}\). Algorithm 2 shows the learning procedure of the TEDS. ```
Input = Training data \(\{X_{1},d_{1}\}\),..., \(\{X_{N},d_{N}\}\); (\(X_{n}\) is set of sensor data, \(\mathrm{d}_{n}\) is result of \(X_{n}\)) Run: Initialize sample weight \(w\);  n is the number of input layer nodes  mJ[4] is set of the number of hidden layer nodes for (int k =



Each neuron's computation method is similar to that of a perceptron. That is, the weight sum net of input layer values is applied to the Sigmoid function. For example, in Figure 11, the output value of \(h_{k}^{1}\) is computed in the Formula (16). \[\mathrm{P}\Big{(}h_{k}^{1}\Big{|}x\Big{)}=\sigma\Big{(}net_{h_{1}^{1}}\Big{)} \tag{16}\]

where \(\mathrm{P}\big{(}h_{k}^{1}|x\big{)}\) is a value of \(h_{k}^{1}\) node when \(x\) is used as an input. \(\sigma\Big{(}net_{h_{1}^{1}}\Big{)}\) is a Sigmoid function used as an activation function in the artificial neural network, as shown in Formula (17). \[\sigma\Big{(}net_{h_{1}^{1}}\Big{)}=\frac{1}{1+\exp\left(-net_{h_{1}^{1}} \right)} \tag{17}\]

where the \(net_{h_{1}^{1}}\) represents the weight sum of input layer values. The \(net_{h_{1}^{1}}\) is computed in Formula (18). \[net_{h_{1}^{1}}=\sum_{c}^{6}\omega_{ct}^{1}x_{c} \tag{18}\]

Because an RBM-based learning is unsupervised learning, it is proceeded by using the \(x^{\prime}\) value that computed the \(net\) value from \(h^{1}\) to \(x\) again. The TEDS continues learning by using the following phase from the input layer to the last layer. In the 1 st phase, the TEDS computes the 1 st hidden layer value, \(\mathrm{P}\big{(}h_{k}^{1}|x\big{)}\).