## 2 Algorithm Introduction
### Network Training
#### 2.2.1 Deep Belief Network  
The function of the DBN is to initialize the weights of the deep learning network in order to solve gradient diffusion problem caused by the use of the gradient descent method used to correct the weights [33; 34]. This network is comprised of a few Restricted Boltzmann Machine Networks [35; 36]. The topological graph of Restricted Boltzmann Machine Network is shown in Figure 3.  
The Restricted Boltzmann Machine network consists of two layers, namely, the visible layer and the hidden layer. The neurons between the two layers are fully connected, while the neurons in the peer layer are mutually independent. Both of the layers meet the Boltzmann distribution. Using conditional probability, the two layers can be refactored. When the difference between the hidden reconstruction vector and the input sample set is less than the minimum value that is already set, the training will be finished. The three parameters determined by training are the net weight \(W_{\text{mn}}\) the offset \(B_{n}\), and \(C_{m}\), where  
\[B_{n}=\left[\begin{array}{cccc}b_{1}&b_{2}&\cdots&b_{n}\end{array}\right] \tag{1}\]  
\[C_{m}=\left[\begin{array}{cccc}c_{1}&c_{2}&\cdots&c_{m}\end{array}\right] \tag{2}\]  
The energy equation is  
\[E(x,y;\theta)=-\underset{ij}{\sum}w_{ij}x_{i}y_{j}-\underset{i}{\sum}b_{i}x_{ i}-\underset{j}{\sum}c_{j}y_{j} \tag{3}\]  
where \(\theta=\{w,b,c\}\)  
The joint probability density is  
\[p(x,y)=\frac{e^{-E(x,y)}}{\underset{x,y}{\sum}e^{-E(x,y)}} \tag{4}\]  
Since the probability is a special case of the Gibbs probability distribution [37; 38], we obtain  
\[\frac{\partial\ln p(x)}{\partial w_{ij}}=x_{j}p(y_{i}=1|x)-\frac{1}{l}\underset {k}{\sum}p(y_{i}=1|y^{\prime}_{k})y^{\prime}_{kj} \tag{5}\]  
\[\frac{\partial\ln p(x)}{\partial b_{j}}=x_{j}-\frac{1}{l}\underset{k}{\sum}y^ {\prime}_{kj} \tag{6}\]  
\[\frac{\partial\ln p(x)}{\partial c_{i}}=p(y_{i}=1|x)-\frac{1}{l}\underset{k}{ \sum}p(y_{i}=1|y^{\prime}_{k}) \tag{7}\]  
Figure 3: Network topology of Restricted Boltzmann Machine.  
The weight updating formula is as follows (for learning rate, k for the number of cycles):  
\[w_{ij}=w_{ij}+\alpha\Big{(}x_{j}^{(0)}p\Big{(}y_{i}=1\Big{|}x^{(0)}\Big{)}-x_{j}^ {(k)}p\Big{(}y_{i}=1\Big{|}x^{(k)}\Big{)}\Big{)} \tag{8}\]  
\[b_{j}=b_{j}+\alpha\Big{(}x_{j}^{(0)}-x_{j}^{(k)}\Big{)} \tag{9}\]  
\[c_{i}=c_{i}+\alpha\Big{(}p\Big{(}y_{i}=1\Big{|}x^{(0)}\Big{)}-p\Big{(}y_{i}=1 \Big{|}x^{(k)}\Big{)}\Big{)} \tag{10}\]  
where  
\[p(y_{i}=1|x)=sigmoid\Bigg{(}\sum_{j=1}^{m}w_{ij}x_{j}+c_{i}\Bigg{)} \tag{11}\]  
The Sigmoid function is defined as follows:  
\[f(x)=\frac{1}{1+e^{-x}} \tag{12}\]  
Deep belief net training can be regarded as successively training several Boltzman machine networks limited to two layers, using unsupervised learning from the bottom to the top layer. The intent is to match the features of the data as much as possible. Moreover, in order to improve the accuracy, robustness, and stability of the classification results and to enhance the divisibility of the data, computations in this paper also use samples with categories that are known in order to train the network. In other words, this approach supervises fine-tuning of the network from the top to the bottom using the gradient descent method.  
The specific training program Algorithm 1 flowchart is as follows, in which \(\mathbf{X}\) is for training samples, \(\mathbf{X}^{\prime}\) is for fine-tuning samples, and \(\mathbf{Y}\) is for fine-tuning sample tags:  
```
1. init\(\theta_{i}=\{\mathbf{w}_{i},\mathbf{b}_{i},\mathbf{c}_{i}\}\) for \(i=1,2,\cdots,n\);
2. Input \(\mathbf{X}\);
3. For \(i=1,2,\cdots,n\);
4. Train \(RBM_{i}\)
5. \(\mathbf{x}=sigmoid(\mathbf{c}_{i}+\mathbf{x}*\mathbf{w}_{i})\)
6. End
7. If Fine tune training
8. Input \(\{\mathbf{X}^{\prime};\mathbf{Y}\}\) using Gradient descent method
9. Endif
10. Output \(\theta_{i}=\{\mathbf{w}_{i},\mathbf{b}_{i},\mathbf{c}_{i}\}\) for \(i=1,2,\cdots,n\);
```  
**Algorithm 1**