A lightweight mamba right atrium segmentation system based on atlas prior and boundary perception

By constructing a global right atrial probability map Atlas and a lightweight Mamba segmentation network, combined with an attention-guided boundary enhancement module, the problems of insufficient accuracy and real-time performance in right atrial segmentation in LGE-MRI are solved, achieving efficient and accurate right atrial segmentation suitable for clinical applications.

CN122367973APending Publication Date: 2026-07-10NORTHEAST FORESTRY UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHEAST FORESTRY UNIV
Filing Date
2026-04-14
Publication Date
2026-07-10

Smart Images

  • Figure CN122367973A_ABST
    Figure CN122367973A_ABST
Patent Text Reader

Abstract

A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness is presented, belonging to the field of medical image processing technology. This invention addresses the challenge of existing methods simultaneously achieving segmentation accuracy, lightweight models, and real-time performance. It utilizes a constructed right atrial probabilistic map (Atlas) to provide anatomical structure prior guidance for subsequent segmentation tasks, enhancing performance in LGE-MRI right atrial image segmentation. An attention-guided boundary enhancement module strengthens boundary feature representation at the feature level, while a dynamic weight scheduler optimizes boundary segmentation at the loss function level. This approach obtains complementary information from both region segmentation and boundary optimization, ensuring high image segmentation performance. Furthermore, the lightweight Mamba segmentation network significantly reduces the number of parameters and computational complexity while maintaining long-range dependency modeling capabilities, guaranteeing real-time segmentation. This method can be applied to right atrial image segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical image processing technology, specifically relating to a lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness. Background Technology

[0002] Medical image segmentation is one of the core technologies in the field of cardiovascular disease auxiliary diagnosis. Gadolinium delayed-enhanced magnetic resonance imaging (LGE-MRI), as a standard for assessing myocardial lesions, plays an irreplaceable role in the clinical diagnosis, quantification of disease severity, and treatment planning of diseases such as atrial fibrillation and heart failure through accurate segmentation of the right atrial structure. In recent years, deep learning technology has driven significant progress in medical image segmentation, but LGE-MRI right atrial segmentation still faces multiple technical challenges. The irregular anatomy of the right atrium, its blurred boundaries with surrounding tissues, and significant individual differences among patients, coupled with image noise, partial volume effects, and signal overlap in lesion areas, greatly increase the difficulty of segmentation. At the same time, medical image annotation relies on the experience of professional physicians, accurate annotation is time-consuming and labor-intensive, and high-quality datasets are scarce, making it difficult to support sufficient model training. Existing segmentation techniques have significant drawbacks: traditional thresholding and region growing methods are sensitive to image variations and lack accuracy; CNN-based U-Net and its variants have limited long-distance dependency modeling capabilities; while Transformer-based models improve feature capture, they suffer from parameter redundancy, high computational complexity, long inference time, and poor lightweight performance; some models do not incorporate prior medical knowledge, lack anatomical structure-specific guidance, and are prone to edge misalignment and structural loss; moreover, existing loss functions tend to focus on region matching, with insufficient optimization of boundary details, making it difficult to meet the quantitative needs of clinical fine structures.

[0003] In summary, existing methods are insufficient in terms of accuracy, lightweight design, and real-time performance, and cannot meet actual clinical needs. There is a need for an LGE-MRI right atrial segmentation technique that combines medical prior knowledge, optimized boundary segmentation, and balances efficiency and accuracy to address the aforementioned technical challenges. Summary of the Invention

[0004] The purpose of this invention is to address the problem that existing segmentation methods cannot simultaneously achieve segmentation accuracy, lightweight model, and real-time segmentation, and proposes a lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness.

[0005] The technical solution adopted by the present invention to solve the above-mentioned technical problems is: a lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness, the system including an LGE-MRI right atrial dataset acquisition module, an Atlas prior construction module, an LGE-MRI right atrial data preprocessing module, a global Atlas preprocessing module, a lightweight Mamba segmentation network, and an LGE-MRI right atrial image acquisition module to be segmented;

[0006] The LGE-MRI right atrial dataset acquisition module is used to acquire the right atrial LGE-MRI image dataset and the segmentation labels of each right atrial LGE-MRI image data in the dataset;

[0007] The Atlas prior construction module is used to generate a global right atrial probability map Atlas based on the right atrial LGE-MRI image dataset obtained by the LGE-MRI right atrial dataset acquisition module.

[0008] The LGE-MRI right atrial data preprocessing module is used to preprocess each LGE-MRI image in the acquired right atrial LGE-MRI image dataset.

[0009] The global Atlas preprocessing module is used to adjust the size of the global right atrial probability map Atlas to obtain a probability matrix composed of pixels in the adjusted global right atrial probability map Atlas.

[0010] The lightweight Mamba segmentation network includes an encoding unit and a decoding unit, and the lightweight Mamba segmentation network is trained using a probability matrix and a normalized voxel matrix corresponding to each right atrial LGE-MRI image.

[0011] The LGE-MRI right atrial image acquisition module acquires the LGE-MRI right atrial image to be segmented;

[0012] After preprocessing the LGE-MRI right atrial image to be segmented, the preprocessed LGE-MRI right atrial image to be segmented and the global right atrial probability map Atlas generated by the Atlas prior construction module are concatenated as the input to the trained lightweight Mamba segmentation network. The right atrial segmentation result is then inferred using the trained lightweight Mamba segmentation network.

[0013] Furthermore, the specific working process of the Atlas prior construction module is as follows:

[0014] Step A1: Calculate the right atrial volume in each LGE-MRI right atrial image in the acquired right atrial LGE-MRI image dataset. Then, determine the median right atrial volume based on the calculation results. Use the LGE-MRI right atrial image corresponding to the median as the LGE-MRI right atrial image of the reference case. Then, select the LGE-MRI right atrial images of 14 cases whose right atrial volume is closest to the median.

[0015] Step A2: Use the LGE-MRI right atrial image of the reference case as the fixed image, and use the LGE-MRI right atrial images of the remaining 14 selected cases as moving images. The registration optimization objective for moving and fixed images is to maximize the normalized cross-correlation coefficient.

[0016] Step A3: Select the registered moving images corresponding to the normalized cross-correlation coefficients greater than 0.45, and then calculate the weight of each selected moving image.

