--- {} --- # Dataset Card for MedMNIST ## Dataset Details ### Dataset Description MedMNIST is a large-scale MNIST-like collection of standardized biomedical images, including 12 datasets for 2D and 6 datasets for 3D. All images are pre-processed into 28x28 (2D) or 28x28x28 (3D) with the corresponding classification labels. - **License:** CC BY 4.0 ### Dataset Sources - **Homepage:** https://medmnist.com/ - **Paper:** Yang, J., Shi, R., Wei, D., Liu, Z., Zhao, L., Ke, B., ... & Ni, B. (2023). Medmnist v2-a large-scale lightweight benchmark for 2d and 3d biomedical image classification. Scientific Data, 10(1), 41. ## Dataset Structure #### PathMNIST: Total images: 107,180 Classes: 9 categories Splits: - **Train:** 89,996 images - **Validation:** 10,004 images - **Test:** 7,180 images Image specs: 28×28 pixels #### ChestMNIST: Total images: 112,120 Classes: 14 categories (multi-label) Splits: - **Train:** 78,468 images - **Validation:** 11,219 images - **Test:** 22,433 images Image specs: 28×28 pixels #### DermaMNIST: Total images: 10,015 Classes: 7 categories Splits: - **Train:** 7,007 images - **Validation:** 1,003 images - **Test:** 2,005 images Image specs: 28×28 pixels #### OCTMNIST: Total images: 109,309 Classes: 4 categories Splits: - **Train:** 97,477 images - **Validation:** 10,832 images - **Test:** 1,000 images Image specs: 28×28 pixels #### PneumoniaMNIST: Total images: 5,856 Classes: 2 categories Splits: - **Train:** 4,708 images - **Validation:** 524 images - **Test:** 624 images Image specs: 28×28 pixels #### RetinaMNIST: Total images: 1,600 Classes: 5 categories (ordinal regression) Splits: - **Train:** 1,080 images - **Validation:** 120 images - **Test:** 400 images Image specs: 28×28 pixels #### BreastMNIST: Total images: 780 Classes: 2 categories Splits: - **Train:** 546 images - **Validation:** 78 images - **Test:** 156 images Image specs: 28×28 pixels #### BloodMNIST: Total images: 17,092 Classes: 8 categories Splits: - **Train:** 11,959 images - **Validation:** 1,712 images - **Test:** 3,421 images Image specs: 28×28 pixels #### TissueMNIST: Total images: 236,386 Classes: 8 categories Splits: - **Train:** 165,466 images - **Validation:** 23,640 images - **Test:** 47,280 images Image specs: 28×28 pixels #### OrganAMNIST: Total images: 58,830 Classes: 11 categories Splits: - **Train:** 34,561 images - **Validation:** 6,491 images - **Test:** 17,778 images Image specs: 28×28 pixels #### OrganCMNIST: Total images: 23,583 Classes: 11 categories Splits: - **Train:** 12,975 images - **Validation:** 2,392 images - **Test:** 8,216 images Image specs: 28×28 pixels #### OrganSMNIST: Total images: 25,211 Classes: 11 categories Splits: - **Train:** 13,932 images - **Validation:** 2,452 images - **Test:** 8,827 images Image specs: 28×28 pixels #### OrganMNIST3D: Total images: 1,742 Classes: 11 categories Splits: - **Train:** 971 images - **Validation:** 161 images - **Test:** 610 images Image specs: 28×28x28 pixels #### NoduleMNIST3D: Total images: 1,633 Classes: 2 categories Splits: - **Train:** 1,158 images - **Validation:** 165 images - **Test:** 310 images Image specs: 28×28x28 pixels #### AdrenalMNIST3D: Total images: 1,584 Classes: 2 categories Splits: - **Train:** 1,188 images - **Validation:** 98 images - **Test:** 298 images Image specs: 28×28x28 pixels #### FractureMNIST3D: Total images: 1,370 Classes: 3 categories Splits: - **Train:** 1,027 images - **Validation:** 103 images - **Test:** 240 images Image specs: 28×28x28 pixels #### VesselMNIST3D: Total images: 1,908 Classes: 2 categories Splits: - **Train:** 1,335 images - **Validation:** 191 images - **Test:** 382 images Image specs: 28×28x28 pixels #### SynapseMNIST3D: Total images: 1,759 Classes: 2 categories Splits: - **Train:** 1,230 images - **Validation:** 177 images - **Test:** 352 images Image specs: 28×28x28 pixels ## Example Usage Below is a quick example of how to load this dataset via the Hugging Face Datasets library. ``` from datasets import load_dataset # Load the dataset dataset = load_dataset("randall-lab/medmnist", name="pathmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="chestmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="dermamnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="octmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="pneumoniamnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="retinamnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="breastmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="bloodmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="tissuemnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="organamnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="organcmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="organsmnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="organmnist3d", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="nodulemnist3d", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="adrenalmnist3d", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="fracturemnist3d", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="vesselmnist3d", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/medmnist", name="synapsemnist3d", split="train", trust_remote_code=True) # Access a sample from the dataset example = dataset[0] image = example["image"] label = example["label"] image.show() # Display the image print(f"Label: {label}") ``` ## Citation **BibTeX:** @article{yang2023medmnist, title={Medmnist v2-a large-scale lightweight benchmark for 2d and 3d biomedical image classification}, author={Yang, Jiancheng and Shi, Rui and Wei, Donglai and Liu, Zequan and Zhao, Lin and Ke, Bilian and Pfister, Hanspeter and Ni, Bingbing}, journal={Scientific Data}, volume={10}, number={1}, pages={41}, year={2023}, publisher={Nature Publishing Group UK London} }