# Depth-Oriented Gray Image for Unseen Pig Detection in Real Time
## 5 Discussion  
The results of this study demonstrated that the proposed method, which utilized foundation models during the initialization phase with top-view images as input, was capable of operating in real time on a CPU through simple image processing. The DOG images generated by the proposed method showed superior object detection performance compared to that of grayscale images in various pigpen environments, indicating their effectiveness in distinguishing between the foreground and background even in complex settings. However, in tilted-view environments, the performance of DOG images varied depending on the camera angle and perspective transformation method. In certain cases, distinguishing between the foreground and background became challenging, potentially reducing detection accuracy. These limitations highlighted the need for the further development of robust methodologies that could reliably operate in tilted-view scenarios. Figure 9 presents the results of applying the proposed method to tilted-view scenarios. It shows the outcomes of applying the proposed method to tilted-view input image after performing perspective transformations, with the green boxes representing the detected objects. In the input image, pigs closer to the camera appeared larger than those farther away. However, in the transformed image, a distortion was observed where pigs farther from the camera appeared larger than those closer to the camera due to the applied perspective transformation. This distortion seemed to have arisen during the perspective transformation process. Additionally, incorrect results from the Otsu thresholding of the depth background image led to the generation of RoI images that obscured parts of the pigs. To address this issue, developing appropriate perspective transformation methods or designing a more robust approach that can reliably work in tilted-view environments could be a topic for future research. Table 3 presents the performance of different YOLO model versions when tested on unseen environment data. The models were trained on augmented training data, where DOG images were added to the training dataset to enhance robustness against complex and previously unseen conditions. The results demonstrated how the inclusion of DOG images improved the models' generalization capability and detection accuracy in challenging environments. Models trained on both Gray and DOG images showed an overall improvement in AP50, ranging from 3.6% to 6.6%, compared to models trained on Gray images. This indicated that incorporating DOG images into the training process contributed to the better handling of challenging scenarios and improved overall detection performance. However, there are two key challenges associated with augmenting the training data. First, while the proposed method performs effectively in top-view scenarios, it fails to achieve consistent results in tilted-view settings. Second, the initialization process must be performed on all training images, which significantly increases the overall training time. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Train** & **Test** & **Detection** & **TP** & **FP** & **FN** & **AP50** & **Inference Time** \\
**Image Type** & **Image Type** & **Model** & & & & **(\%)** & **(ms)** \\ \hline \multirow{4}{*}{Gray} & Gray & YOLOv8n [48] & 3838 & 493 & 760 & 90.4 & 5.8 \\  & Gray & YOLOv9t [49] & 3845 & 657 & 753 & 88.8 & 10.6 \\  & (baseline) & YOLOv10n [50] & 3723 & 555 & 875 & 88.3 & 6.6 \\  & & YOLOv11n [10] & 3972 & 433 & 626 & 93.2 & 5.9 \\ \hline \multirow{4}{*}{Gray} & Gray & YOLOv8n [48] & 4317 & 169 & 281 & 97.0 & 9.4 \\  & DOG & YOLOv9t [49] & 4171 & 384 & 427 & 94.1 & 14.2 \\ \cline{1-1}  & DOG & YOLOv10n [50] & 4228 & 525 & 370 & 93.5 & 10.2 \\ \cline{1-1}  & & YOLOv11n [10] & 4296 & 216 & 302 & 97.0 & 9.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance of different YOLO model versions tested on unseen environment data trained with augmented training data. Figure 9: Results of the proposed method on tilted view.