Eye fundus image optic cup and optic disc segmentation method, system and terminal

By constructing the fundus image viewing disc segmentation model of the autoencoder and denoising module, using the dual-branch structure and feature frequency information analyzer, the problems of insufficient utilization of boundary feature information and poor noise interaction are solved, and the segmentation results are significantly improved. accuracy.

CN119067985APending Publication Date: 2024-12-03SHENZHEN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410920859.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, when performing the visual cup disc segmentation of the fundus image based on convolutional neural network and denoising diffusion probability model, boundary feature information is insufficient, and the denoising architecture cannot efficiently integrate semantics and noise interactions, resulting in inaccurate segmentation results.

Method used

Build a fundus visual disc segmentation model including an autoencoder, forward noise addition module and reverse noise denoising module. Through step-by-step noise addition and denoising processes of multiple time steps, double-use noise branching and conditional image branching is used. Branch structure, combining feature frequency information analyzer and hybrid attention module, calculates loss functions to integrate semantic features and noise interactions.

Benefits of technology

Improves the accuracy of fundus image visual cup disc segmentation, which is better than the performance performance of traditional methods on public data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067985A_ABST
    Figure CN119067985A_ABST
Patent Text Reader

Abstract

The invention discloses an eye fundus image optic cup and optic disc segmentation method, system and terminal, and the method comprises the steps: constructing an eye fundus image optic cup and optic disc segmentation model, obtaining an eye fundus image and an original segmentation mask of the eye fundus image, inputting the original segmentation mask into an auto-encoder of the segmentation model, and carrying out the dimension reduction, inputting the dimension-reduced segmentation mask into a forward noise adding module of the segmentation model, and gradually adding noise to the dimension-reduced segmentation mask by using noise to obtain a noise mask; inputting the noise mask and the eye fundus image into a reverse denoising module of a segmentation model for gradual denoising to obtain predicted noise, and calculating a loss function by using the predicted noise and the noise to obtain a target segmentation model; and obtaining a target fundus image, inputting the target fundus image into the target segmentation model for calculation, and obtaining an optic disc and optic cup segmentation grey-scale map of the target fundus image. According to the method, interaction of semantic features and noise can be integrated more efficiently, and the accuracy of the segmentation result of the optic cup and optic disk of the fundus image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, system, terminal and computer-readable storage medium for segmenting optic cups and discs of fundus images. Background Art

[0002] The calculation of the cup-to-disc ratio requires accurate extraction of the optic disc and cup areas. Manual segmentation of the optic disc and cup is a time-consuming professional task, and manually evaluated fundus images may have significant differences in judgment due to various human factors. Therefore, it is necessary to develop a method to automatically and accurately segment the optic cup and disc in fundus images for early diagnosis of glaucoma. Traditional methods for segmenting the optic cup and disc are mainly based on the color, boundary detection, contrast threshold, and morphology of the optic disc, and mainly rely on manual extraction of image features. The segmentation effect will be affected by the image shooting quality, the lesion area, and other fundus structures. In addition, the number of extracted features is small and the type is fixed, which will affect the generalization performance of the model.

[0003] At present, some optic cup and optic disc segmentation methods based on convolutional neural networks have also been proposed and achieved good results; however, these methods have ignored the use of the boundary feature information of the optic cup and optic disc; at the same time, the denoising diffusion probability model has also been applied to the field of medical image segmentation, realizing the implicit integration of uncertainty mapping and segmentation, but its denoising architecture cannot efficiently integrate semantics and noise interactions, resulting in inaccurate segmentation results of the optic cup and optic disc in fundus images.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] The main purpose of the present invention is to provide a method, system, terminal and computer-readable storage medium for segmenting the optic cup and optic disc of fundus images, aiming to solve the problem in the prior art that when segmenting the optic cup and optic disc of fundus images based on convolutional neural networks and denoising diffusion probability models, the boundary feature information of the cup and optic disc is insufficiently utilized, and the denoising architecture cannot efficiently integrate semantics and noise interaction, resulting in inaccurate segmentation results of the optic cup and optic disc of fundus images.

[0006] To achieve the above object, the present invention provides a method for segmenting the optic cup and optic disc of a fundus image, the method comprising the following steps:

[0007] Constructing a segmentation model of the optic cup and optic disc of the fundus image, wherein the segmentation model of the optic cup and optic disc of the fundus image comprises an autoencoder, a forward denoising module and a reverse denoising module;

[0008] Acquire training data, the training data including a fundus image and an original segmentation mask corresponding to the fundus image, input the original segmentation mask into the autoencoder for dimensionality reduction, and obtain a segmentation mask after dimensionality reduction;

[0009] Inputting the dimension-reduced segmentation mask into the forward noise adding module, and using noise to gradually add noise to the dimension-reduced segmentation mask over multiple time steps to obtain a noise mask;

[0010] Inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain predicted noise at all time steps, and using the predicted noise and the noise at the corresponding time step to calculate a loss function until the loss function converges to obtain a target segmentation model;

[0011] A target fundus image to be segmented is acquired, and the target fundus image is input into the target segmentation model for calculation to obtain an optic disc and optic cup segmentation grayscale image of the target fundus image.

[0012] Optionally, the method for segmenting the optic cup and optic disc of the fundus image, wherein the step of inputting the segmentation mask after dimensionality reduction into the forward denoising module, and using noise to perform stepwise denoising on the segmentation mask after dimensionality reduction at multiple time steps to obtain a noise mask, specifically comprises:

[0013] Inputting the dimension-reduced segmentation mask into the forward denoising module, wherein the forward denoising module includes a denoising network at multiple time steps;

[0014] Gaussian noise is gradually added to the segmentation mask after dimension reduction through multiple noise adding networks, and after multiple time steps, a noise mask after gradual noise addition is obtained.

[0015] Optionally, in the method for segmenting the optic cup and optic disc of a fundus image, the denoising network comprises an encoder, a decoder and a bottleneck module;

