## 3 Results and Discussion
### Observation of Bubbles Detection and \(H_{2}\) Evolution  
Throughout the duration of the PP test, there was an evolution in the characteristics of the H\({}_{2}\) bubbles, based on the images taken at 6 and 10 min (Figure 8). In the blank solution, larger bubbles were observed, initially adhering to the surface before eventually bursting  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Inhibitor** & \(\mathbf{\beta_{a}}\) & \(-\mathbf{\beta_{c}}\) & \(\mathbf{\mathrm{E_{corr}}}\) & \(\mathbf{\mathrm{i_{corr}}}\) & **Corrosion Rate** & **IE** \\
**Concentration (g/L)** & **(V/dec)** & **(V/dec)** & **(V)** & **(\(\times 10^{-4}\) A/cm\({}^{2}\))** & **(mm/Year)** & **(\%)** \\ \hline \hline \multicolumn{7}{c}{WM} \\ \hline
0 & 0.122 \(\pm\) 0.02 & 0.145 \(\pm\) 0.03 & \(-\)0.495 \(\pm\) 0.01 & 4.28 \(\pm\) 0.92 & 17.78 \(\pm\) 0.89 & 0 \\
0.1 & 0.130 \(\pm\)  
out. Bubbles continued to form intermittently on the specimen's surface, indicating a partial cathodic reaction taking place to reduce the H+ from the H+-rich solution (1 M HCI) [38; 58]. Conversely, the specimens placed in the inhibitor solution displayed smaller bubbles that diffused across the surface. The training process of YOLOv4 in this study consists of several steps as below:  
1. Dataset Preparation: Gather 3755 images of the bubble dataset with annotated images and the corresponding bounding boxes around the objects of interest, along with the class labels. 2. Configuration: Adjust the hyperparameters in the configuration files. Modify the settings, such as the batch size, learning rate, and input image size (Table 2). 3. Training Execution: Execute the training process using the prepared dataset. The model learns to detect objects by minimizing detection errors through optimization. 4. Loss Calculation: Compute the loss functions (localization, confidence, and classification) based on the differences between the predicted and true bounding boxes, objectness scores, and class predictions. Figure 8: Images captured during PP test, at 6 th minute (**left**) and 10 th minute (**right**): (**a**) 0 g/L, (**b**) 0.1 g/L, (**c**) 0.2 g/L, (**d**) 0.3 g/L, and (**e**) 0.4 g/L. Background and Optimization: Backpropagate the calculated loss to optimize the model's parameters using optimization techniques, like stochastic gradient descent (SGD) or its variants (Figure 9a). 6. Model Evaluation: Periodically assess the model's performance on a validation dataset using metrics, such as precision, recall, and mAP (mean average precision) (Figure 9b). 7. Fine-tuning and Iteration: Fine-tune the model by adjusting the hyperparameters or training it on additional data if needed and iterating until the desired accuracy is achieved. 8. Model Deployment: Deploy the trained model for inference on new data or integrate it into applications for real-time object detection tasks (Figure 10). Figure 9: (**a**) Illustration of the loss progression, and (**b**) curves of the mAP (mean average precision) during the training of YOLOv4 with the dataset. In order to gain deeper insights from the outcomes, we analyze several calculation results of the detection models trained with the dataset. These results include the mAP50, mAP75, FPS, average IoU, precision, recall, and F1-Score. Precision serves as a metric to assess the accuracy of the model's predictions by determining the proportion of actual truths correctly identified by the model. Recall measures the ratio of actual truths correctly identified by the model out of the total number of actual truths. The F1-Score is a com  
Figure 10: Bubbles detection in different inhibitory conditions: (**a**) 0 g/L, (**b**) 0.1 g/L, (**c**) 0.2 g/L, (**d**) 0.3 g/L, and (**e**) 0.4 g/L. prehensive metric that evaluates the balance of the model's data. It combines precision and recall by calculating their product and dividing it by their sum, multiplied by 2.