Med MNIST

[pip install medmnist] 18x Standardized Datasets for 2D and 3D Biomedical Image Classification

AI & Machine LearningPythonApache-2.0

Abstract

Med MNIST is an open-source AI & Machine Learning project. [pip install medmnist] 18x Standardized Datasets for 2D and 3D Biomedical Image Classification. We introduce MedMNIST, a large-scale MNIST-like collection of standardized biomedical images, including 12 datasets for 2D and 6 datasets for 3D. All images are standardized into multiple size options (MNIST-like 28 and larger 64/128/224) with the corresponding classification labels, so that no background knowledge is required for users. It is built using Python. The complete source code is publicly available on GitHub under the Apache License 2.0, making it a useful reference for students building an AI & Machine Learning mini project or final-year project.

1. Introduction

We introduce MedMNIST, a large-scale MNIST-like collection of standardized biomedical images, including 12 datasets for 2D and 6 datasets for 3D. All images are standardized into multiple size options (MNIST-like 28 and larger 64/128/224) with the corresponding classification labels, so that no background knowledge is required for users. Covering primary data modalities in biomedical images, MedMNIST is designed to perform classification on lightweight 2D and 3D images with various data scales (from 100 to 100,000) and diverse tasks (binary/multi-class, ordinal regression and multi-label). The resulting dataset, consisting of approximately 708K 2D images and 10K 3D images in total, could support numerous research and educational purposes in biomedical image analysis, computer vision and machine learning. We benchmark several baseline methods on MedMNIST, including 2D / 3D neural networks and open-source / commercial AutoML tools.

Jiancheng Yang, Rui Shi, Donglai Wei, Zequan Liu, Lin Zhao, Bilian Ke, Hanspeter Pfister, Bingbing Ni

Multiple Size Options: 28 (MNIST-Like), 64, 128, and 224

2. Objective

[pip install medmnist] 18x Standardized Datasets for 2D and 3D Biomedical Image Classification

This project demonstrates how Python can be applied to a real-world AI & Machine Learning problem.

4. Technology Stack

Python
  • List all available datasets:
  • Download available datasets of a specific size (size=None (28) by default):
  • Delete all downloaded npz from root:
  • Print the dataset details given a subset flag:
  • Save the dataset as standard figure and csv files, which could be used for AutoML tools, e.g., Google AutoML Vision:
  • Parse and evaluate a standard result file, refer to Evaluator.parse_and_evaluate for details.

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Python 3.8 or later
  • pip / virtualenv for dependencies
  • VS Code, PyCharm or Jupyter Notebook
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/MedMNIST/MedMNIST.git
cd MedMNIST
  1. Python 3 (>=3.6)
  2. PyTorch\==1.3.1
  3. numpy\==1.18.5, pandas\==0.25.3, scikit-learn\==0.22.2, Pillow\==8.0.1
  4. fire, scikit-image

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Deploy the model as a web app with Streamlit, Flask or FastAPI
  • Compare against an additional model and report the metric difference
  • Add explainability (SHAP / Grad-CAM)

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. What dataset does the project use and how was it pre-processed?
  2. Which algorithm / model architecture is used and why was it chosen over alternatives?
  3. How are training and testing data split, and how is overfitting avoided?
  4. Which evaluation metrics (accuracy, precision, recall, F1) are reported and what do they mean here?
  5. How would you deploy this model for real users?

9. Source Code & License

This project is developed by MedMNIST and published on GitHub under the Apache License 2.0. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on an AI & Machine Learning project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for AI & Machine Learning Internship