Skip to content

Commit

Permalink
update medmnist+ details
Browse files Browse the repository at this point in the history
  • Loading branch information
ThreeSRR committed Jan 19, 2024
1 parent 62e665e commit f49eb7d
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ Please also cite source data paper(s) of the MedMNIST subset(s) as per the descr
# Release Notes
* [WIP] `v3.0.0`: MedMNIST+ featuring larger sizes: 64x64, 128x128, and 224x224 for 2D, and 64x64x64 for 3D.
- [ ] TODO: test all (`__main__.py`, `getting_started.ipynb`, `getting_started_without_PyTorch`, including using `Evaluator`)
- [ ] TODO: new examples for v3 large size (in `getting_started.ipynb`, `getting_started_without_PyTorch`, including using `Evaluator`)
- [ ] TODO: a [document](on_medmnist_plus.md) on MedMNIST+ details
- [x] TODO: new examples for v3 large size (in `getting_started.ipynb`, `getting_started_without_PyTorch`, including using `Evaluator`)
- [x] TODO: a [document](on_medmnist_plus.md) on MedMNIST+ details
- [ ] TODO: clean README, release on PyPI.
* `v2.2.4`: removed a small number of blank samples in OrganAMNIST, OrganCMNIST, OrganSMNIST, OrganMNIST3D, and VesselMNIST3D.
* `v2.2.3`: DermaMNIST license to CC BY-NC 4.0
Expand Down
177 changes: 139 additions & 38 deletions examples/getting_started.ipynb

Large diffs are not rendered by default.

87 changes: 86 additions & 1 deletion on_medmnist_plus.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
# How we generated the MedMNIST+ (the larger-size version of MedMNIST)

#TODO
The data in MedMNIST+ corresponds one-to-one with that in MedMNIST (size 28x28 for 2D, 28x28x28 for 3D), with the only difference lying in the resolution of the images. In other words, the dataset splits (*i.e.* train, val, and test) and the sample indices are the same for MedMNIST and MedMNIST+.

It is important to emphasize that for the data obtained through center-crop followed by resizing in MedMNIST, we use the same size for center-crop and subsequently resize to obtain the target resolution in MedMNIST+.

We will describe the details of MedMNIST+, compared with MedMNIST. More details of MedMNIST can be found in our [paper](https://doi.org/10.1038/s41597-022-01721-8).

### PathMNIST
In MedMNIST, we resize the source images of 3×224×224 into 3×28×28.

In MedMNIST+, for size 224x224, we utilize the source images directly; while for size 64x64 and 128x128, we resize the source images into the target size.

### ChestMNIST
In MedMNIST, we resize the source images of 1×1,024×1,024 into 1×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we resize the source images into the target size.

### DermaMNIST
In MedMNIST, the source images of 3×600×450 are resized into 3×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we resize the source images into the target size.

### OCTMNIST
In MedMNIST, the source images are gray-scale, and their sizes are (384–1,536)×(277–512). We center-crop the images with a window size of length of the short edge and resize them into 1×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we center-crop the images with a window size of length of the short edge, and then resize the source images into the target size.

### PneumoniaMNIST
In MedMNIST, the source images are gray-scale, and their sizes are (384–2,916)×(127–2,713). We center-crop the images with a window size of length of the short edge and resize them into 1×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we center-crop the images with a window size of length of the short edge, and then resize the source images into the target size. Note that after center-crop, the smallest size of the images is 127x127, and we upsample them to 128x128 and 224x224.

### RetinaMNIST
In MedMNIST, the source images of 3×1,736×1,824 are center-cropped with a window size of length of the short edge and resized into 3×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we first center-crop the images with a window size of length of the short edge, and then resize the source images into the target size.

### BreastMNIST
In MedMNIST, the source images of 1×500×500 are resized into 1×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we resize the source images into the target size.

### BloodMNIST
In MedMNIST, the source images with resolution 3×360×363 pixels are center-cropped into 3×200×200, and then resized into 3×28×28.

In MedMNIST+, for size 224x224, 128x128, and 64x64, we first center-crop the images into 3×200×200, and then resize the source images into the target size.

### TissueMNIST
In MedMNIST, each gray-scale image is 32×32×7 pixels, where 7 denotes 7 slices. We obtain 2D maximum projections by taking the maximum pixel value along the axial-axis of each pixel, and resize them into 28×28 gray-scale images.

In MedMNIST+, following the same procedure in MedMNIST, we obtain 2D maximum projections by taking the maximum pixel value along the axial-axis of each pixel, resulting in images of size 1x32x32. Then, for size 224x224, 128x128, and 64x64, we resize the source images into the target size.

### Organ{A,C,S}MNIST
In MedMNIST, Hounsfeld-Unit (HU) of the 3D images are transformed into gray-scale with an abdominal window. We crop 2D images from the center slices of the 3D bounding boxes in axial/coronal/sagittal views (planes). The only diferences of Organ{A,C,S}MNIST are the views. The images are resized into 1×28×28 to perform multi-class classifcation of 11 body organs.

In MedMNIST+, following the same procedure in MedMNIST, we crop 2D images from the center slices of the 3D bounding boxes in axial/coronal/sagittal views (planes). Then, for size 224x224, 128x128, and 64x64, we resize the source images into the target size.

### OrganMNIST3D
In MedMNIST, the source of the OrganMNIST3D is the same as that of the Organ{A,C,S}MNIST. Instead of 2D images, we directly use the 3D bounding boxes and process the images into 28×28×28 to perform multi-class classifcation of 11 body organs.

In MedMNIST+, we directly use the 3D bounding boxes and process the images into 64x64x64.

### NoduleMNIST3D
In MedMNIST, we center-crop the spatially normalized images (with a spacing of 1mm × 1mm x 1mm) into 28×28×28.

In MedMNIST+, to be consistent with the dataset in MedMNIST, we center-crop the spatially normalized images (with a spacing of 1mm × 1mm x 1mm) into 28×28×28, and then upsample them into 64x64x64.

### AdrenalMNIST3D
In MedMNIST, we calculate the center of adrenal and resize the center-cropped
64×64×64 volume into 28×28×28.

In MedMNIST+, we calculate the center of adrenal and center-crop the image into 64×64×64.

### FractureMNIST3D
In MedMNIST, for each annotated fracture area, we calculate its center and resize the center-cropped 64×64×64 image into 28×28×28.

In MedMNIST+, for each annotated fracture area, we calculate its center and center-crop the image into 64×64×64.

### VesselMNIST3D
In MedMNIST, we fix the non-watertight mesh with PyMeshFix and voxelize the watertight mesh with trimesh into 28×28×28 voxels.

In MedMNIST+, we fix the non-watertight mesh with PyMeshFix and voxelize the watertight mesh with trimesh into 64×64×64 voxels.

### SynapseMNIST3D
In MedMNIST, for each labeled synaptic location, we crop a 3D volume of 1024×1024×1024 and resize it into 28×28×28 voxels.

In MedMNIST+, for each labeled synaptic location, we crop a 3D volume of 1024×1024×1024 and center-crop it into 64×64×64 voxels.

0 comments on commit f49eb7d

Please sign in to comment.