MSc thesis2025Open access

Advanced boundary-enhanced instance segmentation and spatial-temporal transformer models for automated schizophrenic investigation

Osasumwen Raphael Imarhiagbe

University of Lethbridge, Department of Mathematics and Computer Science (Master of Science thesis)

Read in OPUS

Abstract

Accurate segmentation and detection in neuroimaging is essential for advancing clinical understanding and the diagnosis of schizophrenia. This thesis introduces Boundary-Refined Attention Network (BoRefAttnNet), a novel boundary-refined 3D U-Net variant specifically designed for precise segmentation of subcortical brain structures from structural magnetic resonance imaging (sMRI). BoRefAttnNet incorporates multi-scale boundary attention modules that explicitly highlight anatomically critical edges while suppressing background noise, significantly improving segmentation accuracy for small or complex anatomical structures. Evaluations using FastSurfer-processed sMRI data from the publicly available Centre for Biomedical Research Excellence (COBRE) dataset demonstrate that BoRefAttnNet significantly outperforms conventional 3D U-Net baselines in accurately delineating key subcortical structures, including the hippocampus, amygdala, and basal ganglia. Building upon this enhanced segmentation capability, we further experiment with a Dynamic Spatial-Temporal Transformer Model (DySTTM) to detect schizophrenia by integrating structural and functional MRI (fMRI) modalities. The DySTTM leverages spatial attention to capture anatomical interdependencies from segmented sMRI data and temporal attention to model dynamic brain connectivity patterns from resting-state fMRI. Experimental results indicate that the integration of these multimodal imaging features using DySTTM provides superior diagnostic accuracy and interpretability compared to established models such as 3D ResNet and XGBoost classifiers.

  • boundary-aware segmentation
  • attention mechanisms
  • deep learning
  • multimodal fusion
  • dynamic spatial-temporal modeling
  • medical image segmentation
  • computational psychiatry
Thesis pipeline: structural and functional MRI to a schizophrenia decisionStructural MRI is pre-processed with FastSurfer and segmented by BoRefAttnNet into subcortical masks. Resting-state functional MRI provides time series. DySTTM fuses the masks with the time series using spatial and temporal attention and outputs a patient-versus-control decision.STRUCTUREFUNCTIONsMRIT1 volumeCOBRE datasetFastSurferpre-processingBoRefAttnNet3D U-Net + boundaryattention at each scaleSubcortical maskshippocampus · amygdalabasal gangliars-fMRIresting stateRegional time seriesactivity per structure, over the scanDySTTMspatial × temporalattentionDecisionpatient /controlCompared against 3D U-Net (segmentation) and 3D ResNet / XGBoost (classification) baselines in the thesis.
The two contributions as one pipeline. BoRefAttnNet turns structural scans into boundary-faithful masks of small subcortical structures; DySTTM reads those masks together with resting-state functional signals to detect schizophrenia. Conceptual figure drawn from the published description.
Soft region prediction versus boundary-refined segmentationTwo drawings of the same brain structure. On the left its edge is blurred and uncertain; on the right the edge is drawn sharply, with attention concentrated along the boundary.Voxel-wise predictionthe edge is a guessBoundary attentionthe edge is learned explicitly
Conceptual illustration. Subcortical structures such as the hippocampus and amygdala are small, with low contrast against their neighbours; errors concentrate at their boundaries.
BoRefAttnNet architecture schematicA structural MRI volume enters a three-level encoder that halves resolution at each level, passes through a bottleneck, and is rebuilt by a decoder. Each decoder level receives a skip connection from the encoder and carries a Boundary Attention Module that emphasises anatomical edges before the final segmentation of subcortical structures is produced.Encoder3D convolutions · downsamplingBottleneckDecoder + boundary attentionupsampling · skip fusion · edge emphasissMRI volumeFastSurfer-processed1×½¼⅛BAM¼BAM½BAM1×encoder blockdecoder blockBoundary Attention Moduleskip connectionSkip connections carry fine spatial detail to each decoder level · resolution shown relative to the input (1× → ⅛ → 1×)Segmentationsubcortical masks
BoRefAttnNet, a boundary-refined 3D U-Net. Boundary Attention Modules (BAM) at each decoder scale highlight anatomically critical edges while suppressing background noise; the outputs are masks of the hippocampus, amygdala and basal ganglia. Schematic drawn from the published description; exact layer configuration is in the thesis.
DySTTM pipeline schematicStructural MRI is segmented by BoRefAttnNet and passed to a spatial-attention transformer that models anatomical interdependencies. Resting-state functional MRI is windowed over time and passed to a temporal-attention transformer that models dynamic connectivity. The two representations are fused and classified, and compared against 3D ResNet and XGBoost baselines.StructuresMRIstructural volumeBoRefAttnNetsubcortical segmentationSpatial attentionanatomical interdependenciesFunctionrs-fMRIresting-state time serieswindowed connectivityTemporal attentiondynamic connectivity patternsMultimodalfusionSZ /controlcompared against3D ResNetXGBoostData: COBRE (public), FastSurfer-processed · Training on NVIDIA L4 GPUs (GCP)
DySTTM fuses the segmented structural representation with dynamic functional connectivity. Spatial attention captures how regions relate anatomically; temporal attention captures how connectivity evolves over the scan.

