Degradation-aware fundus image quality enhancement method, system, device and medium

CN122222852BActive Publication Date: 2026-08-18CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610656256.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-08-18
Estimated Expiration
2046-05-13

AI Technical Summary

Technical Problem

[0017]针对上述现有技术中的不足,本发明提供了一种基于退化感知的眼底图像质量增强方法、系统、设备及介质,旨在解决现有眼底图像增强技术中存在的退化区域感知不足、细节丢失、结构失真及微小血管修复能力有限等核心问题,实现对低质量眼底图像的高精度、高保真增强

Benefits of technology

[0030] (1) Adaptive perception and differential enhancement of degraded regions are achieved, effectively avoiding over-smoothing and artifact problems. This invention introduces a degradation degree assessment and a self-attention mechanism with a degradation perception penalty term, which can quantitatively assess the degradation degree of each local region of the image and dynamically adjust the attention weight distribution. Severely degraded regions are enhanced, while clear regions retain their original quality without interference. This solves the problem of uneven enhancement caused by global uniform enhancement in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122222852B_ABST
    Figure CN122222852B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on degradation perception's fundus image quality enhancement method, system, equipment and medium, wherein method includes: to original low-quality fundus image is standardized pretreatment;To the fundus image after pretreatment is divided into area, feature extraction and degradation degree evaluation, and introduce the self-attention mechanism with degradation perception penalty term, realize differentiation feature enhancement;Build generation network, including encoder and decoder, finally output enhanced fundus image;Build discriminant network, including multiple parallel multi-scale convolution branches, the output of multiple branches is fused, and through double output head respectively outputs true probability value and authenticity confidence heat map;The generation network and discriminant network are trained against;For the fundus image to be enhanced, after image pretreatment and local feature self-adapting enhancement, input trained generation network, output quality enhanced fundus image.The application can realize high-precision, high-fidelity enhancement to low-quality fundus image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, system, device, and medium for enhancing the quality of fundus images based on degradation perception. Background Technology

[0002] Fundus images are crucial for clinical ophthalmic diagnosis, primarily acquired using two types of equipment: fundus cameras and optical coherence tomography (OCT). Fundus cameras illuminate the retina with a specific wavelength of light, using an optical system to image the retinal surface structures such as blood vessels, the optic disc, and the macula as a two-dimensional color image. OCT, on the other hand, utilizes the principle of low-coherence optical interference to perform high-resolution tomographic scanning of the retina, obtaining microscopic structural information about each layer. In actual clinical settings, factors such as patient pupil size, eye movement, refractive media opacity, equipment aging, and lighting conditions often lead to varying degrees of quality degradation in acquired fundus images. This degradation manifests as blurriness, noise, insufficient contrast, and localized obstruction, severely impacting the accuracy of subsequent disease diagnosis.

[0003] Traditional image enhancement methods include signal processing techniques such as histogram equalization, adaptive contrast enhancement (CLAHE), and wavelet denoising. These methods are based on fixed mathematical transformation rules to adjust brightness and contrast globally or locally and suppress noise in images. However, traditional methods lack the ability to understand the semantic information of images, have limited effectiveness in handling complex degradation patterns, and are prone to introducing artifacts or over-enhancement. In recent years, deep learning-based image enhancement techniques have made breakthrough progress, especially convolutional neural networks (CNNs), which have shown excellent performance in tasks such as super-resolution reconstruction, denoising, and deblurring.

[0004] Existing technical solution 1: A fundus image enhancement method based on standard GAN (Generative Adversarial Network). It has the following drawbacks:

[0005] Disadvantage 1: The generator employs a globally uniform enhancement strategy, failing to differentiate the degree of degradation in different regions of the image. For regions with significantly different degrees of degradation in the fundus image (such as blurred microvessels versus relatively clear background areas), the same enhancement operation is applied uniformly. This results in insufficient enhancement of severely degraded areas and over-processing of clear areas, introducing artifacts, leading to an unbalanced overall enhancement effect. The root cause of this drawback lies in the network's lack of perception and evaluation of the local degradation level of the input image, making it unable to dynamically adjust the feature enhancement intensity of different regions.

[0006] Disadvantage 2: The generator relies solely on L1 or L2 pixel-level reconstruction loss constraints during the reconstruction process, lacking a structured latent spatial coding mechanism. Pixel-level loss tends to generate the mean of the output pixels, leading to over-smoothing of the generated image and significant loss of high-frequency texture information (such as microvascular walls and retinal nerve fiber layer texture). The technical root of this disadvantage lies in the fact that the pure GAN architecture lacks explicit coding constraints on the overall structural information of the image, making it difficult to guarantee structural consistency.

[0007] Disadvantage 3: The global discriminator only outputs a single overall probability of the image being genuine or fake, failing to provide fine-grained local feedback signals to the generator. The generator cannot identify which local regions in the image have poor generation quality, thus hindering targeted optimization and limiting both training efficiency and final generation quality.

[0008] Existing technical solution two: an image reconstruction method based on standard VAE (variational autoencoder). It has the following drawbacks:

[0009] Disadvantage 1: Standard VAEs are trained using MSE or L1 reconstruction losses. Because the MSE loss function tends to generate the mean pixel value of all possible outputs during optimization, this "mean regression" effect systematically suppresses high-frequency components in the generated image, resulting in inherent reconstruction blurring. For diagnostically significant microvascular branches, capillary network textures, lesion edge contours (such as the circular boundaries of microaneurysms and the irregular edges of hemorrhages), and the fine striated structures of the retinal nerve fiber layer in fundus images, the reconstruction results are often blurry and have diffused boundaries, failing to provide detailed information that meets the accuracy requirements for clinical interpretation.

[0010] Disadvantage 2: Standard VAEs lack adversarial training mechanisms, and the decoder has no external discriminator to provide feedback signals regarding the realism of the image during the generation process. This causes the decoder to tend to output "safe" but smooth results lacking detailed variations when faced with uncertainty, rather than generating potentially more realistic high-frequency textures.

[0011] Disadvantage 3: Standard VAE uses a completely uniform encoding-decoding strategy for regions with different degrees of degradation in the image. The encoder does not distinguish which regions in the input image are severely degraded (such as blurred blood vessel areas) and which regions are relatively clear (such as background areas), and the decoder cannot perform targeted restoration of degraded areas. Standard VAE lacks differentiated processing capabilities, and its overall enhancement effect is limited by the indiscriminate reconstruction of all regions.

[0012] In view of the shortcomings of the existing technical solutions, the core technical problems to be solved by this application include:

[0013] Technical Problem 1: How to achieve adaptive perception and differential enhancement of different degraded areas in fundus images, that is, how to dynamically adjust the enhancement intensity according to the degree of degradation of each local area, so as to effectively enhance the degraded areas while avoiding over-processing of the clear areas.

