# Tor Anonymous Traffic Identification Based on Parallelizing Dilated Convolutional Network
## 3 Model Design of This Paper
### Multilayer Restricted Boltzmann Machine Coding Module  
The multi-layer restricted Boltzmann machine is used to encode the input utilizing unsupervised learning. The single-layer RBM is first introduced which consists of two layers of neurons, a layer called the visible layer used for the input training data and a layer called the hidden layer used to extract features; hence, the name of the hidden element is also known as the feature detector. The structure of a single-layer RBM is shown in Figure 9. Since only the inter-layer is symmetrically fully connected within the visible and hidden layers, the neurons within the layers are not interconnected, so given the values of all the visible elements, the values of each hidden element are not correlated with each other. Similarly, given all the hidden elements, the values of the visible elements are not correlated so that parallel computing can be applied to the calculation of the values of each neuron. We process the extracted cell timestamp data (for example in Figure 8, \"subtraction\" are performed on 0, 0, 0.1895 of the first three timestamps to obtain 0, 0-0, 0.1895-0), and then use it as v1, v2, v3... aa input to the multi-layer RBMs. h1, h2, h3... in the following layer to demonstrate the results obtained after a single-layer encoding. \begin{table}
\begin{tabular}{c c} \hline
**Number** & **Manual Feature** \\ \hline
1 & The number of cells \\
2 & The number of incoming cells (+1) \\
3 & The number of outcoming cells (\(-1\)) \\
4 & The number of bursts \\
5 & The number of forward bursts \\
6 & The number of backward bursts \\
7 & Total transmission time \\
8 & Average time to send each burst \\ \hline \end{tabular}
\end{table} 
Table 1: Eight Manual Features. For a Boltzmann machine, the overall energy of the network can be expressed as  
\[E(v,h)=-(v^{T}.W\cdot h+\frac{1}{2}v^{T}.L\cdot v+\frac{1}{2}h^{T}.J\cdot h \tag{4}\]  
The joint density probability function of \(v\) and \(h\)[21]:  
\[P(v,h)=\frac{e^{-E(v,h)}}{Z} \tag{5}\]  
where \(Z=\sum_{v}\sum_{h}e^{-E(v,h)}\), the explicit layer neuron's bias coefficient matrix \(L=\left[L_{ij}\right]_{N_{v}\times N_{h}}\), the bias coefficient matrix of the hidden layer neuron itself \(J=\left[J_{ij}\right]_{N_{h}\times N_{h}}\), the weight matrix of the neuron connections between the explicit and implicit layers \(W=\left[W_{ij}\right]_{N_{v}\times N_{h}}\) and \(N_{h},N_{v}\) represents the number of neurons in the hidden layer and the number of neurons in the dominant layer, respectively. In a constrained Boltzmann machine, the hidden layer neuron \(h_{j}\) is activated by a neuron in the dominant layer \(v\). The probability of activation:  
\[P\big{(}h_{j}|v\big{)}=\sigma\bigg{(}b_{j}+\sum\
olimits_{i}W_{ij}v_{i}\bigg{)} \tag{6}\]  
where \(b_{j}\) is the bias coefficient of the dominant layer neuron. Since the restricted Boltzmann machine is bi-directionally connected, the explicit layer neuron \(v_{i}\) can equally be activated by the hidden layer neurons activated with a probability of  
\[P(v_{i}|h)=\sigma(c_{i}+\sum\
olimits_{j}W_{ij}h_{j},) \tag{7}\]  
where: \(c_{i}\) is the bias coefficient of the hidden layer neuron and \(\sigma\) is the Sigmoid function, i.e., \(\text{Sigmoid}(x)=\frac{1}{1+e^{-x}}\). In the RBM, neurons are independent in the same layer, so the probability density also satisfies independence, the following two equations are obtained:  
\[P(h|v)=\prod\
olimits_{j=1}^{N_{h}}P\big{(}h_{j}|v\big{)} \tag{8}\]  
\[P(v|h)=\prod\
olimits_{i=1}^{N_{v}}P(v_{i}|h) \tag{9}\]  
When the data are fed into the explicit layer, the RBM calculates the probability of each hidden layer neuron being switched on \(P(h_{j}|v)\), taking a random number \(\mu\) of 0-1 as the threshold, where neurons greater than this threshold are activated, otherwise they are not. The same is carried out for the explicit layer calculated from the hidden layer. In the learning process of RBM, the contrast scatters algorithm is used to train each piece of traffic data [22].