[0017] Step A4: According to the weight, the segmentation labels of each registered moving image are weighted and fused, and the fusion result is used as the global right atrial probability map Atlas.

[0018] Furthermore, the method for calculating the normalized cross-correlation coefficient is as follows:

[0019]

[0020] in, For the registered first Zhang moving image, Represents a fixed image. Indicates the first registration The first moving image The value of each pixel. Represents the first in a fixed image The value of each pixel. This represents the mean value of all pixels in a fixed image. Indicates the first registration The mean value of all pixels in a moving image. Represents the fixed image and the registered image. Normalized cross-correlation coefficients of moving images.

[0021] Furthermore, the weight of each selected moving image is calculated as follows:

[0022]

[0023] in, Indicates the selected first Weights of moving images, Indicates the selected first Weights of moving images, This indicates the total number of images selected. Indicates the selected first Weights of moving images.

[0024] Furthermore, the working process of the LGE-MRI right atrial data preprocessing module is as follows:

[0025] Step B1: Perform 3D-limited contrast adaptive histogram equalization on the LGE-MRI right atrial images;

[0026] Step B2: Perform Z-score normalization on the image after 3D-constrained contrast adaptive histogram equalization.

[0027] Step B3: Perform depth-direction symmetrical filling on the Z-score normalized image to make the depth of the filled image 96 layers.

[0028] The number of layers padded forward and backward in the image after Z-score normalization are as follows:

[0029]

[0030]

[0031] in, This indicates the original number of layers in the depth direction of the image after Z-score normalization. Indicates the number of layers to fill forward. Indicates the number of layers to fill backwards. Indicates rounding down;

[0032] Step B4: Crop the filled image to the center. The size of the cropped image is 320×320, and the center position of the cropped image is:

[0033]

[0034] in, This indicates the position of the center of the cropped image along the height direction of the filled image. This indicates the position of the center of the cropped image along the width of the filled image. This indicates the height of the cropped image. This indicates the width of the image to be cropped.

[0035] The cropped image is downsampled at the voxel level to obtain a standardized voxel matrix.

[0036] Furthermore, the internal workflow of the lightweight Mamba segmentation network is as follows:

[0037] Step C1: Concatenate the normalized voxel matrix corresponding to each right atrial LGE-MRI image with the probability matrix along the channel dimension to obtain each concatenation result. Use each concatenation result as a training sample of the lightweight Mamba segmentation network. The segmentation label of the training sample is the segmentation label of the image corresponding to the normalized voxel matrix in the training sample.

[0038] The first channel in the stitched result is the normalized voxel matrix corresponding to the right atrial LGE-MRI image, and the second channel in the stitched result is the probability matrix.

[0039] Step C2: Use each training sample as the input of the encoding unit. Within the encoding unit, use the training sample as the input of the first encoder, then use the output of the first encoder as the input of the second encoder, then use the output of the second encoder as the input of the third encoder, then use the output of the third encoder as the input of the fourth encoder, and use the outputs of the first encoder, the second encoder, the third encoder, and the fourth encoder as the output of the encoding unit.

[0040] Within the first encoder, the input part is sequentially passed through a downsampling module, a large kernel convolution module, and an attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the first encoder.

[0041] In the second encoder, the input part is sequentially passed through the downsampling module, the large kernel convolution module, and the attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the second encoder.

[0042] Within the third encoder, the input part is sequentially passed through the downsampling module, the TSMamba block, and the attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the third encoder.

[0043] Within the fourth encoder, the input part is sequentially passed through the downsampling module, the TSMamba block, and the attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the fourth encoder.

[0044] Step C3: Within the decoding unit, the output of the fourth encoder is passed through the first feature uncertainty enhancement module and the bottleneck layer respectively. The output of the first feature uncertainty enhancement module and the output of the bottleneck layer are used as the input of the first decoder. The output of the first decoder is then used as the input of the first attention-guided boundary enhancement module within the decoding unit. Finally, the output of the first decoder and the output of the first attention-guided boundary enhancement module within the decoding unit are joined by a residual connection to obtain the residual connection result a.

[0045] The output of the third encoder is passed through the second feature uncertainty enhancement module. The output of the second feature uncertainty enhancement module and the residual connection result a are used as the input of the second decoder. The output of the second decoder is passed through the second attention-guided boundary enhancement module in the decoding unit. The output of the third encoder and the output of the second attention-guided boundary enhancement module in the decoding unit are residually connected to obtain the residual connection result b.

[0046] The output of the second encoder is passed through the third feature uncertainty enhancement module. The output of the third feature uncertainty enhancement module and the residual connection result b are used as the input of the third decoder. The output of the third decoder is then passed through the third attention-guided boundary enhancement module in the decoding unit. The output of the third attention-guided boundary enhancement module in the decoding unit is residually connected with the output of the second encoder to obtain the residual connection result c.

[0047] The output of the first encoder is passed through the fourth feature uncertainty enhancement module. The output of the fourth feature uncertainty enhancement module and the residual connection result c are used as the input of the fourth decoder. The output of the fourth decoder is then passed through the fourth attention-guided boundary enhancement module in the decoding unit. The output of the fourth attention-guided boundary enhancement module in the decoding unit is residually connected with the output of the first encoder to obtain the residual connection result d.

[0048] The residual connection result d is then passed through a convolutional layer with a kernel size of 1×1×1. The output of the convolutional layer is then passed through UnetOutBlock, and the segmentation prediction result is output through UnetOutBlock.

[0049] Step C4: Calculate the loss function based on the output segmentation prediction results and the true segmentation labels of the samples, and then adjust the model parameters in reverse according to the loss function until a trained model is obtained.

[0050] Furthermore, the attention-guided boundary enhancement module includes a 3D Sobel boundary extraction submodule, an attention mechanism submodule, and a feature fusion submodule. The working process of the attention-guided boundary enhancement module is as follows:

[0051] Step D1, the 3D Sobel boundary extraction submodule includes three independent 3D convolutional layers, which are used to extract boundary features in the X, Y and Z directions of the input x, respectively;

[0052] The boundary features in the X, Y, and Z directions are concatenated along the channel dimension to obtain the concatenated boundary feature edge_feat;

