## 2 System Architecture, Theoretical Methods, and Experiments
### Autoencoding with CNN  
Convolutional autoencoders are based on CNNs, including convolutional layers, pooling layers, and upsampling layers. Since CNNs have achieved excellent image recognition results, the image itself is a two-dimensional matrix of pixels. Therefore, the two-dimensional matrix in the monitoring window can also be directly input to CNNs. The operations performed by the convolutional, pooling, and upsampling layers are explained below.  
The convolutional layer performs convolution on the input image and the kernel. The kernel is usually a square 3 \(\times\) 3 matrix, denoted by \(\otimes\). Taking Figure 4 as an example, the  
Figure 3: Time-spectrum data graphs obtained by MFCC speech recognition: (**a**) ambient sound and (**b**) PVC pipe leakage.  
kernel will first operate on the orange area in the upper left corner of the original image (the orange area is also a \(3\times 3\) square matrix, the same as the kernel) to calculate the Hadamard product of these two matrices.  
\[0\times 0+0\times 0+0\times 1+0\times 1+1\times 0+0\times 0+0\times 0+0\times 1+0 \times 1=0.\]  
This product can be used as the first value of the feature map on the right in Figure 4. Next, the kernel will continue to calculate the Hadamard products on the original image from left to right, from top to bottom, until the entire image is scanned by the kernel, producing a complete feature map. To further output the feature map with the same size as the original image, padding should be added on the periphery of the original image so that the output feature map and the original image before padding is added share the same size.  
The purpose of the pooling layer [15] is to further reduce the feature map output using the convolutional layer while retaining the obvious features in the feature map. There are two common pooling operations: max pooling and mean pooling. In this study, max pooling is used to reduce feature maps. Take Figure 5 as an example of pooling. First, the input image is divided into several rectangular regions, and the maximum value is output for each subregion. Usually, the size of the subregion is \(2\times 2\). This mechanism works because the precise location of a feature is far less important than its rough location relative to other features.  
The pooling layer will continuously reduce the spatial size of the data, decreasing the number of parameters and the amount of computation, which also prevents overfitting to a certain extent. The operations performed by the upsampling layer are quite simple; it directly resamples each area of the feature map. The detailed method can be directly  
Figure 4: Diagram of operations performed by the convolutional layer.  
Figure 5: Diagram of operations performed by the pooling layer.  
seen in Figure 6. Finally, the architecture of the autoencoder is shown in Figure 7. The original image is a 13 \(\times\) 16 matrix compressed by the encoder to obtain a 13 \(\times\) 4 encoding matrix. It is worth noting that, by design, the pooling layer in the encoder sets the size of the sub-regions to be 1 \(\times\) 2. This helps preserve the correlation between the timing information on the compression matrix and the sensor. The upsampling layer [16] in the decoder is also aimed at timing amplification.  
Figure 6: Diagram of operations performed by the upsampling layer.  
Figure 7: An autoencoder based on a CNN.