File size: 4,881 Bytes
6fc6f19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
language:
- en
tags:
- medical
- radiology
- image-captioning
- multimodal
- computer-vision
task_categories:
- image-to-text
- text-generation
pretty_name: "ROCOv2 Modality-Specific Splits"
size_categories:
- 1K<n<10K
---

# ROCOv2 Modality-Specific Dataset Splits

## Dataset Description

This dataset contains modality-specific splits of the ROCOv2 radiology dataset, organized and processed for training specialized medical image captioning models.

### Dataset Summary

- **Total Samples**: 1,000
- **Modalities**: 5
- **Splits per Modality**: train, validation, test
- **Random Seed**: 42
- **Processing Date**: 2025-08-31 12:52:59.233482

### Modality Distribution

| Modality | Samples | Percentage |
|----------|---------|------------|
| CT | 188 | 18.8% |
| X-ray | 199 | 19.9% |
| MRI | 200 | 20.0% |
| Microscopy | 207 | 20.7% |
| Ultrasound | 206 | 20.6% |


## Dataset Structure

### Data Fields

- **caption** (string): Medical description of the image
- **modality** (string): Imaging modality (CT, MRI, X-ray, Ultrasound, Microscopy, Other)
- **modality_id** (int): Numerical ID for the modality
- **caption_length** (int): Number of words in the caption
- **length_category** (string): Caption length category (short, medium, long)
- **original_index** (int): Index in the original dataset
- **image** (Image): Medical image (if available)

### Data Splits

Each modality is split into:
- **Train**: ~80% for model training
- **Validation**: ~10% for model validation
- **Test**: ~10% for final evaluation

### Split Statistics

#### CT

- **train**: 150 samples
- **val**: 18 samples
- **test**: 20 samples

#### X-ray

- **train**: 159 samples
- **val**: 19 samples
- **test**: 21 samples

#### MRI

- **train**: 160 samples
- **val**: 20 samples
- **test**: 20 samples

#### Microscopy

- **train**: 165 samples
- **val**: 20 samples
- **test**: 22 samples

#### Ultrasound

- **train**: 164 samples
- **val**: 20 samples
- **test**: 22 samples



## Usage

```python
from datasets import load_dataset

# Load a specific modality
ct_dataset = load_dataset("WafaaFraih/rocov2-modality-splits", "CT")

# Load all modalities
all_datasets = {}
modalities = ["CT", "MRI", "X-ray", "Ultrasound", "Microscopy", "Other"]

for modality in modalities:
    try:
        all_datasets[modality] = load_dataset("WafaaFraih/rocov2-modality-splits", modality)
        print(f"Loaded {modality}: {len(all_datasets[modality]['train'])} train samples")
    except:
        print(f"{modality} not available")

# Access specific split
train_data = ct_dataset['train']
val_data = ct_dataset['validation'] 
test_data = ct_dataset['test']
```

## Modality-Specific Characteristics

### CT (Computed Tomography)
- Keywords: axial, coronal, sagittal, contrast, enhancement, density, hounsfield
- Typical caption prefixes: "This CT scan shows", "CT imaging reveals"

### MRI (Magnetic Resonance Imaging)  
- Keywords: t1, t2, flair, dwi, gadolinium, signal, intensity, weighted
- Typical caption prefixes: "This MRI shows", "Magnetic resonance imaging reveals"

### X-ray (Radiography)
- Keywords: ap, lateral, pa, portable, upright, supine, opacity, lucency
- Typical caption prefixes: "This chest X-ray shows", "Radiographic examination reveals"

### Ultrasound (Sonography)
- Keywords: echo, doppler, transducer, frequency, acoustic, anechoic, hyperechoic
- Typical caption prefixes: "This ultrasound shows", "Sonographic examination reveals"

### Microscopy (Histopathology)
- Keywords: cellular, nuclear, cytoplasm, tissue, staining, morphology, biopsy
- Typical caption prefixes: "This microscopic image shows", "Histological examination reveals"

## Training Recommendations

### Modality-Specific Training
- Each modality has optimized hyperparameters
- Use modality-specific data augmentation
- Consider modality-specific evaluation metrics

### Batch Sizes (recommended)
- CT: 8
- MRI: 6  
- X-ray: 10
- Ultrasound: 8
- Microscopy: 6

### Learning Rates (recommended)
- CT: 2e-5
- MRI: 1.5e-5
- X-ray: 3e-5
- Ultrasound: 2.5e-5
- Microscopy: 1.8e-5

## Citation

If you use this dataset, please cite the original ROCOv2 paper and this processed version:

```
@article{rocov2,
  title={ROCOv2: Radiology Objects in COntext Version 2},
  author={...},
  journal={...},
  year={2023}
}
```

## License

Please refer to the original ROCOv2 dataset license terms.

## Dataset Creation

This dataset was created by processing the original ROCOv2 dataset with stratified splitting to ensure balanced representation across different caption lengths and modalities.

### Processing Steps:
1. Modality classification based on caption content
2. Stratified splitting by caption length categories
3. Quality validation and metadata generation
4. Conversion to Hugging Face Dataset format

## Contact

For questions about this processed dataset, please open an issue in the repository.