[0053] Step D2: The concatenated boundary feature `edge_feat` is used as input to the attention mechanism submodule. Within the attention mechanism submodule, the concatenated boundary feature `edge_feat` is sequentially passed through a convolutional layer with a kernel size of 1×1×1, an instance normalization layer, and a Sigmoid activation function layer. The output of the Sigmoid activation function layer is used as the generated spatial attention map `att_map`. The concatenated boundary feature `edge_feat` is then multiplied element-wise with the spatial attention map `att_map` to obtain the weighted boundary feature. :

[0054] Step D3: The feature fusion submodule will combine the input x with the weighted boundary features. The fusion feature fusion_feat is obtained by concatenating the data along the channel dimension.

[0055] The fusion feature fusion_feat is then passed through a convolutional layer with a kernel size of 1×1×1. The output of the convolutional layer is then concatenated with the input x using residuals. The residual concatenation result is then passed through an instance normalization layer and a ReLU activation function layer to obtain the feature output by the attention-guided boundary enhancement module.

[0056] Furthermore, the weighted boundary features for:

[0057]

[0058] in, This indicates element-wise multiplication.

[0059] Furthermore, the loss function for:

[0060]

[0061] in, It is a regional loss. It is boundary loss. The boundary loss weights are calculated based on the current training epoch.

[0062] Furthermore, the method for calculating the boundary loss weights is as follows:

[0063]

[0064] in, Indicates the boundary loss weights. This represents the initial value of the boundary loss weights. This represents the final value of the boundary loss weights. This indicates the round number at which boundary loss begins to intervene. This indicates the increment step size of the boundary loss weights. This indicates the current training round number.

[0065] The beneficial effects of this invention are:

[0066] This invention employs a global Atlas prior knowledge fusion mechanism, utilizing the constructed right atrial probability map Atlas as the second channel input to provide anatomical structure prior guidance for subsequent segmentation tasks, thereby enhancing performance in LGE-MRI right atrial image segmentation. An attention-guided boundary enhancement module strengthens boundary feature representation at the feature level, while a dynamic weight scheduler optimizes boundary segmentation at the loss function level, obtaining complementary information from both region segmentation and boundary optimization. Furthermore, the lightweight Mamba segmentation network designed in this invention uses a state-space model instead of a Transformer, significantly reducing the number of parameters and computational complexity while maintaining long-distance dependency modeling capabilities, ensuring real-time segmentation. Simultaneously, by employing 3D CLAHE contrast enhancement preprocessing and a dynamic weight scheduling strategy, image segmentation performance is guaranteed by combining Atlas prior knowledge and a boundary awareness mechanism without requiring a large amount of labeled data. Attached Figure Description

[0067] Figure 1 This is a flowchart of a lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness, according to the present invention.

[0068] Figure 2 This is a schematic diagram of the structure of a lightweight Mamba segmentation network;

[0069] Figure 3 This is a schematic diagram of the TSMamba block structure;

[0070] Figure 4 This is a flowchart of the Attention-Guided Boundary Enhancement (AGBE) module. Detailed Implementation

[0071] Specific implementation method one: Combining Figure 1This embodiment describes a lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness. The system includes an LGE-MRI right atrial dataset acquisition module, an Atlas prior construction module, an LGE-MRI right atrial data preprocessing module, a global Atlas preprocessing module, a lightweight Mamba segmentation network, and an LGE-MRI right atrial image acquisition module.

[0072] The LGE-MRI right atrial dataset acquisition module is used to acquire the right atrial LGE-MRI image dataset and the segmentation labels of each right atrial LGE-MRI image data in the dataset;

[0073] Specifically, the image dataset acquired by the LGE-MRI right atrial dataset acquisition module comes from the RAS dataset;

[0074] The Atlas prior construction module is used to generate a global right atrial probability map Atlas based on the right atrial LGE-MRI image dataset obtained by the LGE-MRI right atrial dataset acquisition module, and uses the generated global right atrial probability map Atlas as prior guidance information for subsequent segmentation.

[0075] Specifically:

[0076] Step A1: Calculate the right atrial volume in each LGE-MRI right atrial image in the acquired right atrial LGE-MRI image dataset. Then, determine the median right atrial volume based on the calculation results (for an even number of data points, the median is the average of the two middle numbers). Use the LGE-MRI right atrial image corresponding to the median as the LGE-MRI right atrial image of the reference case (for an even number of data points, the image corresponding to the right atrial volume closest to the median is the image of the reference case). Then, select the LGE-MRI right atrial images of the 14 cases (i.e., the moving cases) whose right atrial volume is closest to the median.

[0077] It should be noted that right atrial volume is calculated by counting the number of voxels in the labeled region. Selecting cases near the median volume to form the atlas ensures representativeness. Compactness, positional deviation, and other indicators can also be used to screen reference and moved cases. The screening methods based on other indicators are the same as those based on right atrial volume. The formula for calculating compactness is: , This represents the actual volume of the right atrium. The bounding box encloses the volume, and the positional deviation is the Euclidean distance between the centroid of the right atrium and the image center;

[0078] Step A2: Using the LGE-MRI right atrial image of the reference case as the fixed image, and the LGE-MRI right atrial images of the remaining 14 selected cases as moving images, interpolation is used during registration to unify the fixed image and all moving LGE-MRI right atrial images to the target scale. The displacement field is learned through GPU non-rigid registration to achieve fine alignment. The registration optimization objective for Zhang's moving and stationary images is to maximize the normalized cross-correlation (NCC) coefficient:

[0079]

[0080] in, For the registered first Zhang moving image, Represents a fixed image. Indicates the first registration The first moving image The value of each pixel. Represents the first in a fixed image The value of each pixel. This represents the mean value of all pixels in a fixed image. Indicates the first registration The mean value of all pixels in a moving image. Represents the fixed image and the registered image. Normalized cross-correlation coefficients of moving images;

[0081] The rigid transformation matrix corresponding to the largest normalized cross-correlation coefficient for:

[0082]

[0083] in, For rotation matrix, As a translation vector, the first is transformed by a rigid transformation matrix. Registering moving images can maximize the normalized cross-correlation coefficient.

[0084] Step A3: Select the registered moving images corresponding to the normalized cross-correlation coefficients greater than 0.45. That is, remove low-quality data based on the NCC value to ensure the reliability of Atlas construction. Then calculate the weight of each selected moving image:

[0085]

