jialucode commited on
Commit
7aa7a1f
·
verified ·
1 Parent(s): 5fc8125

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +84 -60
README.md CHANGED
@@ -9,8 +9,10 @@ license: mit
9
  ## 0.1 Supported Tasks
10
 
11
  - What tasks can be performed on this dataset?
 
12
  Developing robust and reliable multimodal QA systems for ECG interpretation relies on the availability of both high-quality and large quantities of labeled data. Yet, obtaining massive amounts of labeled ECGs from cardiologists is costly, which often results in limited datasets. Traditional supervised learning methods tend to perform well only on data with the same distribution as the training data. In real-world deployment, however, models frequently encounter new tasks and previously unseen populations outside the training distribution, where traditional methods may fail.
13
  - Are there any code associated with this dataset?
 
14
  Electrocardiogram–Language Model for Few-Shot Question Answering with Meta Learning(ICASSP 2025), https://arxiv.org/html/2410.14464v1
15
 
16
  ## 0.2 Dataset Highlights
@@ -40,6 +42,7 @@ The dataset is a structured reorganization of the existing ECG-QA dataset, adapt
40
  "attribute": ["non-diagnostic t abnormalities"]
41
  }
42
  ```
 
43
  ### 1.1.2 Source Datasets Instances distribution
44
 
45
  <img src="img/distribution_attr.png" alt="Figure 1: Illustration of class formation and attribute distribution for different question types." width="600"/>
@@ -68,45 +71,102 @@ python load_class.py --paraphrased_path /your/actual/path/to/ecgqa/mimic-iv-ecg/
68
  | Single-Query | 30 | attr_1/attr_2/.../attr_n | 260 (208:52) | 63,125 | Q: What direction is this ECG deviated to? <br> A: Normal axis/... |
69
  | All | 206 | yes/no/both/none/.../attr_n | 678 (541:137) | 144,885 | ... |
70
 
71
- ### Few-shot Build
72
 
 
73
 
74
  ```python
75
- train_data = dataset["train"]
76
- validation_data = dataset["validation"]
77
- test_data = dataset["test"]
78
-
79
- for example in train_data.select(range(3)):
80
- print(example)
81
- ```
82
-
83
- ```bash
84
- python data_loader.py --paraphrased_path /your/actual/path/to/ecgqa/mimic-iv-ecg/paraphrased --test_dataset mimic
85
  ```
 
86
 
87
- <img src="img/FSL_ECG_QAMeta-Learning.png" alt="Few-shot Meta-learning Example" width="600"/>
88
-
89
-
90
- ## Dataset Structure
91
 
92
- ### Data Fields
93
-
94
- - `feature1`: a `string` feature representing <!-- description -->
95
- - `feature2`: a `string` feature representing <!-- description -->
96
- - `label`: a `int64` classification label, with 0 indicating <!-- meaning --> and 1 indicating <!-- meaning -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
- ### Data Splits
99
 
100
  - Number of instances in each split (train/test): 8:2
101
  - Criteria: first split based on template id (no expression overlap between train/test), then random split for support/query set in few-shot tasks.
102
 
103
- ## Dataset Creation
 
 
 
104
 
105
- ### Curation Rationale
106
 
107
  Developing robust and reliable multimodal QA systems for ECG interpretation relies on the availability of both high-quality and large quantities of labeled data. Meta-learning, a paradigm focused on “learning to learn”, enables them to acquire transferable knowledge and adapt rapidly to new, unseen tasks with minimal labeled data.
108
 
109
- ## Citation
110
 
111
  ```
112
  @inproceedings{10888594,
@@ -118,39 +178,3 @@ Developing robust and reliable multimodal QA systems for ECG interpretation reli
118
  doi={10.1109/ICASSP49660.2025.10888594}
119
  }
120
  ```
121
-
122
- ## How to Use
123
-
124
- ### Example Preprocessing and Training
125
-
126
- ```python
127
- from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TrainingArguments
128
-
129
- tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
130
-
131
- def tokenize_function(examples):
132
- return tokenizer(examples["feature1"], padding="max_length", truncation=True)
133
-
134
- tokenized_dataset = dataset.map(tokenize_function, batched=True)
135
-
136
- model = AutoModelForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=2)
137
-
138
- training_args = TrainingArguments(
139
- output_dir="./results",
140
- per_device_train_batch_size=16,
141
- per_device_eval_batch_size=16,
142
- num_train_epochs=3,
143
- evaluation_strategy="epoch",
144
- save_strategy="epoch",
145
- load_best_model_at_end=True,
146
- )
147
-
148
- trainer = Trainer(
149
- model=model,
150
- args=training_args,
151
- train_dataset=tokenized_dataset["train"],
152
- eval_dataset=tokenized_dataset["validation"],
153
- )
154
-
155
- trainer.train()
156
- ```
 
9
  ## 0.1 Supported Tasks
10
 
11
  - What tasks can be performed on this dataset?
12
+
13
  Developing robust and reliable multimodal QA systems for ECG interpretation relies on the availability of both high-quality and large quantities of labeled data. Yet, obtaining massive amounts of labeled ECGs from cardiologists is costly, which often results in limited datasets. Traditional supervised learning methods tend to perform well only on data with the same distribution as the training data. In real-world deployment, however, models frequently encounter new tasks and previously unseen populations outside the training distribution, where traditional methods may fail.
14
  - Are there any code associated with this dataset?
15
+
16
  Electrocardiogram–Language Model for Few-Shot Question Answering with Meta Learning(ICASSP 2025), https://arxiv.org/html/2410.14464v1
17
 
18
  ## 0.2 Dataset Highlights
 
42
  "attribute": ["non-diagnostic t abnormalities"]
43
  }
44
  ```
