# Deep Instance Segmentation of Laboratory Animals in Thermal Images
## 2 Methods
### Evaluation Metrics
\begin{table}
\begin{tabular}{l c c c c c} \hline \hline  & **mAP** & **AP\({}_{\text{50}}\)** & **AP\({}_{\text{75}}\)** & **mAP** & **AP\({}_{\text{50}}\)** & **AP\({}_{\text{75}}\)** \\ \hline
**orig** & bbox & & & segm & \\ \hline
2 batch, 100,000 epochs & **78.235** & **100** & 92.41 & 79.615 & **100** & **95.535** \\ \hline
4 batch, 100,000 epochs & 76.413 & 99.99 & **95.435** & **80.371** & 99.99 & 91.678 \\ \hline
**ch1** & & & & & \\ \hline
2 batch, 100,000 epochs & **78.862** & 100 & **98.307** & 77.724 & 100 & 90.687 \\ \hline
4 batch, 100,000 epochs & 77.725 & 100 & 94.535 & **81.259** & 100 & **95.188** \\ \hline
**ch2** & & & & & \\ \hline
2 batch, 100,000 epochs & 64.42 & 99.18 & 69.516 & 62.307 & 96.206 & 71.867 \\ \hline
4 batch, 100,000 epochs & **75.275** & **99.833** & **90.342** & **74.431** & **99.833** & **89.674** \\ \hline
**ch3** & & & & & \\ \hline
2 batch, 100,000 epochs & 44.557 & 84.367 & 40.402 & 13.097 & 60.133 & 0.012 \\ \hline
4 batch, 100,000 epochs & **55.982** & **95.072** & **57.009** & **32.752** & **89.025** & **16.88** \\ \hline
**16-bit** & & & & & \\ \hline
2 batch, 100,000 epochs & **78.112** & 99.99 & **97.29** & 80.198 & 99.99 & 94.435 \\ \hline
4 batch, 100,000 epochs & 76.296 & **100** & 90.662 & **81.267** & **100** & **94.887** \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Training results for TensorMask from scratch learning and 500 images. Figure 3 presents the exemplary testing results for two images (Figures 3a,b) which constituted quite a serious challenge for segmentation. For a better illustration, the contact area was zoomed and manually segmented with a yellow line in Figures 3c,d. The examples given include animals that overlapped one another. Figures 3e-h present the results of pre-trained learning for Mask R-CNN and TensorMask respectively. The instance segmentation made by those architectures trained from scratch are shown in Figures 3i-l.  
Table 6 demonstrates the results of the inference made for _orig_ images using commonly available models pre-trained only on MS COCO Dataset, Citiscapes and LVIS. We also used two different implementations of Mask R-CNN pre-trained on the COCO dataset. The results of 3-fold cross-validation for the parameters of four batch size with 2000 epochs and two batch size with 100,000 epochs for pre-trained and trained from random initialization models respectively are presented in Table 7. The results are presented in the form of box and segmentation \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & **mAP** & **AP\({}_{\text{50}}\)** & **AP\({}_{\text{75}}\)** & **mAP** & **AP\({}_{\text{50}}\)** & **AP\({}_{\text{75}}\)** \\ \hline
**Mask R-CNN** & bbox & \multicolumn{4}{c}{segm} \\ \hline MS COCO—implementation [37] & 4.14 & 13.39 & 1.4 & 5.36 & 14.44 & 1.05 \\ \hline MS COCO—implementation [36] & 7.62 & 13.5 & 7.62 & - & - & - \\ \hline Citiscapes & 0.06 & 0.3 & 0 & 0.01 & 0.09 & 0 \\ \hline LVIS & 0.71 & 3.45 & 0.04 & 0 & 0 & 0 \\ \hline
**TensorMask** & \multicolumn{4}{c}{} \\ \hline MS COCO—implementation [37] & 1.69 & 3.41 & 1.29 & 3.06 & 6.31 & 2.6 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Segmentation results for commonly available models. Figure 3: Examples of segmentation and detection prediction made for (**a,b**) the original images; (**c,d**) proper segmentation zoomed and marked with yellow lines. Results for: (**e,f**) pre-trained Mask R-CNN; (**g,h**) pre-trained TensorMask; (**i,j**) random initialized Mask R-CNN; (**k,l**) random initialized TensorMask. mAP. The folds of model training for three different training and testing datasets were repeated twice. Presented result values are the best selected repetition.