## 2 CBN-VAE Model Architecture
### Model Structure and Training  
The CBN-VAE model is a hybrid model which the calculation unit is D-CRBM and the model framework is VAE. Specifically, the CBN-VAE model consists of two parts: an encoder and a decoder. The encoder learns the hidden mathematical features of the original sensing data and compresses the sensing data, and the decoder reconstructs the sensing data based on the hidden mathematical features. The structure of the CBN-VAE model is shown in Figure 4, and the details of layers and parameters used for the CBN-VAE model is shown in Table 1. For a time sequence input of sensing data with size of \(120\times 1\), after encoding by the encoder, the data is compressed to a size of \(5\times 1\). The decoder reconstructs the compressed data back to the size of \(120\times 1\). The activation functions used by all layers are Rectified Linear Unit (ReLU) nonlinearity. In the encoder, the model first extracts the hidden mathematical features of the input data through a combination of multiple layers of D-CRBM and max-pooling and encodes the input data by this way. We designed a fully connected layer for the output of the feature after the features were extracted. Then,  
Figure 4: CBN-VAE model. The contents in the parentheses of the network layer (D-CRBM and Fully Connected) are the size of the layer kernel, and the contents in the parentheses of the vector (input and output, etc.) are the size of the vector. For Max-pooling and Up-pooling layers, the contents in the parentheses are the size of the sampling. Figure 3: Max-pooling and Reconstruction. we used the variational sampling method of VAE to design two fully connected layers to calculate the mean vector and the standard deviation vector of the output of the last fully connected layer. We sampled from the standard deviation vector and then added it to the mean vector to get the final output of the encoder. For a time sequence input of sensing data with size of \(120\times 1\), after extracting features by the D-CRBM and max-pooling, the features were represented as a vector of size of \(54\times 1\times 1\). Then we used the fully connected layer to convert this vector into a 2-dimensional output of size \(27\times 1\) and use the 2-dimensional output to calculate the mean vector and standard deviation vector of the variational sampling method. The mean vector and the standard deviation vector were added to get our final compressed data with size of \(5\times 1\). In the decoder, by using the undirected graph characteristics of the D-CRBM, we built the decoding network using the parameters of the corresponding network in the encoder. Unlike the encoder network, we built a new fully connected layer in the decoder to recover the data after the variational sampling. The parameters of the other layers in the decoder network were the same as the corresponding layers in the encoder network. Combining the encoder and the decoder, we can get the model output of the same dimension for each model input. Our goal is to make the model output as close as possible to the model input itself. That is, after the model input is encoded, it is possible to recover as much of the original information as possible by decoding. The methods we used to reduce parameters and computation consumption of CBN-VAE model are summarized as follow:  
* Change the convolution output feature map dimension. This method can significantly reduce the number of convolution kernel parameters for the next convolutional layer. For a convolutional layer with output size of \(\mathbf{O}_{w}\times\mathbf{O}_{h}\times\mathbf{C}_{o}\), the parameters of next convolutional layer convolution kernel should be \(\mathbf{K}_{s}\times\mathbf{C}_{o}\times\mathbf{K}_{u}\) where \(\mathbf{K}_{s}\) is the size of kernel and \(\mathbf{K}_{s}\) is the number of kernel.