license: cc-by-3.0
language:
- en
size_categories:
- 1M<n<10M
pretty_name: BIOSCAN-5M
tags:
- Multimodal_dataset
- Large_dcale_dataset
- Image
- DNA_barcode
- Taxonomy
- Biodiversity
- LLMs
- BERT
- Clustering
- Multimodal_retrieval_learning
- Zero_shot_transfer_learning
- Geo_location
- Specimen_size
- Insect
- Species
maintainers:
- https://huggingface.co/Gharaee
author:
name: Zahra Gharaee
github: https://github.com/zahrag
hf: https://huggingface.co/Gharaee
dataset_loader_script: dataset.py
dataset_split_names:
- pretarin
- train
- validation
- test
- val_unseen
- test_unseen
- key_unseen
- other_heldout
Dataset Card for BIOSCAN-5M
Overview
As part of an ongoing worldwide effort to comprehend and monitor insect biodiversity, we present the BIOSCAN-5M Insect dataset to the machine learning community. BIOSCAN-5M is a comprehensive dataset containing multi-modal information for over 5 million insect specimens, and it significantly expands existing image-based biological datasets by including taxonomic labels, raw nucleotide barcode sequences, assigned barcode index numbers, geographical information, and specimen size.
Large-Scale Foundation Model Training
BIOSCAN-5M is partitioned to support both closed-world and open-world biodiversity learning:
Closed-world (train, val, test): Samples with known species names for supervised classification.
Open-world (key_unseen, val_unseen, test_unseen): Placeholder species but known genera, enabling generalization to unseen species.
Novelty detection (other_heldout): Unknown species and genus, suitable for open-set detection.
Pretraining (pretrain): Unlabeled data for self- or semi-supervised learning at scale.
Supported Tasks
Task I: DNA-based Taxonomic Classification Predict taxonomic labels from raw DNA barcode sequences.
Task II: Zero-Shot Transfer Learning Evaluate whether unlabeled models can organize data into semantically meaningful clusters—across modalities like image and DNA—using learned representations.
Task III: Multimodal Retrieval Learning Retrieve matching specimens across modalities (e.g., image ↔ DNA ↔ Text) using shared embeddings.
Citation
If you make use of the BIOSCAN-5M dataset and/or its code repository, please cite the following paper:
cite as:
@inproceedings{gharaee2024bioscan5m,
title={{BIOSCAN-5M}: A Multimodal Dataset for Insect Biodiversity},
booktitle={Advances in Neural Information Processing Systems},
author={Zahra Gharaee and Scott C. Lowe and ZeMing Gong and Pablo Millan Arias
and Nicholas Pellegrino and Austin T. Wang and Joakim Bruslund Haurum
and Iuliia Zarubiieva and Lila Kari and Dirk Steinke and Graham W. Taylor
and Paul Fieguth and Angel X. Chang
},
editor={A. Globerson and L. Mackey and D. Belgrave and A. Fan and U. Paquet and J. Tomczak and C. Zhang},
pages={36285--36313},
publisher={Curran Associates, Inc.},
year={2024},
volume={37},
url={https://proceedings.neurips.cc/paper_files/paper/2024/file/3fdbb472813041c9ecef04c20c2b1e5a-Paper-Datasets_and_Benchmarks_Track.pdf},
}
Dataset Features
Each configuration loads specimen images along with associated metadata fields:
image
RGB JPEG images of individual insect specimens.Metadata fields
- Indexing fields
processid: A unique number assigned by BOLD (International Barcode of Life Consortium).sampleid: A unique identifier given by the collector.
- Taxonomic labels
phylum,class,order,family,subfamily,genus,species: Hierarchical taxonomic classification
- Genetic information
dna_bin: Barcode Index Numberdna_barcode: DNA barcode sequence
- Geographic data
country,province_state: Collection locationcoord-lat,coord-lon: Latitude and longitude coordinates
- Specimen size data
image_measurement_value: Measured image property (e.g., pixel area)area_fraction: Fraction of the image occupied by the specimenscale_factor: Relative size normalization factor
- Split and localization
split: Data partition label (e.g., train, test, val)chunk: Subdirectory label for scalable storage
- Indexing fields
Usage
First, download the dataset.py script to your project directory by running the following command:
wget -P /path/to/your/project_directory https://huggingface.co/datasets/bioscan-ml/BIOSCAN-5M/resolve/main/dataset.py
Once you've downloaded the script, you can use the datasets library to load the dataset. For example:
from datasets import load_dataset
ds = load_dataset("dataset.py", name="cropped_256_eval", split="validation", trust_remote_code=True)
ℹ️ Note: The CSV metadata and image package associated with the selected configuration will be automatically downloaded and extracted to
~/.cache/huggingface/datasets/downloads/extracted/.
📑 Configurations
name |
Available split values |
|---|---|
cropped_256, original_256 |
pretrain, train, validation, test, val_unseen, test_unseen, key_unseen, other_heldout |
cropped_256_pretrain, original_256_pretrain |
pretrain |
cropped_256_train, original_256_train |
train |
cropped_256_eval, original_256_eval |
validation, test, val_unseen, test_unseen, key_unseen, other_heldout |
ℹ️ Note: If you do not specify the
splitwhen loading the dataset, all available splits will be loaded as a dictionary.
Sample Usage
First, download the usage_demo_bioscan5m.py script to your project directory by running the following command:
wget -P /path/to/your/project_directory https://huggingface.co/datasets/bioscan-ml/BIOSCAN-5M/resolve/main/usage_demo_bioscan5m.py
This script demonstrates how to load and visualize samples from the BIOSCAN-5M dataset.
To run the script, execute:
python usage_demo_bioscan5m.py
This will display 10 dataset samples, each showing the organism image on the right, and the corresponding metadata fields on the left, including taxonomic, geographic, genetic, and size-related information.
Dataset Access
To clone this dataset repository, use the following command:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datasets/bioscan-ml/BIOSCAN-5M
Dataset Sources
- Dataset website: https://biodiversitygenomics.net/5M-insects/
- GoogleDrive: https://drive.google.com/drive/u/1/folders/1Jc57eKkeiYrnUBc9WlIp-ZS_L1bVlT-0
- GitHub: https://github.com/zahrag/BIOSCAN-5M
- Zenodo: https://zenodo.org/records/11973457
- Kaggle: https://www.kaggle.com/datasets/zahragharaee/bioscan-5m/data
- Paper: https://arxiv.org/abs/2406.12723

