Linné B 50M

Version française plus bas

Linné 50M, a DNA language model trained from scratch on COI barcodes, fine-tuned to write order › family › genus (NCBI taxonomy of 2018-12-01) after a sequence. Its main use is to score how suspicious a label is: −log P(announced order, family, genus | sequence).

These are the five models of the retrospective test of the project. Each model b_pliK never saw any sequence of the insect species of fold K. Fold 1, the one used by the online demo, never saw Cuvierina pacifica and C. cancapae.

Code and protocol: github.com/geekourson/linne.

Usage

pip install torch safetensors huggingface_hub
python3 -c "from huggingface_hub import snapshot_download; print(snapshot_download('billygeekourson/linne-b-50m'))"
python3 <that folder>/exemple.py                     # built-in example: Cuvierina pacifica announced as "Carabus"
python3 <that folder>/exemple.py ACGTACGT... Bombus  # your sequence and an announced genus
from exemple import Linne
m = Linne(pli=1)
m.identifier(seq)            # {'order': ('Pteropoda', 0.9992), 'family': ('Cavoliniidae', 0.9999), 'genus': ('Cuvierina', 1.0)}
m.auditer(seq, "Carabus")    # score_suspicion ≈ 23.8, p_order (Coleoptera) ≈ 5.6e-07

Reading the suspicion score. Measured on 68,192 insect species, each scored by the fold model that never saw it: median 0.37, 90 % below 5.9, 99 % below 10.3.

Files

File Content
b_pli{0..4}.safetensors weights of the five models, about 300 MB each
config_pli{0..4}.json architecture and training recipe
classes_pli{0..4}.json index → NCBI 2018 taxid → name, per rank. They differ by fold: a genus whose species are all in fold K is unknown to model K
model.py, modele_b.py, vocab.py the PyTorch code, the same as in the repository
exemple.py identification and label audit

Architecture

The 16-layer, width-512 trunk of Linné 50M. The 12 lower layers are frozen. Order and family embeddings are injected at layer 12. Three heads (order, family, genus) use a hierarchical softmax: the family is chosen only among those of the given order, and the genus only among those of the given family. The heads were initialised with class prototypes.

Results

model B 8-mer nearest neighbour
genus accuracy, new sequences of known species ≈ 0.90 (five folds: 0.896 to 0.905) 0.967
reclassifications 2018 → 2026 in the top 500 (lift) 3 (1.62) 2 (1.08)
AUROC on reclassifications 0.624 0.603

The difference on reclassifications is not significant (bootstrap 95 % CI of [−3, +6] positives). The striking case: Cuvierina pacifica and C. cancapae, marine snails filed among the ground beetles in 2018. Model B ranks them 49th and 63rd out of 68,673. The simple method ties them with 12,489 other species.

Limitations

  • For identification, the 8-mer nearest neighbour is better. Use this model to flag labels that do not fit the DNA, not to name a specimen.
  • It always answers, even on random DNA. Check first with Linné 50M that the sequence looks like a real, intact COI.
  • It only knows names and classifications as of 2018-12-01.

Linné B 50M (français)

C'est le tronc de Linné 50M, ré-entraîné à écrire ordre › famille › genre (taxonomie NCBI du 2018-12-01) après une séquence COI. Il sert surtout à noter à quel point une étiquette est suspecte.

Ce sont les cinq modèles du test rétrospectif. Le modèle b_pliK n'a vu aucune séquence des espèces d'insectes du pli K. Le pli 1, celui de la démo, n'a jamais vu les Cuvierina.

  • Pour identifier un spécimen, le plus proche voisin 8-mers fait mieux : environ 97 % contre 90 %.
  • Sur les reclassements de 2018 à 2026, il ne fait que légèrement mieux, et l'écart n'est pas significatif.
  • Il répond toujours, même sur de l'ADN aléatoire. Vérifiez d'abord la séquence avec Linné 50M.

Code et protocole : github.com/geekourson/linne. Licence MIT.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support