# A Hybrid Segmentation Approach by Combining Bayesian Capsules and Convolutional Neural Network for Ischemic Stroke Lesion of Computed Tomography Image

Wahabou Kassim Taba Chabi, Sèmèvo A Ahouandjinou, Manhougbé Kiki, Adoté Ametepe

► To cite this version:

Wahabou Kassim Taba Chabi, Sèmèvo A Ahouandjinou, Manhougbé Kiki, Adoté Ametepe. A Hybrid Segmentation Approach by Combining Bayesian Capsules and Convolutional Neural Network for Ischemic Stroke Lesion of Computed Tomography Image. 2025. hal-05197854

HAL Id: hal-05197854

https://inria.hal.science/hal-05197854v1

Preprint submitted on 4 Aug 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
PREPRINT

# A Hybrid Segmentation Approach by Combining Bayesian Capsules and Convolutional Neural Network for Ischemic Stroke Lesion of Computed Tomography Image

Wahabou K. TABA CHABI*¹,², Sèmèvo A. AHOUANDJINOU*¹,², Manhougbé KIKI*¹,³, Adoté AMETEPE*²,³

¹ Doctoral School of Engineering Sciences (ED-SDI), Benin

²Research Laboratory in Computer Science and Applications (LRSIA), Benin

³Laboratory of Electronics, Telecommunications, and Applied Informatics, Benin

*E-mail: Wahabou Kassim kassim.tabachabi@uac.bj

**Abstract**

Automatic segmentation of ischemic lesions remains a significant challenge in medical imaging, mainly due to variations in acquisition protocols and the anatomical complexity of brain structures. Early identification of affected brain regions using computed tomography allows medical professionals to correlate clinical status with the location of vessel occlusion, facilitating the timely administration of appropriate treatments such as thrombolytic therapy alone or in combination with mechanical thrombectomy. This paper aims to develop an algorithm for the precise segmentation of ischemic lesions in stroke, which is essential both during acute stages to guide treatment decisions, such as a patient's eligibility for thrombectomy treatment, and during subacute and chronic stages for evaluating disease outcomes, clinical follow-up, and for defining optimal therapeutic strategies. We proposed integrating Bayesian Capsules into a U-Net architecture (U-Net + Capsule Bayesian) to enhance segmentation robustness and accuracy. This approach better preserves the spatial hierarchy of features and enables uncertainty estimation within a probabilistic framework. The experiment results show that: The U-Net model achieved a precision of 88.3% and a recall of 91.1% on the regions of interest. The U-Net+ Capsule Bayesian model improved these metrics by enhancing spatial consistency in segmentations and reducing errors along lesion boundaries. A qualitative analysis of 8300 images demonstrated that incorporating Bayesian Capsules into U-Net provides a more accurate representation of complex structures and a more reliable segmentation of pathological regions.

**Keywords**

Ischemic stroke, Computed Tomography images, Bayesian Capsules Network, Convolutional Neural Network, Automatic images segmentation

# I INTRODUCTION

Ischemic stroke is a critical medical condition caused by the blockage of a cerebral blood vessel, leading to reduced blood flow and oxygen deprivation in affected brain tissues. It accounts for approximately 85% of all stroke cases and is among the leading causes of death and dis-
ability worldwide. In Sub-Saharan Africa, stroke-related mortality has increased by 25% in recent years, contrasting with a 30% decrease in northern countries. This rise is attributed to aging populations, increased vascular risk factors (hypertension, diabetes, obesity), and limited healthcare infrastructure [2], [13].

Early identification using Computed Tomography (CT) helps correlate clinical status with vessel occlusion, enabling timely thrombolytic therapy or mechanical thrombectomy. Magnetic Resonance Imaging (MRI) and CT remain the primary imaging modalities for lesion assessment and vascular territory delineation [9],[4]. However, manual segmentation by neuroradiologists is labor-intensive and subjective, leading to variability. Automated segmentation enhances reproducibility and accuracy, especially in resource-limited settings [18], [12].