[0016] The encoder includes four stacked encoder blocks, each of which includes a noise image branch and a conditional image branch, each branch includes two residual blocks and a hybrid attention module, and the two branches are connected by two feature frequency information analyzers;

[0017] The decoder comprises four stacked decoder blocks, two convolutional blocks and a residual block, each of the decoder blocks comprises two consecutive residual blocks and a hybrid attention module;

[0018] The bottleneck module is connected to the encoder and the decoder, and the bottleneck module includes two residual blocks and a hybrid attention module.

[0019] Optionally, the method for segmenting the optic cup and optic disc of the fundus image, wherein the step of inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for stepwise denoising to obtain predicted noise at all time steps, specifically comprises:

[0020] Inputting the noise mask at the current time step, the fundus image and the inverse denoising module, wherein the inverse denoising module includes denoising networks at multiple time steps;

[0021] Down-sampling the noise mask and the fundus image through the decoder, outputting a tensor, inputting the tensor into the bottleneck module for rearrangement and calculation to obtain a bottleneck output result, and inputting the bottleneck output result into the decoder for up-sampling to obtain a first predicted noise at a current time step;

[0022] The noise mask at the previous time step is predicted according to the noise mask at the current time step, and the second predicted noise at the previous time step is continuously calculated according to the noise mask at the previous time step and the fundus image until the predicted noise at all time steps is obtained.

[0023] Optionally, the method for segmenting the optic cup and optic disc of the fundus image, wherein the loss function is calculated using the predicted noise and the noise at the corresponding time step, specifically comprises:

[0024] The loss function is calculated based on the predicted noise and the noise at the corresponding time step.

[0025] Where t represents the time step, X t represents the noise mask at time step t, g represents the fundus image, ∈ θ (X t ,g,t) represents the prediction noise at time step t,∈ represents the noise at time step t, and W θ is a dynamic parameter, and α is a hyperparameter.

[0026] Optionally, in the method for segmenting the optic cup and optic disc of a fundus image, the tensor comprises: a noise image branch output tensor and a conditional image branch output tensor;

[0027] The downsampling the noise mask and the fundus image by the decoder to output a tensor specifically includes:

[0028] Input the noise mask and the current time step into the noise image branch of the encoder block, obtain a first noise capture feature through a first residual block in the noise image branch, input the fundus image and the current time step into the conditional image branch, and obtain a first conditional capture feature through a first residual block in the conditional image branch;

[0029] Feeding back the first noise capture feature in the noise image branch to the conditional image branch through the first feature frequency information analyzer, concatenating the first noise capture feature and the first conditional capture feature to obtain a first jump output;

[0030] Inputting the first skip output and the current time step into a second residual block in the conditional image branch of the encoder block to obtain a second conditional captured feature;

[0031] Feeding back the second conditional capture feature to the noise image branch through a feedback mechanism, multiplying the second conditional capture feature with the first noise capture feature to obtain a multiplication result, and inputting the multiplication result into a second residual block in the noise image branch to obtain a second noise capture feature;

[0032] Inputting the second noise capture feature into the hybrid attention module of the noise image branch for feature capture to obtain a noise image branch output tensor;

[0033] Feeding the noise image branch output back to the conditional image branch through the second characteristic frequency information analyzer, splicing the noise image branch output with the second conditional capture feature to obtain a second jump output;

[0034] Inputting the second jump output into the hybrid attention module of the conditional image branch for feature capture to obtain a conditional image branch output tensor;

[0035] The first jump output and the second jump output are used for a jump connection between an encoder and a decoder.

[0036] Optionally, the method for segmenting the optic cup and optic disc of the fundus image, wherein the step of inputting the output result to the decoder for upsampling to obtain the first predicted noise at the current time step, specifically comprises:

[0037] Inputting the bottleneck output result and the current time step into a first residual block of the decoder block to obtain a first residual capture feature;

[0038] Receiving a first skip output from the encoder block, and concatenating the first skip output with the first residual capture feature to obtain a first concatenated result;

[0039] Inputting the first splicing result and the current time step into a second residual block of the decoder block to obtain a second residual capture feature;

[0040] receiving a second skip output from the encoder block, and concatenating the second skip output with the second residual capture feature to obtain a second concatenated result;

[0041] Inputting the second splicing result into the hybrid attention module of the encoder block for extraction to obtain refined information;

[0042] After the refined information passes through the first convolution block of the decoder, the residual block of the decoder and the second convolution block of the decoder in sequence, the first prediction noise at the current time step is output.

