Skip to publication

15 min read

GeoSANE — generating geospatial models from weights

GeoSANE argues that geospatial pretraining need not begin with satellite data: knowledge distributed across existing models can be learned in weight space and regenerated for a chosen architecture. On fMoW, its generated ViT-L reaches 58.9 versus 35.7 from scratch under matched fine-tuning. Model collections could therefore become training corpora rather than competing endpoints.

Trace a checkpoint through tokenization and reconstruction, compute how the loss mixture changes training pressure, and diagnose how prompt-conditioned sampling preserves architecture while replacing its initialization.

Contents

Models as training data

Why learn across existing checkpoints instead of selecting or merging one?

The running example asks one initialization to combine radar-relevant geospatial structure, dense-prediction structure, and a Swin-B backbone. Yet the paper describes remote-sensing models as specialists across sensors, resolutions, and objectives, with complementary rather than unified capabilities. No single checkpoint is therefore guaranteed to cover all three.

The obvious move is model selection: find the checkpoint closest to the flood task and fine-tune it. That preserves one model’s complete parameterization, but it also accepts that model’s particular trade-off. A radar specialist can use a different architecture; a Swin-B checkpoint can lack radar specialization. Because the collection’s capabilities are complementary rather than unified, selecting one endpoint cannot combine information distributed across several specialists.

Direct merging looks like the next obvious attempt. If two checkpoints share aligned parameter slots, their weights can be combined in parameter space. But heterogeneous checkpoints do not provide that alignment: a Swin block, a convolutional block, and a task head divide computation into different tensors. The merging methods discussed by the paper generally assume a shared architecture and initialization, precisely the constraints this collection violates. Forcing an average would therefore confuse structural incompatibility with knowledge transfer.

GeoSANE changes what counts as the dataset. Its filtered collection contains 103 remote-sensing models with about 38 billion parameters, spanning foundation and task-specific checkpoints. A weight corpus is this population treated as training examples rather than as candidates from which one winner must be chosen. The corpus supplies inputs for learning a shared representation of neural-network weights. Because the representation is learned across the population, GeoSANE is designed to capture relationships among models without requiring them to share an architecture or initialization.

That reframes the Swin-B prompt: it can specify the requested backbone while the learned weight representation supplies information drawn from a broader geospatial population. But calling checkpoints a corpus does not make their raw tensors uniform. The collection includes ViTs, Swins, ResNets, UNets, detectors, and multimodal models; these expose different layer shapes and parameter counts. They still cannot enter one sequence model directly.

Weight tokenization

How are incompatible checkpoint tensors converted into uniform tokens T\mathbf{T} without confusing padding with parameters?

Take a Swin-B checkpoint: flattening its layer tensors would produce a scalar sequence, but the stream would no longer mark where one layer ends and the next begins. Checkpoints with different parameter counts would also produce different lengths. GeoSANE therefore needs uniform token vectors that retain layer provenance and support fixed-size batches; its sequence representation handles models of different lengths, architectures, and sizes.

GeoSANE first reshapes each layer’s weights into a two-dimensional matrix, keeping the layer as the unit of organization. It then splits those matrices into fixed-width vectors. If a matrix portion is too large, splitting produces several vectors; if the final portion is too short, zero padding fills the unused coordinates. Concatenating the vectors produces the weight token sequence T\mathbf{T}. Fixed width standardizes each token, while splitting lets the full sequence remain as long as the checkpoint requires.

Fixed width alone does not recover provenance. Each token therefore receives positional metadata recording its absolute sequence position, layer index, and position within that layer. For the Swin-B prompt, two equal-looking vectors from different attention blocks remain distinguishable because their metadata differs.

Models still produce sequences of different lengths, so GeoSANE divides each sequence into fixed-length chunks called windows. Windows make batch dimensions agree without requiring a ResNet, ViT, and Swin checkpoint to contain the same parameter count. Processing chunks also avoids forcing an entire large checkpoint through the encoder-decoder at once; the sequence can be reconstructed window by window.