45
+
46
  ### 1.1.2 Source Datasets Instances distribution
47
 
48
  <img src="img/distribution_attr.png" alt="Figure 1: Illustration of class formation and attribute distribution for different question types." width="600"/>
 
71
  | Single-Query | 30 | attr_1/attr_2/.../attr_n | 260 (208:52) | 63,125 | Q: What direction is this ECG deviated to? <br> A: Normal axis/... |
72
  | All | 206 | yes/no/both/none/.../attr_n | 678 (541:137) | 144,885 | ... |
73
 
74
+ ## 1.3 Few-shot Build
75
 
76
+ ### 1.3.1 load ECG-QA-FSL dataset
77
 
78
  ```python
79
+ python data_loader.py
80
+ --model_name /your/actual/path/to/model/download/from/hugging/face
81
+ --paraphrased_path /your/actual/path/to/ecgqa/mimic-iv-ecg/paraphrased
82
+ --test_dataset ptb-xl
 
 
 
 
 
 
83
  ```
84
+ ### 1.3.2 sample of ECG-QA-FSL dataset
85
 
 
 
 
 
86
 
87
+ ```python
88
+ episode = {
89
+ # --- Support Set ---
90
+ "support_x": [ # ECG feature tensors or preprocessed arrays
91
+ ecg_sample_1, # typically a NumPy array or tensor
92
+ ecg_sample_2,
93
+ # ...
94
+ ],
95
+ "support_y_q": [ # Question token sequences (padded)
96
+ [12, 45, 78, 0, 0, 0],
97
+ [23, 67, 89, 90, 0, 0],
98
+ # ...
99
+ ],
100
+ "support_y_a": [ # Answer token sequences (padded)
101
+ [1, 0, 0, 0, 0, 0],
102
+ [1, 1, 0, 0, 0, 0],
103
+ # ...
104
+ ],
105
+ "support_y_q_mask": [ # Mask for question tokens (1 = valid, 0 = pad)
106
+ [1, 1, 1, 0, 0, 0],
107
+ [1, 1, 1, 1, 0, 0],
108
+ # ...
109
+ ],
110
+ "support_y_a_mask": [ # Mask for answer tokens
111
+ [1, 0, 0, 0, 0, 0],
112
+ [1, 1, 0, 0, 0, 0],
113
+ # ...
114
+ ],
115
+ "flatten_support_x": [ # File paths to raw ECG signals
116
+ "/path/to/support/ecg_1.npy",
117
+ "/path/to/support/ecg_2.npy",
118
+ # ...
119
+ ],
120
+
121
+ # --- Query Set ---
122
+ "query_x": [
123
+ ecg_query_1,
124
+ ecg_query_2,
125
+ # ...
126
+ ],
127
+ "query_y_q": [
128
+ [34, 78, 56, 0, 0, 0],
129
+ [90, 12, 45, 76, 0, 0],
130
+ # ...
131
+ ],
132
+ "query_y_a": [
133
+ [0, 1, 1, 0, 0, 0],
134
+ [1, 0, 0, 0, 0, 0],
135
+ # ...
136
+ ],
137
+ "query_y_q_mask": [
138
+ [1, 1, 1, 0, 0, 0],
139
+ [1, 1, 1, 1, 0, 0],
140
+ # ...
141
+ ],
142
+ "query_y_a_mask": [
143
+ [1, 1, 1, 0, 0, 0],
144
+ [1, 0, 0, 0, 0, 0],
145
+ # ...
146
+ ],
147
+ "flatten_query_x": [
148
+ "/path/to/query/ecg_1.npy",
149
+ "/path/to/query/ecg_2.npy",
150
+ # ...
151
+ ],
152
+ }
153
+ ```
154
 
155
+ ### 1.3.3 Data Splits
156
 
157
  - Number of instances in each split (train/test): 8:2
158
  - Criteria: first split based on template id (no expression overlap between train/test), then random split for support/query set in few-shot tasks.
159
 
160
+ ### 1.3.4 ECG-QA-FSL dataset for meta-learning
161
+ <img src="img/FSL_ECG_QAMeta-Learning.png" alt="Few-shot Meta-learning Example" width="600"/>
162
+
163
+ # 2. Summary
164
 
165
+ ## 2.1 Curation Rationale
166
 
167
  Developing robust and reliable multimodal QA systems for ECG interpretation relies on the availability of both high-quality and large quantities of labeled data. Meta-learning, a paradigm focused on “learning to learn”, enables them to acquire transferable knowledge and adapt rapidly to new, unseen tasks with minimal labeled data.
168
 
169
+ ## 2.2 Citation
170
 
171
  ```
172
  @inproceedings{10888594,
 
178
  doi={10.1109/ICASSP49660.2025.10888594}
179
  }
180
  ```