[0014] Technical Problem 2: How to achieve a balance between maintaining structural consistency and restoring high-frequency details during image enhancement, that is, how to restore the texture and detail loss caused by degradation to the greatest extent possible while ensuring that the enhanced image and the original image strictly correspond in the overall anatomical structure (blood vessel direction, optic disc position, macular morphology, etc.).

[0015] Technical Issue 3: How to improve the discriminator's ability to distinguish multi-scale differences in the texture of fine structures such as microvessels, so that it can provide the generator with accurate local quality feedback signals, thereby guiding the generator to focus on optimizing weak areas.

[0016] Technical Question 4: How to improve the training efficiency, convergence speed and generalization ability of the model through adaptive optimization strategies, and avoid pattern collapse and training instability problems, given the limited size of the fundus image dataset. Summary of the Invention

[0017] To address the shortcomings of the existing technologies, this invention provides a method, system, device, and medium for enhancing the quality of fundus images based on degradation perception. It aims to solve the core problems in existing fundus image enhancement technologies, such as insufficient perception of degradation areas, loss of details, structural distortion, and limited ability to repair microvessels, and to achieve high-precision, high-fidelity enhancement of low-quality fundus images.

[0018] Firstly, a method for enhancing the quality of fundus images based on degradation perception is provided, comprising the following steps: Image preprocessing: Standardization preprocessing is performed on the original low-quality fundus images; Local feature adaptive enhancement: The preprocessed fundus image is divided into regions, and then features are extracted and the degree of degradation is evaluated for each region. A self-attention mechanism with a degradation perception penalty term is introduced to achieve differentiated feature enhancement for different degradation regions in the preprocessed fundus image. Constructing a generative network: including an encoder and a decoder. The encoder is used to extract the mean vector and log-variance vector of the latent space of the fundus image after differential feature enhancement. The decoder gradually restores the spatial resolution based on the latent variables obtained by reparameterization sampling, and finally outputs an enhanced fundus image with the same size as the input. Construct a discriminative network: including multiple parallel multi-scale convolutional branches. After the outputs of multiple branches are fused, the network outputs a single global true / false probability value and a single-channel truth confidence heatmap of the same size as the input image through dual output heads. Adversarial training: The generator network and the discriminator network are trained adversarially using a dataset of low-quality fundus images and corresponding real high-quality reference images. Image enhancement: For the fundus image to be enhanced, after image preprocessing and local feature adaptive enhancement, it is input into the trained generative network and outputs a fundus image with enhanced quality.

[0019] Furthermore, the image preprocessing includes: Size standardization: The original low-quality fundus images are uniformly scaled to a fixed size; Basic noise suppression: Bilateral filtering is applied to the size-normalized fundus image for noise reduction; Contrast pre-adjustment: Adaptive contrast-limited histogram equalization is used to enhance the contrast of the denoised fundus image.

[0020] Furthermore, the local feature adaptive enhancement includes: Region segmentation and feature extraction: The preprocessed fundus image is divided into several overlapping local regions; each region is processed by a lightweight convolutional feature extraction subnetwork with shared weights to extract feature representations, outputting a d-dimensional feature vector; the feature vectors of all regions are combined to form a feature matrix. , where N is the total number of region blocks; Degradation Assessment: A lightweight degradation assessment subnetwork, operating in parallel with a lightweight convolutional feature extraction subnetwork, quantifies the degradation level of each region block. The degradation scores of all regions blocks are combined to form a degradation score vector. , This represents the degradation score of the i-th region block; Self-attention computation with penalty terms: using the feature matrix and degenerate score vector As input, a degradation perception penalty term is introduced on top of the standard self-attention mechanism to calculate the enhanced feature matrix. The degradation perception penalty term is the penalty matrix P, whose i.e., the first term is the penalty term P. Each element is defined as ,in For learnable scalar parameters, The structural similarity between the i-th region block and the j-th region block; Feature Reorganization and Output: The enhanced feature matrix The feature vectors of each region block in the image are decoded using a sub-network; for overlapping regions, a weighted average strategy is used for fusion, with the weights proportional to the degradation scores of each region block; the final output is a fundus image with enhanced differential features. .

[0021] Furthermore, the generative network adopts a VAE-GAN hybrid architecture, wherein the encoder includes a 6-layer convolutional module and two parallel fully connected layers, and the two parallel fully connected layers output the mean vector and the log-variance vector of the latent space, respectively. The decoder includes a 6-layer deconvolution module and introduces U-Net-style skip connections to concatenate the feature maps of each layer of the encoder with the corresponding layers of the decoder. In addition, a residual self-attention module is inserted between the 3rd and 4th layers of the decoder.

[0022] Furthermore, the total loss function of the generator network is defined as: ; in, This represents the total loss of the generator network. , , , and Let represent the pixel-level reconstruction loss, KL divergence regularization term, adversarial loss, perceptual loss, and structural similarity loss, respectively. ~ This corresponds to the weight of each loss term; The confidence heatmap M, used to determine the authenticity of the network output, guides the optimization direction of the generator network during training through a gradient masking mechanism: in the backpropagation phase of each training round, the total loss function... Regarding the enhanced fundus images output by the generative network gradient Before continuing to backpropagate to each layer within the generator network, multiply by the spatial weight matrix (1-M).

[0023] Furthermore, the discriminant network includes three parallel multi-scale convolutional branches, each containing four sequentially arranged convolutional-instance normalization-LeakyReLU modules. The output feature maps of the three branches are adaptively weighted and fused through a learnable channel attention module. The weights are dynamically determined by the texture complexity of the input region, which is estimated by calculating the variance of the local gradient magnitude. The fused feature map passes through two output heads. The first output head is a true / false discrimination head, which outputs a globally unique true / false probability value through global average pooling and a fully connected layer. The second output header is a local confidence heatmap header, which maps the feature map into a single-channel truth confidence heatmap of the same size as the input image through 1×1 convolution. In the authenticity confidence heatmap, each pixel value is constrained to the [0,1] interval by the Sigmoid activation function, which represents the confidence of the discrimination network in the authenticity of that location; The loss function of the discriminant network is expressed as follows: ; in, This indicates the total loss of the discrimination network; This represents the output of the network authenticity discrimination header. Expressing expectations; This represents the enhanced fundus image output by the generator network. This represents the corresponding real, high-quality reference image; and These represent the gradient penalty term and the gradient penalty weight, respectively. It is expressed as follows: ; Where Î represents and Random linear interpolation samples between represents the gradient of the discriminant network with respect to the interpolated sample Î; ||·||2 represents the L2 norm.

[0024] Furthermore, during adversarial training, a training scheduling framework based on reinforcement learning is introduced. This framework evaluates the output quality of the generator network in real time through a multi-dimensional reward function and dynamically schedules key hyperparameters during training accordingly. These key hyperparameters include the ratio of training steps for the generator network to those for the discriminator network. The multi-dimensional reward function is expressed as follows: ; Where R represents the total reward, and ΔPSNR represents the improvement in peak signal-to-noise ratio of the enhanced image compared to the unenhanced image; This indicates the improvement in structural similarity metrics between the enhanced image and the unenhanced image. This indicates the improvement in the perceptual distance metric between the enhanced image and the unenhanced image. This represents the confidence score output after the enhanced image is input into a pre-trained clinical quality assessment network; ~ This corresponds to the weight of each reward item.

