{"id":50796678,"url":"https://github.com/Imageomics/bioclip-2","last_synced_at":"2026-06-29T21:01:15.429Z","repository":{"id":298519005,"uuid":"991449538","full_name":"Imageomics/bioclip-2","owner":"Imageomics","description":"Repository for the BioCLIP 2 model project. [NeurIPS'25 Spotlight] BioCLIP 2 is a biological foundation model trained on TreeOfLife-200M. Despite the narrow training objective, BioCLIP 2 yields extraordinary accuracy when applied to various biological visual tasks such as habitat classification and trait prediction.","archived":false,"fork":false,"pushed_at":"2026-05-20T23:57:45.000Z","size":22825,"stargazers_count":67,"open_issues_count":2,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-21T05:59:24.463Z","etag":null,"topics":["biology","clip","computer-vision","imageomics","knowledge-guided-machine-learning","taxonomy"],"latest_commit_sha":null,"homepage":"https://imageomics.github.io/bioclip-2/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Imageomics.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":".zenodo.json","notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-27T16:34:03.000Z","updated_at":"2026-05-20T23:57:50.000Z","dependencies_parsed_at":"2025-06-11T15:03:13.678Z","dependency_job_id":"7bb0a644-c0f6-4c7b-8c16-b456e6c004c6","html_url":"https://github.com/Imageomics/bioclip-2","commit_stats":null,"previous_names":["imageomics/bioclip-2"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Imageomics/bioclip-2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2Fbioclip-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2Fbioclip-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2Fbioclip-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2Fbioclip-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Imageomics","download_url":"https://codeload.github.com/Imageomics/bioclip-2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Imageomics%2Fbioclip-2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34942665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biology","clip","computer-vision","imageomics","knowledge-guided-machine-learning","taxonomy"],"created_at":"2026-06-12T15:00:34.719Z","updated_at":"2026-06-29T21:01:15.413Z","avatar_url":"https://github.com/Imageomics.png","language":"Python","funding_links":[],"categories":["🔬 Domain-Specific Applications"],"sub_categories":["🌾 Agriculture \u0026 Ecology"],"readme":"# BioCLIP 2  [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.15644363-blue)](https://doi.org/10.5281/zenodo.15644363)\n\nThis repository contains the code for [BioCLIP 2](https://huggingface.co/imageomics/bioclip-2) training and evaluation (testing and visualizing embeddings). We developed this repository based on [BioCLIP](https://github.com/imageomics/BioCLIP) and [OpenCLIP](https://github.com/mlfoundations/open_clip).\nBioCLIP 2 is trained on the [TreeOfLife-200M dataset](https://huggingface.co/datasets/imageomics/TreeOfLife-200M) and achieves state-of-the-art performance on both species classification and other biological visual tasks. The BioCLIP 2 website is hosted from the `gh-pages` branch of this repository.\n\n[Paper](https://proceedings.neurips.cc/paper_files/paper/2025/hash/94da80cbfe870c1db958c88a8a27018c-Abstract-Conference.html) | [Model](https://huggingface.co/imageomics/bioclip-2) | [Data](https://huggingface.co/datasets/imageomics/TreeOfLife-200M) | [Demo](https://huggingface.co/spaces/imageomics/bioclip-2-demo)\n---\n\nBioCLIP 2 is a CLIP model trained on a new 200M-image dataset of biological organisms with fine-grained taxonomic labels.\nBioCLIP 2 outperforms general domain baselines on a wide spread of biology-related tasks, including zero-shot and few-shot classification.\n\n## 📰 News and Updates\n\n- 💖 **February 2026:** [BioCLIP 2.5 Huge](https://huggingface.co/imageomics/bioclip-2.5-vith14) is released for Love Data Week! The latest model, based on the [OpenCLIP ViT-H/14 checkpoint](https://huggingface.co/laion/CLIP-ViT-H-14-laion2B-s32B-b79K), used the accelerated training code from [v2.0.0](https://github.com/Imageomics/bioclip-2/releases/tag/v2.0.0) and the updated [TreeOfLife-200M](https://huggingface.co/datasets/imageomics/TreeOfLife-200M) dataset (19M more images and some additional content-based filtering).\n- 🔗 **July 2025:** BioCLIP 2 is set as the default model for [pybioclip](https://github.com/Imageomics/pybioclip), with full prediction and text embedding support.\n- 🚀 **June 2025:** [BioCLIP 2](https://huggingface.co/imageomics/bioclip-2) is released! Trained on the [TreeOfLife-200M dataset](https://huggingface.co/datasets/imageomics/TreeOfLife-200M) (Revision [a8f38b4](http://huggingface.co/datasets/imageomics/TreeOfLife-200M/tree/a8f38b4388579862c56ae57d6f094c2ac0e92e12)), BioCLIP 2 demonstrates emergent properties beyond species classification after extensive hierarchical contrastive training.\n\n## Table of Contents\n\n1. [Model](#model)\n2. [Training and Evaluation Commands](#commands)\n3. [Paper, website, and data](#paper)\n4. [Citation](#citation)\n\n## Model\n\nThe main differences in the training implementation between BioCLIP 2 and BioCLIP are the adopted model architecture and the introduction of experience replay. BioCLIP 2 employs a ViT-L/14 CLIP architecture pre-trained with LAION-2B data. Along with the contrastive optimization of biological organism data, we also include part of the LAION-2B data for experience replay. In order to reduce the influence of the domain gap between hierarchical labels and image captions, we use two separate visual projectors on top of the visual encoder. This part of the code is in [transformer.py](src/open_clip/transformer.py).\nWe provide the weight of BioCLIP 2 in the [BioCLIP 2 model repo](https://huggingface.co/imageomics/bioclip-2).\n\n## Commands\n\n### Training\nThe [TreeOfLife-200M](https://huggingface.co/datasets/imageomics/TreeOfLife-200M) images can be downloaded from their original sources with [distributed-downloader](https://github.com/Imageomics/distributed-downloader). [TreeOfLife-toolbox/docs](https://github.com/Imageomics/TreeOfLife-toolbox/tree/main/docs#treeoflife200m-dataset-download-guide) contains instructions for full download into the proper format, and the code to construct the webdataset for training. These repositories are included in the supplementary material.\n[img2dataset](https://github.com/rom1504/img2dataset) can be used to download data from the first three metadata parquet files of LAION-2B-en; we use the first downloaded 4,000 tar files for experience replay. Finally, download the validation set from [TreeOfLife-10M](https://huggingface.co/datasets/imageomics/TreeOfLife-10M) ([download instructions](https://github.com/Imageomics/bioclip/blob/main/docs/imageomics/treeoflife10m.md)), as we use that for evaluation during training.\n\nClone this repository, then install the requirements:\n```\nconda env create -f requirements.yml\n```\n\nTo train the model, run:\n```\nsbatch slurm/train.sh\n```\n\n### Evaluation\n**Species classification**\n\nWe evaluated [BioCLIP 2](https://huggingface.co/imageomics/bioclip-2) on the same test sets as used for [BioCLIP](https://huggingface.co/imageomics/bioclip), as well as a newly curated camera trap test set:\n\n- [NABirds](https://dl.allaboutbirds.org/nabirds): In place of [Birds525](https://www.kaggle.com/datasets/gpiosenka/100-bird-species), since it is no longer available.\n- [Meta-Album](https://meta-album.github.io/): For comparison to [BioCLIP](https://huggingface.co/imageomics/bioclip), we used the Plankton, Insects, Insects 2, PlantNet, Fungi, PlantVillage, and Medicinal Leaf datasets.\n- [Rare Species](https://huggingface.co/datasets/imageomics/rare-species): Nearly 12K images representing 400 species labeled Near Threatened through Extinct in the Wild by the [IUCN Red List](https://www.iucnredlist.org/).\n- [IDLE-OO Camera Traps](https://huggingface.co/datasets/imageomics/IDLE-OO-Camera-Traps): A new dataset we curated to evaluate performance on camera trap images. It is constructed from five [Labeled Information Library of Alexandria: Biology and Conservation (LILA BC)](https://lila.science) datasets labeled to the image-level, which we then balanced. See the [IDLE-OO Camera Traps dataset](https://huggingface.co/datasets/imageomics/IDLE-OO-Camera-Traps) for more details.\n\nThe metadata used in evaluation is provided in [`data/annotation`](data/annotation/), including [NABirds](data/annotation/nabirds), [Rare Species](data/annotation/rare_species/), and other benchmarks from [Meta Album](data/annotation/meta-album/). All evaluation parameters are described in [src/evaluation/README.md](src/evaluation/README.md).\nPlease be sure to update the directories accordingly to reflect the locations of these data and metadata in `slurm/eval.sh` and run:\n```\nsbatch slurm/eval.sh\n```\n\n**Other biological visual tasks**\n\nWe also evaluated on biological tasks that go beyond species classification with the following datasets:\n- [NeWT](https://github.com/visipedia/newt)\n- [FishNet](https://fishnet-2023.github.io/)\n- [AwA2](https://cvml.ista.ac.at/AwA2/)\n- [Herbarium19](https://www.kaggle.com/c/herbarium-2019-fgvc6/data)\n- [PlantDoc](https://github.com/pratikkayal/PlantDoc-Dataset)\n\nPlease be sure to update the directories accordingly to reflect the locations of these data in `slurm/eval_other.sh` and run:\n```\nsbatch slurm/eval_other.sh\n```\n\n\u003ch2 id=\"paper\"\u003ePaper, Website, and Data\u003c/h2\u003e\n\nThe paper is in [NeurIPS 2025 proceedings](https://proceedings.neurips.cc/paper_files/paper/2025/hash/94da80cbfe870c1db958c88a8a27018c-Abstract-Conference.html). We also have a preprint on [arXiv](https://doi.org/10.48550/arXiv.2505.23883) and a [project website](https://imageomics.github.io/bioclip-2/).\n\nOur data is published on Hugging Face: [TreeOfLife-200M](https://huggingface.co/datasets/imageomics/TreeOfLife-200M) and [IDLE-OO Camera Traps](https://huggingface.co/datasets/imageomics/IDLE-OO-Camera-Traps). Step-by-step download instructions for TreeOfLife-200M are available in [TreeOfLife-toolbox](https://github.com/Imageomics/TreeOfLife-toolbox/tree/main/docs#treeoflife200m-dataset-download-guide).\n\n## Citation\n\nPlease cite our papers and the associated repositories if you use our code or results.\n\n```\n@inproceedings{NEURIPS2025_94da80cb,\n author = {Gu, Jianyang and Stevens, Sam and Campolongo, Elizabeth and Thompson, Matthew and Zhang, Net and Wu, Jiaman and Kopanev, Andrei and Mai, Zheda and White, Alexander and Balhoff, James and Dahdul, Wasila and Rubenstein, Daniel and Lapp, Hilmar and Berger-Wolf, Tanya and Chao, Wei-Lun (Harry) and Su, Yu},\n booktitle = {Advances in Neural Information Processing Systems},\n editor = {D. Belgrave and C. Zhang and H. Lin and R. Pascanu and P. Koniusz and M. Ghassemi and N. Chen},\n pages = {102778--102811},\n publisher = {Curran Associates, Inc.},\n title = {BioCLIP 2: Emergent Properties from Scaling Hierarchical Contrastive Learning},\n url = {https://proceedings.neurips.cc/paper_files/paper/2025/file/94da80cbfe870c1db958c88a8a27018c-Paper-Conference.pdf},\n volume = {38},\n year = {2025}\n}\n ```\n\nOur code (this repository):\n```\n@software{bioclip2code,\n  author = {Jianyang Gu and Samuel Stevens and Elizabeth G. Campolongo and Matthew J. Thompson and Net Zhang and Jiaman Wu and Zheda Mai},\n  doi = {10.5281/zenodo.15644363},\n  title = {{B}io{CLIP} 2},\n  version = {2.0.0},\n  month = {jan},\n  year = {2026}\n}\n```\n\nAlso consider citing OpenCLIP and BioCLIP:\n\n```\n@software{ilharco_gabriel_2021_5143773,\n  author={Ilharco, Gabriel and Wortsman, Mitchell and Wightman, Ross and Gordon, Cade and Carlini, Nicholas and Taori, Rohan and Dave, Achal and Shankar, Vaishaal and Namkoong, Hongseok and Miller, John and Hajishirzi, Hannaneh and Farhadi, Ali and Schmidt, Ludwig},\n  title={OpenCLIP},\n  year={2021},\n  doi={10.5281/zenodo.5143773},\n}\n```\n\nOriginal BioCLIP Paper:\n ```\n@inproceedings{stevens2024bioclip,\n  title = {{B}io{CLIP}: A Vision Foundation Model for the Tree of Life}, \n  author = {Samuel Stevens and Jiaman Wu and Matthew J Thompson and Elizabeth G Campolongo and Chan Hee Song and David Edward Carlyn and Li Dong and Wasila M Dahdul and Charles Stewart and Tanya Berger-Wolf and Wei-Lun Chao and Yu Su},\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year = {2024},\n  pages = {19412-19424}\n}\n```\nOriginal Code:\n```\n@software{bioclip2023code,\n  author = {Samuel Stevens and Jiaman Wu and Matthew J. Thompson and Elizabeth G. Campolongo and Chan Hee Song and David Edward Carlyn},\n  doi = {10.5281/zenodo.10895871},\n  title = {BioCLIP},\n  version = {v1.0.0},\n  year = {2024}\n}\n```\n\n## License\n\nBioCLIP 2 is released under the MIT License. Some elements of the code are copyright by others (see [`LICENSE`](LICENSE)); detailed provenance information is provided in [`HISTORY.md`](HISTORY.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImageomics%2Fbioclip-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FImageomics%2Fbioclip-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImageomics%2Fbioclip-2/lists"}