Padding now creates a bookkeeping hazard. A padded zero has the same numeric value as a genuine learned parameter equal to zero. If both entered reconstruction error, the decoder would be trained to reproduce storage introduced by tokenization rather than only model weights.

The parameter mask M\mathbf{M} resolves that ambiguity. Its value is 11 at every real parameter coordinate and 00 at every padded coordinate. Reconstruction differences are multiplied by this mask, so changing a prediction at padding contributes exactly nothing to the loss; changing a prediction at a genuine zero-valued parameter still contributes normally. Padding standardizes shape, and the mask compensates by removing those added coordinates from the training target.

Combined with per-layer tokenization, positional metadata, and fixed-length windows, this yields a unified sequence format while retaining layer and within-layer provenance. But reconstruction alone can be minimized by copying each input. It does not determine how two views of the same model or checkpoints from different models should be arranged in latent space.

Shared latent objective

How do reconstruction loss Lrec\mathcal{L}_{rec} and contrastive loss Lc\mathcal{L}_{c} jointly shape latent representation Z\mathbf{Z}?

Suppose the tokenized Swin-B checkpoint is reconstructed almost perfectly, window by window. That sounds sufficient, but the encoder could merely preserve enough local detail to copy each chunk. Nothing in that task requires two views of the same checkpoint to occupy nearby regions of latent representation, or checkpoints from different models to remain distinct. Accurate copying alone therefore leaves the model-level geometry unspecified.

reconstruction loss supplies the copying pressure. The decoder reconstructs each real weight token, and the squared difference from the original contributes to the error. parameter mask multiplies padded positions by 00, so reducing error on invented padding cannot improve the objective; only actual checkpoint parameters count.

contrastive loss supplies the missing model-level pressure. GeoSANE creates two views of one model—the original token sequence and a noised copy—then passes both through the encoder and projection head. The NT-Xent criterion, a batch contrastive loss, pulls their projected embeddings together while keeping them distinct from embeddings of other models. Noise can alter local values, but model identity should survive.

(1γ)Lrec+γLc(1 - \gamma)\mathcal{L}_{rec} + \gamma\mathcal{L}_{c}
The training objective gives reconstruction weight 1γ1-\gamma and contrastive weight γ\gamma; increasing one necessarily decreases the other because their coefficients sum to 11.

The balance matters. At γ=0\gamma=0, training rewards parameter fidelity but provides no contrastive force organizing checkpoints. At γ=1\gamma=1, the objective ignores reconstruction, so nearby embeddings need not decode into faithful Swin-B weight chunks. Intermediate values ask latent representation to retain decodable parameters while making model identity stable under noise. GeoSANE is trained with this combined reconstruction and contrastive guidance rather than either term alone.

Loss mixture across reconstruction error

As γ\gamma rises, the curve flattens: reconstruction error contributes less while the held contrastive term contributes more.

Loss mixture across reconstruction error: live curves controlled by Contrastive mixture weight gamma-0.080.210.50.791.0800.250.50.751
Combined lossReconstruction loss Lrec\mathcal{L}_{rec}
Combined objective

This isolates the published mixture with Lc=0.6\mathcal{L}_{c}=0.6 held at the selected illustrative value, both losses shown on a common scale, and masking already included inside Lrec\mathcal{L}_{rec}. It is not the complete training process.

The two losses pressure the latent space to preserve real parameters and organize models at once. But the objective leaves a concrete problem unresolved: how does generation select a region whose decoded weights match the requested Swin-B architecture?

Prompt-conditioned generation

How does a prompt model constrain architecture while allowing GeoSANE to generate different weights w~\widetilde{\mathbf{w}}?

For Sen1Floods11, sampling anywhere in the shared latent space has no Swin-B-specific anchor: the decoder might produce a sequence associated with another tensor layout. The obvious safe alternative is to copy the ImageNet-pretrained Swin-B prompt, but that preserves both its architecture and its existing initialization. One attempt risks incompatible weights; the other generates nothing new. GeoSANE needs the prompt to constrain structure without forcing every parameter to remain equal to the prompt.