[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a fundus image optic cup and optic disc segmentation system, wherein the fundus image optic cup and optic disc segmentation system comprises:

[0044] A model building module, used to build a segmentation model of the optic cup and optic disc of the fundus image, wherein the segmentation model of the optic cup and optic disc of the fundus image includes an autoencoder, a forward denoising module and a reverse denoising module;

[0045] A training data dimensionality reduction module is used to obtain training data, wherein the training data includes a fundus image and an original segmentation mask corresponding to the fundus image, and input the original segmentation mask into the autoencoder for dimensionality reduction to obtain a segmentation mask after dimensionality reduction;

[0046] A stepwise noise adding module, used for inputting the segmentation mask after dimension reduction into the forward noise adding module, and performing stepwise noise adding on the segmentation mask after dimension reduction at multiple time steps using noise to obtain a noise mask;

[0047] A model training module, used for inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain predicted noise at all time steps, and using the predicted noise and the noise at the corresponding time step to calculate a loss function until the loss function converges to obtain a target segmentation model;

[0048] The cup-to-disc ratio calculation module is used to obtain a target fundus image to be segmented, input the target fundus image into the target segmentation model for calculation, and obtain an optic disc-to-cup segmentation grayscale image of the target fundus image.

[0049] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a fundus image optic cup and optic disc segmentation program stored in the memory and executable on the processor, wherein the fundus image optic cup and optic disc segmentation program, when executed by the processor, implements the steps of the fundus image optic cup and optic disc segmentation method as described above.

[0050] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a fundus image optic cup and optic disc segmentation program, and when the fundus image optic cup and optic disc segmentation program is executed by a processor, the steps of the fundus image optic cup and optic disc segmentation method as described above are implemented.

[0051] In the present invention, a segmentation model of the optic cup and optic disc of the fundus image is constructed, the fundus image and the original segmentation mask corresponding to the fundus image are obtained, the original segmentation mask is input into the autoencoder of the segmentation model for dimensionality reduction, the segmentation mask after dimensionality reduction is input into the forward denoising module of the segmentation model, and the segmentation mask after dimensionality reduction is gradually denoised using noise to obtain a noise mask; the noise mask and the fundus image are input into the reverse denoising module of the segmentation model for gradual denoising to obtain predicted noise, and a loss function is calculated using the predicted noise and the noise to obtain a target segmentation model; the target fundus image is obtained, and the target fundus image is input into the target segmentation model for calculation to obtain a grayscale image of the optic cup and optic disc segmentation of the target fundus image. The present invention can more efficiently integrate the interaction of semantic features and noise, and improve the accuracy of the segmentation results of the optic cup and optic disc of the fundus image. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a flow chart of a preferred embodiment of the method for segmenting the optic cup and optic disc of fundus images of the present invention;

[0053] Figure 2 It is a general framework diagram of a segmentation model of the optic cup and optic disc of a fundus image in the method for segmenting the optic cup and optic disc of a fundus image of the present invention;

[0054] Figure 3 It is a structural diagram of the encoder block in the method for segmenting the optic cup and optic disc of the fundus image of the present invention;

[0055] Figure 4 It is a structural diagram of a hybrid attention module in the method for segmenting the optic cup and optic disc of fundus images of the present invention;

[0056] Figure 5 It is a structural diagram of a characteristic frequency information analyzer in the method for segmenting the optic cup and optic disc of a fundus image of the present invention;

[0057] Figure 6 It is a structural diagram of a decoder block in the method for segmenting the optic cup and optic disc of a fundus image of the present invention;

[0058] Figure 7 It is a flow chart of downsampling the noise mask and the fundus image by a decoder in the method for segmenting the optic cup and optic disc of the fundus image of the present invention;

[0059] Figure 8 It is a schematic diagram of the principle of a preferred embodiment of the system for segmenting the optic cup and optic disc of fundus images of the present invention;

[0060] Fig. 9 Schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION

[0061] The present application provides a method for segmenting the optic cup and optic disc of a fundus image and related equipment. In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

[0062] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0063] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0064] The method for segmenting the optic cup and optic disc of the fundus image described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the method for segmenting the optic cup and optic disc of the fundus image comprises the following steps:

[0065] Step S10, constructing a segmentation model of the fundus image optic cup and optic disc, wherein the segmentation model of the fundus image optic cup and optic disc comprises an autoencoder, a forward denoising module and a reverse denoising module.

[0066] Specifically, Figure 1As shown, a segmentation model of the optic cup and optic disc of the fundus image is constructed, and the segmentation model of the optic cup and optic disc of the fundus image is constructed based on the diffusion model. After training, it is used to generate a segmentation mask of the optic cup and optic disc of the fundus image; the segmentation model of the optic cup and optic disc of the fundus image includes an autoencoder, a forward denoising module and a reverse denoising module.

[0067] Wherein, the autoencoder is a pre-trained artificial neural network, which is used to map the input image from a high-dimensional space (256*256) to a low-dimensional space (64*64). The focus of the segmentation model of the fundus image optic cup and optic disc is the denoising diffusion model (Denoising Diffusion Probabilistic Model, DDPM), which mainly uses T time steps to learn the potential distribution q(X0) of the training data, and performs variational inference on the Markov process. The framework includes two processes, the forward denoising process and the reverse denoising process (i.e., the forward denoising module and the reverse denoising module in the present invention). In the forward denoising process, the model starts from the original segmentation mask X0, gradually adds Gaussian noise, and gradually converts it into a noise mask.

[0068] Step S20: acquiring training data, wherein the training data includes a fundus image and an original segmentation mask corresponding to the fundus image, and inputting the original segmentation mask into the autoencoder for dimensionality reduction to obtain a segmentation mask after dimensionality reduction.

[0069] It can be understood that in order to train the segmentation model of the fundus image optic cup and optic disc, training data (fundus image and the original segmentation mask corresponding to the fundus image) are obtained. In this embodiment, the training data used are respectively from two publicly available data sets PALM and REFUGE. The REFUGE data set contains 1,200 fundus images and corresponding optic disc and optic cup segmentation masks (represented by different grayscales in the same image), and is divided into a training set, a validation set, and a test set according to a preset ratio. In order to save computing resources, the size of the original image is adjusted to 256×256×3 in this implementation. At the same time, in order to prevent the network from overfitting, the training data is enhanced by various transformations such as translation, rotation, flipping, affine, color jitter and grayscale. In addition, for fair comparison, all settings in this embodiment are consistent for all comparison methods, and the algorithm is implemented on the PyTorch platform using three NVIDIA RTXA6000 GPUs.

[0070] Furthermore, the obtained original segmentation mask is input into the autoencoder for dimensionality reduction to obtain a segmentation mask after dimensionality reduction. The autoencoder maps the input image from a high-dimensional space to a low-dimensional space to achieve dimensionality reduction, so as to reduce the huge amount of computation of the probability denoising diffusion model.

[0071] Step S30: input the segmentation mask after dimensionality reduction into the forward noise adding module, and use noise to gradually add noise to the segmentation mask after dimensionality reduction over multiple time steps to obtain a noise mask.

[0072] Specifically, the dimensionally reduced segmentation mask is input into the forward denoising module, which includes a denoising network over multiple time steps.

[0073] Furthermore, Gaussian noise is gradually added to the segmentation mask after dimension reduction through multiple noise adding networks, and after multiple time steps, a noise mask after gradual noise addition is obtained.