Computer-aided decision support systems, particularly those based on automatic segmentation, are crucial for stroke diagnosis in low-resource environments [14],[17]. Challenges include limited research funding, infrastructural constraints, and a shortage of neurology specialists [15],[11]. This study proposes a hybrid U-Net and Bayesian Capsules approach for stroke lesion segmentation to improve ischemic lesion identification. Integrating probabilistic modeling into CNN architectures offers a promising solution, particularly in middle-income countries where advanced diagnostic tools are scarce.

In this paper, we develop a new segmentation approach by combining the U-Net model with a Bayesian capsule algorithm. We show that this probabilistic approach provides advantages over traditional segmentation models, including models. This approach allows for better uncertainty management and more robust segmentation, especially for images with complex or uncertain features. Moreover, we propose an adapted training methodology for networks combining U-Net and Bayesian capsules, including weight initialization and normalization techniques to improve model performance and ensure stability during training. We also demonstrate that our approach optimizes the U-Net architecture by integrating the Bayesian capsule to better capture hierarchical relationships in different regions of interest in the images. The paper is structured as follows: Section 2 reviews related works on automatic ischemic lesion segmentation. Section 3 details the proposed Bayesian Capsules and CNN-based approach. Section 4 provides a detailed presentation of the experimental results and performance evaluation in the context of early ischemic stroke diagnosis.

## II RELATED WORKS

Before the advent of high-performance computing and large-scale datasets, early methods for automatic ischemic lesion segmentation relied on manual feature extraction combined with basic machine learning algorithms. The introduction of the ISLES challenge, dedicated to ischemic stroke lesion segmentation [3], marked a significant milestone. Over multiple editions, it provided a benchmark dataset and an evaluation framework for comparing segmentation methods [10]. Most submitted solutions leveraged deep learning architecture [16]. U-Net and its variants became essential due to their convolutional neural network (CNN) design, optimized for biomedical image segmentation [8]. Recent studies have explored the integration of Bayesian capsules into segmentation models. These methods combine capsule networks, which capture hierarchical spatial relationships in images, with probabilistic modeling to estimate prediction uncertainty. Incorporating Bayesian capsules into architectures like U-Net has shown promise in improving segmentation robustness and accuracy, particularly in cases where image quality is degraded by non-optimized acquisitions or resource limitations. Several adaptations of U-Net have also been proposed. Some approaches integrate a 3D U-Net with a variational
decoder branch, enhancing supervision and regularization [7]. Others adopt a two-stage cascaded approach, where an initial rough segmentation is refined in a second phase. The nnU-Net framework was developed to automatically adapt U-Net to different datasets, streamlining medical image segmentation.

# III PROPOSED APPROACH

In this section, we describe the proposed approach by presenting the data used and its preprocessing. Then, we detail the overall architecture of our segmentation approach, and finally, we present the modeling, training, and testing phases.

## 3.1 Dataset and Preprocessing

The dataset consists of brain CT images, manually annotated and collected from a cohort of 83 patients in the subacute phase of stroke. For each patient, approximately 225 images per sequence were acquired, with an average of 100 axial images from sequence 2 used, totaling around 8,300 images. These images were obtained using a Siemens SOMATOM EMOTION 16 scanner (2011 model), without contrast agent, at the University Hospital of Cotonou (Benin). They reflect the clinical heterogeneity of ischemic stroke presentations. By a standard data split protocol, the dataset was divided into 70% for training, 20% for validation, and 10% for testing.

For vascular territory detection, a rigorous preprocessing pipeline was applied: images were resized to 640×640 pixels to ensure uniform input for machine learning models. A Gaussian filter was applied to reduce noise while preserving vascular structures. Finally, data augmentation techniques were employed to enhance the model's robustness and generalization capability.

## 3.2 Motivation and Contribution

In this paper, we propose a new segmentation approach by combining the U-Net model with a Bayesian capsule algorithm. We show that this probabilistic approach provides advantages over traditional segmentation models, including models. This approach allows for better uncertainty management and more robust segmentation, especially for images with complex or uncertain features. Moreover, we propose an adapted training methodology for networks combining U-Net and Bayesian capsules, including weight initialization and normalization techniques, to improve model performance and ensure stability during training. We also demonstrate that our approach optimizes the U-Net architecture by integrating the Bayesian capsule to better capture hierarchical relationships between different regions of interest in the images. Finally, we prove that it is possible to adapt this combined model by using a capsule-based Variational Autoencoder (VAE) approach, to enhance the representation of latent data and better capture complex variations present in medical images. Our results show that this combined model outperforms traditional approaches to complex medical datasets, reducing complexity while maintaining competitive performance and providing more accurate and reliable segmentation results in clinical contexts.

