# Multizone Leak Detection Method for Metal Hose Based on YOLOv5 and OMD-ViBe Algorithm
## 3 Experiment and Results
### Experimental Results
#### 3.2.2 Bubble Recognition Based on OMD-ViBe
In Figure 9, the frames 186, 365, 570, 837 and 911 are shown to compare each algorithm. In the figure, white indicates that the target has been correctly detected, green indicates that the target has been misjudged as a nontarget, and red indicates that the actual nontarget has been underestimated as a target. In frame 186, it can be observed that the traditional ViBe algorithm is susceptible to ghosting due to the slow movement of bubbles. This results in inconsistent detection outcomes with the target, leading to false detections. However, in frame 365, it is shown that PBAS and the adaptive background learning algorithms can detect many disturbing factors during bubble movement, which could be attributed to water lighting effects or image noise in the actual scenario. It can be concluded that the algorithm is highly resistant to interference and can further improve detection accuracy by eliminating the ghosting caused by slow bubbles. This paper presents constructed videos depicting normal leakage and minor leakage, consisting of a total of 1000 frames per video. We propose the OMD-ViBe algorithm and conducted comparison experiments between the original ViBe algorithm and the improved version. The effectiveness of these algorithms was analyzed in each detection scenario based on two working conditions. The following section provides a detailed analysis of the impact of both algorithms in each scenario. Figure 10 displays the results of normal leak detection, showcasing three frames of bubble movement at frames 185, 188 and 205 for comparison. Figure 10a presents the original video image, while Figure 10b,c show the detection outcomes of the OMD-ViBe algorithm, with the bubbles marked in red boxes for easier analysis. The figures reveal that the bubble profile obtained by the OMD-ViBe algorithm is more comprehensive than that of the original figure. This improvement is attributed to the dynamic threshold calculation method used by the OMD-ViBe algorithm, which has higher sensitivity to bubble appearance in the frame image, resulting in better detection outcomes. Figure 11 presents the results of tiny-leak detection, with frames 174, 184 and 198 selected for comparison. Figure 11a displays the original video image, while Figure 11b,c present the detection outcomes of the OMD-ViBe algorithm. Both algorithms could detect the bubble to some extent, but it can be observed that in frame 198, Figure 11c has a false detection. This false detection is due to the ghosting phenomenon caused by the traditional ViBe algorithm when the bubble moves slowly, and the detected bubble foreground target is not updated in time, leading to false detection. However, the algorithm proposed in this paper effectively avoids this situation and accurately identifies the target. To determine the frequency of each pixel point, the detection results of the OMD-ViBe and ViBe algorithms were overlaid on 1000 frames, and the calculation formulae outlined in Equations (18)-(21) were applied. The statistical outcomes are presented in Figure 12. Through a comparison of the results in Figure 12a,b and Figure 12c,d, it can be observed that the OMD-ViBe algorithm has a slightly higher frequency than does the ViBe for both the normal leakage and microleakage scenarios. This indicates that the OMD-ViBe algorithm detects bubbles corresponding to a higher number of former attractions, as shown in  
Figure 8: Metal hose leakage. Figures 10 and 11. Thus, these findings confirm the superior effectiveness of the OMD-ViBe algorithm in extracting bubble information. Figure 9: Background algorithm segmentation results. Figure 11: Tiny-leakage bubble recognition effect: (**a**) original image, (**b**) OMD-ViBe, and (**c**) ViBe. Figure 10: Normal leakage bubble recognition effect: (**a**) original image, (**b**) OMD-ViBe, and (**c**) ViBe. Figure 12(a) displays the original map without any leakage, while Figure 12(b) shows the map with leakage points.