Retinal blood vessel and optic disc segmentation method and system based on multi-dimensional attention and edge enhancement mechanism
By constructing a segmentation method for retinal vessels and optic disc based on multi-dimensional attention and edge enhancement mechanisms, the problems of high computational complexity and severe information loss in existing technologies are solved. This method achieves accurate segmentation of retinal vessels and optic disc, improves segmentation accuracy and robustness, and is suitable for early automated diagnosis of fundus diseases.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN UNIV
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-10
AI Technical Summary
Existing methods for segmenting retinal vessels and optic discs suffer from high computational complexity, significant information loss, excessive dependence on absolute position, and difficulty in meeting clinical diagnostic needs.
A segmentation method for retinal vessels and optic discs based on multidimensional attention and edge enhancement mechanisms is adopted. By constructing the EIAIU_Net segmentation model with a CNN-Transformer hybrid architecture, a multidimensional attention module (SSA-IAI) and an edge enhancement Transformer module (EETF) are integrated. The model is trained using a paired shuffle consistency strategy (PSC) to reduce the dependence on absolute position information and achieve simultaneous capture of global semantics and local details and edge enhancement.
It significantly improves the segmentation accuracy and robustness of retinal vessels and optic disc, and can generalize under different imaging perspectives and pathological conditions, providing reliable support for early automated diagnosis of fundus diseases.
Smart Images