[0074] It can be understood that for an image X at a given time step t t , the noise adding process q of the forward noise adding network is:

[0075]

[0076] Among them, q(X t |X t-1 ) represents the image X at time step t-1 t-1 To the image X at time step t t The noise adding process, I represents the identity matrix, T represents the total time step, represents the normal distribution, β1,…,β T is the variance at different time steps in the forward process, and the purpose is to add a small amount of Gaussian noise to the image at each step.

[0077] Repeat the above operation t times to get the image X from X0 to time step t t The noise adding process is expressed as:

[0078] Among them, let α t =1-β t ,make β t represents the variance at time step t, s represents the ordinal number of the operation, and α t and These are values ​​defined for convenience of representation. s Indicates α1, α2...α t The cumulative multiplication of .

[0079] Furthermore, using the reparameterization technique, we can directly convert X t Written as a function of the segmentation mask X0 after dimensionality reduction:

[0080] Here, ∈ represents the noise added at time step t.

[0081] Step S40, input the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain the predicted noise at all time steps, and use the predicted noise and the noise at the corresponding time steps to calculate the loss function until the loss function converges to obtain the target segmentation model.

[0082] like Figure 2 As shown, the inverse denoising module includes a denoising network at multiple time steps, and the denoising network includes an encoder, a decoder and a bottleneck module.

[0083] Specifically, if Figure 3 As shown, the encoder includes four stacked encoder blocks, each of which includes a noise image branch and a conditional image branch, each of which includes two residual blocks and a hybrid attention module (such as Figure 4 As shown, the hybrid attention module represents the combination of free attention and linear attention), and the two branches are connected by two feature frequency information analyzers (such as Figure 5 As shown, the function of the characteristic frequency information analyzer is to constrain the noise-related components in the characteristics);

[0084] like Figure 6 As shown, the decoder includes four stacked decoder blocks, two convolution blocks and a residual block, and each of the decoder blocks includes two consecutive residual blocks and a hybrid attention module;

[0085] The bottleneck module is connected to the encoder and the decoder, and the bottleneck module includes two residual blocks and a hybrid attention module.

[0086] Furthermore, the step of inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for stepwise denoising to obtain predicted noise at all time steps specifically includes:

[0087] Inputting the noise mask at the current time step, the fundus image and the inverse denoising module, wherein the inverse denoising module includes denoising networks at multiple time steps;

[0088] Down-sampling the noise mask and the fundus image through the decoder, outputting a tensor, inputting the tensor into the bottleneck module for rearrangement and calculation to obtain a bottleneck output result, and inputting the bottleneck output result into the decoder for up-sampling to obtain a first predicted noise at a current time step;

[0089] The noise mask at the previous time step is predicted according to the noise mask at the current time step, and the second predicted noise at the previous time step is continuously calculated according to the noise mask at the previous time step and the fundus image until the predicted noise at all time steps is obtained.

[0090] It can be understood that the inverse denoising process p θ It can be learned by the model parameters θ:

[0091]

[0092] Based on the above formula, we can get t Prediction X t-1 :

[0093]

[0094] Among them, p θ (X t-1 |X t ) represents the image X at time step t t To the image X at time step t-1 t-1 The inverse denoising process, σ t is the parameter of model training, μ θ is the mean of the normal distribution z is a random normally distributed variable at time t. ∈ θ are the parameters of the denoising network to be trained, the input of the denoising network is the noise mask X at time step t t , time step t and the fundus image, the output is ∈ θ (X t , t) is the X predicted by DDPM t Gaussian noise at time t. If t is not equal to 1, then Otherwise z is 0. From t=T to t=1, repeat T times to gradually return from the noise to the true segmentation mask X0.

[0095] The use of the predicted noise and the noise at the corresponding time step to calculate the loss function specifically includes:

[0096] The loss function is calculated based on the predicted noise and the noise at the corresponding time step.

[0097] Where t represents the time step, X t represents the noise mask at time step t, g represents the fundus image, ∈ θ (X t , g, t) represents the prediction noise at time step t, ∈ represents the noise at time step t, W θ is a dynamic parameter, and α is a hyperparameter.

[0098] Understandably, W θ is a dynamic parameter that aims to increase the weight of noise predictions in the boundary region and reduce their weights far away from the boundary. It is obtained through a two-step process, including the calculation of the distance map and the calculation of the boundary attention. In addition, W θ is dynamically parameterized, depending on the time point at which the distance map is calculated, which means that W θ As a variable, it will be dynamically adjusted according to the specific characteristics of each image at time step t. In this embodiment, a distance transformation function is used to obtain a distance map. The distance transformation function calculates the Euclidean distance between each non-zero (foreground) pixel in the image and the nearest zero (background) pixel. This is a binary image processing technique. First, the boundary pixels are identified by assigning a value of 1 to the boundary pixels and setting all other pixels to zero. The final result is a grayscale image in which the grayscale intensity within the foreground area is modified to represent the distance from each point to the nearest boundary. At the same time, in order to standardize the intensity level of the distance map and improve it as a dynamic weighting matrix W θ In order to improve the applicability of the image processing, the gamma correction technology in image processing is used to calculate the boundary attention in this embodiment. By adjusting the gamma value, the overall strength of the distance map can be controlled, thereby obtaining a smoother representation and enhancing its effectiveness in the loss function.

[0099] Furthermore, if Figure 7 As shown, the tensor includes: a noise image branch output tensor and a conditional image branch output tensor; the noise mask and the fundus image are downsampled by the decoder to output a tensor, including:

[0100] Step S401, input the noise mask and the current time step into the noise image branch of the encoder block, obtain the first noise capture feature through the first residual block in the noise image branch, input the fundus image and the current time step into the conditional image branch, and obtain the first conditional capture feature through the first residual block in the conditional image branch.

[0101] Step S402: Feedback the first noise capture feature in the noise image branch to the conditional image branch through the first feature frequency information analyzer, and concatenate the first noise capture feature and the first conditional capture feature to obtain a first jump output.

