Papers
Topics
Authors
Recent
Search
2000 character limit reached

BarcodeMamba+: Fungal Barcode Classification

Updated 5 July 2026
  • BarcodeMamba+ is a foundation model using a state-space backbone to classify fungal ITS sequences into hierarchical taxonomic levels in complex, long-tailed distributions.
  • It employs a two-stage pretrain-and-fine-tune paradigm, combining self-supervised learning on unlabeled data with taxonomy-aware fine-tuning mechanisms like hierarchical label smoothing and weighted loss.
  • Benchmark results show it outperforms BLAST, CNN Encoder, and other baselines, achieving up to 81.7% species-level accuracy with efficient inference at 8.0 ms/sample.

Searching arXiv for BarcodeMamba+, BarcodeMamba, and closely related fungal barcode classification work. BarcodeMamba+ is a foundation model for fungal DNA barcode classification from the internal transcribed spacer (ITS) region, built on a state-space model backbone and trained with a pretrain-and-fine-tune paradigm. It is designed to assign ITS sequences to kingdom, phylum, class, order, family, genus, and species in a regime characterized by sparse labels, long-tailed taxa distributions, hierarchical taxonomy, and taxonomic distribution shift. The model combines self-supervised pretraining on unlabeled fungal ITS data with taxonomy-aware fine-tuning enhancements, and on the reported benchmark it outperforms BLAST, CNN Encoder, MycoAI-CNN, MycoAI-BERT, and BarcodeBERT across all taxonomic levels (Gao et al., 17 Dec 2025).

1. Problem domain and biological setting

BarcodeMamba+ addresses fungal DNA barcode classification from ITS, a standard genetic marker for fungal identification and biodiversity monitoring. The task is explicitly hierarchical: each sequence is assigned taxonomic labels at kingdom, phylum, class, order, family, genus, and species. The underlying difficulty is not only multi-class prediction, but prediction over a nested taxonomic structure in which errors at species level may still preserve correct higher-rank assignments.

The reported motivation is strongly tied to the structure of fungal biodiversity data. Up to 93% of collected fungal samples remain unannotated at the species level, so many specimens have only partial labels or lack fine-grained labels altogether. The class distribution is long-tailed, with some taxa well represented and many species rare. The label space is hierarchical rather than flat, and the evaluation regime includes taxonomic distribution shift: the test sets differ from the broad training distribution, especially the Filamentous Fungi set, which has very low overlap with training barcodes. The paper also emphasizes that fungi often have minimalistic morphological features, so identification relies heavily on DNA sequences rather than morphology (Gao et al., 17 Dec 2025).

Within this setting, conventional supervised learning is presented as insufficient because it requires dense labels and does not naturally exploit the large amount of unlabeled sequence data. This motivates a foundation-model approach in which sequence representations are learned first, then adapted to taxonomic prediction.

2. Architectural basis and relation to BarcodeMamba

BarcodeMamba+ is built on the BarcodeMamba state-space model architecture. Its backbone is described as a stack of nn identical blocks, each containing layer normalization, a multi-layer perceptron, and a Mamba-2 mixing layer. The Mamba-2 layer is the core state-space component, and the final hidden states serve as the sequence representation used for classification. The architectural description also states that the Mamba-2 layer maps a dd-dimensional input representation through a pp-dimensional head (Gao et al., 17 Dec 2025).

The model inherits its architectural lineage from BarcodeMamba, which was introduced as a barcode-specific foundation model for DNA sequence modeling in biodiversity analysis. In that earlier formulation, structured state space models were motivated as an alternative to attention-based architectures because attention has quadratic cost in sequence length, whereas SSMs scale sub-quadratically or linearly/near-linearly and can therefore be more efficient for longer contexts. BarcodeMamba specifically emphasized Mamba-2 as a sequence model that integrates the theory of SSMs with attention mechanisms, with the background claim that SSMs can be computed as long convolution during training and recurrence during inference (Gao et al., 2024).

Tokenization is a consequential part of the BarcodeMamba+ design. The model uses Byte-Pair Encoding (BPE) as its main tokenizer, following MycoAI’s recommendation for fungal sequences. The comparison against character-level and kk-mer-based tokenization is summarized by the claim that BPE balances single-nucleotide resolution and motif capture, is vocabulary-efficient, and avoids some kk-mer frame-shift issues. This choice distinguishes BarcodeMamba+ from the earlier BarcodeMamba study, which focused on character-level and kk-mer tokenization for barcode modeling in invertebrates (Gao et al., 17 Dec 2025).