GeoSANE first tokenizes prompt-model weights from the ImageNet-pretrained Swin-B and passes the resulting weight token sequence through the weight encoder. The prompt is therefore not an example to copy after generation. It supplies an architectural reference and a location from which generation can begin.

The encoder output is prompt latent representation, the prompt’s address in the learned weight space. GeoSANE fits a kernel density estimator around that address. A kernel density estimator, or KDE, builds a local probability distribution from nearby latent values rather than assuming one fixed parametric shape. GeoSANE then samples from this local distribution. Locality is the compromise: every sample remains near the prompt’s structurally similar region, but it need not equal the prompt’s latent representation. The sampled point can therefore carry a different parameter configuration shaped by the geospatial model collection used to train the latent space.

The weight decoder maps each sampled latent point to candidate weight tokens. Detokenization then places those token values back into the tensor layout specified by the Swin-B prompt, producing generated model weights. The compensating constraint is explicit: parameter values change, while the architecture—including its layer arrangement and tensor structure—remains that of the prompt. GeoSANE can generate several such candidates because sampling and decoding require only forward passes; the paper describes selecting candidates by a simple performance criterion before fine-tuning.

The resulting backbone can be loaded into the Sen1Floods11 segmentation pipeline, but loading proves only structural compatibility. It does not show that the new initialization contains useful geospatial structure, beats the unchanged ImageNet prompt, or improves on random initialization. Those claims require the same Swin-B architecture and equal fine-tuning conditions for all three starting points.

Generated initialization tests

Which comparisons distinguish transferred geospatial structure from architecture, prompt pretraining, merging, or compression effects?

In the Sen1Floods11 example, GeoSANE-generated weights and the ImageNet-pretrained prompt are evaluated with Swin-B backbones under the same fine-tuning budget. A strong score therefore leaves several explanations open: Swin-B may simply fit the task well, ImageNet pretraining may supply useful features, or downstream training may erase differences between starting weights. Comparing only against random initialization is the obvious test, but it cannot separate those alternatives.

The first control locks the architecture and training duration. GeoSANE-generated models are compared with randomly initialized models of identical architecture, fine-tuned for the same number of epochs under similar conditions. This asks whether the generated initialization contributes anything beyond Swin-B and ordinary task training. The experiments fine-tune generated models for 5050 epochs with AdamW and select the final checkpoint by validation loss. A second control starts from the unchanged ImageNet-pretrained Swin-B prompt and gives it the same 5050-epoch fine-tuning budget as the generated Swin-B. That comparison is stricter: architecture and prompt pretraining are now shared, while the initial parameter values differ.

Selection needs separate accounting. GeoSANE can generate several candidates and retain the top candidates using a performance criterion before fine-tuning. If scratch and prompt baselines do not receive an equivalent selection opportunity, the comparison measures the complete generation-and-selection procedure, not only geospatial structure in the sampled weights. The matched controls still answer a useful operational question—whether that procedure supplies a better starting point—but they do not assign every gain to one causal component.

The remaining comparisons attack different substitutes. Existing remote-sensing foundation models test whether generated weights compete with conventional large-scale pretraining. DARE merges pairs of foundation models and is compared with a GeoSANE model of the same architecture, testing direct parameter combination as an alternative explanation. Lightweight experiments compare generated ResNet-18 and MobileNetV2 weights with magnitude pruning, variational dropout, and knowledge distillation. The ResNet-18 comparisons use 1111 million parameters; for MobileNetV2, pruning retains about 55 million nonzero parameters, while GeoSANE and distillation use 3.53.5 million. These experiments cover classification, segmentation, and object detection. Gains across these controls support GeoSANE as a useful initialization procedure, but exceptions and ablations without remote-sensing weights determine how far that conclusion extends.

Evidence and scope

What do the benchmark and ablation results establish about learning geospatial knowledge from weights?