[0102] Step S403: Input the first jump output and the current time step into a second residual block in the conditional image branch of the encoder block to obtain a second conditional capture feature.

[0103] Step S404: feed back the second conditional capture feature to the noise image branch through a feedback mechanism, multiply the second conditional capture feature by the first noise capture feature to obtain a multiplication result, and input the multiplication result into a second residual block in the noise image branch to obtain a second noise capture feature.

[0104] Step S405: input the second noise capture feature into the hybrid attention module of the noise image branch for feature capture to obtain a noise image branch output tensor.

[0105] Step S406: Feedback the noise image branch output to the conditional image branch through the second feature frequency information analyzer, and splice the noise image branch output with the second conditional capture feature to obtain a second jump output.

[0106] Step S407: input the second jump output to the hybrid attention module of the conditional image branch for feature capture to obtain a conditional image branch output tensor; wherein the first jump output and the second jump output are used for a jump connection between the encoder and the decoder.

[0107] Specifically, two 1x1 convolutions are first used to expand the number of channels of the input feature map from 1 to 64 (the specific size depends on the situation), and then input into the encoding block. The specific details of each encoder block are as follows Figure 3 As shown, the present invention does not simply connect the noise image X and the conditional image g in series and feed them into the network, but chooses to adopt a dual-branch feature extraction strategy to enhance the feature extraction process. The dual branches are the noise image branch and the conditional image branch. The noise image branch extracts noise-related features, while the conditional image branch focuses on semantic information. This strategy enables the model to integrate complementary and distinguishing features. Each branch includes two residual blocks and a hybrid attention block, which can make the calculation more efficient and generate non-redundant feature representations.

[0108] Furthermore, in order to integrate temporal information, this embodiment feeds the time step t into the four residual blocks of the dual branches respectively to capture the temporal information associated with each input. The temporal embedding is performed by embedding t from a sinusoidal position, followed by a linear layer, a GeLU activation function, and another linear layer. In addition, this embodiment feeds the first residual block in the noise image branch The first noise capture feature is fed into the conditional image branch through a feature frequency information analyzer, and then combined with the first residual block in the conditional image branch Get the first conditional capture feature and concatenate it as the first jump output m i ,The characteristic frequency information analyzer can alleviate the influence of high-frequency noise information of noisy images.

[0109] It should be noted that the characteristic frequency information analyzer (such as Figure 5 As shown) in the encoder block, its role is to constrain The noise-related components in the image are first subjected to wavelet transformation, and the wavelet function is specified as haar, and the transformation level is 1. The result returned by the function is a tuple containing the wavelet coefficients of each level. Here, the first level is selected to obtain the real part feature f. I and the imaginary characteristic f R , this process can be expressed as: I 、f R = WT(f);

[0110] Furthermore, the real characteristic f I and the imaginary characteristic f R The corresponding learnable weight w I and w R After multiplication, they are added together and finally the output features are obtained through inverse wavelet transform.

[0111]

[0112] Among them, WT -1 represents the inverse wavelet transform, ⊙ represents the element-by-element product. The weight w I and w R It is a randomly initialized tensor whose element values ​​follow a normal distribution with a mean of 0 and a standard deviation of 0.02. The tensor is then packaged as a nn.Parameter object to make it a learnable parameter of the model.

[0113] Furthermore, if Figure 3 The second residual block in the conditional image branch in this implementation is shown by the curved arrow in the encoder part. Then a feedback mechanism is introduced to The output of is convolved and connected to the second residual block in the noise image branch. Input, this feedback mechanism enables the synthesized features that contain overall information about the conditional image and the noise image to be shared in the noise image branch. By doing so and multiplying the feature map, important features are emphasized while less significant features are weakened. The multiplication operation here acts as an attention mechanism where the shared features guide the noise image path to pay more attention to relevant information-rich areas.

[0114] In this embodiment, the output features of the noise image branch are also analyzed by a feature frequency information analyzer. The output of i . Each encoder block will eventually have four outputs: g i、m i 、n i , where the noise image branch outputs a tensor and the conditional image branch output tensor g i is fed to the next encoder block to continue the feature extraction process, while m i and n i Used for skip connections from encoder to decoder.

[0115] Furthermore, a convolutional layer is set after the encoder, and the convolutional layer is used to and g i After downsampling, the encoder will eventually output a 4*4 target tensor.

[0116] The target tensor is rearranged and calculated through the bottleneck module to obtain the bottleneck output result. The bottleneck module includes a residual block, an LF-Att module and another residual block. LF-Att is a dual attention module (such as Figure 4 As shown in Figure 3), it combines free attention (F-Att) for spatial relations and linear attention (L-Att) for capturing semantic context information to enhance the overall feature representation.

[0117] Furthermore, the step of inputting the output result to the decoder for upsampling to obtain the first predicted noise at the current time step specifically includes:

[0118] Inputting the bottleneck output result and the current time step into a first residual block of the decoder block to obtain a first residual capture feature; receiving a first skip output from the encoder block, and concatenating the first skip output with the first residual capture feature to obtain a first concatenated result;

[0119] Inputting the first splicing result and the current time step into a second residual block of the decoder block to obtain a second residual capture feature; receiving a second skip output from the encoder block, and splicing the second skip output with the second residual capture feature to obtain a second splicing result;

[0120] The second splicing result is input into the hybrid attention module of the encoder block for extraction to obtain refined information; after the refined information passes through the first convolution block of the decoder, the residual block of the decoder and the second convolution block of the decoder in sequence, the first prediction noise at the current time step is output.

[0121] like Figure 6 As shown, it can be understood that the decoder consists of four stacked decoder blocks, followed by two convolution blocks and a residual block, and finally outputs the predicted noise ∈ θ (Xt , g, t). Each decoder block includes two consecutive residual blocks and an LF-Att module. and the second residual block of the decoder block Afterwards, m i and n i The first residual capture feature and the second residual capture feature are concatenated together. By integrating these features, the decoder can obtain refined information from the encoder, thereby better estimating the amount of noise added in the forward process and recovering the missing information during the learning process.