3. Training paradigm and taxonomy-aware optimization

The defining methodological choice in BarcodeMamba+ is a two-stage pretrain-and-fine-tune regime. During pretraining, the model uses unlabeled UNITE+INSD fungal ITS data and learns sequence patterns with next-token prediction; no taxonomic labels are used. During fine-tuning, a classification head is added, and the model is adapted on labeled data with enhancements intended to address hierarchical taxonomy and class imbalance (Gao et al., 17 Dec 2025).

Three fine-tuning modifications are evaluated systematically. The first is hierarchical label smoothing (HLS), described as a taxonomy-aware version of standard label smoothing. Rather than distributing smoothing mass uniformly over all incorrect labels, HLS reduces the penalty when the predicted label is taxonomically close to the true label. Predicting the correct genus but wrong species is therefore treated as less harmful than predicting the wrong family. The reported effect is a consistent performance improvement, with an average gain of +3.3% accuracy; the appendix is said to show significant pp-values across the three test sets for accuracy, precision, and recall. Standard label smoothing is reported not to provide a significant benefit compared with HLS.

The second modification is a weighted loss function for severe class imbalance. The appendix states: “The loss for each sample is weighted by the inverse square root of its class frequency.” In conceptual form,

wc1fc,w_c \propto \frac{1}{\sqrt{f_c}},

where fcf_c is the frequency of class cc. Weighted cross-entropy is then used during fine-tuning. The reported effect is an average +4.1% accuracy improvement, with statistically significant gains on all three test sets.

The third modification is the multi-head output layer from MycoAI. This design predicts all seven taxonomic ranks simultaneously using separate linear output layers. It is contrasted with a single-head baseline that predicts only species and infers higher ranks from a predefined taxonomic matrix. In the reported experiments, however, multi-head outputs yield inconsistent gains and nearly no average benefit when fine-tuning on species-labeled data, with average dd0 accuracy. This establishes that the principal empirical gains come from taxonomy-aware smoothing and imbalance-aware weighting rather than the output-layer factorization (Gao et al., 17 Dec 2025).

The optimization schedule reported for BarcodeMamba+ is summarized below.

Training stage Epochs Learning rate
Fully supervised 7 dd1
Pretrain 15 dd2
Fine-tune 12 dd3

For BarcodeMamba+, CNN Encoder, and BarcodeBERT, optimization uses AdamW with weight decay dd4, dd5, and dd6. Training uses early stopping patience of 3 epochs and a 12-hour time limit (Gao et al., 17 Dec 2025).

4. Data, benchmark construction, and preprocessing

The experiments use the MycoAI splits of the UNITE+INSD data. The training set contains 5.23M sequences and 14.7k distinct species. The hierarchy contains 18 phyla, 70 classes, 231 orders, 791 families, and 3,695 genera, while only 7% of samples are annotated at species level. The validation set contains 10.5k sequences.

Three test sets are used. The Yeast test set contains 4.4k sequences and evaluates a concentrated fungal clade. The Filamentous Fungi test set contains 11.6k sequences and is described as broad, taxonomically distinct, and the most difficult and most shifted benchmark. The MycoAI Benchmark contains 367k sequences and serves as a comprehensive benchmark. Test examples from classes unseen during training are excluded (Gao et al., 17 Dec 2025).

The preprocessed MycoAI dataset applies four filtering steps: duplicate sequence-label removal; length filtering beyond 4 standard deviations from the mean, where mean length is 558.0 bp and standard deviation is 126.2 bp; removal of sequences with more than 5% ambiguous bases; and removal of classes with fewer than 3 samples.

A central aspect of the benchmark is overlap with training barcodes, because the study treats taxonomic distribution shift as a primary evaluation axis.

Test set Sequences Identical barcode overlap with training
Yeast 4.4k 86.73%
Filamentous Fungi 11.6k 6.48%
MycoAI Benchmark 367k 100%

The Filamentous Fungi split is therefore the most stringent generalization test in the reported study. A plausible implication is that performance on this split is especially informative about robustness to unseen or underrepresented taxa.

