lighteternal commited on
Commit
f9966eb
·
verified ·
1 Parent(s): 9b37058

Add data card, charts and Open TG-GATEs licence text

Browse files
README.md ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ pretty_name: ToxDecision-9B training data
4
+ language:
5
+ - en
6
+ task_categories:
7
+ - visual-question-answering
8
+ - multiple-choice
9
+ - image-classification
10
+ tags:
11
+ - pathology
12
+ - histopathology
13
+ - toxicologic-pathology
14
+ - rodent
15
+ - rat
16
+ - mouse
17
+ - decision-model
18
+ - calibration
19
+ size_categories:
20
+ - 100K<n<1M
21
+ configs:
22
+ - config_name: items
23
+ default: true
24
+ data_files:
25
+ - split: train
26
+ path: items/train.parquet
27
+ - split: dev
28
+ path: items/dev.parquet
29
+ - split: test_internal
30
+ path: items/test_internal.parquet
31
+ - split: test
32
+ path: items/test.parquet
33
+ - config_name: images
34
+ data_files:
35
+ - split: images
36
+ path: images/*.parquet
37
+ ---
38
+
39
+ # ToxDecision-9B training data
40
+
41
+ The data [ToxDecision-9B](https://huggingface.co/lighteternal/toxdecision-9b) was trained and tested on: **211,807 decision items on 27,496 rodent H&E images**, built only from openly licensed sources. Each item is a multiple-choice, yes/no, true/false-statement or severity question about one image, with its answer, the source of that answer and the licence of the image. Every row the model could train on is here. VIPER, the benchmark the model is evaluated on, was never used to build this data.
42
+
43
+ [Model](https://huggingface.co/lighteternal/toxdecision-9b) · [LoRA adapter](https://huggingface.co/lighteternal/toxdecision-9b-lora)
44
+
45
+ | | |
46
+ |---|---|
47
+ | **Full model**: merged weights, load and run | [toxdecision-9b](https://huggingface.co/lighteternal/toxdecision-9b) |
48
+ | LoRA adapter for [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) | [toxdecision-9b-lora](https://huggingface.co/lighteternal/toxdecision-9b-lora) |
49
+ | Training data, splits and provenance | this repo |
50
+
51
+ ## Summary
52
+
53
+ | | |
54
+ |---|---|
55
+ | Items | 211,807: 207,294 decisions (73,493 multiple choice, 131,012 yes/no or true/false, 2,789 severity) and 4,513 free-text descriptions |
56
+ | Images | 27,496 H&E images: rat 112,831 items, mouse 97,291, species not stated 1,685 |
57
+ | Sources | PubMed Central open-access figures, NTP Nonneoplastic Lesion Atlas, Open TG-GATEs slides with Bayer expert annotations, IMPC mouse histopathology |
58
+ | Splits | train 190,054 · dev 13,791 · test_internal 6,843 · test 1,119, split by article, atlas page, study or gene |
59
+ | Licences | per row (`license`); CC BY-SA 4.0 proposed for the collection, to be confirmed (see [Licence](#licence)) |
60
+ | Benchmark contamination | none by construction: VIPER images and text and VIPER's MMO image source were never stored or used |
61
+
62
+ ```python
63
+ from datasets import load_dataset
64
+
65
+ items = load_dataset("lighteternal/toxdecision-data", "items", split="train") # questions and answers
66
+ images = load_dataset("lighteternal/toxdecision-data", "images", split="images") # 8.4 GB of JPEGs
67
+ img_by_id = {iid: i for i, iid in enumerate(images["image_id"])}
68
+ row = items[0]
69
+ image = images[img_by_id[row["image_id"]]]["image"] # PIL image
70
+ ```
71
+
72
+ ## Composition
73
+
74
+ ![Items by source](assets/items_by_source.png)
75
+
76
+ | Source bucket (`source`) | Items | Images | How the answer was obtained |
77
+ |---|---:|---:|---|
78
+ | `vstyle`: VIPER-format re-renders | 49,006 | 11,823 | labels of the items below, re-rendered in the benchmark's question format |
79
+ | `qa`: caption-grounded QA, round 1 | 25,312 | 5,487 | an open LLM wrote questions from figure captions; evidence spans checked in code; no-image filtered |
80
+ | `replay`: format retention | 24,586 | 11,964 | no label; in training the base model's own answer distribution is the target |
81
+ | `impc`: IMPC mouse histopathology | 22,306 | 3,069 | pathologist annotations (MPATH diagnoses, severity) |
82
+ | `literature`: PMC figure findings | 21,923 | 8,712 | findings extracted from figure captions and mapped to SEND terms |
83
+ | `probe`: over-reading probes | 18,317 | 5,703 | "within normal limits" or specific lesion statements, from the image's label |
84
+ | `bayer`: Bayer expert polygons | 15,477 | 3,749 | computed from expert polygons on TG-GATEs rat liver slides |
85
+ | `slides`: TG-GATEs slide tiles | 14,124 | 6,728 | TG-GATEs study metadata: vehicle controls and weak positives |
86
+ | `ntp`: NTP atlas | 12,611 | 1,995 | expert diagnoses of the atlas images |
87
+ | `claude`: Claude-written items | 5,688 | 640 | written by Claude Opus from the image and its expert label, then audited |
88
+ | `qa2`: verified QA, round 2 | 2,457 | 1,711 | open-LLM questions kept by an image-grounded verifier |
89
+
90
+ Images are shared between buckets (an atlas image can carry label-derived items, VIPER-format re-renders and Claude-written items), so the image column does not add up to 27,496.
91
+
92
+ ![Items by organ and species](assets/items_by_organ.png)
93
+
94
+ | Organ group | Items | Share |
95
+ |---|---:|---:|
96
+ | liver | 56,492 | 26.7% |
97
+ | kidney | 33,138 | 15.6% |
98
+ | male reproductive organs | 15,888 | 7.5% |
99
+ | lung | 14,244 | 6.7% |
100
+ | GI tract | 12,779 | 6.0% |
101
+ | heart | 5,783 | 2.7% |
102
+ | salivary gland | 4,711 | 2.2% |
103
+ | thyroid | 2,423 | 1.1% |
104
+ | urinary bladder | 2,014 | 1.0% |
105
+ | other organs (brain, bone, eye, skin, spleen, uterus/ovary, pancreas, ...) | 61,717 | 29.1% |
106
+ | organ not stated | 2,618 | 1.2% |
107
+
108
+ ![Items by VIPER question category](assets/items_by_category.png)
109
+
110
+ | VIPER category tag | Items |
111
+ |---|---:|
112
+ | Pathology identification | 40,715 |
113
+ | Over-reading probes | 26,355 |
114
+ | Anatomy | 21,535 |
115
+ | Characterization | 11,277 |
116
+ | Localization | 3,596 |
117
+ | Quantification | 2,153 |
118
+ | Artifact | 744 |
119
+ | No VIPER category (presence, organ, severity, replay, descriptions) | 105,432 |
120
+
121
+ ![Split sizes](assets/splits.png)
122
+
123
+ All items on one image share its split. `test_internal` holds out whole articles, atlas pages and TG-GATEs studies; `test` holds out IMPC genes (every allele and centre of a gene stays in one split) and a few round-2 QA items. Bayer studies are split by study: the 34 test studies used for the model's held-out slide evaluation are not in this release's training split.
124
+
125
+ ## Sources, licences and attribution
126
+
127
+ | Source | Licence | Images | Items | Attribution |
128
+ |---|---|---:|---:|---|
129
+ | [PubMed Central Open Access](https://www.ncbi.nlm.nih.gov/pmc/tools/openftlist/) figures | CC BY (11,722 images), CC0 (74) | 11,796 | 69,410 | per image: article citation and DOI in the `attribution` and `doi` columns of the images |
130
+ | [Open TG-GATEs](https://doi.org/10.18908/lsdba.nbdc00954-02-000) rat liver and kidney slides | CC BY-SA 2.1 JP | 10,573 (incl. Bayer tiles) | 59,161 | "Toxicogenomics Project and Toxicogenomics Informatics Project under CC Attribution-Share Alike 2.1 Japan". Licence and Additional License: [`licenses/OPEN_TG-GATEs_LICENSE.txt`](licenses/OPEN_TG-GATEs_LICENSE.txt) |
131
+ | Bayer expert annotations on 230 Open TG-GATEs rat liver slides | CC BY-SA 2.1 JP (as the slides) | (on the TG-GATEs tiles) | (in the row above) | M. Radbruch, B. Lawrenz, H. Pischon, V. Bertani, U. Bach, F. Schorsch, A. Poehlmann, S. Villalba: "Annotated necrosis and mitotic figures on 230 rat liver slides of the Open TG-GATEs dataset" (Bayer AG, with Aignostics GmbH) |
132
+ | [NTP Nonneoplastic Lesion Atlas](https://ntp.niehs.nih.gov/atlas/nnl) | US Government work, public domain | 2,058 | 46,742 | National Toxicology Program, NIEHS; atlas page URL per image |
133
+ | [IMPC](https://www.mousephenotype.org/) histopathology, BioImage Archive [S-BIAD3040](https://www.ebi.ac.uk/biostudies/BioImages/studies/S-BIAD3040) | CC BY 4.0 | 3,069 | 36,494 | International Mouse Phenotyping Consortium; Groza et al. 2023, *Nucleic Acids Res.*, doi:10.1093/nar/gkac972 |
134
+
135
+ Items take the licence of their image (`license` column). The image rows carry `attribution`, `ref` (source URL, PMC figure or slide reference) and, for articles, `doi`.
136
+
137
+ **Left out of this release:** 23,648 items on 3,177 images whose licence is non-commercial or no-derivatives (CC BY-NC 4,753 items, CC BY-NC-SA 3,108, CC BY-NC-ND 15,787). None of them was used to train ToxDecision-9B, and the no-derivatives terms do not allow sharing crops. The rule and the counts are in [`provenance/release_filter.json`](provenance/release_filter.json).
138
+
139
+ ## How the items were built
140
+
141
+ 1. **Label-derived items.** Each image's expert or source label (NTP diagnosis, IMPC pathologist annotation, caption findings mapped to SEND terms, TG-GATEs study record) becomes presence questions ("Is necrosis present in this image?"), a primary-finding multiple choice, organ identification, severity grades and "any lesion?" questions.
142
+ 2. **Rendering in VIPER's format (`vstyle`, `probe`).** VIPER was profiled only through aggregate statistics (option counts and lengths, stem patterns, keyword shares, statement lengths, category, organ and magnification shares, image colour statistics), never through its text. The labelled items were then re-rendered to match:
143
+ - stems that name species, organ and stain;
144
+ - exactly 5 options of the same kind and within ±20% length, drawn from a 2,050-entry phrase dictionary checked against rules that forbid added location, extent, severity or cause;
145
+ - single-assertion true/false statements of 9 to 16 words, in the KPrim wording;
146
+ - "image-swap" false statements (a true statement about another image);
147
+ - over-reading probes, with a normal answer in about 45% of them.
148
+ 3. **Bayer programmatic items (`bayer`).** Structure position, structure identity, extent bins, counts, artifacts and low-power fields, with exact answers computed from the expert polygons. Lobular-zone items were dropped after an audit (blind agreement 3 of 12; the zone was not visible in the field).
149
+ 4. **Verified question synthesis (`qa2`, and re-rendered in `vstyle`).** An open LLM (Qwen3.6-35B-A3B) wrote questions grounded in evidence quoted from captions and atlas narratives. An image-grounded verifier (the same model, multimodal), calibrated against expert-style audits, kept 4,365 items.
150
+ 5. **Round-1 caption questions (`qa`).** The same open LLM wrote caption-grounded questions; every question had to quote a verbatim evidence span, checked in code, and questions about doses, compounds, time points or genotypes (not visible in an image) were rejected.
151
+ 6. **Claude-written items (`claude`).** Claude Opus (Anthropic) viewed each image together with its expert label and wrote VIPER-style items. Pathology claims had to follow the label; anatomy and position claims were allowed only when clearly visible. 640 rat images (NTP atlas pages, and TG-GATEs control tiles of kidney and liver), 5,688 items.
152
+ 7. **Replay (`replay`).** Generic decision items on the same images. They have no gold answer: during training the model is pulled towards the base model's own answer distribution on them, to keep its general behaviour.
153
+
154
+ ## Quality control
155
+
156
+ All audits were done by Claude Opus viewing each image under a strict one-image-at-a-time protocol, with hidden wrong-answer controls mixed in. Every control was caught.
157
+
158
+ | Item set (audit sample) | Judged correct | Action |
159
+ |---|---|---|
160
+ | Bayer programmatic (36) | extent 6/6; field 1/6; zone 3/12 | redesigned; re-audit 6/6 on ink and position |
161
+ | IMPC primary findings (53) | 66% (male reproductive 12/13) | kept; images with several findings lose the primary-finding item |
162
+ | QA synthesis without the verifier (142) | 61% | image-grounded verifier added |
163
+ | QA synthesis with the verifier (54) | **87%** | kept; IMPC multiple-choice items dropped |
164
+ | VIPER-format re-renders (30) | 77% | distractors with overlapping terms excluded |
165
+ | Claude-written items (136) | **98.5%** | scaled to 640 images |
166
+
167
+ Other filters:
168
+ - **No-image filter.** A text-only model (Qwen3.5-0.8B) answered the items without the image; 11,024 round-1 multiple-choice items that it could answer were dropped (42% of that set). Its flag and score are kept as `blind_flag` and `blind_p` where computed.
169
+ - **Panel check.** An image check removed 27,016 items on 4,876 composite, non-H&E or wrong-organ figure panels.
170
+ - **Image exclusions.** Writers' flags removed 5 non-H&E slides and relabelled 14 NTP "testis" images that showed epididymis.
171
+
172
+ ## Decontamination
173
+
174
+ - VIPER's images, questions and answers were never downloaded into this data, stored or trained on. VIPER was used only as aggregate statistics (counts and shares) to align the question format.
175
+ - MMO, the Roche multi-organ set that supplies most VIPER images (CC BY-NC), was never used.
176
+ - VIPER also draws 63 images from Open TG-GATEs rat liver. Slides whose regions matched VIPER images in a template and perceptual-hash (pHash) check were removed; this removed 3 TG-GATEs test slides.
177
+ - Held-out evaluation slides (34 Bayer test studies, the TG-GATEs liver probe slides) are not in the training split.
178
+
179
+ ## Columns
180
+
181
+ **`items`**
182
+
183
+ | Column | Meaning |
184
+ |---|---|
185
+ | `image_id` | key into the `images` config |
186
+ | `split` | train / dev / test_internal / test |
187
+ | `mode` | `decision` (single-pass answer) or `describe` (free-text description; not used to train ToxDecision-9B) |
188
+ | `kind` | `choice` (multiple choice), `noul` (yes/no or true/false; gold `true`/`false`), `score` (ordered severity levels), `text` (description) |
189
+ | `question` | the question, or for statements: stem + `Statement: "..."` + `Is this statement true?` |
190
+ | `criteria` | JSON object of the answer options in display order (choice, score) |
191
+ | `gold` | the correct option, `true`/`false`, or the description |
192
+ | `soft_true` | soft target for yes/no items when the label is uncertain (e.g. 0.95) |
193
+ | `state` | the context line shown with the image, e.g. "Rat liver, H&E" (training drops it for 40% of samples, as VIPER prompts have none) |
194
+ | `source` | source bucket (table above); `image_source`: where the image comes from |
195
+ | `qtype`, `orig_qtype`, `style` | item template, the template it was re-rendered from, and the stem style |
196
+ | `category`, `viper_category` | VIPER-style category tags where assigned |
197
+ | `mag` | magnification when known (2.5×, 5×, 10×, 20×) |
198
+ | `license`, `label_source` | licence of the image; how the answer was obtained (e.g. `ntp_atlas_expert`, `bayer_polygon_area`, `claude_opus_image_grounded_expert_anchored`, `base_model` for replay) |
199
+ | `replay`, `weight`, `ctx`, `blind_flag`, `blind_p`, `knowledge` | build fields: replay flag, sampling weight, context flag, no-image filter flag and score, and `knowledge` = kept although answerable from text knowledge (set on some buckets only) |
200
+
201
+ **`images`**: `image_id`, `image` (JPEG), `image_source`, `source`, `license`, `attribution`, `ref`, `doi`, `species`, `organ`, `width`, `height`, `findings` (source diagnoses), `normal`, `meta_json` (other source fields, e.g. IMPC gene, sex, zygosity, MPATH terms and the pathologist's description).
202
+
203
+ ## Licence
204
+
205
+ Each row keeps the licence of its image (`license`):
206
+ - **CC BY-SA 2.1 JP** (Open TG-GATEs slides and the Bayer annotations): share-alike. Redistribution must carry the attribution string above and the database's Additional License ([`licenses/OPEN_TG-GATEs_LICENSE.txt`](licenses/OPEN_TG-GATEs_LICENSE.txt)), and derivatives must stay under that licence (the CC 2.x terms also allow a later version with the same licence elements).
207
+ - **CC BY / CC BY 4.0** (PMC figures, IMPC): attribution, given per image.
208
+ - **CC0** and **US Government public domain** (NTP): no conditions.
209
+
210
+ For the collection as a whole we propose **CC BY-SA 4.0**, which keeps the share-alike terms of the TG-GATEs material and is compatible with the CC BY and public-domain rows. **This is a proposal to be confirmed by the founder**; it is not legal advice, and the per-row licence always applies to the images.
211
+
212
+ ## Limitations
213
+
214
+ - **Label noise.** Caption-derived labels can inherit a mismatch between a caption and the panel it was assigned to, despite the panel check. Round-1 caption questions were filtered for image dependence but not verified item by item.
215
+ - **Audits by one model family.** The Claude-written items were audited by the same model family; an audit by a human pathologist is pending.
216
+ - **Coverage.** Rat thyroid, urinary bladder, salivary gland and male accessory glands are scarce in open data (thyroid 1.1% and bladder 1.0% of items). Nearly half of the items are mouse, while VIPER is rat only.
217
+ - **Replay items** have no gold answer and are only meaningful as distillation targets.
218
+ - **TG-GATEs tiles** come from one laboratory, scanner and stain, as do the held-out Bayer and probe tests.
219
+
220
+ ## Intended use
221
+
222
+ Training and evaluating decision models for rodent toxicologic pathology research, studying calibration and over-reading, and building question sets for pathology education. Not for diagnosis or for regulatory decisions about individual studies.
223
+
224
+ ## Acknowledgements
225
+
226
+ Open TG-GATEs (Toxicogenomics Project and Toxicogenomics Informatics Project; NIBIOHN, Japan), the Bayer pathologists who annotated the TG-GATEs liver slides, the National Toxicology Program (NIEHS) for the Nonneoplastic Lesion Atlas, the International Mouse Phenotyping Consortium and the BioImage Archive, the authors of the PubMed Central open-access articles whose figures are used, and the VIPER authors (Mahmood lab) for the benchmark and its documentation.
assets/items_by_category.png ADDED

Git LFS Details

  • SHA256: e358a8d386dbf8614f11e99a2c1af17fe0ef3750a6549f69d4d6b9e6a603ce40
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB
assets/items_by_organ.png ADDED

Git LFS Details

  • SHA256: 45ab98f4a516719475bbdf30725b70a3de45ed9d48c852bb58a733a16ca8cc88
  • Pointer size: 131 Bytes
  • Size of remote file: 123 kB
assets/items_by_source.png ADDED

Git LFS Details

  • SHA256: 17d0439dd8f40807d58646e4004ebd900b359136c1b0f14f58649ee85de36655
  • Pointer size: 131 Bytes
  • Size of remote file: 273 kB
assets/splits.png ADDED

Git LFS Details

  • SHA256: 560e06c40eb5cc38d365201128c75a81ddf0960b4c7498633c4e7e857e196ba5
  • Pointer size: 130 Bytes
  • Size of remote file: 69.6 kB
licenses/OPEN_TG-GATEs_LICENSE.txt ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Open TG-GATEs Pathological Image Database License
2
+ =================================================
3
+
4
+ Last updated: 2012/05/24
5
+
6
+
7
+ License to Use This Database
8
+ -----------------------------------------------------------------------
9
+
10
+ You may use this database in compliance with the terms and conditions
11
+ of the Standard License and the Additional License described below. The
12
+ Standard License specifies the license terms regarding the use of this
13
+ database and the requirements you must follow in using this database.
14
+ The Additional License specifies those items that are exceptionally
15
+ permitted even though they are generally prohibited in the Standard
16
+ License.
17
+
18
+
19
+ Standard License
20
+ -----------------------------------------------------------------------
21
+
22
+ `Creative Commons License
23
+ <http://creativecommons.org/licenses/by-sa/2.1/jp/deed.en_US>`_
24
+
25
+ The Standard License for this database is the license specified in the
26
+ Creative Commons Attribution-Share Alike 2.1 Japan. If you use data
27
+ from this database, please be sure attribute this database as follows:
28
+ **"Toxicogenomics Project and Toxicogenomics Informatics Project under
29
+ CC Attribution-Share Alike 2.1 Japan"**.
30
+
31
+ The summary of the Creative Commons Attribution-Share Alike 2.1 Japan
32
+ is found `here
33
+ <http://creativecommons.org/licenses/by-sa/2.1/jp/deed.en_US>`_.
34
+
35
+ With regard to this database, you are licensed to:
36
+
37
+ 1. freely access part or whole of this database, and acquire data;
38
+ 2. freely redistribute part or whole of the data from this database;
39
+ and
40
+ 3. freely create and distribute database and other derivative works
41
+ based on part or whole of the data from this database,
42
+
43
+ under the Standard License, as long as you comply with the following
44
+ conditions:
45
+
46
+ 1. You must attribute this database in the manner specified by the
47
+ author or licensor when distributing part or whole of this database
48
+ or any derivative work.
49
+ 2. You must distribute any derivative work based on part or whole of
50
+ the data from this database under this License.
51
+
52
+
53
+ Additional License
54
+ -----------------------------------------------------------------------
55
+
56
+ 1. You must display this Additional License along with the Standard
57
+ License when distributing any derivative work based on part of whole
58
+ of the data from this database.
59
+ 2. When you conduct research by using this database, and describe the
60
+ research results in an article or paper, you always need to cite
61
+ this database, and specify the name and URL of this database in the
62
+ article or paper.
63
+ 3. You need to contact the Licensor shown below to request a license
64
+ for use of this database or any part thereof not licensed under the
65
+ Standard License and the above Additional License.
66
+
67
+ | National Institute of Biomedical Innovation
68
+ | 7-6-8 Saito-Asagi, Ibaraki City, Osaka 567-0085, Japan
69
+ | Tel: +81-72-641-9826
70
+ | E-mail: opentggates@nibiohn.go.jp
71
+
72
+
73
+ Reference
74
+ -----------------------------------------------------------------------
75
+
76
+ The original license text can be found `here
77
+ <https://dbarchive.biosciencedbc.jp/en/open-tggates-pathological-images/lic.html>`_.