# Toward Semi-Supervised Graphical Object Detection in Document Images
## 3 Proposed Framework  
Semi-supervised object detection algorithms are broadly divided into consistency and pseudo labeled. The pseudo-labeled algorithms are multi-staged and run in two stages where an initial classifier is generated using the labeled data in the first stage, In the next stage, the initial classifier is used to create pseudo labels before updating the initial classifier with the combination of labeled and pseudo-labeled data. The Soft Teacher [10] framework, which is proven to produce supervised-like results in object detection is being used to prove the same for graphical page object detection in a pseudo-labeling framework with few modifications to the training process. Firstly, the framework is made end-to-end, without any initial classifier, and then, weak augmentation is used to generate pseudo labels. To address the issue of low training data, the strongly augmented data along with labeled data are used for detection training.  
The framework comprises two models: the \"student\" model, which is in charge of detection training, and the \"teacher\" model creates pseudo boxes for unlabeled input. The teacher model is the student model's exponential moving average (EMA) and learns to generate pseudo labels on weakly augmented unlabeled data. In contrast, the student model is trained on both labeled and strongly augmented unlabeled data to minimize the loss. The teacher model generates two sets of pseudo labels: one for the classification task and the other for detecting bounding boxes. We employ the FixMatch technique [49] of using data augmentation for training two multiple branches.  
During the training process shown in Figure 3, the training data are split into different batches, each of which contains a random selection of labeled and unlabeled data. The teacher model creates pseudo labels from weakly augmented unlabeled data, while the student model uses both labeled and strongly augmented data. The pseudo labels generated by the teacher model are exploited as ground truth for strongly augmented unlabeled data to accomplish detection training. In contrast to the traditional classification problem, which determines whether a specific image corresponds to a specific label, the localization problem should identify and localize several entities in the same image. Identifying a particular object can be treated as a classification task, and the localization branch can be handled as a regression task. The framework's total loss is the weighted sum of supervised and unsupervised losses  
\[L_{total}=L_{sup}+\alpha L_{unsup} \tag{1}\]  
Here, \(L_{sup}\) and \(L_{unsup}\) represent the supervised and unsupervised loss, respectively, and if \(N_{la}\) and \(N_{un}\) represent the number of labeled and unlabeled images in a batch with \(I^{i}_{la}\) and \(I^{i}_{un}\) representing a particular labeled and unlabeled images, respectively, the supervised and unsupervised loss can be defined as below  
\[L_{sup}=\frac{1}{N_{la}}\sum_{i=1}^{N_{la}}(L_{cls}(I^{i}_{la})+L_{reg}(I^{i}_ {la})) \tag{2}\]  
\[L_{unsup}=\frac{1}{N_{un}}\sum_{i=1}^{N_{un}}(L_{unsup}^{cls}(I^{i}_{un})+L_{ unsup}^{reg}(I^{i}_{un})) \tag{3}\]  
Both the teacher and student model are randomly initialized initially, and during the training, the teacher model, in addition to providing pseudo labels, guides the student model. This effect occurs because the teacher model is a simple EMA of the student. During the training of the teacher model, multiple pseudo boxes are generated, and the Non-Maxima Suppression technique is leveraged to discard a few pseudo boxes. However, there can still be multiple pseudo boxes after the suppression technique. To segregate the available boxes into foreground and background, a threshold is employed, and the predictions with box scores higher than the threshold are used as foreground boxes in training.