FlexiMo: A Flexible Remote Sensing Foundation Model

Xuyang Li, Chenyu Li, Pedram Ghamisi, Danfeng Hong

TL;DR

FlexiMo introduces a highly adaptable remote sensing foundation model that breaks free from the rigid constraints of fixed spatial resolutions, patch sizes, and channel counts. By combining a parameter-free spatial resolution-aware scaling module with a wavelength-guided channel adaptation mechanism, it seamlessly processes heterogeneous satellite imagery to achieve state-of-the-art performance across diverse downstream tasks without altering the underlying network architecture.

What Problem Does This Paper Address?

Satellite imagery is inherently heterogeneous. Different sensors capture data at varying Ground Sample Distances (GSD), spectral bands (RGB, multispectral, hyperspectral), and modalities (such as Synthetic Aperture Radar, or SAR). However, most current Remote Sensing Foundation Models (RSFMs) rely on Vision Transformer (ViT) backbones that utilize rigid, fixed-size patch tokenization (typically 16×16 pixels).

This rigid design introduces two major challenges:

  1. Rigid Tokenization: When input resolutions change, the resulting token sequence lengths vary, which disrupts the geometric consistency of positional encodings and degrades the model's spatial awareness.
  2. Multi-scale Perception Conflict: A fixed patch size forces an unnatural trade-off. In high-resolution images, small patches create massive computational overhead, while in low-resolution scenarios, large patches risk discarding critical, fine-grained details.

Traditional workarounds like data resampling or extensive parameter fine-tuning either destroy the intrinsic physical properties of the sensor data or demand prohibitive computational resources.

Rigid patch tokenization creates conflicts across varying spatial resolutions, frequencies, and local information entropies.

Methods

FlexiMo achieves both dimensional independence and physical consistency by introducing two novel modules on top of a pre-trained ViT backbone (leveraging weights from the DOFA model):

  • Spatial Resolution-Aware Module: To adapt to arbitrary spatial scales without losing information or altering token norms, the authors developed a plug-and-play, parameter-free alignment mechanism. It uses a pseudo-inverse matrix transformation (termed PI-Resize) to mathematically "invert" the norm distortion typically caused by standard bilinear interpolation. This allows the model to dynamically recalibrate its patch embeddings based on the target resolution.
  • Dynamic Channel Adaptation Module: To handle varying numbers of spectral channels, FlexiMo treats the central wavelength of each channel as prior knowledge. A lightweight Transformer-based network processes these wavelengths as an input sequence, dynamically generating custom convolution kernels tailored specifically to the unique spectral characteristics of the input sensor data.
Fig. 2. An illustration of the proposed FlexiMo. FlexiMo can adjust the patch embedding weights of a pretrained model based on the resolution and image size of the input, enabling better adaptation to the data distribution of downstream tasks.
Detailed look at the wavelength-guided dynamic weight generation process.

Datasets

The authors validated FlexiMo across a variety of image-level and pixel-level tasks using five prominent remote sensing benchmarks (summarized in the paper's dataset table):

Summary of the datasets, modalities, and task types used to evaluate FlexiMo.
  • EuroSAT: 27,000 Sentinel-2 multispectral images (13 bands) for scene classification.
  • EuroSAT-SAR: A 2-channel (VV, VH polarization) SAR variant of EuroSAT for scene classification.
  • SegMunich: Sentinel-2 imagery covering Munich for 13-class land cover classification.
  • WHU-Building: High-resolution aerial and satellite imagery (0.3m to 2.5m GSD) for building extraction.
  • GF12MS-WHU: Gaofen-1 and Gaofen-2 imagery used for cloud detection.

Key Insights and Ideas

  • Bilinear Resizing Breaks Embeddings: Simply applying standard bilinear interpolation to patch weights alters the overall token norm, which causes model performance to tank when image sizes change. Inverting the interpolation matrix via a Moore-Penrose pseudo-inverse preserves the original embedding properties perfectly in upsampling scenarios.
  • Wavelengths as Continuous Coordinates: Instead of treating channels as discrete, fixed slots (like standard RGB networks), treating wavelengths as continuous prior coordinates allows a single visual encoder to natively understand completely different sensor configurations—even shifting from 12-band optical data to 2-channel radar data.
  • Granularity Control for Dense Tasks: For pixel-level tasks like segmentation, smaller patch sizes significantly boost the model's sensitivity to fine details (like sharp building edges), whereas larger patch sizes help reduce redundancy in massive high-resolution scenes.

Key Results

FlexiMo achieved state-of-the-art (SOTA) performance across all evaluated downstream tasks:

  • Scene Classification: On the EuroSAT dataset, FlexiMo achieved a SOTA Overall Accuracy (OA) of 99.44% (outperforming baseline models like SatMAE, SpectralGPT, and the original DOFA). Notably, its performance remained stable even when tested on highly downsampled image sizes (e.g., 99.43% OA at 56×56 pixels).
  • Modality Adaptation: On the EuroSAT-SAR dataset, dynamically adjusting the patch size from 16×16 to 8×8 yielded a 3.35% boost in accuracy (improving from 86.36% to 89.71%).
  • Semantic Segmentation: On SegMunich, FlexiMo outperformed the runner-up by 1.4 points, reaching a mean Intersection over Union (mIoU) of 52.7%. On the WHU-Building dataset, it achieved an mIoU of 94.8%. As visualized in the building extraction results, finer patch granularities drastically reduced misclassifications along complex structural boundaries.
Fine-tuning results on the EuroSAT dataset demonstrating FlexiMo's superior accuracy across different patch and image sizes.
Fig. 4. Comparison of segmentation visualizations from models employing different patch sizes on the WHU-Building dataset. As the patch size decreases, the model extracts building edges more effectively.

Limitations and Future Work

Despite its flexibility, FlexiMo has a few limitations:

  • Pre-training Dependency: The dynamic weight generator requires extensive, large-scale pre-training to learn effective spectral priors. If you skip pre-training and attempt to fine-tune FlexiMo directly on a small dataset, it performs worse than a standard Transformer.
  • Compute vs. Accuracy Trade-off: While smaller patch sizes consistently improve dense pixel-level prediction accuracy, they dramatically increase the token sequence length, leading to higher computational overhead during inference.

Future work will likely focus on developing methods to dynamically balance this performance-compute trade-off on the fly.

Summary updated

BibTeX
@misc{li2025fleximo,
  author = {Xuyang Li and Chenyu Li and Pedram Ghamisi and Danfeng Hong},
  title = {{FlexiMo: A Flexible Remote Sensing Foundation Model}},
  year = {2025},
  eprint = {2503.23844},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.23844},
}
Figure