## 2 Materials and Methods
### Training Procedure Using \(D_{weak}\) Subset  
Without bounding box annotations, bounding box regression or foreground background classification can be performed. Thus, images in the \(D_{weak}\) dataset can only aid the classification procedure in the RCNN-top section. We must have a strategy for giving labels to RoIs proposed by the RPN in order to use \(D_{weak}\) images. Although there is no complete way for figuring out the labels of each RoIs, it is known that given an image label, there is at least one mass that should be labeled as the image label. We are able to infer the most probable RoI that should be labeled by rewriting the model with random variables. Let \(X_{roi}\) be indicator random variables that map all RoIs to their ground truth (background, benign, malignant) and \(G\) be the set of all RoIs in an image. Set G is obtained as an output of the RPN. RoIs in G are considered to contain distinct objects after the non-maximum suppression (NMS) post-processing. NMS eliminates RoIs that overlap with an IoU over 0.5. The RoI with the higher foreground score is kept among the two RoIs. The relationship of the values is defined as \(malignant>benign>background\).  
\[Y=\max_{i\in G}(X_{roi_{1}},X_{roi_{2}},X_{roi_{3}},\ldots)\]  
Thus, \(Y\) represents the label of an image, since a single malignant lesion would make an image label malignant, and a single benign lesion would make the image label benign if there are no other malignant lesions. Subsequently, the most probable mass to be labeled given the image label can be written, as follows,  
\[\underset{i\in G}{\text{argmax}}\ p(X_{roi_{i}}=labelY=label)\equiv\underset{ i\in G}{\text{argmax}}\ p(X_{roi_{i}}=label).\]  
Because \(Y\) is a max of all RoI labels, conditioning the probability with \(Y=label\) gives no information if the probability in question is that of \(X\) having the same label. Thus, it is optimal to choose the RoI with the highest probability of containing the labeled object. Let \(\hat{X}\) denote the mapping between the proposed RoI and the predicted label by the RCNN-top layer. Since \(\hat{X}\) is trained directly by the cross entropy loss with \(X\) when using the \(D_{strong}\) dataset, \(\hat{X}\) can be used as an alternative of \(X\) if suitably trained. Therefore, we label the RoI with the highest image label score after running through RCNN-top, to be the train target in the RCNN-top section and then calculate the loss for a single \(D_{weak}\) image, as follows,  
\[L_{cls}^{RCNN-top}=crossentropy(\max_{i\in G}\ p(\hat{X}_{i}),\ p(label)).\]  
However, \(\hat{X}\) would not be able to replace \(X\) in the early stages of training. Hence, we introduce a controlled weight for \(L_{cls}^{RCNN-top}\), so-called \(\alpha\). We increase \(\alpha\) from a 0.01 as the training progresses and the manner of this increase can vary. The weight \(\alpha\) for \(L_{cls}^{RCNN-top}\) was selected among the following candidates:  
\[\alpha=1-0.99\ (0.9^{step/2000})\]  
\[\alpha=0.01+0.99\ (step/totalsteps)\]  
\[\alpha=0.01+0.99\ (step/totalsteps)^{5} \tag{1}\]  
\[\alpha=0.01+0.99\ (step/totalsteps)^{16} \tag{2}\]  
\[\alpha=0.01+0.99\ (step/totalsteps)^{32}. \tag{3}\]  
Changes of \(\alpha\) following the training steps are visualized in Figure 2. The usage of \(L_{cls}^{RCNN-top}\) is considered to be more conservative as the equation number increases. The \(D_{weak}\) and \(D_{strong}\) dataset is concurrently used and the calculated loss from each image is summed, as follows,\[L_{final}=L_{strong}+\alpha\,L_{weak},\] \[L_{strong}=L_{cls}^{RPN}+L_{reg}^{RPN}+L_{cls}^{RCNN-top}+L_{reg}^{RCNN- top},\] \[L_{weak}=L_{cls}^{RCNN-top}.\]