# EnsemblePigDet: Ensemble Deep Learning for Accurate Pig Detection
## 4 Experimental Results
### Discussion  
Figure 7 shows the result of solving the failed detection cases for each model using the model ensemble. In the case of Figure 7a, while false negatives were created that resulted in missing pig detection in model B, all of the pigs within a frame detected through the model ensemble are shown. In the case of Figure 7b, while false positives were created that resulted in the detection of background as pig in model A, all of the pigs detected through the model ensemble that merged with falsely detected boxes are shown. In addition, Figure 7c shows false negatives and false positives created in model B, which were merged using a model ensemble that correctly detected all pigs within a frame. Hence, even if falsely detected boxes were created from each model, enhancing the detection result of each model and further merging the result using the model ensemble was possible. Although many errors with single models could be solved by the ensemble model, some errors still remain. Figure 8 shows the result of not being able to detect all pigs within a frame, even after applying the model ensemble. In the case of Figure 8a, while false negatives occurred in models A and B, detection of all pigs within a frame failed even after merging the result using the model ensemble because of false negatives occurring for the same pig. In addition, as shown in Figure 8b, even though false negatives of model A and false positives of model B were created, the detection boxes could not be merged. This was because the false positives of model B were considered as pigs instead of the false negatives of model A, even after applying the model ensemble, due to false positives with high confidence scores. To summarize, the detection result might not merge correctly, even after applying the model ensemble to the following cases: the same pigs not being detected, \begin{table}
\begin{tabular}{c c c} \hline \hline
**Proposed Ensemble Models** & \# Error Frames with max\_ pigs (ACC\_pixels) \\ \hline Confidence1 = 0.3 and & Threshold1 = 0.5 and Threshold2 = 0.3 & 956 (93.17\%) \\ Confidence2 = 0.5 & Threshold1 = 0.7 and Threshold2 = 0.3 & 1162 (91.70\%) \\ \hline Confidence1 = 0.3 and & Threshold1 = 0.7 and Threshold2 = 0.5 & 1077 (92.31\%) \\ \hline Confidence2 = 0.7 & Threshold1 = 0.5 and Threshold2 = 0.3 & 1173 (91.62\%) \\ Confidence2 = 0.7 & Threshold1 = 0.7 and Threshold2 = 0.3 & 3092 (77.91\%) \\ \hline Confidence1 = 0.5 and & Threshold1 = 0.5 and Threshold2 = 0.3 & 1753 (87.48\%) \\ Confidence2 = 0.7 & Threshold1 = 0.7 and Threshold2 = 0.3 & 2283 (83.69\%) \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Comparison of accuracy ACC\({}_{\text{max\_ pigs}}\) for 13,997 key frames with overexposed regions (obtained during 8:30 a.m. to 10:30 a.m.) with different ensemble parameters (case of Confidence1 and Threshold1 = conservative, Confidence2 and Threshold2 = aggressive). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Proposed Ensemble Models** & \# Error Frames with max\_ pigs (ACC\_pixels) \\ \hline  & Threshold1 = 0.3 and Threshold2 = 0.5 & 832 (94.06\%) \\ Confidence1 = 0.5 and & Threshold1 = 0.3 and Threshold2 = 0.7 & 637 (95.45\%) \\ Confidence2 = 0.3 & Threshold1 = 0.5 and Threshold2 = 0.7 & 621 (95.56\%) \\ Confidence1 = 0.7 and & Ensemble1 pieDet \\ \hline Confidence1 = 0.7 and & Threshold1 = 0.3 and Threshold2 = 0.5 & 916 (93.46\%) \\ Confidence2 = 0.3 & Threshold1 = 0.3 and Threshold2 = 0.7 & 678 (95.16\%) \\ \hline Confidence1 = 0.5 and & Threshold1 = 0.5 and Threshold2 = 0.7 & 673 (95.19\%) \\ \hline Confidence1 = 0.7 and & Threshold1 = 0.3 and Threshold2 = 0.5 & 1312 (90.63\%) \\ Confidence2 = 0.5 & Threshold1 = 0.5 and Threshold2 = 0.7 & 1361 (90.28\%) \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Comparison of accuracy ACC\({}_{\text{max\_ pigs}}\) for 13,997 key frames with overexposed regions (obtained during 8:30 a.m. to 10:30 a.m.) with different ensemble parameters (case of Confidence1 and Threshold1 = aggressive, Confidence2 and Threshold2 = conservative).