## 5 Experimental Results and Discussions
As shown in the right column, by comprehensively judging the presence of foreign particles based on the proportion of inference results from various images of moving objects observed during the tracking of each fluid bag, we can achieve a more stable and superior performance in determining the presence of foreign particles. In other words, even if the moving object is out of focus or there are observational images that are difficult to judge due to lens distortion from the crumpling of the fluid bag, we can make better decisions by combining all the judgment results throughout the tracking process based on multiple inference results. Figure 13: Examples of the constructed OPAIs and the inference results of each OPAI. Additionally, the input frame sequence used in this experiment was a high-resolution video input at 10 fps for 2 s, which was compiled into 600 \(\times\) 800 OPAIs through object tracking. Therefore, the data reduction rate for deep learning inference is calculated as (600 \(\times\) 800)/(3627 \(\times\) 5488 \(\times\) 20) = 0.12%, resulting in a data compression effect of 829.374 times. By performing deep learning model inference on the accumulated and reduced data throughout the tracking period in a very short time, real-time processing of the identification of moving objects within the fluid bag becomes possible. The proposed system operated in a multi-threaded environment, allowing it to simultaneously perform video acquisition from two cameras, moving object detection, tracking, OPAI generation, and deep learning inference on a single computer. In this multi-threaded environment, within a two-second timeframe, high-resolution videos from each camera were processed to extract and track moving objects, resulting in the generation of 600 \(\times\) 800 OPAIs. For each generated OPAI, Faster RCNN took 250 to 300 ms to perform inference in the multi-threaded environment, and processing OPAIs from both cameras one by one took 500 to 600 ms. When two OPAIs were generated from each camera, the inference process took 1 to 1.2 s. As a result, it was confirmed that a total of 3 to 3.4 s was required to determine the presence of foreign particles inside a fluid bag. This enabled the proposed system, which was configured to inspect five bags simultaneously in parallel, to output inspection results within 5 s, allowing for the inspection of each bag to be completed in less than 1 s. Consequently, it was possible to perform real-time inspections of fluid bags moving on a conveyor belt at a rate of one bag per second. For the evaluation of the performance of the proposed algorithm, we tested it on 35 fluid bags (500 mL each) containing easily floating foreign particles sized 150-200 \(\upmu\)m and 100 normal fluid bags without any foreign particles. For quantitative performance comparison, we examined the test results using metrics such as Recall, Precision, and Accuracy, as shown below:  
\[Recall=\frac{TP}{TP+FN} \tag{16}\]  
\[Precision=\frac{TP}{TP+FP} \tag{17}\]  
\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{18}\]  
where \(TP\) is the number of true positives, \(TN\) is the number of true negatives, \(FP\) is the number of false positives, and \(FN\) is the number of false negatives. The results of the foreign particle detection for test samples are summarized in a confusion matrix, as shown in Figure 14. Based on the results, with \(TP\) = 34, \(FP\) = 1, \(TN\) = 98, and \(FN\) = 2, the algorithm achieved a Recall of 97.1%, a Precision of 94.4%, and an Accuracy of 97.8%. The proposed system tracked moving objects across multiple frames, allowing it to repeatedly perform deep learning inference on the observed objects in each frame to determine whether they were air bubbles.