Stroke Lesion Segmentation in Clinical Workflows: A Modular, Lightweight, and Deployment-Ready Tool
Yann Kerverdo, Florent Leray, Youwan Mahé, Stéphanie Leplaideur, Francesca Galassi · 2025
Read Stroke Lesion Segmentation in Clinical Workflows: A Modular, Lightweight, and Deployment-Ready Tool by Yann Kerverdo, Florent Leray, Youwan Mahé, Stéphanie Leplaideur, Francesca Galassi (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-24378.txt.
Introduction
Yann Kerverdo and four co-authors built StrokeSeg, a light tool that puts stroke lesion mapping into day to day hospital use. Top tools like nnU-Net map brain lesions very well. But they are heavy, come as one large block, and are hard to set up in a clinic. StrokeSeg splits the work into three parts. Prep, inference, and clean up are kept apart, so each part can be swapped or fixed on its own.
Prep uses the Anima toolbox and gives files in a standard form. Inference runs on ONNX Runtime with half precision numbers, which cuts the model size by about half. The tool has both a screen based form and a text command form. It ships as Python scripts or as a stand alone Windows program. Tests on hospital data show it is ready to deploy.
Catalog record
| CREATOR | Yann Kerverdo, Florent Leray, Youwan Mahé, Stéphanie Leplaideur, Francesca Galassi |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 14 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2510-24378
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Stroke Lesion Segmentation in Clinical Workflows: A Modular, Lightweight, and Deployment-Ready Tool Yann Kerverdo, Florent Leray, Youwan Mahé, Stéphanie Leplaideur, Francesca Galassi Abstract Deep learning frameworks such as nnU-Net achieve state-of-the-art performance in brain lesion segmentation but remain difficult to deploy clinically due to heavy dependencies and monolithic design. We introduce StrokeSeg , a modular and lightweight framework that translates research-grade stroke lesion segmentation models into deployable applications. Preprocessing, inference, and postprocessing are decoupled: preprocessing relies on the Anima toolbox with BIDS-compliant outputs, and inference uses ONNX Runtime with Float16 quantisation, reducing model size by about 50%. StrokeSeg provides both graphical and command-line interfaces and is distributed as Python scripts and as a standalone Windows executable. On a held-out set of 300 sub-acute and chronic stroke subjects, segmentation performance was equivalent to the original PyTorch pipeline (Dice difference < 10 − 3 <10^{-3} ), demonstrating that high-performing research pipelines can be transformed into portable, clinically usable tools. † † address: 1 Univ Rennes, Inria, CNRS, Inserm, IRISA UMR 6074, Empenn, Rennes, France 2 Siemens Healthineers, Courbevoie, France 3 CHU Rennes, Physical Medicine and Rehabilitation Department, Rennes, France 4 Centre de Kerpape, Ploemeur, France 1 Introduction Stroke is a leading cause of long-term disability worldwide [ 1 ] . In the sub-acute and chronic phases, structural magnetic resonance imaging (MRI) is routinely used to assess lesion extent, monitor recovery, and guide rehabilitation strategies [ 2 ] . Accurate lesion segmentation is essential for quantifying brain damage and linking imaging to functional outcomes. Manual delineation, however, is time-consuming and subject to inter-rater variability [ 3 ] , motivating automated methods. Recent deep learning advances, notably nnU-Net [ 4 ] , have achieved state-of-the-art performance in post-stroke lesion segmentation on datasets such as ATLAS v2.0 [ 5 ] . Di Matteo et al. [ 6 ] further trained stroke-specific nnU-Net v2 models on T1-weighted (T1w) and T1w+FLAIR MRI, releasing pretrained weights and inference code. We use these models as a case study to present a general framework for translating nnU-Net pipelines into lightweight, deployable tools applicable across medical imaging tasks. Existing toolkits such as TorchIO [ 7 ] and pymia [ 8 ] support reproducible preprocessing for research, while system-level frameworks like MONAI Deploy [ 9 ] and PACS-AI [ 10 ] enable integration with DICOM and PACS infrastructures. However, these solutions do not address a key practical challenge: transforming a pretrained research model into a lightweight application that can run directly on a clinical workstation. This work addresses this limitation by introducing StrokeSeg [ 11 ] , a versatile application that translates high-performing research models into deployable, clinically usable tools. Specifically, it (i) restructures the nnU-Net pipeline into independent, interoperable components, (ii) improves computational efficiency and portability through ONNX Runtime and Float16 quantisation, and (iii) delivers a reproducible implementation suitable for clinical research workflows. 2 Methods 2.1 Architecture overview Our goal was to transform the stroke-specific nnU-Net–based segmentation pipeline of Di Matteo et al. [ 6 ] into a lightweight, portable, and reproducible research tool. The design needed to satisfy two distinct user groups: (i) clinical researchers, who require a simple, installable application for routine analysis, and (ii) computer vision researchers, who expect transparency and modularity for further development. Bridging these domains - computer vision research, software engineering, and clinical practice - introduces specific technical and usability constraints (Fig. 1 ). To address them, the development was structured along three axes: (1) modular architecture, separating preprocessing, inference, and postprocessing; (2) performance optimisation through runtime and model-level improvements; and (3) packaging for reproducible, cross-platform deployment. Two packaging targets were defined to reflect typical usage scenarios: Windows systems for clinical research applications and Linux systems for computer vision research and high-performance computing (HPC) environments. Figure 1: Challenges at the intersection of research, engineering, and clinical practice. Each overlap highlights domain-specific constraints addressed in this work. 2.2 Scientific package The original nnU-Net–based pipeline [ 4 , 6 ] was refactored into three independent stages. Preprocessing. Brain extraction and spatial normalisation are performed with the Anima toolbox [ 12 ] , wrapped in a dedicated module. Both monomodal (T1w) and bimodal (T1w + FLAIR) inputs are supported; FLAIR volumes, when provided, are rigidly registered to T1w. Intermediate files are organised following BIDS conventions to ensure traceability and interoperability. Inference. Pretrained models from [ 6 ] were exported to the ONNX graph format and executed with ONNX Runtime, removing heavy training-only dependencies. As in nnU-Net [ 4 ] , the inference module implements patch-based prediction and Gaussian-weighted merging. Inference can be executed on either CPU or CUDA backends, and only the required dependencies are packaged for each target. Postprocessing. Network logits are converted to probability maps via softmax. The lesion channel produces a probability map and a binary mask after configurable thresholding (default 0.5). Optionally, outputs can be saved in MNI space, with inverse transforms applied to recover subject-space results. Figure 2: Overview of the StrokeSeg packaging workflow. The CMake project compiles the C++ launcher and gathers the scientific Python modules, embedded Python environment, and pretrained models. CPack then builds a platform-specific installer (e.g., NSIS for Windows) supporting both graphical and command-line execution. The resulting package can be launched directly by end users without manual environment configuration. 2.3 Performance-oriented inference Inference performance was compared between the native PyTorch implementation and the ONNX Runtime version. The ONNX-based approach markedly reduced software dependencies and overall package size (Sec. 3.2 ) while preserving accuracy (Sec. 3.1 ). Model weights were converted from Float32 to Float16 , reducing storage requirements by about 50%. After preliminary optimisations, brain extraction emerged as the main runtime bottleneck. To address this, StrokeSeg introduces two optimisations: (i) a dedicated Brain Extraction Only mode, and (ii) a caching mechanism allowing either re-use of previously processed data or loading of externally prepared brain-extracted volumes, thereby avoiding redundant computations. During inference, GPU acceleration is used automatically when a compatible CUDA runtime is available; otherwise, execution seamlessly falls back to the CPU. This behaviour is essential in clinical environments, where most workstations lack discrete CUDA GPUs. Runtime measurements (Sec. 3.2 ) were obtained on two representative hardware configurations: (1) an Ultrabook laptop (Intel i7-10610U CPU, 16 GiB RAM, no dedicated GPU) representing typical clinical research hardware; and (2) a workstation laptop (Intel i7-13850HX CPU, NVIDIA RTX 5000 Ada GPU, 32 GiB RAM) representing a computer vision research setup. Ten subjects T1w were processed with the monomodal pipeline using the 16-bit quantised model executed via ONNX Runtime. Runtime measurements were aggregated across three processing stages: brain extraction, registration, and model inference. 2.4 Packaging and distribution 2.4.1 Main packaging target For classical Windows-based clinical environments, StrokeSeg is packaged as a fully self-contained application using Embedded Python and an NSIS installer generated via CMake/CPack. Self-containment is essential for clinical end users, who typically have limited interaction with command-line tools. To ensure a user-friendly experience, a lightweight C++ bootstrapper launches the Python graphical interface, hides the console window, and presents the software as a single executable (Fig. 2 ). This bootstrapper serves as the main entry point, supporting three modes: command-line (headless), graphical (GUI), and combined debug mode. The installer bundles all required dependencies, removing the need for a system-wide Python installation or internet