Emaad commited on
Commit
e5d8f0d
·
1 Parent(s): 69fe38a

Upload 3 files

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +64 -172
  3. images/architecture.png +3 -0
  4. images/huanglogo.jpeg +0 -0
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ images/architecture.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,198 +1,90 @@
1
  ---
2
  license: mit
 
3
  tags:
4
  - biology
 
 
 
 
 
5
  ---
6
- # Model Card for Model ID
7
 
8
- Primarily for image prediction
9
 
10
- ## Model Details
11
 
12
- ### Model Description
 
13
 
14
- <!-- Provide a longer summary of what this model is. -->
15
 
 
 
 
16
 
 
 
17
 
18
- - **Developed by:** [More Information Needed]
19
- - **Shared by [optional]:** [More Information Needed]
20
- - **Model type:** [More Information Needed]
21
- - **Language(s) (NLP):** [More Information Needed]
22
- - **License:** [More Information Needed]
23
- - **Finetuned from model [optional]:** [More Information Needed]
24
 
25
- ### Model Sources [optional]
 
 
26
 
27
- <!-- Provide the basic links for the model. -->
 
28
 
29
- - **Repository:** [More Information Needed]
30
- - **Paper [optional]:** [More Information Needed]
31
- - **Demo [optional]:** [More Information Needed]
 
 
 
32
 
33
- ## Uses
 
34
 
35
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
 
 
 
36
 
37
- ### Direct Use
 
38
 
39
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
 
 
 
40
 
41
- [More Information Needed]
42
 
43
- ### Downstream Use [optional]
44
 
45
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
 
 
 
46
 
47
- [More Information Needed]
 
 
 
 
48
 
49
- ### Out-of-Scope Use
50
-
51
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
52
-
53
- [More Information Needed]
54
-
55
- ## Bias, Risks, and Limitations
56
-
57
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
58
-
59
- [More Information Needed]
60
-
61
- ### Recommendations
62
-
63
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
64
-
65
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
66
-
67
- ## How to Get Started with the Model
68
-
69
- Use the code below to get started with the model.
70
-
71
- [More Information Needed]
72
-
73
- ## Training Details
74
-
75
- ### Training Data
76
-
77
- <!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
78
-
79
- [More Information Needed]
80
-
81
- ### Training Procedure
82
-
83
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
84
-
85
- #### Preprocessing [optional]
86
-
87
- [More Information Needed]
88
-
89
-
90
- #### Training Hyperparameters
91
-
92
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
93
-
94
- #### Speeds, Sizes, Times [optional]
95
-
96
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
97
-
98
- [More Information Needed]
99
-
100
- ## Evaluation
101
-
102
- <!-- This section describes the evaluation protocols and provides the results. -->
103
-
104
- ### Testing Data, Factors & Metrics
105
-
106
- #### Testing Data
107
-
108
- <!-- This should link to a Data Card if possible. -->
109
-
110
- [More Information Needed]
111
-
112
- #### Factors
113
-
114
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
115
-
116
- [More Information Needed]
117
-
118
- #### Metrics
119
-
120
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
121
-
122
- [More Information Needed]
123
-
124
- ### Results
125
-
126
- [More Information Needed]
127
-
128
- #### Summary
129
-
130
-
131
-
132
- ## Model Examination [optional]
133
-
134
- <!-- Relevant interpretability work for the model goes here -->
135
-
136
- [More Information Needed]
137
-
138
- ## Environmental Impact
139
-
140
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
141
-
142
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
143
-
144
- - **Hardware Type:** [More Information Needed]
145
- - **Hours used:** [More Information Needed]
146
- - **Cloud Provider:** [More Information Needed]
147
- - **Compute Region:** [More Information Needed]
148
- - **Carbon Emitted:** [More Information Needed]
149
-
150
- ## Technical Specifications [optional]
151
-
152
- ### Model Architecture and Objective
153
-
154
- [More Information Needed]
155
-
156
- ### Compute Infrastructure
157
-
158
- [More Information Needed]
159
-
160
- #### Hardware
161
-
162
- [More Information Needed]
163
-
164
- #### Software
165
-
166
- [More Information Needed]
167
-
168
- ## Citation [optional]
169
-
170
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
171
-
172
- **BibTeX:**
173
-
174
- [More Information Needed]
175
-
176
- **APA:**
177
-
178
- [More Information Needed]
179
-
180
- ## Glossary [optional]
181
-
182
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
183
-
184
- [More Information Needed]
185
-
186
- ## More Information [optional]
187
-
188
- [More Information Needed]
189
-
190
- ## Model Card Authors [optional]
191
-
192
- [More Information Needed]
193
-
194
- ## Model Card Contact
195
-
196
- [More Information Needed]
197
 
 
198
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ library_name: pytorch
4
  tags:
5
  - biology
6
+ - microscopy
7
+ - text-to-image
8
+ - transformers
9
+ metrics:
10
+ - accuracy
11
  ---
12
+ [![Huang Lab](images/huanglogo.jpeg)](huanglab.ucsf.edu)
13
 
14
+ # CELL-E 2
15
 
 
16
 
