## 3 Proposed Lightweight Deep Learning Approach
### Temporal Efficient Residual Network
#### 3.2.2 Temporal Convolution  
Figure 11 illustrates the difference between conventional 2D convolution and temporal convolution when dealing with STFT features as inputs. Assuming a stride of 1 and that zero padding is applied to give the input and output the same resolution, given the input \(X\in\mathbb{R}^{w\times h\times c}\) and weights \(W\in\mathbb{R}^{k_{w}\times k_{h}\times c\times c^{\prime}}\), the output of the 2D convolution is \(Y\in\mathbb{R}^{w\times h\times c^{\prime}}\). STFT is widely used to convert raw audio into a time-frequency representation \(I\in\mathbb{R}^{t\times f}\), where \(t\) denotes the time axis and \(f\) denotes the feature axis extracted from the frequency domain, as shown in Figure 11a. Most previous studies have defined the input tensor as \(X\in\mathbb{R}^{w\times h\times c}\), where \(w=t\), \(h=f\), and \(c=1\).  
Conventional CNNs often use smaller convolutional kernels to convert low-level features into higher-level features, as shown in Figure 11b. As a result, deeper convolutional layers need to be stacked to capture rich information from both high and low frequencies. Let us assume that by simply stacking n 3 \(\times\) 3 convolutional layers with a stride of 1, the receptive field of the network grows only to 2n + 1. Researchers have suggested the application of attentional mechanisms, recurrent units, or pooling to alleviate this problem, but these usually introduce a large number of parameters that increase the computational burden.  
Temporal convolution provides a new perspective on the analysis of fiber optic sensing signals, redefining the time-frequency diagram as a frame-by-frame time series, rather than a traditional visualized image. This treatment is more attuned to the natural properties of audio and similar time series data, highlighting the dominance of the temporal dimension of the signal, while making full use of the important information of the frequency features.  
Figure 10: The structure of the proposed TEResNet, where the first convolutional layer has a \(3\times 1\) convolutional kernel and the others are \(9\times 1\).  
Based on this, the convolution shown in Figure 11c is performed, which reshapes the input from \(X_{2d}\) to \(X_{1d}\). We consider \(I\) as one-dimensional sequence data, where the features of each time frame are denoted by \(f\), resulting in \(X_{1d}\in\mathbb{R}^{t\times 1\times f}\). The convolution kernel covers the entire frequency range, which makes full use of the information in the lower layers without the need to stack multiple layers to form high-level features. By applying temporal convolution, the size of the 2D feature map is reduced, while keeping the same number of parameters. Assuming that the weight of the conventional 2D convolution is \(W_{2d}\in\mathbb{R}^{3\times 3\times 1\times c}\), the weight of the temporal convolution is \(W_{1d}\in\mathbb{R}^{3\times 1\times f\times c^{\prime}}\) and the number of parameters is equal, i.e., \(c^{\prime}=3\times c/f\). Assuming that \(t=100\), \(f=40\), \(c=120\), and \(c^{\prime}=9\), temporal convolution requires fewer computations \(MAC\)s \(=3\times 3\times 1\times f\times t\times c\) = 4,320,000 than 2D convolution \(MAC\)s \(=3\times 1\times f\times t1\times c^{\prime}\) = 108,000. In addition, the output feature maps of temporal convolution \(Y_{1d}\in\mathbb{R}^{t\times 1\times c^{\prime}}\) are smaller than the output feature maps of conventional 2D convolution \(Y_{2d}\in\mathbb{R}^{t\times f\times c}\). The reduction in feature map size greatly decreases the computational burden and memory requirements of subsequent slices, which is critical for fast external intrusion identification.