DeepMed: A unified, modular pipeline for end-to-end deep learning in computational pathology

Marko van Treeck, Didem Çifçi, Narmin Ghaffari Laleh, Oliver Lester Saldanha, Chiara Maria Lavinia Loeffler, Katherine Hewitt, Hannah Sophie Muti, Amelie Echle, Tobias Seibel, Tobias Paul Seraphin, Christian Trautwein, Sebastian Foersch, Tom Luedde, Daniel Truhn, Jakob Nikolas KatherbioRxiv 2021 · DOI

TL;DR

This paper introduces DeepMed, a flexible and modular Python library for end-to-end deep learning in computational pathology. It addresses the lack of standardization and adaptability in existing AI workflows for analyzing histopathology images, enabling researchers to easily predict various attributes from whole slide images, alone or with multimodal data.

What Problem Does This Paper Address?

Interpreting histopathology slides is crucial for diagnosing diseases and advancing cancer research. Artificial intelligence (AI), particularly deep learning (DL) with convolutional neural networks (CNNs), has shown great promise in automatically analyzing these images to extract quantifiable information beyond human capabilities. DL models can predict complex features like tumor subtypes, genetic mutations, and gene expression directly from standard H&E stained slides. However, a significant challenge is the lack of standardized, modular, and easily adaptable AI pipelines. Researchers often have to re-implement similar pipelines from scratch, which is time-consuming and prone to errors. Existing workflows are often tightly coupled, making it difficult to modify specific components or adapt them to new tasks or data types. Furthermore, deploying these pipelines across different hardware and operating systems can be problematic.

Methods

DeepMed is presented as a solution to these challenges, offering a unified, modular, and extensible Python library. Its core design separates key functionalities into distinct modules: preprocessing, training, deployment, statistics, and visualization. This modularity allows users to alter or replace individual components without affecting the rest of the pipeline.

Key features and methods include:

  • Modularity: Enables easy customization and adaptation to new tasks or data types.
  • Scalability: Designed to run on various hardware, from single-GPU laptops to multi-GPU cloud clusters.
  • Developer-Friendly Structure: Facilitates rapid prototyping and integration of new methods.
  • User-Friendly Interface: Allows researchers to test multiple hypotheses efficiently, including cross-validation and external validation.
  • Multimodal Integration: Supports combining image data with tabular (clinical, genetic) information.
  • Subgroup Training: Enables training models on specific subsets of data defined by user-provided criteria.
  • Parameterization: Allows running multiple experiments with varying parameters from a single script.
  • Standardized Data Format: Adheres to the "Aachen Protocol" for consistent data input.

Datasets

The paper utilizes the TCGA-BRCA benchmark dataset, which is publicly available. Specifically, it uses:

  • TCGA-BRCA-A2: Used for training (100 images from Walter Reed National Military Medical Center).
  • TCGA-BRCA-E2: Used for testing (90 images from Roswell Park Comprehensive Cancer Center).

These datasets are described as already tiled and normalized, and the paper provides access to them for reproducibility.

Key Insights and Ideas

  • Modularity is Key: The paper strongly emphasizes that a modular design is crucial for advancing computational pathology, allowing for rapid iteration and adaptation in a fast-evolving field.
  • Bridging the Gap: DeepMed aims to democratize deep learning in pathology by providing a user-friendly, yet powerful, tool that reduces the technical overhead for researchers.
  • Multimodal Power: Integrating non-image data (like clinical or genetic information) alongside histopathology images can significantly boost prediction performance.
  • Explainability through Visualization: The ability to generate "top tiles" (images with the highest prediction scores) offers a valuable tool for understanding model decisions and potentially discovering new morphological biomarkers.
  • Scalability for Diverse Needs: The library's ability to scale from local use to cloud computing makes it suitable for teaching, prototyping, and large-scale research.

Key Results

