Lightweight multi-scale attention fusion segmentation method, system and device for medical image and medium

By using a lightweight multi-scale attention fusion network, this study addresses the problems of high model complexity, insufficient extraction of fine structures, and limited generalization ability across datasets in medical image segmentation. It achieves efficient and accurate medical image segmentation, suitable for portable medical devices and resource-constrained clinical environments.

CN121837618APending Publication Date: 2026-04-10SHANGHAI INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing medical image segmentation methods suffer from high model complexity, insufficient ability to extract fine structures, inadequate feature fusion, and limited generalization ability across datasets.

Method used

A lightweight multi-scale attention fusion network is adopted, which performs feature extraction and fusion through cascaded U-shaped sub-networks. Multi-scale features are fused by weighted fusion of three-branch convolutional blocks and attention weights, and combined with an adaptive feature fusion module to achieve multi-scale feature representation and efficient information fusion.

Benefits of technology

It significantly reduces model complexity, enhances the ability to extract fine structures and generalize across datasets, improves the structural continuity and boundary clarity of segmentation results, and is suitable for portable medical devices and resource-constrained clinical environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837618A_ABST
    Figure CN121837618A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight multi-scale attention fusion segmentation method, system and device for a medical image and a medium, and belongs to the technical field of deep learning image segmentation, and the method comprises the steps: carrying out the image preprocessing of an original medical image, obtaining a preprocessed image, and cutting the preprocessed image into image blocks; taking the image blocks as input, and sending the image blocks into a lightweight multi-scale attention fusion network; respectively setting three-branch convolution blocks in a coding structure and a decoding structure of the U-shaped sub-network to obtain multi-scale feature representation; and performing adaptive feature fusion on the obtained multi-scale feature representation, performing up-sampling and channel splicing on features output by different decoding layers, sequentially performing channel attention and space attention weighting, and outputting a medical image segmentation result. According to the method, the calculation complexity can be remarkably reduced while the high segmentation precision is kept, the fine structure extraction capability is improved, and the method has good cross-dataset accuracy and clinical practicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning image segmentation technology, specifically to a lightweight multi-scale attention fusion segmentation method, system, device, and medium for medical images. Background Technology

[0002] Structural features in medical images serve as crucial biomarkers for the diagnosis and pathological analysis of various diseases. Clinically, medical image segmentation primarily relies on manual annotation by physicians, which is not only time-consuming and labor-intensive but also subject to subjective variations, making it difficult to meet the needs of large-scale screening and early diagnosis. Therefore, automated segmentation methods based on deep learning are essential.

[0003] In existing technologies, deep learning methods based on convolutional neural networks have made significant progress in medical image segmentation. For example, the U-Net model proposed by Ronneberger et al. can extract multi-level features through an encoder-decoder structure, achieving end-to-end segmentation. Subsequently, researchers have proposed various improved models, such as R2U-Net with recurrent convolution, Attention U-Net with an attention mechanism, and U-Net++ with enhanced cross-layer connections. Although these methods have achieved good accuracy, they still have the following problems: High model complexity: Many improved methods significantly increase the number of parameters and computational load while improving accuracy, making them unsuitable for deployment in portable medical imaging equipment or resource-constrained clinical environments.

[0004] Insufficient ability to extract fine structures: Medical images show great differences in target structures. These methods are prone to breakage or omission when capturing small or complex targets, resulting in insufficient integrity of the segmentation results.

[0005] Insufficient feature fusion: Existing methods often use simple splicing or weighting in the skip connection part, which results in information redundancy and feature misalignment, making it difficult to simultaneously take into account the continuity of global structure and local details.

[0006] Limited cross-dataset generalization ability: Many models perform well on a single public dataset, but their performance degrades significantly under different acquisition conditions or complex pathological images, affecting clinical applicability.

[0007] Therefore, there is an urgent need for a medical image segmentation method that can ensure segmentation accuracy while possessing lightweight design, high sensitivity to fine structures, efficient feature fusion, and good generalization ability across datasets. Summary of the Invention

[0008] In view of the above-mentioned problems, the present invention provides a lightweight multi-scale attention fusion segmentation method, system, device and medium for medical images.

[0009] Therefore, the technical problem solved by this invention is: how to solve the problems of high model complexity, insufficient ability to extract fine structures, insufficient feature fusion, and limited generalization ability across datasets in existing methods.