The generated Swin-B improves flood segmentation, but one score cannot reveal whether the gain is broad or merely a favorable task. Even a broad leaderboard leaves a second ambiguity: generation might preserve generic computer-vision structure without learning anything specific to geospatial models. The evidence needs both matched controls and an intervention on the weight corpus.

The matched scratch comparison holds architecture and fine-tuning duration constant, removing the obvious explanation that GeoSANE simply received a stronger backbone or more optimization. Under those conditions, generated initializations outperform scratch across all ten reported datasets. In the running example, direct fine-tuning of the ImageNet-pretrained Swin-B prompt scores 85.285.2 on Sen1Floods11, while the generated initialization scores 89.689.6 under the same 5050-epoch budget. That establishes an initialization gain beyond both random weights and the unchanged prompt; it does not yet identify where that gain came from.

The remote-sensing ablation supplies the missing intervention. GeoSANE first generates from a latent space trained only on general computer-vision weights, then from the same system after training on remote-sensing weights; downstream fine-tuning is identical. The computer-vision-only outputs perform similarly to their ImageNet prompts, whereas adding remote-sensing weights improves every reported task, including Sen1Floods11 from 86.086.0 to 89.689.6. Architecture-compatible generation alone therefore does little beyond the prompt. The improvement appears when geospatial checkpoints change the learned weight space.

The opening claim therefore closes narrowly. GeoSANE uses a heterogeneous remote-sensing model collection as training data for a shared weight representation. Under matched architecture and fine-tuning conditions, its generated initializations beat scratch across ten datasets, and adding remote-sensing weights yields gains beyond computer-vision-only generation. These experiments establish reuse of knowledge carried by existing checkpoints; they do not establish that data pretraining can be removed from the larger ecosystem.

Transfer set

Put the pieces together

These questions combine mechanisms from more than one section. Work from the causal chain before opening the answer.

  1. 01

    The requested backbone changes from Swin-B to ViT-L, while the heterogeneous checkpoint corpus stays the same. How do weight tokenization and prompt-conditioned generation still produce architecture-compatible weights rather than forcing the corpus models to share the requested architecture?

    Show answer

    Tokenization converts every checkpoint into fixed-width T\mathbf{T} with positional metadata and uses M\mathbf{M} to exclude padding, so heterogeneous models can train one shared representation without aligned tensors. GeoSANE then encodes the ViT-L prompt into Za\mathbf{Z}_a, samples locally around that address, decodes the sample, and detokenizes it into the prompt’s ViT-L tensor layout. The corpus shapes the generated parameter values, while the prompt supplies the requested architecture.

  2. 02

    Suppose padded coordinates are mistakenly marked as real in M\mathbf{M}. Combine the tokenization, joint-objective, and generation mechanisms to trace what changes and what remains protected.

    Show answer

    Those coordinates would enter Lrec\mathcal{L}_{rec}, so the encoder-decoder would spend reconstruction pressure reproducing tokenization storage rather than only checkpoint parameters. Lc\mathcal{L}_{c} could still organize views by model identity, but it would not correct the corrupted coordinate-level target. Prompt-conditioned detokenization would still restore the requested architecture, yet the learned representation would have a weaker basis for generating faithful parameter values because reconstruction had included padding.

  3. 03

    Matched fine-tuning shows that a generated model beats scratch and its unchanged prompt, but generation from computer-vision-only weights stays near the prompt and one lightweight comparison is lost. What combined conclusion follows about the throughline and the hook?

    Show answer

    The matched controls rule out architecture, ordinary fine-tuning, and unchanged ImageNet pretraining as sufficient explanations for the gain. The corpus ablation then identifies the missing cause: remote-sensing checkpoints reshape the shared latent space, so local sampling around the prompt can produce architecture-compatible weights with additional geospatial structure. The lightweight loss sets the boundary. This closes the hook concretely: incompatible checkpoints become useful training examples through uniform tokenization, a jointly organized latent representation, and prompt-constrained decoding, making model collections reusable geospatial training corpora without showing that generated weights replace every compression method or all satellite-data pretraining.

