Visual DNA · Distribution Shift · Invariant Learning

Toward Robust Genomic Prediction under Distribution Shifts via Visual DNA Modeling

ShiftGeno renders DNA as structured images and separates invariant biological signals from distribution-specific shortcuts—delivering compact, reliable prediction on low-similarity sequences.

Anonymous submission 2026 Open-source implementation
0.532

Average MCC

18 NT-DS tasks
+16.4%

Relative gain

over the next-best NT-DS model
0.804

Average accuracy

7 GB-DS tasks
1.87M

Total parameters

≈ 1/266 of NT-v2

01 Motivation

Genomic deployment rarely stays in distribution.

Models trained on one sequence length, species, or sequence source must often predict on another. Random and chromosome-based splits can leave locally similar patterns on both sides of the split, obscuring whether a model learned transferable biology or simply recognized familiar sequence context.

Figure 1 Distribution shifts appear when train and test DNA differ in length, species background, or origin.
01

Measure the shift

Rank samples by nearest-neighbor k-mer similarity rather than assuming the original split is challenging.

02

Change the representation

Render one-dimensional DNA into a structured character-grid image with glyph-aligned visual tokens.

03

Separate signal from shortcut

Allocate fused features into invariant and spurious components, then predict from the invariant branch.

02 Method

Read DNA as an image. Learn what stays stable.

ShiftGeno preserves base order in a 256 × 256 character grid, extracts global and contiguous motif evidence, and learns a complementary invariant–spurious feature allocation.

Figure 2 The end-to-end ShiftGeno pipeline, from DNA rendering to invariant prediction.
  1. 01

    Render & tokenize

    Write bases into fixed cells, create 8 × 8 glyph patches, and preserve their sequence position.

  2. 02

    Fuse global & motif context

    A six-layer Conv-Transformer captures broad context while multi-scale convolutions extract contiguous motifs.

  3. 03

    Disentangle & predict

    A feature-wise ratio m creates complementary invariant and spurious branches; only the invariant branch predicts labels.

Image256 × 256 RGB
Tokens1,024 glyph patches
Hidden size128 dimensions
Motif kernels7 & 8 bases

03 Benchmarks

Low similarity is the evaluation target, not an accident.

NT-DS and GB-DS reconstruct established genomic benchmarks to explicitly hold out samples with the lowest nearest-neighbor similarity while preserving the original DNA sequences and labels.

Figure 3 Validation and test samples move to lower-similarity regions in both benchmark families.
NT-DS 18

Nucleotide Transformer tasks

Histone marks, enhancers, promoters, and splice-site classification under low sequence similarity.

  • Average metric: MCC
  • Top-1 Jaccard similarity
  • 16/18 top-two finishes
GB-DS 7

Genomic Benchmark tasks

Human regulatory, enhancer, promoter, coding, and cross-species tasks with varied sequence lengths.

  • Average metric: accuracy
  • Original labels retained
  • 4/7 first- or second-place finishes

Split protocol

Similarity-aware by construction

  1. 1Merge original task splits
  2. 2Estimate top-1 Jaccard similarity with Dashing
  3. 3Reserve the lowest-similarity 20%
  4. 4Stratify evenly into validation and test

04 Results

Higher accuracy with a fraction of the model.

ShiftGeno leads both benchmark families on average. The gains do not come from scale or large-model pretraining: the full end-to-end model contains only 1.87 million parameters.

NT-DS

Average test MCC

0.532
ShiftGeno
0.532
Enformer
0.457
LucaOne
0.405
JanusDNA
0.357
NT-v2
0.347

+16.4% relative improvement over the second-best average.

GB-DS

Average test accuracy

0.804
ShiftGeno
0.804
Enformer
0.752
DNABERT-2
0.691
LucaOne
0.674
NT-v2
0.673

+6.9% relative improvement over the second-best average.

Robustness At 40% masking, ShiftGeno retains 0.511 MCC versus 0.322 for the next-best model.
Efficiency ShiftGeno is ≈266× smaller than NT-v2 and ≈845× smaller than LucaOne.

05 Analysis

The model highlights biological signal and separates representation roles.

Attribution and representation analyses probe what the model uses—not only whether its prediction is correct.

Biological attribution

Known splice-donor patterns emerge from pixel-level evidence.

Integrated Gradients highlights GGTAAG and GGTAAT fragments in positive donor samples. Both contain the canonical GT dinucleotide associated with 5′ splice donor sites, showing that predictions concentrate on plausible local sequence evidence.

Interpretability Green intensity marks base-level attribution; red boxes mark emphasized donor contexts.

Feature disentanglement

Invariant and spurious branches occupy distinct geometries.

Joint t-SNE projections show separation between invariant features zi and spurious features zs across representative NT-DS and GB-DS tasks. The result provides qualitative evidence that the complementary branches learn different roles.

Representation Orange denotes invariant features; green denotes spurious features.

06 Takeaway

Visual DNA offers a compact path to distribution-aware genomics.

ShiftGeno turns genomic modeling into a visual learning problem and explicitly isolates the features that should survive distribution change. The result is stronger low-similarity generalization, perturbation robustness, and biologically meaningful attribution in a 1.87M-parameter model.

Explore the repository