# Semi-Supervised Learning Matting Algorithm Based on Semantic Consistency of Trimaps
## 3 Methodology
### Dataset Combination  
To further validate the performance of Tri-SSL, we conducted dataset combination experiments. The experiments consisted of two steps: (1) in the first step, we performed supervised training on the Adobe dataset; (2) in the second step, we performed semi-supervised training with Distinction-646 dataset as unlabeled data. This helped to improve overall performance. The experiment utilized Matterformer [16] and ELGT [17] as baseline models to demonstrate Tri-SSL's ability to improve the performance of different matting methods. In the first step, both base models were trained using their original training parameters. Matterformer underwent 200,000 iterations (approximately 93 epochs) with a batch size of 20 and an initial learning rate of \(1\times 10^{-3}\). ELGT was trained for 200,000 iterations (approximately 112 epochs), with a batch size of 24 and an initial learning rate of \(5\times 10^{-4}\). The trained model was loaded in the second step, and the Distinction-646 dataset was employed as weakly annotated data. The weakly supervised branch was added to optimize the model and training for another 100,000 iterations. At this point, the batch size for Matterformer was adjusted to 12, with 12 labeled and 12 unlabeled images per iteration and a learning rate of \(5\times 10^{-4}\). Meanwhile, ELGT's batch size was adjusted to 10, with 10 labeled and 10 unlabeled images per iteration and a learning rate of \(2.5\times 10^{-4}\)  
Figure 4: The qualitative results of the 1/16 dataset partition ratio on Composition-1k. The green box zooms in on the detail. The batch size was halved because the semi-supervised branch doubled the number of image samples in a single iteration. To control the influence of other factors and prove the effectiveness of Tri-SSL, the following control experiment was conducted in the second step: we loaded the model trained in the first step, but did not add the weakly supervised branch to the model. The model was trained for an additional 100,000 iterations to ensure consistency of the training iterations with the Tri-SSL experiments. The experimental results based on Matteformer and ELGT are presented in Table 2 and Table 3, respectively. In Tables 2 and 3, the model \(+\)_Tri-SSL_ refers to the target experiment, where the first-stage trained model was loaded and semi-supervised fine-tuning with unlabeled data (from the Distinction-646 dataset) was conducted. The model \(+SupOnly\) refers to the control experiment where the first-stage trained model was loaded, and supervised training of the same number of iterations was conducted. As shown in Table 2, after semi-supervised fine-tuning, the mean square error (MSE) of Matterformer decreased from 8.63 to 7.56, and the sum of absolute differences (SAD) value reduced from 25.04 to 22.11 on the Distinction-646 dataset. On the AIM-500 dataset, the MSE value improved from 32.5 to 29.6. In Table 3, the \(ELGT+\)_Tri-SSL_ is seen to outperform \(ELGT\) on the Adobe test set, decreasing the MSE value from 3.79 to 3.58. The control experiment \(ELGT+SupOnly\) slightly improved over \(ELGT\), with the MSE value of 3.70 inferior to the 3.58 of \(ELGT+\)_Tri-SSL_. The results demonstrate the ability of the proposed semi-supervised training method to learn from weakly annotated data and improve model performance. After introducing Distinction-646 data as weakly annotated data for additional training, the Tri-SSL model based on the ELGT achieved state-of-the-art performance. We compared Tri-SSL quantitatively with three traditional and nine deep learning methods on the Composition-1k test set. The comparison results are shown in Table 4, demonstrating