thompsonmj commited on
Commit
32b128a
·
verified ·
1 Parent(s): 679f7d6

Add BioCLIP, BioCLIP 2, and BioCLIP 2.5 embeddings

Browse files

Store freshly computed raw float32 embeddings for three pinned BioCLIP model revisions, replace the previous BioCLIP 2 values, and add cosine IVF-PQ indexes and embedding provenance metadata.

.gitattributes CHANGED
@@ -64,3 +64,9 @@ data/challenges.lance/_indices/37c8bf8f-cd83-4654-99c9-06d4ab512db1/page_data.la
64
  data/challenges.lance/_indices/ed515135-5a05-4aad-bf2c-cb82a6e3eced/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
65
  data/challenges.lance/_indices/f955ea3d-d52e-4648-9ee0-47e5f079bf31/page_data.lance filter=lfs diff=lfs merge=lfs -text
66
  data/challenges.lance/data/0101000010000111101000011eaf1a405297a75656ec0b52d8.lance filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
64
  data/challenges.lance/_indices/ed515135-5a05-4aad-bf2c-cb82a6e3eced/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
65
  data/challenges.lance/_indices/f955ea3d-d52e-4648-9ee0-47e5f079bf31/page_data.lance filter=lfs diff=lfs merge=lfs -text
66
  data/challenges.lance/data/0101000010000111101000011eaf1a405297a75656ec0b52d8.lance filter=lfs diff=lfs merge=lfs -text
67
+ data/challenges.lance/_indices/1e2f3c02-d1a8-48a1-9bd5-0b0426464782/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
68
+ data/challenges.lance/_indices/20571172-e01c-4e6b-ba84-3bf84a1f8918/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
69
+ data/challenges.lance/_indices/7a6376d6-ca81-4b4b-b590-150eba21cad6/auxiliary.idx filter=lfs diff=lfs merge=lfs -text
70
+ data/challenges.lance/data/1100110101001101000000116694ab4c00a50f06a8423432b2.lance filter=lfs diff=lfs merge=lfs -text
71
+ data/challenges.lance/data/111001110110011100010100e1b8534dab87665804f1543796.lance filter=lfs diff=lfs merge=lfs -text
72
+ data/challenges.lance/data/111110101001000101010011512d384599b65075f6fd18060c.lance filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -14,7 +14,7 @@ pretty_name: Fine-Grained Challenges
14
 
