scottclowe nielsr HF Staff gwtaylor commited on
Commit
6353d79
·
verified ·
1 Parent(s): a8cb2b5

Improve CanadianInvertebrates-ML dataset card: metadata, abstract, and sample usage (#2)

Browse files

- Improve CanadianInvertebrates-ML dataset card: metadata, abstract, and sample usage (71824ed8fc696f1da0e9ff2f25c4efbb7fbbb732)
- Update README: fix text, cite, links, remove placeholder (0216252bbafa0ac8657a15bdeef8738ec87fbcd2)


Co-authored-by: Niels Rogge <[email protected]>
Co-authored-by: Graham Taylor <[email protected]>

Files changed (1) hide show
  1. README.md +70 -45
README.md CHANGED
@@ -1,52 +1,56 @@
1
- ---
2
- license: cc-by-3.0
3
- language:
4
- - en
5
- size_categories:
6
- - 100K<n<1M
7
- pretty_name: CanInv-ML
8
- tags:
9
- - DNA_barcode
10
- - Taxonomy
11
- - Biodiversity
12
- - LLMs
13
- - BERT
14
- - Clustering
15
- - Zero_shot_transfer_learning
16
- - Insect
17
- - Species
18
- maintainers:
19
- - https://huggingface.co/pmillana
20
- author:
21
- name: Pablo Millan Arias
22
- github: https://github.com/millanp95
23
- hf: https://huggingface.co/pmillana
24
- dataset_loader_script: dataset.py
25
- dataset_split_names:
26
- - pretrain
27
- - train
28
- - validation
29
- - test
30
- - test_unseen
31
- task_categories:
32
- - feature-extraction
33
- ---
 
 
34
 
35
  # Dataset Card for CanadianInvertebrates-ML
36
 
37
  Alternative names: InvertebratesCanada-ML, CanInv-ML, CanInv-1M, Canada-1.5M
38
 
 
 
 
 
39
 
40
  ### Overview
41
- The CanadianInvertebrates-ML is a machine learning-ready dataset derived from the raw DNA barcodes publiseh in [deWaard et. al, 2019](https://www.nature.com/articles/s41597-019-0320-2). The data is specifically designed and curated for different machine learning tasks in biodiversity analysis: species classification, genus identification of novel species, and BIN reconstruction.
42
 
43
  ### Citation
44
 
45
- If you make use of this dataset and/or its code repository, please cite the following paper:
46
-
47
- ```
48
- cite as:
49
 
 
50
  @misc{arias2025barcodeberttransformersbiodiversityanalysis,
51
  title={BarcodeBERT: Transformers for Biodiversity Analysis},
52
  author={Pablo Millan~Arias and Niousha Sadjadi and Monireh Safari and ZeMing Gong and Austin T. Wang and Joakim Bruslund Haurum and Iuliia Zarubiieva and Dirk Steinke and Lila Kari and Angel X. Chang and Scott C. Lowe and Graham W. Taylor},
@@ -56,11 +60,9 @@ cite as:
56
  primaryClass={cs.LG},
57
  url={https://arxiv.org/abs/2311.02401},
58
  }
59
-
60
-
61
  ```
62
 
63
- ## **Dataset content**
64
 
65
  Each specimen contains the following annotations:
66
 
@@ -75,15 +77,38 @@ Each specimen contains the following annotations:
75
  - **Split and localization**
76
  - `split`: Data partition label (e.g., pretrain, train, test, val, test_unseen)
77
 
78
- ### Sample Usage
 
 
79
 
80
- To-Do
 
81
 
 
 
 
 
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
 
84
  ### Dataset Sources
85
 
86
  - **GitHub:** https://github.com/bioscan-ml/BarcodeBERT
87
- - **Zenodo:** To-Do
88
- - **Kaggle:** ?
89
  - **Paper:** https://arxiv.org/abs/2311.02401
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: cc-by-3.0
5
+ size_categories:
6
+ - 1M<n<10M
7
+ task_categories:
8
+ - feature-extraction
9
+ - text-classification
10
+ pretty_name: CanInv-ML
11
+ tags:
12
+ - DNA_barcode
13
+ - Taxonomy
14
+ - Biodiversity
15
+ - LLMs
16
+ - BERT
17
+ - Clustering
18
+ - Zero_shot_transfer_learning
19
+ - Insect
20
+ - Species
21
+ maintainers:
22
+ - https://huggingface.co/pmillana
23
+ author:
24
+ name: Pablo Millan Arias
25
+ github: https://github.com/millanp95
26
+ hf: https://huggingface.co/pmillana
27
+ dataset_loader_script: dataset.py
28
+ dataset_split_names:
29
+ - pretrain
30
+ - train
31
+ - validation
32
+ - test
33
+ - test_unseen
34
+ library_name: transformers
35
+ ---
36
 
37
  # Dataset Card for CanadianInvertebrates-ML
38
 
39
  Alternative names: InvertebratesCanada-ML, CanInv-ML, CanInv-1M, Canada-1.5M
40
 
41
+ This dataset is used in the paper [BarcodeBERT: Transformers for Biodiversity Analysis](https://huggingface.co/papers/2311.02401).
42
+
43
+ ## Paper Abstract
44
+ In the global challenge of understanding and characterizing biodiversity, short species-specific genomic sequences known as DNA barcodes play a critical role, enabling fine-grained comparisons among organisms within the same kingdom of life. Although machine learning algorithms specifically designed for the analysis of DNA barcodes are becoming more popular, most existing methodologies rely on generic supervised training algorithms. We introduce BarcodeBERT, a family of models tailored to biodiversity analysis and trained exclusively on data from a reference library of 1.5M invertebrate DNA barcodes. We compared the performance of BarcodeBERT on taxonomic identification tasks against a spectrum of machine learning approaches including supervised training of classical neural architectures and fine-tuning of general DNA foundation models. Our self-supervised pretraining strategies on domain-specific data outperform fine-tuned foundation models, especially in identification tasks involving lower taxa such as genera and species. We also compared BarcodeBERT with BLAST, one of the most widely used bioinformatics tools for sequence searching, and found that our method matched BLAST's performance in species-level classification while being 55 times faster. Our analysis of masking and tokenization strategies also provides practical guidance for building customized DNA language models, emphasizing the importance of aligning model training strategies with dataset characteristics and domain knowledge. The code repository is available at this https URL .
45
 
46
  ### Overview
47
+ CanadianInvertebrates-ML is a machine learning-ready dataset derived from the raw DNA barcodes published in [deWaard et. al, 2019](https://www.nature.com/articles/s41597-019-0320-2). The data is specifically designed and curated for different machine learning tasks in biodiversity analysis: species classification, genus identification of novel species, and BIN reconstruction.
48
 
49
  ### Citation
50
 
51
+ If you make use of this dataset and/or its code repository, please cite the following paper:
 
 
 
52
 
53
+ ```bibtex
54
  @misc{arias2025barcodeberttransformersbiodiversityanalysis,
55
  title={BarcodeBERT: Transformers for Biodiversity Analysis},
56
  author={Pablo Millan~Arias and Niousha Sadjadi and Monireh Safari and ZeMing Gong and Austin T. Wang and Joakim Bruslund Haurum and Iuliia Zarubiieva and Dirk Steinke and Lila Kari and Angel X. Chang and Scott C. Lowe and Graham W. Taylor},
 
60
  primaryClass={cs.LG},
61
  url={https://arxiv.org/abs/2311.02401},
62
  }
 
 
63
  ```
64
 
65
+ ## Dataset content
66
 
67
  Each specimen contains the following annotations:
68
 
 
77
  - **Split and localization**
78
  - `split`: Data partition label (e.g., pretrain, train, test, val, test_unseen)
79
 
80
+ ### Sample Usage
81
+
82
+ To use this dataset with the BarcodeBERT model, you can follow the example from the associated GitHub repository:
83
 
84
+ ```python
85
+ from transformers import AutoTokenizer, AutoModel
86
 
87
+ # Load the tokenizer
88
+ tokenizer = AutoTokenizer.from_pretrained(
89
+ "bioscan-ml/BarcodeBERT", trust_remote_code=True
90
+ )
91
 
92
+ # Load the model
93
+ model = AutoModel.from_pretrained("bioscan-ml/BarcodeBERT", trust_remote_code=True)
94
+
95
+ # Sample sequence
96
+ dna_seq = "ACGCGCTGACGCATCAGCATACGA"
97
+
98
+ # Tokenize
99
+ input_seq = tokenizer(dna_seq, return_tensors="pt")["input_ids"]
100
+
101
+ # Pass through the model
102
+ output = model(input_seq.unsqueeze(0))["hidden_states"][-1]
103
+
104
+ # Compute Global Average Pooling
105
+ features = output.mean(1)
106
+ ```
107
+ ### BIOSCAN Datasets for PyTorch
108
 
109
+ CanadianInvertebrates-ML is being incorporated into the [BIOSCAN Datasets for PyTorch project](https://github.com/bioscan-ml/dataset), which provides a standardized way to access and utilize this dataset in PyTorch-based machine learning workflows. You can see the work in progress in [this pull request](https://github.com/bioscan-ml/dataset/pull/61).
110
  ### Dataset Sources
111
 
112
  - **GitHub:** https://github.com/bioscan-ml/BarcodeBERT
113
+ - **Zenodo:** https://doi.org/10.5281/zenodo.15650124
 
114
  - **Paper:** https://arxiv.org/abs/2311.02401