The paper demonstrates DeepMed's capabilities across several tasks:

  • Prediction of Molecular Features from Histology:
    • In external validation experiments on breast cancer data, DeepMed achieved high classification performance, with patient-level AUROCs ranging from 0.656 for ER status to 0.860 for histological subtype. All targets reached statistical significance (p<0.05).
  • Within-cohort cross-validation showed moderate to high prediction performance, with statistical significance reached for histological subtype (p=0.023).
  • Multimodal Prediction:
    • Adding non-image information (PR status, HER2 status, age) to the training significantly improved classifier performance in an external validation experiment (Table 4).
  • Subgroup Analysis:
    • DeepMed demonstrated utility even in small datasets, predicting ER status with AUROCs of 0.687 and 0.768 for TMB-high and TMB-low subgroups, respectively, with p-values < 0.05.
  • Parameterization:
    • Demonstrated the ability to compare different auxiliary variables in multimodal models, showing improved performance when using proliferation status or diagnosis age as additional inputs.

Limitations and Future Work

  • Limitations:
    • Clinical Applicability: The paper acknowledges that not all clinically significant traits can be predicted from histopathology slides alone. Two large-scale assessments suggest that only about one-third of evaluated genetic changes and two-thirds of tested molecular alterations are predictable from histology.
  • Data Standardization: Challenges remain due to a lack of standardization in computational pathology, such as the widespread use of proprietary image file formats.
  • Data Size: While DeepMed can handle small datasets, real-world applications often require training and validation on thousands of cases for optimal performance.
  • Future Work:
    • The authors suggest that DeepMed's modular design makes it easy to incorporate new technologies like multiple instance learning and vision transformers as they emerge.
  • The library is positioned as a versatile and future-proof instrument for academic computational pathology, implying ongoing development and expansion of its capabilities.

Summary updated

Abstract

Abstract The interpretation of digitized histopathology images has been transformed thanks to artificial intelligence (AI). End-to-end AI algorithms can infer high-level features directly from raw image data, extending the capabilities of human experts. In particular, AI can predict tumor subtypes, genetic mutations and gene expression directly from hematoxylin and eosin (H&amp;E) stained pathology slides. However, existing end-to-end AI workflows are poorly standardized and not easily adaptable to new tasks. Here, we introduce DeepMed, a Python library for predicting any high-level attribute directly from histopathological whole slide images alone, or from images coupled with additional meta-data ( https://github.com/KatherLab/deepmed ). Unlike earlier computational pipelines, DeepMed is highly developer-friendly: its structure is modular and separates preprocessing, training, deployment, statistics, and visualization in such a way that any one of these processes can be altered without affecting the others. Also, DeepMed scales easily from local use on laptop computers to multi-GPU clusters in cloud computing services and therefore can be used for teaching, prototyping and for large-scale applications. Finally, DeepMed is user-friendly and allows researchers to easily test multiple hypotheses in a single dataset (via cross-validation) or in multiple datasets (via external validation). Here, we demonstrate and document DeepMed’s abilities to predict molecular alterations, histopathological subtypes and molecular features from routine histopathology images, using a large benchmark dataset which we release publicly. In summary, DeepMed is a fully integrated and broadly applicable end-to-end AI pipeline for the biomedical research community.
BibTeX
@misc{treeck2021deepmed,
  author = {Marko van Treeck and Didem Çifçi and Narmin Ghaffari Laleh and Oliver Lester Saldanha and Chiara Maria Lavinia Loeffler and Katherine Hewitt and Hannah Sophie Muti and Amelie Echle and Tobias Seibel and Tobias Paul Seraphin and Christian Trautwein and Sebastian Foersch and Tom Luedde and Daniel Truhn and Jakob Nikolas Kather},
  title = {{DeepMed: A unified, modular pipeline for end-to-end deep learning in computational pathology}},
  year = {2021},
  doi = {10.1101/2021.12.19.473344},
  howpublished = {bioRxiv},
}
Figure