Update README.md
Browse files
README.md
CHANGED
|
@@ -1,158 +1,157 @@
|
|
| 1 |
-
# OpenMM-Medical
|
| 2 |
-
|
| 3 |
-
## Introduction
|
| 4 |
-
|
| 5 |
-
OpenMM-Medical is a comprehensive
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
Chest
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
Covid
|
| 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 |
-
Pulmonary Chest
|
| 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 |
-
import
|
| 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 |
With this setup, you should be able to evaluate OpenMM-Medical using Baichuan-Omni successfully.
|
|
|
|
| 1 |
+
# OpenMM-Medical
|
| 2 |
+
|
| 3 |
+
## Introduction
|
| 4 |
+
|
| 5 |
+
OpenMM-Medical is a comprehensive medical evaluation dataset, which is an integration of existing datasets. OpenMM-Medical spans multiple domains, including Magnetic Resonance Imaging (MRI), CT scans, X-rays, microscopy images, endoscopy, fundus imaging, and dermoscopy.
|
| 6 |
+
|
| 7 |
+
Components | Content | Type | Number | Metrics
|
| 8 |
+
| :----: | :----: |:----: | :----: |:----: |
|
| 9 |
+
ACRIMA | Fundus Photography | Multiple Choice Question Answering | 159 | Acc
|
| 10 |
+
Adam Challenge | Endoscopy | Multiple Choice Question Answering | 87 | Acc
|
| 11 |
+
ALL Challenge | Microscopy Images | Multiple Choice Question Answering | 342 | Acc
|
| 12 |
+
BioMediTech | Microscopy Images | Multiple Choice Question Answering | 511 | Acc
|
| 13 |
+
Blood Cell | Microscopy Images | Multiple Choice Question Answering | 1175 | Acc
|
| 14 |
+
BreakHis | Magnetic Resonance Imaging | Multiple Choice Question Answering | 735 | Acc
|
| 15 |
+
Chest CT Scan | CT Imaging | Multiple Choice Question Answering | 871 | Acc
|
| 16 |
+
Chest X-Ray PA | X-Ray | Multiple Choice Question Answering | 850 | Acc
|
| 17 |
+
CoronaHack | X-Ray | Multiple Choice Question Answering | 684 | Acc
|
| 18 |
+
Covid CT | CT Imaging | Multiple Choice Question Answering | 199 | Acc
|
| 19 |
+
Covid-19 tianchi | X-Ray | Multiple Choice Question Answering | 96 | Acc
|
| 20 |
+
Covid19 heywhale | X-Ray | Multiple Choice Question Answering | 690 | Acc
|
| 21 |
+
COVIDx CXR-4 | X-Ray | Multiple Choice Question Answering | 485 | Acc
|
| 22 |
+
CRC100k | Magnetic Resonance Imaging | Multiple Choice Question Answering | 1322 | Acc
|
| 23 |
+
DeepDRiD | Fundus Photography | Multiple Choice Question Answering | 131 | Acc
|
| 24 |
+
Diabetic Retinopathy | Fundus Photography | Multiple Choice Question Answering | 2051 | Acc
|
| 25 |
+
DRIMDB | Fundus Photography | Multiple Choice Question Answering | 132 | Acc
|
| 26 |
+
Fitzpatrick 17k | Dermoscopy | Multiple Choice Question Answering | 1552 | Acc
|
| 27 |
+
HuSHeM | Microscopy Images | Multiple Choice Question Answering | 89 | Acc
|
| 28 |
+
ISBI2016 | Dermoscopy | Multiple Choice Question Answering | 681 | Acc
|
| 29 |
+
ISIC2018 | Dermoscopy | Multiple Choice Question Answering | 272 | Acc
|
| 30 |
+
ISIC2019 | Dermoscopy | Multiple Choice Question Answering | 1952 | Acc
|
| 31 |
+
ISIC2020 | Dermoscopy | Multiple Choice Question Answering | 1580 | Acc
|
| 32 |
+
JSIEC | Fundus Photography | Multiple Choice Question Answering | 220 | Acc
|
| 33 |
+
Knee Osteoarthritis | X-Ray | Multiple Choice Question Answering | 518 | Acc
|
| 34 |
+
MAlig Lymph | Magnetic Resonance Imaging | Multiple Choice Question Answering | 149 | Acc
|
| 35 |
+
MHSMA | Microscopy Images | Multiple Choice Question Answering | 1282 | Acc
|
| 36 |
+
MIAS | X-Ray | Multiple Choice Question Answering | 142 | Acc
|
| 37 |
+
Monkeypox Skin Image 2022 | Dermoscopy | Multiple Choice Question Answering | 163 | Acc
|
| 38 |
+
Mura | X-Ray | Multiple Choice Question Answering | 1464 | Acc
|
| 39 |
+
NLM- Malaria Data | Magnetic Resonance Imaging | Multiple Choice Question Answering | 75 | Acc
|
| 40 |
+
OCT & X-Ray 2017 | X-Ray, Optical Coherence Tomography | Multiple Choice Question Answering | 1301 | Acc
|
| 41 |
+
OLIVES | Fundus Photography | Multiple Choice Question Answering | 593 | Acc
|
| 42 |
+
PAD-UFES-20 | Dermoscopy | Multiple Choice Question Answering | 479 | Acc
|
| 43 |
+
PALM2019 | Fundus Photography | Multiple Choice Question Answering | 510 | Acc
|
| 44 |
+
Pulmonary Chest MC | X-Ray | Multiple Choice Question Answering | 38 | Acc
|
| 45 |
+
Pulmonary Chest Shenzhen | X-Ray | Multiple Choice Question Answering | 296 | Acc
|
| 46 |
+
RadImageNet | CT; Magnetic Resonance Imaging; Ultrasound | Multiple Choice Question Answering | 56697 | Acc
|
| 47 |
+
Retinal OCT-C8 | Optical Coherence Tomography | Multiple Choice Question Answering | 4016 | Acc
|
| 48 |
+
RUS CHN | X-Ray | Multiple Choice Question Answering | 1982 | Acc
|
| 49 |
+
SARS-CoV-2 CT-scan | CT | Multiple Choice Question Answering | 910 | Acc
|
| 50 |
+
Yangxi | Fundus Photography | Multiple Choice Question Answering | 1515 | Acc
|
| 51 |
+
|
| 52 |
+
## Usage
|
| 53 |
+
|
| 54 |
+
The following steps detail how to use [**Baichuan-Omni-1.5**](https://github.com/baichuan-inc/Baichuan-Omni-1.5) with OpenMM-Medical for evaluation using [**VLMEvalKit**](https://github.com/open-compass/VLMEvalKit):
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
### **1. Add `baichuan.py` in `VLMEvalKit/vlmeval/vlm`**
|
| 59 |
+
|
| 60 |
+
Download `baichuan.py` (which defines the `Baichuan` model class) and add it in `VLMEvalKit/vlmeval/vlm`.
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
### **2. Modify `VLMEvalKit/vlmeval/vlm/__init__.py`**
|
| 65 |
+
Add the following line:
|
| 66 |
+
```python
|
| 67 |
+
from .baichuan import Baichuan
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
### **3. Modify `VLMEvalKit/vlmeval/config.py`**
|
| 73 |
+
Import the `Baichuan` model:
|
| 74 |
+
```python
|
| 75 |
+
from vlmeval.vlm import Baichuan
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
Add the `Baichuan-omni` model configuration:
|
| 79 |
+
```python
|
| 80 |
+
'Baichuan-omni': partial(
|
| 81 |
+
Baichuan,
|
| 82 |
+
sft=True,
|
| 83 |
+
model_path='/your/path/to/the/model/checkpoint'
|
| 84 |
+
)
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
---
|
| 88 |
+
|
| 89 |
+
### **4. Modify `VLMEvalKit/vlmeval/dataset/image_mcq.py`**
|
| 90 |
+
Download `image_mcq.py` and add the following code to define the `OpenMMMedical` class. Ensure the `image_folder` points to your OpenMM-Medical dataset location:
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
class OpenMMMedical(ImageMCQDataset):
|
| 94 |
+
|
| 95 |
+
@classmethod
|
| 96 |
+
def supported_datasets(cls):
|
| 97 |
+
return ['OpenMMMedical']
|
| 98 |
+
|
| 99 |
+
def load_data(self, dataset='OpenMMMedical'):
|
| 100 |
+
image_folder = "/your/path/to/OpenMM_Medical"
|
| 101 |
+
def generate_tsv(pth):
|
| 102 |
+
import csv
|
| 103 |
+
from pathlib import Path
|
| 104 |
+
tsv_file_path = os.path.join(LMUDataRoot(), f'{dataset}.tsv')
|
| 105 |
+
...
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
---
|
| 109 |
+
|
| 110 |
+
### **5. Update `VLMEvalKit/vlmeval/dataset/__init__.py`**
|
| 111 |
+
Import `OpenMMMedical`:
|
| 112 |
+
```python
|
| 113 |
+
from .image_mcq import (
|
| 114 |
+
ImageMCQDataset, MMMUDataset, CustomMCQDataset,
|
| 115 |
+
MUIRDataset, GMAIMMBenchDataset, MMERealWorld, OpenMMMedical
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
IMAGE_DATASET = [
|
| 119 |
+
ImageCaptionDataset, ImageYORNDataset, ImageMCQDataset, ImageVQADataset,
|
| 120 |
+
MathVision, MMMUDataset, OCRBench, MathVista, LLaVABench, MMVet,
|
| 121 |
+
MTVQADataset, TableVQABench, MMLongBench, VCRDataset, MMDUDataset,
|
| 122 |
+
DUDE, SlideVQA, MUIRDataset, GMAIMMBenchDataset, MMERealWorld, OpenMMMedical
|
| 123 |
+
]
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
---
|
| 127 |
+
|
| 128 |
+
### **6. Update `VLMEvalKit/vlmeval/dataset/image_base.py`**
|
| 129 |
+
Modify the `img_root_map` function:
|
| 130 |
+
```python
|
| 131 |
+
def img_root_map(dataset):
|
| 132 |
+
if 'OpenMMMedical' in dataset:
|
| 133 |
+
return 'OpenMMMedical'
|
| 134 |
+
if 'OCRVQA' in dataset:
|
| 135 |
+
return 'OCRVQA'
|
| 136 |
+
if 'COCO_VAL' == dataset:
|
| 137 |
+
return 'COCO'
|
| 138 |
+
if 'MMMU' in dataset:
|
| 139 |
+
return 'MMMU'
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
---
|
| 143 |
+
|
| 144 |
+
### **7. Run the Evaluation**
|
| 145 |
+
Execute the following command to start the evaluation:
|
| 146 |
+
```bash
|
| 147 |
+
python run.py --data OpenMMMedical --model Baichuan-omni --verbose
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
### **Notes:**
|
| 153 |
+
- Ensure that all paths (e.g., `/your/path/to/OpenMM_Medical`) are correctly specified.
|
| 154 |
+
- Confirm that the Baichuan model checkpoint is accessible at the defined `model_path`.
|
| 155 |
+
- Validate the dependencies and configurations of VLMEvalKit to avoid runtime issues.
|
| 156 |
+
|
|
|
|
| 157 |
With this setup, you should be able to evaluate OpenMM-Medical using Baichuan-Omni successfully.
|