[0122] In addition, this embodiment uses an additional skip connection operation between the input X and the residual block after the decoder, so that the influence of noise can be preserved during the decoding process.

[0123] In summary, the present invention provides a new method for segmenting the optic cup and optic disc of fundus images based on a diffusion model. The proposed denoising network integrates the interaction of semantic features and noise more efficiently by inputting the image and mask in parallel to a dual-branch encoder, and introduces a feature frequency information analyzer to reduce the influence of high-frequency noise components. At the same time, in order to encourage the model to give priority to boundary information, the present invention introduces dynamic parameters in the loss function to enhance the emphasis on boundary areas. Through experimental verification, the performance of the method of the present invention on the optic cup and optic disc segmentation tasks of two public datasets is better than other advanced segmentation methods based on CNN, Transformer and diffusion models.

[0124] Furthermore, if Figure 8 As shown, based on the above-mentioned method for segmenting the optic cup and optic disc of fundus images, the present invention also provides a system for segmenting the optic cup and optic disc of fundus images, wherein the system for segmenting the optic cup and optic disc of fundus images comprises:

[0125] A model building module 51 is used to build a segmentation model of the optic cup and optic disc of the fundus image, wherein the segmentation model of the optic cup and optic disc of the fundus image includes an autoencoder, a forward denoising module and a reverse denoising module;

[0126] A training data dimension reduction module 52 is used to obtain training data, wherein the training data includes a fundus image and an original segmentation mask corresponding to the fundus image, and input the original segmentation mask into the autoencoder for dimension reduction to obtain a segmentation mask after dimension reduction;

[0127] A stepwise noise adding module 53, used for inputting the segmentation mask after dimension reduction into the forward noise adding module, and performing stepwise noise adding on the segmentation mask after dimension reduction at multiple time steps using noise to obtain a noise mask;

[0128] A model training module 54 is used to input the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain predicted noise at all time steps, and use the predicted noise and the noise at the corresponding time step to calculate a loss function until the loss function converges to obtain a target segmentation model;

[0129] The cup-to-disc ratio calculation module 55 is used to obtain a target fundus image to be segmented, input the target fundus image into the target segmentation model for calculation, and obtain an optic disc-to-cup segmentation grayscale image of the target fundus image.

[0130] Furthermore, if Fig. 9 As shown, based on the above-mentioned method and system for segmenting the optic cup and optic disc of fundus images, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Fig. 9 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0131] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a segmentation program 40 for fundus images of optic cups and optic discs, and the segmentation program 40 for fundus images of optic cups and optic discs can be executed by the processor 10, thereby realizing the segmentation method for fundus images of optic cups and optic discs in the present application.

[0132] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the method for segmenting the optic cup and optic disc of the fundus image.

[0133] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.

[0134] In one embodiment, when the processor 10 executes the fundus image optic cup and optic disc segmentation program 40 in the memory 20, the following steps are implemented:

[0135] Constructing a segmentation model of the optic cup and optic disc of the fundus image, wherein the segmentation model of the optic cup and optic disc of the fundus image comprises an autoencoder, a forward denoising module and a reverse denoising module;

[0136] Acquire training data, the training data including a fundus image and an original segmentation mask corresponding to the fundus image, input the original segmentation mask into the autoencoder for dimensionality reduction, and obtain a segmentation mask after dimensionality reduction;

[0137] Inputting the dimension-reduced segmentation mask into the forward noise adding module, and using noise to gradually add noise to the dimension-reduced segmentation mask over multiple time steps to obtain a noise mask;

[0138] Inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain predicted noise at all time steps, and using the predicted noise and the noise at the corresponding time step to calculate a loss function until the loss function converges to obtain a target segmentation model;

[0139] A target fundus image to be segmented is acquired, and the target fundus image is input into the target segmentation model for calculation to obtain an optic disc and optic cup segmentation grayscale image of the target fundus image.

[0140] The step of inputting the segmentation mask after dimensionality reduction into the forward noise adding module and using noise to gradually add noise to the segmentation mask after dimensionality reduction at multiple time steps to obtain a noise mask specifically includes:

[0141] Inputting the dimension-reduced segmentation mask into the forward denoising module, wherein the forward denoising module includes a denoising network at multiple time steps;

[0142] Gaussian noise is gradually added to the segmentation mask after dimension reduction through multiple noise adding networks, and after multiple time steps, a noise mask after gradual noise addition is obtained.

[0143] Wherein, the denoising network includes an encoder, a decoder and a bottleneck module;

[0144] The encoder includes four stacked encoder blocks, each of which includes a noise image branch and a conditional image branch, each branch includes two residual blocks and a hybrid attention module, and the two branches are connected by two feature frequency information analyzers;

[0145] The decoder comprises four stacked decoder blocks, two convolutional blocks and a residual block, each of the decoder blocks comprises two consecutive residual blocks and a hybrid attention module;

[0146] The bottleneck module is connected to the encoder and the decoder, and the bottleneck module includes two residual blocks and a hybrid attention module.

[0147] The step of inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for stepwise denoising to obtain predicted noise at all time steps specifically includes:

[0148] Inputting the noise mask at the current time step, the fundus image and the inverse denoising module, wherein the inverse denoising module includes denoising networks at multiple time steps;

[0149] Down-sampling the noise mask and the fundus image through the decoder, outputting a tensor, inputting the tensor into the bottleneck module for rearrangement and calculation to obtain a bottleneck output result, and inputting the bottleneck output result into the decoder for up-sampling to obtain a first predicted noise at a current time step;

[0150] The noise mask at the previous time step is predicted according to the noise mask at the current time step, and the second predicted noise at the previous time step is continuously calculated according to the noise mask at the previous time step and the fundus image until the predicted noise at all time steps is obtained.

[0151] The step of calculating the loss function using the predicted noise and the noise at the corresponding time step specifically includes:

