HistoGym: A Reinforcement Learning Environment for Histopathological Image Analysis
Zhi-Bo Liu, Xiaobo Pang, Jizhao Wang, Shuai Liu, Chen Li
TL;DR
HistoGym reframes histopathological image analysis as a sequential, multi-scale decision problem and introduces an open-source RL environment built on the OpenSlide pyramid to simulate a pathologist's diagnostic workflow. By integrating with Farama Gymnasium and providing configurable observations, actions, and rewards, it supports tumor detection and classification tasks across multiple organs and scenarios. Baseline experiments with PPO and Ape-X DQN reveal that environmental complexity and representation choices strongly influence learning, highlighting challenges in continuous action spaces and pixel-level policy learning. The platform offers a standardized, extensible benchmark to accelerate RL research in computational pathology and to improve interpretability through traceable diagnostic trajectories.
Abstract
In pathological research, education, and clinical practice, the decision-making process based on pathological images is critically important. This significance extends to digital pathology image analysis: its adequacy is demonstrated by the extensive information contained within tissue structures, which is essential for accurate cancer classification and grading. Additionally, its necessity is highlighted by the inherent requirement for interpretability in the conclusions generated by algorithms. For humans, determining tumor type and grade typically involves multi-scale analysis, which presents a significant challenge for AI algorithms. Traditional patch-based methods are inadequate for modeling such complex structures, as they fail to capture the intricate, multi-scale information inherent in whole slide images. Consequently, there is a pressing need for advanced AI techniques capable of efficiently and accurately replicating this complex analytical process. To address this issue, we introduce HistoGym, an open-source reinforcement learning environment for histopathological image analysis. Following OpenAI Gym APIs, HistoGym aims to foster whole slide image diagnosis by mimicking the real-life processes of doctors. Leveraging the pyramid feature of WSIs and the OpenSlide API, HistoGym provides a unified framework for various clinical tasks, including tumor detection and classification. We detail the observation, action, and reward specifications tailored for the histopathological image analysis domain and provide an open-source Python-based interface for both clinicians and researchers. To accommodate different clinical demands, we offer various scenarios for different organs and cancers, including both WSI-based and selected region-based scenarios, showcasing several noteworthy results.