Figure CN122368073A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical image processing and auxiliary diagnosis of ophthalmic diseases, specifically to a method and system for retinal vessel and optic disc segmentation based on multi-dimensional attention and edge enhancement mechanisms. Background Technology
[0002] Eye diseases have become a significant public health problem threatening human visual health worldwide. At least 2.2 billion people worldwide suffer from visual impairments, of whom 1 billion suffer from preventable or treatable fundus diseases. The fundus is the only part of the human body where the dynamics and health status of the body's blood circulation can be directly observed. Changes in the morphology and distribution of retinal vessels and the optic disc are closely related to the occurrence and development of various eye diseases. For example, in diabetic retinopathy, abnormalities such as microaneurysms and tortuous dilation of retinal vessels may appear; in pathological myopia, morphological changes such as optic disc tilt and displacement can foreshadow serious complications. Therefore, precise segmentation of retinal vessels and the optic disc is a crucial step in the early screening and diagnosis of fundus diseases.
[0003] Traditional methods for segmenting retinal vessels and optic discs have many drawbacks: manual annotation is inefficient and highly subjective, making it difficult to meet the needs of large-scale clinical screening; threshold-based segmentation algorithms have poor adaptability and insufficient accuracy when faced with complex lesion images. In recent years, deep learning-based segmentation models have made significant progress. Convolutional Neural Networks (CNNs) are adept at capturing local detailed features, while Transformers can model global contextual relationships. The CNN-Transformer hybrid structure, which combines the two, has shown superiority in the field of medical image segmentation.
[0004] However, existing deep learning segmentation techniques still face significant challenges: First, traditional attention mechanisms are computationally complex, consuming excessive computational resources when processing high-resolution fundus images, and struggle to balance feature extraction of local details with global context. Second, traditional downsampling methods cause irreversible information loss, leading to loss of vascular features, discontinuous segmentation results, and the potential for "correct semantic classification but spatial location offset." Third, the Transformer architecture heavily relies on positional encoding, easily overfitting the absolute spatial coordinates of the target and neglecting the morphological features of the lesion itself, resulting in insufficient attention to local texture details in complex backgrounds. These shortcomings make it difficult for existing models to meet the actual needs of clinical diagnosis in terms of microvascular segmentation accuracy and optic disc boundary recognition accuracy. Therefore, a more accurate and robust method for retinal vessel and optic disc segmentation is urgently needed. Summary of the Invention
[0005] The purpose of this invention is to propose a method and system for retinal vessel and optic disc segmentation based on multi-dimensional attention and edge enhancement mechanisms, so as to achieve accurate segmentation of retinal vessels and optic disc, improve the ability to identify fine vessel branches and blurred optic disc boundaries and improve generalization performance, and meet the needs of early automated diagnosis of clinical eye diseases.
[0006] According to a first aspect of the embodiments of this disclosure, a method for retinal vessel and optic disc segmentation based on multi-dimensional attention and edge enhancement mechanisms is provided, comprising the following steps: Acquire fundus images and preprocess them; An EIAIU_Net segmentation model based on a CNN-Transformer hybrid architecture is constructed. The model integrates a multi-dimensional attention module (SSA-IAI) and an edge enhancement Transformer module (EETF). The EIAIU_Net segmentation model is trained based on a paired shuffle consistency strategy (PSC). The paired shuffle consistency strategy (PSC) applies a consistency constraint to the fundus image by performing a reversible block-level spatial shuffling operation on the fundus image during the training phase, thereby giving the model the property of reducing its dependence on absolute positional information. The preprocessed fundus image is input into the EIAIU_Net segmentation model, and feature enhancement is performed using the multi-dimensional attention module (SSA-IAI). The multi-dimensional attention module (SSA-IAI) includes a spatial self-attention module (SSA_Conv) and a channel attention module (IAI_Conv). The channel attention module (IAI_Conv) is composed of an inter-channel attention module (Inter_Channel) and an intra-channel attention module (Intra_Channel) in parallel. IAI_Conv achieves complementary fusion of global dependencies and local context by integrating the cross-feature global interaction modeling capability of Inter_Channel with the local detail capture and cross-channel compensation capability of Intra_Channel. The three modules achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic associations, local detail features, and cross-channel dependencies while maintaining the feature space dimension, and outputting multi-dimensional fused features. The edge enhancement Transformer module (EETF) is used to perform boundary enhancement processing on the multi-dimensional fused features. The edge enhancement Transformer module (EETF) adopts a dual-branch structure consisting of an edge prior module and an interactive attention module. The edge prior module extracts multi-scale edge features and projects them into an edge token sequence. The interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that integrate edge prior knowledge. Based on the aforementioned interactive enhancement features, pixel-level segmentation results of retinal vessels and optic disc are generated via the model's output layer.
[0007] In one embodiment, the spatial self-attention module (SSA_Conv) achieves spatial self-attention through convolutional projection and residual connections, establishing global long-distance semantic dependencies while maintaining the feature space dimension. The channel attention module (IAI_Conv) achieves dynamic enhancement of cross-feature semantic associations through the global channel interaction modeling function of the inter-channel attention module (Inter_Channel), and achieves efficient capture of fine-grained local details and maintenance of global consistency through the local window attention and cross-channel compensation functions of the intra-channel attention module (Intra_Channel). The inter-channel attention module (Inter_Channel) fuses self-related information through normalization and relevance branch operations, dynamically adjusts channel weights, and achieves global feature interaction between channels. The intra-channel attention module (Intra_Channel) captures local dependencies within the feature map through a windowed attention mechanism and depthwise separable convolution, and enhances feature representation capabilities by combining a cross-channel compensation mechanism.
[0008] In one embodiment, the edge prior module extracts edge features of different scales through convolution and pooling layers, and then projects the multi-scale edge features into an edge token sequence through 1×1 convolution, thereby realizing the serialized representation of edge features.
[0009] In one embodiment, the injector in the interactive attention module integrates edge structure guidance information into the global semantic features of the Transformer, and the extraction block feeds back the semantically enhanced features to the edge branches, thereby realizing bidirectional information interaction and complementarity between edge features and global Transformer features.
[0010] In one embodiment, the Paired Shaking Consistency Strategy (PSC) divides the fundus image into several blocks and randomly arranges them to generate shuffled variants during the training phase. The original fundus image and the shuffled variants are simultaneously input into all network branches of the model. After encoding, the original spatial order of the encoded labels and multi-scale skip connection features is restored through inverse permutation. Combined with consistency constraints, the model focuses on learning discriminative features of blood vessels and optic discs.
[0011] In one embodiment, the backbone of the EIAIU_Net segmentation model uses a pre-activated ResNet architecture to extract multi-scale semantic features, and the decoding stage uses a U-shaped multi-scale upsampling path. The multi-scale features are then fused through upsampling and skip connections before being input to the output layer.
[0012] In one embodiment, the output layer of the EIAIU_Net segmentation model is a 1×1 convolutional layer, which performs pixel-level mapping of interactive enhancement features through 1×1 convolution to generate pixel-level segmentation results of retinal vessels and optic disc.
[0013] According to a second aspect of the present disclosure, a retinal vessel and optic disc segmentation system based on a multi-dimensional attention and edge enhancement mechanism is provided, comprising: The preprocessing module acquires fundus images and performs preprocessing on them; The model building module is used to construct the EIAIU_Net segmentation model based on the CNN-Transformer hybrid architecture. The model integrates a multi-dimensional attention module (SSA-IAI) and an edge enhancement Transformer module (EETF). The EIAIU_Net segmentation model is trained based on the Paired Shuffle Consistency Strategy (PSC). The Paired Shuffle Consistency Strategy (PSC) gives the model the property of reducing its dependence on absolute positional information by performing a reversible block-level spatial shuffling operation on the fundus image and applying consistency constraints during the training phase. The multi-dimensional feature enhancement module inputs the preprocessed fundus image into the EIAIU_Net segmentation model and uses the multi-dimensional attention module (SSA-IAI) for feature enhancement. The multi-dimensional attention module (SSA-IAI) includes a spatial self-attention module (SSA_Conv) and a channel attention module (IAI_Conv). The channel attention module (IAI_Conv) is composed of an inter-channel attention module (Inter_Channel) and an intra-channel attention module (Intra_Channel) in parallel. IAI_Conv integrates the cross-feature global interaction modeling capability of Inter_Channel with the local detail capture and cross-channel compensation capability of Intra_Channel, achieving complementary fusion of global dependencies and local context. The three modules achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic associations, local detail features, and cross-channel dependencies while maintaining the feature space dimension, and outputting multi-dimensional fused features. The boundary feature enhancement module utilizes the Edge Enhancement Transformer (EETF) module to perform boundary enhancement processing on the multi-dimensional fused features. The Edge Enhancement Transformer (EETF) module adopts a dual-branch structure consisting of an edge prior module and an interactive attention module. The edge prior module extracts multi-scale edge features and projects them into an edge token sequence. The interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that incorporate edge prior knowledge. The segmentation result generation module generates pixel-level segmentation results of retinal vessels and optic discs through the output layer of the model, based on the interactive enhancement features.
[0014] According to a third aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the memory, wherein the processor executes the program to implement the retinal vessel and optic disc segmentation method based on multidimensional attention and edge enhancement mechanism.
[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the retinal vessel and optic disc segmentation method based on a multi-dimensional attention and edge enhancement mechanism.
[0016] The advantages of the above technical solutions adopted in this invention compared with the prior art are as follows: This invention achieves automated and precise segmentation of retinal vessels and the optic disc through the synergistic action of multiple modules, while providing reliable technical support for the auxiliary diagnosis of fundus diseases. Compared with traditional methods, it eliminates the inefficiency and subjectivity of manual annotation, and overcomes the problems of poor adaptability and severe loss of detail in traditional algorithms, significantly improving segmentation efficiency and detail capture capabilities.
[0017] This invention relies on the design of a multi-dimensional attention module and an edge enhancement Transformer module to achieve simultaneous capture of global semantics and local details, enhance the segmentation accuracy of fine blood vessel branches and blurred boundaries of the optic disc, and effectively solve the problems of segmentation and positioning offset and inaccurate boundary recognition.
[0018] The pairing and shuffling consistency strategy in this invention reduces the model's dependence on absolute position information, allowing the model to focus more on the core discriminative features of blood vessels and optic discs, and significantly improves the model's generalization ability under different imaging perspectives and pathological conditions.
[0019] The segmentation results of this invention can directly serve the early automated diagnosis of clinical eye diseases, providing an objective and reliable basis for the accurate diagnosis of fundus diseases such as diabetic retinopathy, glaucoma, and pathological myopia. It perfectly meets the actual clinical needs for early screening and accurate diagnosis of eye diseases, and provides an efficient technical solution for the auxiliary diagnostic system of fundus diseases, possessing significant clinical application value. Attached Figure Description
[0020] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.
[0021] Figure 1This is the overall architecture diagram of the EIAIU_Net network; Figure 2 This is a schematic diagram of the SSA_IAI module structure; Figure 3 This is a schematic diagram of the CNN_Layer module structure; Figure 4 This is a schematic diagram of the SSA_Conv module structure; Figure 5 This is a schematic diagram of the Inter_Channel module structure; Figure 6 This is a schematic diagram of the Intra_Channel module structure; Figure 7 Here is a schematic diagram of the IAI_Conv module structure; Figure 8 This is a schematic diagram of the EETF module structure. Detailed Implementation
[0022] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0024] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0025] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and systems according to various embodiments of this disclosure. It should be noted that each block in a flowchart or block diagram may represent a module, segment, or portion of code, which may include one or more executable instructions for implementing the logical functions specified in the various embodiments. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, may be implemented using a dedicated hardware-based system that performs the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0026] Example 1: This embodiment provides a method for retinal vessel and optic disc segmentation based on multi-dimensional attention and edge enhancement mechanisms, including the following steps: Step S1: Obtain the fundus image to be processed and preprocess it; Specifically, the FIVES and Refuge2 public datasets were selected. The FIVES dataset contains 800 2048×2048 pixel fundus images, covering four scenarios including normal fundus and diabetic retinopathy. The Refuge2 dataset contains 2000 fundus images at different resolutions, acquired by four mainstream fundus cameras. Preprocessing operations such as brightness adjustment, contrast enhancement, and noise filtering were performed on the images to improve image quality.
[0027] The FIVES and Refuge2 datasets were divided into training and test sets in a 9:1 ratio. The training set was used for learning model parameters, and the test set was used to evaluate the model's generalization performance.
[0028] Step S2: Construct the EIAIU_Net segmentation model based on a CNN-Transformer hybrid architecture; the model integrates a multi-dimensional attention module (SSA-IAI) and an edge enhancement Transformer module (EETF); wherein, the model is trained based on the Paired Shake Consistency Strategy (PSC), which performs a reversible block-level spatial shuffling operation on the fundus image during the training phase and applies consistency constraints, giving the model the characteristic of reducing dependence on absolute positional information; forming a collaboratively optimized segmentation framework that takes into account both local detail capture and global context modeling capabilities, effectively solving the problems of detail loss and localization offset in complex lesion images of traditional models.
[0029] Specifically, the EIAIU_Net segmentation model backbone uses pre-activated ResNetV2 to extract multi-scale semantic features. After block1 and block2, the IAI_Conv module is introduced. This module is composed of Intra_Channel and Inter_Channel modules in parallel. The SSA_Conv module is added at the deepest output of the convolutional backbone. An edge enhancement encoder composed of EdgePrior and EdgeEnhancedEncoder is designed, and the PSC strategy is integrated for training constraints. In the decoding stage, a U-shaped multi-scale upsampling path is adopted. Features are fused through bilinear upsampling and skip connections. Finally, pixel-level predictions are generated through 1×1 convolution.
[0030] The model was trained using the StochGradAdam optimizer with an initial learning rate of 9.1e-4, a batch size of 2, and 200 training iterations for both the FIVES and Refuge2 datasets. The weighted sum of cross-entropy loss (CE) and dice loss (Dice) was used as the loss function, and the smoothing factor was set to 1 to avoid the denominator being zero.
[0031] Preferably, during the training phase, the fundus image is divided into n×n blocks and randomly arranged to generate mixed variants, which are simultaneously fed into all network branches along with the original fundus image. This ensures that vascular texture, optic disc boundary information, and global context are jointly modeled in a consistent perturbation space. After encoding, the original spatial order of the encoded labels and multi-scale skip connection features is restored through inverse permutation. Combined with consistency constraints, the model focuses on discriminative features such as vascular continuity, bifurcation morphology, and optic disc boundary, rather than absolute positional information. This improves the generalization performance under different visual fields and pathological conditions without increasing the computational overhead of the inference phase.
[0032] Step S3: Input the preprocessed fundus image into the EIAIU_Net segmentation model and perform feature enhancement using the multi-dimensional attention module (SSA-IAI). The multi-dimensional attention module (SSA-IAI) includes a spatial self-attention module (SSA_Conv) and a channel attention module (IAI_Conv). The channel attention module (IAI_Conv) is composed of an inter-channel attention module (Inter_Channel) and an intra-channel attention module (Intra_Channel) in parallel. IAI_Conv integrates the cross-feature global interaction modeling capability of Inter_Channel with the local detail capture and cross-channel compensation capability of Intra_Channel, achieving complementary fusion of global dependencies and local context. The three achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic associations, local detail features, and cross-channel dependencies while maintaining the feature space dimension, and outputting multi-dimensional fused features. This balances computational efficiency and feature representation capability, improving the recognition accuracy of fine blood vessel branches and blurred optic disc boundaries.
[0033] Specifically, SSA_Conv achieves spatial self-attention through convolutional projection and residual connections, establishing long-distance dependencies while maintaining the feature space dimension. Inter_Channel focuses on global interactions between channels, fusing self-related information through IAI_LayerNorm normalization and correlation branch operations to dynamically adjust channel weights. Intra_Channel captures local dependencies within feature maps through windowed attention mechanisms and depthwise separable convolutions, enhancing expressiveness by combining cross-channel compensation mechanisms and learning-optimized parameters. These three mechanisms synergistically enhance feature representation through residual fusion, achieving multi-dimensional feature complementarity and multi-scale coverage, balancing computational efficiency with detail capture capabilities. Step S4: The multi-dimensional fused features are enhanced using the Edge Enhancement Transformer (EETF) module. The Edge Enhancement Transformer (EETF) module adopts a dual-branch structure consisting of an edge prior module and an interactive attention module. The edge prior module extracts multi-scale edge features and projects them into an edge token sequence. The interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that incorporate edge prior knowledge. This alleviates the problem of detail loss and positioning offset caused by downsampling and enhances the ability to capture the continuity of blood vessels and the optic disc contour.
[0034] Specifically, the edge prior module extracts multi-scale edge features of 4×, 8×, 16×, and 32× through four convolutional and pooling layers, and projects them into an edge token sequence through 1×1 convolution. The interactive attention module realizes bidirectional information flow between edge features and Transformer features through an injector and an extractor. The injector integrates edge structure guidance information into semantic features, and the extractor feeds back semantic enhancement features to the edge branch through deformable multi-scale attention and a convolutional feedforward network (ConvFFN), thereby enhancing the accuracy and robustness of boundary region segmentation.
[0035] Step S5: Based on the interaction enhancement features, generate pixel-level segmentation results of retinal vessels and optic disc via the output layer of the model.
[0036] The trained model was tested on the test set and compared with 10 mainstream models such as UNet, Attn-UNet, TransUNet, and SwinUNet. Evaluation metrics included Precision, Recall, IoU, and Dice.
[0037] Experimental results show that EIAIU_Net performs excellently on both the FIVES and Refuge2 datasets: on the FIVES dataset, Recall reaches 83.18%, IoU reaches 68.93%, and Dice reaches 81.60%; on the Refuge2 dataset, Recall reaches 96.38%, IoU reaches 91.92%, and Dice reaches 95.79%. The core metrics are all superior to the mainstream models compared, and it can accurately segment fine blood vessel branches and blurred optic disc regions in complex backgrounds.
[0038] Table 1 Performance comparison of different models on the Fives dataset Table 2 Performance comparison of different models on the Refuge2 dataset It is worth noting that EIAIU_Net significantly improves the ability to identify fine blood vessels and blurred boundaries while maintaining segmentation accuracy through multi-module collaborative optimization. Although its precision index is slightly lower than some comparative models on some datasets, its overall segmentation performance and clinical application value are better, providing reliable technical support for the automated diagnosis of eye diseases.
[0039] This invention possesses excellent practicality and scalability. By reasonably adjusting model parameters, module structure, and dataset size, the model's performance and adaptability can be further improved. It not only provides strong support for the early diagnosis of ophthalmic diseases but also offers objective evidence for monitoring disease progression and evaluating treatment effectiveness, thus possessing significant clinical application value.
[0040] Example 2: This embodiment provides a retinal vessel and optic disc segmentation system based on multi-dimensional attention and edge enhancement mechanisms, including: The preprocessing module acquires fundus images and performs preprocessing on them; The model building module is used to construct the EIAIU_Net segmentation model based on the CNN-Transformer hybrid architecture. The model integrates a multi-dimensional attention module (SSA-IAI) and an edge enhancement Transformer module (EETF). The EIAIU_Net segmentation model is trained based on the Paired Shuffle Consistency Strategy (PSC). The Paired Shuffle Consistency Strategy (PSC) gives the model the property of reducing its dependence on absolute positional information by performing a reversible block-level spatial shuffling operation on the fundus image and applying consistency constraints during the training phase. The multi-dimensional feature enhancement module inputs the preprocessed fundus image into the EIAIU_Net segmentation model and uses the multi-dimensional attention module (SSA-IAI) for feature enhancement. The multi-dimensional attention module (SSA-IAI) includes a spatial self-attention module (SSA_Conv) and a channel attention module (IAI_Conv). The channel attention module (IAI_Conv) is composed of an inter-channel attention module (Inter_Channel) and an intra-channel attention module (Intra_Channel) in parallel. IAI_Conv integrates the cross-feature global interaction modeling capability of Inter_Channel with the local detail capture and cross-channel compensation capability of Intra_Channel, achieving complementary fusion of global dependencies and local context. The three modules achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic associations, local detail features, and cross-channel dependencies while maintaining the feature space dimension, and outputting multi-dimensional fused features. The boundary feature enhancement module utilizes the Edge Enhancement Transformer (EETF) module to perform boundary enhancement processing on the multi-dimensional fused features. The Edge Enhancement Transformer (EETF) module adopts a dual-branch structure consisting of an edge prior module and an interactive attention module. The edge prior module extracts multi-scale edge features and projects them into an edge token sequence. The interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that incorporate edge prior knowledge. The segmentation result generation module generates pixel-level segmentation results of retinal vessels and optic discs through the output layer of the model, based on the interactive enhancement features.
[0041] The above modules can be deployed on the same device or distributed devices; the division of modules is only a functional logic description and does not limit the specific physical boundaries or implementation order.
[0042] Example 3: An electronic device is provided for running the aforementioned "retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism". The electronic device includes: a processor, a memory, and optional communication interface / display device / input device, etc.; the memory stores a computer program that can run on the processor, and when the processor executes the program, it implements steps S1 to S5 of the method described in Embodiment 1, specifically including but not limited to: S1. Acquire fundus images and preprocess them; S2. Construct an EIAIU_Net segmentation model based on a CNN-Transformer hybrid architecture; the model integrates a multi-dimensional attention module (SSA-IAI) and an edge enhancement Transformer module (EETF); wherein, the EIAIU_Net segmentation model is trained based on a paired shuffle consistency strategy (PSC), which gives the model the property of reducing its dependence on absolute position information by performing a reversible block-level spatial shuffling operation on the fundus image and applying consistency constraints during the training phase; S3. Input the preprocessed fundus image into the EIAIU_Net segmentation model and perform feature enhancement using the multi-dimensional attention module (SSA-IAI). The multi-dimensional attention module (SSA-IAI) includes a spatial self-attention module (SSA_Conv) and a channel attention module (IAI_Conv). The channel attention module (IAI_Conv) is composed of an inter-channel attention module (Inter_Channel) and an intra-channel attention module (Intra_Channel) in parallel. IAI_Conv integrates the cross-feature global interaction modeling capability of Inter_Channel with the local detail capture and cross-channel compensation capability of Intra_Channel, achieving complementary fusion of global dependencies and local context. The three components achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic associations, local detail features, and cross-channel dependencies while maintaining the feature space dimension, and outputting multi-dimensional fused features. S4. The edge enhancement Transformer module (EETF) is used to perform boundary enhancement processing on the multi-dimensional fused features; the edge enhancement Transformer module (EETF) adopts a dual-branch structure consisting of an edge prior module and an interactive attention module; wherein, the edge prior module extracts multi-scale edge features and projects them into an edge token sequence; the interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that integrate edge prior knowledge; S5. Based on the aforementioned interactive enhancement features, pixel-level segmentation results of retinal vessels and optic disc are generated via the model's output layer.
[0043] The electronic device hardware can be one of a server, personal computer, workstation, industrial controller, edge computing device, or mobile terminal; the processor can be a general-purpose CPU, GPU, NPU, FPGA, or a combination thereof; the memory can be RAM, ROM, flash memory, or disk array. The device can interact with local / remote data storage (acquiring observation data and outputting inversion results) through a communication interface. The above hardware configuration does not constitute a limitation of the present invention.
[0044] Example 4: A computer-readable storage medium storing a computer program, which, when run on a processor of an electronic device, causes the program to execute the method steps S1 to S5 described in Embodiment 1; the storage medium may be a disk, optical disk, flash memory, solid-state drive, read-only memory, random access memory, or any combination of the above media.
[0045] Those skilled in the art will understand that the modules or steps described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, which can then be stored in a storage device for execution by a computer device. Alternatively, they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. This disclosure is not limited to any particular combination of hardware and software.
[0046] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0047] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. A method for retinal vessel and optic disc segmentation based on multi-dimensional attention and edge enhancement mechanisms, characterized in that, Includes the following steps: Acquire fundus images and preprocess them; An EIAIU_Net segmentation model based on a CNN-Transformer hybrid architecture is constructed. The model integrates a multi-dimensional attention module and an edge enhancement Transformer module. The EIAIU_Net segmentation model is trained based on a paired shuffle consistency strategy. The paired shuffle consistency strategy performs a reversible block-level spatial shuffle operation on the fundus image and applies consistency constraints during the training phase, thereby giving the model the property of reducing its dependence on absolute position information. The preprocessed fundus image is input into the EIAIU_Net segmentation model, and feature enhancement is performed using the multi-dimensional attention module. The multi-dimensional attention module includes a spatial self-attention module and a channel attention module. Channel attention is composed of parallel inter-channel attention and intra-channel attention. By integrating the cross-feature global interaction modeling capability of inter-channel attention with the local detail capture and cross-channel compensation capability of intra-channel attention, the complementary fusion of global dependency and local context is achieved. The three components achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic association, local detail features, and cross-channel dependency while maintaining the feature space dimension, and outputting multi-dimensional fused features. The edge enhancement Transformer module is used to perform boundary enhancement processing on the multi-dimensional fused features. The edge enhancement Transformer module adopts a dual-branch structure consisting of an edge prior module and an interactive attention module. The edge prior module extracts multi-scale edge features and projects them into an edge token sequence. The interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that integrate edge prior knowledge. Based on the aforementioned interactive enhancement features, pixel-level segmentation results of retinal vessels and optic disc are generated via the model's output layer.
2. The retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism according to claim 1, characterized in that, The spatial self-attention module achieves spatial self-attention through convolutional projection and residual connections, establishing global long-distance semantic dependencies while maintaining the feature space dimension. The channel attention module achieves dynamic enhancement of cross-feature semantic associations through the global channel interaction modeling function of the inter-channel attention module, while achieving efficient capture of fine-grained local details and maintenance of global consistency through the local window attention and cross-channel compensation functions of the intra-channel attention module. The inter-channel attention module fuses self-related information through normalization and relevance branch operations, dynamically adjusts channel weights, and achieves global feature interaction between channels. The in-channel attention module captures local dependencies within the feature map through a windowed attention mechanism and depthwise separable convolution, and enhances feature representation capabilities by combining a cross-channel compensation mechanism.
3. The retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism according to claim 1, characterized in that, The edge prior module extracts edge features at different scales through convolution and pooling layers, and then projects the multi-scale edge features into an edge token sequence through 1×1 convolution, thereby realizing the serialized representation of edge features.
4. The retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism according to claim 1, characterized in that, The injector in the interactive attention module integrates edge structure guidance information into the global semantic features of the Transformer, and the extraction block feeds back the semantically enhanced features to the edge branches, realizing bidirectional information interaction and complementarity between edge features and global Transformer features.
5. The retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism according to claim 1, characterized in that, The paired shuffling consistency strategy divides the fundus image into several blocks and randomly arranges them to generate shuffling variants during the training phase. The original fundus image and the shuffling variants are simultaneously input into all network branches of the model. After encoding, the original spatial order of the encoded labels and multi-scale skip connection features is restored through inverse permutation. Combined with consistency constraints, the model focuses on learning the discriminative features of blood vessels and optic discs.
6. The retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism according to claim 1, characterized in that, The backbone of the EIAIU_Net segmentation model uses a pre-activated ResNet architecture to extract multi-scale semantic features. In the decoding stage, a U-shaped multi-scale upsampling path is used. Multi-scale features are then fused through upsampling and skip connections before being input to the output layer.
7. The retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism according to claim 1, characterized in that, The output layer of the EIAIU_Net segmentation model is a 1×1 convolutional layer. The interactive enhancement features are mapped at the pixel level through 1×1 convolution to generate pixel-level segmentation results for retinal vessels and optic disc.
8. A retinal vessel and optic disc segmentation system based on multi-dimensional attention and edge enhancement mechanisms, characterized in that, include: The preprocessing module acquires fundus images and performs preprocessing on them; The model building module is used to construct the EIAIU_Net segmentation model based on the CNN-Transformer hybrid architecture. The model integrates a multi-dimensional attention module and an edge enhancement Transformer module. The EIAIU_Net segmentation model is trained based on a paired shuffle consistency strategy. The paired shuffle consistency strategy performs a reversible block-level spatial shuffle operation on the fundus image and applies consistency constraints during the training phase, which gives the model the characteristic of reducing its dependence on absolute position information. The multi-dimensional feature enhancement module inputs the preprocessed fundus image into the EIAIU_Net segmentation model and uses the multi-dimensional attention module for feature enhancement. The multi-dimensional attention module includes a spatial self-attention module and a channel attention module. Channel attention is composed of parallel inter-channel attention and intra-channel attention. By integrating the cross-feature global interaction modeling capability of inter-channel attention with the local detail capture and cross-channel compensation capability of intra-channel attention, channel attention achieves complementary fusion of global dependencies and local context. The three modules achieve multi-dimensional feature complementarity through residual fusion, simultaneously capturing global semantic associations, local detail features, and cross-channel dependencies while maintaining the feature space dimension, and outputting multi-dimensional fused features. The boundary feature enhancement module utilizes the edge enhancement Transformer module to perform boundary enhancement processing on the multi-dimensional fused features. The edge enhancement Transformer module adopts a dual-branch structure consisting of an edge prior module and an interactive attention module. The edge prior module extracts multi-scale edge features and projects them into an edge token sequence. The interactive attention module uses the edge token sequence to perform bidirectional information interaction with the global features of the Transformer, thereby generating interactive enhancement features that integrate edge prior knowledge. The segmentation result generation module generates pixel-level segmentation results of retinal vessels and optic discs through the output layer of the model based on the interactive enhancement features.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and running thereon, characterized in that, When the processor executes the program, it implements the retinal vessel and optic disc segmentation method based on multi-dimensional attention and edge enhancement mechanism as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the retinal vessel and optic disc segmentation method based on multidimensional attention and edge enhancement mechanism as described in any one of claims 1-7.