## 5 Experimental Results and Discussions
Figure 10: The proposed configuration of cameras and lights for visual inspection of flexible fluid bags. methods often identify more regions than the actual moving objects due to their non-uniform movements. This results in decreased processing speed and particle detection performance. Figure 12 shows the results of applying these methods to consecutive frames of a flexible fluid bag. The candidate regions identified as moving objects are labeled on the actual input image for comparison. The comparison includes simple differencing, global motion-compensated differencing, and the proposed near-similarity-based object-level background removal for candidate moving objects. The number of candidate regions extracted from simple differencing is 1249, while global motion-compensated differencing reduces this number to 763, primarily in the central part of the image. However, many candidate regions still appear in the peripheral areas. The proposed method, which applies near-similarity-based object-level background removal, dramatically reduces the number of candidate moving objects to five. By performing visual inspections only on these filtered candidate regions, the processing time is significantly reduced, enhancing the feasibility of real-time processing. If we construct OPAIs by collecting images of moving objects observed during the tracking process of the internal movement of the fluid bag, we can effectively convert the  
Figure 12: Comparison of the background rejection using different differential methods. (**a**) Consecutive input frames of a flexible fluid bag. (**b**) Comparison of binarization results from frame differencing: from the top, without compensation, with global motion compensation, and with the proposed near-similarity-based background removal. (**c**) Comparison of the number of objects labeled: based on the results shown on the left, there are 1249 objects, 763 objects, and 5 objects for each method from the top. vast amount of data from high-resolution input frame sequences into smaller OPAIs that consist only of the data necessary for actual inspection. To effectively enhance the detection performance for OPAIs, data for training were collected using the VISFFB system by capturing inspection images of fluid bags (both those without internal foreign particles and those containing various types of internal foreign particles). Under the same conditions as the actual inspection, with back and bottom lighting setup, videos of the fluid bags were recorded while rotating the bags to introduce the movement of the internal fluid. These recordings were then processed to detect and track the moving objects, resulting in the creation of an OPAI dataset. Out of the 941 OPAIs thus generated, 851 were designated as training data, while the remaining 90 were set aside for validation. The images were used to train the system to distinguish between bubbles and foreign particles. In the training dataset, 11,541 bubbles and 8208 foreign particles were labeled, while, in the validation set, 1077 bubbles and 814 foreign particles were labeled. Figure 13 shows the results of creating OPAIs for fluid bags containing foreign particles and another fluid bag without foreign particles, showing air bubbles. In the left column, the results of the constructed OPAIs from each fluid bag are displayed, and above each object patch image, the tracking ID for the registered object during the tracking process is indicated. The deep learning inference results for the object images are shown as circles proportional to the size of the object. A blue circle indicates that the object is inferred to be a foreign particle, while a white circle indicates an air bubble. If there is no circle, it indicates that the object was not inferred to be either a foreign particle or an air bubble.