5. Comparative performance and efficiency

The main empirical claim is that BarcodeMamba+ outperforms all baselines across all taxonomic levels and all three test sets. At species level, the reported accuracies are 80.6% on Yeast, 46.5% on Filamentous Fungi, and 81.7% on the MycoAI Benchmark. Compared with the next-best baseline, CNN Encoder, species accuracy on the MycoAI Benchmark improves from 72.6% to 81.7%, while species accuracy on Filamentous Fungi improves from 31.4% to 46.5% (Gao et al., 17 Dec 2025).

At higher taxonomic levels, BarcodeMamba+ also gives the best reported family and genus results across test sets. On Yeast, family accuracy is 98.7% and genus accuracy is 95.3%. On Filamentous Fungi, family accuracy is 92.6% and genus accuracy is 81.1%. On the MycoAI Benchmark, family accuracy is 99.0% and genus accuracy is 96.5%.

The most consequential comparison is on the Filamentous Fungi split, because it combines severe shift with minimal barcode overlap. On this benchmark, BarcodeMamba+ reaches 46.5% species accuracy, compared with 31.4% for CNN Encoder, 28.2% for MycoAI-CNN, 16.6% for MycoAI-BERT, 27.7% for BarcodeBERT, and 33.4% for BLAST. This suggests better generalization to unseen or rare taxa than both classical sequence matching and transformer-based baselines (Gao et al., 17 Dec 2025).

The model is also described as compact and efficient. BarcodeMamba+ has 12.1M parameters and runs at 8.0 ms/sample. For comparison, BLAST runs at 208.6 ms/sample, BarcodeBERT has 44.6M parameters, and CNN Encoder also has 12.1M parameters but lower accuracy. The reported comparison is therefore not only about predictive quality, but about the efficiency-accuracy tradeoff relevant to large-scale genomics workflows.

6. Ablations, scaling behavior, limitations, and extensions

The ablation study isolates two distinct questions: whether pretraining is preferable to fully supervised training from scratch, and which fine-tuning modifications contribute most. Across tokenizers, pretraining improves performance, and BPE is the best tokenizer in BarcodeMamba+. The best results are obtained with the pretrain-and-fine-tune regime plus BPE. In the second ablation, hierarchical label smoothing and weighted loss emerge as the strongest contributors, while the multi-head output yields mixed and often negligible effect (Gao et al., 17 Dec 2025).

The scaling study uses the default configuration of pretrain + fine-tune, BPE tokenizer, hierarchical label smoothing, weighted loss, and multi-head output. The reported finding is that genus- and species-level performance is sensitive to model capacity, accuracy peaks at around 50M parameters, and performance degrades at 140M parameters for species-level tasks. This is interpreted as evidence that scaling helps up to a point, but overly large models may overfit fine-grained fungal classification.

This scaling behavior is consistent with the broader BarcodeMamba line of work. In the earlier invertebrate study, BarcodeMamba with Mamba-2 was shown to outperform BarcodeBERT with only 8.3% as many parameters in one comparison, to reach 99.2% species-level accuracy in linear probing without fine-tuning for seen species, and in the scaling study to achieve 70.2% genus-level accuracy in 1-nearest-neighbor probing for unseen species using 63.6% of BarcodeBERT’s parameters (Gao et al., 2024). The fungal BarcodeMamba+ results therefore fit within a broader argument that SSM backbones can be both efficient and expressive for barcode-specific biodiversity analysis.

The reported limitations are specific rather than generic. Model capacity has limits, since very large models can degrade species-level performance. Multi-head outputs were not uniformly beneficial, so hierarchical output design may require refinement. Taxonomic distribution shift remains difficult, especially for extremely underrepresented taxa. The authors also suggest extensions to other markers, including COI for insects and rbcL for plants, and future integration with imaging, environmental data, and other multimodal biodiversity sources (Gao et al., 17 Dec 2025).

From the reported evidence, BarcodeMamba+ occupies a specific methodological position in fungal biodiversity research: an SSM-based foundation model that combines self-supervised pretraining, taxonomy-aware fine-tuning, and class-imbalance correction to address sparse labels, long-tailed taxa, and hierarchical supervision under distribution shift.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to BarcodeMamba+.