## 3 Object Detection in High-Resolution Images Using OPAIs  
When the rotating flexible fluid bag is stopped, the objects moving inside it must be identified as either air bubbles or foreign particles using a deep learning object detection model. However, several issues arise during this process. Firstly, when the rapidly rotating fluid bag stops, the bag itself halts, but the internal fluid continues to rotate. This causes the flexible fluid bag, although held tightly, to wobble non-uniformly due to the fluid's  
Figure 4: The proposed configuration of the illumination and image acquisition system. Figure 5: Comparison of the refractive and blocking effects based on the substance: (**a**) bubble showing refraction of light; (**b**) particle blocking light. movement. Many visual inspection methods reduce computational load by removing the background and identifying candidate objects using difference images between previous and current frames or motion-compensated difference images. However, the non-uniform wobbling of the fluid bag makes it difficult to detect these target substances or candidates through simple difference or motion-compensated difference images. The entire fluid bag wobbles non-uniformly, causing even particles on the bag's surface to be extracted as candidate objects, similar to particles moving inside the bag. In this study, to remove the background of such a non-uniformly wobbling flexible fluid bag and accurately identify only the actual moving target or candidate regions, the algorithm first obtains candidate regions based on difference images. The algorithm uses the similarity to adjacent objects within the vibration distance range in the previous frame to determine if the object is attached to the bag's outer surface, such as surface reflections, dust, or printed patterns on the surface. Particles or air bubbles moving significantly will show low similarity to objects within the vibration distance range in previous frames. Therefore, we apply a method to filter out non-moving objects based on this similarity, extracting only the few actual moving air bubbles or foreign particles inside the fluid bag. The similarity measure used here is the normalized correlation coefficient. Secondly, when attempting to detect objects in high-resolution images using a deep learning model, the following issues arise:  
1. Increased memory consumption  
Convolutional Neural Network (CNN) models, which are commonly used for object detection, generate multiple feature maps due to the convolution operations, significantly increasing memory usage. Thus, many object detection models are designed to handle smaller input image sizes, such as 224 \(\times\) 224, 256 \(\times\) 256, 512 \(\times\) 512, and 600 \(\times\) 800 pixels. Handling larger resolution images directly would require substantial memory, leading to exponentially higher costs. Additionally, as memory usage increases, so does the computational complexity, resulting in longer execution times. 2. Complicated maneuvering of input image  
To process larger images, deep learning models may need to become deeper and more complex, which complicates training and tuning. Training and optimizing deeper models with larger input data can take significantly more time, making practical application challenging. Due to these challenges, directly applying deep learning models to high-resolution images is difficult. Various methods are employed to adjust the input image size to fit the model's capacity, such as the following:  
* Image resizing: Reducing the size of the high-resolution image to match the input size for the deep learning model. * Image dividing: Dividing the high-resolution image into smaller patches and feeding separately into the model. * Sliding Window: A sliding window moves across the high-resolution image, processing each section independently. However, these methods still require the entire image data to be processed by the deep learning network, leading to slow processing speeds for high-resolution images.