Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,124 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: gpl-3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
inference: false
|
| 3 |
+
co2_eq_emissions:
|
| 4 |
+
emissions: 7540
|
| 5 |
+
source: MLCo2 Machine Learning Impact calculator
|
| 6 |
+
geographical_location: East USA
|
| 7 |
+
hardware_used: Tesla V100-SXM2 GPU
|
| 8 |
+
tags:
|
| 9 |
+
- text-to-image
|
| 10 |
license: gpl-3.0
|
| 11 |
+
|
| 12 |
+
language: en
|
| 13 |
+
model-index:
|
| 14 |
+
- name: SpecLab
|
| 15 |
+
results: []
|
| 16 |
---
|
| 17 |
+
|
| 18 |
+
# SpecLab Model Card
|
| 19 |
+
|
| 20 |
+
This model card focuses on the model associated with the DALL·E mini space on Hugging Face, available [here](https://huggingface.co/spaces/Nano1337/SpecLab).
|
| 21 |
+
|
| 22 |
+
## Model Details
|
| 23 |
+
|
| 24 |
+
* **Developed by:** Haoli Yin
|
| 25 |
+
* **Model type:** Atrous Spatial Pyramid Pooling (ASPP) model for Specular Reflection Segmentation in Endoscopic Images
|
| 26 |
+
* **Language(s):** English
|
| 27 |
+
* **License:** GPL 3.0
|
| 28 |
+
* **Model Description:** This is a model that can be used to generate images based on text prompts. As the model developers wrote in the [project report](https://wandb.ai/dalle-mini/dalle-mini/reports/DALL-E-mini-Generate-images-from-any-text-prompt--VmlldzoyMDE4NDAy) about DALL·E mini, “OpenAI had the first impressive model for generating images with [DALL·E](https://openai.com/blog/dall-e/). DALL·E mini is an attempt at reproducing those results with an open-source model.”
|
| 29 |
+
* **Resources for more information:** See OpenAI’s website for more information about [DALL·E](https://openai.com/blog/dall-e/), including the [DALL·E model card](https://github.com/openai/DALL-E/blob/master/model_card.md). See the [project report](https://wandb.ai/dalle-mini/dalle-mini/reports/DALL-E-mini-Generate-images-from-any-text-prompt--VmlldzoyMDE4NDAy) for more information from the model’s developers. To learn more about DALL·E Mega, see the DALL·E Mega [training journal](https://wandb.ai/dalle-mini/dalle-mini/reports/DALL-E-Mega-Training--VmlldzoxODMxMDI2#training-parameters).
|
| 30 |
+
* **Cite as:**
|
| 31 |
+
```bib text
|
| 32 |
+
@misc{Haoli_SpecLab_2022,
|
| 33 |
+
author = {Yin, Haoli},
|
| 34 |
+
doi = {TBD},
|
| 35 |
+
month = {8},
|
| 36 |
+
title = {SpecLab},
|
| 37 |
+
url = {https://github.com/Nano1337/SpecLab},
|
| 38 |
+
year = {2022}
|
| 39 |
+
}
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Uses
|
| 43 |
+
|
| 44 |
+
### Direct Use
|
| 45 |
+
|
| 46 |
+
The model is intended to be used to generate dense pixel-wise segmentation maps of specular reflection regions found in endoscopy images. Intended uses exclude those described in the [Misuse and Out-of-Scope Use](#misuse-malicious-use-and-out-of-scope-use) section.
|
| 47 |
+
|
| 48 |
+
### Downstream Use
|
| 49 |
+
|
| 50 |
+
The model could also be used for downstream use cases, including further research efforts, such as detecting specular reflection in other real-world scenarios. This application would require fine-tuning the model with domain-specific datasets.
|
| 51 |
+
|
| 52 |
+
## Limitations and Bias
|
| 53 |
+
|
| 54 |
+
### Limitations
|
| 55 |
+
|
| 56 |
+
The performance of the model may degrade when applied on non-biological tissue images. There may also be edge cases causing the model to fail to detect specular reflection, especially if the specular reflection present is a different color than white.
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
### Bias
|
| 60 |
+
|
| 61 |
+
The model is trained on endoscopy video data, so it has a bias towards detecting specular reflection better on biological tissue backgrounds.
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
### Limitations and Bias Recommendations
|
| 66 |
+
|
| 67 |
+
* Users (both direct and downstream) should be made aware of the biases and limitations.
|
| 68 |
+
* Further work on this model should include methods for balanced representations of different types of specular reflections.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
## Training
|
| 72 |
+
|
| 73 |
+
### Training Data
|
| 74 |
+
|
| 75 |
+
The GLENDA "no pathology" dataset was used to train the model:
|
| 76 |
+
* [GLENDA Dataset](http://ftp.itec.aau.at/datasets/GLENDA/), which contains ~12k image frames.
|
| 77 |
+
* Masks (to be released), were generated using the specular reflection detection pipeline found in this paper (to be released).
|
| 78 |
+
* Train/Val/Test was split randomly based on a 60/20/20 distribution.
|
| 79 |
+
|
| 80 |
+
### Training and Evaluation Procedure & Results
|
| 81 |
+
|
| 82 |
+
You can view the training logs [here at Weights and Biases](https://wandb.ai/nano-1337/Predict/reports/SpecLab-Training-for-10-Epochs--VmlldzoyNDYyNDIz?accessToken=xfjtfgb5szvsk08luvmwinjl6y2kvp1vl1eax52kbxgwgbwjqv29yed9elzgbju1)
|
| 83 |
+
|
| 84 |
+
During training, input images pass through the system as follows:
|
| 85 |
+
* Images are transformed by albumentations with horizontal/vertical flips to augment the data, normalized to [0, 1], and converted to a tensor.
|
| 86 |
+
* A forward pass is run through the model and the logits are output
|
| 87 |
+
* Loss is the "Binary Cross Entropy with Logits Loss" between the model prediction logits and the ground truth masks
|
| 88 |
+
* The logits are run through a sigmoid activation function and a threshold at 0.5 is set to binarize the output.
|
| 89 |
+
|
| 90 |
+
The simplified training procedure for SpecLab is as follows:
|
| 91 |
+
|
| 92 |
+
* **Hardware:** One 16GB NVIDIA Tesla V100-SXM2
|
| 93 |
+
* **Optimizer:** Adam
|
| 94 |
+
* **Batch:** 4 samples
|
| 95 |
+
* **Learning rate:** initialized at 0.001 then CosineAnnealingLR with a T_max of 20.
|
| 96 |
+
* **Epochs:** 10 epochs
|
| 97 |
+
* **Steps:** 18k
|
| 98 |
+
|
| 99 |
+
## Environmental Impact
|
| 100 |
+
|
| 101 |
+
### DALL·E Mini Estimated Emissions
|
| 102 |
+
|
| 103 |
+
Based on that information, we estimate the following CO2 emissions using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.
|
| 104 |
+
|
| 105 |
+
* **Hardware Type:** tesla V100-SXM2
|
| 106 |
+
* **Hours used:** 6
|
| 107 |
+
* **Cloud Provider:** Google Colab
|
| 108 |
+
* **Compute Region:** us-east1 (provided by model developers)
|
| 109 |
+
* **Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid):** 7.54 kg CO2 eq.
|
| 110 |
+
|
| 111 |
+
## Citation
|
| 112 |
+
|
| 113 |
+
```bibtext
|
| 114 |
+
@misc{Dayma_DALL·E_Mini_2021,
|
| 115 |
+
author = {Dayma, Boris and Patil, Suraj and Cuenca, Pedro and Saifullah, Khalid and Abraham, Tanishq and Lê Khắc, Phúc and Melas, Luke and Ghosh, Ritobrata},
|
| 116 |
+
doi = {10.5281/zenodo.5146400},
|
| 117 |
+
month = {7},
|
| 118 |
+
title = {DALL·E Mini},
|
| 119 |
+
url = {https://github.com/borisdayma/dalle-mini},
|
| 120 |
+
year = {2021}
|
| 121 |
+
}
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
*This model card was written by: Boris Dayma, Margaret Mitchell, Ezi Ozoani, Marissa Gerchick, Irene Solaiman, Clémentine Fourrier, Sasha Luccioni, Emily Witko, Nazneen Rajani, and Julian Herrera.*
|