4.1. Dataset
Brain Tumor Dataset: The first dataset used in this study was the publicly available Brain Tumor Dataset: Segmentation & Classification, released by Indrakumar K on Kaggle. This derivative repository was assembled from the four-class Brain Tumor MRI Dataset on Kaggle and the contrast-enhanced MRI dataset developed by Cheng et al. and distributed through SciDB v1 and Figshare v8 [
36]. The former mainly provides image-level diagnostic labels, whereas the pixel-level annotations used in this study were not generated by the authors of the present work or inferred from the classification labels. Instead, they originate from the Cheng dataset, which provides manually delineated tumor contours and corresponding binary tumor masks. The associated study reports that the tumor boundaries were manually delineated by three experienced radiologists for 3064 T1-weighted contrast-enhanced MRI slices collected from 233 patients. The derivative segmentation subset used in our experiments contains 2192 two-dimensional MRI image–mask pairs, comprising 554 glioma, 708 meningioma, and 930 pituitary tumor images. Only one final mask is publicly available for each image. According to the repository description, intensity normalization to the range of 0 to 1, Gaussian filtering, and contrast enhancement were applied during dataset preparation. In our experiments, all images and masks were resized to 224 × 224 pixels and randomly divided into training and test sets at a ratio of 8:2 using a random seed of 42. Representative images and their corresponding ground-truth masks are shown in
Figure 4.
BRICS 2025: The second dataset used in this study was BRISC 2025, where BRISC denotes Brain tumor Image Segmentation and Classification [
37]. It is a curated dataset designed for brain tumor MRI segmentation and classification. The complete classification dataset contains 6000 two-dimensional, single-slice, contrast-enhanced T1-weighted MRI images, including 5000 training images and 1000 test images across four diagnostic categories: glioma, meningioma, pituitary tumor, and non-tumorous cases. For the segmentation experiments, only the official segmentation subset was used. This subset contains 4793 MRI image–mask pairs from the three tumor categories, including 3933 training pairs and 860 test pairs.
The segmentation masks were created using AnyLabeling and iteratively refined by a trained annotation team. The masks and class labels were subsequently verified under the supervision of a certified radiologist and physician, and disagreements were resolved collaboratively through visual comparison and overlap inspection. The images cover the axial, coronal, and sagittal planes, and their class and plane distributions are summarized in
Table 2. Representative images and corresponding ground-truth masks are shown in
Figure 5.
4.3. Evaluation Metrics
The comparative evaluation in our experiments was conducted using a series of metrics based on the confusion matrix. TP refers to the cases in which the model correctly predicts positive samples as positive. FP refers to the cases in which the model incorrectly predicts negative samples as positive. TN refers to the cases in which the model correctly predicts negative samples as negative. FN refers to the cases in which the model incorrectly predicts positive samples as negative.
Specifically, Accuracy (Acc), Precision (Pre), Recall, F1-score, Dice Coefficient, and Intersection over Union (IoU) were adopted in this study. Larger values of these metrics indicate better model performance. Through the collaborative evaluation of multiple metrics, the clinical applicability of the model can be quantified objectively and comprehensively. The corresponding formulas are given as follows.
Accuracy (Equation (20)) represents the proportion of correctly predicted samples among all samples. It measures the consistency between the predicted mask and the ground-truth mask over the entire image from the most intuitive perspective.
Precision (Equation (21)) represents the proportion of actual positive samples among all samples predicted as positive by the model. It evaluates the anti-interference capability of the model and quantifies its ability to suppress false alarms in normal tissues.
Recall (Equation (22)) represents the proportion of all real positive samples that are correctly identified by the model. It evaluates the detection capability of the model from a safety perspective and ensures that lesion regions are not missed.
F1-Score (Equation (23)) is the harmonic mean of Precision and Recall and is used to comprehensively evaluate both the Precision and Recall of the model. In class imbalance scenarios, it is usually more informative than Accuracy because it considers both false detections and missed detections.
The Dice coefficient (Equation (24)) is commonly used in image segmentation tasks to measure the degree of overlap between the predicted region and the ground-truth annotation region. In binary segmentation tasks, Dice has the same mathematical form as F1-score. It can be regarded as the F1-score in segmentation tasks and focuses on measuring the similarity between the predicted region and the real region.
IoU (Equation (25)) represents the ratio of the intersection between the predicted positive region and the real positive region to their union.
mIoU (Equation (26)) is a commonly used comprehensive evaluation metric in multi class segmentation tasks. It represents the average IoU across all classes and can comprehensively reflect the segmentation performance of the model for different categories. Therefore, it is more suitable for evaluating the overall segmentation quality in multi class tasks.
4.6. Experimental Results on Brain Tumor Dataset
The model was trained on the Brain Tumor Dataset for a total of 100 epochs. As shown in
Figure 6, the loss curves of the training set and validation set present a clear convergence trend. The losses decrease rapidly in the early training stage and become stable in the later stage without obvious divergence or abnormal oscillation. After 80 epochs, both curves tend to stabilize, and the numerical changes in the loss functions follow a reasonable pattern. These results indicate that the model achieves effective convergence during training.
As shown in
Table 3, detailed comparative experiments were conducted between the proposed model and various mainstream models. The bolded values indicate the best results. U-Net achieves an mIoU of 85.228% and a Dice coefficient of 0.796 through its classical encoder–decoder structure and skip connections, forming a strong baseline. Although Attention U-Net introduces gated attention into skip connections to suppress irrelevant backgrounds, its mIoU slightly decreases to 84.605%, indicating that simple spatial attention does not fully exploit the guiding potential of deep semantics for shallow features. DeepLabV3+ captures multi-scale context through the ASPP module and obtains the highest precision. However, its continuous downsampling and atrous convolution tend to lose tumor boundary details, resulting in a recall of only 82.971%. TransUNet embeds a Transformer encoder into the U-shaped structure and uses self-attention to model global dependencies, increasing the recall to 84.416%. However, the global receptive field also introduces a large amount of background interference, causing the precision to decrease to 73.368% and the Dice coefficient to only 0.753. UNet3+ adopts full-scale skip connections to fuse multi-level features, but this may lead to information redundancy and noise accumulation, with a recall of only 80.928% and an mIoU of 81.638%. VM-UNet performs long-range modeling based on the visual state space model SS2D, but it shows the weakest performance in this task because of its insufficient ability to preserve fine local spatial details.
To further clarify the methodological differences from the most closely related architectures, Attention U-Net and SLf-UNet were examined as representative attention-based and frequency-based variants, respectively. Attention U-Net uses coarse decoder semantics to gate fine encoder features in skip connections, thereby realizing implicit cross-scale feature selection. However, it lacks explicit receptive field adaptation and direct modeling of local texture transitions. In contrast, TSGM combines parallel convolutional branches with different receptive fields and texture-span gating in the encoder, enabling TSF U-Net to jointly characterize tumor morphology, heterogeneous textures, and boundary transitions. Consequently, TSF U-Net surpasses Attention U-Net by 1.866, 2.950, 2.051, and 2.477 percentage points in mIoU, Recall, Precision, and F1-score, respectively, while increasing the Dice coefficient by 0.023. SLf-UNet combines spatial features with low-frequency representations and performs upsampling through frequency-domain zero padding, with an emphasis on global structural information. In comparison, DCT-FGB uses aligned deep spectral features to generate gating masks that adaptively calibrate the shallow spectrum in each skip connection, followed by inverse transformation and residual spatial fusion. This semantically guided spectral filtering reduces irrelevant frequency responses while preserving useful spatial details. Compared with SLf-UNet, TSF U-Net improves mIoU, Recall, Precision, and F1-score by 1.099, 3.216, 3.876, and 3.095 percentage points, respectively, and increases the Dice coefficient from 0.742 to 0.819. These results demonstrate that the coordinated modeling of multi-scale morphology, pathological texture variations, and frequency-domain feature selection provides a more balanced segmentation representation than cross-scale attention or spatial and low-frequency fusion alone.
The proposed TSF U-Net achieves an mIoU of 86.471%, a recall of 87.424%, a Dice coefficient of 0.819, and an F1-score of 84.693%, all ranking first among the compared methods. Meanwhile, its precision remains very close to that of DeepLabV3+, indicating that the model maintains a high positive predictive ability while significantly improving tumor recall. These results fully demonstrate that the multi-scale texture enhancement of TSGM and the semantic cleaning of DCT-based frequency-domain gating can form an effective complement, thereby improving the comprehensive performance of brain tumor segmentation.
Figure 7 shows the visual segmentation results of different comparison algorithms on three different types of images in the test set. For axial images, almost all widely used U-Net-based comparison algorithms show inaccurate and unclear tumor boundaries. For coronal images, Attention U-Net, U-Net, and UNet3+ show obvious missegmentation, indicating a relatively high false-positive rate. For sagittal images, Attention U-Net, TransUNet, and VM-UNet produce obvious morphological misjudgments. In contrast, the proposed model effectively avoids these over-segmentation and missegmentation problems, and its predicted regions are closer to the real tumor morphology and boundaries. This further demonstrates that our model achieves better segmentation performance.
Furthermore, we perform comprehensive quantitative evaluations of the computational efficiency for all competing models as well as our proposed model. All the results are summarized in
Table 4. The computational efficiency results show that TSF U-Net contains 27.926 M parameters and requires 93.931 G FLOPs, with an inference latency of 15.031 ms and a throughput of 66.528 FPS. Compared with the original U-Net, the proposed model increases the parameter count and FLOPs by 10.663 M and 32.705 G, corresponding to increases of 61.77% and 53.42%, respectively. Its inference latency increases by 6.727 ms, while the FPS decreases by 44.76%. This additional cost is mainly associated with the parallel multi-scale convolutional branches of TSGM and the frequency-domain feature processing performed by DCT-FGB.
Nevertheless, TSF U-Net has fewer parameters than Attention U-Net, CENet, TransUNet, UNet3+, VM-UNet and SLf-UNet, and achieves lower latency than SLf-UNet, CCENet TransUNet, UNet3+, and VM-UNet. Although its FLOPs are relatively high, the model maintains a throughput of 66.528 FPS under the adopted experimental conditions. These results indicate that the improvements in segmentation performance are accompanied by a measurable computational cost, while the overall parameter scale and inference efficiency remain competitive with those of several comparison models.
4.7. Experimental Results on BRICS 2025 Dataset
The model was also trained on this dataset for 100 epochs. As shown in
Figure 8, both the training and validation loss curves show a clear downward trend. The training loss decreases from 0.445 to 0.068, with a reduction of approximately 84.7%, while the validation loss decreases from 0.271 to 0.108, with a reduction of approximately 60.3%. The two curves exhibit rapid decline in the early stage, smooth transition in the middle stage, and convergence to low values in the later stage. The training loss remains lower than the validation loss with a stable gap, and no obvious divergence or continuous increase in validation loss is observed. These results indicate that the model has stable optimization, favorable convergence, no obvious overfitting, and reliable generalization ability on this dataset.
Similar to the experiments on the Brain Tumor Dataset, the proposed model and other comparison models were trained on the BRICS 2025 Dataset, and the corresponding image segmentation results were obtained. The bolded values indicate the best results. As shown in
Table 5, the proposed model achieves the best performance in mIoU, Acc, Precision, and F1-score, with only Recall and Dice being slightly lower than those of Attention U-Net. In the visual comparison of image segmentation shown in
Figure 9, it can be intuitively observed that the proposed model identifies tumor regions and boundaries more accurately. The experimental results on BRICS 2025 demonstrate that the proposed model has favorable generalization ability and robustness. Compared with SLf-UNet, which mainly enhances global structural representation by combining spatial and low-frequency features, TSF U-Net further integrates explicit multi-scale texture modeling through TSGM and semantic-guided spectral calibration through DCT-FGB. This design strengthens boundary-related local variations while suppressing irrelevant shallow frequency responses. TSF U-Net outperforms SLf-UNet on every evaluation metric. These results indicate that the collaboration between spatial texture enhancement and adaptive frequency selection provides more balanced segmentation performance on the BRICS 2025 Dataset.
It should be noted that TSF U-Net achieves a Recall of 90.029%, which is 0.994, 0.362, and 0.811 percentage points lower than those of Attention U-Net, TransUNet, and U-Net, respectively. This difference may be attributed to the relatively conservative feature selection of the proposed model. TSGM provides less additional enhancement to low-contrast or blurred-boundary regions with limited local texture spans, while the deep semantic guidance in DCT-FGB may reduce the influence of weak tumor responses during frequency-domain feature selection. These mechanisms suppress false positives but may introduce a small increase in false negatives. In contrast, direct skip connections, spatial attention, and global self-attention may preserve a broader range of weak positive responses. Nevertheless, the Precision of TSF U-Net is 1.220, 2.050, and 0.797 percentage points higher than those of the three comparison models, respectively, while its mIoU and F1-score are also higher. The lower Recall therefore mainly reflects a tradeoff between Precision and Recall. Recall-sensitive loss functions and adaptive feature guidance will be investigated to reduce missed low-contrast tumor regions.
4.8. Ablation Study
To evaluate the individual and joint contributions of the proposed modules, ablation experiments were conducted on the Brain Tumor and BRICS 2025 datasets. Four configurations were compared: the U-Net baseline, the TSGM variant, the DCT-FGB variant, and the complete TSF U-Net. Their quantitative results are reported in
Table 5 and
Table 6, while representative segmentation results are shown in
Figure 10 and
Figure 11. The following analysis discusses the limitations of the baseline and the effects of each module.
The baseline model adopts the classical U-Net encoder–decoder architecture. As shown in
Table 6, all evaluation results of the U-Net baseline model are lower than those of the other ablation models. The bolded values indicate the best results. Although its Accuracy reaches 99.453%, its Precision is only 79.496% and its Recall is 86.933%. This indicates that the standard U-Net can identify most lesion regions, but it still produces many false-positive predictions. This problem is particularly obvious at the junctions between lesion boundaries and complex textures, where the feature representation lacks targeted boundary enhancement and noise suppression mechanisms. Similar limitations are observed on the BRISC 2025 Dataset. As shown in
Table 7, the U-Net baseline achieves the highest Recall of 91.162% among the ablation variants, but obtains the lowest mIoU, Precision, F1-score, and Dice values of 88.833%, 84.587%, 87.752%, and 0.838, respectively. These results indicate that the direct transmission of shallow features enables U-Net to retain a broader range of potential tumor responses, but also introduces background interference and false-positive predictions, thereby limiting the accuracy of tumor boundaries and regional overlap. The results on both datasets therefore consistently demonstrate the limitations of the baseline model in discriminative feature selection and noise suppression.
Effect of TSGM Block: On the Brain Tumor Dataset, compared with the baseline model, the TSGM variant achieves a substantial improvement of 1.504% in Precision, a slight increase of 0.002% in Dice, and simultaneous improvements in mIoU and F1-score. This improvement benefits from the adaptive receptive field coverage enabled by the parallel multi-branch structure, which allows the model to focus on both small-scale details and large-scale structural information. The pathological texture-span sensor (PTS) strengthens the responses of transition regions between pathological tissues and normal tissues through texture-span attention, effectively suppressing false activations of background and irrelevant tissues. Meanwhile, the Recall is also improved by 0.678%, indicating that the overall segmentation quality is significantly enhanced. On the BRICS 2025 Dataset, the TSGM variant improves Precision, mIoU, and F1-score by 0.793%, 0.046%, and 0.059%, respectively, and increases the Dice coefficient from 0.838 to 0.842. However, its Recall decreases by 0.778%. This result suggests that TSGM consistently improves feature selectivity and regional overlap, although its enhancement of weak or low-contrast tumor responses may vary across datasets.
Effect of DCT-FGB Block: On the Brain Tumor Dataset, the DCT-FGB variant obtains a Recall of 85.854%, which is slightly lower than that of the baseline model. However, the other metrics, including mIoU, Accuracy, Precision, F1-score, and Dice, are all improved compared with the baseline. Through frequency-domain zero padding and gating mechanisms, DCT-FGB preserves the frequency structure of deep semantic information and uses it as guidance to clean shallow features. This process improves the reliability of shallow feature transmission and enhances the representation of true tumor-related regions, while exerting a relatively moderate suppression effect on false positives. Consistent results are obtained on the BRICS 2025 Dataset. Compared with U-Net, the DCT-FGB variant improves mIoU, Precision, and F1-score by 0.058, 1.071, and 0.075 percentage points, respectively, while the Dice coefficient increases from 0.838 to 0.839. Its Recall decreases by 1.053 percentage points, whereas Accuracy remains nearly unchanged. These results further indicate that frequency-domain semantic guidance improves the suppression of irrelevant shallow responses, but may also reduce the contribution of weak tumor features that are insufficiently represented in deep semantic features.
The TSF U-Net employs the TSGM block in the deep encoder stages and embeds DCT-FGB into all skip connections, forming a feature-learning strategy with collaborative enhancement in both the spatial and frequency domains. Specifically, the model captures local details and multi-scale contextual information of large lesion regions in the deep encoder stages, while performing lossless filtering on shallow spectra at the skip connection stage. In this way, the network obtains both boundary localization ability and semantic consistency. The experimental results show that only the Recall of the complete model is slightly lower than that of the TSGM variant by 0.19 percentage points. This may be because the DCT-FGB module suppresses some low-contrast, blurred-boundary, or diffuse lesion regions to a certain extent. Nevertheless, all other metrics are significantly improved compared with the baseline model and the single-module variants. This indicates that the complete model significantly enhances segmentation boundary accuracy by appropriately reducing the noise sensitivity of extreme recall regions, achieving a better balance between boundary misclassification suppression and regional completeness. On the BRICS 2025 Dataset, the complete TSF U-Net achieves the highest mIoU, Accuracy, F1-score, and Dice values of 89.055%, 99.507%, 88.026%, and 0.846, respectively. Compared with the baseline, it improves mIoU, Precision, and F1-score by 0.222, 0.875, and 0.274 percentage points, respectively, although Recall decreases slightly by 0.413 percentage points. More importantly, compared with the DCT-FGB-only and TSGM-only variants, the complete model improves Recall by 0.640 and 0.365 percentage points and mIoU by 0.164 and 0.176 percentage points, respectively. This demonstrates that the spatial and frequency-domain modules complement each other and partially compensate for the sensitivity reduction observed when either module is used independently. The visual results also intuitively show that the final model produces better segmentation maps than the other models, which is often of greater practical value in clinical segmentation scenarios.
To further investigate how the proposed modules influence feature learning, feature activation maps of the ablation variants on the two datasets are visualized in
Figure 12 and
Figure 13. Warmer colors indicate regions receiving greater activation, while the contours denote the ground-truth tumor regions. The U-Net baseline exhibits weak or incomplete lesion responses in some cases, together with scattered activations outside the tumor regions, indicating that direct skip connections may transmit irrelevant shallow textures to the decoder. After introducing TSGM, the activation distributions are more closely aligned with heterogeneous intratumoral regions and tumor boundary transitions. This observation is consistent with the texture-span mechanism, which emphasizes regions exhibiting pronounced local feature variations. DCT-FGB further concentrates the responses in semantically relevant tumor regions and attenuates several peripheral background activations, suggesting that deep semantic frequency gating selectively filters shallow responses that are inconsistent with tumor semantics. The complete TSF U-Net generally produces more coherent activation within the annotated regions, demonstrating the complementary effects of spatial texture enhancement and frequency-domain feature selection. Nevertheless, residual extra-tumoral activations or incomplete responses at low-contrast boundaries remain in several examples, which may account for the observed tradeoff between Precision and Recall. These qualitative results provide additional evidence for the internal mechanisms and limitations of the proposed modules.
4.9. Cross-Dataset Generalization Experiment
To further evaluate the generalization ability of TSF U-Net under dataset distribution shifts, bidirectional cross-dataset experiments were conducted between the Brain Tumor Dataset and the BRISC 2025 Dataset. In each experiment, the model was trained only on the source dataset and directly evaluated on the target dataset without target-domain fine-tuning or parameter updating. The same preprocessing and evaluation settings were used to ensure that the results reflected the transferability of the learned representations rather than adaptation to the target dataset.
As shown in
Table 8, when trained on the Brain Tumor Dataset and tested on the BRICS 2025 Dataset, TSF U-Net achieves an mIoU of 77.369%, a Recall of 82.998%, an F1-score of 71.639%, and a Dice coefficient of 0.632. These results indicate that the model retains a certain ability to identify tumor regions across datasets. However, the Precision decreases to 63.015%, suggesting that differences between the source and target distributions introduce additional false-positive predictions. In the reverse direction, training on the BRICS 2025 Dataset and testing on the Brain Tumor Dataset results in an mIoU of 70.881%, a Recall of 77.973%, a Precision of 48.773%, an F1-score of 60.009%, and a Dice coefficient of 0.564. Compared with the opposite direction, mIoU, Recall, Precision, and F1-score decrease by 6.488%, 5.025%, 14.242%, and 11.630%, respectively. This directional difference suggests that features learned from the Brain Tumor Dataset transfer more effectively to the BRICS 2025 Dataset than vice versa.
Overall, the results demonstrate that TSF U-Net retains a degree of cross-dataset transferability, while the performance degradation, particularly in Precision and Dice, reveals the continuing influence of differences in image acquisition, intensity distribution, lesion appearance, and annotation criteria. Future work will investigate domain adaptation and intensity normalization strategies to improve robustness across heterogeneous clinical datasets.