[0152] The loss function is calculated based on the predicted noise and the noise at the corresponding time step.

[0153] Where t represents the time step, X t represents the noise mask at time step t, g represents the fundus image, ∈ θ (X t , g, t) represents the prediction noise at time step t, ∈ represents the noise at time step t, W θ is a dynamic parameter, and α is a hyperparameter.

[0154] Wherein, the tensors include: a noise image branch output tensor and a conditional image branch output tensor;

[0155] The downsampling the noise mask and the fundus image by the decoder to output a tensor specifically includes:

[0156] Input the noise mask and the current time step into the noise image branch of the encoder block, obtain a first noise capture feature through a first residual block in the noise image branch, input the fundus image and the current time step into the conditional image branch, and obtain a first conditional capture feature through a first residual block in the conditional image branch;

[0157] Feeding back the first noise capture feature in the noise image branch to the conditional image branch through the first feature frequency information analyzer, concatenating the first noise capture feature and the first conditional capture feature to obtain a first jump output;

[0158] Inputting the first skip output and the current time step into a second residual block in the conditional image branch of the encoder block to obtain a second conditional captured feature;

[0159] Feeding back the second conditional capture feature to the noise image branch through a feedback mechanism, multiplying the second conditional capture feature with the first noise capture feature to obtain a multiplication result, and inputting the multiplication result into a second residual block in the noise image branch to obtain a second noise capture feature;

[0160] Inputting the second noise capture feature into the hybrid attention module of the noise image branch for feature capture to obtain a noise image branch output tensor;

[0161] Feeding the noise image branch output back to the conditional image branch through the second characteristic frequency information analyzer, splicing the noise image branch output with the second conditional capture feature to obtain a second jump output;

[0162] Inputting the second jump output into the hybrid attention module of the conditional image branch for feature capture to obtain a conditional image branch output tensor;

[0163] The first jump output and the second jump output are used for a jump connection between an encoder and a decoder.

[0164] The step of inputting the output result to the decoder for upsampling to obtain the first predicted noise at the current time step specifically includes:

[0165] Inputting the bottleneck output result and the current time step into a first residual block of the decoder block to obtain a first residual capture feature;

[0166] Receiving a first skip output from the encoder block, and concatenating the first skip output with the first residual capture feature to obtain a first concatenated result;

[0167] Inputting the first splicing result and the current time step into a second residual block of the decoder block to obtain a second residual capture feature;

[0168] receiving a second skip output from the encoder block, and concatenating the second skip output with the second residual capture feature to obtain a second concatenated result;

[0169] Inputting the second splicing result into the hybrid attention module of the encoder block for extraction to obtain refined information;

[0170] After the refined information passes through the first convolution block of the decoder, the residual block of the decoder and the second convolution block of the decoder in sequence, the first prediction noise at the current time step is output.

[0171] In summary, the present invention provides a method, system and terminal for segmenting the optic cup and optic disc of a fundus image. The method includes: constructing a segmentation model of the optic cup and optic disc of the fundus image, obtaining the fundus image and the original segmentation mask corresponding to the fundus image, inputting the original segmentation mask into the autoencoder of the segmentation model for dimensionality reduction, inputting the segmentation mask after dimensionality reduction into the forward denoising module of the segmentation model, using noise to gradually add noise to the segmentation mask after dimensionality reduction to obtain a noise mask; inputting the noise mask and the fundus image into the reverse denoising module of the segmentation model for gradual denoising to obtain predicted noise, using the predicted noise and the noise to calculate the loss function to obtain a target segmentation model; obtaining a target fundus image, inputting the target fundus image into the target segmentation model for calculation, and obtaining a grayscale image of the optic disc and optic cup segmentation of the target fundus image. The present invention integrates the interaction of semantic features and noise more efficiently by inputting images and masks into a dual-branch encoder in parallel, and introduces a feature frequency information analyzer to reduce the influence of high-frequency noise components. At the same time, a dynamic parameter is introduced into the loss function to enhance the emphasis on boundary areas, thereby improving the accuracy of the segmentation results of the optic cup and optic disc in fundus images.

[0172] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0173] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0174] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for segmenting the optic cup and optic disc of a fundus image, characterized in that: The method for segmenting the optic cup and optic disc of the fundus image comprises: Constructing a segmentation model of the optic cup and optic disc of the fundus image, wherein the segmentation model of the optic cup and optic disc of the fundus image comprises an autoencoder, a forward denoising module and a reverse denoising module; Acquire training data, the training data including a fundus image and an original segmentation mask corresponding to the fundus image, input the original segmentation mask into the autoencoder for dimensionality reduction, and obtain a segmentation mask after dimensionality reduction; Inputting the dimension-reduced segmentation mask into the forward noise adding module, and using noise to gradually add noise to the dimension-reduced segmentation mask over multiple time steps to obtain a noise mask; Inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain predicted noise at all time steps, and using the predicted noise and the noise at the corresponding time step to calculate a loss function until the loss function converges to obtain a target segmentation model; A target fundus image to be segmented is acquired, and the target fundus image is input into the target segmentation model for calculation to obtain an optic disc and optic cup segmentation grayscale image of the target fundus image.

2. The method for segmenting the optic cup and optic disc of a fundus image according to claim 1, characterized in that: The step of inputting the segmentation mask after dimensionality reduction into the forward noise adding module and using noise to gradually add noise to the segmentation mask after dimensionality reduction at multiple time steps to obtain a noise mask specifically includes: Inputting the dimension-reduced segmentation mask into the forward denoising module, wherein the forward denoising module includes a denoising network at multiple time steps; Gaussian noise is gradually added to the segmentation mask after dimensionality reduction through multiple noise adding networks, and after multiple time steps, a noise mask after gradual noise addition is obtained.

