# Learning to Segment Blob-like Objects by Image-Level Counting
## 4 Experiments and Results
### Architectures, Training, and Evaluation Settings  
The goal of the evaluation was to analyze the feasibility of our training method for weakly supervised segmentation training. For this, we employed three different network architectures, a variant of ResNet, UNet++, and TransUNet, in order to avoid biases caused by a specific architecture or a specific architecture size. UNet and its successors, like UNet++ and TransUNet, are typical networks for segmentation tasks, especially in the field of medical image analysis [35]. UNet++ is CNN-based, while TransUNet uses transformers as an encoder. The original ResNet and derivates of it are commonly used as backbones and, thus, provided a suitable basis for our investigations as well. UNet++ is used with 8 or 16 filters in the first layer. Dilated ResNet consists of 18 or 34 residual blocks, as shown in Figure 4. We developed a multiscale combination of dilated convolutions that is conceptually similar to the context block module used by [PERSON] et al. [36]. Each of our blocks consists of three dilated convolutions with increasing dilation values to capture a wider area at once than in the original ResNet. The sum of their results passes a Leaky ReLU activation and a group normalization [37] before a final \(1\times 1\) convolutional layer. Each convolution uses 32 filters. This specific structure proved to be particularly effective in preliminary tests on a reduced dataset.  
TransUNet uses the vision transformer (ViT)-Base variant with an input patch size of \(16\times 16\)[14] with a residual network (ResNet50) [38] as the backbone.  
Figure 4: A dilated residual block, as used in the dilated ResNets of this work. The \(k\times k\) notation specifies the kernel size. The parameters \(d_{1}=1\), \(d_{2}=2\), and \(d_{3}=4\) give the dilation. The number of channels is given as \(c\). GN denotes a group normalization [37] with a group size of 8. The last convolution uses a dilation value of 1.  
Figure 3: Scheme of the training setup of a counting network with the contrast loss (Section 3.3) and the morphological loss (Section 3.4) as additional losses between the implicit segmentation and the explicit counting.  
To evaluate an approach quantitatively, we relied on the numbers of true positives (tps), false positives (fps), and false negatives (fns) and measures  
\[\text{precision}=\begin{cases}1&\text{if tp}+\text{fp}+\text{fn}=0\\ 0&\text{if tp}=0\text{ and fp}+\text{fn}>0\\ \frac{\text{tp}}{\text{tp}+\text{fp}}&\text{otherwise},\end{cases} \tag{7}\]  
and  
\[\text{F}_{1}\text{ score}=\begin{cases}1&\text{if tp}+\text{fp}+\text{fn}=0\\ 0&\text{if tp}=0\text{ and fp}+\text{fn}>0\\ \frac{2\text{ precision}-\text{recall}}{\text{precision}+\text{recall}}&\text{ otherwise}.\end{cases} \tag{9}\]  
We used the measures in modified versions, adding special cases in order to allow them to be applied where they would not be defined otherwise, i.e., in cases where there are no true positives. Two objects are considered a match, i.e., a true positive, if their bounding boxes overlap significantly. The final value of a metric is the average of the values determined for the individual examples. For each network, we selected the best of 5 training runs and, by that, did not focus on a stability assessment, but aimed to compare the capabilities of the approaches. Therefore, we give a separate view of the stability of the results in addition to the metrics described above.