Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,199 +1,117 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
-
|
| 28 |
-
### Model Sources [optional]
|
| 29 |
-
|
| 30 |
-
<!-- Provide the basic links for the model. -->
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
-
|
| 36 |
-
## Uses
|
| 37 |
-
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
-
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
|
| 52 |
-
##
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
|
|
|
|
|
|
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
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).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
-
|
| 184 |
|
| 185 |
-
|
|
|
|
|
|
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
##
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
| 198 |
|
| 199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 5 |
+
tags:
|
| 6 |
+
- qwen2
|
| 7 |
+
- neuroscience
|
| 8 |
+
- ASD
|
| 9 |
+
- fMRI
|
| 10 |
+
- clinical-nlp
|
| 11 |
+
- fine-tuned
|
| 12 |
+
- amd-mi300x
|
| 13 |
+
- rocm
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# asd-interpreter-merged
|
| 18 |
|
| 19 |
+
**Clinical language interpreter for ASD fMRI connectivity reports.**
|
| 20 |
+
Fine-tuned from `Qwen/Qwen2.5-7B-Instruct` on AMD MI300X (ROCm 7.0) using QLoRA, then merged to a single fp16 checkpoint.
|
| 21 |
|
| 22 |
+
Used live in the [BrainConnect-ASD Space](https://huggingface.co/spaces/lablab-ai-amd-developer-hackathon/BrainConnect-ASD) to generate patient-facing clinical summaries from gradient saliency scores produced by a 20-model LOSO GCN ensemble.
|
| 23 |
|
| 24 |
+
---
|
| 25 |
|
| 26 |
## Model Details
|
| 27 |
|
| 28 |
+
| Field | Value |
|
| 29 |
+
|---|---|
|
| 30 |
+
| **Base model** | Qwen/Qwen2.5-7B-Instruct |
|
| 31 |
+
| **Fine-tuning method** | QLoRA (r=16, α=32, target: q/v projections) |
|
| 32 |
+
| **Training hardware** | AMD MI300X · ROCm 7.0 · DigitalOcean |
|
| 33 |
+
| **Parameters** | 8B (merged, fp16) |
|
| 34 |
+
| **Context length** | 4096 tokens |
|
| 35 |
+
| **License** | Apache 2.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
## What It Does
|
| 40 |
|
| 41 |
+
Given a structured prompt containing:
|
| 42 |
+
- Ensemble ASD probability `p(ASD)`
|
| 43 |
+
- Per-model predictions from 20 LOSO site-blind GCN models
|
| 44 |
+
- Network-level gradient saliency scores (7 Yeo networks: DMN, Salience, Frontoparietal, etc.)
|
| 45 |
|
| 46 |
+
The model outputs a **clinical connectivity summary** with:
|
| 47 |
+
1. Overall impression and confidence level
|
| 48 |
+
2. Which brain networks drove the prediction and why
|
| 49 |
+
3. Site-invariance assessment (20/20 model consensus signals robustness)
|
| 50 |
+
4. Recommended next steps for clinical review
|
| 51 |
|
| 52 |
+
---
|
| 53 |
|
| 54 |
+
## Usage
|
| 55 |
|
| 56 |
+
```python
|
| 57 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 58 |
+
import torch
|
| 59 |
|
| 60 |
+
model_id = "Yatsuiii/asd-interpreter-merged"
|
| 61 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 62 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
| 63 |
|
| 64 |
+
prompt = """You are a clinical neuroscience AI. Write a concise clinical connectivity summary.
|
| 65 |
|
| 66 |
+
Patient data:
|
| 67 |
+
- p(ASD) = 0.847 (ensemble mean across 20 site-blind models)
|
| 68 |
+
- Model consensus: 17/20 models predict ASD
|
| 69 |
+
- Top network saliency: DMN=0.0041, Salience=0.0038, Frontoparietal=0.0029
|
| 70 |
|
| 71 |
+
Write a 3-paragraph clinical summary."""
|
| 72 |
|
| 73 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 74 |
+
with torch.no_grad():
|
| 75 |
+
out = model.generate(**inputs, max_new_tokens=400, temperature=0.3, do_sample=True)
|
| 76 |
+
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
| 77 |
+
```
|
| 78 |
|
| 79 |
+
---
|
| 80 |
|
| 81 |
## Training Details
|
| 82 |
|
| 83 |
+
- **Dataset**: Synthetic clinical summaries generated from ABIDE I gradient saliency outputs, manually curated for clinical tone and factual grounding
|
| 84 |
+
- **Fine-tuning**: QLoRA via `peft` + `trl` SFTTrainer
|
| 85 |
+
- **Hardware**: AMD MI300X (192GB HBM3), ROCm 7.0, PyTorch 2.5.1+rocm6.2
|
| 86 |
+
- **Epochs**: 3 · Batch size: 4 · LR: 2e-4 · Warmup: 50 steps
|
| 87 |
+
- **Merge**: LoRA adapter merged into base weights with `peft.merge_and_unload()`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
+
## Integration
|
| 92 |
|
| 93 |
+
This model runs as a vLLM endpoint (served via `rocm/vllm`) and is queried by the BrainConnect-ASD Gradio Space after every inference run. If the vLLM server is unavailable, the Space falls back to a cached demo report.
|
| 94 |
|
| 95 |
+
```
|
| 96 |
+
Space → GCN ensemble inference → gradient saliency → structured prompt → this model → clinical report
|
| 97 |
+
```
|
| 98 |
|
| 99 |
+
---
|
| 100 |
|
| 101 |
+
## Limitations
|
| 102 |
|
| 103 |
+
- Trained on synthetic data derived from ABIDE I — not validated on real clinical populations
|
| 104 |
+
- Not a medical device. Outputs are for research and demonstration purposes only.
|
| 105 |
+
- Performance degrades on atlases other than CC200 (saliency prompt was optimized for CC200 → Yeo-7 mapping)
|
| 106 |
|
| 107 |
+
---
|
| 108 |
|
| 109 |
+
## Citation
|
| 110 |
|
| 111 |
+
If you use this model or the BrainConnect-ASD pipeline, please cite:
|
| 112 |
|
| 113 |
+
```
|
| 114 |
+
BrainConnect-ASD — AMD Developer Hackathon 2025
|
| 115 |
+
Raghav Aryen · lablab.ai · AMD MI300X
|
| 116 |
+
https://huggingface.co/spaces/lablab-ai-amd-developer-hackathon/BrainConnect-ASD
|
| 117 |
+
```
|