[0025] Secondly, a degradation-aware-based fundus image quality enhancement system is provided, comprising: Image input interface: used to support fundus image input, its output is connected to the preprocessing module; Preprocessing module: Used to perform normalization preprocessing on the input raw low-quality fundus image, and its output is connected to the local feature adaptive enhancement module; Local Feature Adaptive Enhancement Module: This module is used to divide the preprocessed fundus image into regions, then extract features and evaluate the degree of degradation of each region, and introduces a self-attention mechanism with a degradation perception penalty term to achieve differentiated feature enhancement of different degradation regions in the preprocessed fundus image. Its output is connected to the generator. The generator consists of an encoder and a decoder. The encoder extracts the mean vector and log-variance vector of the latent space of the fundus image after differential feature enhancement. The decoder gradually restores the spatial resolution based on the latent variables obtained by reparameterization sampling. Finally, it outputs an enhanced fundus image with the same size as the input. Its output is connected to the discriminator and the image output interface. Discriminator: It includes multiple parallel multi-scale convolutional branches. After the outputs of multiple branches are fused, they output a single global true / false probability value and a single-channel truth confidence heatmap of the same size as the input image through dual output heads. During the training phase, its output feedback signal is connected to the generator to form closed-loop adversarial training. Optimization Controller: Used to evaluate the generator's output quality in real time based on a multidimensional reward function, and dynamically adjust key hyperparameters for generator and discriminator training, including the ratio of training steps for the generator and discriminator; it is only active during the training phase.

[0026] Image output interface: Used to output enhanced quality fundus images.

[0027] Thirdly, an electronic device is provided, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store a computer program, the one or more processors invoking the computer program to cause the electronic device to perform the aforementioned degradation-perception-based fundus image quality enhancement method.

[0028] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform the aforementioned method for enhancing the quality of fundus images based on degradation perception.

[0029] This invention proposes a method, system, device, and medium for enhancing the quality of fundus images based on degradation perception, which has the following beneficial effects:

[0030] (1) Adaptive perception and differential enhancement of degraded regions are achieved, effectively avoiding over-smoothing and artifact problems. This invention introduces a degradation degree assessment and a self-attention mechanism with a degradation perception penalty term, which can quantitatively assess the degradation degree of each local region of the image and dynamically adjust the attention weight distribution. Severely degraded regions are enhanced, while clear regions retain their original quality without interference. This solves the problem of uneven enhancement caused by global uniform enhancement in the prior art.

[0031] (2) An optimal balance between maintaining structural consistency and restoring high-frequency details is achieved simultaneously during image enhancement. This invention employs a VAE-GAN hybrid architecture. The structured latent space encoding of VAE ensures a strict correspondence between the enhanced image and the original image in terms of global anatomical structure, while the adversarial training mechanism of GAN effectively restores high-frequency texture details. This also solves the problems of insufficient structural consistency and blurred reconstruction in existing technologies.

[0032] (3) Significantly improved multi-scale discrimination capability for fine structures such as microvessels and efficiency of targeted optimization of the generator network. The multi-branch, multi-scale architecture and fusion mechanism of the discriminant network enable it to dynamically focus on the most relevant feature scales based on the texture complexity of different regions. The local confidence heatmap feedback mechanism further realizes precise guidance for generator optimization, enabling the generator network to focus on optimizing weak areas. It solves the problems of fixed receptive fields and coarse feedback signals in existing technologies.

[0033] (4) By introducing a training scheduling framework based on reinforcement learning, adaptive macro-control of the adversarial training process is achieved, significantly improving training stability and final generation quality. Existing technical solutions rely on manually preset fixed hyperparameters during training, which cannot adapt to the dynamic changes in the adversarial situation between the generator and the discriminator, resulting in low training efficiency and a tendency to fall into pattern collapse or training oscillation. This invention transforms non-differentiable multidimensional quality indicators into reward signals to drive the dynamic adjustment of hyperparameters such as the training step ratio, enabling the training process to autonomously adapt to the optimal adversarial intensity based on the actual performance of the generator, without the need for repeated manual parameter tuning. This solves the problems of low training efficiency and insufficient generalization ability caused by the lack of adaptive optimization mechanisms in existing technologies. Attached Figure Description

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

[0035] Figure 1 This is a flowchart of a method for enhancing fundus image quality based on degradation perception, provided by an embodiment of the present invention. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0037] This invention provides a scheme for improving the quality of fundus images based on local feature adaptive enhancement, a hybrid generative architecture of variational autoencoder-generative adversarial network (VAE-GAN), and reinforcement learning optimization. This scheme aims to address core problems in existing fundus image enhancement techniques, such as insufficient perception of degraded regions, loss of detail, structural distortion, and limited ability to repair microvessels. Through a hierarchical, adaptive, and multi-stage collaborative training and inference process, it achieves high-precision, high-fidelity enhancement of low-quality fundus images. The technical solution of this invention will be specifically described below with reference to specific embodiments.

[0038] like Figure 1 As shown, this embodiment of the invention provides a method for enhancing the quality of fundus images based on degradation perception, including the following steps: S1: Image preprocessing: Standardize the original low-quality fundus images.

[0039] Specifically, the image preprocessing includes: S11: Size standardization: The input raw low-quality fundus images are uniformly scaled to a fixed size (such as 512×512 pixels or 256×256 pixels) using bicubic interpolation to ensure image quality during the scaling process; S12: Basic noise suppression: Bilateral filtering is applied to the size-normalized fundus image for noise reduction. Bilateral filtering determines the filtering weight by simultaneously considering the spatial distance and gray-level difference between pixels. While suppressing random noise in flat areas, it can preserve important structural boundary information such as blood vessel edges and lesion contours, avoiding the blurring effect of traditional Gaussian filtering on edges. In this embodiment, the spatial domain filtering kernel size is set to 5×5. S13: Contrast pre-adjustment: Adaptive contrast-limited histogram equalization is used to enhance the contrast of the denoised fundus image. In this embodiment, histogram equalization is performed independently in each local block and over-enhancement is suppressed by cropping and limiting parameters. Then, bilinear interpolation is performed on the boundaries of adjacent blocks to eliminate block effects. The cropping and limiting parameters are set to 2.0 and the block size is 8×8.

[0040] In some other embodiments, to avoid color distortion, the image is converted to a color space after size standardization. Specifically, the original RGB color space is converted to the LAB color space, and the luminance channel (L channel) and chrominance channels (A and B channels) are separated. Subsequent basic noise suppression and contrast pre-adjustment are based on the luminance channel. Finally, the image is converted back to the RGB color space to obtain the preprocessed fundus image.