15
  Groups of morphologically similar species for evaluating and tuning fine-grained classifiers on top of [BioCLIP ecosystem model](https://imageomics.github.io/bioclip-ecosystem/pages/models.html) embeddings. Each group gathers species that are easily confused with one another, and the groups span several clades so a classifier can be probed on the distinctions that actually matter rather than on coarse taxonomy.
16
 
17
- The corpus lives in a [Lance dataset](https://huggingface.co/docs/hub/en/datasets-lance) and can be acted on as a whole, on any single group independently, or on any single image. Images, embeddings (such as the 768-d BioCLIP 2 embeddings), taxonomic lineage, provenance, and the search indexes all live in the same table:
18
 
19
  ```
20
  data/challenges.lance/
@@ -33,11 +33,15 @@ data/challenges.lance/
33
  | `source_dataset`, `source_id`, `publisher`, `basisOfRecord`, `img_type`, `resolution_status` | string | record provenance |
34
  | `source_url` | string | URL of the image (from TreeOfLife-200M provenance) |
35
  | `license_name`, `license_link`, `copyright_owner` | string | per-image license + attribution (see Licensing) |
 
36
  | `emb_bioclip2` | fixed_size_list\<float32\>[768] | BioCLIP 2 embedding (IVF_PQ-indexed) |
 
37
  | `image` | binary | webp bytes (decode with `PIL.Image.open(io.BytesIO(...))`) |
38
 
39
  `seen_in_training` is per-image and is constant within a source cohort, so a single group can mix images seen in training with held-out images. See Considerations for using this data.
40
 
 
 
41
  ## Groups
42
 
43
  Each group is a set of confusable species drawn from [TreeOfLife-200M](https://huggingface.co/datasets/imageomics/TreeOfLife-200M). Images are sampled at up to 100 per species with a fixed random seed, so classes stay roughly balanced; images that resolve only to a genus are kept as a separate bucket, also capped at 100.
@@ -58,7 +62,7 @@ Install: `uv pip install pylance polars pillow`
58
  ```python
59
  import lance
60
  import polars as pl
61
- URI = "hf://datasets/imageomics/fine-grained-challenges/data/challenges.lance"
62
  ds = lance.dataset(URI) # scans remotely over hf://, no full download
63
 
64
  # Groups present and their sizes
@@ -67,7 +71,7 @@ pl.from_arrow(ds.to_table(columns=["challenge_group"]))["challenge_group"].value
67
  # One group independently (filter pushed down to only retrieve relevant rows and column projection to only retrieve relevant columns)
68
  hummingbirds = ds.scanner(
69
  filter="challenge_group = 'Trochilidae'",
70
- columns=["uuid", "species", "emb_bioclip2"],
71
  ).to_table()
72
 
73
  # Select by training exposure (unseen test set vs. seen in training)
@@ -85,7 +89,7 @@ img = Image.open(io.BytesIO(row["image"]))
85
  lance.write_dataset(hummingbirds, "./Trochilidae.lance")
86
  ```
87
 
88
- Because reads are columnar and pushed down over `hf://`, you can browse metadata cheaply by projecting to just the columns you need (e.g. omit `image` and `emb_bioclip2`). For example, count the images of one species without fetching any images or embeddings:
89
 
90
  ```python
91
  ds.count_rows(filter="species = 'Peromyscus maniculatus'")
@@ -102,9 +106,7 @@ The `seen_in_training` field records the model versions whose training data incl
102
 
103
  The `seen_in_training` field is derived per image from its presence in TreeOfLife-200M, the training data for the listed models. It is a per-image membership fact for those model versions. For held-out evaluation, select `array_length(seen_in_training) = 0`, which corresponds to images novel to every listed model.
104
 
105
- Models referenced: [`bioclip-2`](https://huggingface.co/imageomics/bioclip-2) (trained on an earlier TreeOfLife-200M snapshot) and [`bioclip-2.5`](https://huggingface.co/imageomics/bioclip-2.5-vith14) (trained on a later, expanded snapshot). The corresponding embedding columns use a filename-safe slug: value `bioclip-2.5` corresponds to column `emb_bioclip2p5`.
106
-
107
- Currently, only `emb_bioclip2` is provided.
108
 
109
  ## Licensing and attribution
110
 
 
14
 
15
  Groups of morphologically similar species for evaluating and tuning fine-grained classifiers on top of [BioCLIP ecosystem model](https://imageomics.github.io/bioclip-ecosystem/pages/models.html) embeddings. Each group gathers species that are easily confused with one another, and the groups span several clades so a classifier can be probed on the distinctions that actually matter rather than on coarse taxonomy.
16
 
17
+ The corpus lives in a [Lance dataset](https://huggingface.co/docs/hub/en/datasets-lance) and can be acted on as a whole, on any single group independently, or on any single image. Images, embeddings from three BioCLIP model generations, taxonomic lineage, provenance, and search indexes all live in the same table:
18
 
19
  ```
20
  data/challenges.lance/
 
33
  | `source_dataset`, `source_id`, `publisher`, `basisOfRecord`, `img_type`, `resolution_status` | string | record provenance |
34
  | `source_url` | string | URL of the image (from TreeOfLife-200M provenance) |
35
  | `license_name`, `license_link`, `copyright_owner` | string | per-image license + attribution (see Licensing) |
36
+ | `emb_bioclip` | fixed_size_list\<float32\>[512] | original BioCLIP embedding (IVF_PQ-indexed) |
37
  | `emb_bioclip2` | fixed_size_list\<float32\>[768] | BioCLIP 2 embedding (IVF_PQ-indexed) |
38
+ | `emb_bioclip2p5` | fixed_size_list\<float32\>[1024] | BioCLIP 2.5 ViT-H/14 embedding (IVF_PQ-indexed) |
39
  | `image` | binary | webp bytes (decode with `PIL.Image.open(io.BytesIO(...))`) |
40
 
41
  `seen_in_training` is per-image and is constant within a source cohort, so a single group can mix images seen in training with held-out images. See Considerations for using this data.
42
 
43
+ Embedding columns contain raw, unnormalized encoder output stored as `float32`. Normalize downstream when using cosine similarity or when an analysis requires unit-length features. Model repository IDs, revisions, dimensions, preprocessing, and software versions are recorded in `data/challenges.embedding_models.json` and in each embedding field's Arrow metadata.
44
+
45
  ## Groups
46
 
47
  Each group is a set of confusable species drawn from [TreeOfLife-200M](https://huggingface.co/datasets/imageomics/TreeOfLife-200M). Images are sampled at up to 100 per species with a fixed random seed, so classes stay roughly balanced; images that resolve only to a genus are kept as a separate bucket, also capped at 100.
 
62
  ```python
63
  import lance
64
  import polars as pl
65
+ URI = "hf://datasets/thompsonmj/test-fine-grained-challenges/data/challenges.lance"
66
  ds = lance.dataset(URI) # scans remotely over hf://, no full download
67
 
68
  # Groups present and their sizes
 
71
  # One group independently (filter pushed down to only retrieve relevant rows and column projection to only retrieve relevant columns)
72
  hummingbirds = ds.scanner(
73
  filter="challenge_group = 'Trochilidae'",
74
+ columns=["uuid", "species", "emb_bioclip2p5"],
75
  ).to_table()
76
 
77
  # Select by training exposure (unseen test set vs. seen in training)
 
89
  lance.write_dataset(hummingbirds, "./Trochilidae.lance")
90
  ```
91
 
92
+ Because reads are columnar and pushed down over `hf://`, you can browse metadata cheaply by projecting to just the columns you need (e.g. omit `image` and the `emb_*` columns). For example, count the images of one species without fetching any images or embeddings:
93
 
94
  ```python
95
  ds.count_rows(filter="species = 'Peromyscus maniculatus'")
 
106
 
107
  The `seen_in_training` field is derived per image from its presence in TreeOfLife-200M, the training data for the listed models. It is a per-image membership fact for those model versions. For held-out evaluation, select `array_length(seen_in_training) = 0`, which corresponds to images novel to every listed model.
108
 
109
+ Models referenced: [`bioclip`](https://huggingface.co/imageomics/bioclip), [`bioclip-2`](https://huggingface.co/imageomics/bioclip-2), and [`bioclip-2.5-vith14`](https://huggingface.co/imageomics/bioclip-2.5-vith14). The corresponding columns are `emb_bioclip`, `emb_bioclip2`, and `emb_bioclip2p5`.
 
 
110
 
111
  ## Licensing and attribution
112
 
data/challenges.embedding_models.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "created_at": "2026-07-16T13:10:18.510970+00:00",
3
+ "dataset": {
4
+ "ordered_uuid_sha256": "b5f623ddc7c8e83305f5336d990874647654d8f2bf413789901a3903640245ba",
5
+ "rows": 32844,
6
+ "uri": "../fine-grained-challenges/data/challenges.lance",
7
+ "version": 62
8
+ },
9
+ "merged_dataset": {
10
+ "ordered_uuid_sha256": "b5f623ddc7c8e83305f5336d990874647654d8f2bf413789901a3903640245ba",
11
+ "rows": 32844,
12
+ "uri": "../fine-grained-challenges/data/challenges.lance",
13
+ "version": 72
14
+ },
15
+ "models": {
16
+ "bioclip": {
17
+ "model": {
18
+ "column": "emb_bioclip",
19
+ "default_batch_size": 32,
20
+ "dimension": 512,
21
+ "key": "bioclip",
22
+ "repo_id": "imageomics/bioclip",
23
+ "revision": "ce901ab3c6a913f9e9ef94ce6d27761069f4f01c"
24
+ },
25
+ "norm": {
26
+ "max": 16.76142120361328,
27
+ "mean": 9.024341583251953,
28
+ "min": 6.639576435089111
29
+ },
30
+ "normalized": false,
31
+ "rows": 32844
32
+ },
33
+ "bioclip2": {
34
+ "existing_column_comparison": {
35
+ "absolute_difference_max": 0.3004598617553711,
36
+ "cosine_mean": 0.9999995231628418,
37
+ "cosine_min": 0.9989847540855408,
38
+ "cosine_p01": 0.9999899864196777,
39
+ "relative_l2_max": 0.04516758769750595,
40
+ "relative_l2_mean": 0.0002680478210095316
41
+ },
42
+ "model": {
43
+ "column": "emb_bioclip2",
44
+ "default_batch_size": 8,
45
+ "dimension": 768,
46
+ "key": "bioclip2",
47
+ "repo_id": "imageomics/bioclip-2",
48
+ "revision": "2957b322090f9cb17ae72c71981c7218a28d81e0"
49
+ },
50
+ "norm": {
51
+ "max": 61.62563705444336,
52
+ "mean": 43.66122055053711,
53
+ "min": 35.81275939941406
54
+ },
55
+ "normalized": false,
56
+ "rows": 32844
57
+ },
58
+ "bioclip2p5": {
59
+ "model": {
60
+ "column": "emb_bioclip2p5",
61
+ "default_batch_size": 2,
62
+ "dimension": 1024,
63
+ "key": "bioclip2p5",
64
+ "repo_id": "imageomics/bioclip-2.5-vith14",
65
+ "revision": "191d741545e4c741cdef4b22c6eb69c945c1e592"
66
+ },
67
+ "norm": {
68
+ "max": 27.95465087890625,
69
+ "mean": 25.101276397705078,
70
+ "min": 19.795944213867188
71
+ },
72
+ "normalized": false,
73
+ "rows": 32844
74
+ }
75
+ }
76
+ }
data/challenges.lance/_indices/{ed515135-5a05-4aad-bf2c-cb82a6e3eced → 1e2f3c02-d1a8-48a1-9bd5-0b0426464782}/auxiliary.idx RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ac166da1322bfbdf7f8bbd7f0bcc3851316b8bed0d518c6a5c7b3c989271fb33
3
  size 1211972
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25668f2954c35da7b107b8667c4b42604ce55d66ebcc43888c1b5b680007e693
3
  size 1211972
data/challenges.lance/_indices/1e2f3c02-d1a8-48a1-9bd5-0b0426464782/index.idx ADDED
Binary file (49.5 kB). View file
 
data/challenges.lance/_indices/20571172-e01c-4e6b-ba84-3bf84a1f8918/auxiliary.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eaec1f8ddc87a5224665ef036d578cd762ab13eba8cd390a730f6e7e0fe931e3
3
+ size 1474117
data/challenges.lance/_indices/20571172-e01c-4e6b-ba84-3bf84a1f8918/index.idx ADDED
Binary file (65.9 kB). View file
 
data/challenges.lance/_indices/7a6376d6-ca81-4b4b-b590-150eba21cad6/auxiliary.idx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3415dc0ee38c3ce5f3103241583c158d098b8e0cb19517e6338ce48834c49069
3
+ size 949828
data/challenges.lance/_indices/7a6376d6-ca81-4b4b-b590-150eba21cad6/index.idx ADDED
Binary file (33.1 kB). View file
 
data/challenges.lance/_indices/ed515135-5a05-4aad-bf2c-cb82a6e3eced/index.idx DELETED
Binary file (46.4 kB)
 
data/challenges.lance/_transactions/61-bc7b7f31-8af6-4c11-b972-394976a64679.txn DELETED
Binary file (892 Bytes)
 
data/challenges.lance/_transactions/71-8cad46a3-f371-438f-8e82-585bda711ae9.txn ADDED
Binary file (470 Bytes). View file
 
data/challenges.lance/_versions/{18446744073709551553.manifest → 18446744073709551543.manifest} RENAMED
Binary files a/data/challenges.lance/_versions/18446744073709551553.manifest and b/data/challenges.lance/_versions/18446744073709551543.manifest differ
 
data/challenges.lance/_versions/latest_version_hint.json CHANGED
@@ -1 +1 @@
1
- {"version":62}
 
1
+ {"version":72}
data/challenges.lance/data/1100110101001101000000116694ab4c00a50f06a8423432b2.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bab775ac9a305914fd7e337e91f0c42784e20893a7ad6242e9e4d64ae326d1e4
3
+ size 67265664
data/challenges.lance/data/111001110110011100010100e1b8534dab87665804f1543796.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4948b25ef260fb6f5ca08fe741ecc595df1bfe542a0988c918cddee6cc490ac
3
+ size 100898101
data/challenges.lance/data/111110101001000101010011512d384599b65075f6fd18060c.lance ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9494475473eae7b5de119f141054fd0fe49edcf77985b70842ddd2132f9313d
3
+ size 134530891