Abstract
Accurate 3D medical image segmentation is vital for clinical decision-making, yet standard architectures often fail to incorporate non-image patient metadata. We present nnY-Net, a novel "Y"-shaped architecture that integrates patient clinical data (e.g., pathology and treatment history) via a cross-attention module. By combining a Swin Transformer encoder for global context with a ConvNeXt-based decoder for spatial precision, nnY-Net achieves state-of-the-art performance in liver tumor segmentation. Our results demonstrate that cross-attention-based fusion of multi-modal data significantly improves segmentation accuracy and boundary definition compared to traditional U-Net variants.
Introduction
3D medical image segmentation, particularly for liver tumors, is essential for effective treatment planning. However, current deep learning approaches face two primary challenges: capturing long-range dependencies within complex 3D volumes and effectively utilizing non-image "tabular" metadata. While clinicians routinely use patient history, pathology reports, and treatment types to inform their decisions, most segmentation models rely solely on image data.
This paper introduces nnY-Net, a hybrid architecture designed to bridge this gap. By leveraging the strengths of both Transformers and Convolutional Neural Networks (CNNs), and introducing a principled method for injecting patient-specific context, nnY-Net provides a more holistic approach to medical image analysis.
Methods
The nnY-Net architecture incorporates several key innovations to optimize segmentation performance:
The "Y" Structure and Cross-Attention
Unlike the standard U-Net, nnY-Net introduces a third branch at the bottleneck. This branch utilizes a Cross-Attention module where the lowest-level image features serve as the "Key" and "Value," while patient metadata (such as pathology and treatment information) acts as the "Query." This mechanism allows the model to dynamically weight image features based on clinical context.
Hybrid Backbone
The model employs a Swin Transformer as the encoder to capture global context through shifted-window self-attention. For the decoder, it utilizes MedNeXt (a ConvNeXt-based architecture) to maintain high-resolution spatial precision at the pixel level, ensuring accurate boundary localization.
Loss Function and Preprocessing
To address the extreme class imbalance typical in medical imaging, the authors utilize DiceFocalCELoss, a combination of Dice Loss, Focal Loss, and Cross-Entropy. The preprocessing pipeline, based on the nnU-Net framework, includes automated tabular data imputation using 11 machine learning models and rigorous 3D image operations such as cropping, clipping, and resampling.
Datasets
The study was conducted using a dataset of 110 liver CT scans from 98 patients, with labels for the liver, tumors, veins, and aorta. The patient metadata included 56 variables, such as pathology grading and treatment metrics.
The authors noted significant missingness in the metadata, particularly regarding tumor size, which was addressed through a robust ML-based imputation strategy. The geometric variability of the dataset, as shown in the spacing and size distributions above, necessitated the automated preprocessing steps.
Results
The nnY-Net was evaluated against several baseline models, including U-Net, UNETR, SwinUNETR, and MedNeXt.
- Liver Segmentation: nnY-Net achieved a Dice score of 0.875, outperforming SwinUNETR (0.786) and MedNeXt (0.852).
- Tumor Segmentation: The Swin-NeXt + Cross Attention configuration achieved a Dice score of 0.620 and a significantly lower Hausdorff Distance (HD95) of 13.331, indicating superior boundary definition.
- Fusion Strategy: Comparative tests revealed that Cross-Attention provided more stable improvements than simple addition or concatenation, preventing convergence issues often associated with transposed convolutions in the decoder.
Discussion and Conclusion
The results suggest that a hybrid approach—using Transformers for encoding global context and modern CNNs for decoding spatial details—is highly effective for 3D medical segmentation. Furthermore, the integration of clinical metadata via cross-attention provides a measurable boost in accuracy, especially for challenging targets like tumors.
While nnY-Net demonstrates state-of-the-art potential, the authors acknowledge that training time was a constraint. Future work will focus on optimizing feature extraction block ratios and exploring larger model variants to further push the boundaries of segmentation performance.
Summary updated