lingxitong/MIL_BASELINE

A library that integrates different MIL methods into a unified framework

What it solves

Computational pathology involves analyzing pathological images that often contain hundreds of billions of pixels, making traditional image analysis methods computationally impractical. This project provides a unified, standardized library for Multiple Instance Learning (MIL), a successful paradigm for analyzing such large-scale images, reducing the fragmentation caused by different frameworks and structures in existing MIL research to improve reproducibility.

How it works

The library integrates a wide array of MIL methods into a single framework with a uniform interface for datasets and a standardized training/testing pipeline. It operates by taking feature-extracted patches from whole-slide images (WSIs) and processing them through various MIL network architectures to perform classification or survival analysis. The system includes tools for dataset splitting (including case-level splitting to prevent data leakage), feature extraction (supporting various foundation models), and visualization of attention scores and feature maps.

Who it’s for

Researchers and practitioners in computational pathology and medical AI who need a consistent baseline to implement, compare, and test different Multiple Instance Learning models on whole-slide images.

Highlights

  • Extensive Model Library: Implements a vast number of MIL networks, including AB_MIL, CLAM, TransMIL, and recent 2024-2026 architectures like Mamba-based and Graph-driven models.
  • Unified Interface: Standardizes dataset inputs via CSVs and provides a consistent YAML-based configuration system for different models.
  • Leakage Prevention: Includes specific case-level split scripts to ensure slides from the same patient remain in the same subset.
  • Integration with Foundation Models: Supports feature extraction using state-of-the-art pathology foundation models like UNI, Virchow, and GigaPath.
  • Built-in Visualization: Provides scripts to generate t-SNE dimensionality reduction maps and attention heatmaps for model interpretability.

Related

  • Project
  • Project
  • Project
  • Project
  • Project