bio.rodeo
ModelsOrganizationsProvidersLeaderboardAboutSign in
bio.rodeo

The authoritative source for evaluating biological foundation models. No hype, just honest analysis.

Categories
  • DNA & Gene
  • RNA
  • Protein
  • Small molecule
  • Single-cell
  • Spatial omics
  • Pathology
  • Imaging
  • Metabolomics
  • Biosignals
  • Language model
bio.rodeoModelsOrganizationsProvidersLeaderboardAboutFAQSubmit a modelContact
© 2026 Pulsatance. All rights reserved. ~
Built by Pulsatance
models / dna-gene / panspace
DNA & Gene
Bielefeld UniversityComenius University BratislavaReleased March 2025

PanSpace

Bacterial genome encoder that renders draft assemblies as Chaos Game Representation images and embeds them for nearest-neighbour species search.

The short version

  • —Identifies the species of a draft assembly by nearest neighbour in a vector index
  • —Turns k-mer counts into a Chaos Game Representation image that a CNN reads as pixels
  • —Indexes 1.6 million bacterial assemblies in 1.6 GB, small enough to query on a laptop
  • —Triplet-loss metric learning pulls same-species assemblies together in embedding space
  • —Convolution kernels are aligned to the k-mer suffix blocks the representation creates
84Openness0Citations
22GitHub stars
GPL-3.0License

Where to run it

No providers recorded yet. Browse all providers

PanSpace is a convolutional encoder that maps a bacterial genome assembly to a single dense vector, so that species identification becomes a nearest-neighbour lookup in an embedding index rather than a sequence alignment. It was built by the algorithmic bioinformatics group at the University of Milano-Bicocca with collaborators at Bielefeld University and Comenius University Bratislava, and posted to bioRxiv in March 2025.

The problem it targets is resource cost, not accuracy. Bacterial genome collections have outgrown BLAST-style alignment outside a compute cluster, and the alignment-free sketching tools that replaced it still need tens of gigabytes of RAM and disk to index a resource such as AllTheBacteria. PanSpace discards the sequence after a single pass: an assembly is reduced to its k-mer counts, those counts are laid out as an image, and a small CNN compresses that image into a fixed-length embedding. The encoder weighs 1.1 MB, and the resulting index is small enough to query on a laptop.

The design is deliberately narrow: PanSpace embeds whole assemblies for taxonomic search, not arbitrary DNA sequences, and offers none of the variant-effect capabilities of genomic language models. Within that scope, the released encoders apply to new draft assemblies without retraining.

#Key Features

  • Chaos Game Representation input: Genome k-mer counts are placed in a 2^k × 2^k frequency matrix in which k-mers sharing a suffix occupy contiguous sub-squares, turning a genome into a greyscale image with real spatial structure.
  • Suffix-aware convolutions: The ConvFCGR layer sets its kernel and stride to match those sub-squares, so each output cell aggregates exactly the k-mers sharing a given suffix rather than an arbitrary pixel neighbourhood.
  • Metric learning, not classification: Training uses a semi-hard triplet loss on species labels, so Euclidean distance in the embedding space reflects species identity directly and retrieval needs no output layer over a fixed label set.
  • FAISS-backed querying: Embeddings go into a FAISS index that scales to billions of vectors; embedding 1,000 assemblies takes about one second, and k-mer counting dominates the rest.
  • Released encoder and index pairs: Zenodo packages bundle a Keras encoder, a prebuilt FAISS index, and the label list, in variants spanning 6-, 7-, and 8-mers and embedding dimensions of 128, 256, and 512.

#Technical Details

The encoder, CNNFCGR, stacks two ConvFCGR layers with 4k filters each, flattens, and projects to an n-neuron dense layer with L2 normalisation, so embeddings lie on the unit sphere and Euclidean distances fall in [0, 2]. FCGR matrices are rescaled to [0, 1] by their maximum and clipped at the 80th percentile to stop overrepresented k-mers from dominating. Training uses the Rectified Adam optimiser at a learning rate of 0.001 for up to 100 epochs with early stopping, on semi-hard triplets only — switching to hard triplets after semi-hard training degraded results. The headline configuration uses 8-mers and 256-dimensional embeddings, trained on high-quality AllTheBacteria assemblies restricted to species with at least 13 examples — 1,841,109 assemblies in total, of which 1,656,597 were indexed and 184,512 held out as queries. That index occupies 1.6 GB and 7.0 GB of peak RAM to build, against 13-75 GB of disk and 40-154 GB of RAM for the three sketching modes of GSearch, the most accurate competing tool. Querying 1,000 held-out assemblies on 48 CPU threads takes 2 minutes 28 seconds at 3.7 GB peak RAM, versus 5 minutes and 81.2 GB for the best GSearch configuration. Macro-averaged species-level precision, recall, and F1 are 0.993, 0.990, and 0.991 against 0.996, 0.995, and 0.995 for that configuration; at genus level PanSpace reaches 0.999 on all three.

#Applications

The intended users are clinical microbiology and food-safety labs that need to name the organism in a draft assembly quickly and locally. Because the index and encoder fit in a couple of gigabytes, a field or hospital lab can classify isolates without shipping data to a cluster, and the same machinery supports similarity search over pangenome collections for surveillance and strain tracking. The library can also train new encoders on other labelled genome collections, or as an autoencoder when labels are unavailable.

#Impact

PanSpace shows that a learned embedding can substitute for genome sketching in taxonomic indexing at a fraction of the resource cost, within a few thousandths of the leading tool's accuracy. The tradeoff is not free: index construction took about 43 hours against 7.5 hours for the fastest GSearch mode, and generating the intermediate FCGR matrices for AllTheBacteria needs 480 GB of scratch space at k = 8 — a one-time cost borne by whoever builds an index, not whoever queries it. The code is GPL-3.0 licensed and the pretrained encoders, indexes, and data splits are archived on Zenodo under CC BY 4.0, so the full pipeline can be reproduced or rebuilt for a different reference database.

At a glance

Released
March 2025
Category
DNA & Gene
License
GPL-3.0
Organizations
Bielefeld University / Comenius University Bratislava

Related models

  • PathogenFinder2

    Technical University of Denmark / Technical University of Munich / Bristol Myers Squibb

  • SPACE (Species-Profile Adaptive Collaborative Experts)

    Renmin University of China

  • WGRL

    University of Toronto

  • CReadNet

    Uppsala University / Science for Life Laboratory

  • BGC-Finder

    Huazhong University of Science and Technology

Links

GitHub RepositoryResearch PaperDataset

Tags

bacteriacnncontrastive_learningsequence_searchtaxonomic_classification

Something wrong?

Much of this page is generated or calculated automatically. Flag anything that looks off and we will re-run it.