# Matchability and Uncertainty-Aware Iterative Disparity Refinement for Stereo Matching
## 3 Methods
### The Matchability and Uncertainty Decoder
#### 3.1.1 Prediction of Matchability Mask  
We observed that in RAFT-based models, even when apparent matching ambiguity noise is carried in the correlation volume slice sampled from ill-posed regions, the accuracy of estimated disparity is only slightly affected. This implies that the model may have an implicit matchability awareness. To verify this insight, the disparity field feature encoding in the baseline model [12] is modified as:  
\[ \begin{split}\hat{m}_{t}&=\sigma(f_{\theta m}^{ \text{m}}(H_{t},C^{\text{mtc}}(\hat{D}_{t}),\hat{d}_{t}))\\ F_{t}^{\text{corr}}&=f_{\theta^{\text{corr}}}^{ \text{corr}}(C^{\text{mtc}}(\hat{D}_{t}),\hat{m}_{t})=\text{Conv}(\,[C^{\text{ mtc}}(\hat{D}_{t}),C^{\text{mtc}}(\hat{D}_{t})\odot\hat{m}_{t},\hat{m}_{t}\,]; \theta^{\text{corr}}),\end{split}  \tag{2}\]  
where \(f_{\theta m}^{\text{m}}\) and \(f_{\theta^{\text{corr}}}^{\text{corr}}\) denote convolutional networks with parameters \(\theta^{\text{m}}\) and \(\theta^{\text{corr}}\), respectively, \([\cdot\,]\) denotes the concatenation operation, \(\odot\) denotes element-wise multiplication and \(\sigma(\cdot)\) denotes the sigmoid function. The volume slice \(C^{\text{mtc}}(\hat{D}_{t})\) is multiplied by matchability mask \(\hat{m}_{t}\) to filter the matching ambiguity noise. From preliminary pre-training experiments we find that the modified model is enabled to decode the matchability mask from the disparity field's hidden state in each iteration, as shown in Figure 2b,c. As depicted in Figure 2b,c, the obtained matchability mask identifies ill-posed regions. However, it exhibits distinct strip-like textures with a periodicity that correlates with the resolution of the image. Specifically, as illustrated in Figure 3a, the offset varies between the disparity \(\hat{d}_{t}\) and the center of the multi-scale pooling (illustrated as blue dots) within the correlation volume \(C^{\text{mtc}}\) along the scanline direction. For two adjacent points \(p_{i,j}\) and \(p_{i,j+1}\) with the same disparity \(\hat{d}_{t}\), their offsets are denoted as offset\({}_{i,j}<0\) and offset\({}_{i,j+1}>0\), respectively. This offset is related to the horizontal pixel coordinate \(j\) and the disparity \(\hat{d}_{t}\). Consistent with our experimental observations, this varying offset introduces a periodic modulation of the disparity field \(F_{t}^{\text{df}}\), causing the model to misinterpret certain horizontal features as unmatchable. This results in strip-like artifacts appearing in the matchability mask. Although these artifacts are gradually attenuated during training, the risk of decreasing accuracy is not negligible. It is challenging to verify this hypothesis directly through network parameters, our proposed post-pooling method, which centers on \(\hat{d}_{t}\) (as shown in Figure 3b), effectively  
Figure 3: Illustrations for correlation volume pooling methods. (**a**) The pooling method used in the baseline [12]. (**b**) The proposed post-pooling method. The pooling center is kept at \(\hat{d}_{t}\). Figure 2: The matchability masks decoded from disparity field’s hidden state. (**a**) The input left image; (**b**,**c**) the matchability mask from the models run at 1/8 and 1/4 resolution, respectively; (**d**) the matchability mask from the model with our modified pooling method runs at 1/4 resolution. The details are visible in the zoomed-in red box. eliminates the offset. As a result, the artifacts in the matchability mask are removed, as evidenced in Figure 2d. This experimental outcome provides indirect confirmation of our hypothesis regarding the cause of the strip-like artifacts. The above preliminary experiments demonstrate the latent implicit matchability awareness in the baseline can be extracted in the form of matchability mask. Notably, the mask is a byproduct obtained from the training of the disparity refinement task, without any additional explicit supervision.