A web-based tool for real-time adequacy assessment of kidney biopsies

Meysam Ahangaran, Emily Sun, Khang Le, Jiawei Sun, William M. Wang, Tian Herng Tan, Lyle Burdine, Zeljko Dvanajscak, Clarissa A. Cassol, Shree Sharma, Vijaya B. KolachalamamedRxiv 2024 · DOI

TL;DR

Researchers have developed a web-based AI tool that uses smartphone photographs to assess the adequacy of kidney biopsies in real-time. By leveraging a deep learning model (MedSAM) to segment the kidney cortex, the tool provides immediate feedback to clinicians, potentially reducing the need for costly and risky repeat procedures.

What Problem Does This Paper Address?

A successful kidney biopsy requires obtaining enough cortex—the outer layer of the kidney containing the glomeruli necessary for diagnosis. However, the rate of "inadequate" biopsies has jumped from 2% in 2005 to 14% in 2020.

This trend is largely driven by a shift in practice: more biopsies are now performed by radiologists using smaller needles, often in settings where a nephropathologist isn't available on-site to verify the sample immediately. When a sample is insufficient, patients face the "dual challenge" of an inaccurate diagnosis or the physical risk and healthcare costs of a repeat biopsy. The authors sought to bridge this gap with a low-cost, accessible digital assistant for the biopsy suite.

Methods

The team built a web-based application (accessible at biopsyadequacy.org) using a JavaScript front-end and a Django back-end.

The "brain" of the tool is a deep learning framework based on MedSAM, an adaptation of Meta’s "Segment Anything Model" specifically fine-tuned for medical imagery.

  1. Image Capture: Clinicians take a photo of the biopsy core (16G) using a smartphone (an iPhone 13 Pro was used in the study) against a light, uniform background.
  2. Preprocessing: The user crops the image to focus on the biopsy tissue.
  3. Segmentation: The MedSAM model identifies and highlights the cortex regions within the tissue core.
  4. Quantification: The system calculates the percentage of the sample that is cortex. The authors recommend a threshold of 70% for a sample to be considered "adequate."

Datasets

The researchers used a dataset of 100 digitized core biopsy images derived from five fresh, unutilized deceased donor kidneys.

  • Annotations: A team of nephropathologists with over 21 years of combined experience provided the "ground truth" by manually annotating the cortex, medulla, and fibrofatty tissue.
  • Validation: The model was evaluated using a 5-fold cross-validation method, splitting the 100 images into training (80%) and test (20%) sets across five rotations to ensure the results were robust and not due to luck.

Key Insights and Ideas

  • Foundation Models for Niche Tasks: The study demonstrates the power of using a "foundation model" (MedSAM). Instead of training a model from scratch on thousands of kidney images, they leveraged a model already trained on 1.5 million medical image-mask pairs and fine-tuned it on a much smaller, specific dataset.
  • The "Gross" Challenge: Distinguishing cortex from medulla in "gross" (naked-eye) images is notoriously difficult, especially in deceased donor kidneys where the tissue can appear shiny or transparent. The AI proved capable of finding subtle patterns that human eyes might miss at the bedside.
  • Democratizing Pathology: By moving the assessment from a high-powered microscope to a smartphone, the tool effectively puts a "pathologist in the pocket" of radiologists and trainees, providing immediate guidance where resources are thin.

Key Results

The model showed strong performance in identifying the kidney cortex:

  • Dice Coefficient: 0.788 ± 0.130 (a measure of overlap between the AI's prediction and the expert's annotation, where 1.0 is perfect).
  • Intersection over Union (IoU): 0.665 ± 0.144.
  • Correlation: There was a high statistical correlation between the AI’s predicted cortex percentage and the experts' measurements (Spearman correlation of 0.724, p < 0.001).
  • Speed: The inference time for a standard 1MB image is under one minute, making it truly viable for real-time clinical use.

Limitations and Future Work

  • Dataset Specifics: The model was trained on deceased donor kidneys, which are non-perfused. The authors note that distinguishing tissue types is actually harder in these samples; they plan to refine the model using images from perfused kidneys to improve real-world accuracy.
  • Hardware Consistency: The current study used a single smartphone model and a controlled distance/background. Future iterations need to be tested across various devices and lighting conditions to ensure generalizability.
  • Sample Size: While 100 images provided a strong proof-of-concept, a larger, more diverse dataset from multiple institutions will be required for clinical validation.
  • Single Image Uploads: Currently, the tool only processes one image at a time. The authors suggest that manually averaging results from multiple photos of the same sample provides better accuracy, a process they hope to automate in the future.

Summary updated

Abstract

The escalating incidence of kidney biopsies providing insufficient tissue for diagnosis poses a dual challenge, straining the healthcare system and jeopardizing patients who may require rebiopsy or face the prospect of an inaccurate diagnosis due to an unsampled disease. Here, we introduce a web-based tool that can provide real-time, quantitative assessment of kidney biopsy adequacy directly from photographs taken with a smartphone camera. The software tool was developed using a deep learning-driven automated segmentation technique, trained on a dataset comprising nephropathologist-confirmed annotations of the kidney cortex on digital biopsy images. Our framework demonstrated favorable performance in segmenting the cortex via 5-fold cross-validation (Dice coefficient: 0.788±0.130) (n=100). Offering a bedside tool for kidney biopsy adequacy assessment has the potential to provide real-time guidance to the physicians performing medical kidney biopsies, reducing the necessity for re-biopsies. Our tool can be accessed through our web-based platform: http://www.biopsyadequacy.org.
BibTeX
@misc{ahangaran2024web,
  author = {Meysam Ahangaran and Emily Sun and Khang Le and Jiawei Sun and William M. Wang and Tian Herng Tan and Lyle Burdine and Zeljko Dvanajscak and Clarissa A. Cassol and Shree Sharma and Vijaya B. Kolachalama},
  title = {{A web-based tool for real-time adequacy assessment of kidney biopsies}},
  year = {2024},
  doi = {10.1101/2024.02.01.24302147},
  howpublished = {medRxiv},
}
Figure