[0010] To address the aforementioned technical problems, this invention provides the following technical solution: a lightweight multi-scale attention fusion segmentation method for medical images, comprising: preprocessing the original medical image to obtain a preprocessed image and cropping it into image blocks; feeding the image blocks as input into a lightweight multi-scale attention fusion network, sequentially performing feature extraction and fusion through two cascaded U-shaped sub-networks, with the two sub-networks connected by element-wise addition; setting three-branch convolutional blocks in the encoding and decoding structures of the U-shaped sub-networks respectively, extracting attention weights along the channel dimension, height dimension, and width dimension of the extracted features, and performing weighted fusion to obtain a multi-scale feature representation; performing adaptive feature fusion on the obtained multi-scale feature representation, upsampling and channel concatenation of the features output from different decoding layers, and sequentially performing channel attention and spatial attention weighting to output the medical image segmentation result.

[0011] As a preferred embodiment of the lightweight multi-scale attention fusion segmentation method for medical images described in this invention, the operation of preprocessing the original medical image to obtain the preprocessed image and cropping it into image blocks includes: performing weighted channel conversion on the original medical image to generate a grayscale image; normalizing the grayscale image; performing brightness and contrast enhancement operations on the normalized image; and cropping the enhanced image to a fixed size to obtain image blocks.

[0012] As a preferred embodiment of the lightweight multi-scale attention fusion segmentation method for medical images described in this invention, the method comprises: taking an image patch as input and feeding it into a lightweight multi-scale attention fusion network, where feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks, connected by element-wise addition; the lightweight multi-scale attention fusion network is composed of two cascaded U-shaped sub-networks with identical structures, each including an encoding structure and a decoding structure; the first U-shaped sub-network receives the image patch and performs feature extraction; between the two U-shaped sub-networks, feature interaction is performed at corresponding levels by element-wise addition to form fused features; the second U-shaped sub-network processes the fused features and outputs a feature map.

[0013] As a preferred embodiment of the lightweight multi-scale attention fusion segmentation method for medical images described in this invention, the method involves setting three-branch convolutional blocks in the encoding and decoding structures of the U-shaped sub-network, extracting attention weights along the channel, height, and width dimensions of the extracted features, and performing weighted fusion to obtain a multi-scale feature representation. This includes: performing feature processing on the input feature map along the channel, height, and width dimensions; generating corresponding attention weights in each dimension; applying the attention weights to the input feature map and performing weighted processing; and performing element-wise weighted fusion on the three weighted feature maps to output a multi-scale feature representation.

[0014] As a preferred embodiment of the lightweight multi-scale attention fusion segmentation method for medical images described in this invention, the feature processing of the input feature map in the channel dimension, height dimension, and width dimension includes: performing global average pooling and global max pooling operations in the channel direction on the input feature map in the channel dimension to extract channel context information; performing global average pooling and global max pooling operations in the height direction on the input feature map in the height dimension to extract vertical context information; and performing global average pooling and global max pooling operations in the width direction on the input feature map in the width dimension to extract horizontal context information.

[0015] This preferred solution can independently extract contextual information in each direction by performing global average pooling and max pooling operations on the channel dimension, height dimension, and width dimension respectively, thereby improving the model's global perception capability of different spatial directions in the feature map.

[0016] As a preferred embodiment of the lightweight multi-scale attention fusion segmentation method for medical images described in this invention, the step of adaptively fusing the obtained multi-scale feature representations, upsampling and concatenating the features output from different decoding layers, and sequentially performing channel attention and spatial attention weighting to output the medical image segmentation result includes: uniformly upsampling feature maps from different decoding layers to the same resolution to obtain upsampled feature maps; concatenating the upsampled feature maps along the channel dimension to form fused features; performing channel attention operation on the fused features first, and then performing spatial attention operation to obtain weighted fused features; inputting the weighted fused features into a convolution operation to output the medical image segmentation result.

[0017] This preferred approach achieves effective integration of multi-scale information by uniformly upsampling feature maps from multiple decoding layers and splicing and fusing them along the channel dimension. Then, channel attention and spatial attention operations are executed sequentially, enabling the model to focus on key regions from both semantic and spatial perspectives, thereby improving the boundary continuity and structural integrity of the segmentation map and reducing detail breaks and erroneous responses.

[0018] As a preferred embodiment of the lightweight multi-scale attention fusion segmentation method for medical images described in this invention, the step of performing channel attention operations followed by spatial attention operations on the fusion features to obtain weighted fusion features includes: performing global average pooling and global max pooling operations on the fusion features in the channel dimension to obtain channel context information; inputting the channel context information into a convolution operation and activating it to generate channel attention weights; applying the channel attention weights to the fusion features to output channel-weighted features; performing a convolution operation on the channel-weighted features in the spatial dimension and activating it to generate spatial attention weights; applying the spatial attention weights to the channel-weighted features to output weighted fusion features.