The question

Schizophrenia leaves subtle traces in the brain: small differences in the size and shape of subcortical structures, and differences in how regions talk to each other over time. Measuring either reliably depends on segmentation that is accurate at the edges of small structures, and on models that can read structure and function together.

Two contributions

BoRefAttnNet addresses the first problem. It is a 3D U-Net whose decoder carries multi-scale boundary attention modules: at each resolution the network is pushed to represent where a structure ends, not only where it is. On FastSurfer-processed sMRI from the public COBRE dataset it outperformed conventional 3D U-Net baselines, most clearly at the boundary.

DySTTM, the Dynamic Spatial-Temporal Transformer Model, addresses the second. It takes the segmented structural representation and resting-state fMRI, applies spatial attention to anatomical interdependencies and temporal attention to the evolving connectivity patterns, fuses the two, and classifies. Against 3D ResNet and XGBoost classifiers the multimodal model gave the best accuracy and ROC-AUC.

Results

The data is the public COBRE release: 174 people, 88 diagnosed with schizophrenia and 86 controls, split 70 / 15 / 15 into training, validation and test sets.

Segmentation

ModelLossDiceHausdorff (mm)ASD (mm)
3D U-NetCross-entropy0.94257.900.29
3D U-NetCross-entropy + boundary0.95406.450.23
BoRefAttnNetCross-entropy0.96554.570.18
BoRefAttnNetCross-entropy + boundary0.96913.080.16
Segmentation on the held-out test set. Dice is the macro average over six classes; lower is better for both distances. Source: thesis, Table 4.2.

The gain is largest where it was meant to be, at the edge. Hausdorff distance, the worst-case boundary error, falls from 7.90 mm for the plain 3D U-Net to 3.08 mm. Per structure, BoRefAttnNet reaches a Dice of 0.96 on the hippocampus, 0.95 on the amygdala and 0.97 on the basal ganglia (Table 4.3).

Detection

ModelAccuracyPrecisionRecallF1ROC-AUC
DySTTM0.920.890.880.8850.94
3D ResNet0.890.880.910.8950.90
XGBoost0.850.830.740.7850.88
Schizophrenia versus control. The best value in each column is in bold, including the two where the baseline wins. Source: thesis, Table 5.1. Paired t-tests on accuracy, 25 degrees of freedom: t = 3.45, p < 0.01 against 3D ResNet; t = 5.12, p < 0.001 against XGBoost.

DySTTM is the most accurate of the three and separates the two groups best across thresholds. It is not ahead everywhere: the 3D ResNet finds slightly more of the true cases.

How it was built

Models were trained on a Google Cloud instance with four NVIDIA L4 GPUs. Segmentation was evaluated with Dice, Hausdorff distance and average surface distance; detection with accuracy, precision, recall, F1 and ROC-AUC. Data came from the Centre for Biomedical Research Excellence (COBRE) release, pre-processed with FastSurfer.

The defence

I defended the thesis at the University of Lethbridge on 12 August 2025.

Osasu at the lectern in a seminar room at the University of Lethbridge, with the title slide of his thesis on the screen behind him
Defence day, 12 August 2025.

Read it

The full thesis is open access at the University of Lethbridge repository: hdl.handle.net/10133/7170. The conference version of the segmentation work is BoRefAttnNet (ICICT 2026).

How to cite

@mastersthesis{imarhiagbe2025thesis,
  author = {Imarhiagbe, Osasumwen Raphael},
  title  = {Advanced boundary-enhanced instance segmentation and spatial-temporal transformer models for automated schizophrenic investigation},
  school = {University of Lethbridge},
  year   = {2025},
  url    = {https://hdl.handle.net/10133/7170}
}

More

Other publications

2026
Conference paper

BoRefAttnNet: Boundary-Refined 3D Brain MRI Segmentation with Multi-Scale Attention for Schizophrenia Analysis

Osasumwen R. Imarhiagbe, John Z. Zhang

ICICT 2026 proceedings · Lecture Notes in Networks and Systems vol. 2108 · pp. 223–232 · Springer, Cham

DOIDetails →