## 3.3 Proposed Segmentation Approach Architecture

To detect vascular territories from CT images, we propose a comparative study of the performance of three models trained on the same dataset. The first is a pre-trained YOLO model capable of identifying various vascular territories as well as lesion areas. The second relies on the classical U-Net architecture, widely used for semantic segmentation. The third model is an optimized version resulting from the combination of U-Net and a Bayesian capsule network,
specifically designed for resource-constrained environments characterized by limited data volume and restricted computational capacity. The integration of the Bayesian framework into the capsule architecture enhances system robustness by improving the handling of prediction uncertainties and more effectively capturing hierarchical spatial relationships within the data. Figure ?? illustrates the architectures of the U-Net and U-Net-CapsuleBayesian models.

<figure><img src="image_2.png" /><figcaption>Figure 1: Architecture of the original U-Net model</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Figure 2: Corresponding labeled image</figcaption></figure>

## 3.4 Model Training Phase

The three segmentation models were trained on annotated images, as depicted in Figure 3. To ensure consistency in the experimental conditions, a comparative analysis was performed using identical hyperparameters. The batch size was fixed at 64, considering memory constraints, and training was conducted over 50 epochs with early stopping applied using a patience parameter of 3. Optimization was performed using the softmax activation function, with an initial learning rate set to 0.0001.
Model performance was evaluated using Dice loss and the Dice coefficient, which quantify the similarity between predicted segmentations and reference binary vascular masks. The U-Net with Bayesian Capsules model was implemented in Keras (TensorFlow 2.11.0, CUDA 11.2) and executed on an NVIDIA Tesla T4 GPU. The dataset includes five classes: four vascular territories (ACA, MCA-Right, MCA-Left, and PCA) and one class corresponding to hypodense regions, as illustrated in Figure 3.

<figure><img src="image_4.png" /><figcaption>Figure 3: Corresponding labeled image</figcaption></figure>

## 3.5 Modeling and testing

Capsule Networks consist of at least one layer of capsules, where each capsule $i$ in a lower layer $L_i$ (child) is associated with capsules $j$ in an upper layer $L_j$ (parent). Each layer contains several lower-level capsules, each defined by a pose matrix $M_i \in R^{4 \times 4}$, which encodes their instantiation parameters, and an activation probability $a_i$.

The pose matrix represents the spatial relationship between an entity and the observer, while the activation probability $a_i$ indicates the actual presence of that entity. Lower-level capsules use their pose matrix $M_i$ to generate a vote for the estimated pose of a higher-level capsule. This vote is obtained through a weighted and viewpoint-invariant transformation:

$$V_{j|i} = M_i W_{ij} \qquad (1)$$

where $V_{j|i}$ denotes the vote cast by capsule $i$ towards capsule $j$, and $W_{ij} \in R^{4 \times 4}$ is a trainable transformation matrix.

The pose matrix $M_j$ of a higher-level capsule $j$ is computed as the weighted mean of the votes received from capsules in $L_i$. This update is carried out following the Expectation-Maximization (EM) routing algorithm, as proposed by Hinton, [8]:

$$M_j = \frac{1}{R_j} \sum_i V_{j|i} R_{ij} \qquad (2)$$
where $R_{ij}$ represents the posterior responsibility of capsule $j$ towards capsule $i$, and $R_j$ is defined as $R_j = \sum_i R_{ij}$. The routing coefficients are adjusted through a variant of the EM algorithm applied to Gaussian mixtures, and they are updated based on the agreement between $V_{j|i}$ and $M_j$.

In dynamic routing [6], this agreement is quantified by the dot product between capsule vectors and can be generalized to matrices using the Frobenius norm:

$$ \|M_j - V_{j|i}\|_F \qquad (3) $$

Finally, a parent capsule $j$ is activated only if the votes $V_{j|i}$ from child capsules $i$ form a dense cluster in $R^D$, indicating a high consensus on its pose $M_j$.