[0019] This preferred approach first performs channel attention operations on the fused features to guide the model to focus on important semantic features in the channel dimension, and then performs attention operations in the spatial dimension to further highlight key structural regions, effectively improving the model's ability to distinguish target regions and suppress redundant responses in complex backgrounds.

[0020] This invention provides a lightweight multi-scale attention fusion segmentation system for medical images.

[0021] To address the aforementioned technical problems, this invention provides the following technical solution: a lightweight multi-scale attention fusion segmentation system for medical images, comprising: an image preprocessing module, a feature extraction module, an attention fusion module, and a segmentation generation module; the image preprocessing module performs image preprocessing operations on the original medical image to obtain a preprocessed image and crop it into image patches; the feature extraction module takes the image patches as input and feeds them into a lightweight multi-scale attention fusion network, sequentially performing feature extraction and fusion through two cascaded U-shaped sub-networks, with the two sub-networks connected by element-wise addition; the attention fusion module sets three-branch convolutional blocks in the encoding and decoding structures of the U-shaped sub-networks respectively, extracts attention weights along the channel dimension, height dimension, and width dimension of the extracted features, and performs weighted fusion to obtain a multi-scale feature representation; the segmentation generation module performs adaptive feature fusion on the obtained multi-scale feature representation, upsamples and concatenates the features output from different decoding layers, and sequentially performs channel attention and spatial attention weighting to output the medical image segmentation result.

[0022] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the lightweight multi-scale attention fusion segmentation method for medical images.

[0023] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the lightweight multi-scale attention fusion segmentation method for medical images.

[0024] The beneficial effects of this invention are as follows: By constructing a lightweight multi-scale attention fusion network with a cascaded double-U-shaped structure, this invention significantly reduces model complexity while improving the depth and effectiveness of feature extraction. The three-branch convolutional blocks enhance the model's ability to perceive key regions such as fine structures and complex boundaries. The adaptive feature fusion module achieves dynamic fusion and selective enhancement of multi-scale and multi-level features, effectively improving the structural continuity and boundary clarity of the segmentation results. The overall network exhibits good adaptability and stability on different datasets, meeting the comprehensive requirements of accuracy, efficiency, and deployability in clinical applications. This invention can significantly reduce computational complexity while maintaining high segmentation accuracy, improve the ability to extract fine structures, and possesses good cross-dataset accuracy and clinical applicability. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 The above is a flowchart of a lightweight multi-scale attention fusion segmentation method for medical images, provided as an embodiment of the present invention.

[0027] Figure 2 This invention provides an overall architecture of LMAF-Net, a lightweight multi-scale attention fusion segmentation method for medical images, as an embodiment of the present invention.

[0028] Figure 3 This is a schematic diagram of a three-branch convolutional block for a lightweight multi-scale attention fusion segmentation method for medical images, provided as an embodiment of the present invention.

[0029] Figure 4 This is a schematic diagram of a multi-scale attention fusion module for a lightweight multi-scale attention fusion segmentation method for medical images, provided as an embodiment of the present invention.

[0030] Figure 5 This is a schematic diagram of an adaptive feature fusion module for a lightweight multi-scale attention fusion segmentation method for medical images, provided as an embodiment of the present invention. Detailed Implementation

[0031] To make the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0032] Example 1, referring to Figure 1 This is one embodiment of the present invention, which provides a lightweight multi-scale attention fusion segmentation method for medical images, comprising: S1. Perform image preprocessing on the original medical image to obtain the preprocessed image and crop it into image blocks.

[0033] S2. The image patch is taken as input and fed into a lightweight multi-scale attention fusion network. The feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks. The two sub-networks are connected by element-wise addition.

[0034] S3. Set up three-branch convolutional blocks in the encoding and decoding structures of the U-shaped sub-network respectively, extract attention weights along the channel dimension, height dimension and width dimension of the extracted features respectively, and perform weighted fusion to obtain multi-scale feature representation.

[0035] S4. Adaptive feature fusion is performed on the obtained multi-scale feature representation. The features output by different decoding layers are upsampled and concatenated into channels. Channel attention and spatial attention weighting are then performed sequentially to output the medical image segmentation result.

