wli13 commited on
Commit
877d075
·
verified ·
1 Parent(s): 3ab4771

Release HistAgent GigaPath-LoRA checkpoint

Browse files
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: prov-gigapath/prov-gigapath
3
+ library_name: peft
4
+ pipeline_tag: image-to-text
5
+ tags:
6
+ - computational-pathology
7
+ - spatial-transcriptomics
8
+ - histology
9
+ - gene-ranking
10
+ - lora
11
+ ---
12
+
13
+ # HistAgent
14
+
15
+ HistAgent is a visual-omics foundation model that generates ranked molecular readouts from routine H&E images. It combines a spot-centred image with surrounding tissue context and autoregressively predicts the top 50 genes for each location.
16
+
17
+ ## Model details
18
+
19
+ | Property | Value |
20
+ |---|---|
21
+ | Base encoder | `prov-gigapath/prov-gigapath` tile encoder |
22
+ | Vision adaptation | LoRA, rank 16, alpha 32 |
23
+ | Image inputs | Paired local and context H&E views |
24
+ | Decoder | Six-layer Transformer decoder, hidden size 512 |
25
+ | Output | Ranked sequence of up to 50 genes |
26
+ | Vocabulary | 44,538 genes plus four special tokens |
27
+ | Species conditioning | Human, mouse or unknown |
28
+ | Organ conditioning | 32-entry training vocabulary |
29
+
30
+ The repository contains only the trained LoRA parameters and HistAgent-specific modules. The frozen GigaPath base weights are loaded separately from the official gated repository.
31
+
32
+ ## Training data
33
+
34
+ The model was trained on 2.23 million paired H&E–ST locations from 936 human and mouse 10x Visium slides spanning 32 tissue categories. The release checkpoint corresponds to epoch 30 of the GigaPath training run.
35
+
36
+ ## Use
37
+
38
+ Install the accompanying code:
39
+
40
+ ```bash
41
+ git clone https://github.com/zipging/HistAgent.git
42
+ cd HistAgent
43
+ pip install -e .
44
+ ```
45
+
46
+ Request access to [Prov-GigaPath](https://huggingface.co/prov-gigapath/prov-gigapath), set `HF_TOKEN`, and load the model:
47
+
48
+ ```python
49
+ from histagent import load_pretrained
50
+
51
+ model, tokenizer, config = load_pretrained("wli13/HistAgent", device="cuda")
52
+ ```
53
+
54
+ See the [GitHub repository](https://github.com/zipging/HistAgent) for image preprocessing and ranked-gene inference examples.
55
+
56
+ ## Intended use and limitations
57
+
58
+ This model is intended for research on computational pathology and spatial molecular biology. It predicts rank-based molecular readouts rather than transcript counts. Performance can vary with tissue type, staining, scanner characteristics, image resolution and preprocessing. Predictions require independent biological validation and are not intended for clinical diagnosis or treatment decisions.
59
+
60
+ ## Citation
61
+
62
+ The HistAgent manuscript and citation will be added when publicly available.
checkpoint_manifest.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source_checkpoint": "lora_v3_ep30.pth",
3
+ "source_sha256": "74e27bd55335d530536abfa93bf23c974100a7cbbd420f8f2002ee4d81e00996",
4
+ "release_file": "model.safetensors",
5
+ "release_sha256": "a91ef2fd44377051aa9193a69058e378ecd01510242477968a27a8935f46552b",
6
+ "source_keys": 1036,
7
+ "release_keys": 470,
8
+ "verified_frozen_gigapath_keys": 566,
9
+ "release_bytes": 378413816,
10
+ "base_model_id": "prov-gigapath/prov-gigapath"
11
+ }
config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "HistAgentVisualOmics",
3
+ "base_model_id": "prov-gigapath/prov-gigapath",
4
+ "vocab_size": 44542,
5
+ "num_organs": 32,
6
+ "num_species": 3,
7
+ "d_model": 512,
8
+ "n_head": 8,
9
+ "n_layers": 6,
10
+ "max_len": 52,
11
+ "num_latents": 16,
12
+ "vision_embed_dim": 1536,
13
+ "lora_rank": 16,
14
+ "lora_alpha": 32,
15
+ "max_gene_rank": 50
16
+ }
gene_vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a91ef2fd44377051aa9193a69058e378ecd01510242477968a27a8935f46552b
3
+ size 378413816
organ_vocab.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "Unknown": 0,
3
+ "b16f10 syngeneic tumor": 1,
4
+ "bone": 2,
5
+ "brain": 3,
6
+ "breast": 4,
7
+ "cervix": 5,
8
+ "colon": 6,
9
+ "digit": 7,
10
+ "embryo": 8,
11
+ "endometrium": 9,
12
+ "glioblastoma": 10,
13
+ "glioma": 11,
14
+ "heart": 12,
15
+ "joint": 13,
16
+ "kidney": 14,
17
+ "lacrimal gland": 15,
18
+ "leiomyosarcoma": 16,
19
+ "liver": 17,
20
+ "lung": 18,
21
+ "lymph node": 19,
22
+ "melanoma": 20,
23
+ "mouth": 21,
24
+ "muscle": 22,
25
+ "ovary": 23,
26
+ "pancreas": 24,
27
+ "prostate": 25,
28
+ "skin": 26,
29
+ "spleen": 27,
30
+ "stomach": 28,
31
+ "tendon": 29,
32
+ "thymus": 30,
33
+ "undifferentiated pleomorphic sarcoma": 31
34
+ }
species_vocab.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "unknown": 0,
3
+ "human": 1,
4
+ "mouse": 2
5
+ }