## IV RESULTS AND DISCUSSION

The conventional YOLO and U-Net architectures were trained and evaluated using the same dataset as the proposed hybrid model, which combines U-Net with Bayesian Capsule Networks. Model performance was assessed based on three key metrics: precision, recall, and overall accuracy.

Experimental findings demonstrate that integrating the Capsule Network module significantly enhances the model's ability to capture complex spatial relationships between anatomical structures. This improvement is reflected by a precision of 90.63%, which surpasses the precision achieved by the baseline models, as reported in Table 1. Figure 6 illustrates the segmentation outputs, along with the corresponding ROC curves and the confusion matrix.

As observed in Table 1, the proposed architecture consistently outperforms YOLO and U-Net in terms of precision, recall, and accuracy, while also achieving lower training losses. Moreover, a focused analysis on a subset of 8300 segmented images confirms the model's superior ability to delineate ischemic lesion regions more accurately than conventional approaches.

<table><caption>Table 1: Comparative evaluation of precision, accuracy, and recall for the default U-Net, the U-Net enhanced with Bayesian Capsules, and the YOLO architecture.</caption><thead><tr><th rowspan="2">Model</th><th colspan="3">Performance Evaluation Criteria</th></tr><tr><th>Accuracy</th><th>Precision</th><th>Recall</th></tr></thead><tbody><tr><td>Proposed</td><td>90.63%</td><td>89.99%</td><td>90.31%</td></tr><tr><td>U-Net</td><td>87.1%</td><td>82.6%</td><td>81.7%</td></tr><tr><td>YOLO</td><td>90.5%</td><td>87.4%</td><td>89.8%</td></tr></tbody></table>
<figure><img src="image_5.png" /><figcaption>Figure 4: Courbe ROC</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Figure 5: Matrice de confusion</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 6: Image prédite avec le modèle proposé</figcaption></figure>
As shown in Figure 5, the confusion matrix reveals good detection of ischemic regions in both the left and right MCA, with 30,200 pixels correctly classified despite moderate confusion with the ACA. The Hypodensity class, representing the lesions, includes 7,720 correctly segmented pixels but exhibits some confusion with the ACP, reflecting difficulty in distinguishing low-contrast areas. Performance for the ACA (11,893 pixels) and ACP (18,242 pixels) remains lower, likely due to underrepresentation or low visual distinctiveness. Overall, the model effectively detects key vascular regions and hypodense lesions but requires improvements in topographic precision and management of low-contrast structures. Although BayesCap is not specifically designed for vascular territory detection and hypodensity segmentation, it still achieves excellent results. This highlights the benefits of its well-calibrated uncertainty estimates for downstream tasks. The model revealed that, out of the 5,430 identified hypodensity cases, 4,920 were located in the left middle cerebral artery (MCA-LEFT) and the remainder in the right middle cerebral artery (MCA-RIGHT).

V CONCLUSION

This paper introduces a novel segmentation approach that combines U-Net with Bayesian capsule routing. Our method leverages U-Net's strength in multi-scale feature extraction while incorporating a Bayesian capsule model to explicitly capture uncertainty and spatial relationships within segmented objects. Unlike traditional methods, we model uncertainty not only in capsule parameters but also in routing coefficients, which enhances both flexibility and regularization of the model. In our study of 8300 segmented images, 5430 lesions were located within the middle cerebral arteries (MCA), with the remainder found in other arterial regions. These findings underscore the predominance of ischemic strokes in the MCA, emphasizing its critical role in pathological diagnosis. We evaluate our approach across various medical and natural image segmentation datasets, showing superior performance relative to standard U-Net architectures and conventional capsule networks. Notably, our method demonstrates enhanced robustness to intensity changes and deformations, as well as better generalization to out-of-distribution data. Future work will focus on further extending the Bayesian framework to improve these capabilities.

REFERENCES

Publications

[1] P. Viola and W. M. Wells. "Alignment by maximization of mutual information". In: *International Journal of Computer Vision* 24.2 (1997), pages 137–154.

[2] G. A. Donnan, M. Fisher, M. Macleod, and S. M. Davis. "Stroke". In: *The Lancet* 371.9624 (2008), pages 1612–1623.

