# Semi-Supervised Learning Matting Algorithm Based on Semantic Consistency of Trimaps
## 3 Methodology
### Ablation Study  
We conducted granularity ablation and loss ablation to demonstrate the effectiveness of the Tri-SSL method design. All ablation experiments were conducted based on the dataset combination experiment with ELGT.  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline \multirow{2}{*}{**Methods**} & \multicolumn{2}{c}{**MSE\(\downarrow\)**} & \multirow{2}{*}{**SAD\(\downarrow\)**} & \multirow{2}{*}{**Grad\(\downarrow\)**} & \multirow{2}{*}{**Conn\(\downarrow\)**} \\  & \(\mathbf{(\Omega\times 10^{-3})}\) & & & \\ \hline KNN (2013) [10] & 103.0 & 175.4 & 124.1 & 176.4 \\ Closed-Form (2007) [7] & 91.0 & 168.1 & 126.9 & 167.9 \\ Information-flow (2017) [40] & 66.0 & 75.4 & 63.0 & 75.0 \\ DIM (2017) [12] & 14.0 & 54.4 & 31.0 & 50.8 \\ AlphaGAN (2018) [13] & 18.0 & 90.9 & 93.9 & 95.2 \\ IndexNet (2019) [39] & 13.0 & 45.8 & 25.9 & 43.7 \\ Context-aware (2019) [33] & 8.2 & 35.8 & 17.3 & 33.2 \\ GCA (2020) [38] & 9.1 & 35.3 & 16.9 & 32.5 \\ HAttMatting (2020) [14] & 7.0 & 44.1 & 29.2 & 46.4 \\ Transmating (2022) [41] & 4.5 & 24.9 & 9.7 & 20.1 \\ Matterformer (2022) [16] & 4.0 & 23.8 & 8.7 & 18.9 \\ ELGT-Matting (2023) [17] & 3.7 & 23.1 & 8.3 & 19.6 \\ Tri-SSL (Ours) & **3.58** & **22.63** & **8.14** & **19.19** \\ \hline \hline \end{tabular}
\end{table}
Table 4: The quantitative comparison of Tri-SSL and supervised methods on Composition-1k. The \(\downarrow\) indicates that the lower the value, the better.  
Figure 5: Visual comparison of Tri-SSL and supervised methods on Composition-1k. The green box zooms in on the detail. (**a**) Image. (**b**) GCA [38]. (**c**) Image. (**d**) GCA [38]. (**e**) Trimap. (**f**) Matterformer [16]. (**g**) Trimap. (**h**) Matterformer [16]. (**i**) DIM [12]. (**j**) Tri-SSL. (**k**) DIM [12]. (**l**) Tri-SSL. (**m**) IndexNet [39]. (**n**) GT. (**o**) IndexNet [39]. (**p**) GT.  
The first ablation experiment evaluated whether the differently perturbed samples used in the weakly supervised branch had sufficient gap for the network to learn valid information. The differently perturbed samples were formed by different-granularity trimaps. For the fine trimap, the kernel coefficients of the erosion function ranged from 2 to 30 pixels, while, for the coarse trimap, the kernel coefficients ranged from 32 to 60 pixels. In the granularity ablation experiment, we shrank the gap between the different perturbed samples and set the kernel coefficients' range from 2 to 30 pixels for both trimaps. The results are shown in Table 5. The granularity ablation experiment \(Gran\_Ablation\) was inferior to the \(ELGT+Tri\_SSL\) for all four metrics on Composition-1k. Moreover, the performance of \(Gran\_Ablation\) declined on the AIM-500 test set.  
The second ablation experiment evaluated the loss function design of the weakly supervised branch. The overall weight of the weakly supervised loss was adjusted to 1/4 of the weight of the supervised loss, and higher weight was assigned for the side outputs \(l_{wk}^{8}\) and \(l_{wk}^{4}\) in the deeper layer. In the loss ablation experiment, we adjusted the proportion of loss weights in the weakly supervised branch to be consistent with the supervised branch, and kept the overall weight 1/4 of the supervised loss weight. The weakly supervised loss function in the ablation experiment was formed as  
\[\begin{split} L_{wk}^{ablation}=& 0.1L(\hat{\alpha}_{ coarse},\hat{\alpha}_{fine})+0.05L(l_{ coarse}^{4},l_{fine}^{4})\\ &+0.05L(l_{coarse}^{8},l_{fine}^{8}).\end{split} \tag{13}\]  
The results are shown in Table 5. The loss ablation experiment \(Loss\_Ablation\) was inferior to the \(ELGT+Tri\_SSL\) for all four metrics on Composition-1k and had a similar relative performance on the other two test sets.