References

  1. [1]
    However, despite their success, the landscape of remote sensing foundation models (RSFMs) remains fragmented: each model specializes in a subset of sensors, spatial resolutions, or objectives, with many models being complementary and some being more comprehensive than others.
  2. [2]
    Nonetheless, most of these techniques assume that all models share the same architecture and initialization. In contrast, GeoSANE is designed to encapsulate the knowledge of a large collection of remote sensing models, regardless of their architecture or initialization, overcoming key limitations of prior model merging methods.
  3. [3]
    After filtering, the final collection contains 103 (foundation) remote sensing models, representing approximately 38 billion parameters.
  4. [4]
    This model collection serves as the training dataset for GeoSANE, i.e., as input to learn a shared latent representation of neural network weights.
  5. [5]
    GeoSANE is designed to automatically load and process a wide variety of architectures, including Transformer-based backbones (ViT, Swin, etc.), CNNs (ResNet, UNet, MobileNet, etc.), multimodal radar-optical models, YOLO-style detectors, task-specific models for floods and wildfires, and vision-language models.
  6. [6]
    The core idea of~\cite{Schrholt2024TowardsSA} is to tokenize model weights and express an entire model as a sequence of token vectors. Using such a configuration allows the encoder-decoder backbone to learn representations on chunks of the sequences, and therefore enables generating model sequences of different lengths, underlying architectures, and sizes.
  7. [7]
    To that end, the weights w\mathbf{w} of models in the model collection are loaded and reshaped into 2D matrices per layer, then divided into fixed-size tokens Tn\mathbf{T}_n of size dtd_t. Zero padding or splitting is applied where needed to ensure uniform dimensions, and a binary mask M\mathbf{M} is included to distinguish real parameters from padding.
  8. [8]
    Each token is augmented with a 3D positional embedding P=[n,l,k]\mathbf{P}=[n,l,k] indicating absolute sequence position nn, layer index ll, and within-layer position kk.
  9. [9]
    For training, the tokenized model weights are divided into fixed-length chunks of a specified size (referred to as window) to allow uniform batch sizes and to efficiently process architectures of varying parameter counts. This representation allows processing models of different sizes and architectures in a unified sequence format.
  10. [10]
    Here, the mask M\mathbf{M} is used to separate real parameters with 11 from padding with 00, ensuring that the loss is only computed on actual weights.
  11. [11]
    The contrastive term uses two augmented views i,ji,j of the same model: the first is the original token sequence, while the second is a noised version of it. Both views are processed through the encoder and projection head pϕp_{\phi}, and the NT-Xent loss encourages their projected embeddings to be close in latent space while remaining distinct from embeddings of other models.
  12. [12]
    \mathcal{L} &= (1 - \gamma)\mathcal{L}{rec} + \gamma \mathcal{L}{c}.
  13. [13]
    The model is optimized using a combination of reconstruction loss and contrastive guidance, as described in Section~\ref{sec:methods}.
  14. [14]
    Given a \textit{prompt model} aa (e.g., an ImageNet-pretrained ViT-L or Swin-B from the \texttt{timm} library~\cite{rw2019timm}), we tokenize and encode its weights wa\mathbf{w}_a into the latent space to obtain a latent representation Za=gθ(Ta)\mathbf{Z}_a = g_{\theta}(\mathbf{T}_a).
  15. [15]
    We then fit a Kernel Density Estimator (KDE) around Za\mathbf{Z}_a and draw samples z~\tilde{\mathbf{z}} from this local distribution. This sampling procedure explores nearby regions in the latent space that are structurally similar to the prompt, while being shaped by the geospatial knowledge captured during training.
  16. [16]
    Each sampled latent representation z~\tilde{\mathbf{z}} is decoded using the decoder to produce synthetic weight tokens T~=hψ(z~)\tilde{\mathbf{T}} = h_{\psi}(\tilde{\mathbf{z}}), which are subsequently de-tokenized into neural network weights w~\tilde{\mathbf{w}}. The resulting neural network shares the architecture of the \textit{prompt model} but differs in the actual parameter values, producing a network that is ready for fine-tuning on the target downstream task.
  17. [17]
    Sampling in latent space is inexpensive, as both sampling and decoding require only forward passes. This makes it feasible to generate multiple candidate models and select top-mm candidates according to a simple performance criterion before fine-tuning.
  18. [18]
    Comparison between finetuning GeoSANE-generated models vs. direct finetuning of the models used as prompts for GeoSANE (ImageNet-pretrained ViT-L for classification and Swin-B for segmentation and detection). Both versions receive the same finetuning budget of 50 epochs.
  19. [19]
    Table \ref{tab:scratch_vs_geosane} compares models generated by GeoSANE with randomly initialized ones of identical architectures and finetuned for the same number of epochs, under similar conditions.
  20. [20]
    For downstream evaluation, all generated models are fine-tuned for 50 epochs\footnote{We finetune all models for 50 epochs for fair comparison, although performance usually saturates earlier (Fig~\ref{fig:conv_rates}).} using AdamW as the optimizer. We select the final checkpoint based on the lowest validation loss and report its corresponding test performance.
  21. [21]
    For classification tasks we use ViT-L backbones, and for segmentation and detection tasks we use Swin-B. As shown in Table \ref{tab:sota_comparison}, GeoSANE achieves the best or second-best results across ten benchmarks, matching or surpassing RSFMs.
  22. [22]
    We therefore merge pairs of remote sensing foundation models using the DARE (\textbf{D}rop \textbf{A}nd \textbf{RE}scale)~\cite{Yu2023LanguageMA} method and compare the resulting merged models to GeoSANE-generated models of the same architecture.
  23. [23]
    Comparison of GeoSANE with pruning and distillation baselines. For \textit{Magnitude Pruning} and \textit{Variational Dropout}, we prune pretrained Remote Sensing Foundation Models (RSFMs) (ScaleMAE~\cite{Reed2022ScaleMAEAS} and SatMAE~\cite{Cong2022SatMAEPT}) and an ImageNet(IN)-pretrained ViT-L to obtain versions with approximately 11M non-zero parameters (ResNet-18) and 5M (MobileNetV2) non-zero parameters. For \textit{Knowledge Distillation}, the same RSFMs and the ImageNet ViT-L act as teachers, and the student networks are ResNet-18 models with 11M parameters or MobileNetV2 with 3.5M parameters. GeoSANE directly generates models of the target architecture and size.
  24. [24]
    We evaluate models generated by GeoSANE on a diverse set of downstream tasks, covering classification, segmentation, and object detection across multiple modalities.
  25. [25]
    Sen1Floods11 & 85.2 & \textbf{89.6} &\small \textcolor{green!60!black}{+4.4} \
  26. [26]
    Across ten diverse datasets, GeoSANE consistently outperforms training from scratch, with particularly large gains on more challenging, heterogeneous datasets such as fMoW and BigEarthNet, which contain many classes and fine-grained labels. These results show that GeoSANE can serve as an effective initializer for remote sensing models, across various modalities.
  27. [27]
    When comparing Table~\ref{tab:cv_vs_rs_finetune} with the results in Table~\ref{tab:anchor-model} (models prompt vs. GeoSANE-generated models), we observe that models generated without remote sensing fine-tuning (\texttt{CV-only}) perform similarly to their ImageNet-pretrained model prompts. Since these model prompts are themselves ImageNet models, the latent space trained only on computer vision models provides limited additional benefit. In contrast, with additional training on remote sensing model weights \texttt{CV+RS}, GeoSANE-generated models clearly outperform their model prompts.
  28. [28]
    & fMoW & 15.2 & 16.7& 20.5& 16.5& 17.8& 17.4& \underline{23.2}& \textbf{25.5}& 22.1& 17.7 & \textcolor{red!80!black}{-7.8}\