# Log Volume Measurement and Counting Based on Improved Cascade Mask R-CNN and Deep SORT
## 4 Results
### Tracking Results  
We recorded videos of logs outdoors using an IQOO Neo5 SE phone at a frame rate of 30 FPS and a resolution of 1920 \(\times\) 1080, resulting in a total duration of 17 s, which served as input for the Deep SORT tracking model. The log stack where we recorded the video is illustrated in Figure 8, and this log stack was also utilized for subsequent log volume measurement tests. Deep SORT acquires the coordinates of detected log ends through the improved Cascade Mask R-CNN and tracks these logs, as depicted in Figure 8. Even in cases of object deformation, the Deep SORT tracking model consistently identifies them as previously tracked objects, exemplified by \"log end 2\" in Figure 8. In frame \"f\", \"log end 2\" is only partially within the field of view, yet the tracking model correctly recognizes it as the previously tracked \"log end 2\". This continuity in tracking is pivotal for the tracking model's object counting functionality, ensuring that objects are not incorrectly separated or re-identified in cases of transient occlusions or deformations. This significantly enhances the robustness and accuracy of the tracking system.  
Figure 7: Heatmaps generated by different backbone networks. It compared attention of the models to objects after fusing attention mechanisms in different backbone networks.  
The quality of tracking and counting achieved by Deep SORT is directly positively correlated with the accuracy of the object detection model. As the misdetection rate of the object detection model increases, the tracking and counting results inevitably deteriorate. Therefore, it is essential to minimize the false positive rate of the object detection model. We test various detection confidence thresholds to filter the detection outcomes, which are then used as input for the Deep SORT model for object tracking and counting. The corresponding results are presented in Figure 9.  
As illustrated in Figure 9, there is a clear correlation between the confidence levels of the detection model and the accuracy of log end tracking and counting by Deep SORT. Notably, as confidence levels decrease, the number of errors in log end detection increases significantly. For example, when the confidence levels drop from 0.9 to 0.6, the log counts recorded by Deep SORT rise sequentially to 19, 21, 23, and 26. These discrepancies in counts are primarily due to false detections made by the object detection model. At a confidence level of 0.9, log counts show an accuracy of 95%. Therefore, carefully selecting appropriate detection models and establishing suitable detection confidence thresholds are crucial for improving tracking performance.  
In practical applications, selecting the detection model and the requisite confidence level necessitates catering to the unique scenarios and requirements, striking a balance between precision and robustness.  
Figure 8: Deep SORT tracking results. (**a**–**f**) represent the tracking state of the log end at different frames.  
Figure 9: Tracking count results of Deep SORT with different output confidence levels for object detection models.