## 5 Results and Discussion
Dropout works by randomly setting a fraction of the input units to zero during training, forcing the model to rely on different features and reducing the risk of memorizing the training data. Finally, the output of the model is passed through a dense layer with a sigmoid activation function. This layer converts the model output into probabilities for each class, which are suitable for binary classification tasks. For testing, the raw signal data collected by the sensors were divided into a training dataset and a testing dataset. The proposed and comparison models were trained and tested for all four datasets. Here, 75% of the data were used for training; the remaining data were used for testing all the models. In total, 75% of the training data were further divided into two parts, where 80% of the data were used for training and the remaining 20% were used for validation. The training dataset was used to determine the inner parameters of the models. Next, the testing dataset was fed into the trained models to verify their effectiveness. To more explicitly illustrate the performance of the proposed and comparison models, Figure 10 depicts the validation loss versus epochs for the respective models for all the datasets. The proposed model validation loss approaches zero in a smaller number of epochs compared to the other models. Figure 9: Training and validation accuracy versus epochs of the proposed method: (**a**) Gas-13 bar, (**b**) Gas-18 bar, (**c**) Water-13 bar, and (**d**) Water-18 bar. The validation accuracy versus epochs for all the models and datasets is depicted in Figure 11.  
Figure 11: Comparison of validation accuracy of all the models for (**a**) Gas-13 bar, (**b**) Gas-18 bar, (**c**) Water-13 bar, and (**d**) Water-18 bar. Figure 10: Comparison of validation loss of all the models for (**a**) Gas-13 bar, (**b**) Gas-18 bar, (**c**) Water-13 bar, and (**d**) Water-18 bar. A confusion matrix was used to evaluate the performance of the classification model by comparing the predicted classifications to the actual outcomes. With regard to the importance of the confusion matrix in analyzing the performance of the model, Figure 12 presents the confusion matrix of the proposed and comparison models. T-SNE plots can be highly useful in analyzing models by offering insights into how well the model is learning and representing the data. T-SNE can reveal how well a model groups similar data points. If the plot shows clear, distinct clusters, this suggests that the model has learned to differentiate between classes or categories. By visualizing the data in lower dimensions, t-SNE plots can help identify if certain data points are misclassified or if there are overlaps between classes. This can highlight the performance of the model. With respect to the role of the t-SNE plots in analyzing the model performance, Figure 13 represents the t-SNE plots for all the models. The proposed model has clearly separated the leak and non-leak samples, whereas the comparison methods show some misclassification. _Accuracy_, _precision_, _recall_, and _F1 score_ were calculated for all the models and datasets using Equations (4)-(7), respectively. \[Accuracy=\frac{TN+TP}{TN+FP+TP+FN} \tag{4}\]  
\[Precision=\frac{TP}{TP+FP} \tag{5}\]  
Figure 12: Confusion matrices for leak detection: (**a**) proposed, (**b**) TD-LSTM, and (**c**) Bi GRU. Figure 13: TSNE plots for leak detection: (**a**) proposed, (**b**) TD-LSTM, and (**c**) Bi GRU. Figure 8:0  
Figure 8:1  
Accuracy measured the overall correctness of the model by calculating the proportion of true predictions of all predictions. The accuracy was calculated for all the models and datasets, as shown in Figure 8:2 The proposed model's accuracy is superior, with an average accuracy of 99.86% compared to 92.37% and 98.75% for TD-LSTM and BiGRU, respectively. Precision evaluated the accuracy of the positive predictions by measuring the proportion of true positive predictions of all positive predictions by the model. Precision was calculated for all the models.