WSI-Lab: A Pathologist-Inspired, High-Throughput RL Environment for Sequential Whole-Slide Analysis
Abstract
Whole-slide images (WSIs) are gigapixel digital pathology slides where sparse diagnostic evidence makes exhaustive high-magnification inspection computationally expensive. Pathologists instead examine selected regions across magnifications, retain global context and examination history, update their assessment as evidence accumulates, and decide where to look next and when to stop. This naturally frames WSI examination as a partially observable sequential decision problem, for which reinforcement learning (RL) provides a principled framework to learn observation, navigation, and stopping policies. Existing RL and adaptive-sampling methods largely provide task-specific solutions, while existing environments expose limited examination states that do not reflect the richer information available to a pathologist during sequential slide examination and can be costly to execute at RL scale. We introduce WSI-Lab, a reusable, Gymnasium-compatible, pathologist-inspired environment combining the current viewport, global slide context, location and examination history, and an evolving machine diagnostic-belief estimate from acquired evidence. Agents navigate across magnifications and terminate with an explicit diagnosis. Tissue-aware preprocessing, precomputed navigation structures, caching, and efficient state updates reduce repeated online work. RL ablations show that WSI-Lab's complete examination state, tissue-aware navigation, and explicit diagnosis actions support substantially stronger training than reduced variants. Under matched environment workloads, WSI-Lab is additionally up to 2.24x faster while exposing a logical observation payload up to 10.7x larger than existing environments. Code is available at https://anonymous.4open.science/r/wsi-lab-0EEC/.