[0086] in, Indicates the selected first Weights of moving images, Indicates the selected first Weights of moving images, This indicates the total number of images selected. Indicates the selected first Weights of moving images;

[0087] Step A4: Perform weighted fusion on the segmentation labels of each registered moving image according to the weight (i.e., perform voxel-level fusion on the corresponding positions of the segmentation labels of each registered moving image), and use the fusion result as the global right atrial probability map Atlas. The size of the global right atrial probability map Atlas is the same as the size of the registered moving image. The value range of each pixel in the global right atrial probability map Atlas is [0,1], which represents the probability that each voxel position belongs to the right atrium.

[0088] The LGE-MRI right atrial data preprocessing module is used to preprocess each LGE-MRI image in the acquired right atrial LGE-MRI image dataset.

[0089] For any LGE-MRI image, the specific preprocessing procedure is as follows:

[0090] Step B1: Perform 3D Contrast Limited Adaptive Histogram Equalization (3D CLAHE) on the LGE-MRI right atrial images.

[0091] The 3D CLAHE parameters are set as follows: sliding window radius of (4, 4, 4) voxels, contrast limit coefficient. =0.3, symmetry parameter β=0.3, gray level quantization is 256, contrast limit factor. =4; 3D CLAHE processing uses a GPU-accelerated block calculation method, which divides the 3D volume data into blocks of (8, 8, 8) voxels, calculates the cumulative distribution function (CDF) for each block, and achieves a smooth transition between blocks through bilinear interpolation, ultimately outputting an image with enhanced contrast.

[0092] Step B2: Perform Z-score normalization on the image after 3D-constrained contrast adaptive histogram equalization.

[0093] Specifically:

[0094]

[0095] in, This represents any pixel value in the image after 3D-constrained contrast adaptive histogram equalization. express The corresponding Z-score normalization result, This represents the mean of all non-zero pixels in the image after 3D-constrained contrast adaptive histogram equalization. This represents the standard deviation of all non-zero pixels in the image after 3D-constrained contrast adaptive histogram equalization.

[0096] Step B3: Perform depth-direction symmetrical filling on the Z-score normalized image to make the depth of the filled image 96 layers.

[0097] The number of layers padded forward and backward in the image after Z-score normalization are as follows:

[0098]

[0099]

[0100] in, This indicates the original number of layers in the depth direction of the image after Z-score normalization. Indicates the number of layers to fill forward. Indicates the number of layers to fill backwards. Indicates rounding down;

[0101] Step B4: Crop the filled image to the center. The size of the cropped image is 320×320, and the center position of the cropped image is:

[0102]

[0103] in, This indicates the position of the center of the cropped image along the height direction of the filled image. This indicates the position of the center of the cropped image along the width of the filled image. This indicates the height of the cropped image. This indicates the width of the image to be cropped.

[0104] The cropped image is downsampled at the voxel level, that is, the image size is downsampled from 96×320×320 to 96×160×160 using trilinear interpolation, and finally a standardized voxel matrix is ​​obtained.

[0105] Export the preprocessed image and labels as npz format, and save the attributes required for inference and recovery (including original size, original spacing, cropping coordinates, padding parameters, etc.) to a pkl file;

[0106] The global Atlas preprocessing module is used to resize the global right atrial probability map Atlas, that is, to use trilinear interpolation to resize the global right atrial probability map Atlas to 96×160×160 pixels, and obtain the probability matrix composed of pixels in the resized global right atrial probability map Atlas. It should be noted that this probability matrix is ​​reused for all cases, both during the training process and in the subsequent actual detection process, without the need for case-by-case registration.

[0107] The lightweight Mamba segmentation network includes an encoder and a decoder. The encoder employs a four-stage downsampling structure with feature dimensions of [48, 96, 192, 384], and each stage has a depth of two layers. The lightweight Mamba segmentation network is trained using a probability matrix and the normalized voxel matrix corresponding to each right atrial LGE-MRI image. Figure 2 As shown, the internal workflow of a lightweight Mamba segmentation network is as follows:

[0108] Step C1: Concatenate the normalized voxel matrix corresponding to each right atrial LGE-MRI image with the probability matrix along the channel dimension to obtain each concatenation result. Use each concatenation result as a training sample of the lightweight Mamba segmentation network. The segmentation label of the training sample is the segmentation label of the image corresponding to the normalized voxel matrix in the training sample.

[0109] The first channel in the stitched result is the normalized voxel matrix corresponding to the right atrial LGE-MRI image, and the second channel in the stitched result is the probability matrix.

[0110] Step C2: Use each training sample as the input of the encoding unit. Within the encoding unit, use the training sample as the input of the first encoder, then use the output of the first encoder as the input of the second encoder, then use the output of the second encoder as the input of the third encoder, then use the output of the third encoder as the input of the fourth encoder, and use the outputs of the first encoder, the second encoder, the third encoder, and the fourth encoder as the output of the encoding unit.

[0111] The coding unit adopts a hybrid architecture design, namely:

[0112] Within the first encoder, the input is sequentially passed through a downsampling module, a large kernel convolution module (Large KernelConv, used for local feature extraction), and an attention-guided boundary enhancement module (AGBE, used for boundary feature enhancement). The output of the attention-guided boundary enhancement module is used as the output of the first encoder.

[0113] Within the second encoder, the input is sequentially passed through a downsampling module, a large kernel convolution module (Large KernelConv), and an attention-guided boundary enhancement module (AGBE). The output of the attention-guided boundary enhancement module is used as the output of the second encoder.

[0114] Within the third encoder, the input is sequentially passed through a downsampling module, a TSMamba block (used for long-distance dependency modeling), and an attention-guided boundary enhancement module (AGBE). The output of the attention-guided boundary enhancement module is used as the output of the third encoder.

[0115] Among them, such as Figure 3 As shown, the TSMamba block includes a gated spatial convolution (GSC) module, a three-way orthogonal Mamba (ToOM) module, and a multilayer perceptron (MLP) module;

[0116] The GSC module employs two convolutional branches with a kernel size of 3×3×3 and one convolutional branch with a kernel size of 1×1×1, fusing multi-scale features through a gating mechanism.

