## 3 Proposed Leak Detection Model
In Stage 2, the pre-trained \"1D CNN Module\" for each domain, independently learned and stored in Stage 1, is loaded, as shown in Figure 4. Feature fusion is performed by removing the classifiers from each model and combining the output feature maps \(x_{T}\) and \(x_{F}\), representing the time and frequency domains, respectively, into a single higher-dimensional layer \(Z\). This fusion process is mathematically defined in Equation (7) as follows:  
\[Z=f^{concat}([x_{T};x_{F}]), \tag{7}\]  
where \(f^{concat}\) denotes the concatenation function, which merges the two feature maps. Through this feature fusion process, temporal- and frequency-domain information are integrated, resulting in richer features that capture more comprehensive insights. A bidirectional LSTM network is then applied to the fused feature data. This network consists of a forward output \(h_{t}^{f}\) with 128 units and a backward output \(h_{t}^{p}\) with 128 units, which collectively consider sequence information in both forward and backward directions. BN is applied to the bidirectional LSTM outputs to stabilize the learning process. By leveraging the bidirectional LSTM, the model processes sequence data more effectively, utilizing context from both input directions. To emphasize important information at each time step, a dot-product-based attention mechanism is applied to the outputs of each LSTM layer. The attention score is calculated using Equation (8) as follows:  
\[Score\left(h_{t}^{i},h_{s}^{i}\right)=\left(h_{t}^{i}\right)^{T}h_{s}^{i},\;i \in\{f,b\}, \tag{8}\]  
where \(i\) indicates the LSTM direction \(f\) for forward and \(b\) for backward, \(h_{t}^{i}\) denotes the hidden state at time step \(t\), \(h_{s}^{i}\) denotes the hidden state at all time steps \(s\), and \(\left(h_{t}^{i}\right)^{T}\) represents the transpose of \(h_{t}^{i}\). A softmax operation is applied to the attention scores to normalize them into probabilities, which are then used to compute the attention weights. This process is defined in Equation (9) as follows:  
\[\alpha_{t,s}^{i}=\frac{exp\big{(}Score\big{(}h_{t}^{i},h_{s}^{i}\big{)}\big{)} }{\sum_{s^{\prime}}exp\big{(}Score\big{(}h_{t}^{i},\;h_{s^{\prime}}^{i}\big{)} \big{)}},\;i\in\{f,b\}, \tag{9}\]  
where \(\alpha_{t,s}^{i}\) represents the attention weight between the hidden state \(h_{t}\) at the current time step and the hidden state \(h_{s}\  
Finally, the attention vector \(\alpha_{t}^{i}\) for each direction is calculated in Equation (11) by combining the context vector \(c_{t}^{i}\) with the current hidden state \(h_{t}^{i}\), providing domain-specific trainable attention weights. \[\alpha_{t}^{i}=\tanh\Bigl{(}W_{a}^{i}\Bigl{[}c_{t}^{i};h_{t}^{i}\Bigr{]}\Bigr{)},\,i\in\{f,b\}, \tag{11}\]  
where \(W_{a}^{i}\) denotes the learnable weight matrix for direction \(i\) and \(\bigl{[}c_{t}^{i};h_{t}^{i}\bigr{]}\) denotes the concatenation of \(c_{t}^{i}\) and \(h_{t}^{i}\). The hyperbolic tangent function (tanh) introduces non-linear transformation, generating the final attention vector and refining the focus of the model on domain-specific features. Attention vectors \(\alpha_{t}^{f}\) and \(\alpha_{t}^{b}\), obtained from the forward and backward directions of the bidirectional LSTM, are concatenated to form a single vector \(y_{\alpha}\). This process is mathematically defined in Equation (12) as follows:  
\[y_{\alpha}=f^{concat}\Bigl{(}\Bigl{[}\alpha_{t}^{f};\alpha_{t}^{b}\Bigr{]} \Bigr{)}. \tag{12}\]  
Subsequently, a fully connected (FC) layer comprising 64 units is added, with \(y_{\alpha}\) serving as the input. This layer employs a ReLU activation function to introduce non-linearity, enhancing the ability of the model to capture complex patterns in the fused features. The final output layer consists of a single neuron with a sigmoid activation function, designed to perform binary classification, distinguishing between leak and noise signals.