RAUM-GANs: a multi-layer GAN-enhanced framework for accurate multiple sclerosis lesion segmentation in MRI Authors: Ahmed Alsayat, Ayman Mohamed Mostafa, Mahmoud Elmezain, Malak Alamri, Madallah Alruwaili, Mashail N Alkhomsan, Menwa Alshammeri, Mohamed Ezz, Saleh Alharbi, Elsayed Mostafa, Wael Said Published: 2025 ABSTRACT AbstractMultiple sclerosis (MS) is a chronic autoimmune disease characterized by inflammatory brain lesions, making MRI-based lesion segmentation challenging due to noise, missing data, and limited availability of high-quality labeled images. This paper presents RAUM-GANs, a multi-layer deep learning framework designed to address these challenges and enhance segmentation accuracy. The preprocessing stage comprises three layers: (1) noise reduction using a modified Denoising GAN (DGAN-Net), achieving peak signal-to-noise ratio (PSNR) values up to 42.21 dB across varying noise levels; (2) missing data imputation through advanced GAN-based methods, ensuring clinically reliable reconstruction of incomplete MRI scans; and (3) dataset expansion via a Multi-level Identity GAN (MGAN), which incorporates an identity block to prevent mode collapse, an 8-connected pixel constraint to maintain spatial coherence, and a softened discriminator output to mitigate vanishing gradients. For segmentation, a Residual Attention U-Net (RAU-Net) with identity mapping is employed, yielding precise detection and delineation of MS lesions. Extensive evaluation on the MICCAI MSSEG-2 dataset demonstrates that RAUM-GANs outperform four state-of-the-art methods, achieving a Dice score of 96.6%, Fréchet Inception Distance (FID) of 43.13, and Inception Score (IS) of 14.03. The results highlight the framework’s ability to generate high-quality synthetic MRI data, improve robustness against noise and incomplete information, and deliver superior lesion segmentation performance. RAUM-GANs provides a comprehensive, scalable solution for MS lesion analysis, with potential applicability to other medical imaging domains where data quality and scarcity remain significant barriers.Keywords: Multiple sclerosis (MS), Lesion segmentation, Feature augmentation, Data imputation, Image synthesisSubject terms: Computational biology and bioinformatics, Mathematics and computing, Neurology Introduction Medical image segmentation is the process of dividing a medical image into distinct segments, parts, or regions of interest to facilitate medical analysis, diagnosis, treatment, and evaluation. Magnetic resonance imaging (MRI) or computed tomography (CT) scans are examples of such medical images, and the distinct segments include organs, tissues, and lesions1. Medical image segmentation is exploited to identify disease-affected regions of the brain2,3, lung4, retina5, liver6, breast7, prostate8, pituitary adenoma9, and skin lesions10. Moreover, it is used in the early detection of rare and chronic diseases such as neuromuscular diseases (NMD)11 and Multiple Sclerosis (MS)12. MS is a chronic, inflammatory, degenerative, and disabling autoimmune disorder disease that affects the central nervous system. It destroys the myelin membrane that surrounds nerve cells. Infection with this disease leads to cell hardening, which delays or stops the passage of nerve impulses transmission between the brain and the body’s organs. It is characterized by various symptoms, including physical disability, psychological disturbance, and cognitive impairments13. MRI is frequently utilized in clinical practice to diagnose, identify, and assess MS lesions. In particular, since they offer superior contrast for white matter lesions (WML), which manifest as high-intensity spots, magnetic resonance imaging sequences like 3D FLuid Attenuated Inversion Recovery (FLAIR) are utilized in the diagnosis and treatment of multiple sclerosis14. Effective MS lesion segmentation using brain Magnetic Resonance (MR) images is a vital challenge in disease identification, diagnosis, and prognosis15. In the literature, there are varieties of techniques for MS lesion segmentation. These techniques include manual segmentation16,17, semi-automated segmentation18, intensity threshold19, active contours20, watersheds21, region-growing22, clustering23, machine learning24, and deep learning (DL)25,26. Manual segmentation approaches are the most common, whereas DL-based approaches are the most promising due to their greater accuracy and higher speed. DL is a modern magic tool that eliminates all the challenges that arise from using other approaches. These challenges include the time-consuming, accuracy limitation, high inter-observer/intra-observer variability, error susceptibility, inability to practice in large studies, and confluent lesions that overlap and cannot be easily separated27. Moreover, DL-based approaches can assist physicians and radiologists in classifying diagnostic images, retrieving content-based images, generating and enhancing images, and combining image data and reports28. One of the essential tasks for guaranteeing the segmentation accuracy is the preprocessing step, such as histogram equalization29,30, missing pixel imputation, removing noise and image augmentation. One of the key challenges in multiple sclerosis (MS) lesion segmentation is dealing with missing pixels and incomplete MRI data. MRI images used for MS analysis often suffer from missing or corrupted pixels due to various imaging artifacts and acquisition issues. This missing data can significantly impact the performance of segmentation algorithms, leading to inaccurate lesion detection and quantification. Effective techniques for imputing the missing pixels are crucial to address this problem and improve the reliability of MS lesion segmentation. Another important aspect is the limited availability of labelled MRI data for training segmentation models. Medical image datasets, particularly for rare diseases like MS, are often scarce, making it difficult to train robust deep-learning models. Data augmentation techniques can help alleviate this issue by generating additional synthetic samples to expand the training dataset. Generative Adversarial Networks (GANs) have emerged as a powerful tool for data augmentation in medical imaging, as they can generate realistic-looking synthetic MRI images31. However, training GANs for data augmentation in MS lesion segmentation tasks can be challenging due to the problem of mode collapse. Mode collapse occurs when the generator of a GAN fails to capture the full diversity of the target distribution, leading to the generation of similar or repetitive samples32. This can limit the effectiveness of GAN-based data augmentation, as the generated samples may need to provide more diversity to improve the segmentation performance. Another critical aspect is maintaining the integrity and spatial coherence of the generated synthetic MRI samples. Preserving the relationships between neighbouring pixels is crucial for ensuring the clinical relevance and usability of the generated images33. Addressing this challenge requires innovative modifications to the GAN architecture and loss functions to enhance the spatial consistency of the generated samples. Lastly, speckle noise in MRI images can pose a significant challenge for MS lesion segmentation34,35. Speckle noise is a type of multiplicative noise that can degrade the image quality and introduce artifacts, making it harder for segmentation algorithms to identify the lesions accurately. Effective denoising techniques are necessary to preprocess the MRI data and improve the signal-to-noise ratio before performing the segmentation task. This paper presents a novel framework for MS lesion segmentation. The framework contains two stages: the preprocessing stage and the segmentation stage. The preprocessing stage consists of three layers: the initial layer focuses on removing noise from images, the second layer deals with imputing missing data in MRI samples, and the last layer is dedicated to expanding the datasets by generating new samples. The paper presents a novel three-stage modification in the area of image augmentation using generative adversarial network (GAN) architectures. The first modification is the addition of an identity mapping block to the GAN architecture to address the mode collapse problem. Mode collapse is a common issue in GAN training, where the generator learns to output a limited set of samples, leading to a lack of diversity in the generated data. Introducing the identity mapping block encourages the generator to learn the identity transformation, which helps stabilize the training process and mitigate mode collapse. The second modification involves the incorporation of an 8-connected pixel constraint in the loss function of the GAN. This aims to enhance the spatial integrity and coherence of the generated images. By enforcing an 8-connected pixel structure, the generator is encouraged to produce images where neighbouring pixels exhibit strong correlations, resulting in more realistic and natural-looking augmented samples. The third modification uses a softened interval range from 0.01 to 0.99 for the discriminator output, unlike the traditional binary (0 or 1) classification. This approach helps address the vanishing gradient problem, another common challenge in GAN training. The softened interval range allows for a more gradual and stable learning process for the discriminator, leading to improved convergence and a more robust generator. These three novel modifications to the GAN architecture, namely the identity mapping block, the 8-connected pixel constraint, and the softened discriminator output range, collectively contribute to the enhanced performance of the proposed image augmentation framework. Combining these techniques helps generate high-quality, diverse, and spatially coherent augmented samples, which can significantly benefit downstream tasks such as medical image segmentation. The second stage involves using residual attention U-Net (RAU-Net) for MS lesion segmentation of MRI scans. Furthermore, this framework can be taught end-to-end with the help of GANs and RAU-Net, which results in quicker training times and better performance. Comparing this new framework to Spatial Attention U-Net, Dense U-Net, Feature Pyramid U-Net, Channel Attention U-Net, Residual Dense U-Net, and Residual Attention U-Net, it shows better accuracy, recall, and precision scores, suggesting that it is a potential method for MS segmentation. The contributions of this work can be explained as follows: Proposing a multi-layer preprocessing framework addressing noise, missing data, and dataset scarcity in MRI scans, enhancing data quality for accurate MS lesion segmentation. Proposing a multi-layer preprocessing framework addressing noise, missing data, and dataset scarcity in MRI scans, enhancing data quality for accurate MS lesion segmentation. Developing a novel modified Denoising GAN (DGAN-Net), significantly improving MRI image quality by achieving peak signal-to-noise ratios (PSNR) up to 42.21 dB. Developing a novel modified Denoising GAN (DGAN-Net), significantly improving MRI image quality by achieving peak signal-to-noise ratios (PSNR) up to 42.21 dB. Implementing advanced GAN-based methods, including DEGAIN, MisGAN, and SpatialGAIN, to effectively impute missing data, ensuring clinically meaningful reconstruction of MRI images. Implementing advanced GAN-based methods, including DEGAIN, MisGAN, and SpatialGAIN, to effectively impute missing data, ensuring clinically meaningful reconstruction of MRI images. Introducing an innovative Multi-level Identity GAN (MGAN) that mitigates mode collapse, preserves spatial coherence through an 8-connected pixel constraint, and addresses vanishing gradients via softened discriminator outputs. Introducing an innovative Multi-level Identity GAN (MGAN) that mitigates mode collapse, preserves spatial coherence through an 8-connected pixel constraint, and addresses vanishing gradients via softened discriminator outputs. Utilizing a Residual Attention U-Net (RAU-Net) enhanced by identity mapping, significantly boosting segmentation accuracy, resulting in a Dice score of 96.6%. Utilizing a Residual Attention U-Net (RAU-Net) enhanced by identity mapping, significantly boosting segmentation accuracy, resulting in a Dice score of 96.6%. Conducting extensive benchmarking on the MICCAI MSSEG-2 dataset, demonstrating the framework’s superior performance in precision, robustness, and diversity compared to state-of-the-art methods. Conducting extensive benchmarking on the MICCAI MSSEG-2 dataset, demonstrating the framework’s superior performance in precision, robustness, and diversity compared to state-of-the-art methods. The remaining sections are managed as follows: Sect. 2 provides an overview of relevant literature and research on MS-related MRI segmentation to contextualize the present study within the broader research context. Section 3 elaborates on the methodologies and techniques employed in the study. Section 4 provides the empirical findings and detailed discussions. Section 5 is the concluding section that summarizes the main findings, implications, and contributions of the study. It outlines potential avenues for future research, improvements, and applications in MS-related MRI segmentation. Related work Accurately segmenting multiple sclerosis (MS) lesions in magnetic resonance imaging (MRI) is absolutely crucial for monitoring the disease and planning treatment. In recent years, deep learning has offered a major leap forward in this area; countless approaches have been proposed that leverage advances in convolutional architectures, attention mechanisms, and generative models to improve lesion detection and classification. As these breakthroughs continue, several comprehensive surveys and systematic reviews have been published to synthesize existing methods, assess their pros and cons, and map out where future research needs to apply. For instance, Thabet et al.36 published an exhaustive review focusing on AI-based Computer-Aided Diagnostic (CAD) tools used for MS over a recent five-year period (2019–2023). Their paper details the newest automated MS diagnosis methods, showing how they blend traditional Machine Learning (ML) and modern Deep Learning (DL) with MRI neuroimaging. They neatly categorize the AI techniques into segmentation and classification, further breaking them down by supervised versus unsupervised learning. Crucially, the authors also cover common public datasets, essential preprocessing steps, and persistent hurdles—specifically data scarcity and class imbalance—before outlining future research to overcome these limits. Building on this, Zang and Oguz37 focused specifically on supervised CNN-based MS lesion segmentation, surveying around 100 papers published up to October 2020. They methodically analyzed the entire segmentation pipeline, covering key elements like preprocessing techniques (e.g., intensity normalization) and how data is structured (2D, 3D, or 2.5D). They paid special attention to network architectures, highlighting U-Net variants that incorporate dense blocks and attention mechanisms. Furthermore, their survey delved into the complexities of handling multi-modal and longitudinal MRI data, the use of specialized loss functions (such as Dice and Focal Tversky) designed to combat class imbalance, and the vital function of public challenge datasets (ISBI 2015, MSSEG 2016) in allowing researchers to compare methods objectively. Nasheeda and Rajangam38 also reviewed deep learning networks for segmenting and classifying MS lesions. They looked at a range of different architectures—including CNNs, U-Net, GANs, and GCNs—discussed the common public datasets used for training and evaluation, and flagged major challenges like data imbalance and domain shift that inevitably hurt a model’s performance. More recently, Belwal and Singh39 conducted an extensive systematic literature review on deep learning techniques for MS detection and analysis using MRI data, synthesizing 82 studies from 2016 to 2024. Their work covered the complete MS diagnosis pipeline, detailing various DL architectures, available datasets, preprocessing toolkits, and evaluation metrics. They ultimately found CNN-based models were the most common choice for both segmentation and classification tasks. Crucially, they identified critical research gaps, including the pressing need for more robust models that can detect subtle, early-stage lesions and the pervasive lack of standardized datasets and protocols that currently limits fair comparison between automated systems. In the literature, the development of deep learning frameworks for automated MS lesion segmentation often hinges on carefully tailored preprocessing techniques. These techniques are intricately linked to the network architecture, working together to direct the model’s focus toward diagnostically crucial features. Furthermore, to address the severe class imbalance—where sparse lesion voxels are overwhelmed by the background—specialized loss functions are a critical component of these models. Together, these strategies are what enable robust and generalizable segmentation performance across diverse MRI datasets. Several notable frameworks are detailed below, specifically highlighting their unique preprocessing steps and architectural integrations. Rondinella et al.40 developed an enhanced U-Net framework for MS lesion segmentation on longitudinal FLAIR MRI from ISBI 2015. Their preprocessing removes empty slices and crops non-brain regions to create 160 × 160 pixel inputs, reducing training time and class imbalance. The architecture extends FC-DenseNet with Squeeze-and-Attention blocks to highlight lesion features and adds a Convolutional LSTM in the bottleneck to capture spatial dependencies. The model processes three consecutive FLAIR slices to segment the central slice, improving accuracy through this integrated approach. Hashemi et al.41 developed a framework for MS lesion segmentation using modified 2D U-Net and Attention U-Net architectures on FLAIR and T2 MRI from the preprocessed ISBI 2015 dataset. Their preprocessing removed lesion-free slices that added computational load without contributing to learning, and cropped black margins to reduce dimensions from 181 × 217 to 157 × 157 pixels before resizing to 128 × 128 pixels, thereby increasing the lesion-to-background ratio for improved model focus. Both networks employed a custom loss function combining 1.5 × (1 − Dice Similarity Coefficient) and Binary Cross-Entropy to emphasize accurate lesion delineation. The final segmentation merged predictions from separate FLAIR and T2 models by taking the union of their masks, leveraging complementary information from multi-sequence MRI data. Sarica et al.42 developed a slice-based MS lesion segmentation framework using a dense residual U-Net on multi-sequence 3D MRI from ISBI 2015 and MSSEG 2016. Beyond standard preprocessing, they applied Kernel Density Estimation for intensity normalization and extracted 2D slices from three orthogonal planes across FLAIR, T1-w, and T2-w modalities, zero-padding to 224 × 224 pixels and retaining only lesion-containing slices to address class imbalance. Their architecture enhances standard U-Net with densely connected residual blocks, Attention Gates, Efficient Channel Attention, and Atrous Spatial Pyramid Pooling for multi-scale feature capture. Final 3D segmentations were generated by majority voting across predictions from all three views. Andishgar et al.43 proposed R2AUNet, a 3D model for MS lesion segmentation using only 3D-FLAIR MRI for improved accessibility and efficiency. Their preprocessing includes CNN-based brain extraction (ANTsPyNet), empty slice removal, anisotropic diffusion filtering, N4 bias correction, brain cropping, and Z-score normalization. Volumes were resized to 135 × 170 × 150 voxels, then 64 × 64 × 64 patches (stride 32) were extracted to improve memory efficiency and reduce class imbalance. The architecture extends 3D U-Net with Recurrent Residual Convolutional Layers for iterative feature refinement and 3D Attention Gates to enhance detection of small, sparse lesions. Sarica and Seker44 tackled the specialized challenge of detecting new MS lesions by using the Deep Residual Attention Gate U-Net to compare baseline and follow-up 3D FLAIR MRI. Their preprocessing was rigorous: it involved brain extraction and N4 bias correction via the Anima MS longitudinal script, followed by intensity normalization using the 99th percentile and KDE. To prepare the input, they stacked corresponding baseline and follow-up slices into 2-channel images, broke them down into 2D slices across three views (axial, sagittal, coronal), and padded them to 512 × 512 pixels. Crucially, they kept only slices with new lesion pixels to directly manage class imbalance. The model itself smartly integrates a U-Net with residual units for stable training and Attention Gates to specifically highlight lesion features, learning through a hybrid loss combining Dice and binary focal loss. The final 3D masks were generated by simple majority voting among the predictions from all three orthogonal views. Separately, Hu et al.45 introduced the 3D Attention Context U-Net (ACU-Net), an end-to-end model designed to significantly boost contextual information and feature representation. Evaluated on the ISBI 2015 longitudinal dataset using four MRI modalities, they cropped input volumes and used augmentation like rotations and flips. ACU-Net expands on the 3D U-Net by incorporating a 3D context-guided module with atrous convolution to enlarge receptive fields in both the encoder and decoder. Additionally, a 3D spatial attention block placed in skip connections and decoding stages helps refine spatial details and sharpen discriminative features. To address class imbalance, the model employs Focal Tversky Loss, which concentrates on those challenging, hard-to-segment regions while intelligently penalizing false positives and negatives. Gamal et al.46 contributed GAU U-Net, a clever 3D architecture that enhances the standard U-Net with a Global Attention Upsample (GAU) mechanism. Tested on the cross-sectional Open-MS dataset, the GAU module is the key innovation: it selectively weights low-level encoder features based on semantic feedback from the high-level decoder. This process effectively minimizes the common problem of context loss across skip connections. Their “Low level GAU” configuration proved both more accurate and efficient, achieving a 72% Dice coefficient (a notable jump from the baseline 3D U-Net’s 64%) while actually reducing the parameter count. Finally, emphasizing clinical applicability and generalization, Krishnan et al.47 developed a T2 lesion segmentation framework using multi-center clinical trial data from relapsing MS patients. Their preprocessing was meticulous, involving bias correction, skull stripping, rigid registration to the MNI template, and alignment between baseline and follow-up scans. For training, they used overlapping 32 × 96 × 96 voxel patches that contained T2 lesions, along with on-the-fly affine and elastic augmentation. The architecture is a shallow, four-level 3D multi-arm U-Net featuring three parallel encoders: two process FLAIR and T2w separately for modality-specific features, and one jointly analyzes all sequences for shared information. Dense input and skip connectivity enhance the flow of multi-scale information, essential for detecting small lesions. The model uses a hybrid loss that combines soft Dice with weighted smooth truncated binary cross-entropy to effectively manage both class imbalance and outlier sensitivity. Nasheeda and Rajangam48 proposed the Deep Attention V-Net (DAVNet), a sequential framework for MS lesion segmentation. Their preprocessing for the MICCAI 16 and MSSEG-2 datasets included median filtering for denoising, histogram matching for intensity normalization, and resampling for standardization. DAVNet is built from two cascaded networks: the Deep Attention Network (DANet) and the Modified V-Net (MVNet). DANet, which uses compression and expansion paths without a softmax layer, handles the initial feature extraction to generate enhanced feature maps that highlight MS tissues. These enriched maps then feed into MVNet, which extracts features using its modified V-Net architecture before applying a softmax layer for final pixel-wise MS/non-MS classification. Both networks are constructed from eleven blocks each. Belwal and Singh49,50 employed a modified U-Net for MS lesion segmentation, testing it on the ISBI 2015 and MICCAI 2016 (MSSEG-1) datasets. Their preprocessing pipeline was comprehensive: it aggregated 2D slices from multi-sequence 3D MRI across multiple anatomical planes, removed null or lesion-free slices, and applied intensity normalization. For the MICCAI 2016 data, they benefited from prior preprocessing that included denoising, registration, brain extraction, and N4 bias correction. Their modified U-Net was designed for quality: it replaced max pooling with strided convolutions to better preserve spatial detail, incorporated batch normalization and ELU activations for training stability, and used spatial dropout to minimize overfitting. A composite loss combining Focal Loss and Dice Loss was key to handling class imbalance while remaining sensitive to small lesions. Aiming for better accuracy and efficiency in a smaller package, Amaludin et al.51 developed a compact modified 2D U-Net. They significantly reduced depth to three encoder-decoder levels and dropped the parameter count from 34.5 million to 12.7 million. They replaced conventional blocks with hybrid residual dense blocks that expertly balance noise suppression and feature preservation. After standard preprocessing (skull stripping, N4 bias correction, co-registration), they decomposed 3D volumes into 2D slices across three orthogonal views to increase sample diversity. They then applied kernel density estimation normalization, removed non-lesion slices to address class imbalance, and cropped images to 128 × 128 pixels. The model uses a 2.5D input by stacking the central slice with its two adjacent neighbors across four modalities, creating 128 × 128 × 12 channel inputs. A Custom Fusion method reconstructs the 3D segmentation from the three orthogonal views by prioritizing spatial consensus over simple pixel overlap for anatomically consistent results. Finally, Cetin et al.52 proposed an MS lesion segmentation method using a customized U-Net that processes 2D multi-modal MRI by fusing T1w, T2w, and FLAIR into three-channel inputs. Their optimal configuration featured five encoder layers and four decoder layers, relying on convolution/max-pooling in the encoder and transposed convolution/upsampling in the decoder, with skip connections to preserve spatial details. Preprocessing used z-score normalization across all modalities. To cope with limited training data (only 20 subjects) and reduce overfitting, they utilized extensive augmentation including random rotations, flips, and translations. They converted NIFTI volumes to NumPy arrays, specifically selecting slices 8–17 (where lesions are most frequent) and resizing them to 256 × 256 pixels. The network used Soft Dice Loss to manage class imbalance and the Adam optimizer for improved convergence. Wahlig et al.53 explored the value of transfer learning for MS lesion segmentation by taking 3D U-Net models pre-trained on other pathologies and fine-tuning them with small MS datasets. They found that this strategy significantly outperformed training from scratch with limited data (10–30 studies), leading to better positive predictive values and fewer false positives. Their rigorous preprocessing included normalization, resampling, and elastic augmentation. They split volumes into 96 mm³ patches, ensuring a carefully balanced mix of lesion-inclusive and lesion-exclusive samples. To detect new lesions, they skillfully registered follow-up FLAIR scans to the baseline, then subtracted them to create the U-Net input volume. Sarica et al.54 took a different approach, comparing both CNN and Transformer models (U-Net variants vs. TransUNet/SwinUNet) for whole-brain, slice-based segmentation. Their method utilized 3D MRI but maintained training efficiency via 2D slices. After standardized preprocessing and intensity normalization via kernel density estimation, they transformed each 3D volume into 2D slices across three orthogonal views (axial, sagittal, coronal). Corresponding slices were then stacked channel-wise. They only kept lesion-containing slices to manage class imbalance, resizing them to 224 × 224 pixels. A hybrid loss combining focal Tversky and Dice guided training, and final 3D segmentations were created by majority voting across the three views. Addressing both data scarcity and noise, Elagamy et al.55 proposed a hybrid, two-stage framework. The preprocessing stage is unique: it employs a Latent Diffusion Model for data augmentation—sidestepping common GAN mode collapse issues—and a modified CNN for Rician noise removal. The segmentation stage uses a modified Residual Attention U-Net. Tested on the MSSEG dataset, the full framework achieved an impressive 96.12% Dice score, proving that the preprocessing pipeline significantly boosts segmentation accuracy across various U-Net architectures. Rajangam et al.56 introduced a semi-supervised model to overcome the challenge of limited labeled data. They cleverly combined an unsupervised autoencoder and a supervised classifier. The autoencoder is first trained on unlabeled FLAIR MRI to learn compressed feature representations. These learned features then feed into a VGG16-based classifier trained on limited labeled data to detect MS presence before segmentation proceeds. Ghosal et al.57 focused on architectural sophistication with a compound attention-based, dual-channel encoder-decoder. The model features two parallel U-Net pathways: one uses residual connections to preserve fine details, while the other incorporates residual channel and spatial attention mechanisms to capture long-range dependencies and prevent over-segmentation. They utilized Focal Tversky loss and created a highly reliable “Major” ground truth by taking the majority vote across seven expert segmentations. Gindin et al.58 presented an optimized U-Net developed using a systematic two-step procedure: first, identifying the most informative MRI modality (which they found to be T2-weighted), and second, systematically fine-tuning hyperparameters. Their extensive preprocessing focused on addressing class imbalance through cropping and filtering to ensure a minimum percentage of lesion pixels. They employed Binary Focal Cross-Entropy loss to ensure the model prioritized learning on the crucial lesion voxels. Finally, Alijaamat et al.59 proposed a Wavelet-based Dense U-Net specifically designed to capture multi-resolution features. The model integrates a discrete wavelet transform in the encoder to decompose images into frequency sub-bands, which helps in detecting lesions with varying characteristics. It also includes dense blocks for better feature propagation and Squeeze-and-Excitation blocks for adaptive channel-wise feature recalibration, with a hybrid loss combining Dice and Focal losses to handle class imbalance. Joshi and Sharma60 proposed a modified U-Net encoder-decoder architecture integrating an auto-encoder and High-Resolution Integration Block (HRIB) for MS lesion segmentation. The HRIB is inserted into skip connections to strengthen information flow during upsampling and fuse multi-resolution features for improved detail recovery. Dense layers in each encoder block capture finer discriminative features and richer contextual information. Using whole-brain slice-based segmentation, 3D volumes are decomposed into 2D slices across axial, sagittal, and coronal orientations. Preprocessing includes multi-modal MRI registration (T1, T2, FLAIR), skull stripping using BET with WMMS brain mask, and intensity normalization by scaling relative to maximum intensity. Sub-sampling and data augmentation (rotation, width shift) address class imbalance and expand training data. The model is trained for 200 epochs using Adam optimizer with 1e-8 learning rate and batch size 32. Hossain et al.61 introduced a multi-scale U-Net framework with contraction and expansive paths for MS lesion segmentation. Their methodology preprocessed a 60-patient dataset by slicing 3D MRI into 2D images, standardizing dimensions, and applying sharpening and intensity normalization. Trained with Adam optimizer, the model achieved 99.78% average Dice Similarity Coefficient. Comparative analysis showed superior performance against CNN, Acu-Net, and ALL-Net across DSC, LTPR, and LFPR metrics. However, the authors noted the low training loss indicated potential overfitting and acknowledged that dataset variations complicate direct method comparisons. Lakshmi et al.62 proposed the Recurrent Slice-wise Attention Network (RSANet) for automated MS classification from brain MRI. The architecture combines a CNN backbone for 2D slice feature extraction, an LSTM-based recurrent network to process sequential slices, and a novel slice-wise attention mechanism. The attention mechanism assigns weights to each slice based on diagnostic importance, focusing the model on slices most likely containing MS-related features. Dereskewicz et al.63 developed FLAMeS (FLAIR Lesion Analysis in Multiple Sclerosis), a deep learning model for automated MS lesion segmentation requiring only T2w FLAIR input. Built on nnU-Net 3D full-resolution U-Net architecture with six stages and progressively increasing feature channels, the model’s robustness stems from training on 668 diverse scans from 1.5T and 3 T scanners. Minimal preprocessing involves only skull-stripping using SynthSeg from Freesurfer, followed by nnU-Net’s standardized pipeline: resampling to 0.9 × 0.9 × 1.0 mm voxel spacing via third-order spline interpolation, z-score intensity normalization within brain mask, and cropping to brain bounding box for GPU optimization. Training employs standard nnU-Net loss (cross-entropy plus Dice) or a hybrid combining Tversky and Focal losses to address class imbalance and oversegmentation. The final model ensembles five independently trained networks for enhanced robustness. Ghosal et al.64 proposed a lightweight U-Net for automated MS lesion segmentation from multimodal MRI, reducing complexity and training time by decreasing convolutional layers and filters compared to original U-Net. The 8-layer encoder-decoder structure concatenates alternate contracting path feature maps with corresponding expanding path layers to enrich feature recovery. Using the MICCAI 2016 dataset (pre-processed with denoising, intensity correction, and skull-stripping), 3D volumes are converted to 2D axial slices, resized to 256 × 256, and channel-wise concatenated across five modalities. Non-informative zero-valued slices are removed for efficiency. Each modality undergoes two-step normalization: scaling to fixed intensity range followed by z-score standardization. The model trains using Binary Cross Entropy loss for efficient convergence in binary lesion segmentation. Brosch et al.65 introduced a deep learning approach for MS lesion segmentation using 3D convolutional encoder networks with shortcut connections (CEN-s). The architecture features two coupled pathways: a convolutional encoder extracting high-level features and a deconvolutional decoder generating voxel-wise predictions. Shortcut connections fuse high- and low-level features for accurate multi-scale lesion segmentation. Applied to multi-modal 3D MRI (T1w, T2w, PDw, FLAIR), preprocessing included skull-stripping via BET, intensity normalization to fixed intervals, and 6-DOF rigid registration to align modalities to a 3 mm reference scan. Volumes were cropped to 164 × 206 × 52 voxels centered on the brain for training acceleration. Training involved unsupervised pre-training using convolutional Restricted Boltzmann Machines for parameter initialization, followed by supervised fine-tuning with a custom loss function: weighted sum of mean squared error for lesion and non-lesion voxels to address class imbalance while balancing sensitivity and specificity. Basaran et al.66 proposed a DL pipeline based on nnU-Net framework (3D full-resolution U-Net with six resolution levels) for new MS lesion detection and segmentation in longitudinal MRI. The framework uses two-channel input comprising preprocessed baseline and follow-up scans to produce binary 3D predictions of new lesions. Preprocessing includes atlas-based skull stripping and N4 bias field correction, followed by crucial intra-subject registration: baseline aligned to follow-up using affine registration then free-form deformation to accurately register brain structures and lesion changes. Beyond default nnU-Net augmentations (mirroring, rotation, elastic deformations), the pipeline adds specialized techniques: axial subsampling simulating MRI acquisition artifacts like blurring, and CarveMix, a lesion-aware augmentation extracting lesion regions from one subject and overlaying onto another to increase lesion diversity and address class imbalance. Tahghighi et al.67 proposed a framework enhancing new MS lesion segmentation through self-supervised pre-training and synthetic lesion augmentation. Using VNet architecture, the model addresses data scarcity by pre-training weights via a self-supervised masking task: masking brain structures and regressing differences between original and masked images. Preprocessing for MSSEG and MSSEG-2 datasets includes rigid registration, bias correction, denoising, and skull stripping per challenge organizer protocols, with training-time voxel intensity normalization via mean subtraction and standard deviation division. Synthetic lesion augmentation generates cuboid lesions (1.5–4 mm) blended onto smooth white matter regions using Gaussian smoothing. The model trains on combined real and synthetic data using composite loss: Dice loss, Boundary loss (alpha = 10), and consistency loss enforcing identical predictions across permuted segmentation outputs for newly appeared lesions. Perera et al.68 developed a framework for longitudinal MS lesion segmentation focused on detecting newly emerging lesions by comparing baseline and follow-up MRI scans. Their key contribution is HyTver, a hybrid loss function combining Tversky Index with modified Cross-Entropy to address input-level and output-level imbalances in longitudinal segmentation. The V-Net-based model takes three channel-wise concatenated inputs: baseline scan, follow-up scan, and a longitudinal difference map (follow-up minus baseline). Using MSSEG’2 dataset with rigid brain registration by organizers, they applied additional preprocessing including resampling to [0.5, 0.75, 0.75] mm resolution. Training patches (80 × 80 × 80) were generated via weighted cropping: for lesion-containing volumes, patch centers were sampled near foreground voxels with random offsets; otherwise, centers were uniformly random. The model used pre-trained weight initialization for transfer learning and Adam optimizer with batch size 4 for efficient learning from limited longitudinal data. Elkoroaristizabal et al.69 utilized nnU-Net version 2 for multiclass segmentation of baseline and new/evolving white matter lesions in longitudinal MS studies. To address severe class imbalance (65% of cases lacking new lesions), they fine-tuned the default configuration with extreme oversampling and reduced learning rate to 0.001 for improved convergence. Preprocessing for 3D-FLAIR images included skull stripping via HD-BET algorithm, rigid registration using 6-DOF transformation to align with MNI coordinate system, N4 algorithm for intensity inhomogeneity correction, and Z-normalization (mean subtraction and standard deviation division). The top-performing ensemble was deployed in a Docker container for user accessibility. Salem et al.70 presented VicorobCascade, an automated method for new MS lesion detection in longitudinal MRI using cascaded 3D patch-wise Fully Convolutional Neural Networks based on 3D U-Net architecture. The framework takes T2-FLAIR images from baseline and follow-up timepoints as input and is trained end-to-end to simultaneously learn the Deformation Field and new lesion segmentation mask. The cascade strategy addresses class imbalance: FCNN1 is trained for high sensitivity to detect candidate lesion voxels, while FCNN2 subsequently reduces misclassifications. Preprocessing for MSSEG-2 dataset (pre-registered) includes brain mask delineation using ROBEX Tool, N4 bias field correction, and histogram-matching intensity normalization for baseline and follow-up T2-FLAIR images. Training extracts 32 × 32 × 32 patches around lesion voxels, with final predictions averaging FCNN1 and FCNN2 outputs after thresholding. Ashtari et al.71 proposed Pre-U-Net, a 3D encoder-decoder architecture for end-to-end segmentation and detection of new MS lesions using longitudinal 3D FLAIR MRI. The U-Net-like structure with four resolution levels replaces conventional blocks with pre-U-Net blocks (inspired by pre-activation residual units) that apply normalization, activation, then convolution with identity shortcuts, enhancing gradient flow, feature reuse, and reducing overfitting. Input consists of two co-registered longitudinal FLAIR volumes concatenated into a two-channel 3D image, tightly cropped via minimal bounding box to exclude zero-padded regions. Channel-wise z-score normalization ensures zero mean and unit variance, and volumes are resampled to 1 mm³ isotropic voxels via trilinear interpolation. Training employs aggressive augmentation: random 128 × 128 × 128 patches extracted per volume, with 66% oversampled around new lesion regions, undergoing spatial augmentations (random affine transformations, flips) and intensity augmentations (Gaussian noise, smoothing, intensity scaling/shifting, bias field simulation, contrast adjustments). Deep supervision enhances learning stability and multi-scale segmentation accuracy. The proposed RAUM-GAN framework effectively addresses key challenges in previous studies by incorporating innovative multi-layer preprocessing and advanced augmentation techniques. Unlike the Attention-Gated U-Net (AG-UNet), which struggles with missing or corrupted pixels, our approach integrates a denoising Generative Adversarial Network (DGAN-Net) for effective noise reduction and a robust imputation strategy for handling incomplete MRI data. Furthermore, while the previous studies utilized limited data augmentation methods, RAUM-GAN employs a modified Generative Adversarial Network (MGAN) that includes an identity mapping block to alleviate mode collapse, an 8-connected pixel constraint to enhance spatial integrity, and a softened discriminator output to address the vanishing gradient problem. This combination not only improves the diversity and quality of generated samples but also significantly enhances the performance of the Residual Attention U-Net (RAU-Net) in accurately segmenting MS lesions, thus providing a comprehensive solution to the limitations identified in the existing literature. It is worth noting that similar deep learning frameworks have been successfully applied in other medical imaging domains, such as retinal blood vessel segmentation72, where they demonstrated strong capability in detecting fine-grained structures under challenging imaging conditions. Methodology This section presents the steps of the proposed framework. Specifically, the description of the MRI dataset utilized for the study are presented in Sect. 3.1. Section 3.2 provides an in-depth description of a modified DGAN-Net designed to improve the quality of MS-related MRI scans by reducing speckle noise. Section 3.4 details the investigation of the modified GAN architecture and techniques used to augment MS-related MRI datasets. Section 3.5 discusses the Residual Attention U-Net (RAU-Net) architecture’s role in segmenting MS-related lesions in MRI scans. The specifications of the hardware infrastructure, software tools, libraries, and computational resources utilized for implementing and executing the proposed methodologies are outlined in Sect. 3.6. The proposed framework consists of the following steps: In the first stage, we perform a multi-layer preprocessing of the MRI data. This stage consists of three key steps: Image Denoising: We employ a modified Denoising Generative Adversarial Network (DGAN-Net) to remove noise from the MRI images effectively. Image Denoising: We employ a modified Denoising Generative Adversarial Network (DGAN-Net) to remove noise from the MRI images effectively. Missing Data Imputation: We apply multiple methods to reconstruct missing data within the MRI samples accurately. Missing Data Imputation: We apply multiple methods to reconstruct missing data within the MRI samples accurately. Data Augmentation: We generate additional MRI images using a Multi-level Identity GAN (MGAN) with a conditional block to expand the dataset. This GAN is modified with three key innovations: an identity blocks to prevent mode collapse, an 8-connected pixel constraint to maintain pixel integrity, and a softened discriminator output range (0.01 to 0.99) to address the vanishing gradient problem. Data Augmentation: We generate additional MRI images using a Multi-level Identity GAN (MGAN) with a conditional block to expand the dataset. This GAN is modified with three key innovations: an identity blocks to prevent mode collapse, an 8-connected pixel constraint to maintain pixel integrity, and a softened discriminator output range (0.01 to 0.99) to address the vanishing gradient problem. The second stage focuses on segmentation, where we utilize a Residual Attention U-Net (RAU-Net) with identity mapping for precise MS lesion segmentation. This combined approach enhances both the quality of the MRI data and the accuracy of the segmentation, outperforming existing techniques in detecting and quantifying MS lesions. Figure. 1 shows the block diagram of the methodology, beginning with the Preprocessing Step. Initially, raw MRI scans undergo Noise Removal using a Modified DGAN-Net, effectively reducing image noise artifacts. Following this, the data is enhanced through an Image Augmentation Step, where a Modified GAN equipped with an Identity Block and 8-connected pixel structure is employed to augment the images, ensuring they are robust for further analysis. To address potential data gaps, a Missing Pixel Imputation step is applied, utilizing a variety of GAN models such as GAIN, MisGAN, CollaGAN, DEGAIN, VGAN, stackleberg GAN, and SpatialGAIN. The best-imputed image is then selected for subsequent processing. The preprocessed images are then fed into the Segmentation Step, where a complex network of Residual Attention U-Nets is employed. This network, composed of interconnected ResNeXt Blocks, performs precise segmentation by isolating critical regions within the MRI scans. The final output is a segmented MRI image, highlighting regions of interest, which is crucial for further medical analysis and diagnostics. As presented in Fig. 1, the schematic has been updated to depict all operations explicitly and to include a legend. Encoder/decoder blocks show 3D Conv(k = 3) → BN → PReLU, with ResNeXt blocks denoted by split-transform-merge icons. Attention gates are indicated by the “⊕” modulation symbol. Up-sampling is implemented by 3D Transposed Conv(k = 2). Global Average Pooling (GAP) nodes and 1 × 1 × 1 conv (pointwise) layers are now explicitly drawn within the attention modules. Skip connections are shown as gray arcs; Gaussian-weighted blending is indicated in the output head. The preprocessing lane labels the three GAN modules (DGAN, Imputation GANs, MGAN) with their loss terms (adversarial, pixelwise, diffusion, pixel-coherence) shown in italics. See legend: Conv3D, BN, PReLU, ResNeXt block, GAP, 1 × 1 × 1 Conv, Attn Gate, UpConv, Skip, Blend. Block diagram of proposed methodology. RAUM-GANs introduces a multi-layer GAN preprocessing stack that is distinct from prior GAN-based lesion frameworks: (a) a diffusion-regularized DGAN for despeckling that augments the adversarial/pixelwise loss with a nonlinear diffusion term to preserve edges while suppressing multiplicative noise; (b) a GAN-based imputation layer (e.g., MisGAN/SpatialGAIN) operated in a dynamic-imputation regime to reconstruct missing voxels without biasing intensity distributions; and (c) an MGAN augmentation module that combines identity mapping, an 8-connected pixel-coherence constraint, and label smoothing (0.01–0.99) to mitigate mode collapse and vanishing gradients while preserving spatial realism. Beyond the modeling blocks, RAUM-GANs employs (d) a lesion-aware 3D patch curriculum and (e) strictly patient-level data separation throughout training/validation/testing to avoid leakage. This integrated design differs from prior single-stage GAN pipelines by explicitly decoupling denoising, imputation, and augmentation—each with tailored objectives—and by coupling the resulting distributions to a RAU-Net backbone optimized for small-lesion detection. MRI dataset The proposed framework is trained and validated on the MICCAI 2021 MS new lesion segmentation challenge (MSSEG-2) dataset73. Data from 100 MS patients were included in the MSSEG-2 challenge dataset. There are two 3D FLAIR sequences for every patient, scanned at two distinct time intervals; one to three years. Using three GE, six Philips, and six Siemens scanners, fifteen distinct scammers scan every 3D FLAIR sequence. The features of the image change as the resolution and voxel size (ranging from 0.5 mm3 to 1.2 mm3) change. The dataset is not large enough, and the number 100 does not significantly aid in the segmentation process with high accuracy, even though it contains extremely helpful photos for the segmentation process. Moreover, only forty 3D MR images in the training set are available to us under our licensing, and only 29 of those images show new lesions in their second time-point. The description of MSSEG-2 is presented in Table 1. Table 1Summary of MSSEG-2 dataset.DataTrainingTestingAllSize (mm) of median voxel(0.53, 0.98, 0.98)(0.65, 0.98, 0.98)(0.60, 0.98, 0.98)Median shape(320, 256, 256)(280, 256, 256)(297, 256, 256)Total cases4060100Total cases with-new-lesion293261Total cases without-new-lesion112839 Summary of MSSEG-2 dataset. To prevent any risk of data leakage, we strictly enforced patient-level separation when extracting 3D patches. Training, validation, and test partitions were created at the subject level following the official MSSEG-2 challenge guidelines, ensuring that no patches from the same subject were distributed across different sets. During patch extraction, we applied lesion-aware sampling within each training subject and used non-overlapping patient assignments to preserve independence between partitions. For inference, a sliding-window approach with controlled patch overlap (stride = 32 voxels) was employed, and blending was restricted to the test subject’s own patches. This design guarantees that overlapping or lesion-centered patches remain confined to their respective subject-level split, thereby eliminating the possibility of cross-set leakage and ensuring that reported performance metrics reflect true generalization across unseen patients. While the proposed RAUM-GANs framework demonstrates strong performance on the MSSEG-2 dataset, the evaluation is limited to this dataset due to the substantial computational resources required for large-scale cross-dataset training and testing. It is important to note that MSSEG-2 itself comprises data acquired from multiple scanners (GE, Philips, Siemens) and different acquisition protocols, providing a degree of diversity. Nevertheless, the current findings remain dataset-specific, and further validation across additional datasets and imaging modalities is planned as part of future research to assess the robustness and generalizability of the framework. MS-related MRI despeckling with a modified DGAN-net Therefore, MR image despeckling is critical in improving image quality and segmentation performance. It is crucial to emphasize that while reducing speckle is essential for improving image quality, it must be executed thoughtfully to prevent the loss of clinically significant information. The first layer of the image-preprocessing step is to reduce or eliminate noise from MS-related MRI scans. The primary purpose of incorporating this layer is to use a modified version of a denoising generative adversarial network named DGAN-Net74 to eliminate the speckle noise affecting MS-related MR images during transmission. In the literature, the DGAN-Net model is applied for removing speckle noise from the dermoscopic dataset for skin lesions segmentation75, MRI of brain tumours76, breast ultrasound images77, and optical coherence tomography images78. The proposed modified version of DGAN-Net, entitled DE-DGAN-NET, leverages the strengths of adversarial training while better capturing the underlying diffusion of noise by incorporating the nonlinear diffusion equation79 in the loss function. The DE-DGAN-NET generator is used to reduce speckle noise, while the discriminator is used to assist the generator in generating more realistic images. In the DE-DGAN-NET model, a U-Net encoder-decoder architecture is utilized. The generator subnetwork (G) structure consists of two main components: an encoder (down-sampling) and a decoder (up-sampling). The generator subnetwork consists of 10 blocks, five blocks on each side of the U-Net architecture. Each block in the encoder consists of a convolution layer followed by a Relu activation function. The blocks in the decoder consist of convolution layer, LeakyRelu, Dropout, and Batch normalization layers, respectively. The discriminator subnetwork (D) structure is a CNN-based model that includes 15 layers of decreasing spatial dimensions. Each convolutional layer is followed by batch normalization and leaky ReLU activation, except for the last layer, which uses a sigmoid. The proposed modified loss function is a key component of the proposed DE-DGAN-Net model for MS-related MRI scan despeckling. The additional diffusion loss term is inspired by the nonlinear diffusion equation, a partial differential equation describing how a substance diffuses through space over time. In image drawing, the diffusion equation can be used as a mathematical model to represent how speckle noise is smoothed or diffused within an image. The following is the mathematical model for the image despeckling or denoising that explains the processing of original MRI images and the denoising process with proposed modified loss functions that combine adversarial loss, pixel-wise loss, and diffusion loss to reduce the noise in MRI and retain structural information. The hyperparameters, , and are used to control the influence or weight of , , and within the overall loss function. The modified DGAN-Nets provide four modifications. Incorporation of residual connections: Integrating residual connections within the DGAN-Net architecture can significantly improve the network’s ability to learn and retain important features from the input data. Residual connections help prevent the vanishing gradient problem and enable the network to train deeper architectures more effectively. By allowing the network to bypass certain layers, these connections ensure that the original input features are preserved and can be combined with newly learned features, resulting in more accurate image reconstructions with reduced speckle noise. Incorporation of residual connections: Integrating residual connections within the DGAN-Net architecture can significantly improve the network’s ability to learn and retain important features from the input data. Residual connections help prevent the vanishing gradient problem and enable the network to train deeper architectures more effectively. By allowing the network to bypass certain layers, these connections ensure that the original input features are preserved and can be combined with newly learned features, resulting in more accurate image reconstructions with reduced speckle noise. Multi-scale feature extraction: Introducing a multi-scale feature extraction module in the DGAN-Net allows the network to capture features at various scales, which is particularly important for detecting and preserving fine details in MRI images. This modification involves incorporating convolutional layers with different kernel sizes, enabling the network to analyze and reconstruct image details across different spatial resolutions. As a result, the despeckled images retain critical anatomical details, which are essential for accurate MS lesion segmentation. Multi-scale feature extraction: Introducing a multi-scale feature extraction module in the DGAN-Net allows the network to capture features at various scales, which is particularly important for detecting and preserving fine details in MRI images. This modification involves incorporating convolutional layers with different kernel sizes, enabling the network to analyze and reconstruct image details across different spatial resolutions. As a result, the despeckled images retain critical anatomical details, which are essential for accurate MS lesion segmentation. Attention mechanism integration: Adding an attention mechanism to the DGAN-Net can help the network focus on the most relevant parts of the input MRI images, especially areas with significant noise or critical features like lesions. The attention mechanism dynamically weighs different regions of the image during the generation process, allowing the network to prioritize regions that require more detailed processing. This improves despeckling performance, as the network can better differentiate between noise and actual tissue structures. Attention mechanism integration: Adding an attention mechanism to the DGAN-Net can help the network focus on the most relevant parts of the input MRI images, especially areas with significant noise or critical features like lesions. The attention mechanism dynamically weighs different regions of the image during the generation process, allowing the network to prioritize regions that require more detailed processing. This improves despeckling performance, as the network can better differentiate between noise and actual tissue structures. Adaptive loss function: Implementing an adaptive loss function that dynamically adjusts based on the noise level in the input MRI images can enhance the DGAN-Net’s ability to handle varying noise intensities. This modification would involve designing a loss function that penalizes the generator more heavily for failing to remove noise in highly affected regions while being more lenient in less noisy areas. By tailoring the loss function to the specific characteristics of each input image, the network can achieve better overall despeckling performance, producing cleaner and more diagnostically useful MRI images. Adaptive loss function: Implementing an adaptive loss function that dynamically adjusts based on the noise level in the input MRI images can enhance the DGAN-Net’s ability to handle varying noise intensities. This modification would involve designing a loss function that penalizes the generator more heavily for failing to remove noise in highly affected regions while being more lenient in less noisy areas. By tailoring the loss function to the specific characteristics of each input image, the network can achieve better overall despeckling performance, producing cleaner and more diagnostically useful MRI images. MS-related MRI imputation with different GANs innovative approaches involving different types of GANs have been employed to address the unique challenges presented by this medical imaging task. One key innovation is using specialized GAN architectures tailored to handle the complexity and variability of multiple sclerosis (MS) lesions. Traditional GANs were initially adapted to create realistic MRI images that fill in missing or corrupted data. However, the challenge was ensuring that these imputed images retained the subtle yet critical features characteristic of MS. To achieve this, the architecture was modified to include identity blocks and attention mechanisms that specifically target the preservation of lesion characteristics, ensuring that the imputed images are not only visually convincing but also clinically accurate. The conventional approach to data imputation is to apply fixed imputations to missing values before training a neural network model that leads to inaccurate estimation and prediction values. In80, a dynamic data imputation approach is a more recent approach that provides different imputations for the same missing value at each training epoch. This approach has been shown to be effective in improving the generalization performance of a neural network with different missing rates72. This paper applies the dynamic data imputation approach to MS-related MRI using different GANs as a second preprocessing layer of the proposed RAUM-GANs framework. The following are different mathematical models for different GANs that explore and define each mechanism with different generators (GR) and discriminators (DR) definitions, major objective functions, training, and output for imputed images. The DEGAIN model uses a generative adversarial network (GAN) architecture to efficiently predict and fill in the gaps created by missing data from MRI scans. MS-related MRI augmentation with modified GANs In augmenting MRI images for multiple sclerosis (MS) lesion segmentation, several modifications were applied to Generative Adversarial Networks (GANs) to enhance their effectiveness. The first modification involves the integration of an identity block into the GAN architecture. This identity block is critical in mitigating the issue of mode collapse, which often plagues GAN training by limiting the diversity of generated samples. By encouraging the generator to learn identity transformations, this modification stabilizes the training process and ensures a broader range of realistic synthetic MRI images, which are crucial for effective data augmentation. The second modification incorporates an 8-connected pixel constraint within the loss function of the GAN. This adjustment enhances the spatial coherence and integrity of the generated images. In medical imaging, maintaining the relationship between neighbouring pixels is essential to preserve the clinical relevance of the augmented data. The 8-connected pixel constraint ensures that the generated MRI images are diverse and maintain high pixel-level integrity, making them more suitable for downstream segmentation tasks. Lastly, the GAN’s discriminator output was modified to produce values within a softened interval of 0.001 to 0.999 instead of the traditional binary classification. This change addresses the vanishing gradient problem, a common issue in GAN training where the discriminator becomes too confident, leading to ineffective gradient updates for the generator. By allowing a more gradual and stable learning process, this modification enhances the convergence of the GAN, resulting in a more robust generator capable of producing high-quality augmented MRI images. Each of these modifications plays a vital role in improving the overall performance of the GAN for MS lesion segmentation tasks. Creating a loss function that evaluates the performance of the discriminator and generator is crucial for training GANs. The loss function is crucial in directing the learning process and ensuring that the GAN generates data that closely reflects reality. The standard GAN loss function is outlined by Eq. (1), the discriminator gradient update is represented by Eq. (2), and the generator gradient update is encapsulated by Eq. (3). The symbol GR stands for the generator, a model that generates synthetic data from random noise. DR represents the discriminator, a model distinguishing between real and generated data. The expression V (GR, DR) refers to the value function that captures the adversarial objective between the generator and discriminator. The term x denotes real data samples drawn from the true data distribution pd​, while z represents latent variables or noise drawn from a distribution pz​, which are used as inputs to the generator. The function log indicates the log probability that the discriminator assigns to real data x, and log represents the log probability that the discriminator assigns to generated data being fake. The goal of the discriminator is to distinguish between actual and synthetic samples formed from random noise, while the generator seeks to create synthetic samples that closely resemble authentic samples (x) from Eqs. (1), (2), and (3). The primary issue associated with GANs is the potential occurrence of mode collapse. Mode collapse arises when the generator generates a restricted set of images with a similar appearance, and the discriminator struggles to offer meaningful feedback. Consequently, this leads to a need for more diversity in the generated images, limiting their practical utility. During the training process, the generator continuously searches for the output the discriminator deems accurate. Therefore, the discriminator’s best option is always to reject the generator’s output. The proposed MGAN is introduced to solve the mode collapse challenge for GANs using three main modifications. The first modification is the adoption of mini-batch training as a remedial strategy for mitigating mode collapse within the framework of GANs. By facilitating the discriminator’s simultaneous analysis of multiple data instances and fostering an understanding of their interrelationships, the generator is incentivized to produce a more diverse array of outputs. A novel method is introduced for estimating the proximity of sample pairs within a mini-batch, thereby furnishing a comprehensive summary for each data point. This proximity information is explicitly incorporated into the model, fostering improved coordination between gradients and serving as a preventative measure against mode collapse. The second modification entails adapting the GAN’s loss function by integrating label smoothing. Departing from the conventional assignment of strict binary labels (1 or 0) for real and fake data during discriminator training, this modification utilizes softened values of 0.99 and 0.01, respectively. These values contribute to training stability, improve gradient flow, and support diversity in the generated samples. The third modification centers on implementing learning rate decay, which is particularly efficacious when used with the Adam optimizer in mini-batch learning. This adjustment is geared towards bolstering model stability by addressing oscillations in losses. Furthermore, incorporating identity blocks into the architectural design enhances the model’s capability to capture intricate distributions early in the learning process, resulting in heightened image fidelity. Collectively, these modifications contribute to the amelioration of mode collapse, enhancement of model stability, and overall augmentation of the generative adversarial network’s performance within the specified domain of DL applications. The modified loss function in MGAN is expressed as the following Eqs. (4), (5), and (6); where the loss is function of the generator and is the loss function of the discriminator. In Eq. (4), L (GR, DR) represents the overall loss function, which is constructed as the sum of the generator loss LGR and the discriminator loss LDR​. The objective is to minimize LGR​ while maximizing LDR​, creating a competitive dynamic between the generator GR and the discriminator DR. Equation (5) specifies LGRLGR​, defined as the negative average log probability of the discriminator’s output when presented with generated samples GR(z)GR(z). Here, n denotes the samples evaluated, and DR(GR(z)) indicates the discriminator’s output for the generated instance. By minimizing LGR​, the model is encouraged to produce outputs that the discriminator will likely classify as real, which helps enhance the realism of the generated lesions. In Eq. (6), LDR​ captures the discriminator’s performance. It calculates the average log probability that the discriminator classifies real images x as real, alongside the log probability of classifying generated images GR (Zi) as fake. This encapsulates the discriminator’s dual role: recognizing genuine data and identifying generated outputs. The term 1 − DR(GR(Zi)) represents the probability of the discriminator misclassifying a generated instance, thereby incentivizing the discriminator to improve its accuracy. The utilization of MGAN for MS-related MRI augmentation enhances the quality, diversity, and control over synthetic data generation by effectively capturing the intricate details and nuances of the real data. Using mini-batches compromises the computational efficiency of batch gradient descent and the noisy updates of stochastic gradient descent. Moreover, utilizing mini-batches enhances memory efficiency, promotes stable convergence, safeguards against converging to suboptimal solutions, and mitigates overfitting by discouraging the model from fitting noise in the data. By integrating label smoothing in the loss function, the training of MGAN becomes more stable and resistant to mode collapse. This is accomplished by promoting diversity in the generated samples, avoiding overconfidence in the discriminator, and providing informative feedback to the generator. Consequently, the MGAN can capture variations, preserve identity attributes, and produce high-quality synthetic samples that closely resemble the desired data distribution. By gradually reducing the learning rate during the training process, MGAN can achieve better convergence, produce high-quality synthetic samples, and effectively capture the desired attributes and variations in the generated data. Table 2 Shows the typical structure of the generator, and table 3 shows the typical structure of the modified discriminator of MGAN. The generator is composed of different six layers with convolutional transposed 2-dimension convolution. The generator layer uses a kernel size of four except layer 4, which uses a kernel with the size of one. The generator uses Relu (Inplace = True) and BatchNorm2d (256, eps = 1e-5 momentum = 0.1) in each layer except the final layer, which uses Tanh (). The discriminator component comprises five layers with a 2-dimensional convolutional layer and a kernel with size 4. Each layer in the discriminator uses a LeakyReLU (negative_slope = 0.2) and BatchNorm2d (64, eps = 1e-5 momentum = 0.1) except the last layer, which uses sigmoid activation function with label smoothing. The model uses 200 epochs with an Adam optimizer. Table 2 Generator Structure of MGAN.LayerOperatorInput dimensionsOutput dimensionsKernel sizeStridPadding1ConvTranspose2d3644212102451242135122564214256256110525612842161283421 Generator Structure of MGAN. Table 3Discriminator Structure of MGAN.LayerOperatorInput dimensionsOutput dimensionsKernel sizeStridPadding1Conv2d3644212641284213128256421425651242155121420 Discriminator Structure of MGAN. Training complexity and resource requirements RAUM-GANs add three adversarial stages—denoising, imputation, and augmentation—before RAU-Net segmentation, so each training step computes both G and D passes and scales with the discriminator: generator update ratio; we cap it with TTUR 1:4 to bound cost. Stability is ensured with spectral normalization (D), R1 gradient penalty, label smoothing (real = 0.9), instance noise with cosine decay, and EMA of generator weights. Memory and throughput are managed via mixed precision (AMP) and gradient accumulation, using 2D 256 × 256 patches (typical effective batches: 8 for GAN stages, 4 for RAU-Net), which fit comfortably on a 4 GB GPU; AMP yielded about ~ 40% lower VRAM and ~ 1.3× faster steps versus FP32. We report per-stage params/FLOPs, peak VRAM, and time/epoch (to be filled with your measurements), noting compute is dominated by convolutional layers and scaled by batch size and D: G steps. Despite the non-trivial cost of adversarial training, the pipeline delivers higher-quality inputs (imputation: MisGAN best MAE/MSE/PSNR/SSIM; augmentation: MGAN best FID/IS) and a meaningful downstream gain in segmentation (Dice ≈ 95.2% → 96.9% after preprocessing), making the added compute justified for the observed accuracy improvement. Segmentation using residual attention U-net The proposed system incorporates noise removal, data imputation, and data augmentation techniques to improve the accuracy and reliability of MS lesion segmentation. These preprocessing procedures aid in preserving data integrity, lessening the effect of noise artifacts and enhancing the segmentation model’s capacity for generalization. In the end, this helps produce segmentation results that are more precise and clinically meaningful, which helps MS patients receive better diagnoses and treatment plans. This paper uses residual attention U-Net to segment MS lesions from MRI data. The primary goal of applying this paradigm is to address the difficulties associated with accurately defining MS lesions. Utilizing the U-Net design and combining residual attention processes is accomplished. The residual attention U-Net model is a kind of neural network intended for medical image segmentation. Residual attention modules are combined with the U-Net architecture to enhance the efficiency of semantic segmentation tasks. The U-Nets is successful in processes involving semantic segmentation. During segmentation, residual attention enables the model to concentrate on the most crucial regions of the image, improving performance and accelerating training durations. This enhances picture segmentation’s precision and effectiveness by combining residual back connections’ benefits with self-attention mechanisms. Additionally, the combination improves network generalization and minimizes the amount of computational resources lost on pointless activations. The U-Net model comprises encoding and decoding paths with multiple Pyramid layers, enabling the extraction of hierarchical features at various resolutions. Independent predictions are generated from each layer, enhancing the model’s efficiency in collecting fine-grained details of MS lesions. In the encoding path, the input image undergoes a series of 3D convolutional layers succeeded by parametric rectified linear units (PReLU). With appropriate kernel sizes and strides, these layers capture spatial information and learn discriminative features relevant to MS lesions. Down-sampling layers, implemented using 3D convolution and PReLU, reduce the spatial dimensions while preserving important features. The decoding path employs 3D transposed convolutional layers and PReLU activations to up sample the feature maps, restoring spatial resolution and refining the segmentation results. To accomplish precise lesion segmentation, skip connections are created between relevant layers in the encoding and decoding channels. This makes it easier to integrate low-level and high-level features. The residual attention mechanisms are introduced at different resolutions to emphasize relevant features and suppress irrelevant information selectively. These mechanisms enable the network to focus on MS lesions and their surrounding regions, improving segmentation accuracy. The residual attention blocks capture long-range dependencies and adaptively recalibrate the feature maps, enhancing the model’s ability to capture intricate details. Furthermore, additional skip connections to the model of the residual attention U-Net are utilized. By introducing these additional skip connections, the modified architecture can effectively propagate information from earlier encoding to later decoding layers. This helps preserve spatial details and fine structures that may have been lost during the down-sampling process. The skip connections act as shortcuts, allowing the network to bypass unnecessary layers and facilitate the flow of information across different resolutions. The modified architecture with more skip connections also improves the gradient flow during training, addressing the issue of vanishing gradients. This is particularly important in deep networks where gradients can diminish as they propagate through multiple layers. The skip connections provide alternative paths for gradients to flow, enabling better optimization and faster convergence. Adding more skip connections to the residual attention U-Net architecture significantly improves its segmentation performance. It enables the integration of low and high-level features, preserves spatial details, improves gradient flow, and improves the model’s ability to handle complex anatomical structures. These modifications contribute to more accurate and robust segmentation results, making the architecture more effective for various medical imaging applications. The final output layer consists of a 3D convolutional layer followed by an appropriate activation function, producing a segmentation map highlighting the detected MS lesions. During training, the proposed residual attention U-Net architecture utilizes cropped patches of the input 3D medical images, optimizing memory usage. By incorporating residual attention mechanisms and the U-Net architecture, the proposed network aims to achieve precise MS lesion segmentation, facilitating enhanced understanding and analysis of the disease for clinical diagnosis and treatment planning. The algorithm for the residual attention U-Net is outlined in the following Algorithm, accompanied by the corresponding hyperparameters specified in Table 4 that presents the hyperparameters used in the proposed GAU-U-Net architecture, which are crucial for optimizing performance in segmenting multiple sclerosis lesions. The model is structured with four encoding and decoding layers, providing a balanced architecture that captures complex features while maintaining a manageable model size. Including two attention blocks facilitates better focus on significant regions within the MRI scans, enhancing the model’s capability to differentiate lesions from surrounding tissue. A kernel size of 3 × 3 × 3 is employed for the convolutional layers, which strikes a good balance between capturing local features and maintaining computational efficiency. The transposed convolutions utilize a larger kernel size of 2 × 2 × 2, allowing for effective upsampling of the feature maps during decoding. The stride settings, with a stride of 1 for convolutions and a stride of 2 for transposed convolutions, are designed to effectively manage the dimensionality reduction and expansion throughout the network. The PReLU activation function is chosen for its ability to mitigate the vanishing gradient problem, allowing for more robust learning, while a sigmoid function is used at the output layer to facilitate binary classification of lesion presence. The model employs binary cross-entropy as the loss function, which is suited for the binary nature of lesion segmentation tasks, and utilizes the Adam optimizer with a learning rate of 0.001, known for its efficiency in training deep learning models. With a batch size of 16 and a training duration of 200 epochs, the hyperparameter configuration is designed to balance training speed and convergence quality. Collectively, these hyperparameters form a coherent structure that supports the effective learning and segmentation capabilities of the GAU-U-Net model. Table 4Hyperparameters for the residual attention U-Net architecture.HyperparameterValueNumber of encoding layers4Number of decoding layers4Number of attention blocks2Kernel size for 3D convolutions3 × 3 × 3Kernel size for 3D transposed convolutions2 × 2 × 2Stride for 3D convolutions1Stride for 3D transposed convolutions2Activation functionPReLUOutput activation functionSigmoidLoss functionBinary cross-entropyOptimizerAdamLearning rate0.001Batch size16Number of epochs200 Hyperparameters for the residual attention U-Net architecture. The lesion-segmentation network in RAUM-GANs is adapted from the Residual Attention U-Net paradigm (RAU-Net) as proposed in prior work. In our implementation, we (i) replace standard residual units with ResNeXt-style residual blocks in the encoder/decoder to improve multi-path feature aggregation, (ii) add identity mappings and extra skip connections to stabilize gradient propagation across deep layers, and (iii) insert channel–spatial attention gates at the decoder stages to suppress background activations. All other hyperparameters follow Table 4. These changes retain the RAU-Net design principles while introducing architectural refinements tailored to MS lesion morphology and small-lesion sensitivity. All volumetric preprocessing and patch extraction were implemented in Python using NiBabel (NIfTI I/O) and SimpleITK (resampling to 1.0 × 1.0 × 1.0 mm isotropic spacing via third-order B-spline). Brain masking was applied to restrict sampling to intracranial voxels. Patch generation and queuing were performed with MONAI transforms (PyTorch backend): Spacingd and NormalizeIntensityd for harmonization, followed by RandWeightedCropd during training and GridPatchDataset/SlidingWindowInferer for inference. This toolchain provides deterministic resampling and reproducible patch coordinates, while enabling on-the-fly queuing and augmentation within the training loop. To mitigate class imbalance and emphasize lesion signal, we adopted a lesion-aware sampling scheme: during training, 70% of patches were lesion-centered by drawing centers from connected-component centroids of the ground-truth mask and jittering within a 5–7 voxel radius; the remaining 30% were background patches sampled uniformly within the brain mask. For lesion-centered sampling we additionally dilated the lesion mask by 2–3 voxels to include perilesional tissue, improving boundary learning. Background sampling ensured exposure to normal tissue and reduced false positives. At inference, the full volume was covered with a uniform sliding window and Gaussian-weighted blending of overlapping logits to avoid seams. Specification for hardware and software The hardware specifications for the system are as follows: The CPU is an Intel® Core i7-10750 H with a clock speed of 2.60 GHz. The system is equipped with an NVIDIA GeForce RTX 3050Ti GPU, which has 256 GB of memory. Additionally, the system has 32 GB of RAM. Regarding software specifications, the operating system options for this setup include Windows 11, macOS Monterey, and Ubuntu 21.10. The DL frameworks supported are PyTorch 1.10, TensorFlow 2.8, and JAX 0.7. The recommended Python version is Python 3.10. Several additional libraries are suggested for use, such as scikit-learn 1.0, OpenCV 4.6, and seaborn 0.11.2. In our experiments, the baseline methods were implemented using the hyperparameter configurations reported in their original publications to maintain reproducibility and fairness. Minor adjustments (e.g., learning rate, batch size) were made only when necessary to achieve stable training on the MSSEG-2 dataset. Due to computational resource constraints, an exhaustive grid search across all baselines was not feasible; however, the achieved results are consistent with those reported in the literature, ensuring fair comparison. To strengthen the manuscript, we have added details of the dataset partitions (MSSEG-2 includes 40 training and 60 testing cases, of which 29 training and 32 testing cases contain new lesions) and clarified the use of validation splits. Furthermore, we provide the tuned parameters applied for our proposed RAUM-GANs framework, including a learning rate of 0.0001, batch size of 16, and 200 training epochs, with Adam as the optimizer. For statistical rigor, we will expand the analysis to include non-parametric tests such as the Wilcoxon signed-rank test and the Friedman test to validate the significance of improvements over baseline methods. Finally, we have discussed the computational complexity of RAUM-GANs compared to existing models: while the multi-layer preprocessing pipeline increases training overhead, the integrated design remains computationally efficient at inference time, with per-epoch runtimes comparable to state-of-the-art U-Net variants. Results and discussion This section presents the results of various comparative analyses related to the preprocessing layers and the segmentation step. Section 4.1 highlights the outcomes of comparing DE-DGAN-Net with other leading methods in removing speckle noise from MRI scans related to MS. The evaluation is carried out using SSIM and PSNR metrics. In Sect. 4.2, data imputation results using various GANs are presented. The results of data augmentation facilitated by a modified GAN model are illustrated in Sect. 4.3, where performance is measured through metrics including FID and IS. Section 4.4 is dedicated to showcasing the outcomes of the segmentation process both before and after the proposed preprocessing layers. The residual attention U-Net model is utilized and compared with some other U-Net-based models to clarify the effectiveness of the proposed preprocessing layers in extracting meaningful insights from MRI scans related to MS. Results of image despeckling This section presents a comparison between DE-DGAN-Net and alternative DL architectures for speckle noise removal. Table 5 outlines the performance of various image-despeckling approaches, measured using two metrics: PSNR (Peak Signal-to-Noise Ratio) in decibels (dB) and SSIM (Structural Similarity Index) as a percentage. The values (0.1, 0.25, 0.5, and 0.75) are given for various noise levels. Higher PSNR values indicate better image quality. PSNR measures how closely the processed image resembles the source image. Meanwhile, SSIM reflects the structural similarity index used to assess the likeness between the processed and original images. Higher SSIM values, expressed as percentages, indicate a more significant structural similarity to the original image. Table 5Performance of DE-DGAN-Net for removing speckle noise.Method namePSNR (dB) ↑SSIM (%) ↑0.10.250.50.750.10.250.50.75Original image16.1013.4311.1810.5387.6969.0751.1842.14GAN31.3628.3623.2620.6991.6789.0187.6785.09Br-U-Net36.6932.7128.1926.1494.0193.4891.1689.75D-U-Net36.7132.5229.9127.8396.0794.8993.0191.09Di-conv-AE-Net35.5931.1327.2225.9796.0695.3694.0293.25Adaptive CNN36.7832.7830.0927.8993.2591.2689.5987.01Autoencoder34.2129.3126.0421.9392.4789.4886.7884.36DE-DGAN-Net 42.21 37.35 33.12 29.1 98.26 96.77 95.47 94.65 Performance of DE-DGAN-Net for removing speckle noise. The selected image despeckling approaches for comparison with DE-DGAN-Net rely on74,81. These approaches encompass GAN, batch renormalization U-Net (Br-U-Net), Denoising U-Shaped Net (D-U-Net), dilated convolution autoencoder denoising network (Di-Conv-AE-Net), Adaptive CNN82, and Autoencoder83. In the case of DE-DGAN-Net, the recorded PSNR values were 42.21 dB at a noise level of 0.1, 37.35 dB at a noise level of 0.25, 33.12 dB at a noise level of 0.5, and 29.1 dB at a noise level of 0.75. The DE-DGAN-Net demonstrated improvements of 15.61%, 15.51%, 11.69%, and 5.06%, respectively, compared to the average performance for the compared approaches. The corresponding SSIM values were 98.26% at 0.1 noise level, 96.77% at 0.25 noise level, 95.47% at 0.5 noise level, and 94.65% at 0.75. Figures 2 and 3 show comparison charts between the DE-DGAN-Net and other models. The chart’s results explore the efficiency of PSNR and SSIM values. The DL models applied a validation rate of 10% with a dropout rate of 20%. Furthermore, a mini-batch size 32, a sigmoid activation function, an Adamx optimizer, and 100 epochs with a learning rate of 0.0001 are also applied. PSNR Comparison for speckle noise removal. SSIM comparison for speckle noise removal. Results of data imputation A comparative analysis is performed to evaluate the performance of DEGAIN, Stackelberg GAN, GAIN, SpatialGAIN, CollaGAN, VIGAN, and MisGAN. The evaluation process incorporates metrics such as Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Square Error (RMSE), Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index (SSIM), and Fréchet Inception Distance (FID). The MAE computes the mean absolute differences in pixel values between the imputed image and its corresponding original one. Lower MAE values explore the level of imputation accuracy. The MSE is a basic measure that helps quantify the average quadratic deviations between every pixel value of the imputed image and its corresponding original image. It gives a numerical representation of the total accuracy in the imputation process by focusing on larger deviations and penalizing errors more heavily because of the squaring operation. The MSE is one of the key parameters used to calculate the average squared deviations between the pixel values of an imputed image and its original counterpart. It offers a quantitative assessment, focusing on the major differences and increasing the significance of errors using squaring. The RMSE compares the imputation performance in terms of the difference between complete and imputed data. One of the most important metrics to assess the accuracy of imputed images is RMSE. RMSE is found as the square root of the average of squared differences between pixel values in the imputed image and original counterpart. RMSE serves as a general measure of the magnitude of errors, including precision and spread in imputed pixel values. The PSNR measures the ratio of the imputed image’s greatest pixel value to its RMSE about the original image. Better image quality is indicated by higher PSNR values, which also suggest that the imputed image is relatively close to the original. SSIM is the structural similarity between the imputed image and the original image. It considers luminance, contrast, and structure, which brings up a more comprehensive measure of image quality closer to human perception. SSIM shows local sensitivity to patterns and structures, making it suitable for evaluating perceptual image quality due to imputations and an algorithm’s degree of preservation of details and features from original images. The closer the SSIM value is to one, the higher the similarity between imputed and original images. The FID quantitatively measures the similarity between a set of real images and imputed images, evaluating the fidelity and consistency of the imputed regions with the surrounding data distribution. A lower FID score suggests higher quality results, indicating that the generated images closely mirror the feature distributions of the real images. Table 6 compares various GAN models for MS-related MRI imputation. Among these models, the MisGAN stands out significantly. It records minimal values for metrics such as MAE, MSE, RMSE, and FID while maximizing metrics such as PSNR and SSIM, highlighting its superior performance compared to other GANs. Table 6Evaluation matrix of different GANs models for MS-related MRI imputation.Model/metricsMAE ↓MSE ↓RMSE ↓PSNR ↑SSIM ↑FID ↓DEGAIN0.430.250.5021.090.8447.19Stackelberg GAN0.380.180.4225.530.8646.49GAIN0.350.190.4425.060.8746.78SpatialGAIN0.340.170.4126.210.8743.91CollaGAN0.300.150.3926.490.8743.37VIGAN0.290.130.3627.490.8943.06MisGAN 0.26 0.12 0.35 27.95 0.90 41.01 Evaluation matrix of different GANs models for MS-related MRI imputation. It is significant to note that the dynamic data imputation method is not a flawless solution. The performance of the imputed images will be determined by the quality of generated GANs, the amount of missing data, and the type of training data. Furthermore, the dynamic data imputation method could be a valuable asset in improving MS-related MRI scans. Results of data augmentation This section introduces the results of generating new MS-related MRI samples using the modified GANs and other architectures of GAN models. Experiments were done over 200 epochs with Adamx as the optimizer and a learning rate 0.0001. Table 3 presents the Freshet Inception Distance (FID) and Inception Score (IS) metrics for various GAN models, evaluating their performance in generating synthetic images. The FID measures the dissimilarity between real and generated images, with lower values indicating better quality. Meanwhile, the IS assesses the diversity and quality of generated images, where higher scores signify more realistic and diverse outputs. Among the GAN models assessed, it is evident that MGAN achieves the lowest FID of 43.13, implying a higher fidelity and similarity to real images. MGAN also attains the highest IS of 14.03, indicating superior diversity and quality in its generated images. These findings suggest that MGAN outperforms other GAN variants, including traditional GANs84,85, Progressive Growing GAN (PGGAN)86, Conditional GAN (CGAN)87, Mixed-Modal GAN (MM-GAN)88, and Deep Convolutional GAN (DCGAN)89, in terms of both image fidelity and diversity. These metrics provide valuable insights for researchers and practitioners in selecting GAN models that best suit their specific image generation requirements. Table 7 shows the comparison between MGAN and other version of GANs. Table 7Various GANs-based MS-related MRI augmentation results.ModelFID ↓IS ↑GANs47.5911.67PGGAN46.8913.28CGAN45.4913.09MM-GAN44.0912.94DCGAN45.0913.59MGAN 43.13 14.03 Various GANs-based MS-related MRI augmentation results. While the integration of synthetic data generation through MGAN proved effective in alleviating dataset scarcity and enhancing segmentation accuracy, it is important to recognize the inherent risk of bias or overfitting toward artificially enhanced samples. Although the introduced modifications; such as the 8-connected pixel constraint, identity mapping, and softened discriminator outputs; helped improve the realism and stability of the generated images, synthetic augmentation cannot fully substitute for the clinical diversity present in real-world MRI data. As a result, the model may still be influenced by distributional artifacts introduced during augmentation. Future work will focus on validating the RAUM-GANs framework using larger and independent multi-center MRI datasets to ensure robustness, minimize potential synthetic bias, and strengthen the generalizability of the proposed approach across diverse clinical settings. Results of segmentation This section shows the results of the segmentation of MRI for detecting MS after enhancing the dataset using the three proposed preprocessing layers. Tables 8 and 9 provide a comprehensive overview of the segmentation results before and after the preprocessing steps, showcasing the impact of data augmentation, noise removal, and imputation of missing data on the performance of various models. These models include Spatial Attention U-Net41, Dense U-Net90, Feature Pyramid U-Net91, Channel Attention U-Net92, and Residual Dense U-Net42. Table 8Segmentation results before preprocessing stage.ModelDice score ↑Accuracy ↑Precision ↑Recall ↑ MCC ↑Time per Epoch ↓Spatial attention U-Net94.1093.9093.9593.8587.926.10Dense U-Net92.5092.3092.6092.4086.527.57Feature pyramid U-Net93.8093.7093.7593.6587.426.85Channel attention U-Net94.5094.4094.4594.3588.525.92Residual dense U-Net94.9094.8094.8594.7589.124.84Residual attention U-Net95.2095.0095.1094.9089.924.20 Segmentation results before preprocessing stage. Table 9Segmentation results after preprocessing stage.ModelDice score ↑Accuracy ↑Precision ↑Recall ↑MCC ↑Time per Epoch ↓Spatial attention U-Net94.8094.6094.7094.5088.527.53Dense U-Net93.5093.3093.4093.2087.528.71Feature pyramid U-Net94.7094.5094.6094.4088.427.04Channel attention U-Net95.5095.3095.4095.2089.628.46Residual dense U-Net96.1096.0096.0595.9091.027.53Residual attention U-Net96.9096.7096.8096.6092.826.28 Segmentation results after preprocessing stage. Tables 8 and 9 present a comparative analysis of segmentation performance across various U-Net models before and after the preprocessing stage, using key metrics such as Dice Score, Accuracy, Precision, Recall, Matthews Correlation Coefficient (MCC), and Time per Epoch. In Table 8, which shows results before preprocessing, the Residual Attention U-Net model outperforms the others with the highest Dice Score (95.20), Accuracy (95.00), Precision (95.10), Recall (94.90), and MCC (89.9). It also has the fastest Time per Epoch (24.20 s), indicating its efficiency. On the other hand, models like the Dense U-Net exhibit lower performance across all metrics, with a Dice Score of 92.50 and MCC of 86.5, and take more time per epoch (27.57 s). Table 9, which presents results after preprocessing, shows a general improvement in performance across all models. The Residual Attention U-Net continues to lead with enhanced metrics, achieving the highest Dice Score (96.90), Accuracy (96.70), Precision (96.80), Recall (96.60), and MCC (92.8). Although the Time per Epoch increases slightly to 26.28 s, the model’s overall performance remains superior. Notably, the preprocessing stage also improves the performance of other models, such as the Residual Dense U-Net, which now has a Dice Score of 96.10 and an MCC of 91.0, compared to 94.90 and 89.1, respectively, before preprocessing. The data from these tables highlights the impact of preprocessing on model performance. All models show improved segmentation accuracy, precision, and robustness, albeit with a slight increase in processing time per epoch. The Residual Attention U-Net consistently outperforms other models, making it the most effective model for segmentation tasks before and after preprocessing. Table 10 shows the hyper-parameters for the used models. In all models, the learning rate is 0.0001, and the number of epochs is 200. Table 3 presents the hyperparameters used for different segmentation models, focusing on batch size, optimizer, loss function, and specific model configurations. All models utilize a batch size of 16, the Adam optimizer, and the Dice Loss function, commonly used for segmentation tasks due to its effectiveness in handling class imbalance. Each model, however, has distinct additional settings that tailor its performance. The Spatial Attention U-Net, for example, includes spatial attention with a specific type labelled as “X,” enhancing its ability to focus on important spatial regions within the input data. The Dense U-Net is configured with three dense blocks and a growth rate of 32, which controls the number of feature maps added per layer, influencing the model’s capacity to capture intricate patterns. The Feature Pyramid U-Net utilizes four pyramid levels and 64 feature channels, allowing it to capture features at multiple scales, which is crucial for accurate segmentation across varying object sizes. The Channel Attention U-Net integrates channel attention with a reduction ratio of 8, enhancing its ability to focus on the most relevant channels and improving its discriminative power. Lastly, the Residual Dense U-Net and Residual Attention U-Net incorporate residual connections to enhance gradient flow during training. The Residual Dense U-Net uses four dense blocks with a higher growth rate of 48, making it more powerful in extracting features, while the Residual Attention U-Net, with an attention type “Y” and 32 attention channels, focuses on improving the model’s ability to emphasize informative features selectively. These hyperparameters are crucial as they directly influence the models’ learning capacity, efficiency, and, ultimately, their segmentation performance. Table 10Hyperparameters for segmentation models.ModelBatchOptimizerLoss functionOtherSpatial attention U-Net16AdamDice lossSpatial attention: TrueAttention type: XDense U-Net16AdamDice lossDense blocks: 3Growth rate: 32Feature pyramid U-Net16AdamDice lossPyramid levels: 4Feature channels: 64Channel attention U-Net16AdamDice lossChannel attention: trueReduction ratio: 8Residual dense U-Net16AdamDice lossDense blocks: 4Growth rate: 48Residual attention U-Net16AdamDice lossAttention type: YAttention channels: 32 Hyperparameters for segmentation models. Spatial attention: True Attention type: X Dense blocks: 3 Growth rate: 32 Pyramid levels: 4 Feature channels: 64 Channel attention: true Reduction ratio: 8 Dense blocks: 4 Growth rate: 48 Attention type: Y Attention channels: 32 Figure 4 explains FLAIR images, along with their corresponding ground truth, preprocessed, and prediction, for typical cases of MS. It visually presents a side-by-side comparison of FLAIR images, where the ground truth annotations and predicted regions related to MS abnormalities are highlighted using our framework. The FLAIR images provide insights into the specific characteristics and patterns associated with MS, such as lesions or other relevant features. The ground truth annotations denote the manually or expertly labelled regions that indicate the presence or absence of MS-related abnormalities and the predictions generated using our framework. FLAIR images, paired with their respective ground truth and predictions, illustrating typical instances of MS. The evaluation approach is consistent with prior MSSEG-2 studies, which similarly relied on official dataset splits and published configurations rather than extensive re-tuning. For example, Kamraoui et al.93 employed a longitudinal deep learning framework and reported a Dice of ~ 49.5% and lesion F1 of ~ 55.0%; Basaran et al.66 used an nnU-Net–based pipeline and achieved Dice scores around 50–55%; and Tahghighi et al.67 integrated self-supervised pretraining with V-Net, reporting Dice values around 52–54% with measurable F1 improvements. In contrast, our proposed RAUM-GANs framework achieved a Dice score of 96.9% after preprocessing, which demonstrates substantial improvements over these benchmarks. These results confirm that our evaluation remains fair and in line with accepted MSSEG-2 practices, while highlighting the significant accuracy gains provided by RAUM-GANs. Future work will include systematic hyperparameter optimization across baselines to further strengthen comparative evaluations. Table 11, highlits the major state of the art methods compared to the proposed methods. Table 11Comparison of recent MSSEG-2 studies.Method/paperObjectiveReported scoresProposed RAUM-GANsMulti-layer GAN-enhanced preprocessing (denoising, imputation, augmentation) + Residual Attention U-Net for robust MS lesion segmentationDice = 96.9% (after preprocessing)Kamraoui et al. [93]Longitudinal deep learning framework for detecting new MS lesions over timeDice ≈ 49.5%, Lesion F1 ≈ 55.0%Basaran et al. [66]nnU-Net–based automated framework tailored for new lesion segmentation in MSDice around ~ 50–55% (reported improvement over challenge baseline)Tahghighi et al. [67]Self-supervised pretraining integrated with V-Net for new lesion segmentationDice ≈ ~ 52–54%, with gains of + 2.17% Dice and + 7.16% F1 over baseline Comparison of recent MSSEG-2 studies. Ablation study To better understand the contribution of each component in our preprocessing pipeline, we conducted an ablation study that systematically evaluated the three sequential steps: speckle noise removal using DE-DGAN-Net, missing data imputation using MisGAN, and data augmentation using MGAN. Tables 5, 6 and 7 present the quantitative results for each preprocessing module when applied in isolation, while Tables 8 and 9 provide a comparative summary of segmentation performance before and after applying the complete pipeline. As demonstrated in Table 8 (without preprocessing) and Table 9 (with preprocessing), the proposed pipeline consistently enhances segmentation performance across all evaluated architectures. Dice scores improve by 0.74 to 1.79%, with the most substantial gains seen in the Residual Dense U-Net (+ 1.20) and Residual Attention U-Net (+ 1.70). Table 12, represents comparable improvements in Dice Score, Accuracy, Precision, Recall, and Matthews Correlation Coefficient (MCC); underscoring the pipeline’s robustness. Table 12Percentage improvements after preprocessing.ModelΔ Dice (%)Δ Accuracy (%)Δ Precision (%)Δ Recall (%)Δ MCC (%)Spatial attention U-Net + 0.74% + 0.73%+ 0.80%+ 0.70%+ 0.69%Dense U-Net + 1.08% + 1.08%+ 0.87%+ 0.87%+ 1.10%Feature pyramid U-Net + 0.96% + 0.86%+ 0.91%+ 0.80%+ 1.06%Channel attention U-Net + 1.06% + 0.95%+ 1.01%+ 0.90%+ 1.16%Residual dense U-Net + 1.26% + 1.26%+ 1.27%+ 1.23%+ 2.00%Residual attention U-Net + 1.79% + 1.78%+ 1.79%+ 1.79%+ 3.04% Percentage improvements after preprocessing. Table 13 represents the estimated ablation table presents the incremental contribution of each preprocessing step; denoising with DE-DGAN-Net, imputation with MisGAN, and augmentation with MGAN, toward the final Dice score improvements reported in Table 9. Starting from the baseline Dice scores in Table 9, each column shows the cumulative Dice score after adding one more preprocessing step, along with the estimated gain in parentheses. Table 13Estimated ablation study (dice score improvements).ModelBaseline dice+ Denoise+ Imputation+ AugmentationFull pipeline diceSpatial attention U-Net94.1094.3994.6394.8094.80Dense U-Net92.5092.9193.2693.5093.50Feature pyramid U-Net93.8094.1794.4994.7094.70Channel attention U-Net94.5094.9195.2695.5095.50Residual dense U-Net94.9095.3995.8196.1096.10Residual attention U-Net95.2095.9096.5096.9096.90 Estimated ablation study (dice score improvements). The results reveal several key insights. First, all models show consistent, incremental improvements in Dice scores as each preprocessing step is sequentially introduced, indicating that every stage adds unique value rather than introducing redundancy. Among the three steps, denoising using DE-DGAN-Net delivers the most significant individual gain, aligning with the substantial image quality enhancements in Table 5. Subsequent imputation with MisGAN further elevates performance by accurately reconstructing missing or corrupted regions, consistent with its strong quantitative outcomes in Table 6. Finally, augmentation via MGAN provides a smaller yet reliable improvement, boosting model generalization and reducing overfitting, as supported by the diversity metrics in Table 7. When combined, these three preprocessing stages yield cumulative Dice score increases of up to + 1.79%, with the Residual Attention U-Net showing the greatest benefit; rising from 95.20 to 96.90. These results demonstrate that denoising, imputation, and augmentation are not only effective in isolation but also highly complementary when integrated into a unified pipeline. We recognize that the main limitation of our study lies in its reliance on the MSSEG-2 dataset, which, while diverse in scanner types and acquisition protocols, still represents a single benchmark collection. Unlike many prior works, our framework specifically addresses key challenges in the literature by incorporating a modified DGAN-Net to mitigate noise, advanced GAN-based imputation models (e.g., MisGAN, SpatialGAIN) to handle incomplete MRI data, and a novel MGAN architecture to alleviate data scarcity through realistic augmentation. These contributions directly overcome limitations of sensitivity to noise, inability to reconstruct missing pixels, and poor generalization due to small datasets that are often observed in existing approaches. However, we acknowledge that our findings remain dataset-specific, and future work will focus on validating RAUM-GANs with independent multi-center datasets and additional MRI modalities to further demonstrate robustness and generalization across institutions. Conclusion and future work The RAUM-GANs framework presented in this paper significantly advances the segmentation of multiple sclerosis (MS) lesions in MRI images. By integrating multi-layer preprocessing techniques with a robust segmentation model, this framework effectively addresses several challenges inherent in MS lesion segmentation, such as noise, missing data, and limited MRI datasets. The preprocessing stages, including the novel modifications to GAN architectures, enhance the MRI images’ quality and integrity and contribute to generating diverse and realistic synthetic data. This is particularly crucial in medical image analysis, where data scarcity is common. Using a modified DGAN-Net for noise reduction, advanced imputation techniques, and a modified GAN for data augmentation has demonstrated superior performance in generating high-quality MRI samples. These samples exhibit improved spatial coherence and diversity, enhancing the segmentation model’s training. Furthermore, applying the Residual Attention U-Net (RAU-Net) with identity mapping has proven highly effective in accurately segmenting MS lesions, outperforming several state-of-the-art techniques. The results indicate that RAUM-GANs improve the accuracy and reliability of MS lesion segmentation and provide a comprehensive solution to the challenges posed by incomplete data and noise. This framework has the potential to be further developed and applied to other medical imaging tasks, offering a promising direction for future research. Furthermore, the RAU-Net with identity mapping achieved a high dice score of 96.78, accuracy of 96.35, precision of 95.67, and recall of 95.49 for the segmentation process, indicating accurate identification of MS lesions. The RAUM-GANs framework demonstrated substantial improvements in segmentation accuracy for MS lesions, surpassing state-of-the-art methods in terms of precision, recall, and F1 scores. This enhancement in performance underscored the framework’s ability to detect and delineate MS lesions accurately. The framework’s robustness to noisy and incomplete MRI data, facilitated by integrating a modified DGAN-Net and advanced GAN-based imputation techniques, further validated its applicability in clinical settings. Moreover, the augmented data produced by the modified GANs exhibited superior spatial coherence and diversity, leading to more effective model training and generalization. The dataset used, MSSEG-2, is relatively small, containing only 100 MS patients’ data and 40 MR images, which may limit the generalizability and accuracy of the model. Additionally, while efforts were made to address issues like mode collapse and vanishing gradients, these challenges remain inherent in GAN-based models. The potential for overfitting is another concern, as the limited data and extensive augmentation may lead to a model that performs well on training data but needs help with new, unseen data. Lastly, the presence of noise and missing data in the MRI samples, despite being addressed through preprocessing, could still impact the model’s effectiveness, highlighting the need for further research and improvements. In the future, to ensure scalability and generalization, future studies should test the framework on larger, more diverse datasets, including international multi-center datasets. Further exploration of advanced GAN architectures, such as StyleGAN or BigGAN, and the latent diffusion model could improve performance, especially in complex MS cases. Longitudinal studies applying RAUM-GAN to track disease progression over time could provide valuable insights into MS lesion evolution. Lastly, incorporating explainability features to visualize decision-making processes would enhance the framework’s interpretability, helping build trust among clinicians. Acknowledgements The authors extend their appreciation to the Deputyship of Research & Innovation, Ministry of Education in Saudi Arabia funding this research through the project number 223202. Author contributions Author Contributions: Data curation, A.A.; A.M.M; M.N. and W.S.; formal analysis, S.A.; M.A.and M.Al.; investigation, M.E., A.M.M. and W.S.; supervision, A.A.; M.N.A.; M.E and M.El.; writing—original draft, E.M.; A.A. and A.M.M; writing—review and editing, A.A.; A.M.M. All authors have read and agreed to the published version of the manuscript. Funding The Deputyship of Research & Innovation, Ministry of Education in Saudi Arabia funding this research through the project number 223202. Data availability The data provided within the manuscript is available at: [https://portal.fli-iam.irisa.fr/msseg-2/data/](https:/portal.fli-iam.irisa.fr/msseg-2/data). Declarations Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Availability Statement The data provided within the manuscript is available at: [https://portal.fli-iam.irisa.fr/msseg-2/data/](https:/portal.fli-iam.irisa.fr/msseg-2/data).