[0041] S2: Local Feature Adaptive Enhancement: The preprocessed fundus image is divided into regions, and then features are extracted and the degree of degradation is evaluated for each region. A self-attention mechanism with a degradation perception penalty term is introduced to achieve differentiated feature enhancement for different degradation regions in the preprocessed fundus image.

[0042] Specifically, the local feature adaptive enhancement includes: S21: Region Segmentation and Feature Extraction: The preprocessed fundus image is divided into several overlapping local region blocks. Let the size of the preprocessed fundus image be H×W, where H and W represent the height and width, respectively. The size of each region block is... (e.g., p=32 or p=64), step size is s (e.g., ... Then, along each horizontal and vertical direction, we can obtain... and Each region is divided into several blocks; each region is processed by a lightweight convolutional feature extraction subnetwork with shared weights (in this embodiment, it consists of 3 layers of 3×3 convolutional-BN-ReLU modules with 64, 128, and 256 channels respectively) to extract feature representations, and the output is a d-dimensional feature vector (e.g., d=256); the feature vectors of all regions are combined to form a feature matrix. , where N is the total number of region blocks.

[0043] S22: Degradation Assessment: A lightweight degradation assessment subnetwork, running in parallel with a lightweight convolutional feature extraction subnetwork, quantifies the degradation level of each region block. This degradation assessment subnetwork takes the pixel data of each region block as input (i.e., the region blocks obtained in S21, sharing the same batch of input as the feature extraction subnetwork, but processed independently), and outputs a scalar degradation score through two convolutional layers and a global average pooling layer. (After Sigmoid activation function). This represents the degradation score of the i-th region block. A larger value indicates more severe degradation (e.g., greater blurriness, higher noise, and greater loss of structural integrity); the training labels for the degradation assessment subnetwork are automatically generated from image quality assessment metrics (such as local PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity Index) and comparisons with high-quality reference images); the degradation scores of all regions form the degradation score vector. .

[0044] S23: Self-attention computation with penalty term: using the feature matrix and degenerate score vector As input, a degradation perception penalty term is introduced on top of the standard self-attention mechanism to calculate the enhanced feature matrix. .