[0117] The ToOM module models Mamba sequences in three directions—depth, width, and height—using forward, backward, and crossover modes respectively, and then sums the results from the three directions. For each direction, the forward mode directly performs Mamba processing, the backward mode first flips the sequence, then processes it, and finally flips it back, and the crossover mode reassembles the sequence according to its odd and even positions, processes it, and then restores it. The ToOM module uses the Mamba state-space model, with parameters including d_model (feature dimension), d_state=16 (state dimension), d_conv=4 (kernel size), and expand=2 (expansion factor).

[0118] MLP module: Employs a channel-dimensional fully connected layer with a spread ratio of 2 and uses the GELU activation function.

[0119] Within the fourth encoder, the input is sequentially passed through a downsampling module, a TSMamba block (used for long-distance dependency modeling), and an attention-guided boundary enhancement module (AGBE). The output of the attention-guided boundary enhancement module is used as the output of the fourth encoder.

[0120] (1) The downsampling modules in the four encoders all adopt hybrid scale downsampling (HS Downsampling). The downsampling module first includes three parallel convolutional branches, each of which includes a convolutional layer. The kernel sizes of the convolutional layers in the three branches are 5×5×5, 3×3×3, and 2×2×2, respectively. After concatenating the features output by the three convolutional branches, the concatenation result is fused through a convolutional layer with a kernel size of 1×1×1. The fused result is used as the output of the downsampling module.

[0121] (2) The attention-guided boundary enhancement module includes a 3D Sobel boundary extraction submodule, an attention mechanism submodule, and a feature fusion submodule. The number of input channels and output channels of the attention-guided boundary enhancement module in each encoder are as follows:

[0122] The attention-guided boundary enhancement module in the first encoder has 48 input channels and 48 output channels.

[0123] The attention-guided boundary enhancement module in the second encoder has 96 input channels and 96 output channels.

[0124] The attention-guided boundary enhancement module in the third encoder has 192 input channels and 192 output channels;

[0125] The attention-guided boundary enhancement module in the fourth encoder has 384 input channels and 384 output channels.

[0126] like Figure 4 As shown, the working process of the attention-guided boundary enhancement module is as follows:

[0127] Step D1, the 3D Sobel boundary extraction submodule includes three independent 3D convolutional layers, which are used to extract boundary features in the X, Y and Z directions of the input x, respectively;

[0128] In this layer, each 3D convolutional layer has a kernel size of 3×3×3, padding of 1, and no bias term; the Sobel kernel weights in the three directions are defined as follows:

[0129] Weights of the convolution kernel in the Sobel_X direction:

[0130] Level 1: [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]];

[0131] Level 2: [[-2, 0, 2], [-4, 0, 4], [-2, 0, 2]];

[0132] Layer 3: [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]];

[0133] The weights of the Sobel_Y direction convolution kernel are obtained by transposing the weights of the Sobel_X direction convolution kernel in the height and width dimensions;

[0134] The weights of the Sobel_Z direction convolution kernel are obtained by transposing the weights of the Sobel_X direction convolution kernel in the depth and width dimensions;

[0135] The weights of the three Sobel convolutional layers are set to the above fixed values ​​during initialization to ensure the stability of boundary extraction;

[0136] The boundary features in the X, Y, and Z directions are concatenated along the channel dimension to obtain the concatenated boundary feature edge_feat;

[0137] The number of channels for the concatenated boundary features in the first encoder is 72, the number of channels for the concatenated boundary features in the second encoder is 144, the number of channels for the concatenated boundary features in the third encoder is 288, and the number of channels for the concatenated boundary features in the fourth encoder is 576. Each stage of the decoder is the same as the corresponding encoder stage.

[0138] Step D2: The concatenated boundary feature `edge_feat` is used as input to the attention mechanism submodule. Within the attention mechanism submodule, the concatenated boundary feature `edge_feat` is sequentially passed through a convolutional layer with a kernel size of 1×1×1 (compressing the number of channels to 1), an instance normalization layer (Instance Norm3d), and a Sigmoid activation function layer. The output of the Sigmoid activation function layer is used as the generated spatial attention map `att_map`. The concatenated boundary feature `edge_feat` is then multiplied element-wise with the spatial attention map `att_map` to obtain the weighted boundary feature. :

[0139]

[0140] in, This indicates element-wise multiplication;

[0141] Step D3: The feature fusion submodule will combine the input x with the weighted boundary features. The fusion feature fusion_feat is obtained by concatenating the data along the channel dimension.

[0142] Within the first encoder, the number of channels for the fusion feature fusion_feat is 120;

[0143] Within the second encoder, the number of channels for the fusion feature fusion_feat is 240;

[0144] Within the third encoder, the number of channels for the fusion feature fusion_feat is 480;

[0145] Within the fourth encoder, the number of channels for the fusion feature fusion_feat is 960;

[0146] Each stage of the decoder is the same as the corresponding stage of the encoder.

[0147] The fusion feature fusion_feat is then passed through a convolutional layer with a kernel size of 1×1×1 (compressing the number of channels of the fusion feature back to the original number of input channels). The output of the convolutional layer is then residually concatenated with the input x. The residual concatenation result is then passed through an instance normalization layer and a ReLU activation function layer in sequence to obtain the feature output by the attention-guided boundary enhancement module.

[0148] Step C3: Within the decoding unit, the output of the fourth encoder is passed through the first feature uncertainty enhancement module (FUE) and the bottleneck layer (which includes a convolutional layer, an instance normalization layer, and a ReLU activation function in sequence). The output of the first feature uncertainty enhancement module and the output of the bottleneck layer are used as the input of the first decoder. The output of the first decoder is then used as the input of the first attention-guided boundary enhancement module within the decoding unit. Finally, the output of the first decoder and the output of the first attention-guided boundary enhancement module within the decoding unit are joined by a residual connection to obtain the residual connection result a.

[0149] The Feature Uncertainty Enhancement (FUE) module enhances the features output by the encoder. The FUE module calculates the mean of the features along the channel dimension, and after Sigmoid activation, calculates the uncertainty weight u, as shown in the formula:

[0150]

[0151]

[0152]

[0153] in, This represents the input to the FUE module. Indicates calculation The mean in the channel dimension, This represents a constraint function used to restrict the lower bound to 0. , This indicates the output of the FUE module;

[0154] An AGBE module is connected after each decoder stage to fuse the decoder features with the corresponding encoder features (skip_feat) to further enhance the boundary features;

