# Occlusion-Aware Worker Detection in Masonry Work: Performance Evaluation of YOLOv8 and SAMURAI
## 4 Discussion
### Analysis of Detection Performance  
The detection performance of YOLOv8 and SAMURAI was assessed across different occlusion conditions and construction tasks, focusing on accuracy, processing speed, and computational efficiency. The evaluation results highlight the strengths and limitations of each model in various scenarios.  
Both models demonstrated high detection accuracy under non-occlusion conditions (Case 1). However, as occlusion increased, YOLOv8's performance declined significantly. In partial occlusion (Case 2), YOLOv8 showed reduced accuracy compared to SAMURAI, and in severe occlusion (Case 3), its accuracy dropped to approximately 52.67%. In contrast, SAMURAI maintained a relatively high accuracy of 92.67%, indicating that its memory-based tracking mechanism helps maintain consistent detection results even when objects are occluded for extended periods.  
The impact of occlusion also varied by task type. In the brick transportation task, which involved 15 s video clips, both models achieved relatively high accuracy due to the worker's continuous movement, which periodically exposed them to the camera. However, in the brick laying task, which used 60 s video clips, detection accuracy decreased due  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Task**} & **YOLOv8** & **SAMURAI** & **YOLOv8** & **SAMURAI** & **YOLOv8** & **SAMURAI** \\  & **Case 1** & **Case 1** & **Case 2** & **Case 2** & **Case 3** & **Case 1** \\ \hline Carrying Bricks & & & & & & \\ (Detection Count) & 56 & 59 & 49 & 57 & 41 & 56 \\ Brick Laying & & & & & & \\ (Detection Count) & & & & & & \\ Accuracy (\%) & 93.00 & 98.33 & 78.00 & 94.33 & 52.67 & 92.67 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Detection accuracy of YOLOv8 and SAMURAI by algorithm and case in brick transportation and laying.  
to the prolonged periods in which workers remained stationary behind stacked bricks. YOLOv8 performed better in dynamic environments where occlusion was temporary, whereas SAMURAI demonstrated greater robustness in scenarios where occlusion persisted over time.  
In addition to accuracy, key evaluation metrics such as precision, recall, F1-score, and IoU were analyzed to provide a comprehensive assessment of detection performance. YOLOv8 achieved a precision of 97.00%, recall of 98.00%, and F1-score of 0.97, indicating strong performance under minimal occlusion conditions. Similarly, SAMURAI recorded a precision of 96.50%, recall of 94.80%, and F1-score of 0.95, maintaining high detection quality even under occlusion-heavy scenarios.  
Beyond accuracy, detection speed is also a crucial factor in evaluating model performance. YOLOv8 processed frames at approximately 28-32 FPS, making it suitable for real-time applications. However, its frame-by-frame detection approach made it more susceptible to occlusion. In contrast, SAMURAI prioritized accuracy over speed, operating at approximately 9-12 FPS. While this slower speed limits its suitability for real-time applications, its ability to maintain high accuracy in occlusion-heavy environments makes it more reliable for scenarios where precise detection is required.  
Table 5 provides a summary of detection accuracy, precision, recall, F1-score, processing speed, and video processing times for each task, offering a detailed comparison between the two models.  
These findings indicate that YOLOv8 is approximately 2.5 to 3.5 times faster than SAMURAI in terms of frame processing speed. However, SAMURAI achieves about 1.3 times higher accuracy on average across all occlusion conditions. YOLOv8 is well-suited for real-time applications requiring fast inference, while SAMURAI provides superior accuracy, particularly under occlusion, albeit with higher computational demands. The inclusion of precision, recall, and F1-score enhances the reliability of performance evaluation, providing a more comprehensive view of each model's detection capabilities under various site conditions.