# Labeling Expert: A New Multi-Network Anomaly Detection Architecture Based on LNN-RLSTM
## 5 Labeling Neural Network Structure  
Labeling neural network structure is a multilayer forward type of neural network with error back-propagation learning algorithm, and its structure is shown in Figure 9. In this neural network model, it contains an input layer, an output layer and an intermediate layer in between the input and output layers. The main idea of labeling neural networks is to divide the learning process into two stages. The first stage is a forward-propagation process that gives the input information, which is processed layer by layer through the input layer by the implicit layer and calculates the actual output value of each cell. Figure 8: About the abnormal data handling of compressed windows. Figure 7: Situation of very few anomalous isolated points. The second stage is the error back-propagation process, where the difference between the actual output and the desired output (i.e., the error) is recursively calculated layer by layer if the desired output value is not obtained in the output layer to adjust the weights according to this error, so that the error decreases along the gradient direction. As the process of pattern forward propagation and error back propagation is repeated alternately, the actual output of the network gradually approaches the respective desired output, and the correctness of the network's response to the input pattern increases. Once the connection weights for each layer question are determined by learning, the neural network is ready to work. The key to the training process of labeling a neural network is the selection of input and output samples, the initialization of network connection weights and the data of network results. Preparation of training sample set: Firstly, input samples and output samples are selected, then the data samples must be normalized, and finally, the training set and test set must be set, specifying the number of samples to be trained and the organization of samples to be selected. Preparation of initial weights: The starting point of the network training travel surface depends on the initialization of the connection weights, so choosing a suitable initialization method is the key to reducing the training time. Usually, the weights are randomly taken as a very small non-zero number. The design of the neural network structure: mainly the design of the number of hidden layers and the number of connected nodes. Since the labeling network with a single hidden layer can approximate a continuous function in any closed interval, the three-layer network structure can achieve the mapping from X-dimensional space to Y-dimensional space. The number of connected nodes is determined by the number of training samples in the network and the complexity of the implicit law of the samples. **Input layer:** the input pattern vector has \(n\) inputs \(x_{i}\), \((i=1,2,\ldots,n)\);  
**Hidden layer (middle layer):** there are \(n_{1}\) neurons with input of \(x_{i}\), \((i=1,2,\ldots,n)\) and output of \(h_{j}\), \((j=1,2,\ldots,n_{1})\), weight of hidden layer of \(w_{ij}\) and threshold of \(\theta_{j}\);  
\[h_{j}=f\left(\sum_{t=1}^{n1}w_{ij}h_{j}-\theta_{j}\right)\qquad j=1,2,\ldots,n1\]  
Figure 9: Structural diagram of neural network. **Output layer:** there are \(m\) neurons, the output is \(y_{l}\), \((l=1,2,\ldots,m)\), the weight of this layer is \(w_{jl}\) and the threshold is \(\theta_{l}\). \[y_{l}=f\left(\sum_{i=1}^{n1}w_{jl}h_{j}-\theta_{l}\right)\qquad l=1,2,\ldots,m\]  
**Learning sample set:**  
\[\{(X^{p},t^{p})\parallel p=1,\ldots,T\}\]  
Here: \(X^{p}=\left(-1,x_{1}^{p},x_{2}^{p},\ldots,x_{m}^{p}\right)\) is the input of the \(P\)-th sample; \(t^{p}=\left(-1,t_{1}^{p},t_{2}^{p},\ldots,t_{m}^{p}\right)\) is the standard output of \(X^{p}\);\(y^{p}=\left(-1,y_{1}^{p},y_{2}^{p},\ldots,y_{m}^{p}\right)\) is the actual output of \(X^{p}\). Untrained network, general \(t^{p}-y^{p}\
eq 0\) and the learning algorithm are used to adjust the network weight \(W\) so that \(\left(t^{p}-y^{p}\right)\to 0\).