[0045] More specifically, firstly, based on the feature matrix Calculate the query matrix Key matrix Sum matrix : , , ; in, It is a learnable linear projection matrix; Next, calculate the attention weight matrix. : ; in, This represents the softmax activation function; Let P be the dimension of the key vector; P is the degradation-aware penalty term, i.e., the penalty matrix, whose i-th... Each element is defined as: ; in, For learnable scalar parameters, The structural similarity between the i-th region block and the j-th region block (using the feature matrix) The cosine similarity of the corresponding feature vectors is calculated; the intention of this penalty term is to address severely degraded regions ( Large) in regions with dissimilar structures ( Smaller interactions receive higher attention weights, allowing for greater use of structure-related information from the global context for compensation during feature fusion; while clearer regions ( The penalty term (smaller) approaches zero to avoid unnecessary feature interference; finally, the enhanced feature matrix is: .

[0046] S24: Feature Restructuring and Output: The enhanced feature matrix... The feature vectors of each region block in the image are decoded using a sub-network (2 layers of deconvolution); for overlapping regions, a weighted average strategy is used for fusion, with the weights proportional to the degradation scores of each region block, ensuring that the enhancement effect of degradation regions is preferentially preserved; the final output is a fundus image with differentially enhanced features. .

[0047] This embodiment innovatively introduces a degradation perception penalty term P based on the traditional self-attention mechanism. A specially designed degradation evaluation sub-network quantifies and scores the degree of degradation (blurriness, noise level, loss of structural integrity, etc.) of each local region of the image, and embeds this score into the calculation of the attention weights. Specifically, the elements of the penalty matrix P... The degree of degradation in each region was taken into account. Structural similarity between regions This mechanism enables severely degraded regions to selectively acquire complementary structural information from the global context for feature compensation, while the attention weights of clear regions remain almost unaffected. This effectively avoids the over-smoothing and artifact introduction problems common in traditional enhancement methods. The mechanism achieves adaptive perception and differentiated enhancement of different degraded regions of the image, improving the detail clarity of degraded regions while maintaining the overall natural transition and structural consistency of the image. Compared to existing globally uniform enhancement methods, this mechanism significantly improves the accuracy and balance of enhancement. It should be noted that the lightweight convolutional feature extraction sub-network, the self-attention calculation with penalty terms, and the feature recombination and output sub-network are trained together with the generator network.

[0048] S3: Constructing a generative network: This includes an encoder and a decoder. The encoder is used to extract the mean vector and logarithmic variance vector of the latent space of the fundus image after differential feature enhancement. The decoder gradually restores the spatial resolution based on the latent variables obtained by reparameterization sampling, and finally outputs an enhanced fundus image with the same size as the input.

[0049] Specifically, the generative network adopts a VAE-GAN hybrid architecture, deeply integrating the structural encoding capability of a variational autoencoder with the detail generation capability of a generative adversarial network, achieving synergistic optimization of structure preservation and detail recovery; the generative network outputs the results of step S2. As input, the output is an enhanced fundus image. More specifically, the implementation method is as follows: Encoder structure: The encoder is based on As input, it includes 6 convolutional layers (each layer contains 3×3 convolution, batch normalization (BN), Leaky ReLU activation, and a stride of 2). In this embodiment, the number of channels is 64, 128, 256, 512, 512, and 512 respectively, progressively compressing the input image into low-dimensional feature maps. After the last feature map layer, the mean vector of the latent space is output through two parallel fully connected layers. Sum of logarithmic variance vector ( For potential spatial dimensions, such as This probabilistic coding method gives the latent space a continuous and smooth structure, which is beneficial for encoding the global anatomical structure information of the image.

[0050] Reparameterized sampling: The latent variable z is sampled from the encoded Gaussian distribution using reparameterization techniques. ; in, For standard normal noise, This represents element-wise multiplication; this technique makes the sampling process differentiable, thus supporting backpropagation training.

[0051] Decoder Structure: The decoder is symmetrical to the encoder structure, including 6 deconvolutional layers (each layer contains 4×4 deconvolution, batch normalization, ReLU activation, and a stride of 2), with channel numbers of 512, 512, 256, 128, 64, and 3 / 1 respectively. The decoder gradually recovers the spatial resolution from the latent variable z, ultimately outputting an enhanced fundus image of the same size as the input. In this embodiment, a U-Net-style skip connection is introduced into the decoder to concatenate the feature maps of each layer of the encoder with the corresponding layers of the decoder to preserve multi-scale spatial detail information. In addition, a residual self-attention block is inserted between the 3rd and 4th layers of the decoder to aggregate global contextual information from intermediate feature maps, enhancing the consistency of long-range structures.

[0052] The total loss function of the generator network is defined as: ; in, This represents the total loss of the generator network. , , , and Let represent the pixel-level reconstruction loss, KL divergence regularization term, adversarial loss, perceptual loss, and structural similarity loss, respectively. ~ This corresponds to the weight of each loss term.

[0053] The following is a definition of each loss term: Pixel-level reconstruction loss The L1 norm is used to measure the pixel-wise absolute error between the generated image and the real high-quality image, defined as: ; in, This represents the enhanced fundus image output by the generator network. Represents the corresponding real high-quality reference image; ||·||1 represents the L1 norm, which is more robust to outliers than the L2 norm (mean squared error) and produces a clearer and sharper image; N is the total number of pixels in the image (enhanced fundus image).

[0054] KL divergence regularization term The latent distribution of the constraint encoder output approximates the standard normal prior distribution, defined as: ; The summation iterates through all dimensions of the latent space. This regularization term ensures the continuity and interpolability of the latent space, preventing the encoder from mapping different images to isolated latent regions, thus guaranteeing that the decoder can generate meaningful images at any location in the latent space.

[0055] Combating losses Feedback signals from the discriminative network drive the generative network to produce more realistic images; in this embodiment, Wasserstein distance is used as the adversarial loss, and the adversarial loss of the generative network is defined as: ; Where D(·) is the true / false discrimination head output of the discrimination network. Expressing expectations, This represents the enhanced fundus image output by the generative network. The generative network minimizes this loss to ensure that the discriminative network outputs the generated image as accurately as possible (i.e., the discriminative network considers the generated image more realistic). The Wasserstein distance has smoother gradient characteristics compared to the cross-entropy loss of the original GAN, effectively mitigating the gradient vanishing problem during training.

[0056] Perceived loss Based on the intermediate layer feature representation of the pre-trained VGG-16 network, the distance between the generated image and the real image in the high-level semantic feature space is measured and defined as: ; in, This represents the feature extraction function of the l-th layer of the VGG-16 network. In this embodiment, the feature maps of the two layers conv3_3 and conv4_3 are selected for calculation. These represent the number of channels, height, and width of the feature map at layer l, respectively, used for normalization. Perceptual loss measures image differences in the feature space rather than the pixel space, enabling it to capture high-frequency structural information such as texture and edges, thus compensating for the insensitivity of pixel-level L1 loss to high-frequency details.

[0057] Structural similarity loss : Directly optimize the degree of structural information preservation between the generated image and the real image, defined as: ; Here, SSIM(·,·) is the structural similarity exponential function, which calculates the similarity of the three components of brightness, contrast, and structure in a local region through a sliding window and takes the average. The SSIM value range is [0,1], and the larger the value, the more similar the structures are. Therefore, 1−SSIM is taken as the loss term to be minimized. This loss constrains the quality of the generated image from the three dimensions of brightness, contrast, and structure, complementing the pixel-level L1 loss and feature-level perceptual loss.

[0058] Weighting coefficients of each loss term ~ Determined through experiments (typical value) The basis for setting the weights is: Maximum weight ( =10) is a fundamental constraint to ensure pixel-level reconstruction quality; Second ( =5) to strengthen structural integrity; ( =2) Supplement high-frequency information constraints at the feature level; ( =1) Provide moderate adversarial drive to avoid training instability; Minimum weight ( =0.5) to ensure the regularization of the potential space without excessively sacrificing the reconstruction quality.

[0059] S4: Construct a discriminative network: This includes multiple parallel multi-scale convolutional branches. After the outputs of the multiple branches are fused, they are output through dual output heads, which output a single global true / false probability value and a single-channel truth confidence heatmap of the same size as the input image.

[0060] The discriminant network receives the enhanced fundus image output by the generator network and the corresponding real high-quality reference image as input, and provides adversarial feedback signals to the generator network through multi-scale feature discrimination. The specific implementation is as follows:

[0061] Network Architecture: In this embodiment, the discriminant network includes three parallel multi-scale convolutional branches, employing 3×3, 5×5, and 7×7 convolutional kernels respectively. Each branch contains four sequentially configured convolutional-instance normalization-LeakyReLU modules. The three branches capture fine textures (3×3 branch, corresponding to fine structures such as microvascular walls and retinal fiber layers), medium-scale features (5×5 branch, corresponding to vascular branches and small lesions), and large-scale structures (7×7 branch, corresponding to large-area structures such as the optic disc and macula). The output feature maps of the three branches are adaptively weighted and fused through a learnable channel attention module (based on a squeeze-and-excitation structure). The weights are dynamically determined by the texture complexity of the input region. Specifically, texture complexity is estimated by calculating the variance of local gradient magnitudes: regions with high complexity (such as densely populated microvascular regions) automatically increase the weights of small-scale branches; regions with low complexity (such as background regions) automatically increase the weights of large-scale branches.

[0062] Dual-output head design: The fused feature map passes through two output heads. The first output head is a true / false discrimination head, which outputs a single global true / false probability value through global average pooling and a fully connected layer. The second output header is a local confidence heatmap header, which maps the feature map into a single-channel truth confidence heatmap of the same size as the input image through 1×1 convolution. In the authenticity confidence heatmap, each pixel value is constrained to the [0,1] interval by a Sigmoid activation function, representing the confidence of the discriminator network in the authenticity of that location; regions with low confidence indicate that the discriminator considers the generation quality of that region to be poor. This authenticity confidence heatmap guides the optimization direction of the generator network during training through a gradient mask mechanism: in the backpropagation phase of each training round, the total loss function... Regarding the enhanced fundus images output by the generative network gradient (shape is) The same tensor is multiplied by the spatial weight matrix (1-M) before being propagated back into the layers of the generative network, i.e.: ; Among them, ∂ / ∂ The gradient of the total loss function with respect to the enhanced fundus image output by the generator network is given by a gradient value at each pixel location in the spatial dimension H×W; M is the realism confidence heatmap output by the local confidence heatmap head of the discriminator network, which is an H×W confidence matrix. Each element M(i,j)∈[0,1] in M ​​represents the confidence of the discriminator network in the generation quality at location (i,j); (1-M) inverts the confidence and uses it as a spatial weight (broadcast along the channel dimension C); This represents element-wise multiplication (Hadamard product). The gradient, after being masked and modulated, is then propagated back through each layer of the generator network using a chain rule, ultimately updating the generator network parameters θ. The design intent of this mechanism is as follows: for regions with low discriminant network confidence (i.e., small M values ​​and poor generation quality), the (1-M) value is close to 1, the gradient is almost unsuppressed, and the generator network obtains full optimization driving force in these regions; for regions with high discriminant network confidence (i.e., large M values ​​and good generation quality), the (1-M) value is close to 0, the gradient is significantly decayed, and the generator network no longer over-optimizes these already good regions. In this way, the gradient is spatially redistributed, causing the generator network to automatically concentrate optimization resources on weaker regions. This method achieves precise spatial guidance of the generator network's optimization direction by the discriminant network while maintaining the integrity of the loss function system.

[0063] In this embodiment, the probabilistic encoding capability of variational autoencoders (VAEs) and the adversarial generation capability of generative adversarial networks (GANs) are creatively deeply integrated to construct a two-stage image generation architecture that balances structural consistency and detail realism. The VAE encoder maps the input image to a structured latent probability distribution, constraining the continuity and smoothness of the latent space through KL divergence regularization, thereby preserving global anatomical information (vascular topology, optic disc morphology, macula position, etc.) at the latent representation level. The decoder, starting from sampled latent variables, gradually restores spatial resolution and generates enhanced images with the assistance of U-Net skip connections and residual self-attention modules. The discriminator network provides the generative network with feedback on the realism of high-frequency textures and local details through adversarial training. The synergistic constraints of multiple loss functions (pixel-level reconstruction loss, KL divergence loss, adversarial loss, perceptual loss, and SSIM structural loss) achieve an optimal balance between structural fidelity and detail restoration. Compared to existing pure GAN methods, the structured latent space of VAEs significantly improves the structural consistency of the enhanced images; compared to existing pure VAE methods, the adversarial training mechanism of GANs effectively solves the reconstruction blur problem.

[0064] Furthermore, this embodiment proposes a three-branch parallel multi-scale local feature extraction network as the discriminator. The three branches employ 3×3, 5×5, and 7×7 convolutional kernels, respectively, each focusing on texture features at different scales. Through a channel attention fusion module, the weight contribution of each branch is dynamically adjusted according to the texture complexity of the input region: in areas with dense microvessels, the weight of small-scale branches is automatically enhanced to capture fine vessel wall structures; in background areas, the weight of large-scale branches is automatically enhanced to assess regional consistency. In addition, the discriminator network innovatively designs a dual-output head structure: in addition to the true / false discrimination head, a local confidence heatmap head is added to generate a true confidence heatmap of the same size as the input image. This heatmap serves as an explicit feedback signal, directly guiding the generator to invest more optimization effort in areas with poor quality through weighted reconstruction loss, achieving precise guidance for the optimization of the generator network. The discriminator network achieves a qualitative improvement in both multi-scale texture discrimination capability and feedback accuracy.

[0065] S5: Adversarial Training: Adversarial training is performed on the generator network and the discriminator network based on low-quality fundus images and corresponding real high-quality reference image datasets.

[0066] Adversarial training strategy: This embodiment uses Wasserstein distance combined with gradient penalty term (WGAN-GP) as an adversarial training framework to improve training stability and alleviate mode collapse problem.

[0067] The loss function of the discriminant network is expressed as follows: ; in, This indicates the total loss of the discrimination network; This represents the output of the network authenticity discrimination header. Expressing expectations; This represents the enhanced fundus image output by the generator network. This represents the corresponding real high-quality reference image; the first two terms are the dual form of the Wasserstein distance, and the discriminator minimizes this loss to make it more accurate for real high-quality reference images. The higher the score, the better the generated enhanced fundus image. The rating should be as low as possible; and These represent the gradient penalty term and the gradient penalty weight, respectively. It is expressed as follows: ; Where Î represents and Random linear interpolation samples between ε~U(0,1) are uniformly distributed random numbers; The gradient of the discriminant network with respect to the interpolated sample Î is represented by ||·||2, which represents the L2 norm. The gradient penalty term constrains the gradient norm of the discriminant network to be close to 1 near the data manifold, thus satisfying the Lipschitz continuity constraint and ensuring training stability. In this embodiment, the gradient penalty weights... Set it to 10.

[0068] The adversarial loss of the generative network is defined in step S3. Its goal is to maximize the score of the discriminant network for the generated image, i.e., minimize the score. .

[0069] The generator network and the discriminator network are updated alternately with an initial training step ratio of 1:1. This ratio is dynamically adjusted according to the performance of the generator network under the training scheduling framework based on reinforcement learning.

[0070] S6: Image Enhancement: For the fundus image to be enhanced, after image preprocessing and local feature adaptive enhancement, it is input into the trained generative network and outputs a fundus image with enhanced quality.

[0071] In some embodiments, the discriminant network can operate as an optional quality assessment module: an enhanced fundus image is input into the discriminant network, which outputs the overall image authenticity probability (as an overall quality confidence score) and a local authenticity confidence heatmap (identifying the distribution of enhancement quality in different regions of the image). The system's final output includes: an enhanced fundus image file, an overall quality confidence score, and a visualized enhancement quality heatmap report for clinicians' reference.

[0072] In some preferred embodiments, a training scheduling framework based on reinforcement learning is introduced during adversarial training. This framework evaluates the output quality of the generator network in real time through a multi-dimensional reward function and dynamically schedules key hyperparameters during training accordingly. These key hyperparameters include the ratio of training steps for the generator network to those for the discriminator network. The parameter updates for the generator network are still based on the total loss function defined in step S3. Completed through standard backpropagation, the training scheduling framework based on reinforcement learning does not directly participate in gradient calculation, but rather acts as an upper-level scheduling controller to guide the overall direction of the training process.

[0073] The specific implementation process of the training scheduling framework based on reinforcement learning is as follows: The necessity of introducing a training scheduling framework based on reinforcement learning: In adversarial training, the following problems are difficult to solve using only the standard training process. First, the training balance between the generator and discriminator networks is dynamically changing: In the early stages of training, the discriminator network usually has the advantage, and the generator network struggles to generate effective gradients; in the later stages of training, as the generator network's capabilities improve, the discriminator network may experience feedback saturation, and the gradient signal weakens. If a fixed ratio of training steps and learning rate is used, it cannot adapt to this constantly changing adversarial situation, easily leading to pattern collapse (generator output convergence) or training oscillation (loss value repeatedly jumping between extremes). Second, the loss function defined in step S3... Although it can effectively drive the parameter optimization of the generator network, its various sub-loss terms ( , , , and These are all differentiable surrogate metrics, creating a semantic gap with the image quality evaluation standards that are of practical clinical concern. For example, low L1 reconstruction loss does not equate to clear microvascular structure, and a high SSIM value does not necessarily mean the image meets clinical diagnostic requirements. While image quality assessment metrics such as PSNR, SSIM, and LPIPS, as well as the ClinicalScore, are closer to the final quality goal, they are either non-differentiable or computationally too expensive to be directly used as loss terms in backpropagation. Thirdly, the aforementioned quality metrics can only be calculated after the complete image is generated, representing delayed feedback signals that cannot be embedded in the computational graph of layer-by-layer gradient propagation. Reinforcement learning frameworks are naturally suited to handle such scenarios: they do not require differentiable reward signals, can perform decision optimization based on delayed, discontinuous evaluation signals, and adaptively adjust strategies through trial and error mechanisms. Therefore, this embodiment draws on the core idea of ​​"adjusting strategies based on environmental feedback" in reinforcement learning, integrating non-differentiable multidimensional quality metrics into a reward function, thereby driving the dynamic scheduling of key hyperparameters and superimposing an adaptive macro-control mechanism on top of standard backpropagation training.

[0074] Multidimensional reward function design: To quantitatively evaluate the output quality of the generator network in each training round, the following multidimensional reward function is designed: ; Where R represents the total reward; ΔPSNR = PSNR( , PSNR , PSNR represents the improvement in peak signal-to-noise ratio (PSNR) between the enhanced and unenhanced images. A higher PSNR indicates less pixel-level distortion. , ) and PSNR( , The peak signal-to-noise ratio (PSNR) of the enhanced image and the peak signal-to-noise ratio (PSNR) of the unenhanced image are respectively represented. This indicates an enhanced anterior fundus image; = SSIM( , ) - SSIM( , SSIM (Structural Similarity metric) represents the improvement in structural similarity between the enhanced and unenhanced images. , ) and SSIM ( , ) represent the structural similarity index of the enhanced image and the structural similarity index of the unenhanced image, respectively; = LPIPS( , ) - LPIPS , ), representing the improvement in perceptual distance metrics between the enhanced image and the unenhanced image (a smaller LPIPS indicates better perceptual quality; the difference is taken to indicate a positive improvement direction), LPIPS( , ) and LPIPS , () represent the perceived distance index of the enhanced image and the perceived distance index of the unenhanced image, respectively; This represents the confidence score output after the enhanced image is input into a pre-trained clinical quality assessment network. In this embodiment, the clinical quality assessment network is a binary classifier trained on the ResNet-18 architecture. It is trained under supervision on a labeled fundus image quality dataset. The labeling criteria are: images with clearly identifiable blood vessel orientation, intact optic disc contours, and no obvious artifacts in the macular region are labeled as "meeting clinical diagnostic requirements" (positive class); otherwise, they are labeled as negative class. The clinical quality assessment network is pre-trained before adversarial training, and its parameters are frozen during inference, serving only as a scorer.

[0075] Weight of each reward item ~ The typical value is PSNR and SSIM, as the most basic image quality metrics, are given higher weights, while LPIPS and ClinicalScore, as supplementary metrics for higher-level perception and clinical usability, are given lower weights.

[0076] Co-evolutionary mechanism: During adversarial training, the training step ratio between the generator and discriminator networks is dynamically adjusted based on the value of the reward function R. The initial training step ratio is set to 1:1 (i.e., the generator and discriminator networks each update once per round). When the generator network's reward value exceeds a preset threshold (set as 1.05 times the current moving average of the reward) for five consecutive rounds, the training step ratio of the discriminator network is increased (from 1:1 to 2:1 or 3:1), increasing the discrimination difficulty and forcing the generator network to continuously optimize at a higher standard. Conversely, if the generator network's reward decreases for three consecutive rounds, the discriminator network's training step ratio is reverted to 1:1, giving the generator network room to recover. The upper limit of the training step ratio is set to 3:1 to prevent the discriminator network from becoming too strong and causing the generator network's gradient to vanish. Of course, in some embodiments, the co-evolutionary mechanism can also be extended to the learning rate, for example, by mapping the changes in the total reward R over two consecutive rounds to obtain the updated learning rate, achieving dynamic optimization of the learning rate. This co-evolutionary training dynamic, which combines competition and cooperation, significantly avoids common problems such as pattern collapse and training instability during training. It is significantly superior to the standard adversarial training scheme that uses fixed hyperparameters in terms of both training stability and final generation quality.

[0077] This invention also provides a degradation-aware fundus image quality enhancement system, comprising: Image input interface: used to support fundus image input, its output is connected to the preprocessing module; Preprocessing module: Used to perform normalization preprocessing on the input raw low-quality fundus image, and its output is connected to the local feature adaptive enhancement module; Local Feature Adaptive Enhancement Module: This module is used to divide the preprocessed fundus image into regions, then extract features and evaluate the degree of degradation of each region, and introduces a self-attention mechanism with a degradation perception penalty term to achieve differentiated feature enhancement of different degradation regions in the preprocessed fundus image. Its output is connected to the generator. The generator consists of an encoder and a decoder. The encoder extracts the mean vector and log-variance vector of the latent space of the fundus image after differential feature enhancement. The decoder gradually restores the spatial resolution based on the latent variables obtained by reparameterization sampling. Finally, it outputs an enhanced fundus image with the same size as the input. Its output is connected to the discriminator and the image output interface. Discriminator: It includes multiple parallel multi-scale convolutional branches. After the outputs of multiple branches are fused, they output a single global true / false probability value and a single-channel truth confidence heatmap of the same size as the input image through dual output heads. During the training phase, its output feedback signal is connected to the generator to form closed-loop adversarial training. Optimization Controller: Used to evaluate the generator's output quality in real time based on a multidimensional reward function, and dynamically adjust key hyperparameters for generator and discriminator training, including the ratio of training steps for the generator and discriminator; it is only active during the training phase. Image output interface: Used to output enhanced quality fundus images.

[0078] It should be understood that the functional unit modules in the various embodiments of the present invention can be concentrated in one processing unit, or each unit module can exist physically separately, or two or more unit modules can be integrated into one unit module, and can be implemented in hardware or software.

[0079] This invention also provides an electronic device, which includes one or more processors and a memory; the memory is coupled to the one or more processors and is used to store a computer program, wherein the one or more processors call the computer program to cause the electronic device to perform the degradation-aware fundus image quality enhancement method as described above.

[0080] This invention also provides a computer-readable storage medium comprising a computer program that, when run on an electronic device, causes the electronic device to perform the aforementioned method for enhancing fundus image quality based on degradation perception.

[0081] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0082] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0083] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0084] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0085] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0086] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.