[0036] It should be noted that this invention addresses the problems of high computational complexity, insufficient ability to extract detailed structures, and low feature fusion efficiency in medical image segmentation. It proposes a segmentation method integrating lightweight structural design, 3D attention modeling, and hierarchical feature fusion. Through steps S1-S4, a segmentation framework with multi-scale expressive capabilities, low computational resource consumption, and adaptability to various image quality variations is constructed. This achieves high-precision segmentation of key structures in medical images, improves the model's adaptability and robustness under different data sources, and demonstrates promising clinical deployment prospects.

[0037] Example 2, an embodiment of the present invention, provides a lightweight multi-scale attention fusion segmentation method for medical images based on the previous embodiment, comprising: In this embodiment, the image preprocessing in step S1 can perform channel conversion on the original medical image according to a fixed weighting method to generate a grayscale image; perform normalization processing on the generated grayscale image; then use adaptive histogram equalization and gamma correction operations to improve the brightness and contrast of the image; finally, crop the enhanced image to a fixed size to obtain image blocks, which are used to input the lightweight segmentation network.

[0038] In one alternative implementation, image preprocessing may further involve performing Gaussian filtering to denoise the original image, then performing edge enhancement processing, and directly normalizing the color image before cropping it into image blocks.

[0039] In another alternative implementation, image preprocessing can also utilize the Retinex image enhancement algorithm to reconstruct the brightness and color of the original image, extract the brightness channel for grayscale processing, and then perform normalization and image block cropping.

[0040] This invention standardizes the brightness, contrast, and scale of the original medical image through an image preprocessing step, making the input image more balanced in terms of brightness distribution and structural contrast, and significantly improving the model's feature extraction capability in low-contrast and heterogeneous image regions.

[0041] Furthermore, in step S1, the original medical image undergoes image preprocessing to obtain a preprocessed image, which is then cropped into image blocks. This includes the following steps A1-A4: A1. Perform weighted channel conversion on the original medical image to generate a grayscale image.

[0042] A2. Normalize the grayscale image.

[0043] A3. Perform brightness and contrast enhancement operations on the normalized image.

[0044] A4. The enhanced image is cropped to a fixed size to obtain image blocks.

[0045] In this embodiment, the normalization process in step A2 linearly normalizes the entire image based on the pixel value range after grayscale conversion, compressing all pixel values ​​into a uniform range, thereby improving the input consistency in brightness between different images. As an intermediate step in image preprocessing, normalization occurs after grayscale conversion and before image enhancement, facilitating stable feature extraction by subsequent enhancement and segmentation models.

[0046] In one alternative implementation, the normalization process can also employ the Z-score normalization method to normalize the image pixels, performing a normalization transformation on the pixel values ​​based on the mean and standard deviation of the image, in order to improve the processing stability when the image brightness has a large dynamic range.

[0047] In another alternative implementation, the normalization process can also employ a local normalization strategy, dividing the image into several regions and performing normalization processing on each region separately, in order to accommodate situations where there are local brightness differences or non-homogeneous regions in the image.

[0048] The present invention, through the linear normalization method adopted in the embodiments of this application, significantly reduces the model training bias caused by inconsistent brightness of input images while ensuring the overall brightness distribution of the image. This helps to improve the consistent response capability of the segmentation model to different image samples and enhances the stability of overall feature extraction and inference.

[0049] Specifically, image data preprocessing and cropping operations are performed to improve input image quality and enhance the model's generalization ability. First, the original color fundus images are converted to grayscale images by channel weighting (weights of 0.299, 0.587, and 0.114) to preserve brightness information and reduce redundant color interference. Subsequently, the grayscale images are normalized to ensure consistency in brightness and contrast. To further improve the visibility of low-contrast regions, adaptive histogram equalization and gamma correction are used for contrast enhancement. During the training phase, 64×64 image blocks are randomly cropped from the preprocessed images for data augmentation and to reduce GPU memory consumption; during the testing phase, images are cropped sequentially with a fixed step size, and the prediction results are reconstructed to ensure the continuity and integrity of the blood vessel segmentation map.

[0050] Furthermore, in step S2, the image patch is used as input and fed into a lightweight multi-scale attention fusion network. Feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks. The two sub-networks are connected by element-wise addition, including the following steps B1-B4: B1. The lightweight multi-scale attention fusion network is composed of two U-shaped sub-networks with the same structure cascaded together. The two U-shaped sub-networks include an encoding structure and a decoding structure, respectively.

[0051] B2. The first U-shaped sub-network receives image blocks and performs feature extraction.

[0052] B3. Between the two U-shaped sub-networks, feature interaction is performed at the corresponding levels by adding elements one by one to form fused features.

