# Weakly Supervised Learning with Positive and Unlabeled Data for Automatic Brain Tumor Segmentation
## 2 Methods
### Estimating Missing Class Priors \(\pi\)  
Usually, the ratio of foreground and background or positive and negative is unknown and needs to be either manually or automatic heuristically estimated. For some medical  
Figure 3: Schematic explanation of the idea behind weight-based PU-learning. (**a**) Original image: The bright and dark pixels of the image represent its two classes. (**b**) Original image with segmentation overlayed: The green pixels show that the sparsely annotated areas are the sparse annotations. (**c**) Probability of the green class: The probability of annotations given for different preconditions. If the weight for annotated pixels artificially increased, the annotation probability matches the original class probability. tasks, manual estimation procedures exist while they are not known to other tasks. We therefore evaluated both a manual and an automatic estimation of the class prior. For this study, the class prior corresponds to the ratio of gross tumor volume (GTV) to the volume of healthy tissue in the unlabeled data, which can be derived from a completely segmentation of tumorous tissue using the ratio of GTV-labeled voxels vs. other voxels. However, it is not possible to use this approach when given only incomplete annotation, and other methods are needed to estimate \(\pi\). **The automatic estimation of \(\pi\):**\(\pi\) might be estimated from the data assuming that positive and negative data are different enough and that the positive samples are drawn independently and are identically distributed (i.i.d). [PERSON] et al. proposed estimating this ratio by finding the overall class prior \(\theta=P(y=1)\) that reduces the difference between the two distributions \(\theta\cdot P(\mathbf{x}\mid s=1)\) and \(P(\mathbf{x})\)[PERSON] et al. (2018). The intuition behind this is that parts of the original distribution that are caused by the positive samples will be matched, while the other parts cannot be matched. This concept is schematically illustrated in Figure 4a,b. [PERSON] et al. suggest using Pearson divergence (PE) to measure the similarity of both distributions and to derive an analytic solution for \(\theta\). We refer to this method as 'Pearson Divergence Prior Estimation' (PEPE) and calculate \(\pi\) based on it as follows. \[\pi=\frac{\theta-P(s=1)}{1-P(s=1)}. \tag{2}\]  
An underlying assumption for PEPE is that positive samples are drawn i.i.d [PERSON] et al. (2018). However, the manual sparse annotation process always nearly leads to a sampling bias that might affect the performance of the estimation algorithm (cf. Figure 4b). We therefore propose to include a correction of the sampling bias by using importance weighting ([PERSON] et al., 2017). Here, the idea is to weight each sample with an sample-dependent weight factors so that the corrected distribution matches the original distributions from which the data have been drawn. To achieve this, each sample \(\mathbf{x}\) is weighted accordingly to the following ratio (cf. Equation (5)):  
\[w(\mathbf{x})=\frac{P_{\text{Test}}(\mathbf{x})}{P_{\text{Training}}(\mathbf{x})} \tag{3}\]  
by correcting the positive class estimation according to the following. \[P(\mathbf{x}\mid s=1)=\frac{w(\mathbf{x})}{\mid w\mid}\cdot n\cdot P_{\mathcal{ P}}(\mathbf{x}\mid s=1) \tag{4}\]  
The weighting factor \(w(\mathbf{x})\) must be estimated since the computational estimation of a distribution is challenging and neither \(P_{\text{Test}}(\mathbf{x})\) nor \(P_{\text{Training}}(\mathbf{x})\) are known. We use the estimation approach that is also used for the non-i.i.d correction and that is described in Section 2.4 and call this method the 'Domain Adapted PEPE' (DA-PEPE). **Manual estimation of \(\pi\):** A manual estimation of \(\pi\) is more labor-intensive than an algorithmic estimation and requires an application-specific approach. However, the potentially more accurate estimation and the reduced likelihood for outliers can lead to more accurate classifiers.