[0087] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for enhancing the quality of fundus images based on degradation perception, characterized in that, Includes the following steps: Image preprocessing: Standardization preprocessing is performed on the original low-quality fundus images; Local feature adaptive enhancement: The preprocessed fundus image is divided into regions, and then features are extracted and the degree of degradation is evaluated for each region. A self-attention mechanism with a degradation perception penalty term is introduced to achieve differentiated feature enhancement for different degradation regions in the preprocessed fundus image. The local feature adaptive enhancement includes: Region segmentation and feature extraction: The preprocessed fundus image is divided into several overlapping local regions; each region is processed by a lightweight convolutional feature extraction subnetwork with shared weights to extract feature representations, outputting a d-dimensional feature vector; the feature vectors of all regions are combined to form a feature matrix. , where N is the total number of region blocks; Degradation Assessment: A lightweight degradation assessment subnetwork, operating in parallel with a lightweight convolutional feature extraction subnetwork, quantifies the degradation level of each region block. The degradation scores of all regions blocks are combined to form a degradation score vector. , Indicates the first i Degradation score for each region block; Self-attention computation with penalty terms: using the feature matrix and degenerate score vector As input, a degradation perception penalty term is introduced on top of the standard self-attention mechanism to calculate the enhanced feature matrix. The degradation perception penalty term is the penalty matrix P, whose i.e., the first term is the penalty term P. Each element is defined as ,in For learnable scalar parameters, For the first i The first block and the first j Structural similarity of regions / blocks; Feature Recombination and Output: The enhanced feature matrix The feature vectors of each region block in the image are decoded using a sub-network; for overlapping regions, a weighted averaging strategy is used for fusion, with the weights proportional to the degradation scores of each region block; the final output is a fundus image with enhanced differential features. ; Constructing the generative network: The generative network adopts a VAE-GAN hybrid architecture, including an encoder and a decoder. The encoder is used to extract the mean vector and logarithmic variance vector of the latent space of the fundus image after differential feature enhancement. The decoder gradually restores the spatial resolution based on the latent variables obtained by reparameterization sampling, and finally outputs an enhanced fundus image with the same size as the input. The discriminative network is constructed, which includes multiple parallel multi-scale convolutional branches. After the outputs of multiple branches are fused, they are output through dual output heads, which output a global single true / false probability value and a single-channel truth confidence heatmap of the same size as the input image. The output feature maps of each branch are adaptively weighted and fused through a learnable channel attention module, and the weights are dynamically determined by the texture complexity of the input region. Adversarial training: The generator network and the discriminator network are trained adversarially using a dataset of low-quality fundus images and corresponding real high-quality reference images. Image enhancement: For the fundus image to be enhanced, after image preprocessing and local feature adaptive enhancement, it is input into the trained generative network and outputs a fundus image with enhanced quality. The total loss function of the generator network is defined as: in, This represents the total loss of the generator network. , , , and Let represent the pixel-level reconstruction loss, KL divergence regularization term, adversarial loss, perceptual loss, and structural similarity loss, respectively. ~ This corresponds to the weight of each loss term; The confidence heatmap M, used to determine the authenticity of the network output, guides the optimization direction of the generator network during training through a gradient masking mechanism: in the backpropagation phase of each training round, the total loss function... Regarding the enhanced fundus images output by the generative network gradient Before continuing to backpropagate to each layer within the generator network, multiply by the spatial weight matrix (1-M).