[0053] B4. The second U-shaped sub-network processes the fused features and outputs a feature map.

[0054] Specifically, this invention proposes a lightweight multi-scale attention fusion network (LMAF-Net), the overall structure of which is as follows: Figure 2 As shown, where Figure 2 The network employs a cascaded double-U-shaped network structure, consisting of two identical U-shaped sub-networks connected sequentially, with an adaptive feature fusion module introduced after the second U-shaped sub-network. This design significantly reduces the number of network parameters and computational complexity while maintaining segmentation accuracy, achieving high-precision image segmentation with low complexity. Structurally, both U-shaped sub-networks use an encoder-decoder symmetric structure, embedding a three-branch convolutional block and a multi-scale attention fusion module in each layer. Feature interaction between the two U-shaped sub-networks occurs through element-wise addition. This connection method draws on the idea of ​​LadderNet, which avoids the exponential expansion of the number of channels in the feature map at the connection point, effectively reducing the number of parameters and memory overhead, while increasing the information flow transmission path and enhancing the fusion and reuse capabilities between features at different levels.

[0055] Furthermore, in step S3, three-branch convolutional blocks are set in the encoding and decoding structures of the U-shaped sub-network, respectively. Attention weights are extracted along the channel dimension, height dimension, and width dimension of the extracted features, and then weighted and fused to obtain a multi-scale feature representation, including the following steps C1-C4: C1. Perform feature processing on the input feature map in the channel dimension, height dimension, and width dimension respectively; C2. Generate corresponding attention weights for each dimension; C3. Apply attention weights to the input feature maps respectively and perform weighted processing; C4. Perform element-wise weighted fusion on the three weighted feature maps to output multi-scale feature representations.

[0056] Furthermore, in step C1, feature processing is performed on the input feature map in the channel dimension, height dimension, and width dimension, including the following steps C11-C13: C11. Perform global average pooling and global max pooling operations on the input feature map along the channel dimension to extract channel context information.

[0057] C12. Perform global average pooling and global max pooling operations on the input feature map in the height dimension to extract vertical contextual information.

[0058] C13. Perform global average pooling and global max pooling operations on the input feature map in the width dimension to extract horizontal contextual information.

[0059] In this embodiment of the application, the element-wise weighted fusion operation in step C4 can perform attention weight calculation on the input feature map in the channel dimension, height dimension and width dimension respectively to obtain weighted feature maps in three directions; then the weighted feature maps in the three directions are weighted and fused according to the one-to-one correspondence of the element positions, and multi-scale feature representation is synthesized by element-wise addition and weight adjustment.

[0060] In an alternative implementation, the element-wise weighted fusion operation can also perform an element-wise maximum value selection operation on the attention-enhanced feature maps in three directions, taking the response value with the largest value in the three feature maps at each position as the fusion result, so as to enhance the response intensity of key feature regions.

[0061] In another alternative implementation, the element-wise weighted fusion operation can also perform channel concatenation on the weighted feature maps in three directions, and then introduce a 1×1 convolution layer for feature compression and fusion, thereby extracting the most representative feature responses from the attention outputs in multiple directions.

[0062] The effect of this invention is that, through the element-wise weighted fusion operation adopted in the embodiments of this application, it can achieve balanced fusion of multi-dimensional features while maintaining the attention response characteristics in each direction, thereby improving the integrity and consistency of feature representation and enhancing the model's ability to perceive complex structures and non-uniform regions.

[0063] Specifically, the cropped 64×64 image patch is input into the LMAF-Net backbone network, and then sequentially passes through cascaded double U-shaped sub-networks for feature extraction and fusion. The first stage U-Net is responsible for extracting multi-scale basic features, while the second stage U-Net performs deep semantic enhancement and detail reconstruction based on the output of the previous stage. Three-branch convolutional blocks and multi-scale attention fusion modules are sequentially embedded within the network to achieve multi-dimensional feature modeling and cross-scale information interaction, thereby fully integrating shallow detail information and deep semantic features.

[0064] like Figure 3 As shown, Input is the input. To add element by element, To achieve element-wise multiplication, Conv7×7 is a 7×7 convolution, and Sigmoid is the activation function. This invention proposes a Three-branch Convolution Block (TCB) to enhance feature extraction capabilities for slender targets with complex boundaries in medical images. The TCB processes the input feature map in parallel across three dimensions: channel, height, and width, generating attention weights for each dimension to achieve multi-dimensional information enhancement. Within each branch, global contextual features are first extracted using Global Average Pooling (GAP) and Global Max Pooling (GMP), then dynamically weighted using 7×7 convolution and Sigmoid activation to adaptively weight the input features, highlighting key regional information.