[0155] The output of the third encoder is passed through the second feature uncertainty enhancement module. The output of the second feature uncertainty enhancement module and the residual connection result a are used as the input of the second decoder. The output of the second decoder is passed through the second attention-guided boundary enhancement module in the decoding unit. The output of the third encoder and the output of the second attention-guided boundary enhancement module in the decoding unit are residually connected to obtain the residual connection result b.

[0156] The output of the second encoder is passed through the third feature uncertainty enhancement module (FUE). The output of the third feature uncertainty enhancement module and the residual connection result b are used as the input of the third decoder. The output of the third decoder is then passed through the third attention-guided boundary enhancement module in the decoding unit. The output of the third attention-guided boundary enhancement module in the decoding unit is residually connected with the output of the second encoder to obtain the residual connection result c.

[0157] The output of the first encoder is passed through the fourth feature uncertainty enhancement module (FUE). The output of the fourth feature uncertainty enhancement module and the residual connection result c are used as the input of the fourth decoder. The output of the fourth decoder is then passed through the fourth attention-guided boundary enhancement module in the decoding unit. The output of the fourth attention-guided boundary enhancement module in the decoding unit is residually connected with the output of the first encoder to obtain the residual connection result d.

[0158] The residual connection result d is then passed through a convolutional layer with a kernel size of 1×1×1. The output of the convolutional layer is then passed through UnetOutBlock, and the segmentation prediction result is output through UnetOutBlock.

[0159] It should be noted that the working process of the first to the fourth decoders is the same. The working process within the decoder is based on UnterUpBlock. Specifically, the two inputs of the decoder are upsampled separately, and then the two upsampled results are fused together. The fused result is used as the output of the decoder.

[0160] The number of channels in the AGBE module of each stage of the decoder is the same as that in the corresponding encoder stage, specifically:

[0161] The first stage of the decoder's AGBE module has 384 input channels and 384 output channels.

[0162] The second stage of the decoder's AGBE module has 192 input channels and 192 output channels.

[0163] The third stage of the decoder, the AGBE module, has 96 input channels and 96 output channels.

[0164] The AGBE module in the fourth stage of the decoder has 48 input channels and 48 output channels.

[0165] Step C4: Calculate the loss function based on the output segmentation prediction results and the true segmentation labels of the samples, and then adjust the model parameters in reverse according to the loss function until a trained model is obtained.

[0166] The weights of each term in the loss function are adjusted based on a dynamic weight scheduler. The dynamic weight scheduler gradually introduces and strengthens the boundary loss during the training process, thereby achieving a dynamic balance between the region loss and the boundary loss, so as to improve the accuracy of right atrial boundary segmentation.

[0167] The dynamic weight scheduler employs a boundary segmentation optimization strategy to dynamically adjust the weights of the boundary loss. The core of this strategy is to avoid introducing boundary loss during the initial training phase, focusing instead on region segmentation. Once the region segmentation is stable, boundary loss is gradually introduced for boundary optimization. Specifically, in the initial training phase (before...)... Boundary loss weights (each epoch) When the value is 0, no boundary loss is introduced, and the model focuses on learning region segmentation; from the 1st... Starting from each epoch, boundary loss is gradually introduced, and the weights... From initial value Linear growth to final value The growth step size is the growth per epoch. Specifically:

[0168] in, Indicates the boundary loss weights. This represents the initial value of the boundary loss weights. This represents the final value of the boundary loss weights. This indicates the round number at which boundary loss begins to intervene. This indicates the increment step size of the boundary loss weights. This indicates the current training round number.

[0169] It should be noted that the training process of the lightweight Mamba segmentation network is as follows:

[0170] Step 1: Initialize training parameters:

[0171] The Adam optimizer is used, with an initial learning rate set to The weight decays to A multinomial learning rate scheduling strategy is adopted, and the learning rate decay formula is:

[0172]

[0173] in, The initial learning rate is given, epoch is the current training epoch, max_epoch is the maximum number of training epochs (300 in this invention), the batch size is 2, and validation is performed every 2 epochs; the dynamic weight scheduler is initialized and set... , , , ;

[0174] Step 2: Initialize the training epoch number to 1;

[0175] Step 3: Initialize training data batch t=1;

[0176] Step 4: Select the t-th batch of training data from the training dataset;

[0177] This batch contains preprocessed LGE-MRI right atrial images and their corresponding annotations; the LGE-MRI right atrial images are dual-channel inputs, with the first channel being the original LGE-MRI image and the second channel being the Atlas prior, with an image size of 96×160×160;

[0178] Step 5: Train the lightweight Mamba segmentation network using the training data selected in Step 4. The loss function used during training is... for:

[0179]

[0180] in, It is a regional loss. It is boundary loss. These are the boundary loss weights calculated by the dynamic weight scheduler based on the current training epoch.

[0181] Regional losses Including Dice loss and cross-entropy loss Two parts:

[0182]

[0183] The method for calculating Dice loss is as follows:

[0184]

[0185] in, Indicates the first Individual elements belong to the predicted probability of the foreground. Indicates the first The true label of individual factors For smoothing terms;

[0186] Cross-entropy loss employs class-weighted cross-entropy to mitigate the class imbalance problem in segmentation tasks. The calculation method is as follows:

[0187]

[0188] Where N represents the total number of voxels. Indicates the first Individual elements correspond to real categories The weights (background category weight w0=1.0, foreground category weight w1=10.0) This indicates the th logits in the model output without Softmax normalization. Individual elements correspond to real categories The predicted value; C=2 represents the total number of categories (background and foreground);

[0189] Step Six: Calculate the total loss The network parameters are updated by backpropagation based on the total loss.

[0190] Step 7: Perform the verification steps: Set a window size, use a sliding window inference strategy to infer the verification set, with a window overlap rate of 0.5, use Gaussian weighting for window fusion, and calculate the Dice coefficient of the verification set;

[0191] An early stopping mechanism is adopted, and the Dice coefficient of the validation set is monitored. If there is no improvement for 30 consecutive rounds, the training is stopped early.

[0192] Step 8: Determine if the maximum number of batches for the current round has been reached;

[0193] If the maximum number of batches in the current round has not been reached, then set the batch number t = t + 1, and return to step four.

[0194] If the maximum batch size for the current round is reached, then set the training round number epoch = epoch + 1, and return to step three.