3. The method for segmenting the optic cup and optic disc of a fundus image according to claim 1, characterized in that: The denoising network includes an encoder, a decoder and a bottleneck module; The encoder includes four stacked encoder blocks, each of which includes a noise image branch and a conditional image branch, each branch includes two residual blocks and a hybrid attention module, and the two branches are connected by two feature frequency information analyzers; The decoder comprises four stacked decoder blocks, two convolutional blocks and a residual block, each of the decoder blocks comprises two consecutive residual blocks and a hybrid attention module; The bottleneck module is connected to the encoder and the decoder, and the bottleneck module includes two residual blocks and a hybrid attention module.

4. The method for segmenting the optic cup and optic disc of a fundus image according to claim 3, characterized in that: The step of inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for stepwise denoising to obtain predicted noise at all time steps specifically includes: Inputting the noise mask at the current time step, the fundus image and the inverse denoising module, wherein the inverse denoising module includes denoising networks at multiple time steps; Down-sampling the noise mask and the fundus image through the decoder, outputting a tensor, inputting the tensor into the bottleneck module for rearrangement and calculation to obtain a bottleneck output result, and inputting the bottleneck output result into the decoder for up-sampling to obtain a first predicted noise at a current time step; The noise mask at the previous time step is predicted according to the noise mask at the current time step, and the second predicted noise at the previous time step is continuously calculated according to the noise mask at the previous time step and the fundus image until the predicted noise at all time steps is obtained.

5. The method for segmenting the optic cup and optic disc of a fundus image according to claim 4, characterized in that: The use of the predicted noise and the noise at the corresponding time step to calculate the loss function specifically includes: The loss function is calculated based on the predicted noise and the noise at the corresponding time step. Where t represents the time step, X t represents the noise mask at time step t, g represents the fundus image, ∈ θ (X t , g, t) represents the prediction noise at time step t, ∈ represents the noise at time step t, W θ is a dynamic parameter, and α is a hyperparameter.

6. The method for segmenting the optic cup and optic disc of a fundus image according to claim 5, characterized in that: The tensors include: a noise image branch output tensor and a conditional image branch output tensor; The downsampling the noise mask and the fundus image by the decoder to output a tensor specifically includes: Input the noise mask and the current time step into the noise image branch of the encoder block, obtain a first noise capture feature through a first residual block in the noise image branch, input the fundus image and the current time step into the conditional image branch, and obtain a first conditional capture feature through a first residual block in the conditional image branch; Feeding back the first noise capture feature in the noise image branch to the conditional image branch through the first feature frequency information analyzer, concatenating the first noise capture feature and the first conditional capture feature to obtain a first jump output; Inputting the first skip output and the current time step into a second residual block in the conditional image branch of the encoder block to obtain a second conditional captured feature; Feeding back the second conditional capture feature to the noise image branch through a feedback mechanism, multiplying the second conditional capture feature with the first noise capture feature to obtain a multiplication result, and inputting the multiplication result into a second residual block in the noise image branch to obtain a second noise capture feature; Inputting the second noise capture feature into the hybrid attention module of the noise image branch for feature capture to obtain a noise image branch output tensor; Feeding the noise image branch output back to the conditional image branch through the second characteristic frequency information analyzer, splicing the noise image branch output with the second conditional capture feature to obtain a second jump output; Inputting the second jump output into the hybrid attention module of the conditional image branch for feature capture to obtain a conditional image branch output tensor; The first jump output and the second jump output are used for a jump connection between an encoder and a decoder.

7. The method for segmenting the optic cup and optic disc of a fundus image according to claim 6, characterized in that: The inputting the output result into the decoder for upsampling to obtain the first predicted noise at the current time step specifically includes: Inputting the bottleneck output result and the current time step into a first residual block of the decoder block to obtain a first residual capture feature; Receiving a first skip output from the encoder block, and concatenating the first skip output with the first residual capture feature to obtain a first concatenated result; Inputting the first splicing result and the current time step into a second residual block of the decoder block to obtain a second residual capture feature; receiving a second skip output from the encoder block, and concatenating the second skip output with the second residual capture feature to obtain a second concatenated result; Inputting the second splicing result into the hybrid attention module of the encoder block for extraction to obtain refined information; After the refined information passes through the first convolution block of the decoder, the residual block of the decoder and the second convolution block of the decoder in sequence, the first prediction noise at the current time step is output.

8. A system for segmenting optic cup and optic disc of fundus image, characterized in that: The segmentation system of the fundus image optic cup and optic disc comprises: A model building module, used to build a segmentation model of the optic cup and optic disc of the fundus image, wherein the segmentation model of the optic cup and optic disc of the fundus image includes an autoencoder, a forward denoising module and a reverse denoising module; A training data dimensionality reduction module is used to obtain training data, wherein the training data includes a fundus image and an original segmentation mask corresponding to the fundus image, and input the original segmentation mask into the autoencoder for dimensionality reduction to obtain a segmentation mask after dimensionality reduction; A stepwise noise adding module, used for inputting the segmentation mask after dimension reduction into the forward noise adding module, and performing stepwise noise adding on the segmentation mask after dimension reduction at multiple time steps using noise to obtain a noise mask; A model training module, used for inputting the noise mask and the fundus image into the denoising network of the inverse denoising module for step-by-step denoising to obtain predicted noise at all time steps, and using the predicted noise and the noise at the corresponding time step to calculate a loss function until the loss function converges to obtain a target segmentation model; The cup-to-disc ratio calculation module is used to obtain a target fundus image to be segmented, input the target fundus image into the target segmentation model for calculation, and obtain an optic disc-to-cup segmentation grayscale image of the target fundus image.

9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a fundus image optic cup and optic disc segmentation program stored in the memory and executable on the processor. When the fundus image optic cup and optic disc segmentation program is executed by the processor, the steps of the fundus image optic cup and optic disc segmentation method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a fundus image optic cup and optic disc segmentation program, and when the fundus image optic cup and optic disc segmentation program is executed by a processor, the steps of the fundus image optic cup and optic disc segmentation method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Fundus image classification method and system using diffusion-model-based continual test-time adaptation

    WO2026180001A1