[0065] The enhanced features output from the three branches are fused through element-wise weighted summation to form the final multi-scale feature representation. The calculation formula is as follows: in, This indicates an element-wise weighted operation. For high-dimensional attention weights, Attention weights for the channel dimension. The attention weights are for the width dimension. For multi-scale feature representation, For high-dimensional enhanced features, For channel-dimensional enhancement features, This is an enhanced feature for the width dimension.

[0066] In this embodiment, the adaptive feature fusion in step S4 upsamples feature maps from different decoding layers to the same resolution and concatenates them into fused features along the channel dimension. Channel attention and spatial attention operations are then performed sequentially to weight the fused features. Channel attention is used to model the response relationships between different channels, while spatial attention is used to enhance the positional response of key regions. Finally, the weighted fused features are input into a convolution operation to generate the medical image segmentation result. This process represents the actual fusion method used in this invention disclosure.

[0067] In an alternative implementation, adaptive feature fusion can also be achieved by directly summing the feature maps output by each decoding layer pixel by pixel, omitting the attention mechanism, and outputting the result by simply compressing the number of channels after concatenation.

[0068] In another alternative implementation, adaptive feature fusion can also use a Transformer structure to uniformly model the feature maps output by each decoding layer, use a self-attention mechanism to learn the weight distribution of features in each layer before fusion, and input the fusion result into a lightweight decoding module to obtain the final segmentation map.

[0069] The present invention, through the upsampling, channel splicing and channel-space dual attention weighting operations adopted in the embodiments of this application, can achieve fine fusion of multi-level features at the spatial location and semantic expression levels, so that the network has stronger structure perception and boundary preservation capabilities when generating segmentation results, and effectively improves the model's response accuracy and stability to small structures and blurred edges.

[0070] Furthermore, in step S4, the obtained enhanced features are adaptively fused, the features output from different decoding layers are upsampled and concatenated, and channel attention and spatial attention weighting are performed sequentially to output the medical image segmentation result, including the following steps D1-D4: D1. Upsample the feature maps from different decoding layers to the same resolution to obtain upsampled feature maps.

[0071] D2. Segment upsampled feature maps along the channel dimension to form fused features.

[0072] D3. Perform channel attention operation on the fused features first, then perform spatial attention operation to obtain weighted fused features.

[0073] D4. Input the weighted fusion features into the convolution operation and output the medical image segmentation result.

[0074] Furthermore, in step D3, channel attention operation is first performed on the fused features, followed by spatial attention operation, to obtain weighted fused features, including the following steps D31-D35: D31. Perform global average pooling and global max pooling operations on the fused features at the channel dimension to obtain channel context information.

[0075] D32. Input the channel context information into the convolution operation and activate it to generate channel attention weights.

[0076] D33. Apply channel attention weights to the fused features and output channel-weighted features.

[0077] D34. Perform convolution operations on the channel-weighted features in the spatial dimension and activate them to generate spatial attention weights.

[0078] D35. Apply spatial attention weights to the channel weighted features and output weighted fusion features.

[0079] Specifically, adaptive feature fusion is used to upsample and concatenate features from different decoding layers at a uniform resolution, followed by sequential application of channel attention and spatial attention mechanisms to generate a final vessel segmentation map with continuous structure and clear boundaries. This segmentation map can be used in subsequent clinical diagnostic or screening systems.

[0080] like Figure 4 As shown, GroupProc is group processing, WGAP is vertical global average pooling, HGAP is horizontal global average pooling, Softmax is the activation function, Output is the output, and Conv1×1 is a 1×1 convolution. The multi-scale attention fusion (MSAF) module proposed in this invention addresses the information redundancy and spatial misalignment problems caused by direct feature concatenation in traditional skip connections. This module divides the input features into several groups according to the channel dimension, and each group independently performs local convolutional feature extraction and directional global context modeling to achieve efficient multi-scale information fusion. Specifically, the input features are divided into... There are several subgroups, each with a size of [size missing]. This grouping strategy can reduce computation while maintaining feature diversity and improving information flow. The grouping formula is as follows: in, This is the feature map after channel grouping. for, As input features, For batch size, The number of groups for the channel. For the number of channels, The height of the feature map, The height and width of the feature map.

