# EmbeddedPigDet--Fast and Accurate Pig Detection for Embedded Board Implementations
## 4 Experimental Results
### Comparison of Detection Performance
To reduce the effect of additional CPU time for the IP module of EmbeddedPigDet, we implemented the pipelined version of EmbeddedPigDet (denoted as EmbeddedPigDet**pipe**). With a pipelined execution, the additional CPU time for the IP module (e.g., 12.98 ms on a TX-2) can be hidden by the GPU time for EmbeddedPigYOLO (e.g., 15.55 ms on a TX-2) in processing the continuous video stream. In Figure 8, for the purpose of explanation between the CPU and GPU computation of EmbeddedPigDet**pipe**, we separately represented the image fetch step by CPU (denoted as _Fetch_), the image preprocessing module by CPU (denoted as _IP_), EmbeddedPigYOLO by GPU (denoted as _EmbeddedPigYOLO_) and the postprocessing step for Non-Maximum Suppression by CPU (denoted as _NMS_). \begin{table}
\begin{tabular}{l c c c} \hline \hline  & **Method** & **Accuracy (AP) \(\uparrow\)** & **Speed (fps) \(\uparrow\)** & **Integrated Performance (AP \(\times\) fps) \(\uparrow\)** \\ \hline YOLOv2 [75] & End-to-end deep learning for & 98.41 & 3.91 & 384 \\ \hline TinyYOLOv2 [75] & object detection & 96.96 & 12.78 & 1239 \\ \hline EmbeddedPigYOLO(v2) & & 95.60 & 21.19 & 2025 \\ \hline EmbeddedPigDet(v2) & Combination of image processing and deep learning & 97.66 & 15.83 & 1545 \\ \hline
**EmbeddedPigDet**pipe**(v2) & & **97.66** & **34.38** & (\(\times\)8.7 than YOLO) \\ (Ours) & & & (\(\times\)2.7 than TinyYOLO) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of average performance on a Nano. Figure 8: Illustration of the code structure for a pipelined execution and execution times of each step on a TX-2. As shown in Table 6, YOLO and TinyYOLO could not satisfy the execution speed requirement on a Nano embedded board, although YOLO is a single-shot detector and TinyYOLO is a tiny version of YOLO. On the other hand, EmbeddedPigYOLO could improve the execution speed of TinyYOLO significantly. Although we minimized the additional overhead of the IP module with simple image processing techniques, the execution speed of EmbeddedPigDet was degraded. However, the CPU time for the IP module was less than the GPU time for EmbeddedPigYOLO. Therefore, with a pipelined execution, the additional CPU time for the IP module could be totally hidden by the GPU time and EmbeddedPigDet**pipe** could recover its execution speed. In general, there is a tradeoff between execution speed and accuracy. In order to represent this tradeoff with a single performance metric, we define the \"integrated\" performance as a product of execution speed and accuracy. Compared to the end-to-end deep learning-based methods (i.e., YOLO and TinyYOLO), the proposed method EmbeddedPigDet**pipe** could improve the integrated performance by a factor of up to 9.3 and 2.7, respectively. As explained, the first goal of this study was to improve the execution speed of a well-known tiny object detector (i.e., TinyYOLO) for low-cost embedded board implementations. By generating the composite image and applying the pipelining technique, however, we could improve the integrated performance of both YOLO and TinyYOLO, regardless of the platform used. Since the proposed method could be applied to any \(3\times 3\) convolutional layer, the proposed method can also be applied to other tiny versions of CNN-based object detectors having \(3\times 3\) convolutional layers. Finally, we compared the cost effectiveness of each method by computing \"per-cost\" integrated performance. Compared to the end-to-end deep learning-based methods (i.e., YOLO and TinyYOLO), the proposed method could improve the per-cost integrated performance (see Table 7). For example, the proposed method could improve the per-cost integrated performance of YOLO and TinyYOLO by a factor of 1.6 and 1.1 on a typical PC, respectively. On a Nano board, however, the proposed method could improve the per-cost integrated performance of YOLO and TinyYOLO by a factor of 8.7 and 2.6, respectively.