17
+ ## Model description
18
+ [![CELL-E_2](images/architecture.png)](https://github.com/BoHuangLab/CELL-E_2)
19
 
20
+ CELL-E 2 is the second iteration of the original [CELL-E](https://www.biorxiv.org/content/10.1101/2022.05.27.493774v1) model which utilizes an amino acid sequence and nucleus image to make predictions of subcellular protein localization with respect to the nucleus.
21
 
22
+ CELL-E 2 is novel bidirectional transformer that can generate images depicting protein subcellular localization from the amino acid sequences (and *vice versa*).
23
+ CELL-E 2 not only captures the spatial complexity of protein localization and produce probability estimates of localization atop a nucleus image, but also being able to generate sequences from images, enabling *de novo* protein design.
24
+ We trained on the [Human Protein Atlas](https://www.proteinatlas.org) (HPA) and the [OpenCell](https://opencell.czbiohub.org) datasets.
25
 
26
+ CELL-E 2 utilizes pretrained amino acid embeddings from [ESM-2](https://github.com/facebookresearch/esm).
27
+ Localization is predicted as a binary image atop the provided nucleus. The logit values are weighted against these binary images to produce a heatmap of expected localization.
28
 
29
+ ## Model variations
 
 
 
 
 
30
 
31
+ We have made several versions of CELL-E 2 available. The naming scheme follows the structure ```training set_hidden size``` where the hidden size is set to the embedding dimension of the pretrained ESM-2 model.
32
+ We annotate the most useful models under Notes, however other models can be used if memory constraints are present.
33
+ Since these models share similarities with BERT, the embeddings from any of these models may be benefical for downstream tasks.
34
 
35
+ **HPA Models**:
36
+ HPA models are trained on the HPA dataset. They are best for general purpose predictions as they include a variety of cell types.
37
 
38
+ | Model | Size | Notes
39
+ |------------------------|--------------------------------|-------|
40
+ | [`HPA_480`](https://huggingface.co/HuangLab/CELL-E_2_HPA_480) | 4.73 GB | **Best for Image Prediction** |
41
+ | [`HPA_640`](https://huggingface.co/HuangLab/CELL-E_2_HPA_640) | 6.31 GB | |
42
+ | [`HPA_1280`](https://huggingface.co/HuangLab/CELL-E_2_HPA_1280) | 10.8 GB | |
43
+ | [`HPA_2560`](https://huggingface.co/HuangLab/CELL-E_2_HPA_2560) | 17.5 GB | **Best for Sequence Prediction** |
44
 
45
+ **OpenCell Models**:
46
+ OpenCell models are trained on the OpenCell dataset. These only contain HEK cells and should ideally only be used for predictions on HEK cells. They perform well on image prediction but the generate heatmaps contain little information.
47
 
48
+ | Model | Size | Notes
49
+ |------------------------|--------------------------------|-------|
50
+ | [`HPA_480`](https://huggingface.co/HuangLab/CELL-E_2_OpenCell_480) | 4.73 GB | |
51
+ | [`HPA_640`](https://huggingface.co/HuangLab/CELL-E_2_OpenCell_640) | 6.31 GB | |
52
+ | [`HPA_1280`](https://huggingface.co/HuangLab/CELL-E_2_OpenCel_1280) | 10.8 GB | |
53
+ | [`HPA_2560`](https://huggingface.co/HuangLab/CELL-E_2_OpenCell_2560) | 17.5 GB | **Best for Sequence Prediction** |
54
 
55
+ **Finetuned HPA Models**:
56
+ These models were used the HPA models as checkpoints, but then were finetuned on the OpenCell dataset. We found that they improve image generation capabilities, but did not necessary see an improvement in sequence prediction.
57
 
58
+ | Model | Size | Notes
59
+ |------------------------|--------------------------------|-------|
60
+ | [`HPA_480`](https://huggingface.co/HuangLab/CELL-E_2_HPA_Finetuned_480) | 4.73 GB | **Best for Image Prediction** |
61
+ | [`HPA_640`](https://huggingface.co/HuangLab/CELL-E_2_HPA_Finetuned_640) | 6.31 GB | |
62
+ | [`HPA_1280`](https://huggingface.co/HuangLab/CELL-E_2_HPA_Finetuned_1280) | 10.8 GB | |
63
+ | [`HPA_2560`](https://huggingface.co/HuangLab/CELL-E_2_HPA_Finetuned_2560) | 17.5 GB | |
64
 
 
65
 
66
+ ### How to use
67
 
68
+ The full codebase is available on [GitHub](https://github.com/BoHuangLab/CELL-E_2).
69
+ Download the model and make sure ```nuclues_vqgan.yaml```, ```threshold_vqgan.yaml```, ```config.yaml```, and ```model.ckpt``` are present.
70
+ ```
71
+ Here is how to use this model to do sequence prediction:
72
 
73
+ ```python
74
+ configs = OmegaConf.load(configs/config.yaml);
75
+ model = instantiate_from_config(configs.model).to(device);
76
+ model.sample(text=sequence, condition=nucleus)
77
+ ```
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
+ ### BibTeX entry and citation info
81
 
82
+ ```bibtex
83
+ @article{,
84
+ author = {Emaad Khwaja and
85
+ Yun S Song and
86
+ Aaron Agarunov and
87
+ Bo Huang},
88
+ title = {{CELL-E 2:} Translating Proteins to Pictures and Back with a Bidirectional Text-to-Image Transforme},
89
+ }
90
+ ```
images/architecture.png ADDED

Git LFS Details

  • SHA256: 95a3488ee3ee4f4deb17d9c6f3573e41690d589bb64a61a4aae2ab6cf471f0a0
  • Pointer size: 132 Bytes
  • Size of remote file: 2.77 MB
images/huanglogo.jpeg ADDED