Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,80 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: other
|
| 3 |
-
license_name: hippocratic-license
|
| 4 |
-
license_link: >-
|
| 5 |
-
https://firstdonoharm.dev/version/3/0/cl-eco-extr-ffd-law-media-mil-my-soc-sv-tal-usta.html
|
| 6 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: hippocratic-license
|
| 4 |
+
license_link: >-
|
| 5 |
+
https://firstdonoharm.dev/version/3/0/cl-eco-extr-ffd-law-media-mil-my-soc-sv-tal-usta.html
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# LLaSA-7B
|
| 9 |
+
|
| 10 |
+
LLaSA-7B is a large language and sensor assistant that can interpret IMU data for human activities.
|
| 11 |
+
|
| 12 |
+
## Abstract
|
| 13 |
+
|
| 14 |
+
Wearable systems can recognize activities from IMU data but often fail to explain their underlying causes or contextual significance. To address this limitation, we introduce two large-scale resources: SensorCap, comprising 35,960 IMU--caption pairs, and OpenSQA, with 199,701 question--answer pairs designed for causal and explanatory reasoning. OpenSQA includes a curated tuning split (Tune-OpenSQA) optimized for scientific accuracy, narrative clarity, and diagnostic insight. Leveraging these datasets, we develop LLaSA (Large Language and Sensor Assistant), a family of compact sensor-aware language models (7B and 13B) that generate interpretable, context-rich responses to open-ended questions grounded in raw IMU data. LLaSA outperforms commercial LLMs, including GPT-3.5 and GPT-4o-mini, on benchmark and real-world tasks, demonstrating the effectiveness of domain supervision and model alignment for sensor reasoning.
|
| 15 |
+
|
| 16 |
+
### Model Summary
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
- **Developed by:** BASH Lab, WPI
|
| 21 |
+
- **Model type:** sensor-text-to-text
|
| 22 |
+
- **Language(s) (NLP):** English
|
| 23 |
+
- **Finetuned from model:** lmsys/vicuna-13b-v1.5-16K
|
| 24 |
+
|
| 25 |
+
### Model Sources
|
| 26 |
+
|
| 27 |
+
- **Repository:** https://github.com/BASHLab/LLaSA
|
| 28 |
+
- **Paper:** https://arxiv.org/abs/2406.14498
|
| 29 |
+
- **Project Website:** https://bashlab.github.io/llasa_project/
|
| 30 |
+
|
| 31 |
+
### Usage
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
git clone https://github.com/BASHLab/LLaSA.git
|
| 35 |
+
cd LLaSA/LLaSA
|
| 36 |
+
pip install -e .
|
| 37 |
+
hf download BASH-Lab/LLaSA-7B
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
You can run any of the inference scripts (zero-shot classification or question-answering) following the scripts in the eval subdirectory of the LLaSA GitHub repository, or you can run one sample as follows.
|
| 41 |
+
```Python
|
| 42 |
+
from llava.eval.run_llava import eval_model
|
| 43 |
+
from llava.mm_utils import get_model_name_from_path
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
sensor_reading = "imu.npy" # 20Hz, 2 sec (shape: (120,6))
|
| 47 |
+
prompt = "Narrate this activity by analyzing the data."
|
| 48 |
+
model_path = "LLaSA-7B"
|
| 49 |
+
args = type('Args', (), {
|
| 50 |
+
"model_path": model_path,
|
| 51 |
+
"model_base": None,
|
| 52 |
+
"model_name": get_model_name_from_path(model_path),
|
| 53 |
+
"query": prompt,
|
| 54 |
+
"conv_mode": None,
|
| 55 |
+
"image_file": sensor_reading,
|
| 56 |
+
"sep": ",",
|
| 57 |
+
"temperature": 0,
|
| 58 |
+
"top_p": None,
|
| 59 |
+
"num_beams": 1,
|
| 60 |
+
"max_new_tokens": 300
|
| 61 |
+
})()
|
| 62 |
+
llasa_answer = eval_model(args)
|
| 63 |
+
print(llasa_answer)
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Citation
|
| 67 |
+
|
| 68 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 69 |
+
|
| 70 |
+
**BibTeX:**
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
@article{imran2024llasa,
|
| 74 |
+
title={LLaSA: A Sensor-Aware LLM for Natural Language Reasoning of Human Activity from IMU Data},
|
| 75 |
+
author={Imran, Sheikh Asif and Khan, Mohammad Nur Hossain and Biswas, Subrata and Islam, Bashima},
|
| 76 |
+
journal={arXiv preprint arXiv:2406.14498},
|
| 77 |
+
year={2024}
|
| 78 |
+
}
|
| 79 |
+
```
|
| 80 |
+
|