[0081] Within each subgroup, global average pooling is performed along both the horizontal and vertical directions to obtain global contextual information in different directions. The pooling results from both directions are then concatenated, followed by a 1×1 convolution and sigmoid activation to generate directional attention weights. These weights are used to adaptively adjust the feature response intensity, achieving dynamic enhancement of spatial directions. The specific formula is as follows: in, and These represent dynamically weighted directional attention features and local convolutional features, respectively. This indicates a multiplication operation. To utilize right The directional attention weights generated after modulation. To utilize right The directional attention weights generated after modulation. The final directional attention weights are obtained by adding the results of the modulation of the two directions. This process enables the model to fuse features from different scales and dimensions, thereby achieving more efficient cross-scale feature fusion. like Figure 5 As shown, Concatenate represents connection, Channel Attention represents channel attention, and Spatial Attention represents spatial attention. The Adaptive Feature Fusion (AFF) module proposed in this invention is located at the decoding end of the network and is used to fuse features from different levels. Shallow features provide rich detailed information, while deep features contain global semantic information. The effective fusion of the two helps to improve segmentation accuracy while maintaining the continuity of the vascular structure.

[0082] Specifically, features from multiple decoding layers are first upsampled to the same resolution and then concatenated and fused along the channel dimension to form a multi-scale feature representation. The module then introduces channel attention and spatial attention mechanisms for dynamic weighting. Channel attention models the global dependencies between different channels, highlighting important features relevant to the target region; spatial attention focuses on key region locations, suppressing background noise and redundant responses. After two levels of attention weighting, the resulting fused features show significant enhancements in structural continuity and detail integrity. Finally, the optimized features are processed by a 1×1 convolutional layer to generate the final segmentation result. AFF, through dual adaptive fusion of channel and spatial attention, effectively reduces fragmentation and false predictions, ensuring the coherence of the vascular network and its ability to recognize fine structures.

[0083] LMAF-Net contains only 1.39M parameters and 0.15 GFLOPs, far fewer than traditional methods such as U-Net, making it more suitable for deployment on mobile and portable medical imaging devices. It achieves excellent performance on multiple medical image segmentation datasets (such as DRIVE, STARE, CHASE_DB1, and FIVES datasets), with average improvements in F1 score and sensitivity of approximately 4.6% and 5.9%, respectively. Overall, this invention offers significant advantages in terms of lightweight design, accuracy, and clinical usability.

[0084] Example 3 is an embodiment of the present invention, which provides a lightweight multi-scale attention fusion segmentation system for medical images, including an image preprocessing module, a feature extraction module, an attention fusion module, and a segmentation generation module.

[0085] The image preprocessing module is used to perform image preprocessing operations on the original medical images, obtain the preprocessed images, and crop them into image blocks.

[0086] The feature extraction module takes image patches as input and feeds them into a lightweight multi-scale attention fusion network. The feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks, which are connected by element-wise addition.

[0087] The attention fusion module is used to set three-branch convolutional blocks in the encoding and decoding structures of the U-shaped sub-network, respectively, to extract attention weights along the channel, height and width dimensions of the extracted features, and then perform weighted fusion to obtain multi-scale feature representations.

[0088] The segmentation generation module is used to adaptively fuse the obtained multi-scale feature representations, upsample and concatenate the features output by different decoding layers, and sequentially perform channel attention and spatial attention weighting to output the medical image segmentation results.

[0089] This embodiment also provides an electronic device applicable to a lightweight multi-scale attention fusion segmentation method for medical images, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the lightweight multi-scale attention fusion segmentation method for medical images as proposed in the above embodiment.

[0090] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements a lightweight multi-scale attention fusion segmentation method for medical images as proposed in the above embodiments.

[0091] The storage medium proposed in this embodiment belongs to the same inventive concept as the lightweight multi-scale attention fusion segmentation method for medical images proposed in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0092] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0093] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A lightweight multi-scale attention fusion segmentation method for medical images, characterized in that: include, The process involves preprocessing the original medical image to obtain the preprocessed image and then cropping it into image blocks. Image patches are fed into a lightweight multi-scale attention fusion network, and feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks. The two sub-networks are connected by element-wise addition. In the encoding and decoding structures of the U-shaped sub-network, three-branch convolutional blocks are set up respectively. Attention weights are extracted along the channel dimension, height dimension and width dimension of the extracted features respectively, and weighted fusion is performed to obtain multi-scale feature representation. The obtained multi-scale feature representations are adaptively fused, the features output from different decoding layers are upsampled and concatenated, and channel attention and spatial attention weighting are performed in sequence to output the medical image segmentation results.

