scieee AI-readable full text Open interactive document viewer

Fibrosis segmentation in cardiac resonance imaging

Ferreira, Luis Filipe da Silva

Abstract

Heart disease, a leading cause of mortality worldwide, is associated in many cases with a condition known as myocardial fibrosis, assuming a crucial prognostic in disease assessment. Fibrosis manifests in two forms, interstitial and replacement, both affect the heart tissue, however, the first may be reversible with early identification and intervention, and the second causes permanent scar tissue. Given this, the patient needs a precise diagnostic for effective management and treatment, so accurate fibrous tissue localization is needed, to reduce complications according to the patient’s condition. Manual segmentation is the gold standard for accuracy, although it’s time-consuming and costly. For this reason, automated methods have been developed to improve speed and repeatability compared to manual methods, however, the accuracy is still not reliable, due to difficulties in segmenting small and irregular tissues, resolution challenges, and cardiac magnetic resonance imaging quality . Considering the main problem, this project aims to introduce a new attention mechanism to improve an algorithm that can automatically segment the left ventricular myocardium and distinguish between healthy and fibrous tissue using advanced deep-learning methods. Regarding the methodology, we will have the method divided into two phases. In the first stage, a 2D U-Net with Balanced Steady-State Free Precession (bSSFP), Late Gadolinium Enhancement (LGE), and T2 sequences was used as input, to segment three key anatomical structures of the heart: left ventricle, right ventricle, and the left ventricular myocardium, to predict the myocardium area and identify possible locations for edema and scar. In the second stage, the left ventricular myocardium mask from the first stage, accompanied by the same three magnetic resonance imaging sequences and two new images, the LGE-myo and T2-myo, will be used to refine the segmentation and detection of the lesion. In this stage, a new attention mechanism, Bilateral Local Attention (BLA), was implemented within the transformer encoder from the network variant U-Shape Nested Transformer (UNesT). This network comprises a Transformer-based encoder (Nested Hierarchical Transformer), and a convolution-based decoder. The dataset employed in this approach was provided by the MICCAI2020 MyoPS challenge and consists of 45 sets of cardiac magnetic resonance images with three sequences (bSSFP, LGE, T2). Contrary to expected, the results achieved did not significantly exceed those of state-of-the-art methods, although they remain competitive compared to the models that did not employ an ensemble approach, it was positioned in third place among the six methods that did not use this strategy. The average Dice Similarity Coefficient (DSC) of the method was 0.678, in terms of scar segmentation the DSC resulted was 0.640 ± 0.232, and for the combined scar and edema the DSC was 0.715 ± 0.110. In conclusion, the results suggest that the implemented attention mechanism, although promising, did not bring significant benefits in capturing detailed information from cardiac magnetic resonance images compared to other works. This may be attributed to challenges in adapting the model to the specific anatomical variability present in the analyzed images or the need for further investigation to fine-tune the hyperparameters of the second stage.

Full text