[0195] After the lightweight Mamba segmentation network is trained, the LGE-MRI right atrial image acquisition module acquires the LGE-MRI right atrial image to be segmented. After preprocessing the LGE-MRI right atrial image to be segmented, the preprocessed LGE-MRI right atrial image to be segmented and the global right atrial probability map Atlas generated by the Atlas prior construction module are concatenated to form the input of the trained lightweight Mamba segmentation network. The right atrial segmentation result is inferred using the trained lightweight Mamba segmentation network.

[0196] The specific process of inference using a trained lightweight Mamba segmentation network is as follows:

[0197] Step 1: Load the trained model weights, initialize the sliding window inferencer, and initialize the weighted fusion strategy to a Gaussian weighted fusion strategy;

[0198] Step 2: Read the preprocessed LGE-MRI right atrial image to be segmented. The image is a dual-channel image (the first channel is the image, and the second channel is the global right atrial probability map Atlas), with a size of 96×160×160.

[0199] Step 3: Input the preprocessed LGE-MRI right atrial image into the trained lightweight Mamba segmentation network, and use the sliding window inference strategy to perform forward propagation for each window to obtain the predicted logits within the window; use Gaussian weighting to fuse the prediction results of overlapping windows to obtain the complete predicted logits.

[0200] Step 4: Perform Softmax normalization on the fused prediction logits to obtain the prediction probability map pred_prob;

[0201] Step 5: Obtain the predicted binary segmentation mask image pred_mask based on the predicted probability map pred_prob;

[0202] Step 6: Load the attribute file saved during preprocessing to obtain information such as the original size, cropping coordinates, and depth fill parameters of the case.

[0203] Step 7: Perform reverse preprocessing.

[0204] To restore the prediction results to the original image size: First, the predicted binary segmentation mask image is upsampled to 96×320×320. Then, the image is restored to the filled size according to the saved cropping coordinates. Finally, the filled part in the depth direction is cropped according to the saved depth fill parameters to restore the original size.

[0205] Step 8: Save the restored segmentation results as an NIfTI format file for subsequent analysis and visualization.

[0206] This invention evaluates the segmentation results based on the evaluation metrics Dice, Jaccard, and HD95, and statistically summarizes the verification results of each fold of the five-fold cross-validation to obtain the overall performance index and its stability characterization.

[0207] The above examples of the present invention are merely illustrative of the computational model and process of the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is impossible to exhaustively list all possible implementations here. Any obvious variations or modifications derived from the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A lightweight Mamba right atrial segmentation system based on Atlas priors and boundary awareness, characterized in that, The system includes an LGE-MRI right atrial dataset acquisition module, an Atlas prior construction module, an LGE-MRI right atrial data preprocessing module, a global Atlas preprocessing module, a lightweight Mamba segmentation network, and an LGE-MRI right atrial image acquisition module to be segmented. The LGE-MRI right atrial dataset acquisition module is used to acquire the right atrial LGE-MRI image dataset and the segmentation labels of each right atrial LGE-MRI image data in the dataset; The Atlas prior construction module is used to generate a global right atrial probability map Atlas based on the right atrial LGE-MRI image dataset obtained by the LGE-MRI right atrial dataset acquisition module. The LGE-MRI right atrial data preprocessing module is used to preprocess each LGE-MRI image in the acquired right atrial LGE-MRI image dataset. The global Atlas preprocessing module is used to adjust the size of the global right atrial probability map Atlas to obtain a probability matrix composed of pixels in the adjusted global right atrial probability map Atlas. The lightweight Mamba segmentation network includes an encoding unit and a decoding unit, and the lightweight Mamba segmentation network is trained using a probability matrix and a normalized voxel matrix corresponding to each right atrial LGE-MRI image. The LGE-MRI right atrial image acquisition module acquires the LGE-MRI right atrial image to be segmented; After preprocessing the LGE-MRI right atrial image to be segmented, the preprocessed LGE-MRI right atrial image to be segmented and the global right atrial probability map Atlas generated by the Atlas prior construction module are concatenated as the input to the trained lightweight Mamba segmentation network. The right atrial segmentation result is then inferred using the trained lightweight Mamba segmentation network.

2. The lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness as described in claim 1, characterized in that, The specific working process of the Atlas prior construction module is as follows: Step A1: Calculate the right atrial volume in each LGE-MRI right atrial image in the acquired right atrial LGE-MRI image dataset. Then, determine the median right atrial volume based on the calculation results. Use the LGE-MRI right atrial image corresponding to the median as the LGE-MRI right atrial image of the reference case. Then, select the LGE-MRI right atrial images of 14 cases whose right atrial volume is closest to the median. Step A2: Use the LGE-MRI right atrial image of the reference case as the fixed image, and use the LGE-MRI right atrial images of the remaining 14 selected cases as moving images. The registration optimization objective for moving and fixed images is to maximize the normalized cross-correlation coefficient. Step A3: Select the registered moving images corresponding to the normalized cross-correlation coefficients greater than 0.45, and then calculate the weight of each selected moving image. Step A4: According to the weight, the segmentation labels of each registered moving image are weighted and fused, and the fusion result is used as the global right atrial probability map Atlas.

3. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness as described in claim 2, characterized in that, The method for calculating the normalized cross-correlation coefficient is as follows: in, For the registered first Zhang moving image, Represents a fixed image. Indicates the first registration The first moving image The value of each pixel. Represents the first in a fixed image The value of each pixel. This represents the mean value of all pixels in a fixed image. Indicates the first registration The mean value of all pixels in a moving image. Represents the fixed image and the registered image. Normalized cross-correlation coefficients of moving images.

4. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness as described in claim 3, characterized in that, The weight of each selected moving image is calculated as follows: in, Indicates the selected first Weights of moving images, Indicates the selected first Weights of moving images, This indicates the total number of images selected. Indicates the selected first Weights of moving images.

5. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness according to claim 4, characterized in that, The working process of the LGE-MRI right atrial data preprocessing module is as follows: Step B1: Perform 3D-limited contrast adaptive histogram equalization on the LGE-MRI right atrial images; Step B2: Perform Z-score normalization on the image after 3D-constrained contrast adaptive histogram equalization. Step B3: Perform depth-direction symmetrical filling on the Z-score normalized image to make the depth of the filled image 96 layers. The number of layers padded forward and backward in the image after Z-score normalization are as follows: in, This indicates the original number of layers in the depth direction of the image after Z-score normalization. Indicates the number of layers to fill forward. Indicates the number of layers to fill backwards. Indicates rounding down; Step B4: Crop the filled image to the center. The size of the cropped image is 320×320, and the center position of the cropped image is: in, This indicates the position of the center of the cropped image along the height direction of the filled image. This indicates the position of the center of the cropped image along the width of the filled image. This indicates the height of the cropped image. This indicates the width of the image to be cropped. The cropped image is downsampled at the voxel level to obtain a standardized voxel matrix.

6. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness according to claim 5, characterized in that, The internal workflow of the lightweight Mamba segmentation network is as follows: Step C1: Concatenate the normalized voxel matrix corresponding to each right atrial LGE-MRI image with the probability matrix along the channel dimension to obtain each concatenation result. Use each concatenation result as a training sample of the lightweight Mamba segmentation network. The segmentation label of the training sample is the segmentation label of the image corresponding to the normalized voxel matrix in the training sample. The first channel in the stitched result is the normalized voxel matrix corresponding to the right atrial LGE-MRI image, and the second channel in the stitched result is the probability matrix. Step C2: Use each training sample as the input of the encoding unit. Within the encoding unit, use the training sample as the input of the first encoder, then use the output of the first encoder as the input of the second encoder, then use the output of the second encoder as the input of the third encoder, then use the output of the third encoder as the input of the fourth encoder, and use the outputs of the first encoder, the second encoder, the third encoder, and the fourth encoder as the output of the encoding unit. Within the first encoder, the input part is sequentially passed through a downsampling module, a large kernel convolution module, and an attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the first encoder. In the second encoder, the input part is sequentially passed through the downsampling module, the large kernel convolution module, and the attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the second encoder. Within the third encoder, the input part is sequentially passed through the downsampling module, the TSMamba block, and the attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the third encoder. Within the fourth encoder, the input part is sequentially passed through the downsampling module, the TSMamba block, and the attention-guided boundary enhancement module, and the output of the attention-guided boundary enhancement module is used as the output of the fourth encoder. Step C3: Within the decoding unit, the output of the fourth encoder is passed through the first feature uncertainty enhancement module and the bottleneck layer respectively. The output of the first feature uncertainty enhancement module and the output of the bottleneck layer are used as the input of the first decoder. The output of the first decoder is then used as the input of the first attention-guided boundary enhancement module within the decoding unit. Finally, the output of the first decoder and the output of the first attention-guided boundary enhancement module within the decoding unit are joined by a residual connection to obtain the residual connection result a. The output of the third encoder is passed through the second feature uncertainty enhancement module. The output of the second feature uncertainty enhancement module and the residual connection result a are used as the input of the second decoder. The output of the second decoder is passed through the second attention-guided boundary enhancement module in the decoding unit. The output of the third encoder and the output of the second attention-guided boundary enhancement module in the decoding unit are residually connected to obtain the residual connection result b. The output of the second encoder is passed through the third feature uncertainty enhancement module. The output of the third feature uncertainty enhancement module and the residual connection result b are used as the input of the third decoder. The output of the third decoder is then passed through the third attention-guided boundary enhancement module in the decoding unit. The output of the third attention-guided boundary enhancement module in the decoding unit is residually connected with the output of the second encoder to obtain the residual connection result c. The output of the first encoder is passed through the fourth feature uncertainty enhancement module. The output of the fourth feature uncertainty enhancement module and the residual connection result c are used as the input of the fourth decoder. The output of the fourth decoder is then passed through the fourth attention-guided boundary enhancement module in the decoding unit. The output of the fourth attention-guided boundary enhancement module in the decoding unit is residually connected with the output of the first encoder to obtain the residual connection result d. The residual connection result d is then passed through a convolutional layer with a kernel size of 1×1×1. The output of the convolutional layer is then passed through UnetOutBlock, and the segmentation prediction result is output through UnetOutBlock. Step C4: Calculate the loss function based on the output segmentation prediction results and the true segmentation labels of the samples, and then adjust the model parameters in reverse according to the loss function until a trained model is obtained.

7. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness as described in claim 6, characterized in that, The attention-guided boundary enhancement module includes a 3D Sobel boundary extraction submodule, an attention mechanism submodule, and a feature fusion submodule. The working process of the attention-guided boundary enhancement module is as follows: Step D1, the 3D Sobel boundary extraction submodule includes three independent 3D convolutional layers, which are used to extract boundary features in the X, Y and Z directions of the input x, respectively; The boundary features in the X, Y, and Z directions are concatenated along the channel dimension to obtain the concatenated boundary feature edge_feat; Step D2: The concatenated boundary feature `edge_feat` is used as input to the attention mechanism submodule. Within the attention mechanism submodule, the concatenated boundary feature `edge_feat` is sequentially passed through a convolutional layer with a kernel size of 1×1×1, an instance normalization layer, and a Sigmoid activation function layer. The output of the Sigmoid activation function layer is used as the generated spatial attention map `att_map`. The concatenated boundary feature `edge_feat` is then multiplied element-wise with the spatial attention map `att_map` to obtain the weighted boundary feature. : Step D3: The feature fusion submodule will combine the input x with the weighted boundary features. The fusion feature fusion_feat is obtained by concatenating the data along the channel dimension. The fusion feature fusion_feat is then passed through a convolutional layer with a kernel size of 1×1×1. The output of the convolutional layer is then concatenated with the input x using residuals. The residual concatenation result is then passed through an instance normalization layer and a ReLU activation function layer to obtain the feature output by the attention-guided boundary enhancement module.

8. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness according to claim 7, characterized in that, The weighted boundary features for: in, This indicates element-wise multiplication.

9. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness according to claim 8, characterized in that, The loss function for: in, It is a regional loss. It is boundary loss. The boundary loss weights are calculated based on the current training epoch.

10. A lightweight Mamba right atrial segmentation system based on Atlas prior and boundary awareness according to claim 9, characterized in that, The method for calculating the boundary loss weight is as follows: in, Indicates the boundary loss weights. This represents the initial value of the boundary loss weights. This represents the final value of the boundary loss weights. This indicates the round number at which boundary loss begins to intervene. This indicates the increment step size of the boundary loss weights. This indicates the current training round number.