2. The lightweight multi-scale attention fusion segmentation method for medical images as described in claim 1, characterized in that: The image preprocessing operation on the original medical image, which obtains the preprocessed image and crops it into image blocks, includes: The original medical image is weighted and channel-converted to generate a grayscale image; Normalize the grayscale image; Perform brightness and contrast enhancement operations on the normalized image; The enhanced image is cropped to a fixed size to obtain image blocks.

3. The lightweight multi-scale attention fusion segmentation method for medical images as described in claim 2, characterized in that: The image patch is taken as input and fed into a lightweight multi-scale attention fusion network. Feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks. The two sub-networks are connected element-wise by addition. The lightweight multi-scale attention fusion network is composed of two U-shaped sub-networks with the same structure cascaded together. The two U-shaped sub-networks include an encoding structure and a decoding structure, respectively. The first U-shaped sub-network receives image blocks and performs feature extraction; Between the two U-shaped sub-networks, feature interaction is performed at the corresponding levels by element-wise addition to form fused features; The second U-shaped sub-network processes the fused features and outputs a feature map.

4. The lightweight multi-scale attention fusion segmentation method for medical images as described in claim 3, characterized in that: The U-shaped sub-network's encoding and decoding structures each contain three-branch convolutional blocks. Attention weights are extracted along the channel, height, and width dimensions of the extracted features, and then weighted and fused to obtain a multi-scale feature representation, including... The input feature map is processed in the channel dimension, height dimension, and width dimension, respectively. Generate corresponding attention weights for each dimension; Attention weights are applied to the input feature maps respectively, and weighted processing is performed. Perform an element-wise weighted fusion operation on the three weighted feature maps to output a multi-scale feature representation.

5. A lightweight multi-scale attention fusion segmentation method for medical images as described in claim 4, characterized in that: The input feature map is processed in the channel dimension, height dimension, and width dimension, respectively. include, Global average pooling and global max pooling operations are performed on the input feature map along the channel dimension to extract channel context information; Global average pooling and global max pooling operations are performed on the input feature map in the height dimension to extract vertical contextual information; Global average pooling and global max pooling operations are performed on the input feature map in the width dimension to extract horizontal contextual information.

6. The lightweight multi-scale attention fusion segmentation method for medical images as described in claim 4, characterized in that: The obtained multi-scale feature representation is adaptively fused, the features output from different decoding layers are upsampled and concatenated, and channel attention and spatial attention weighting are performed sequentially to output the medical image segmentation result, including: Feature maps from different decoding layers are upsampled to the same resolution to obtain upsampled feature maps; Upsampled feature maps are stitched together along the channel dimension to form fused features; First, perform channel attention operation on the fused features, then perform spatial attention operation to obtain weighted fused features; The weighted fused features are input into the convolution operation, and the medical image segmentation result is output.

7. The lightweight multi-scale attention fusion segmentation method for medical images as described in claim 4, characterized in that: The process involves first performing channel attention operations on the fused features, followed by spatial attention operations, to obtain weighted fused features, including: Perform global average pooling and global max pooling operations on the fused features at the channel dimension to obtain channel context information; The channel context information is input into the convolution operation and activated to generate channel attention weights; Apply channel attention weights to the fused features to output channel-weighted features; Perform convolution operations on the channel-weighted features in the spatial dimension and activate them to generate spatial attention weights; Spatial attention weights are applied to channel-weighted features to output weighted fusion features.

8. A lightweight multi-scale attention fusion segmentation system for medical images, employing the lightweight multi-scale attention fusion segmentation method for medical images as described in any one of claims 1 to 7, characterized in that, include: Image preprocessing module, feature extraction module, attention fusion module, and segmentation generation module; The image preprocessing module is used to perform image preprocessing on the original medical image, obtain the preprocessed image, and crop it into image blocks; The feature extraction module is used to take image patches as input and feed them into a lightweight multi-scale attention fusion network. The feature extraction and fusion are performed sequentially through two cascaded U-shaped sub-networks, and the two sub-networks are connected by element-wise addition. The attention fusion module is used to set three-branch convolutional blocks in the encoding and decoding structures of the U-shaped sub-network, extract attention weights along the channel dimension, height dimension and width dimension of the extracted features, and perform weighted fusion to obtain multi-scale feature representations; The segmentation generation module is used to perform adaptive feature fusion on the obtained multi-scale feature representation, upsample and concatenate the features output by different decoding layers, and sequentially perform channel attention and spatial attention weighting to output the medical image segmentation result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the lightweight multi-scale attention fusion segmentation method for medical images according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the lightweight multi-scale attention fusion segmentation method for medical images according to any one of claims 1 to 7.