# Real-Time Pipeline Leak Detection: A Hybrid Deep Learning Approach Using Acoustic Emission Signals
## 4 Results  
The arrangement of training and validation data plays a crucial role in evaluating the effectiveness of the proposed method. During the training phase, data corresponding to a leak size of 1 mm under fluid pressures of 13 and 18 bars were utilized, while the evaluation phase employed data from varying pressure levels and leak sizes to ensure a comprehensive assessment. The dataset comprised 1080 samples, evenly divided between non-leak samples and leak samples. To construct and validate the model, 80% of the dataset was randomly allocated for training, while the remaining 20% was reserved for validation. Class imbalance was addressed by adjusting the loss function to assign higher importance to the minority class and using stratified k-fold cross-validation to ensure balanced splits during training and testing phases. To maintain consistency and reliability, the experiments were repeated 10 times. The model's convergence was examined by varying the number of training epochs (50, 100, and 150 epochs), and it was observed that optimal accuracy was achieved between 70 and 100 epochs. Early stopping was applied to prevent overfitting by halting training if the validation loss did not improve for 10 consecutive epochs. Additionally, a dropout rate of 0.5 was introduced in the fully connected layers to prevent over-reliance on specific features, and training was stopped once validation loss plateaued. Furthermore, a 5-fold cross-validation strategy was implemented to validate the model's robustness across different data subsets. These combined strategies ensured a balanced, efficient, and reliable training process, resulting in a robust and generalizable fault diagnosis model suitable for real-world applications. Metrics like precision, accuracy, recall, and F1 score were employed to evaluate the efficacy of the suggested method. These metrics give an accurate measure of the classifi  
Figure 8: Non-leak AE signal (**a**) 13 bar (**b**) 18 bar. Figure 9: Leak AE signal (**a**) 13 bar (**b**) 18 bar. cation algorithm's efficiency and data classification accuracy. Equations (13)-(16) are the specific formulas that were used to calculate these measurements. \[Precision=\frac{(\sum_{\alpha}^{A}n_{\alpha})*\left(\frac{T.P_{\alpha}}{T.P_{ \alpha}+F.P_{\alpha}}\right)}{N} \tag{13}\]  
\[Recall=\frac{(\sum_{\alpha}^{A}n_{\alpha})*\left(\frac{T.P_{\alpha}}{T.P_{ \alpha}+F.N_{\alpha}}\right)}{N} \tag{14}\]  
\[F1=\frac{1}{N}\sum_{\alpha}^{A}n_{\alpha}*2*\sum_{\alpha}^{A}\left(\frac{Recall _{\alpha}*Precision_{\alpha}}{Recall_{\alpha}+Precision_{\alpha}}\right) \tag{15}\]  
\[Accuracy=\frac{(\sum_{\alpha}^{A}T.P_{\alpha})}{N} \tag{16}\]  
where \({}^{\prime}\)_FP\({}_{\alpha}\)'_, \({}^{\prime}\)_FN\({}_{\alpha}\)'_, and \({}^{\prime}\)_TP\({}_{\alpha}\)'_ represent false positive, false negative, and true positive outcomes for class A, respectively. A false positive (_FP\({}_{\alpha}\)_) occurs when a sample is incorrectly classified as belonging to class A when it does not. A true positive (_TP\({}_{\alpha}\)_) indicates the correct identification of samples that genuinely belong to class A. On the other hand, a false negative (_FN\({}_{\alpha}\)_) happens when samples that actually belong to class A are misclassified as belonging to another class. The total number of samples in class A is represented by the sum of _TP\({}_{\alpha}\)_ and _FN\({}_{\alpha}\)_ denoted as \({\mathbf{n}}_{\alpha}\). The total number of samples misclassified as belonging to class A is the sum of _FP\({}_{\alpha}\)_ and the difference between the total number of data samples (N) and \({\mathbf{n}}_{\alpha}\). Here, N signifies the total number of data samples in the testing dataset. To evaluate the effectiveness of the proposed approach, a comparison was conducted with three other models designed for similar tasks. The first model (CWT-CNN), developed by [PERSON] et al. [39], employs a CNN trained on CWT images extracted from AE signals under a similar experimental setup. The second model (FFT-CNN), proposed by [PERSON] et al.