University of Minho School of Engineering Luís Filipe da Silva Ferreira Fibrosis Segmentation in Cardiac Resonance Imaging october 2024 University of Minho School of Engineering Luís Filipe da Silva Ferreira Fibrosis Segmentation in Cardiac Resonance Imaging Masters Dissertation Masters Degree in Bioinformatics Dissertation supervised by Professor Doctor Carlos Silva Co-supervised by Doctor Adriano Pinto october 2024 Copyright and Terms of Use for Third Party Work This dissertation reports on academic work that can be used by third parties as long as the internationally accepted standards and good practices are respected concerning copyright and related rights. This work can thereafter be used under the terms established in the license below. Readers needing authorization conditions not provided for in the indicated licensing should contact the author through the RepositóriUM of the University of Minho. CC BY-NC-ND https://creativecommons.org/licenses/by-nc-nd/4.0/ i Acknowledgements The academic path is filled with obstacles and unexpected twists and at that point is when encouragement from family, girlfriend, and friends was very important to me to keep motivated in pursuing my aspirations. Navigating through unknown territories often brings choices and moments of doubt that require patience and persistence to outline these challenges. With that said, I would like to express my gratitude for all the knowledge, support, and dedication given by my supervisor Professor Carlos Silva, who made this work possible to be completed, despite all the obstacles encountered along the way. Additionally, I would like to extend my appreciation to Doctor Adriano Silva for his role in this process and to Elsa Ferreira, who conducted similar research and generously shared her insights. I would like to express my heartfelt gratitude to my family, especially my girlfriend, Catarina Nunes, for always understanding and supporting me in my lowest moments and contributing everything within their reach to help, and finally, to all my friends who were always there to help me whenever I needed them. None of this progress would have been possible to achieve alone. ii Statement of Integrity I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. University of Minho, Braga, october 2024 Luís Filipe da Silva Ferreira iii Abstract Heart disease, a leading cause of mortality worldwide, is associated in many cases with a condition known as myocardial fibrosis, assuming a crucial prognostic in disease assessment. Fibrosis manifests in two forms, interstitial and replacement, both affect the heart tissue, however, the first may be reversible with early identification and intervention, and the second causes permanent scar tissue. Given this, the patient needs a precise diagnostic for effective management and treatment, so accurate fibrous tissue localization is needed, to reduce complications according to the patient’s condition. Manual segmentation is the gold standard for accuracy, although it’s time-consuming and costly. For this reason, automated methods have been developed to improve speed and repeatability compared to manual methods, however, the accuracy is still not reliable, due to difficulties in segmenting small and irregular tissues, resolution challenges, and cardiac magnetic resonance imaging quality . Considering the main problem, this project aims to introduce a new attention mechanism to improve an algorithm that can automatically segment the left ventricular myocardium and distinguish between healthy and fibrous tissue using advanced deep-learning methods. Regarding the methodology, we will have the method divided into two phases. In the first stage, a 2D U-Net with Balanced Steady-State Free Precession (bSSFP), Late Gadolinium Enhancement (LGE), and T2 sequences was used as input, to segment three key anatomical structures of the heart: left ventricle, right ventricle, and the left ventricular myocardium, to predict the myocardium area and identify possible locations for edema and scar. In the second stage, the left ventricular myocardium mask from the first stage, accompanied by the same three magnetic resonance imaging sequences and two new images, the LGE-myo and T2-myo, will be used to refine the segmentation and detection of the lesion. In this stage, a new attention mechanism, Bilateral Local Attention (BLA), was implemented within the transformer encoder from the network variant U-Shape Nested Transformer (UNesT). This network comprises a Transformer-based encoder (Nested Hierarchical Transformer), and a convolution-based decoder. The dataset employed in this approach was provided by the MICCAI2020 MyoPS challenge and consists of 45 iv sets of cardiac magnetic resonance images with three sequences (bSSFP, LGE, T2). Contrary to expected, the results achieved did not significantly exceed those of state-of-the-art methods, although they remain competitive compared to the models that did not employ an ensemble approach, it was positioned in third place among the six methods that did not use this strategy. The average Dice Similarity Coefficient (DSC) of the method was 0.678, in terms of scar segmentation the DSC resulted was 0.640 ± 0.232, and for the combined scar and edema the DSC was 0.715 ± 0.110. In conclusion, the results suggest that the implemented attention mechanism, although promising, did not bring significant benefits in capturing detailed information from cardiac magnetic resonance images compared to other works. This may be attributed to challenges in adapting the model to the specific anatomical variability present in the analyzed images or the need for further investigation to fine-tune the hyperparameters of the second stage. Keywords Myocardial Fibrosis, Cardiac Magnetic Resonance Imaging, Deep Learning, Transformers v Resumo As doenças cardíacas são a principal causa de mortalidade em todo o mundo, sendo associada em muitos casos a uma condição conhecida como fibrose miocárdica, assumindo um prognóstico crucial na avaliação da doença. A fibrose manifesta-se de duas formas, intersticial e de substituição, sendo que ambas afetam o tecido cardíaco, no entanto, a primeira pode ser reversível com identificação e intervenção prévia, e a segunda provoca cicatriz permanente no tecido. Perante isto, o doente necessita de um diagnóstico preciso para uma gestão e tratamento eficaz, pelo que é necessária uma localização precisa do tecido fibroso de format a reduzir as complicações, tendo em conta a condição do doente. A segmentação manual é a referência padrão no que toca à precisão, no entanto é demorada e dispendiosa. Por este motivo, foram desenvolvidos métodos automáticos para melhorar a velocidade e a repetibilidade em comparação com os métodos manuais, no entanto, a precisão ainda não é fiável, devido a dificuldades de segmentação de tecidos pequenos e irregulares, desafios de resolução e qualidade das imagem de ressonância magnética cardíaca. Considerando o problema principal, este projeto visa introduzir um novo mecanismo de atenção, para melhorar um algoritmo que segmenta automaticamente o miocárdio ventricular esquerdo e distingue entre tecido saudável e fibroso, utilizando métodos avançados de Deep Learning . Quanto à metodologia, teremos o método dividido em duas fases. Na primeira fase, foi utilizada uma U-Net 2D com as sequências Balanced Steady-State Free Precession (bSSFP), Late Gadolinium Enhancement (LGE) e T2 como entrada para segmentar três estruturas anatómicas principais do coração: ventrículo esquerdo, ventrículo direito e miocárdio ventricular esquerdo, para prever a área do miocárdio e identificar possíveis locais para o edema e a cicatriz. Na segunda etapa, a máscara do miocárdio ventricular esquerdo da primeira etapa, acompanhada das mesmas três sequências de ressonância magnética e de duas novas imagens, a LGE-myo e a T2-myo, será utilizada para melhorar a segmentação e deteção da lesão. Nesta fase, um novo mecanismo de atenção, Bilateral Local Attention (BLA), foi implemenvi List of Tables 1 Average Dice Similarity Coefficient values for segmentation in the validation dataset at thefirststage..................................... 55 2 Dice Similarity Coefficient values for scar and edema segmentation when different transformer encoders adopt different attention blocks in the validation dataset . . . . . . . . 56 3 Dice Similarity Coefficient (DSC) coefficient values for scar and edema with different methods in the MyoPS 2020 contest. In the table below, the DSC values for the proposed model BLA UnesT reflect the results obtained, including case #207, which contains no scar. When case #207 is excluded, the average DSC changes from 0.640 ± 0.232 to 0.674 ± 0.195. The use of the superscript (**) shows that the approach utilized ensemble learninginthemethod................................. 58 xiii Acronyms AdamW AdamWeightDecay. AI Artificial Intelligence. ANN Artificial Neural Networks. BCE Binary Cross Entropy. BLA Bilateral Local Attention. BN Batch normalization. bSSFP Balanced Steady-State Free Precession. CE Cross Entropy. CMR Cardiac Magnetic Resonance. CNN Convolutional Neural Network. CSWin Cross-Shaped Window. CT Computed Tomography. DeiT Data-efficient Image Transformers. DL Deep Learning. DSC Dice Similarity Coefficient. ECG Electrocardiogram. xiv ECMs Extracellular Matrix Proteins. FCN Fully Convolutional Network. FCNN Fully Connected Neural Networks. FNN Feedforward Neural Networks. FSLA Feature-Space Local Attention. FWHM Full Width at Half Maximum. GANs Generative Adversarial Networks. GD Gradient Descent. ISLA Image-Space Attention. LA Left Atrium. LGE Late Gadolinium Enhancement. LV Left Ventricle. MI Myocardial Infarction. ML Machine Learning. MLP Multi-Layer Perceptron. MN-Net Multi-Scale Nested Network. MRI Magnetic Resonance Imaging. MSA Multi-Head Self-Attention. MSED-Net Multi-Scale Symmetric Encoding-Decoding Network. MyoPS Myocardial Pathology Segmentation. NLP Natural Language Processing. RA Right Atrium. xv ReLU Rectified Linear Unit. ResNet Residual Network. RGB Red Green Blue. RNN Recurrent Neural Networks. RV Right Ventricle. SA Self-attention. SDPA Scaled Dot Product Attention. SGD Stochastic Gradient Descent. SNR Signal-to-Noise Ratio. SSIR Single Shot Inversion Recovery. Swin-T Swin Transformer. TanH Tangent Hyperbolic. UNesT U-Shape Nested Transformer. ViT Vision Transformer. xvi Chapter 1 Introduction This chapter determines the motivation and the goals behind this dissertation, more specifically all the framework of the exploration made. It also explains the dissertation’s structure to, more easily, explore the various chapters and sections. 1.1 Context and Motivation Heart diseases stand out as a problem of enormous relevance, representing the main cause of mortality globally and having a substantial impact on health systems and society as a whole. This intricate scenario is characterized by a wide diversity of clinical contexts that trigger cardiac conditions, with particular emphasis on pathologies associated with the myocardium. In the cardiovascular diseases lies a condition known as myocardial fibrosis that often recurs on a histological level, which assumes a crucial prognostic position. It manifests in two forms: Interstitial Fibrosis, which spreads along the heart tissue during the initial stages of the disease, as myofibroblasts accumulate collagen and the effects might be reversible with early identification and intervention; Replacement Fibrosis, which occurs following cell death, in this case, collagen affects the cell subsequently causing permanent alterations to the heart tissue. It is also important to consider that different cardiac diseases have varied patterns and distributions of fibrosis, which complicates diagnosis and treatment even more. To manage this type of disease effectively and predict prognosis, while understanding its locations in detail, it’s necessary to have a precise evaluation and characterization of the problem, particularly in fibrosis segmentation in Cardiac Magnetic Resonance (CMR) images. This information improves management and helps in decision-making on how to proceed with the therapy, allowing comprehensive monitoring of disease progression by giving exact areas affected by fibrosis in the heart. By doing this, 1 many strategies can be used, such as prescribing specific medications or devices to the fibrosis location in Myocardial Infarction (MI) on the patient’s heart, possibly resulting in lower complications depending on the patient’s condition. Myocardial fibrosis it’s not just a prognosis, it also has a significant impact on the quality of life from an individual perspective. The effects of fibrosis can cause many symptoms that impact an individual’s day- to-day, for example by compromising heart function, and depending on the progression of the pathology, many activities become restricted, like their ability to exercise, accompanied by symptoms such as fatigue and dyspnea. To have a precise segmentation of the fibrosis, different techniques are broadly divided into three categories: manual, automatic, and semi-automatic. The gold standard is manual segmentation, in which trained professionals perform an accurate and tiring segmentation. But this is frequently expensive, slow, and operator-dependent. By contrast, automatic segmentation uses algorithms to divide the CMR images into segments fast and efficiently with a sometimes lack of precision. At least, the goal of semi-automatic segmentation is to improve speed and accuracy by fusing human experience with automated procedures. These techniques can be applied in both two and three dimensions, depending on the imaging requirements. Automation is critical in clinical practice, as it overcomes the fundamental limitations of doing this manually, providing efficiency alongside consistency and agility for assessing fibrosis. This development, not only improves the accuracy of diagnosis, it also indicates a shift, in the understanding and treatment strategies concerning myocardial fibrosis and its implications in patients. Nevertheless, the porting of these methods to clinical practice has not been fully recognized across many medical fields, for this motive, automatic segmentation remains an important research topic. This often occurs due to insufficient data, leading to underestimation in clinical assessments, the small size of particular structures, which makes their resolution difficult, and the complex boundaries of heterogeneous abnormalities and structures situated between diverse anatomical features. On the other hand, the existing techniques that utilize automated segmentation solutions are limited since they are sensitive to imaging quality, structures with comparable intensities, and difficulties in accommodating the diverse range of anatomical differences among individuals. Even while some methods in cardiology are beginning to be promising, much work needs to be done, especially in segmenting intricate cardiac structures and anomalies. Automated segmentation techniques have also been advanced in various domains, including pulmonology, hepatology, neurology, and others. 2 1.2 Objectives This project aims to improve an algorithm that can automatically segment the left ventricular myocardium by distinguishing between healthy and fibrous tissue using advanced deep-learning methods. The main goal of this study consists of introducing a new attention mechanism within an architecture that incorporates a nested hierarchical transformer as an encoder and comprises a convolution-based decoder, attempting to improve the extracting of features in the data and consequently improve the model. The algorithm’s performance is assessed methodically by utilizing accessible images of multi-sequenced CMR based on the Myocardial Pathology Segmentation (MyoPS) challenge dataset, provided by MICCAI2020. Additionally, improving our skills in the Python programming language and diverse Machine Learning (ML) libraries such, as Pytorch, Monai, and PyTorch Lightning. Such assignment requires combining fields of expertise, like image processing and programming along with focusing on ML and health sciences, to advance cardiac segmentation techniques effectively by analyzing cardiac images, specifically, detecting myocardial fibrosis accurately. 1.3 Structure of the Dissertation The structure of this dissertation is made of six distinct chapters. The introductory chapter addresses the context, motivation, and objectives underlying the development of this work. The second chapter corresponding to the theoretical principles, explores two important keys in this work, the biological terms and the Artificial Intelligence (AI) terms. Relatively to the biological terms, it describes the anatomy and physiology of the myocardium, along with the pathophysiology of myocardial fibrosis, and permits an understanding of how the presence of fibrosis impacts the patient. Additionally, specific aspects of the magnetic resonance technique along with the different types of sequences that can be used, depending on the objective, are explored. At the principles of AI, essential theoretical foundations will be examined to support the development of the dissertation, covering concepts related to ML,Deep Learning (DL), and more importantly, transformers, fostering familiarity with these concepts and their evolution over time. In the third chapter, a brief introduction to existing methods used in the segmentation of CMR images, to identify cardiac structures such as the Left Ventricle (LV) myocardium, LV, and Right Ventricle (RV), and the pathologies (edema and scar), highlighting various algorithms (automatic, semi-automatic) and strategies. In the fourth chapter, all the specific information has been meticulously explained to lay out 3 the groundwork of the project, what was initially provided, and what was modified across both stages of the project. Finally, the sixth chapter presents the conclusions and future perspectives, considering all the work and the results obtained, addressing the problem presented, the proposed method, its advantages or disadvantages, and what could be done to improve the results. 4 Chapter 2 Theoretical Principles 2.1 Medical Perspective In this chapter, the medical condition brought to light is explained, emphasizing the understanding of fibrosis pathophysiology, specifically the anatomy, and physiology, describing some of the consequences associated with its presence. The advanced CMR imaging techniques and some sequences associated, like Late Gadolinium Enhancement (LGE), will be discussed in detail throughout the chapter. 2.1.1 Heart Anatomy and Physiology Almost every living being needs an organ to keep the circulant fluid flowing throughout the body, and for humans, the heart makes the blood flow and serves as one of the most vital organs in the body. It serves as the central component of the cardiovascular system, situated in the upper part of the chest, slightly behind and to the left, shielded by the sternum and the rib cage. The muscle of the heart is highlighted with four structures, as we can see in Figure 1, specifically two atria (right and left sides each) in the upper part of the structure and two ventricles (right and left) in the lower part. Each chamber has a unique function in the pumping process, and circulating blood, which is essential to the cardiac cycle. The heart’s chambers proceed in two stages, contracting and relaxing, which provide control of the blood flow inside the heart. During systole, the atria and ventricles contract, which propels blood into vessels, and then in the diastole, the chambers relax and are filled again with blood in anticipation of another pump [1]. To ensure that oxygen and nutrients are distributed to every cell in the body, the cardiovascular cycle pumps blood with low oxygen saturation from the body to the Right Atrium (RA), where it’s pumped to the RV and then to the lungs via the pulmonary artery. On the other hand, it pumps blood with high oxygen saturation from the lungs to the Left Atrium (LA), where it is pumped to the LV and then expelled 5 to the body through the aorta [2]. Figure 1: Heart anatomy. Adapted from [2]. The proper functioning of the heart depends on its muscle walls. The walls are made of three layers which work together to contract the heart’s muscles. The endocardium (innermost layer) guarantees a smooth blood flow surface. The epicardium (outer layer) protects and provides structural support. The myocardium is in between the epicardium and endocardium, the thick middle layer that makes up the heart muscle [2]. Cardiomyocytes are the specialized cells that compose this muscle, the blood flow and pressure in the circulatory system are maintained by them. Cardiomyocytes are tubular structures composed of chains of myofibrils, rod-like units within the cell. These myofibrils correspond to repeated sections of sarcomeres, which are the fundamental contractile factors of muscle cells. Myosin and actin are proteins that form myofilaments, thick and thin fibers that are contained within the sarcomeres. The sliding of myofilaments during muscle compression and relaxation is intermediated by the release of calcium from the sarcoplasmic reticulum, triggering excitation-compression coupling [3]. Oxygen and nutrients facilitate blood flow to the myocardium via the coronary arteries showing that the cardiac cycle is crucial. Any alteration in coronary vascularization or heart muscle function can induce a range of clinical conditions, similar to ischemia or inflammatory cardiomyopathy, decreasing cardiac function and potentially leading to heart failure [3]. 2.1.2 Pathophysiology of Fibrosis A significant histological aspect, such as cardiac fibrosis is frequently observed in heart conditions, where there is an initial build-up of Extracellular Matrix Proteins (ECMs). This process affects the heart’s 6 settings using medical images that are usually defined by pixel intensity values. In this scenario, the goal is to generate a numeric code as the output, which signifies the identification and classification of different tissues, specific pathological features, or conditions within the medical images [14, 17]. 2.2.1.3 Cross-Validation To assess and compare learning algorithms it’s used a technique called cross-validation, to split the dataset into multiple subsets: one of the parts is meant for training and the other for validating it. The main concept is that during rounds of cross-validation iterations, all subsets are used for both training and validation at different iterations, ensuring each data point is included in a validation set at least once. Validation through cross-validation becomes particularly crucial in situations where the dataset is limited in size and there’s a risk of overfitting since it offers an assessment of a model’s effectiveness by guaranteeing every data point is used, in both training and validation phases [18, 19]. Various techniques can be used in validation, but the focus will be centered on the most common one, K-Fold Cross-Validation, whose purpose is to segment a dataset into ksections, known as folds of similar sizes, for training and validation purposes. For example, considering a 3-fold validation process, the data is divided into three parts, this way the model is trained three times in total. One portion is set aside for validation purposes and the two left out are used for training sessions, in each training session as part of this process. When in each iteration, a fold of the data is held out for validation, the other remaining (k-1 folds) are used for learning. Once all the rounds are finished and done with the model evaluation process for each segment, the model is monitored using a predefined measure like an accuracy score. By taking an average to generate a general performance analysis for the model the performance indicators from every segment are combined. This method assists in guaranteeing that the model’s efficiency remains stable and is not excessively reliant on one specific part of the dataset [18]. Cross-validation serves not only the purpose of assessing the effectiveness and applicability of a trained model with one algorithm but also evaluating different learning algorithms or variations of a parameterized model to make comparisons easier. These comparisons are done by analyzing performance metrics across various folds in the dataset, to identify the most optimal algorithm or model variation for a particular dataset [18, 19]. 2.2.2 Deep Learning Within the broader category of DL,ML exemplifies a transformative approach in the era of the Fourth Industrial Revolution. Deep Neural Networks are the basic architecture inside DL, which represents complex architectures that can transform raw data into abstract and even hierarchical representations, allowing ma- 13 chines to perform intrinsically complex tasks such as detection and classification with complete autonomy. Unlike traditional programming paradigms, in which algorithms are hand-coded to work with specific data structures, DL shines with its ability for representation learning at multiple levels. At a low level, we have things like patches of edges and textures and so on, all the way to class labels in an image at a higher level, where each ”neuron” computes sophisticated non-linear functions, allowing it to cooperate with neighboring neurons to make up simple distortions coded by simple patterns. DL significance lies in combining these changes, interleaving them, and teaching the machine to learn monstrously non-linear operations largely by itself, given a suitable skeleton. This automation is particularly useful when it comes to pattern recognition in high dimensions, as we would have with speech recognition or image classification [20, 14]. Thus, DL has played a vital and irreplaceable role in advancing algorithms for processing medical images, evidenced by significant success in several tasks, mainly in the detection and diagnosis of diseases. The main applications of this field in medical image analysis include classification, detection, segmentation, and other tasks associated with image processing [21]. To be more precise, this process (up an image that has meaning into meaningful objects) is called image segmentation. Generally speaking, it is divided into two types: semantic segmentation and instance segmentation. The former aims to have a category label class for each pixel; The latter intends to carve out exact entities, for example, lesions. In medical image analysis, semantic segmentation is usually effective, in most cases using powerful DL algorithms like CNN [22]. In addition to the previously mentioned model, several advances in the field of medical image analysis include approaches such as Transformers, U-Net, FCN, 3D CNN, and ANN, among others. Each of these representations constitutes a unique approach to specific challenges [14]. 2.2.2.1 Artificial Neural Network The computer models of DL, also known as ANN, illustrated in Figure 5, is an abstract model that mimics the structure and function of the human brain, consisting of a set of artificial neurons connected by weights. They have input nodes that deliver information and analogous nodes in an output layer that process this information, modified by an activation function. ANN are structurally designed in layers and can have intermediary layers (an additional layer called a hidden layer) depending on the complexity of the tasks. These models are trained to adjust the weights of connections between neurons for optimized performance, usually by comparing the network output with the true results and updating the weights via an optimization algorithm [23, 14]. 14 Feedforward Neural Network Integrating the components discussed earlier, Feedforward Neural Networks (FNN) may either be classified as simple (if they don´t have hidden/intermediate layers) or deep (with one or more hidden layers). The idea of these hidden layers is that they learn more complex, hierarchical representations of data which then allows the model to capture much more intricate non-linear relationships. In FNN, as the name suggests, the information moves only in one direction, from the input layer through any hidden layers to the output layer, without having feedback connections. When feedback connections are incorporated, the architecture is called Recurrent Neural Networks (RNN).Multi- Layer Perceptron (MLP) is one of the most common deep FNN architectures and can be used to solve complex problems and learn abstract data representations [14]. Figure 5: Illustration of an artificial neural network example, specifically a Deep Feedforward Network, characterized by the presence of a hidden layer. Adapted from [24] To unravel the intricate operation of an ANN, is important to explore the fundamental concept of the Perceptron. This singular computational model represents the most elementary form of a FNN, composed of a single layer. As depicted in Figure 6, the perceptron will receive minputs, symbolized by a vector x∈Rn. Subsequently, it weights each input individually, using a vector of weights w0, w1, w2, . . . , wn, adding them together and submitting the sum to a non-linear function known as the activation function σ. The result of this process is the generation of the output y∈R. If this sum exceeds a defined limit, the neuron is activated; otherwise, it remains inactive. Furthermore, an additional element, known as bias θ, can be incorporated as a constant added to the weighted sum of the inputs, providing an affine transformation property to the model [25, 14]. In general, the model is expressed by y=σ(n ∑ i=1 wixi+θ) 15 Figure 6: Representation of basic components of a perceptron: input nodes, weights, summation, and an activation function. Adapted from [26]. Backpropagation Algorithm Deep FNN uses the backpropagation algorithm, which is intimately related to a loss function and optimization method. They do this by computing the gradients necessary to adjust network weights through a direct tie-in between the actual loss function and take care of the occurrence of how error propagates from the output layer to hidden layers. The loss function measures the difference, between the model predictions and the real labels to help adjust the weights. At the time the optimization technique determines how these gradients are used to update the network parameters during training. This calculation of gradients happens locally to make sure each node only considers its connections[15]. Activation Function Activation functions, σ, introduce nonlinearities in the outputs of neurons by applying them to the sum of inputs and their respective weights within each neuron’s product terms. It allows networks to be flexible and understand patterns efficiently by using well-known activation functions such, as the sigmoid function (2.1), Tangent Hyperbolic (TanH) (2.2)) and Rectified Linear Unit (ReLU) (2.3)). σ(x) = 1 1 + e−x,(2.1) σ(x) = ex−e−x ex+e−x,(2.2) σ(x) = max(0, x),(2.3) In Figure 7 it is possible to observe a comparison between the different activation functions discussed. ReLU, efficient and simple, returns zero for negative values and the respective input for positive values. 16 Sigmoid produces outputs between 0 and 1, useful in binary classification, and TanH generates outputs between -1 and 1, being useful when the average of the inputs is relevant, although the latter two face gradient fading challenges [27, 14]. Figure 7: Comparative analysis of three activation functions, namely Sigmoid (2.1), TanH (2.2) and ReLU (2.3). Adapted from [28]. 2.2.2.2 Convolutional Neural Networks CNN in the constantly changing world of DL is fairly new and has been implemented as a concept to understand visual data. The successful first appearance of ANN in demonstrating their learning capabilities drove further exploration in the analysis of complex visual data which finally gave rise to CNN to tackle these tasks. CNN are characterized as being a specific kind of feedforward network, incorporating zero or more convolutional layers and succeeding pooling layers. These novel constructional modules enable CNN models to have local insight into the data and structures of the actual input. This property makes them suitable for such applications films or images. Usually, as illustrated in Figure 8 the structure of CNN can be built step by step. The initial stage focuses on feature extraction, accomplished through convolutional and pooling layers. Subsequently, the second stage, corresponding to the concluding layers of the CNN, is constituted of fully connected layers, also known as dense layers. 17 Figure 8: Illustration of a convolutional neural network featuring two convolutional layers, each succeeded by pooling, and two fully connected layers. Typically, each convolutional layer is paired with batch normalization and an activation function for enhanced performance Convolution Layers Convolutional layers move filters, also known as kernels, across the image data piece by piece, extracting features into another matrix at each position of the input matrix (Figure 9). The input image can be grayscale with black and white pixels, or it may have multiple channels for colored images, with each grid element representing a feature vector. A kernel impacts only 1 channel or feature map in output and has bias associated with it. At each point, the feature map is generated by computing the dot product between the filter and the corresponding image patch, based on their dimension This build process continues until a filter spans over an image so that multiple feature maps can be built at once. The initial input could be the image itself, for the first layer, and it could be feature maps of previous convolution layers for subsequent deeper layers [25, 14]. Applying linear transformations like ReLU, Sigmoid, and TanH function is essential in making the network more complex after each convolution step in order for it to learn effectively from the input data and capture intricate patterns autonomously for improved visual representation, within the network. Figure 9: Convolving a 3 × 3 kernel over a single channel input. Adapted from [29]. 18 An indispensable characteristic in the implementation of any CNN is its capacity to implicitly zero-pad the input to expand its width. This feature becomes crucial as, without it, the width of the representation would decrease by one pixel less than the kernel width at each layer. Zero-padding the input provides control over the kernel width and the output size independently. In the absence of zero-padding, the choices are constrained to either rapidly shrinking the spatial extent of the network or resorting to small kernels—both scenarios severely restricting the expressive power of the network [14]. Three common padding options are valid, same, and full, as can be observed in Figure 10. ”Valid” convolution, computations occur only where the input fully contains the kernel, resulting in a shrinking output at each layer. If the input image has a width of mand the kernel width is k, the output width becomes m−k+ 1. Each output pixel is affected by the same number of input pixels, resulting in a more uniform behavior. The same convolution type applies zero padding uniformly on every side so that the output convolution feature map size will be the same as the input feature map dimensions. This does not restrict the number of convolutional layers but adds some sort of artificial information around borders. Further, input pixels close to the border have less effect on the output pixel compared to those that are near the center, and hence these may not be represented adequately in the case of border pixels. On the other hand, a fully convolutional layer includes enough padding to allow each pixel to be visited ktimes in each direction, so the resulting width of the output is m+k−1. Pixels near the border receive input from fewer pixels compared with those near the center, making it difficult to train a kernel that works well for everyone. The best amount of zero-padding, as measured by improvements in test set classification accuracy, typically lies somewhere between valid and same [14]. Polling Layers The pooling layers shared in CNN models right after the convolution layers help to adjust the features obtained. These layers form a type of spatial aggregation, which replaces each part of the feature map with one statistic calculated in the pooling region. In Figure 11 it can be noticed that methods like max pooling or average pooling are used to decrease the size of the data dimensions by summarizing and downsampling the information effectively through spatial aggregation techniques such, as selecting the maximum or average value from a set of adjacent pixels. Doing so makes the network’s workload lighter and enhances its capacity to adapt more broadly to various situations. In the first layers of convolutional processing lies a skill in identifying edges and color-related characteristics while when moving into the network’s layers, there is a tendency to combine these initial traits to form more detailed qualities, like designs and intricate objects [25, 14]. 19 Figure 10: Comparing padding techniques in convolutional neural networks: visualizing ”Valid,” ”Same,” and ”Full” padding. Adapted from [30]. Figure 11: Comparing pooling operations in convolutional neural networks: Max Pooling (top) and average pooling (bottom). Adapted from [31]. Regularization Of Neural Networks Efforts to improve efficiency and generalization in neural networks involve implementing fundamental optimization strategies, two notable ones being Batch normalization (BN) and Dropout. BN is located between the convolutional layers and the activation functions, and it normalizes the feature maps that are generated during training. This method standardizes the input distribution to have a mean of 0 and unit variance. This will speed up the learning process since the model easily reaches a local minimum. BN help to stabilize training, leading to improved performance on the task. Meanwhile, as an opposite strategy to avoid overfitting, when the model is too adjusted to the training data and 20 performs worse in new data, there is a dropout. Dropout randomly masks neurons during training. The particular form of randomness introduced reduces the dependence between neurons which acts as a form of regularization. Dropout assists the neural network to expand more by not allowing it to lean towards any specific input training set characteristics. This will also result in a stronger generalization providing better capability to the model when classifying unseen data [25, 14]. Fully-connected Layer The most important kind of layer in a CNN during the classification process is the dense layers also called fully connected layers. These layers emerge at the end of CNN architecture, after the feature extraction from convolution layers and pooling layers. At this point in the process, the output feature maps are flattened into a 1D array or vector of numbers and then combined with dense layers. Then this one-dimensional array is attached to one or more dense layers which apply a linear transformation. Every element in the vector corresponds to a neuron in the dense layer, and each connection from the vector to the neuron in the dense layer has a learnable weight during the training of the network. At this stage, the linear transformation is followed by a non-linear activation function [32, 14]. 2.2.2.3 Fully Convolutional Networks Used in ML, semantic segmentation is a computationally expensive task that works towards developing DL models for computer vision. CNN have been established as a very powerful tool to perform image classification due to their capability of learning hierarchical features from data, however, when pixel-level predictions and semantic segmentation are concerned, the inherent design limitations still lie there, for example, preservation of spatial information. The FCN in Figure 12 explicitly denotes a new architecture paradigm beyond the traditional confines of CNN and can offer to push semantic segmentation to new heights with incredibly simple builds. FCN differ from CNN by not containing any of the fully connected layers as their last layer. FCN take advantage of convolutional layers in the entire network for the smooth handling of spatial information and to generate pixel-level predictions. As a result, this new type of methodology which developed FCN is groundbreaking as it allows the network to take in inputs of different sizes which means that these networks can be flexible and adapted to many types of image size scales. The FCN architecture incorporates a downsampling path (encoder) for decoding rich context followed by an upsampling path (decoder) for the recovery of the original image resolution. An FCN is nothing more than a CNN with a very special structure. In particular, the network connects the encoder and decoder using skip connections, allowing information to be transferred from one path to another, thereby significantly improving the spatial localization of a certain 21 feature at the global map level. Since the outputs of these networks are pixel-level predictions, they are ideal for segmentation tasks [32]. Figure 12: Architecture of a fully convolutional network. Adapted from [32]. 2.2.2.4 U-Net Architecture The U-Net architecture was first proposed by Ronneberger et al. [33]. This former was customized for biomedical image segmentation. Here, the architecture consists of three principal parts: an encoder, a bottleneck module, and a decoder. The most obvious characteristic is its “U” shape architecture which consists of a set of skip connections between the encoder and decoder paths to ensure the preservation of spatial details [34]. A network structure is given in detail in Figure 13, which consists of a contracting path (left side) and an expansive path (right side). The contraction path follows the typical architecture of a convolutional network which consists of repetitions convolutions 3x3 (with padding) and followed by ReLU, ending in a 2x2 maxpooling operation that downsamples the feature maps to half its resolution. In each downsampling step, the number of feature channels grows twice. The expansive path is characterized by an upsampling of the feature map, followed by a 2x2 convolution (”up-convolution”) that reduces the number of feature channels by half. This is succeeded by a concatenation with the correspondingly cropped feature map from the contracting path and two 3x3 convolutions, each followed by a ReLU. Cropping is a technique to make up for the loss of border pixels during convolutions. This is fed into a sequential neural network, where the last layer convolves a 1x1 convolution with an output length equal to the number of classes [33]. 22 mensions of the projected queries, keys, and values for the kth head are all denoted by dk. Subsequently, the result of the horizontal stripes SA for the kth head is explained as: X= [X1, X2, . . . , XM], Yk i=Attention(XiWk Q, XiWk K, XiWk V), H-Attentionk(X) = [Yk 1, Y k 2, . . . , Y k M] Where Xi∈R(sw×W)×CeM=H sw, i = 1, . . . , M.WQ k∈RC×dk, WK k∈RC×dk, WV k∈ RC×dkrepresent the matrices that project the queries, keys, and values to the kth head, respectively, and dkis defined as C K. The SA mechanism with vertical stripes can also be derived in a similar manner. Its resulting value, for the kth head, is represented as V-Attentionk(X). When the natural images do not have any directional bias present, the k-heads are divided into two separate groups running parallel to each other (with each group having K/2 heads, most times K is an even number). The first set of heads focuses on horizontal stripes SA while the second set concentrates on vertical stripes SA. In the end, the results from these two groups are concatenated back together for a combined output. CSWin-Attention(X) = Concat(head1, . . . , headK)WO(2.6) headk=     H-Attentionk(X)for k= 1, . . . , K/2 V-Attentionk(X)for k=K/2 + 1, . . . , K (2.7) The matrix WO, with dimensions RC×C, is typically used to transform the SA outcomes into the desired output dimension (default set as C). The CSWin mechanism improves efficiency with parallel MSA grouping and dynamic stripe widths, balancing accuracy and computational cost. Methodologies in 3D Image Segmentation Two important articles are interlinked to lay the groundwork for the development of the technique known as 3D medical image segmentation by using the U- Shape Nested Transformer (UNesT) approach. This technique builds upon the approach detailed in a study written by Yu et al. [43] with an emphasis on improving the identification and separation of anatomical components in the brain, kidneys, and other organs from 3D medical scans, by integrating into the architecture the nested hierarchical transformer from Zhang et al. [44]. The main objective is to propose and validate an approach that can perform this segmentation accurately and reliably, adapting to different datasets, which include both adults and children and covering various imaging modalities such 29 as Magnetic Resonance Imaging (MRI) and Computed Tomography (CT). The UNesT model aims to create an architecture that efficiently captures information both locally and globally in volumetric medical images, facilitating the precise segmentation of multiple complex anatomical structures. This is made taking into account two main elements, which form a hybrid design model. The first, mentioned in the article authored by Zhang et. al. [44], consists in the nested hierarchical transformer construction which serves as an encoder, and the second element comprises a convolution-based decoder component. The most in-depth explanation of the neural network will be given in the methodology section since this architecture will be incorporated into the basis of the work. With that said, several anatomical structures were segmented, ranging from large organs such as the brain and liver, to small structures, such as glands or certain blood vessels, obtaining better results in certain segmentations comparatively to the state-of-the-art. As for the limitations, as expected, smaller structures are always more challenging to segment and there are also difficulties with irregular structures across different patients. Also, the Dice Similarity Coefficient (DSC) value might not adequately reflect segmentation accuracy due to the minimal contribution of the small segments to the final metric. 2.2.3 Learning Process 2.2.3.1 Initialization In DL setups there is an important step called initialization, where the initial parameters of a neural network are set up to make training processes smooth and effective. The primary objective is to break symmetry within the network components so that each part can perform its function effectively. To achieve this goal various initialization techniques can be used to assign weights values from distributions that cover a range of possibilities. One common technique is called random initialization, where weights receive values from distributions, with high entropy. Introducing randomness helps avoid repetition during the learning phase by making sure that each unit begins with settings [14]. Selecting the right weight initial scale is a very important step in the initialization process. In neural networks, usually initialize biases as zero alongside weight initialization. This is to provide a smooth flow of information across the network by trying to overcome some common issues such as vanishing or exploding gradients Glorot and Bengio’s Initialization Glorot and Bengio’s normalized initialization aims to strike a balance between the activation and gradient variances across layers. The underlying idea is to initialize weights in such a way that the signal neither diminishes too quickly nor grows too rapidly as it passes 30 through the network during forward and backward passes. Maintaining a balance is crucial, to ensuring efficient weight adjustments during the training phase. The process of normalization entails modifying the weight scale at the start according to the input and output units in the layer structure of the network to maintain variance in activations and gradients, and to avoid problems linked with vanishing or exploding gradients based on network architecture considerations [14]. 2.2.3.2 Regularization To enhance the usefulness and adjustability of networks comes the question of applying optimization techniques. One major aspect of this is called regulation, which tries to prevent overfitting. That is the situation in which a model has been particularly unconstrained to fit the training data, meaning that it can not do well with new data. Different regulation methods such, as L1 and L2 norms, Dropout, BN, and Data Augmentation play roles in attaining this objective. L1 and L2 Norms The L1 norm or Lasso norm adds up the values of weights, to the model’s loss function to penalize individual weights and promote some to reach zero precisely. This sparsity-inducing feature makes L1 regularization particularly useful when feature selection is desired, effectively leading to a simpler model. On the side of things, ridge regularization also known as the L2 norm, includes the total of squared weights, in the loss function. This method punishes weights without reducing them to zero. It rather encourages weights to be smaller and more evenly distributed across the model features by utilizing L2 regularization to prevent any feature, from overpowering the model. The main intuition behind both L1 and L2 regularization is to minimize the norms. When either the L1 or L2 norm is added to the loss function in the training phase, we inform the optimization process not just to fit data but also to keep model parameters within a specific range. This regularization effect means that the model will generalize well to unseen data and helps prevent overfitting from happening [45]. Dropout Dropout shown in Figure 18 is a regularization technique introduced by Hinton et al [46] and is widely used to tackle overfitting in Neural Network Models. In practice, it is done to prevent the model from getting too well adapted on the training dataset preventing fails to generalize well on new, unseen samples. Dropout layers inject randomness by stochastically deactivating neurons in a layer for the training of any given instance. This method disturbs the coordination of feature detectors since the units that are dropped out do not have an impact, on the units that are retained. Essentially, dropout acts as a form of regularization by reducing dependence between neurons. Another way of looking at dropout is as an 31 efficient implementation of model averaging, where the trained models share all layers except the units being dropped out. Enforcing this leads to the model not being too greedy of certain features out of the training set, resulting in a more reliable generalization, which improve the classifying for unseen data [25, 14, 46]. Figure 18: Dropout visualization: On the left, a regular neural network without dropout. On the right, dropout is in action. Adapted from [47]. Drop path Drop path is a technique for deep neural networks, especially Residual Network (ResNet), that introduces randomness into the network’s depth during training. Instead of using the full depth of the network in every training iteration, drop path randomly activates only a subset of layers, resulting in a shallower network for each iteration. At each layer is calculated a probability determined by Bernoulli random variables with a survival probability pl that represents that layer. Thus, in each iteration, a randomly selected subset of layers is activated, reducing the depth of the network for that specific iteration. This approach means the network is trained with a randomly reduced version of itself, which lowers computational costs since only the active layers are used for forward propagation and gradient computation. During inference, however, the network operates at its full depth, utilizing the complete model’s capacity. In drop path, training time is decreased since there are fewer computations caused by the fraction of inactive layers during training. In doing so, this regularization will also make the learning better by improving its generalization, thereby boosting the performance of this model. It also overcomes problems such as vanishing gradient and information loss, making training more stable [48, 49]. The probabilities of layer activation can be adjusted uniformly across all layers or in a decreasing manner along the network’s depth. In the linear decay mode, these probabilities start high for the initial layers and decrease for deeper layers. During training, the network is sampled based on these survival probabilities. During testing, all layers are utilized, and the outputs of the layers are calibrated according to the survival probabilities used during training [48]. 32 Batch Normalization Between layers and activation functions, sit BN, which is designed to standardize the produced feature maps while training is ongoing with the main goal of speeding up and steadying neural networks through standardizing inputs, within each mini-batch to tackle problems linked to internal covariate shift [50]. During the training of a network in a usual setting data is adjusted to achieve consistent scales, for better adaptability. BN takes it a step further by working on batches as a whole of individual data points. This method follows a two-part strategy; initially standardizing input features to have an average of zero and a deviation of one and then adjusting the scaled and offset normalized result using learned values known as gamma (γ) and beta (β). When normalizing networks it is important to calculate the average and variation for each feature in a batch to ensure that the hidden activations are consistent and uniform throughout the network layers. Rescaling and adjusting steps are included to give the network the ability to handle patterns while still benefiting from the stabilizing impact of normalization techniques. By enhancing convergence rates and reducing reliance, on weight initializations through BN techniques deep neural networks can achieve greater training stability and improved overall performance [51, 50]. BN has also been discovered to decrease the necessity for dropout. Can serve as a type of regularization making it an essential element, in contemporary neural network designs [52]. Layer norm Layer normalization is a method employed to stabilize and speed up training in networks such as transformers. In contrast to BN that normalizes across the batch dimension, layer norm normalizes each data point individually by adjusting its features. It ensures that the features have an average of zero and a uniform variance across the feature dimension, for every data point. This approach works well for models that have batch sizes or sequence lengths. Layer normalization helps by normalizing features within each data point and hence increases an exploratory factor. This will help in making the learning procedure more consistent as well and also makes performance of same model constant across different sizes. This method is especially useful, in transformer models to handle input scaling and improve training stability and convergence [53]. Data Augmentation Data augmentation is about expanding datasets artificially by making more data points based on the ones we already have in hand either by tweaking the existing data a bit or using advanced tools, like Generative Adversarial Networks (GANs) and autoencoders, to produce fresh data points [54]. Many techniques fall into the category of data augmentation. These methods include changing the shape and the size of objects or images, altering color tones and using kernel filters. More common 33 practices such as rotations or flipping, cropping along with noise introduction also can also be used. The use of data augmentation in methods that integrate generative models is crucial in datasets such as medical images, where obtaining large and varied datasets can be challenging. Data augmentation not only helps to enlarge the datasets during training but they are also considered powerful methods against overfitting, which improve ML models in general. It can also apply data augmentation techniques during training, utilizing tools like PyTorch, which enables easy modifications without the need to physically expand the dataset [55]. To refine datasets, techniques such as GANs and autoencoders, which are primarily used in medical imaging, create data points by synthesizing images that closely resemble the actual dataset. However, GANs encounter challenges such as training difficulties and mode collapse, which can restrict the variety of generated samples. On the other hand, Variational Autoencoders (VAEs) produce a wider array of outcomes, although this can occasionally lead to a decrease in image quality [56, 55]. Optimization In essence, optimization is the process of slowly adjusting neural network parameters (weights and biases) to minimize our loss function as much as possible. We need to try to find which weights cause the various neurons within our neural network cell (layers) to perform optimally concerning some task we care about, such as classification or regression. For this problem, optimization algorithms are responsible for deciding how these parameters should be updated during the training phase [57]. To make the neural network training most effective, we should be meticulous and specific about what requirements are depending on which optimizers. Therefore, many optimizers try to update the model parameters in different ways when it trains such as stochastic gradient (Adam) and stochastic Gradient Descent (GD) with momentum. The efficacy of some particular method can vary with the data, size of training set and constructed network architecture. Adam The Adam optimizer algorithm is a well-known method of training ML models. By adjusting learning rates, it makes training more efficient and smoother than it has ever been before. It is superior to standard Stochastic Gradient Descent (SGD) in several aspects. One key improvement that I would like to mention is this. It uses different learning rates for individual parameters rather than one single rate across the entire network, which leads to some great dividends. It combines ideas from AdaGrad and RMSProp [58] where AdaGrad adjusts rates based on parameter gradients, for sparse data handling while RMSProp adjusts rates by averaging gradients to adapt to changing conditions. Adams’s effectiveness comes from using both subsequent moment calculations, the former to track trends over time and the latter to adjust the learning rate itself, improving computational speed and reducing memory usage in 34 real-world scenarios. Adam sets parameters and moment estimations at the start of training and then updates these estimations based on gradients as training progresses to correct any biases [59]. Although Adam adjusts the learning rate for each parameter based on gradients, its performance can be influenced by the initial learning rate. In this case, a warm-up strategy can be used, where a lower learning rate is defined at the start and it will be increased linearly to a higher value, after reaching this peak, is applied a decay strategy. This strategy mitigates the problem of finding a good minimum and the concern of starting with a low or high learning rate [60]. AdamW The AdamWeightDecay (AdamW) is a version of the Adam optimizer that incorporates separated weight decay. This method separates L2 regularization from the optimization process in relation to the loss function, so that weight decay is uniformly applied regardless of the loss function or optimization step taken. In contrast to Adam in which L2 regularization directly affects gradient updates, AdamW applies weight decay to the network weights regardless of whether a gradient update was performed or not. This adjustment permits Adam to retain its properties and adds the ability to regularize. The efficiency of the optimizer depends on how it focuses on reaching a balance between convergence and generalization by regulating the minimization of loss rather than directly incorporating regularization into parameter updates, as Adam does [61]. Stochastic Gradient Descent with Momentum GD is a very important part in the ML, but this method of calculating gradients over the whole dataset can get quite computationally heavy, so to rectify that problem, SGD was introduced. This innovative method redefines how we update the weights. Unlike the GD technique, SGD updates the weights every time a training example is used. With this method, not only can data be processed more quickly, but the gradient estimate will also have some random noise added to it. This noise may at times, turn the training into a chaotic experience, unhelpful for practical reasons, and unstable at emphatically other times. SGD with momentum improves the algorithms by adopting the physics momentum concept and comprises two important components: velocity and friction. Since velocity is a moving average of gradients over time, it can be conceptually thought of as an indicator pointing in the direction where the gradient should go. Friction, on the other hand, is a rate-limiting factor for how fast you can decay velocity. SGD with momentum has one main advantage, it works to eliminate the oscillations typically seen with pure SGD. This algorithm encourages model convergence by reducing rapid rate fluctuations and maintaining a consistent direction. The physical characteristics of momentum introduced here not only avoid undesirable oscillations but also result in faster and more stable convergence. [62]. 35 2.2.3.3 Learning Rate Schedulers Learning Rate Schedulers are elements in the training of ML models focusing primarily on optimization algorithms like GD. Their main purpose is to adapt the learning rate throughout training to improve model convergence and performance overall by regulating the size of parameter updates in algorithms such, as descent denoted by the symbol η. It can be quite challenging to choose the learning factor as setting it too high may cause overshooting and convergence problems while setting it too low can result in slow convergence or getting stuck in local minimum points on the learning curve. This Hyperparameter helps tackle these difficulties by incorporating adaptability and enabling training, throughout different phases. Different methods exist for adjusting this hyperparameter in ML models, one approach involves using Learning Rate Decay schedules such as time-based decay, step decay, and exponential decay to reduce the learning factor based upon a set schedule and the other method is adaptive learning rate methods like adam and RMSProp which adjust the hyperparameter based upon gradient information or optimization processes [63, 60, 64]. 36 Chapter 3 State of the Art 3.1 Segmentation for Medical Diagnostics MRI image segmentation, is a fundamental feature in evaluating a patient’s health status, not only because it recognizes structures like organs and tissues but also anomalies, because they are essential for healthcare professionals to track a patient’s situation accurately and plan treatments and diagnoses effectively. In the science world and medical practice, there are typically three types of segmentation methods known and used. Automatic, semi-automatic, and manual approaches. These methods are often employed in two or three dimensions to segment images. While 2D segmentation is widely favored and valuable, for pinpointing anatomical traits, 3D segmentation offers further depth particularly when it comes to analyzing volumes and grasping the spatial relationships among structures. The choice between 2D and 3D segmentation depends on several factors such as the intricacy of the anatomy involved in the analysis process and the specific needs for analysis along with the computational capabilities at hand. Both segmentation, in 2D and 3D space, can be performed either manually or, through computational methods based on the individual scenarios and preferences of medical professionals [65]. Professionals with appropriate training, like radiologists or specialized physicians, will manually perform this segmenting work. This carries a high operation cost [66]. This can be done either in 2D in the x–y plane, or slice by slice. Although manual segmentation is time-consuming and subject to observer variability, it does allow expert information to be incorporated. While manual segmentation is considered the method used in this field of study, it can cause inconsistencies between different observers often resulting in significant discrepancies, in the data obtained. Automated segmentation involves using algorithms to divide MRI images into segments consistently, however, it may lack the nuanced understanding that human specialists offer in this process of creating and adapting algorithms across different imaging 37 modalities which poses a challenge, in automated segmentation [67]. The semi-automatic segmentation system is the last segmentation method that combines the input of humans collectively with automated processes to improve speed and repeatability compared to manual methods. It often requires human assistance for setting segmentation parameters or evaluation, promoting accuracy and efficiency, which is crucial in healthcare settings [68]. 3.2 Segmentation in Cardiac Magnetic Resonance Images Cardiac segmentation is critical in recognizing necrotic areas of the heart, such as pre-ablation fibrosis in the LA, post-ablation scarring, and LV infarction. Depending on their location and size, these regions might substantially impact the patient’s cardiovascular health. For instance, ventricular scars indicate previous MI. Fibrosis and scar localization and quantification can assist with therapy stratification in conditions such as atrial fibrillation or ventricular tachycardia, help direct surgery or ablation procedures, and assess treatment response. A large number of algorithms have been proposed for cardiac scarring segmentation, some of which reached considerable performance levels in challenges. Of methods used for scar segmentation, the 2-SD [69] and Full Width at Half Maximum (FWHM) [70] techniques are recommended because of their accuracy and reproducibility. There is an increased interest in automating the segmentation of LA and LV anatomy from LGE CMR images. The development of artificial intelligence, in particular DL algorithms such as Fully Connected Neural Networks (FCNN) and functional models like U-Net has brought a lot of hope for the segmentation of cardiac substructure. This makes it perfectly suited to scar segmentation on LGE CMR images, making it possible to create fully automated solutions. Integration of LGE CMR into co-registered images from other imaging modalities may also improve segmentation [71]. 3.2.1 Automatic Algorithm Automated techniques, particularly those based on DL, have emerged as the gold standard for automating cardiac area segmentation, outperforming earlier methods and demonstrating the ability to duplicate expert analyses. While these computational methods, particularly those based on DL, continue to show promise for segmentation, offering a potentially accurate and efficient alternative to manual processes, fully automated methods for cardiac segmentation have yet to achieve the required level of accuracy to compete with expert segmentation. In a study done by Radau et al.[72], they examined the Sunnybrook Cardiac Data [73] to analyze a 38 4.2.3 Neural Network As we can see in Figure 19, the neural network model selected to segment the three anatomical components (LV,RV,LV myocardium) was a U-net 2D. For input, as described earlier, patches 2D with co-registered MRI image sequences (bSSFP,LGE and T2) were given, and in the end, a segmentation mask was obtained, accurately delineating the regions of interest for each anatomical component. Figure 19: U-Net 2D architecture used for segmentation task Following this, a post-processing step was applied to retain only the largest connected component for each of the three segmented classes, effectively removing small isolated markings and minor connected components. That said, the number of output channels (Cout) was 3, corresponding to the LV,RV, and LV myocardium. 4.3 Second Stage: Segmentation of Anatomical Structures In the second stage, the input is more complex. We use the MRI image sequences (bSSFP,LGE e T2), the LV myocardium mask obtained from the first stage, and two new images, the LGE-myo and T2-myo, all concatenated in one to form the final input. The mask from stage one helps direct the model’s attention to specific regions by limiting the search field for scars and edema, ensuring that the segmentation of this 45 pathology is more precise by minimizing these possible locations. Additionally, new images were created by multiplying the probability of the LV in the myocardium and the respective sequences, forming the LGE-myo and T2-myo, introducing crucial details since these sequences provide important information on myocardial, scar and edema respectively. 4.3.1 Pre-Processing Entering the second stage, similar to the approach taken in the first phase to improve the training model, we start with cropping, this time taking into care the segmentation results from the first phase and focusing on reducing false positives. The model input beyond the three MRI image sequences (bSSFP,LGE, T2), now also includes the segmentation probability mask of the LV (Prob_1) in the myocardium and two new images, LGE-myo and T2-myo, forming a 6-channel input. Since the model requires a fixed input size that is divisible by 16, so the images are zero-padded to a size of 6×256×256×N, where N represents the number of slices, which varies depending on the subject. Considering that there are still variations, among subjects, normalization will be introduced at each channel, resulting in a zero average and a standard deviation of one, which improves the model as described early in phase one. Another method used to improve the images was augmentation. This technique facilitates the expansion of the dataset and introduces variability by incorporating flips and rotations. The rotations were performed in two ways: first, by setting the angle to 90°, 180°, or 270°, and second, by using angles ranging from -30° to 30°. To conclude, during the training phase of this process we extract 2D slices, from the 3D images to use as input and when it comes to testing the network, it receives all N slices from each image after reversing the resizing operation. 4.3.2 Neural Network The network architecture used in this work is based on the hybrid UNesT model, which combines two types of structures: the Hierarchical Transformer as an encoder and a convolutional network as a decoder. In the encoder structure, there are three stages, with each level containing two blocks and two processes. The blockify process demonstrated in Figure 21b comes first, then is followed by the transformer encoder, then the deblockify process, and finally the pooling block. In the last phase of the hierarchy, the pooling block is not present anymore. Instead, the output of the deblockify undergoes normalization, followed by a convolution, resulting in the bottleneck output. From the bottleneck, the decoder, based on the U-Net structure, processes the features through convolutional layers, progressively restoring the spatial resolution 46 and combining multi-scale information to generate the final output with 3 channels (Cout), corresponding to the edema, myocardium scar, and background. Figure 20: Reviewing the outline of the suggested UNesT, with the hierarchical transformer encoder and a convolution-based decoder. 4.3.2.1 UnesT Encoder As for the encoder in the neural network in Figure 21a, the input to our network will consist of images of size H×W×C(height H, width W, and channels C) that will be transformed into 2D patches of size S×S. After this transformation, each one of the patches will be reshaped and then projected into embeddings in RC0using a patch projection layer. The following stage, known as blockify, organizes the embeddings into non-overlapping blocks (each block represents a subset of the 2D patches), which are then flattened, resulting in a tensor X∈RB×Tn×n×C0, where Bis the batch size, Tnis the total number of blocks in the current hierarchy, nis the sequence length (number of embeddings) in each block, and C0is the embedding dimension. Notably, Tn×n=H×W S2. The model employs three hierarchical levels, at each hierarchical level, 2D blocks are processed separately through transformer layers, allowing for multi-scale processing, where each level of the hierarchy handles blocks of different resolutions. The transformer layer comprises a normalization block with connections, a CSWin SA mechanism, and an MLP. The next step, called Deblockify, uses an aggregation function responsible for concatenating the out- 47 comes from the non-overlapping 2D blocks, to create the output of the transformer (referred to as Hierarchy Output), resulting in a seamless volumetric feature map. After this, the output goes through a pooling block which involves a max pooling, a 3x3 convolution layer with a stride of 1, and a normalization layer. The max pooling layer with a kernel size of 3×3 downsamples across the dimensions by a factor of 2×2 (stride of 2). The feature map that is produced is then transferred to the succeeding hierarchical level, for additional processing, which enables the model to effectively gather and combine information from various scales and depths, allowing it to manage intricate relationships, in the data effectively. More in detail, the features maps start at dimensions H S×W S×C0and are reduced by half in size at the start of each new hierarchy level. The feature map undergoes pooling by a 2 factor in both directions (2×2) without altering the sequence length of the embeddings (n) resulting in a decrease in the number of blocks (Tn) at every hierarchy level by 4. The structure consists of three hierarchical levels in total, with 16 blocks in the first, 4 blocks in the second level, and a single block in the third level. The number of transformer layers (depth) are defined as 2,2,8respectively from the largest to smallest resolutions, and the dimensions of respective embeddings (width) are set up by 64,128,256 with sizes generated at every stage from W 2×2i×W 2×2i×Cwhere i= 0,1,2and C= 64,128,256. At the encoder of our model, we utilized a patch size of 2×2and for the embedding dimension was defined a value of 64, leading to feature maps size of H 2×W 2×64 after patch projection. 48 Figure 21: Visualization of the UNesT architecture with the hierarchical transformer encoder (a) and the architecture of the Nested Transformer (b). 4.3.2.2 UNesT Decoder Upon reaching the final output stage, the Decoder steps in to carry out its tasks within a U-shaped architecture. The feature map from the last hierarchical level undergoes a normalization and passes through a 3×3 convolutional layer to create an enhanced transformer encoder output. Subsequently, this output is utilized to generate a bottleneck feature map that is upsampled through the utilization of a transpose convolutional layer. In the U-shaped design layout, the upsampled bottleneck feature map is concatenated with feature maps from the respective levels of the encoder using skip connections. These connections help incorporate information from different scales, facilitating the reconstruction and obtaining a segmented and detailed result. In the first applied skip connection, there is an exception, given that our architecture bottleneck concerns the transformation of the layer’s output through a normalization layer and a convolutional layer. It is anticipated that the semantic significance will be similar to the last hierarchy output. That said, the residual block will not be incorporated in the skip connection of the last hierarchy. Following the concatenation, the combined feature maps go through a block denominated ResBlocks, which includes a 3×3 convolutional layer and a normalization applied thereafter. This block improves the combined features by addressing the differences between the encoder and decoder representations. Once the ResBlocks are 49 traversed through, the cycle continues and the combined feature map undergoes upsampling for the next level, through the transpose convolution layer. Before proceeding to the next stage, from now on, the output from the corresponding encoder hierarchy passes through a skip connection that incorporates a ResBlock, just after that, the feature map from the encoder is concatenated with the features from the decoder. After the fusion, undergoes further refinement with ResBlocks and the feature map is upsampled again. This happens at various levels inside the Decoder. At least, the refined and processed feature map, from the last ResBlock, now enriched with diverse multi-scale and multi-depth details is employed to produce the final segmentation mask. To complete this task successfully, a convolutional layer with a size of 1x1 and a softmax activation function is used on the feature map to produce the final segmentation outcome. This output allows us to obtain the data outlined with the different structures and tissues relevant to the image. 4.3.3 New Approach in the Transformer Encoder ViT, like ViT and DeiT use global attention but it can be computationally intensive because it scales quadratically with the number of patches. Recent models, like the Swin-T have implemented local attention mechanisms based on windows to improve efficiency. The downside involves the lack of connections, between distant patches in the image. Similarly, the CSWin Transformer, which employs CSWin, computes local SA in horizontal and vertical stripes simultaneously, lacking attention to feature-space locality. To overcome this limitation, a new approach was introduced by Yu et al. [86], the Bilateral Local Attention (BLA) block attention, which combines local attention in the image space with local attention in the feature space. Taking this into account, to improve our model performance, the transformer encoder will be adjusted to utilize the BLA block. This block combines two modules, the Image-Space Attention (ISLA) adapted with the CSWin SA and a developed Feature-Space Local Attention (FSLA) module. In addition, it also includes an MLP module and several layer normalization (LN) modules within the block. In this mechanism, the input set of tokens will be denoted as Tin ={ti}N i=1, where ti∈RC,Cis the number of channels, and Nis the number of tokens. At first, the input tokens are processed through a normalization layer and next by an ISLA,), a shortcut connection is applied as follows: TISLA =Tin +ISLA(Layer Normalization(Tin)) Local attention in image space only calculates SA between tokens within the same patch. The result from the ISLA component, TISLA, is inputted into a normalization layer before entering a feature space local 50 attention module known as FSLA. This module includes a connection where: TFSLA =TISLA +FSLA(LN(TISLA)). The FSLA module calculates SA between tokens that are proximate in the feature space and works alongside the ISLA module. For last, the output of the FSLA module, TFSLA, is processed through another normalization layer and an MLP module to produce the final result of the BLA Block: Tout =TFSLA +MLP(LN(TFSLA)). The MLP component includes two fully connected layers. The first layer increases the feature dimension from Cto r×C, while the second layer reduces it back to C. By default, ris set to 4. Now delving deeper into the explanation of how attention works, beginning with the feature-space local attention. FSLA involves two key elements. One is the balanced hierarchical clustering algorithm (Figure 22), an approach that overcomes the imbalance problem of K-means clustering. This method performs Klevels of clustering on the input tokens set T={ti}N i=1. In the first stage of clustering the Ntokens, the set Tis divided into two subsets containing N/2 tokens each. At the k-th stage of clustering, the N/2k−1tokens that have been allocated to the subset in the preceding level are split into two subsets with a size of N/2keach. In the end, the result is 2Kevenly sized subsets, {Ti}2K i=1, and each subset size |Ti|is equal to N/2K. Figure 22: Hierarchical clustering scenario where there are a total of 3 hierarchical levels with 23= 8 clusters, at the lowest level. Adapted from [86]. The other key element, executed at each level of clustering, is balanced binary clustering. The ISLA divides a set of 2mtokens, {ti}2m i=1, into two clusters, each of size m. It requires both groups of tokens to have the same size. The centroids of each one are labeled as c1and c2. Each token tiis evaluated using 51 a distance ratio, ri, to determine its cluster membership: ri=s(ti, c1) s(ti, c2),∀i∈[1,2m]. The formula s(x, y)is used by the algorithm to determine the cosine similarity, between tokens xand y. After sorting the 2mtokens in decreasing order based on their distance ratios {ri}2m i=1, cluster C1is comprised of the first half of the list, and cluster C2consists of the second half, where the size of each cluster is represented as m. The average of tokens in each cluster is utilized to update their centroids and cluster membership of every sample resulting in updates towards optimized clustering similar, to K means. In traditional balanced binary clustering, the resulting clusters, C1and C2, do not share any tokens, indicated by C1∩C2=∅. The lack of overlap in this structure could cause issues for tokens positioned in the middle of the organized list. For example, a token within this section might have feature-space neighbors, in one group cluster being placed in another cluster itself making attention calculations less efficient. To address this problem effectively, the researchers have introduced a method called overlapping binary clustering. This approach involves assigning the first m+ntokens from the sorted list to one cluster, ˆ C1={tji}m+n i=1 , and the last m+ntokens to the second cluster, ˆ C2={tji}2m i=m−n+1. This creates an overlap of 2ntokens, represented as ˆ C1∩ˆ C2={tji}m+n i=m−n+1. The overlap enables central tokens to stay connected with some of their feature-space neighbors, which improves communication when computing attention scores. The suggested hierarchical clustering approach adopts overlapping binary clustering at the last level of the proposed balanced hierarchical clustering and uses the non-overlapping version at the other levels. In the architecture outlined, nvalue is determined based on 40 percent of the patch size (block size) which enhances the data adaptability in overlapping binary clustering scenarios. With this balanced hierarchical clustering from above, the set of tokens Tis divided to be the ensemble of 2Ksubsets {Ti}2K i=1, where the size of each subset is denoted by |Ti|=N/2K. Within each subset, it is applied the standard SA: ˆ Tk=SA(Tk),∀k∈[1,2K]. The output, ˆ Tis defined as the union of all attended subsets: ˆ T=∪ k∈[1,K] ˆ Tk In this approach, the MSA configuration is adopted, which is a fundamental feature of transformer models, to implement FSLA. At this configuration, is performed standard SA but also applied balanced 52 hierarchical clustering independently in each attention head. This strategy allows different heads to focus on different tokens for a given input token. To introduce the BLA into the proposed algorithm, as we can see in Figure 23, the adapted Transformer Encoder of the UNesT architecture (23a) was changed to the BLA Transformer Encoder (23b). (a) (b) Figure 23: Transformer encoder used in UNesT adapted with CSWin block attention (a) and transformer encoder adapted with BLA block attention (b). 53 Chapter 5 Results and Discussion This chapter presents the results of the segmentation of anatomical structures obtained in the first phase and the segmentation of scars and edema in the second phase. The results were evaluated by the DSC and although the first stage did not undergo changes from the baseline work, this output may influence the performance of the model in the second stage. The results were compared with methodologies addressed in the state of the art, allowing to understand the position of the implemented model and verify whether it obtained competitive results in the context of the segmentation of cardiac lesions. 5.1 Model performance To assess the precision of the segmentation results, for scars and edema separately, the DSC was computed as follows: Dice(Vreal, VGD) = 2|Vreal ∩VGD| |Vreal|+|VGD|(5.1) where VGD indicates the gold standard segmentation while Vreal represents the segmentation obtained using the algorithm. 5.2 Protocol adopted During the research conducted for this project, we used a 5 cross-validation approach and calculated the average DSC. Out of the 25 patients, in our training group, 20 cases were designated for training and 5 cases for validation, in each fold. After completing the training procedure for each fold, the criteria used to obtain the final network for each fold consisted of selecting the epoch whose performance metric for validation was the maximum. 54 mask obtained from the first stage, and two new images, the LGE-myo and T2-myo. These two channels allow the model to obtain more precise information about the edema, in the T1 sequence, and the fibrous tissue, in the LGE sequence. The architecture used in this phase was a UNesT variant which incorporates a nested hierarchical transformer as an encoder adapted with BLA and comprises a convolution-based decoder. Regarding the results obtained, the performance achieved did not fully meet initial expectations, although the model managed to position itself in third place, among the six presented methods that didn’t use an ensemble in the segmentation task. This suggests that the implemented attention mechanism, although promising, did not bring significant benefits in capturing detailed information from CMR images compared to the CSWin model, possibly due to limitations in adapting the model to the specific type of anatomical variability present in the analyzed images. 6.2 Prospect for Future Work To complete this work, various skills were required. However, given time constraints, it was not possible to cover all aspects needed to achieve optimal outcomes. As a result of this, there are still several strategies available to further improve the proposed approach. In future developments, an aspect that can be introduced consists of ensemble strategies implementation to combine predictions from the best models, thereby improving the accuracy of cardiac pathologies segmentation and creating a more reliable and efficient system. This combined prediction strategy enhances performance compared to using a single model. The introduction of the new attention mechanism did not steer the model toward more competitive results, in fact, it had the opposite effect. Therefore, it is necessary a deeper study of the architecture parameters of this mechanism to analyze all the details that can be modified for improvement. Moreover, considering alternative attention mechanisms might be another option if the adjustments made to the proposed mechanism are insufficient. Further improvements could be achieved by refining network parameters or, more importantly, by altering the base architecture. This includes trying out new loss functions, exploring new activation functions, and defining alternative data pre-processing methods. Lastly, the amount of data presented in the MyoPS dataset is limited, which influences the results obtained by the model. In an attempt to solve this problem, the provision of new data would be highly beneficial, as it could avoid possible overfitting issues, improve the distribution between the training, validation, 61 and test sets, and produce better segmentations. 62 Bibliography [1] Raheel Chaudhry, Julia H. Miao, and Afzal Rehman. Physiology, Cardiovascular (Oct. 2022). [2] Heart: Anatomy and Function . [3] Anthony Saxton, Muhammad Ali Tariq, and Bruno Bordoni. Anatomy, Thorax, Cardiac Muscle (Aug. 2023). [4] Ping Kong, Panagiota Christia, and Nikolaos G. Frangogiannis. The pathogenesis of cardiac fibrosis. 71.4 (May 2013), pp. 549–574. [5] Myocardial fibrosis. a Healthy myocardium consists of a compact... | Download Scientific Diagram . [6] Yiling Situ et al. Cardiovascular magnetic resonance imaging for structural heart disease. 10.2 (Apr. 2020), pp. 36175–36375. [7] Aurelio Matamoros and Kathleen M. Schmeler. Tumors of the Uterine Corpus Introduction. (June 2012), pp. 423–439. [8] R. J.M. Van Geuns et al. Basic principles of magnetic resonance imaging. 42.2 (Sept. 1999), pp. 149–156. [9] Yasuo Amano et al. Three-dimensional Cardiac MR Imaging: Related Techniques and Clinical Applications. 16.3 (2017), p. 183. [10] Daniel T. Ginat et al. Cardiac imaging: Part 1, MR pulse sequences, imaging planes, and basic anatomy. 197.4 (Oct. 2011), pp. 808–815. [11] Elizabeth R. Jenista et al. Revisiting how we perform late gadolinium enhancement CMR: insights gleaned over 25 years of clinical practice. 25.1 (Dec. 2023), pp. 1–16. [12] home | MS-CMR Segmentation . 63 [13] James A. Nichols, Hsien W. Herbert Chan, and Matthew A. B. Baker. Machine learning: applications of artificial intelligence to imaging and diagnosis. 11.1 (Feb. 2019), pp. 111–118. [14] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning . MIT Press, 2016. [15] Kevin P Murphy. Machine Learning A Probabilistic Perspective . MIT Press, 2012. [16] Farhad Maleki et al. Machine Learning Algorithm Validation. 30 (Nov. 2020), pp. 433–445. [17] Homero Schiabel Ana Maria Marques da Silva Ana Cláudia Patrocínio. Processamento e Análise de Imagens Médicas (2019). [18] Payam Refaeilzadeh, Lei Tang, and Huan Liu. Cross-Validation (2009), pp. 532–538. [19] Drew Wilimitis and Colin G Walsh. Practical Considerations and Applied Examples of Cross-Validation for Model Development and Evaluation in Health Care: Tutorial. 2 (Dec. 2023), e49023. [20] Rene Y. Choi et al. Introduction to Machine Learning, Neural Networks, and Deep Learning. 9.2 (2020). [21] Xuxin Chen et al. Recent advances and clinical applications of deep learning in medical image analysis. 79 (July 2022), p. 102444. [22] Dan Luo et al. Deep Learning for Automatic Image Segmentation in Stomatology and Its Clinical Application. 3 (Dec. 2021), p. 767836. [23] Zhongheng Zhang. A gentle introduction to artificial neural networks. 4.19 (Oct. 2016), pp. 370– 370. [24] Mohammad Faqe Hussein, Azad Saeed, and Soran Mohamad. Comparison Markov Chain and Neural Network Models for forecasting Population growth data in Iraq. 13 (Dec. 2023), pp. 1–14. [25] Maribel Torres-Velazquez et al. Application and Construction of Deep Learning Networks in Medical Imaging. 5.2 (Mar. 2021), p. 137. [26] Danial Karimi et al. Energy Management and Optimization of Large-Scale Electric Vehicle Charging on the Grid. 14.4 (Apr. 2023), p. 95. [27] Activation Functions in Neural Networks | by SAGAR SHARMA | Towards Data Science . [28] Hidden Layer Activation Functions | by Kinder Chen | Medium . [29] Anh H. Reynolds . [30] Classifying Images with Deep Convolutional . 64 [31] Pooling layer operation. Left a 4x4 matrix input. Right 2x2 pooling... | Download Scientific Diagram . [32] Rikiya Yamashita et al. Convolutional neural networks: an overview and application in radiology. 9.4 (Aug. 2018), pp. 611–629. [33] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. 9351 (2015), pp. 234–241. [34] Xiao Xia Yin et al. U-Net-Based Medical Image Segmentation. 2022 (2022). [35] Christopher D. Hollander, Sreerupa Das, and Suraiya Suliman. Automating visual inspection with convolutional neural networks. 11.1 (Sept. 2019). [36] Ashish Vaswani et al. Attention Is All You Need (Aug. 2023). [37] Fahad Shamshad et al. Transformers in medical imaging: A survey. 88 (Aug. 2023), p. 102802. [38] Xiangxiang Chu et al. CONDITIONAL POSITIONAL ENCODINGS FOR VISION TRANSFORMERS (Feb. 2021). [39] Li Yuan et al. Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet (Jan. 2021), pp. 538–547. [40] Wuyang Chen et al. A Simple Single-Scale Vision Transformer for Object Detection and Instance Segmentation (Oct. 2022). [41] Ze Liu et al. Swin Transformer: Hierarchical Vision Transformer using Shifted Windows (Aug. 2021). [42] Xiaoyi Dong et al. CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows . 2022. [43] Xin Yu et al. UNesT: Local Spatial Representation Learning with Hierarchical Transformer for Efficient Medical Segmentation . 2023. [44] Zizhao Zhang et al. Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding . 2021. [45] Visualizing regularization and the L1 and L2 norms | by Chiara Campagnola | Towards Data Science . [46] G E Hinton et al. Improving neural networks by preventing co-adaptation of feature detectors (July 2012). [47] Dropout in (Deep) Machine learning | by Amar Budhiraja | Medium . [48] Gao Huang et al. Deep Networks with Stochastic Depth . 2016. 65 [49] Soufiane Hayou and Fadhel Ayed. Regularization in ResNet with Stochastic Depth . 2021. [50] Introduction to Batch Normalization: Understanding the Basics . [51] Youngeun Kim and Priyadarshini Panda. Revisiting Batch Normalization for Training Low-Latency Deep Spiking Neural Networks From Scratch. 15 (Dec. 2021), p. 773954. [52] Batch Normalization and its Advantages | by Ramji Balasubramanian | Medium . [53] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer Normalization . 2016. [54] Jakub Nalepa, Michal Marcinkiewicz, and Michal Kawulok. Data Augmentation for Brain-Tumor Segmentation: A Review. 13 (Dec. 2019). [55] Cecilia Di Ruberto et al. Deep Learning Approaches for Data Augmentation in Medical Imaging: A Review. 9.4 (Apr. 2023), p. 81. [56] Connor Shorten and Taghi M. Khoshgoftaar. A survey on Image Data Augmentation for Deep Learning. 6.1 (Dec. 2019), pp. 1–48. [57] Umer Waqas et al. Optimization of neural-network model using a meta-heuristic algorithm for the estimation of dynamic Poisson’s ratio of selected rock types. 13.1 (Dec. 2023), p. 11089. [58] R. Elshamy et al. Improving the efficiency of RMSProp optimizer by utilizing Nesterov in deep learning. 13.1 (May 2023), p. 8814. [59] Miaomiao Liu et al. An Improved Adam Optimization Algorithm Combining Adaptive Coefficients and Composite Gradients Based on Randomized Block Coordinate Descent. 2023 (Jan. 2023), pp. 1–14. [60] Yichuan Shao et al. An Improvement of Adam Based on a Cyclic Exponential Decay Learning Rate and Gradient Norm Constraints. 13.9 (May 2024), p. 1778. [61] Towards Understanding Convergence and Generalization of AdamW (2024). [62] Esraa Hassan et al. The effect of choosing optimizer algorithms to improve computer vision tasks: a comparative study. 82.11 (May 2023), pp. 16591–16633. [63] Learning Rate Schedules and Adaptive Learning Rate Methods for Deep Learning | by Suki Lau | Towards Data Science . [64] Hideaki Iiduka. Appropriate Learning Rates of Adaptive Learning Rate Optimization Algorithms for Training Deep Neural Networks. 52.12 (Dec. 2022), pp. 13250–13261. [65] Ahmed Elnakib et al. Medical Image Segmentation: A Brief Survey (2011), pp. 1–39. 66 [66] Loïc Muhirwa. Image Segmentation in Medical Imaging . 2022. [67] Martijn P.A. Starmans et al. Radiomics (Jan. 2019), pp. 429–456. [68] Hari McGrath et al. Manual segmentation versus semi-automated segmentation forquantifying vestibular schwannoma volume on MRI. 15.9 (Sept. 2020), pp. 1445–1455. [69] Christopher M Kramer et al. Standardized cardiovascular magnetic resonance (CMR) protocols 2013 update. 15.1 (2013), p. 91. [70] Andrew S. Flett et al. Evaluation of Techniques for the Quantification of Myocardial Scar of Differing Etiology Using Cardiac Magnetic Resonance. 4.2 (2011), pp. 150–156. [71] Yinzhe Wu et al. Recent Advances in Fibrosis and Scar Segmentation From Cardiac MRI: A State- of-the-Art Review and Future Perspectives. 12 (Aug. 2021), p. 709230. [72] Anupama Bhan, Parthasarathi Mangipudi, and Ayush Goyal. Deep Learning Approach for Automatic Segmentation and Functional Assessment of LV in Cardiac MRI. 11.21 (Nov. 2022), p. 3594. [73] P. Radau et al. Evaluation Framework for Algorithms Segmenting Short Axis Cardiac MRI (2020). [74] Seyed Sadegh Mohseni Salehi, Deniz Erdogmus, and Ali Gholipour. Tversky loss function for image segmentation using 3D fully convolutional deep networks. abs/1706.05721 (2017). [75] Sara Moccia et al. Development and testing of a deep learning-based strategy for scar segmentation on CMR-LGE images. 32.2 (Apr. 2019), pp. 187–195. [76] Shangqi Gao et al. BayeSeg: Bayesian Modeling for Medical Image Segmentation with Interpretable Generalizability . 2023. [77] Xinzhe Luo and Xiahai Zhuang. X-Metric: An N-Dimensional Information-Theoretic Framework for Groupwise Registration and Deep Combined Computing . Nov. 2022. [78] Kai-Ni Wang et al. AWSnet: An Auto-weighted Supervision Attention Network for Myocardial Scar and Edema Segmentation in Multi-sequence Cardiac Magnetic Resonance Images . 2022. [79] Junyi Qiu et al. MyoPS-Net: Myocardial pathology segmentation with flexible combination of multisequence CMR images. 84 (2023), p. 102694. [80] Weisheng Li, Linhong Wang, and Sheng Qin. “CMS-UNet: Cardiac multi-task segmentation in MRI with a u-shaped network”. Myocardial Pathology Segmentation Combining Multi-Sequence Cardiac Magnetic Resonance Images: First Challenge, MyoPS 2020, Held in Conjunction with MICCAI 2020, Lima, Peru, October 4, 2020, Proceedings 1 . Springer. 2020, pp. 92–101. 67 [81] Weisheng Li, Linhong Wang, and Sheng Qin. “CMS-UNet: Cardiac Multi-task Segmentation in MRI with a U-Shaped Network”. Myocardial Pathology Segmentation Combining Multi-Sequence Cardiac Magnetic Resonance Images . Ed. by Xiahai Zhuang and Lei Li. Cham: Springer International Publishing, 2020, pp. 92–101. [82] Jianpeng Zhang et al. “EfficientSeg: A Simple But Efficient Solution to Myocardial Pathology Segmentation Challenge”. Myocardial Pathology Segmentation Combining Multi-Sequence Cardiac Magnetic Resonance Images . Ed. by Xiahai Zhuang and Lei Li. Cham: Springer International Publishing, 2020, pp. 17–25. [83] Feiyan Li and Weisheng Li. “Dual-path feature aggregation network combined multi-layer fusion for myocardial pathology segmentation with multi-sequence cardiac MR”. Myocardial Pathology Segmentation Combining Multi-Sequence Cardiac Magnetic Resonance Images: First Challenge, MyoPS 2020, Held in Conjunction with MICCAI 2020, Lima, Peru, October 4, 2020, Proceedings 1 . Springer. 2020, pp. 146–158. [84] Elsa Ferreira. “Segmentação de Fibrose em Imagens de Ressonância Cardíaca”. Mestrado Integrado em Engenharia Biomédica, Ramo de Eletrónica Médica. Trabalho orientado pelo Professor Doutor Carlos Alberto Silva e Doutor Adriano Pinto. Dissertação de Mestrado. Braga, Portugal: Universidade do Minho, Dec. 2023. [85] Richard Connor et al. Correlations of Cross-Entropy Loss in Machine Learning. 26.6 (2024). [86] Tan Yu et al. BOAT: Bilateral Local Attention Vision Transformer . 2022. 68