3.1. Overview
The proposed IFMA-Stereo introduces a visual foundation model into remote sensing disparity estimation, leveraging its generalized representations at both the feature level and the outcome level to enhance the disparity estimation process. As illustrated in
Figure 1, the model consists of four main components: feature extraction based on a depth estimation foundation model, generation of a cost volume via alternating self-attention and cross-attention mechanisms, monocular–stereo joint iterative module, and disparity optimization based on multiple factors.
Compared to previous remote sensing stereo matching methods, our approach incorporates specialized designs based on visual foundation models. Specifically, in
Section 1, we employ a MobileNetV2 [
43] network for conventional stereo matching cost volume construction and enhance it with feature-level interaction using DepthAnythingV2—a model built upon the DINO visual foundation model. Through a specially designed feature fusion block (FFBLOCK) together with the attention modules (SAB and CAB) in
Section 2, monocular structural information is incorporated into the stereo cost volume, complementing the purely matching-based cues. Furthermore, in
Section 3, pixel-level depth predictions are utilized to assist the binocular iterative process, guiding the model to focus more effectively on relative scene modeling. The dashed box represents the iterative process, WME represents warped motion encoder, and ×
N or ×
M denote N or M iterations. Finally,
Section 4 includes the disparity optimization step that produces the final output.
3.2. Feature Extraction Based on Vision Foundation Model
For feature extraction, we construct two branches. One branch adopts a trainable lightweight CNN (MobileNetV2), following the feature extraction choice of outstanding disparity prediction models such as IGEV-Stereo [
8]. The other branch employs a frozen, pre-trained DepthAnythingV2 foundation model as an auxiliary branch to introduce geometric structure priors. According to the illustration in
Figure 2, a multi-scale integration is performed on the CNN features and the prior-informed features from the foundation model. The multi-scale features
extracted by DepthAnythingV2 are integrated with the corresponding multi-scale features
extracted by MobileNetV2 through the feature fusion block, where
l(
r) denotes the possible left-view (right-view). The design enables a coarse-to-fine incorporation of the generalization information from the depth estimation foundation model, progressively yielding refined generalized features
. Mathematically,
where
denotes the i-th feature fusion block, which performs dimensional concatenation followed by convolutional fusion of features from different levels, and
represents the i-th feature alignment layer, designed to spatially align the generalized features with the multi-scale features of the adjacent level in terms of resolution.
3.3. Cost Volume Generation Based on Self- and Cross-Attention
During feature extraction, the original foundation model DepthAnythingV2 is primarily designed for monocular depth estimation. Consequently, the multi-scale features it extracts encapsulate an understanding of the scene’s inherent geometry but are not explicitly guided for disparity reasoning between stereo pairs. Therefore, this paper introduces an attention mechanism to capture long-range contextual dependencies between feature positions across the left and right views for more effective cost volume construction. By computing attention weights between query and key vectors, the set of vectors originally dedicated to monocular depth extraction are weighted and transformed into features more suitable for stereo cost matching.
In detail, the generalized features
obtained from feature extraction first undergo positional encoding to incorporate relative positional relationships into the spatial information. This enhancement aids the model in better understanding edge structures and supports reasoning over larger spatial contexts, which is particularly beneficial for constructing and interpreting geometric features in extensive texture-less regions. This paper employs sinusoidal relative positional encoding. Given that spatial information in images exhibits translation invariance and disparity depends solely on image content [
44], relative positional encoding is applied only to the Query and Key vectors. Mathematically,
Since
and
represent relative positional encodings and carry no image content information—and considering that disparity is determined exclusively by image content—the attention mechanism can be correspondingly expanded and reformulated as follows:
After obtaining the generalized features for the left and right images through the feature extraction step, we perform weighted aggregation along the epipolar line within the disparity search range to construct the attention mechanism. Following the approach described in prior attention-related literature [
45], we first apply self-attention to the generalized features of the left and right images separately, resulting in refined features. Subsequently, we employ a cross-attention mechanism for further processing, yielding feature representations that are more suitable for stereo cost matching. The specific procedures of self-attention block SAB and cross-attention block CAB are illustrated in
Figure 3.
Subsequently, we need to leverage the generalized features obtained from the foundation model to construct a cost volume that can be integrated into the main stereo matching pipeline. A potential assumption underlying previous approaches that incorporate general features from foundation models into stereo matching is the strict correspondence between views and viewing angles—namely, the left view is observed by the left device and the right view by the right device. This assumption holds in almost all conventional scenarios. However, due to the specific characteristics of remote sensing image pairs, including variations in acquisition devices and viewing angles, the disparity range of such image pairs can vary drastically from negative to positive values, thereby breaking the strict correspondence between views and viewing angles. To address this issue, we introduce negative disparities into the cost volume construction and extend the view-restricted geometry encoding volume to a more generalized bidirectional geometry encoding volume that no longer relies on strict view correspondence.
Figure 4 illustrates a comparison of pixel matching between general scenes and remote sensing scenes, and the horizontal and vertical axes represent the potential matching horizontal coordinates of the epipolarly rectified left and right images, respectively. Within a specified disparity range ∆D, features from the left and right views are horizontally shifted and subsequently processed through dot-product operations between feature vectors, resulting in the construction of a bidirectional geometry encoding volume. Furthermore, we adopt the all-pairs correlation approach proposed by RAFT-Stereo to enhance image detail preservation and improve discriminative capability in challenging edge regions.
3.4. Iteration Based on Monocular and Binocular Combination
Monocular depth estimation foundation models possess a certain capability to regress depth information. This pixel-level depth information can, from a different perspective, help overcome challenges such as significant spatio-temporal variations and difficulties in generalizing across images from different cities, thereby providing a relatively reliable initial depth estimate. On the other hand, iterative-based methods do not directly regress the final disparity but aim to iteratively predict disparity residuals, gradually approaching the optimal estimate. While iterative methods primarily operate at the disparity level, the depth information estimated from monocular images only contains relative relationships and cannot be directly converted. Therefore, we need to extract the relative relationships from this depth information and align them with disparity.
Our experiments reveal that the disparity results obtained from standard iterative methods are more conducive to recovering local fine details, yet they tend to produce blurry predictions in certain non-local geometric structures. In contrast, foundation models, which are primarily adapted to natural images, exhibit strong recognition capability for global geometric contours. However, due to the lack of specialized training on remote sensing data, the domain gap leads to low reliability of local details when transferring these models to remote sensing scenarios. As illustrated in
Figure 5, the unaligned depth extracted from the foundation model is visualized in color and referred to as Relative depth, while the color-visualized disparity results obtained from the standard iterative method are denoted as Predicted disparity. The ground-truth disparity maps are also provided for reference (GT disparity). Comparing Relative depth with Predicted disparity reveals that Relative depth is more sensitive to structural edges and distinguishes well between macro-scale structures due to its understanding of scene geometry. In the figure, this manifests as a tendency to produce relatively straight edges that reflect the relative depth relationships, which aligns well with the structural information of the buildings in this scene. In contrast, Predicted disparity tends to yield relatively blurrier edges, appearing as less straight boundaries. However, Relative depth exhibits deficiencies in capturing local details. For instance, as shown in the red box in
Figure 5, the ground-truth disparity indicates that the right side of the X-shaped structure should be at a similar depth level to the two ends of the X-shape. The Predicted disparity from the standard iterative method accurately reflects this. In contrast, the Relative depth map incorrectly assigns a significantly lower depth value to the right side of the X-shape, in stark discrepancy with the depth levels at the two ends of the X-shape. This undoubtedly represents a severe distortion in the local depth prediction.
Therefore, we decide to combine the advantages of both approaches by leveraging the macroscopic accuracy of the depth estimation foundation model to guide the iterative method in further refining the structural geometric information. This requires extracting the relative relationships from the depth information to establish an appropriate mapping. We propose to construct a simple linear relationship for mapping depth to disparity. The analytical solution to this linear regression problem can be obtained via the least squares method, ultimately reducing to solving a system of linear equations. We need to compute the optimal transformation parameters
, including a weight term and a bias term, to establish the conversion relationship between the flattened monocular depth
and the target flattened disparity
. Mathematically, this is derived as follows:
where
represents an all-1 matrix with the size of
L × 1. By applying the least squares method, the final parameters
can be obtained:
To establish the conversion relationship between depth and disparity, the standard disparity d must be known. However, the standard disparity is the target output and cannot be directly used in the conversion formula. Therefore, an intermediate result is employed as an approximation here, adopting a segmented iterative approach. Initially, a single-path iteration is constructed to predict a disparity, followed by a monocular–stereo joint iteration for higher-precision disparity estimation.
Specifically, as illustrated in
Figure 6, the initial disparity is first regressed from the geometry encoding volume obtained by the regularization network as a relatively coarse disparity. Subsequently, following the idea of IGEV, in each iteration
k, the current disparity value is used to index the features in the geometry encoding volume, and the corresponding correlations are computed via linear interpolation. These indexed features are then fed into the subsequent GRU-based update operator (ConvGRU), which works in conjunction with the context network to jointly update the hidden state of the ConvGRU and the current disparity value. The resulting disparity, which is relatively accurate, is referred to as the standard disparity.
The architecture of the monocular–stereo joint iteration is illustrated in
Figure 7. The depth information is processed via linear regression, where the standard disparity obtained from the initial single-path iteration is substituted as
d into Equation (9) to compute the optimal transformation parameters
. This ultimately yields the mono disparity corresponding to the monocular depth. Meanwhile, to mitigate the impact of erroneous initial values on subsequent iterative updates, we employ the final-level generalized features of the left and right images constructed via the attention mechanism. These features are independently aligned using a warped motion encoder (WME) to compute the current iterative disparity residual, which is then fed into the ConvGRU update operator, thereby progressively refining the current iterative disparity. Specifically, the current iterative disparity residual is first constructed by computing the difference between the left image features
and the right image features
—which have been processed through the attention mechanism in the previous step—after warping the right features using the current disparity. Mathematically,
where warp(
) denotes the result of resampling the right image features along the epipolar direction according to the current disparity.
Subsequently, the iterative disparity residual is utilized for warped motion encoding and then incorporated into a GRU-based update operator. Finally, a new
is computed by combining the standard disparity
and the mono disparity
. Mathematically,
where
s denotes the standard disparity branch,
m denotes the mono disparity branch. By substituting the new
into the GRU update formula, a new dual-branch iterative disparity update can be achieved.