A method and system for segmenting retinal hard exudates based on DEAM and GPCA
By introducing a dual-domain Euler attention module and a geometric phase context aggregator, combined with a three-view equalization loss, the problem of segmenting tiny hard exudates in retinal lesion images was solved, achieving high-precision lesion identification and localization.
Patent Information
- Application Number
- CN202610380616.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-30
Smart Images

Figure CN122312666A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target detection technology, and specifically relates to a method and system for segmenting retinal hard exudates based on DEAM and GPCA. Background Technology
[0002] Hard exudates in the fundus are key biomarkers for the diagnosis and grading of diabetic retinopathy (DR). Although typical hard exudates appear as bright yellow-white patches in fundus images and seem easily identifiable, this often corresponds to the more severe stage of exudative fusion. In the early or progressive stages of DR, a large number of hard exudates actually exist as micro-dots or scattered distributions, with a diameter that may only occupy a few pixels. Due to uneven fundus illumination or lens opacity, these tiny lesions have extremely low contrast and are easily submerged in the complex retinal background. However, it is precisely these micro-exudates, which are difficult to detect with the naked eye, that are often sentinel signals of retinal disease deterioration. Therefore, the focus of automatic segmentation is to solve the pixel-level segmentation problem of low-contrast micro-lesions, rather than just focusing on large, prominent patches.
[0003] Early hard exudate segmentation relied primarily on traditional image processing operators or machine learning classifiers based on handcrafted features. However, these non-end-to-end methods heavily depended on tedious feature engineering and had limited generalization capabilities. With the rise of deep learning, U-Net, with its encoder-decoder structure, established the mainstream paradigm in this field. To overcome the shortcomings of basic U-Net in extracting features from small lesions, subsequent research focused on attention mechanisms and multi-scale feature fusion. For example, MCA-UNet enhanced feature interaction using multi-scale cross-attention, while Exu-Eye and PMCNet improved adaptability to lesion scale variations by refining the network topology. Furthermore, MDES-Net, proposed by Li Bo et al., further enhanced the model's ability to capture fine edges of hard exudates through multi-scale dual encoders and enhanced skip connections. On the other hand, addressing the high similarity between hard exudates and the background, Tang et al. introduced a supervised contrastive learning mechanism, which significantly enhanced the model's ability to distinguish small lesions by narrowing the distance between similar features and widening the distance between dissimilar features. Liu et al. proposed a dual-branch network architecture and combined it with a double-sample modulation loss function, aiming to alleviate the severe pixel-level class imbalance problem in small object segmentation.
[0004] Despite significant advancements in deep learning methods, traditional convolutional neural networks (CNNs) remain constrained by both mathematical principles and pathological logic when dealing with the specific task of identifying hard exudates. First, the blind spot in feature attributes stems from the fact that standard convolution is essentially a scalar weighted summation operation. While this approach can extract spatial texture, it struggles to decouple signal amplitude and phase in the frequency domain, preventing the model from accurately capturing the fine edges of low-contrast, minute lesions using phase information. Second, the blind spot in spatial location arises because the inherent translation invariance of convolutional networks becomes a disadvantage in the context of fundus anatomy. Since the determination of hard exudates highly depends on their absolute coordinates relative to the fovea, i.e., the regional risk differences defined by the ETDRS standard, location awareness is crucial. Lacking the ability to perceive absolute anatomical location, the network struggles to distinguish between true lesions located in the high-risk macular region and similar artifacts in the optic disc region. This impasse of "neither seeing the essence clearly nor accurately locating the position" fundamentally limits breakthroughs in segmentation accuracy.
[0005] Therefore, the core bottlenecks in automatic segmentation of hard exudates can be summarized in three aspects: first, insufficient feature expression of small and low-contrast lesions; second, spatial localization loss in complex anatomical backgrounds; and third, training gradient imbalance caused by extreme pixel-level class imbalance. Summary of the Invention
[0006] In order to overcome the shortcomings of the prior art, the present invention aims to provide a method and system for segmenting hard retinal exudates based on DEAM and GPCA, so as to solve the problem that hard exudates are difficult to detect and accurately locate in images of retinal lesions.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for segmenting retinal hard exudates based on DEAM and GPCA includes the following steps: Step 1: Obtain the image dataset of diabetic retinopathy; Step 2: Construct a segmentation network. The segmentation network adopts an encoder-decoder architecture, embedding a dual-domain Euler attention module in the skip connection path between the encoder and decoder, and introducing a geometric phase context aggregator in the deepest layer of the encoder. The encoder extracts multi-scale hierarchical features from the original image. The dual-domain Euler attention module decouples the features from the first to the (N-1)th layers from the real domain to the amplitude and phase domains, respectively, then performs vectorized reconstruction of the features, followed by dual-domain feature fusion, and finally dual attention refinement and residual preservation to obtain enhanced features. The geometric phase context aggregator injects learnable absolute 2D geometric position codes into the features of the Nth layer and generates direction-aware features using a parallel phase modulation mechanism. Finally, it dynamically aggregates the context to generate the final features. The decoder gradually restores the spatial resolution of the features through upsampling and fuses them with the enhanced features. Step 3: Train the segmentation network using the dataset, and use the trained segmentation network to segment hard exudates in diabetic retinopathy images.
[0008] According to the above technical solution, this invention employs a high-precision segmentation network (DG-Net) that integrates frequency domain attribute enhancement and spatial domain geometric prior. By introducing a dual-domain Euler attention module (DEAM), Euler's formula is applied to the feature space to achieve vectorized operations, thereby effectively capturing lesion intensity and fine edges. By introducing a geometric phase context aggregator (GPCA), false positives in the optic disc region are significantly suppressed using anatomical geometric priors. Furthermore, a three-view equalization loss (TPEL) is used, employing a Nash equalization strategy to coordinate pixel, region, and global gradient flows, addressing gradient fluctuations in the early stages of training and ensuring boundary convergence. Ultimately, this invention achieves high-precision segmentation and localization based on functional orthogonality and synergistic effects.
[0009] Compared with the prior art, the specific beneficial effects of the present invention are: The main contributions of this invention are as follows: (1) This invention introduces a dual-domain Euler attention module (DEAM). Addressing the problem of insufficient representation of fine-grained structures by traditional scalar convolution, this module expands the feature representation into two complementary components: amplitude and phase, achieving frequency domain decoupled modeling. The amplitude component enhances the saliency response of the lesion region, while the phase component strengthens the edge and orientation structures of small lesions, thereby improving the identification capability of low-contrast, small-scale lesions.
[0010] (2) This invention introduces a geometric phase context aggregator (GPCA) that is aware of anatomical structures. To address the problem of hard exudates being easily confused with high-brightness structures such as the optic disc, a learnable two-dimensional coordinate embedding is introduced as a structural prior, enabling the network to possess explicit spatial location awareness. This mechanism helps to utilize the anatomical distribution patterns of the retina and suppress false detections of non-lesion areas.
[0011] (3) This invention adopts a gradient equalization-based three-view loss function (TPEL). To address the optimization bias problem caused by extreme pixel-level class imbalance, the gradient contributions of pixel-level, region-level and global-level objectives are dynamically coordinated to achieve collaborative updates of multi-level optimization objectives, thereby achieving a stable balance between hard example mining and boundary refinement.
[0012] Experiments on the IDRID dataset show that the DG-Net of this invention achieves 61.14% IoU, 75.92% Sensitivity, and 77.81% Precision. In comparison, the classic model U-Net++ only achieves 59.26% IoU and 74.15% Sensitivity, while TransUNet's IoU is only 55.93%. Furthermore, DG-Net also surpasses the specifically designed Dual-Branch Network (73.01%) in overall performance (Dice 74.78%), demonstrating its dual advantages in lesion detection and false positive suppression.
[0013] Meanwhile, ablation experiments confirmed the effectiveness of each module in improving segmentation accuracy and robustness. DG-Net can achieve synergistic enhancements in the identification of small, low-contrast lesions, suppression of complex anatomical backgrounds, and pixel-level class imbalance optimization, providing reliable technical support for clinical DR-assisted diagnosis. Attached Figure Description
[0014] Figure 1 This is a diagram of the overall network architecture of DG-Net.
[0015] Figure 2 This is a schematic diagram of the dual-domain Euler attention module (DEAM).
[0016] Figure 3 This is a schematic diagram of the Geometric Phase Context Aggregator (GPCA) structure.
[0017] Figure 4 This is a graph showing the gradient dynamics analysis of TPEL.
[0018] Figure 5The test results of each method on the IDRID dataset are shown in the left figure, which is the ROC curve and the right figure is the precision-recall (PR) curve.
[0019] Figure 6 The image shows a comparison of the t-SNE feature distributions, with the left image representing Resnet-unet and the right image representing the present invention.
[0020] Figure 7 Comparison of qualitative segmentation results on the IDRID dataset.
[0021] Figure 8 Visualization of DEAM features (raw input).
[0022] Figure 9 Visualization of DEAM characteristics (amplitude response).
[0023] Figure 10 Visualization of DEAM features (phase response). Detailed Implementation
[0024] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings and examples.
[0025] Automatic segmentation of hard exudates in fundus images still faces three major challenges: the difficulty in perceiving small and low-contrast lesions, the significant interference from complex anatomical backgrounds (such as the optic disc region), and the training imbalance caused by extreme pixel-level class imbalance.
[0026] Therefore, this invention provides a method for segmenting retinal hard exudates based on DEAM and GPCA, which mainly includes the following steps: Step 1: Obtain the image dataset of diabetic retinopathy.
[0027] For example, the dataset of this invention can be directly adopted from the publicly available IDRiD dataset, or constructed through clinical image acquisition; the resolution of the images in the dataset should be able to preserve the texture details of extremely small hard exudates, and include diabetic retinopathy samples of various severities, with lesion morphology ranging from punctate to large ring-shaped areas.
[0028] Step 2: Construct the segmentation network.
[0029] The segmentation network DG-Net proposed in this invention aims to solve the problems of feature attribute ambiguity and spatial localization loss in hard exudate segmentation by adopting an architecture design that combines frequency domain attribute enhancement and spatial geometric prior, based on functional orthogonality and synergistic effects. Figure 1As shown, DG-Net is built on the classic encoder-decoder skeleton. Its core innovation lies in decoupling the segmentation task into two functionally orthogonal dimensions: reconstructing features in the frequency domain using a dual-domain Euler attention module (DEAM), and anchoring the anatomical location in the spatial domain using a geometric phase context aggregator (GPCA). Furthermore, to address the gradient-dominated problem caused by extreme sample imbalance, this invention designs a three-view equalization loss (TPEL) to drive the network's optimization process. In one embodiment, its overall architecture is described as follows: First, the network can use common models such as ResNet-50 as the backbone encoder, responsible for extracting multi-scale hierarchical features from the raw fundus images. Given the small size and blurred edges of hard exudates, traditional direct skip connections often introduce significant background noise. Therefore, this invention embeds a DEAM (Deep Alignment Module) in the skip connection path between the encoder and decoder. This module decouples features from the real domain to the amplitude and phase domains, then performs vectorized feature reconstruction, followed by dual-domain feature fusion, and finally dual attention refinement and residual preservation to obtain enhanced features. This allows the saliency of shallow high-resolution features (captured by amplitude) and edge texture (captured by phase) to be explicitly enhanced before being passed to the decoder. Preferably, assuming the encoder has N layers, DEAM is embedded in the skip connection paths from the first layer to the (N-1)th layer, except for the last layer.
[0030] Secondly, to address the optic disc confusion problem caused by the loss of absolute positional information in deep semantic features, this invention introduces GPCA in the deepest layer (i.e., the Nth layer) of the encoder. Unlike traditional methods that only focus on the aggregation of semantic context, GPCA injects learnable absolute 2D geometric positional encoding into the input feature map and uses a parallel phase modulation mechanism to generate orientation-aware features. Finally, it dynamically aggregates the context to generate the final features. This design is equivalent to implanting an "anatomical coordinate system" into the highly abstract deep features, enabling the network to verify the validity of the features based on the structural distribution of the retina (such as the absolute distance from the macula), thereby eliminating false positive responses located in non-lesion areas such as the optic disc from the root cause.
[0031] Finally, the decoder gradually restores the spatial resolution of the features through upsampling and fuses them with the features enhanced by DEAM.
[0032] Furthermore, such as Figure 2 As shown, a detailed introduction to the DEAM (Dual-Domain Euler Attention Module) of this invention is provided.
[0033] Existing convolutional neural networks typically treat feature maps as scalar fields, meaning each pixel's activation intensity is represented by only one real value. While this scalar representation can capture macroscopic semantic information, it often loses crucial frequency domain properties (such as texture directionality and high-frequency edge variations) when processing small lesions with low contrast and weak edges, like hard exudates. To overcome this limitation, inspired by Euler's formula in signal processing to decouple real signals into amplitude and phase, this invention proposes a dual-domain Euler attention module (DEAM). DEAM aims to achieve "vectorized" reconstruction during the feature extraction stage, decoupling features into amplitude and phase domains, thereby uncovering the essential properties of lesions in complex space.
[0034] Figure 2 The upper left and middle yellow areas illustrate the process and principle of decoupling features from the real domain to the amplitude and phase domains, for input features. DEAM at the level ( ) and vertical ( In two orthogonal directions, through parallel Convolution decouples it into the amplitude domain and the phase domain, as expressed by the following formula: in, and They represent Amplitude and phase diagram in the direction, It can characterize the significance intensity, while Capable of characterizing fine edges, Indicates the kernel size as Convolution operation, Indicates batch normalization, For the Sigmoid activation function, For ReLU function, It represents two orthogonal directions: horizontal and vertical.
[0035] Figure 2 The middle section illustrates the process and principle of Euler vectorization reconstruction, which is the core innovation of DEAM. Traditional attention mechanisms typically directly weight features (Attn × Feature), which is still a scalar operation. In this invention, Euler's formula is utilized... The decoupled amplitude and phase are recombined into vector features in the complex domain. Specifically, the phase features ( ) was sent to and Activate the node, then multiply element by element (in the diagram). ) and amplitude characteristics ( The features are cross-modulated and then concatenated along the channel dimension (© in the figure). This demonstrates the operation of using Euler's formula to raise the dimension of features to the complex domain, as expressed by the formula: Through this step, the features are upgraded from scalar space to complex vector space, enabling the network to simultaneously utilize the "modulus" of amplitude to enhance the saliency of lesions and utilize the "angle" of phase to keenly capture the edge gradient of small lesions, thus achieving a qualitative change in feature expression.
[0036] Subsequently, the features are convolved using a large kernel transformation ( ) and channel branches ( The convergence of these features generates the Euler fusion characteristic. This achieves dual-domain feature fusion, expressed by the following formula: In the formula, express Vector features recombined based on Euler's formula in the direction. This indicates a splicing operation along the channel dimension. This indicates element-wise multiplication. This is a characteristic of Euler fusion. and These represent the transform convolutions in the horizontal and vertical directions, respectively. This is the channel convolution branch.
[0037] Figure 2 The lower half illustrates the process and principle of dual attention refinement and residual preservation, integrating Euler fusion features. It is divided into two paths, with the left side being the channel attention branch and the right side being the spatial attention branch.
[0038] In the channel attention branch, weights are generated through global pooling and MLP. The features obtained as follows: in, Indicates global average pooling. Indicates global max pooling; In the spatial attention branch, structural weights are generated by concatenating and convolving statistical features. The features obtained as follows: in, For activation function, These represent the average, maximum, minimum, and sum of the input values, respectively.
[0039] Figure 2 On the far right is a long residual line that runs through the entire network. This indicates that the input features... Add to the refined features (in the image) This ensures that the original anatomical information is not lost, and the formula is expressed as follows: That is, the enhanced features.
[0040] Through this process, DEAM successfully injects high-frequency details from the frequency domain into spatial features without loss, significantly improving the network's ability to perceive minute hard exudates.
[0041] Furthermore, such as Figure 3 As shown, a detailed introduction to the GPCA (Geo-Phase Context Aggregator) of this invention is provided.
[0042] While CNNs possess powerful feature extraction capabilities, their translation invariance still has limitations in hard exudate segmentation tasks: although they can identify textures that "look like exudates," they cannot determine whether these textures are "located in a reasonable anatomical position." For example, highlighted areas of the optic disc are often misidentified as hard exudates. To address this issue, this invention proposes a Geometric Phase Context Aggregator (GPCA). Figure 3 As shown, GPCA injects learnable absolute geometric coordinates and introduces a phase modulation mechanism to dynamically aggregate context, thus endowing the network with the ability to perceive the anatomy.
[0043] Figure 3 The upper part illustrates the process and principle of geometric prior injection. Unlike the relative position encoding or dynamic interpolation encoding commonly used in Transformers, the distribution of hard exudates has strict anatomical constraints (such as absolute distances defined by ETDRS meshes). To implant this prior knowledge into the network, this invention introduces fixed, learnable absolute position encoding at the bottleneck layer of the encoder.
[0044] To enable the network to have absolute anatomical position awareness, learnable two-dimensional absolute geometric coordinates ( Direct injection (in the diagram) Nodes to Input Features In this process, the geometric phase context aggregator injects learnable absolute 2D geometric position codes into the features of the Nth layer. The injection process can be represented as broadcast addition, as shown in the following formula: In the formula, This represents the features after injecting geometric priors. For the features of the Nth layer of the encoder, , and These are two learnable geometric parameter tensors, representing the absolute coordinate fields in the vertical and horizontal directions, respectively, which are continuously updated during training. and , This represents a broadcast operation that expands a tensor along a specific dimension. It is continuously updated during training. and The network can explicitly "memorize" the anatomical structure of the retina (e.g., learn that the left side of an image is usually the optic disc and the center is usually the macula). This mechanism allows the network to use coordinate information as a hard constraint during inference: even if a texture closely resembles a lesion, the network can suppress it based on geometric priors if its coordinates indicate that it is located in the optic disc region.
[0045] Figure 3 The middle section illustrates the process and principle of generating direction-aware features through parallel phase modulation. Traditional self-attention mechanisms are computationally intensive, while this invention uses phase angles to modulate the aggregation weights of features. Specifically, this invention incorporates coordinate information... It is divided into three paths. Two of these paths are fed into the horizontal branch and the vertical branch respectively to extract the amplitude. With modulation angle And in the figure and Cross-multiplication at nodes ( ( ) and splicing (©), calculating intermediate features The formula is expressed as follows: In the formula and In effect, they act as dynamic gating mechanisms, based on geometric position information (implied in...) (middle) to regulate features The transmission intensity. This "geometry-phase" collaborative mechanism ensures that the network can fully consider the rationality of the anatomical location when aggregating long-range contexts, thereby achieving accurate localization of hard exudates and rejection of false positives.
[0046] Subsequently, the intermediate features are passed through a large-kernel depth-separable convolution ( and ), generating direction-aware features for horizontal and vertical branches and The formula is expressed as follows: in and convolution kernel and Depth-separable convolutions.
[0047] The third route, passing through Convolution yields This is used for subsequent dynamic aggregation.
[0048] Figure 3 The lower part of the diagram illustrates the process and principle behind the dynamic aggregation context generating the final features, which is the core dynamic routing mechanism of GPCA. (See the box below the diagram.) First, the weights are aggregated and summed, then passed through Global Average Pooling (GAP), Multilayer Perceptron (MLP), and the Softmax function. This generates three downward-pointing lines in the graph, representing the dynamic weights. : Finally, these three sets of weights are at the bottom three multiplication nodes ( At each point, adaptive weighting is applied to their respective feature branches, and the results are converged. Generate final features The formula is expressed as follows: Step 3: Use the dataset from Step 1 to train the segmentation network from Step 2, and use the trained segmentation network to segment hard exudates in diabetic retinopathy images.
[0049] Because hard exudates account for an extremely small percentage of pixels in fundus images (typically less than 1%), the traditional cross-entropy loss function is easily dominated by a large number of negative background samples, causing the network to converge to a local optimum of "all-black prediction". To address this extreme pixel-level class imbalance problem and balance hard example discovery with boundary refinement, this invention proposes a Tri-Perspective Equilibrium Loss (TPEL) based on gradient dynamics analysis. During training, the network output is supervised by the TPEL loss function, which coordinates the gradient flows from pixel, region, and global perspectives through a Nash equalization strategy, ensuring robust convergence even when dealing with extremely imbalanced samples.
[0050] From a microscopic perspective of pixel classification, this invention requires reducing the weight of simple background samples, forcing the model to focus on those tiny, difficult-to-distinguish lesion pixels. To this end, this invention employs Focal loss. For the difficult example, the formula is: in It is a prediction probability. It is the focusing parameter (set to 4 in this invention). It is the balance factor (set to 0.8 in this invention). From the perspective of gradient dynamics, In the early stages of training, this method can generate high-intensity gradient signals, quickly pushing the model out of local minima and focusing on discovering difficult examples that it "cannot do".
[0051] From a mesoscopic perspective of overlapping regions, Focal loss is insufficient in constraining the smoothness within lesions. Therefore, this invention introduces the Dice loss responsible region to directly optimize the predicted region. With the real mask The similarity between sets, and Representing the model for the first i The predicted value and the true label value of each pixel. It is a very small smoothing coefficient used to prevent the denominator from being zero.
[0052] Dice Loss has relatively gentle gradient characteristics and mainly plays a role in the middle of training, guiding the network to fill the holes inside the lesions and ensuring the integrity of the segmented regions.
[0053] From a macro perspective, IoU is the ultimate evaluation metric. To bridge the gap between the training objective and the evaluation metric, this invention introduces a SoftIoU loss to handle the overall picture and reflect global alignment: Similarly, It is a very small smoothing coefficient used to prevent the denominator from being zero. The SoftIoU loss can provide fine gradient feedback in the later stages of training, and is mainly responsible for fine-tuning the edges of lesions to further improve segmentation accuracy.
[0054] By analyzing the gradient norm changes of the above three types of Loss with the training process (see...), we can understand the changes in the gradient norm of the above three types of Loss. Figure 4This invention identifies that these three gradients dominate the early (Focal), mid (Dice), and late (SoftIoU) stages of training, respectively. To achieve a dynamic balance among these three gradients throughout the entire training cycle and avoid gradient vanishing or exploding from any one perspective, this invention mathematically constructs a Nash equilibrium system. Experiments demonstrate that the simplest 1:1:1 linear weighting achieves the optimal synergistic effect; therefore, the final three-view equilibrium loss function of this invention is expressed as: , , It's weight. .
[0055] In this loss function, Focal is responsible for hard examples, Dice for regions, and SoftIoU for the whole, and the three together drive the network to converge to the global optimum.
[0056] This invention utilizes the publicly available IDRiD (Indian Diabetic Retinopathy Image Dataset) dataset for experimental validation. This dataset was chosen primarily for three reasons: First, compared to earlier datasets such as DiaRetDB1, IDRiD boasts an image resolution of 4288×2848, preserving the texture details of even minute hard exudates, thus better meeting the needs of high-precision clinical diagnosis. Second, this dataset contains samples of diabetic retinopathy of varying severity, covering lesion morphologies from punctate to large ring-shaped areas, making it highly challenging and representative. Finally, it serves as a universal benchmark for evaluating the performance of hard exudate segmentation algorithms in the field of computer vision. The dataset contains 81 high-resolution color fundus images, all acquired from a Kowa VX-10 digital fundus camera, and includes pixel-by-pixel binarized segmentation masks meticulously annotated by ophthalmologists. To ensure fairness in the comparison, this invention strictly adheres to the official partitioning criteria: the training set contains 54 images for model parameter learning; the test set contains 27 images for final performance evaluation.
[0057] Evaluation Metrics: To comprehensively evaluate the segmentation performance of the model across different dimensions, this invention employs four mainstream quantitative metrics: Intersection over Union (IoU), Dice Similarity Coefficient, Sensitivity, and Precision. IoU and Dice are core metrics for measuring segmentation accuracy, quantifying the degree of overlap between the predicted region and the ground truth mask. IoU is more sensitive to small segmentation errors and better reflects the model's performance on fine lesions. Sensitivity measures the model's recall rate for positive samples, crucial for avoiding missed diagnoses in clinical practice; Precision measures the proportion of ground truth lesions in the predicted results, reflecting the model's ability to suppress false positives (such as optic disc misdetection).
[0058] All experiments were implemented using the PyTorch deep learning framework and conducted on a high-performance computing platform equipped with an NVIDIA RTX 4090 GPU. During training, the input images were uniformly resized. Data augmentation strategies such as random rotation and flipping are employed to prevent overfitting. The network is trained using the AdamW optimizer with an initial learning rate of [value missing]. The learning rate was dynamically adjusted using a cosine annealing strategy, and the training lasted for 100 epochs.
[0059] To establish a high-precision performance benchmark for this invention, a comprehensive quantitative comparison was conducted between the proposed DG-Net and current methods in the field of medical image segmentation. The comparison methods covered classic CNN architectures (U-Net, DeepLabV3+), improved CNNs (U-Net++, U-Net3+, etc.), and the latest Transformer hybrid architectures (TransUNet, SegFormer). Specific quantitative results are shown in Table 1.
[0060] Table 1. Performance comparison of mainstream segmentation networks and the model of this invention on the IDRid dataset. Model Scheme IoU(%) Dice(%) Sensitivity (%) Precision (%) U-Net 57.64 72.04 73.33 75.55 AttU-Net 59.07 73.12 75.54 75.07 U-Net++ 59.26 73.27 75.39 75.52 U-Net3+ 58.69 72.60 73.02 76.10 PraNet 44.33 60.26 66.57 57.60 TransUNet 55.93 70.51 71.99 73.92 SegFormer 48.75 64.43 66.46 66.80 DeepLabV3 53.46 68.69 71.19 69.24 ResNet50-Unet 58.43 72.66 72.54 76.68 Swin-UNet 46.95 62.01 62.20 68.00 CE-Net 52.15 67.53 68.60 66.49 Dual-Branch Net 57.50 73.02 72.15 73.91 DG-Net (Ours) 61.14 74.78 75.92 77.81 As shown in Table 1, DG-Net achieved the best performance across all key evaluation metrics (IoU 61.14%, Dice 74.78%). Notably, this invention provides an in-depth comparison of DG-Net with two representative methods specifically designed for exudate segmentation: First, there are dedicated networks specifically designed for segmenting hard exudates or fundus lesions, including the classic Dual-Branch Net and the latest CE-Net from 2024. Although both methods are specifically optimized for lesion characteristics, the IoU of Dual-Branch Net is only 57.50%, while CE-Net, which incorporates supervised contrast learning, is even lower at 52.15%. This result strongly suggests that existing dedicated designs (such as dual-stream sampling or contrast enhancement) often neglect the utilization of frequency domain information, resulting in feature loss when processing extremely small, low-contrast lesions, and failing to reach the accuracy ceiling.
[0061] Secondly, the highly regarded Transformer architecture was tested. Experiments showed that Swin-UNet and SegFormer performed poorly on this task, with IoU dropping to 46.95% and 48.75%, respectively. This confirms that in medical tasks with small sample sizes and high sensitivity to absolute position, pure Transformer architectures lacking inductive bias are highly susceptible to overfitting.
[0062] In comparison, DG-Net not only significantly outperforms the aforementioned dedicated models and Transformer, but also achieves the best performance in both Precision (77.81%) and Sensitivity (75.92%). This verifies that the "frequency domain awareness + geometric prior" strategy proposed in this invention is more effective than simple structural improvements (Dual-Branch) or feature enhancements (CE-Net) in addressing the challenges of hard exudate segmentation.
[0063] Analyzing the performance improvement from the perspective of three types of challenges reveals that DG-Net achieves systematic advantages in small target sensitivity, false detection suppression, and overall overlap ratio (IoU / Dice).
[0064] To further verify the performance of DG-Net, this invention compares and analyzes it with six mainstream segmentation networks (UNet++, Swin-UNet, DeepLabV3+, TransUNet, SegFormer, and PraNet). Figure 5 As shown, DG-Net significantly outperforms all other methods in both ROC and PR curves.
[0065] In the ROC curve ( Figure 5 In the left figure, DG-Net achieved the highest level (AUC = 0.9949), with the curve closest to the top left corner, demonstrating its extremely high recognition rate under different thresholds.
[0066] In the PR curve reflecting the segmentation ability of small lesions ( Figure 5 As shown in the right figure, DG-Net's advantage is more significant. Its mAP reaches 0.8382, a substantial lead of 7.62% and 8.87% compared to the current second-best performing TransUNet (0.7620) and the high-performance Transformer model SegFormer (0.7495), respectively. This result fully demonstrates the effectiveness of capturing subtle edge details through dual-domain Euler attention (DEAM) and utilizing geometric phase context aggregation (GPCA) for spatial awareness, enabling the network to exhibit an excellent balance between accuracy and recall in the highly challenging hard exudate segmentation task.
[0067] To further verify the discriminative power of the features, this invention utilizes the t-SNE algorithm to visualize the high-dimensional features of hard exudates and the sight glass. For example... Figure 6 As shown in the left figure, the feature clusters extracted by the Baseline model are loosely distributed, and the boundaries between classes are not clear enough. In contrast, Figure 6 In the right figure, the feature clusters generated by DG-Net are significantly more compact within classes, and a wider "separation band" is formed between hard exudates and the optic disc. This intuitively demonstrates that by introducing geometric priors and frequency domain features, the network significantly enhances the separability of features, thereby effectively avoiding the misidentification of the optic disc region as a lesion.
[0068] To verify the independent contributions and design rationality of each core module in DG-Net, this invention uses ResNet50-UNet as a baseline and employs a "gradual, cumulative optimization" strategy for ablation experiments. The experimental results are shown in Table 2.
[0069] First, after introducing the Three-View Equalization Loss (TPEL), the IoU improved from 58.43% to 59.20%. This indicates that the Nash equalization strategy effectively alleviates pixel-level class imbalance by balancing the gradient flow of hard example mining and boundary fine-tuning, preventing the model from being dominated by the background. Building on this, further introducing the Dual-Domain Euler Attention Module (DEAM) significantly boosted the IoU to 60.11%, resulting in a substantial gain of +0.91%. This demonstrates that using Euler's formula to upgrade features from scalar to vector dimensions effectively mines frequency domain attributes ignored by traditional convolution, thereby significantly enhancing the ability to capture small lesions. Finally, adding the Geometric Phase Context Aggregator (GPCA) brought the model to a final IoU of 61.14%. The significant improvement in Precision is particularly crucial, indicating that the injection of absolute geometric prior successfully eliminated false positives in the spectral region, completing the final piece of the puzzle in segmentation accuracy and validating the effectiveness of the "geometric + semantic" dual-stream collaboration.
[0070] Table 2 Comparison of Ablation Experiment Results for Core Innovation Modules Model Scheme IoU(%) Dice(%) Recall(%) Precision (%) Baseline 58.43 72.66 72.54 76.68 Baseline + TPEL 59.20 73.15 72.98 77.46 Baseline + TPEL + DEAM 60.48 74.38 76.80 74.97 Baseline + TPEL + DEAM + GPCA 61.14 74.78 75.92 77.81 To visually demonstrate the superiority of DG-Net, Figure 7 The results show a comparison between its model and a representative competing model under three different pathological challenges: First, regarding edge details, such as Figure 7 As shown in (a), the boundaries of hard exudates are usually blurred due to the diffusion effect of retinal illumination. As indicated by the green box, the segmentation results of ResNet50-Unet and TransUNet often have rough or overly smooth edges. Although Unet++ performs better, there is still considerable room for improvement. Pranet's segmentation boundaries are extremely smooth, significantly different from GroudTruth. CE-NET, as a dedicated network for hard exudate segmentation, retains a significant amount of edge detail despite relatively low performance metrics. Swin-Unet has relatively clear edges, but it is still not optimal. In contrast, DG-Net effectively preserves the sharpness and morphological details of irregular edges, thanks to the DEAM module's effective encoding of high-frequency structural features using phase information.
[0071] Secondly, for small lesions, such as Figure 7As shown in (b), scattered lesions at the pixel level are highly susceptible to false negatives. The magnified view within the red box shows that while ResNet50-Unet captured some targets, its misclassification was also extremely significant, misclassifying many non-hard exudate pixels as hard exudates. TransUNet detected some signals, but its accuracy still needs improvement. Unet++ performed better in comparison, but misclassification still occurred. Swin-Unet effectively identified some small lesions, but still misclassified background pixels as lesions, exhibiting a certain degree of false positives. In contrast, PraNet and CE-Net showed relatively stable overall segmentation performance, but their results still have room for further improvement. Finally, DG-Net successfully activated these low-contrast regions, thanks to the enhancement effect of the amplitude response on saliency features in the frequency domain.
[0072] Finally, in densely confluent lesions, such as Figure 7 As shown in (c), the large-area fused patches in the scene require the model to maintain good spatial consistency. The purple box shows that while TransUNet and ResNet50-UNet can segment the basic shape of the hard exudate blocks, their detail is significantly inferior to the gold standard. Unet++ performs slightly better, but its internal detail still needs improvement. PraNet's segmentation performance is relatively weak, making it difficult to effectively characterize the detailed structure of dense lesion regions. CE-Net shows some improvement over PraNet in detail segmentation, but it is still insufficient in characterizing complex lesions. In contrast, Swin-UNet has shown superior overall segmentation performance, but it still lacks some integrity in fine-grained structures. DG-Net overcomes these limitations, generating a segmentation mask with full and coherent internal filling, highly consistent with the gold standard. This strongly demonstrates that the architecture of this invention successfully achieves a dynamic balance between local detail capture and global context modeling.
[0073] To delve deeper into the internal workings of DEAM, this invention... Figure 8 , Figure 9 and Figure 10 The intermediate feature maps after decoupling via Euler transformation are visualized in the image. For example... Figure 9 As shown, the amplitude response primarily acts as a saliency detector, exhibiting a strong activation response to highlighted areas in the image (such as the main body of hard exudate, the optic disc, and blood vessels), reflecting the intensity information of the lesion. In contrast, the phase response ( Figure 10 The method focuses on extracting structural information, and the boundary contours of lesions are clearly visible in its feature maps, effectively capturing the high-frequency edge details of small lesions. This visual separation intuitively proves that DEAM has successfully achieved vector decoupling of features, enabling the network to simultaneously use amplitude to locate the main body of the lesion and use phase to refine the edge of the lesion.
[0074] Based on the above experimental verification, we can conclude that: First, this invention emphasizes the importance of "task-aligned inductive bias" in small lesion medical segmentation tasks. Unlike general semantic segmentation tasks, hard exudate segmentation is characterized by extremely small lesion scale, limited anatomical distribution, and a severe imbalance between foreground and background. Experimental results show that the pure Transformer architecture does not demonstrate an advantage in this task, suggesting that in medical scenarios with strong structural constraints, relying solely on global self-attention mechanisms is insufficient to compensate for the representational deficiencies caused by the lack of structural priors. In contrast, DG-Net, by explicitly introducing frequency domain attribute enhancement and absolute geometric coordinate priors, enables the network to regain structural inductive ability that matches the distribution of retinal pathology, thereby improving segmentation stability and discrimination reliability.
[0075] Secondly, the amplitude-phase decoupling driven by the Euler formula provides a new perspective on feature representation. Traditional convolution or attention mechanisms typically perform scalar operations in the real domain, while DEAM extends the feature map to a vectorized representation space, functionally separating saliency intensity from structural orientation information. This representational reconstruction does not simply increase model complexity, but rather improves information organization efficiency at the feature level. Experimental results show that in scenarios with small and low-contrast lesions, this frequency domain reparameterization can more effectively capture high-frequency edge structures, thereby improving the performance of small target detection.
[0076] Furthermore, from an optimization perspective, TPEL embodies the dynamic balancing idea of gradient complementarity. Under extreme pixel-level class imbalance conditions, a single loss function often exhibits inconsistent gradient dominance across different training stages. This invention constructs a three-view gradient collaboration mechanism, enabling pixel-level hard example mining, region-level overlap optimization, and global metric alignment to form a relatively stable optimization path during training. This indicates that in medical small object segmentation tasks, designing the loss function from a gradient dynamics perspective may be more effective than simply adjusting weight parameters.
[0077] Nevertheless, this invention still has certain limitations. First, experimental validation is based solely on the single publicly available IDRiD dataset. While this dataset offers high resolution and clinical representativeness, cross-dataset validation will help further evaluate the model's generalization ability. Second, the geometric prior injected into GPCA assumes that retinal acquisitions have relatively consistent imaging structures. In cases of significant spectral shifts or severe pathological deformations, this prior may require adaptive modeling strategies to supplement it. Furthermore, this invention has not yet evaluated the model's performance in weakly labeled or semi-supervised scenarios, which is a direction worthy of future exploration.
[0078] In summary, this invention addresses the challenges of small-scale targets, pixel-level class imbalance, and strong structural dependence in fundus hard exudate segmentation tasks. It proposes a DG-Net framework that integrates frequency domain enhancement and geometric prior modeling. By constructing a DEAM module to achieve amplitude-phase decoupling representation, introducing a GPCA module to strengthen spatial structural constraints, and designing a TPEL loss function to coordinate multi-level optimization objectives, the model achieves superior performance compared to several mainstream methods on the IDRiD dataset. Experimental results show that the proposed method effectively improves the recognition accuracy and structural integrity of small-scale lesions while maintaining controllable model complexity. Future cross-dataset validation will be conducted to improve the model's generalization ability.
Claims
1. A method for segmenting retinal hard exudates based on DEAM and GPCA, characterized in that, Includes the following steps: Step 1: Obtain the image dataset of diabetic retinopathy; Step 2: Construct a segmentation network. The segmentation network adopts an encoder-decoder architecture, embedding a dual-domain Euler attention module in the skip connection path between the encoder and decoder, and introducing a geometric phase context aggregator in the deepest layer of the encoder. The encoder extracts multi-scale hierarchical features from the original image. The dual-domain Euler attention module decouples the features from the first to the (N-1)th layers from the real domain to the amplitude and phase domains, respectively, then performs vectorized reconstruction of the features, followed by dual-domain feature fusion, and finally dual attention refinement and residual preservation to obtain enhanced features. The geometric phase context aggregator injects learnable absolute 2D geometric position codes into the features of the Nth layer and generates direction-aware features using a parallel phase modulation mechanism. Finally, it dynamically aggregates the context to generate the final features. The decoder gradually restores the spatial resolution of the features through upsampling and fuses them with the enhanced features. Step 3: Train the segmentation network using the dataset, and use the trained segmentation network to segment hard exudates in diabetic retinopathy images.
2. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 1, characterized in that, Step 1 uses the IDRiD public dataset as the dataset, or constructs the dataset through clinical image acquisition; the resolution of the images in the dataset should be able to preserve the texture details of extremely small hard exudates, and include diabetic retinopathy samples of various severities, with lesion morphologies ranging from punctate to large ring-shaped areas.
3. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 1, characterized in that, The dual-domain Euler attention module will input features The decoupling from the real number domain to the amplitude and phase domains can be achieved as follows: In the formula, and They represent Amplitude and phase diagram in the direction, Indicates the kernel size as Convolution operation, Indicates batch normalization, For the Sigmoid activation function, For ReLU function, It represents two orthogonal directions: horizontal and vertical.
4. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 3, characterized in that, The vectorization reconstruction of features is implemented as follows: In the formula, express Vector features recombined based on Euler's formula in the direction. This indicates a splicing operation along the channel dimension. This indicates element-wise multiplication.
5. The retinal hard exudate segmentation method based on DEAM and GPCA according to claim 4, characterized in that, The method for performing dual-domain feature fusion is as follows: In the formula, This is a characteristic of Euler fusion. and These represent the transform convolutions in the horizontal and vertical directions, respectively. This is the channel convolution branch.
6. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 5, characterized in that, The dual-attention refinement and residual preservation are implemented as follows: Euler fusion feature The input is divided into two branches: a channel attention branch and a spatial attention branch. The channel attention branch generates weights through global pooling and an MLP. The features obtained as follows: in, Indicates global average pooling. Indicates global max pooling; The spatial attention branch generates structural weights through the concatenation and convolution of statistical features. The features obtained as follows: in, For activation function, These represent the average, maximum, minimum, and sum of the input values, respectively. Input features Adding it to the refined features yields the enhanced features. , means as follows: 。 7. The method for segmenting retinal hard exudates based on DEAM and GPCA according to any one of claims 1 to 6, characterized in that, The geometric phase context aggregator injects learnable absolute 2D geometric position codes into the features of the Nth layer. The injection process is as follows: In the formula, This represents the features after injecting geometric priors. For the features of the Nth layer of the encoder, , and These are two learnable geometric parameter tensors, representing the absolute coordinate fields in the vertical and horizontal directions, respectively, which are continuously updated during training. and , This represents a broadcast operation that expands a tensor along a specific dimension.
8. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 7, characterized in that, The method for generating direction-aware features using a parallel phase modulation mechanism is as follows: First of all The amplitude is extracted by feeding the data into the horizontal and vertical branches respectively. With modulation angle Calculate intermediate features Then, orientation-aware features are generated through depthwise separable convolution, expressed by the formula: in, , Indicates two orthogonal directions: horizontal and vertical. Indicates the kernel size as Convolution operation, Indicates batch normalization, For ReLU function, and These are the direction-aware features obtained from the horizontal and vertical branches, respectively. and convolution kernel and Depth-separable convolutions.
9. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 8, characterized in that, The dynamic aggregation context generates the final feature, which is implemented as follows: For dynamic weights, This is the final feature.
10. The method for segmenting retinal hard exudates based on DEAM and GPCA according to claim 1, characterized in that, In step 3, during the training phase, the output of the segmentation network is supervised by a three-view equalization loss function. This function coordinates the gradient flow of the pixel, region, and global views through a Nash equalization strategy to ensure that the model maintains robust convergence when dealing with extremely imbalanced samples. The three-view equalization loss function is expressed as follows: In the formula, It's a Focal loss, and the responsible party is difficult to quantify. , It is a prediction probability. It is the focusing parameter. It is a balancing factor; This is a Dice loss, in the area of responsibility. , and Representing the model for the first i The predicted value and the true label value of each pixel. It is a very small smoothing coefficient used to prevent the denominator from being zero; It's a SoftIoU loss, responsible for the overall loss. ; , , It's weight. , It is a very small smoothing coefficient used to prevent the denominator from being zero.