[3] O. Ronneberger, P. Fischer, and T. Brox. "U-Net: Convolutional Networks for Biomedical Image Segmentation". In: *Lecture Notes in Computer Science (LNCS), MICCAI 9351* (2015), pages 234–241.

[4] K. Kamnitsas, C. Ledig, V. F. Newcombe, J. P. Simpson, A. D. Kane, D. K. Menon, et al. "Efficient multi-scale 3D CNN with fully connected CRF for accurate brain lesion segmentation". In: *Medical Image Analysis* 36 (2017), pages 61–78.

[5] O. Maier, B. H. Menze, J. von der Gablentz, L. Häni, N. Müller-Lenke, R. Weber, et al. "ISLES 2015–A public evaluation benchmark for ischemic stroke lesion segmentation from multispectral MRI". In: *Medical Image Analysis* 35 (2017), pages 250–269.
[6] S. Sabour, N. Frosst, and G. E. Hinton. "Dynamic Routing Between Capsules". In: *Advances in Neural Information Processing Systems (NeurIPS)* 30 (2017), pages 3856–3866.

[7] A. V. Dalca, G. Balakrishnan, J. Guttag, and M. R. Sabuncu. "Unsupervised learning for fast probabilistic diffeomorphic registration". In: *Advances in Neural Information Processing Systems (NeurIPS)* 31 (2018), pages 1020–1030.

[8] G. E. Hinton, S. Sabour, and N. Frosst. "Matrix Capsules with EM Routing". In: *arXiv preprint arXiv:1710.09829* (2018).

[9] A. de Havenon, S. Yaghi, E. A. Mistry, A. Delic, S. Hohmann, E. Shippey, et al. "En-dovascular thrombectomy in acute ischemic stroke patients with COVID-19: prevalence, demographics, and outcomes". In: *Journal of Neurointerventional Surgery* 12.11 (2020), pages 1045–1048.

[10] R. LaLonde, Z. Xu, I. Irmakci, S. Jain, and U. Bagci. "Capsules for Biomedical Image Segmentation". In: *Medical Image Analysis* 68 (2020), page 101889.

[11] S. K. Lee, T. Y. Chung, and H. Y. Choi. "ISLES: Ischemic Stroke Lesion Segmentation Challenge". In: *ISLES Challenge Website* (2020). Available at: https://isles-challenge.org (Accessed: 30 July 2025).

[12] G. Ntaios. "Ischemic stroke in patients with COVID-19: an overview of the current literature". In: *Journal of Stroke and Cerebrovascular Diseases* 29.9 (2020), page 105092.

[13] V. L. Feigin, B. A. Stark, C. O. Johnson, G. A. Roth, C. Bisignano, G. G. Abady, et al. "Global, regional, and national burden of stroke and its risk factors, 1990–2019: a systematic analysis for the Global Burden of Disease Study 2019". In: *The Lancet Neurology* 20.10 (2021), pages 795–820.

[14] F. Isensee, P. F. Jaeger, P. M. Full, P. Vollmuth, and K. H. Maier-Hein. "nnU-Net: a self-adapting framework for U-Net-based medical image segmentation". In: *Nature Methods* 18.2 (2021), pages 203–211.

[15] X. Liu, L. Song, S. Liu, Y. Zhang, T. Wang, Y. Li, et al. "A review of deep-learning-based medical image segmentation methods". In: *Sustainable Cities and Society* 74 (2021), page 103612.

[16] A. Williams and D. M. D. Nguyen. "U-Net Cascade for Improved Tumor Segmentation". In: *Journal of Computational Biology* 22.4 (2021), pages 215–223.

[17] L. Cui, Z. Fan, Y. Yang, R. Liu, D. Wang, Y. Feng, J. Lu, and Y. Fan. "Deep learning in ischemic stroke imaging analysis: A comprehensive review". In: *Biomed Research International* 2022 (2022), Article ID 2456550.

[18] M. Owolabi, A. G. Thrift, S. Martins, W. Johnson, J. Pandian, F. Abd-Allah, and P. Lavados. "The state of stroke services across the globe: Report of World Stroke Organization-World Health Organization surveys". In: *International Journal of Stroke* 17.1 (2022), pages 8–16.