2. The method for enhancing fundus image quality based on degradation perception according to claim 1, characterized in that, The image preprocessing includes: Size standardization: The original low-quality fundus images are uniformly scaled to a fixed size; Basic noise suppression: Bilateral filtering is applied to the size-normalized fundus image for noise reduction; Contrast pre-adjustment: Adaptive contrast-limited histogram equalization is used to enhance the contrast of the denoised fundus image.

3. The method for enhancing fundus image quality based on degradation perception according to claim 1, characterized in that, The generative network adopts a VAE-GAN hybrid architecture, in which the encoder includes a 6-layer convolutional module and two parallel fully connected layers. The two parallel fully connected layers output the mean vector and the log-variance vector of the latent space, respectively. The decoder includes a 6-layer deconvolution module and introduces U-Net-style skip connections to concatenate the feature maps of each layer of the encoder with the corresponding layers of the decoder. In addition, a residual self-attention module is inserted between the 3rd and 4th layers of the decoder.

4. The method for enhancing fundus image quality based on degradation perception according to claim 1, characterized in that, The discriminant network comprises three parallel multi-scale convolutional branches, each containing four sequentially arranged convolutional-instance normalization-LeakyReLU modules. The output feature maps of the three branches are adaptively weighted and fused through a learnable channel attention module. The weights are dynamically determined by the texture complexity of the input region, which is estimated by calculating the variance of local gradient magnitudes. The fused feature map passes through two output heads. The first output head is a true / false discrimination head, which outputs a single global true / false probability value through global average pooling and a fully connected layer. The second output header is a local confidence heatmap header, which maps the feature map into a single-channel truth confidence heatmap of the same size as the input image through 1×1 convolution. In the authenticity confidence heatmap, each pixel value is constrained to the [0,1] interval by the Sigmoid activation function, which represents the confidence of the discrimination network in the authenticity of the location; The loss function of the discriminant network is expressed as follows: in, This indicates the total loss of the discrimination network; This represents the output of the network authenticity discrimination header. Expressing expectations; This represents the enhanced fundus image output by the generator network. This represents the corresponding real, high-quality reference image; and These represent the gradient penalty term and the gradient penalty weight, respectively. It is expressed as follows: Where Î represents and Random linear interpolation samples between This represents the gradient of the discriminant network with respect to the interpolated sample Î; This represents the L2 norm.

5. The method for enhancing fundus image quality based on degradation perception according to any one of claims 1 to 4, characterized in that, In adversarial training, a training scheduling framework based on reinforcement learning is introduced. This framework evaluates the output quality of the generator network in real time through a multi-dimensional reward function and dynamically schedules key hyperparameters during training accordingly. These key hyperparameters include the ratio of training steps for the generator network to those for the discriminator network. The multi-dimensional reward function is expressed as follows: Where R represents the total reward, and ΔPSNR represents the improvement in peak signal-to-noise ratio of the enhanced image compared to the unenhanced image; This indicates the improvement in structural similarity metrics between the enhanced image and the unenhanced image. This indicates the improvement in the perceptual distance metric between the enhanced image and the unenhanced image. This represents the confidence score output after the enhanced image is input into a pre-trained clinical quality assessment network; ~ This corresponds to the weight of each reward item.

6. A system for enhancing the quality of fundus images based on degradation perception, characterized in that, For implementing the degradation-aware fundus image quality enhancement method as described in any one of claims 1 to 5, the system comprises: Image input interface: used to support fundus image input, its output is connected to the preprocessing module; Preprocessing module: Used to perform normalization preprocessing on the input raw low-quality fundus image, and its output is connected to the local feature adaptive enhancement module; Local Feature Adaptive Enhancement Module: This module is used to divide the preprocessed fundus image into regions, then extract features and evaluate the degree of degradation of each region, and introduces a self-attention mechanism with a degradation perception penalty term to achieve differentiated feature enhancement of different degradation regions in the preprocessed fundus image. Its output is connected to the generator. The generator consists of an encoder and a decoder. The encoder extracts the mean vector and log-variance vector of the latent space of the fundus image after differential feature enhancement. The decoder gradually restores the spatial resolution based on the latent variables obtained by reparameterization sampling. Finally, it outputs an enhanced fundus image with the same size as the input. Its output is connected to the discriminator and the image output interface. Discriminator: It includes multiple parallel multi-scale convolutional branches. After the outputs of multiple branches are fused, they output a single global true / false probability value and a single-channel truth confidence heatmap of the same size as the input image through dual output heads. During the training phase, its output feedback signal is connected to the generator to form closed-loop adversarial training. Optimization Controller: Used to evaluate the generator's output quality in real time based on a multidimensional reward function, and dynamically adjust key hyperparameters for generator and discriminator training, including the ratio of training steps for the generator and discriminator; it is only active during the training phase. Image output interface: Used to output enhanced quality fundus images.

7. An electronic device, characterized in that, The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store a computer program, the one or more processors calling the computer program to cause the electronic device to perform the degradation-perception-based fundus image quality enhancement method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when run on an electronic device, causes the electronic device to perform the degradation-perception-based fundus image quality enhancement method as described in any one of claims 1 to 5.