An automated segmentation method for minimal lesions in diabetic retinopathy
By constructing a segmentation network model with an auxiliary segmentation module, and using feature-level labels and embedded modules to enhance the lesion feature representation, the problem of segmenting extremely small lesions in diabetic retinopathy in the prior art has been solved, and efficient and accurate automatic lesion segmentation has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2026-03-06
AI Technical Summary
Existing deep neural network-based models cannot effectively segment tiny lesions in diabetic retinopathy, leading to unstable diagnostic results that rely on physician experience. Furthermore, existing methods cannot effectively distinguish between background and lesion structure.
A segmentation network model with an auxiliary segmentation module is constructed. The lesion feature representation is enhanced by feature-level labels and embedded modules. The ResNet18 encoder is used for feature extraction. Feature-level contrastive learning is used to bring the feature vectors of lesions of the same type closer together and widen the feature vectors of lesions of different types apart, thus solving the problem of small inter-class distance and large intra-class distance.
It achieves pixel-level segmentation of the background and four types of lesions, improves the accuracy and stability of the segmentation model, reduces misdiagnosis and missed diagnosis, and enhances the automatic segmentation capability of DR lesions.
Smart Images

Figure CN116051471B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to an automatic segmentation method, system, and computer-readable storage medium for minimal lesions in diabetic retinopathy. Background Technology
[0002] Diabetic retinopathy (DR) has become a major medical problem for a large number of diabetic patients worldwide and is a leading cause of blindness in the working-age population today. However, to date, there is no effective treatment to completely cure the disease. The most widely accepted approach is early diagnosis and intervention to control disease progression and prevent eventual vision loss. In clinical practice, ophthalmologists typically diagnose DR by identifying the presence of microaneurysms (MA), soft exudates (SE), hard exudates (EX), and hemorrhages (HE), making the segmentation of DR lesions crucial for both diagnosis and treatment.
[0003] The screening and diagnosis of diabetic retinopathy (DR) are performed by relatively experienced ophthalmologists. However, due to the limited and uneven distribution of expert resources and the instability of manual DR diagnosis results, there is a certain percentage of misdiagnosis and misjudgment, which may delay patients' timely treatment.
[0004] In recent years, with the widespread application of deep neural networks in medical image analysis, an increasing number of deep neural network models have been designed for segmentation of diabetic retinopathy (DR) lesions. According to literature reviews, many current studies on DR lesion segmentation only focus on segmenting one or two types of lesions, and have not achieved significant progress. Medical image analysis falls under the field of computer vision. The most commonly used network for solving computer vision tasks is the convolutional neural network (CNN), which can preserve neighborhood connections and local spatial features, thereby achieving feature extraction. U-Net is a classic segmentation network, and with further research, many variants of U-Net have emerged, such as U-Net++ and V-Net. However, existing segmentation networks cannot be directly used for DR lesion segmentation because DR lesions occupy a very small proportion of the overall image; small lesions disappear after passing through convolutional layers, and existing segmentation networks struggle to achieve effective feature extraction for extremely small regions.
[0005] Existing technology discloses a method and system for grading diabetic retinopathy based on deep learning. The method includes: constructing a sample library; removing background and noise from fundus photographs in the sample library; normalizing images of different brightness and intensities to the same range by subtracting local means; augmenting different samples using random stretching and rotation to construct training and testing sets; training an initial deep learning network model by building an input architecture, a multi-branch feature transformation architecture, and an output framework; and inputting the sample to be detected into the trained initial deep learning network model to grade diabetic retinopathy. This approach does not address the problem of small inter-class distance and large intra-class distance between the background and lesions.
[0006] In summary, existing manual DR diagnostic methods rely heavily on doctors' experience, which is time-consuming and labor-intensive. Existing segmentation methods based on deep neural network models cannot achieve efficient and accurate automatic DR segmentation because the networks are not suitable for DR fundus images. Therefore, there is an urgent need for an automatic segmentation method for minimal lesions in diabetic retinopathy. Summary of the Invention
[0007] This invention provides an automatic segmentation method, system, and computer-readable storage medium method for minimal lesions in diabetic retinopathy, which can better distinguish between the background and lesion structure and achieve pixel-level segmentation of the background and four types of lesions.
[0008] The primary objective of this invention is to solve the aforementioned technical problems. The technical solution of this invention is as follows:
[0009] The first aspect of this invention provides an automatic segmentation method for very small lesions in diabetic retinopathy, comprising the following steps:
[0010] S1: Obtain the DR fundus image dataset;
[0011] S2: Preprocess the images and corresponding ground truth labels in the dataset, and obtain the preset first feature level label and second feature level label using the ground truth labels of the images respectively;
[0012] S3: Divide the preprocessed image, ground truth label, first feature level label, and second feature level label into training set, validation set, and test set, and construct a segmentation network model with an auxiliary segmentation module;
[0013] S4: Train the segmentation network model using the training set and validation set to obtain the trained segmentation network model;
[0014] S5: Input the test set into the trained segmentation network model and output the segmentation results. Compare the output results with the real labels to obtain the segmentation evaluation index.
[0015] Furthermore, preprocessing the images and corresponding ground truth labels in the dataset includes:
[0016] The images and their corresponding labels in the DR fundus image dataset are randomly scaled sequentially, with the scaling ratio of the labels being exactly the same as that of the images.
[0017] Normalize the scaled image;
[0018] The labels and normalized images are randomly cropped to a preset size, where the preset size and cropping method of the labels and normalized images are the same.
[0019] Furthermore, the specific steps for obtaining the preset first feature-level labels using the real labels of the images are as follows:
[0020] Set the height and width of the real label to H and W, and the height and width of the first feature-level label to h and w, size_h=H / h, size_w=W / w, then the size of the first feature-level label is h*w*c, where c is the type of lesion + 1;
[0021] In each real label of size_h*size_w, if there is one pixel belonging to category c, the value of the c channel in the corresponding feature-level label is 1; if there is no pixel belonging to category c, the value of the lesion in that category is 0.
[0022] Furthermore, the specific steps for obtaining the preset second-level feature labels using the real labels of the images are as follows:
[0023] Set the height and width of the real label to H and W, and the height and width of the second feature-level label to h and w, with size_h = H / h and size_w = W / w. The size of the second feature-level label is h*w. The value of the feature map at position i and j is equal to the largest value among the i-th size_h and j-th size_w values of the real label, where the value of i ranges from 0 to h and the value of j ranges from 0 to w.
[0024] Furthermore, the segmentation network model includes: a backbone segmentation network, an auxiliary segmentation module, and an embedded module. The backbone segmentation network includes: an encoder, a decoder, and a feature map forward and backward fusion mechanism. The encoder is a ResNet18-based encoder used for feature extraction. The decoder upsamples the feature map to restore its resolution. The feature map forward and backward fusion mechanism is used to fuse multi-scale feature maps in the decoder, thereby mitigating the loss of spatial information as much as possible.
[0025] The auxiliary segmentation module compares the first feature level label with the first feature map output by the auxiliary segmentation module to enhance the feature representation of the foreground class, thereby solving the problem of foreground and background imbalance.
[0026] The embedding module uses feature-level vectors for comparison, bringing feature vectors of the same type of lesion closer together and widening feature vectors of different types of lesions further apart, thereby enabling the network to better distinguish the four types of lesions and solve the problem of small inter-class distance and large intra-class distance.
[0027] Furthermore, the segmentation network is trained using the training set and validation set to obtain the trained segmentation network model. The specific steps are as follows: initialize the preset optimal evaluation index, input the training set into the segmentation network model, and obtain the final segmentation result, auxiliary segmentation result, and feature-level output.
[0028] The final segmentation result and the auxiliary segmentation result are compared with the true label. The feature-level output and the feature-level label are compared. The loss is calculated, the backpropagation loss is calculated, and the network parameters that affect the model training and model output are updated and calculated using the optimizer SGD to make them approach or reach the optimal value, thereby minimizing the loss function and obtaining the optimal model.
[0029] The images in the validation set are input one by one into the optimal model to obtain the segmentation results. The segmentation results are compared with the true labels to obtain the evaluation index. The evaluation index is compared with the current best evaluation index. If the current evaluation index is better than the current best evaluation index, the current model is saved and the current evaluation index is assigned to the best evaluation index. The model is iterated and trained to a specified number of times to obtain the final optimal model.
[0030] Furthermore, the loss includes: backbone segmentation loss. Auxiliary segmentation loss
[0031] , and Feature-level loss
[0032] and comparative learning loss ,in
[0033] , , and
[0034] The total loss consists of ohem loss and generalized dice loss, and is calculated as follows:
[0035]
[0036]
[0037] (3)
[0038] (4)
[0039] (5)
[0040] The loss coefficients are set to the following values: α=1.0, β=0.4, γ=0.4, δ=0.7, ε=1.0. =1.0.
[0041] Furthermore, the initial preset optimal evaluation index is equal to 0.
[0042] A second aspect of the present invention provides an automatic segmentation system for minimal lesions in diabetic retinopathy. The system includes a memory and a processor. The memory includes a program for an automatic segmentation method for minimal lesions in diabetic retinopathy. When executed by the processor, the program for automatic segmentation of minimal lesions in diabetic retinopathy performs the following steps:
[0043] S1: Obtain the DR fundus image dataset;
[0044] S2: Preprocess the images and corresponding ground truth labels in the dataset, and obtain the preset first feature level label and second feature level label using the ground truth labels of the images respectively;
[0045] S3: Divide the preprocessed image, ground truth label, first feature level label, and second feature level label into training set, validation set, and test set, and construct a segmentation network model with an auxiliary segmentation module;
[0046] S4: Train the segmentation network model using the training set and validation set to obtain the trained segmentation network model;
[0047] S5: Input the test set into the trained segmentation network model and output the segmentation results. Compare the output results with the real labels to obtain the segmentation evaluation index.
[0048] A third aspect of the present invention provides a computer-readable storage medium comprising a program for an automatic segmentation method for minimal lesions based on diabetic retinopathy, wherein when the program for the automatic segmentation method for minimal lesions based on diabetic retinopathy is executed by a processor, the program implements the steps of the aforementioned automatic segmentation method for minimal lesions based on diabetic retinopathy.
[0049] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0050] This invention overcomes the problem of small inter-class distance and large intra-class distance between the background and lesions by adding feature-level labels, thereby enabling the segmentation model to better distinguish between the background and lesion structures and improving the network segmentation performance; and achieves pixel-level segmentation of the background and four types of lesions by constructing a segmentation network model with an auxiliary segmentation module. Attached Figure Description
[0051] Figure 1 This is a flowchart of an automatic segmentation method for extremely small lesions in diabetic retinopathy based on the present invention.
[0052] Figure 2 This is a DR fundus image from the DDR dataset in this embodiment of the invention.
[0053] Figure 3 This is a flowchart illustrating the training process of the segmentation network model in an embodiment of the present invention. Detailed Implementation
[0054] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0055] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0056] Example 1
[0057] like Figure 1 As shown, the first aspect of the present invention provides an automatic segmentation method for very small lesions in diabetic retinopathy, comprising the following steps:
[0058] S1: Obtain the DR fundus image dataset;
[0059] In one specific embodiment, a publicly available DR dataset, such as IDRID, can be downloaded. The IDRID dataset contains 81 pixel-level DR fundus images. Alternatively, the DDR dataset can be used. The DDR dataset is also a publicly available dataset and can be downloaded from its official website. The DDR dataset contains 757 pixel-level DR fundus images.
[0060] S2: Preprocess the images and corresponding ground truth labels in the dataset, and obtain the preset first feature level label and second feature level label using the ground truth labels of the images respectively;
[0061] In a specific embodiment, the image preprocessing is as follows: the images in the DR fundus image dataset are randomly scaled and normalized in sequence; the normalized images are randomly cropped to a preset size; it should be noted that if the sampled image only contains the background, it is resampled until the sampled image contains any one of the lesions.
[0062] The preprocessing of the real labels is as follows: the real labels of each image are randomly scaled and normalized in sequence; the normalized real labels are cropped to a preset size to obtain the labels of the corresponding image locations.
[0063] It should be noted that the actual labels and the image are scaled up to the exact same ratio, and the actual labels and the normalized images have the same preset size and cropping method.
[0064] The specific steps for obtaining the preset first feature level labels using the real labels of the images are as follows:
[0065] Set the height and width of the real label to H and W, and the height and width of the first feature-level label to h and w, size_h=H / h, size_w=W / w, then the size of the first feature-level label is h*w*c, where c is the type of lesion + 1;
[0066] In each real label of size_h*size_w, if there is one pixel belonging to category c, the value of the c channel in the corresponding feature-level label is 1; if there is no pixel belonging to category c, the value of the lesion in that category is 0.
[0067] The specific steps for obtaining the preset second-level feature labels using the real labels of the images are as follows:
[0068] Set the height and width of the real label to H and W, and the height and width of the second feature-level label to h and w, with size_h = H / h and size_w = W / w. The size of the second feature-level label is h*w. The value of the feature map at position i and j is equal to the largest value among the i-th size_h and j-th size_w values of the real label, where the value of i ranges from 0 to h and the value of j ranges from 0 to w.
[0069] It should be noted that the data preprocessing methods of randomly scaling, cropping, and resampling images in the preprocessing stage reduced the interference of background information.
[0070] S3: Divide the preprocessed image, ground truth label, first feature level label, and second feature level label into training set, validation set, and test set, and construct a segmentation network model with an auxiliary segmentation module.
[0071] More specifically, the segmentation network model includes: a backbone segmentation network, an auxiliary segmentation module, and an embedded module. The backbone segmentation network includes: an encoder, a decoder, and a feature map forward and backward fusion mechanism. The encoder is a ResNet18-based encoder used for feature extraction. The decoder upsamples the feature map to restore its resolution. The feature map forward and backward fusion mechanism is used to fuse multi-scale feature maps in the decoder, thereby minimizing the loss of spatial information.
[0072] The auxiliary segmentation module compares the first feature level label with the first feature map output by the auxiliary segmentation module to enhance the feature representation of the foreground class, thereby solving the problem of foreground and background imbalance.
[0073] The embedding module uses feature-level vectors for comparison, bringing feature vectors of the same type of lesion closer together and widening feature vectors of different types of lesions further apart, thereby enabling the network to better distinguish the four types of lesions and solve the problem of small inter-class distance and large intra-class distance.
[0074] It should be noted that doctors primarily rely on four types of lesion structures to determine the DR grade, such as... Figure 2 As shown, the regions containing the four structures occupy a very small proportion of the entire image, the foreground and background are very unbalanced, and the colors and sizes of different lesions are very similar. For example, microaneurysms and hemorrhages are both red, while hard exudates and soft exudates are both yellow. This poses a great challenge to the feature learning of deep neural networks.
[0075] The overall segmentation network of this invention is shown in the figure. The input is a DR fundus image x, and the output is a DR lesion segmentation image. DR lesion auxiliary segmentation map , , Feature map , .
[0076] S4: Train the segmentation network model using the training set and validation set to obtain the trained segmentation network model;
[0077] like Figure 3 As shown, the specific steps are as follows: Initialize the preset optimal evaluation index, specifically, initialize the preset optimal evaluation index to 0, input the training set into the segmentation network model, and obtain the final segmentation result, auxiliary segmentation result and feature-level output.
[0078] The final segmentation result and the auxiliary segmentation result are compared with the true label. The feature-level output and the feature-level label are compared. The loss is calculated, the backpropagation loss is calculated, and the network parameters that affect the model training and model output are updated and calculated using the optimizer SGD to make them approach or reach the optimal value, thereby minimizing the loss function and obtaining the optimal model.
[0079] In one specific embodiment, during the training phase, feature-level labels are obtained by processing the true label y. and The output obtained through the network is then compared with the actual labels to calculate the loss. This loss includes: backbone segmentation loss. Auxiliary segmentation loss , and Feature-level loss and comparative learning loss ,in
[0080] , , and
[0081] The total loss consists of ohem loss and generalized dice loss, and is calculated as follows:
[0082]
[0083]
[0084] (3)
[0085] (4)
[0086] (5)
[0087] The loss coefficients are set to the following values: α=1.0, β=0.4, γ=0.4, δ=0.7, ε=1.0. =1.0.
[0088] The segmentation network assigns a lesion class label to each pixel, ultimately obtaining pixel-level prediction results. During the training phase, other results will also be output. , , , , Among them, the prediction results , , The loss is calculated using the true label y, and The loss is calculated by scaling the true labels using the nearest neighbor maximum value. ,and The loss is calculated based on the labels that have undergone multy-hot encoding of the real labels. From which we obtained and The formula is as follows:
[0089] y c (i, j) =max(y(m=([size_h*i, size_h*(i+1))), n=([size_w*j, size_w*(j+1)))))(6)
[0090] y f (i, j, c) = I(y(m=([size_h*i, size_h*(i+1))), n=([size_w*j, size_w*(j+1))))=c) (7)
[0091] Where H and W are the height and width of the input image, h and w are the height and width of the output feature map, size_h = H / h, size_w = W / w, i ∈ [0, h), j ∈ [0, w), c ∈ [0, C), and I(x) is an indicator function, which equals 1 when x is true and 0 otherwise. The two feature-level labels obtained from the ground truth labels are used to guide two auxiliary embedding modules to address the problems of small inter-class distance and large intra-class distance in the background and four types of lesion structures, as well as the foreground-background imbalance problem.
[0092] The images in the validation set are input one by one into the optimal model to obtain the segmentation results. The segmentation results are compared with the true labels to obtain the evaluation index. The evaluation index is compared with the current best evaluation index. If the current evaluation index is better than the current best evaluation index, the current model is saved and the current evaluation index is assigned to the best evaluation index. The model is iterated and trained to a specified number of times to obtain the final optimal model.
[0093] S5: Input the test set into the trained segmentation network model and output the segmentation results. Compare the output results with the real labels to obtain the segmentation evaluation index.
[0094] Example 2
[0095] A second aspect of the present invention provides an automatic segmentation system for minimal lesions in diabetic retinopathy. The system includes a memory and a processor. The memory includes a program for an automatic segmentation method for minimal lesions in diabetic retinopathy. When executed by the processor, the program for automatic segmentation of minimal lesions in diabetic retinopathy performs the following steps:
[0096] S1: Obtain the DR fundus image dataset;
[0097] S2: Preprocess the images and corresponding ground truth labels in the dataset, and obtain the preset first feature level label and second feature level label using the ground truth labels of the images respectively;
[0098] S3: Divide the preprocessed image, ground truth label, first feature level label, and second feature level label into training set, validation set, and test set, and construct a segmentation network model.
[0099] S4: Train the segmentation network model using the training set and validation set to obtain the trained segmentation network model;
[0100] S5: Input the test set into the trained segmentation network model and output the segmentation results. Compare the output results with the real labels to obtain the segmentation evaluation index.
[0101] A third aspect of the present invention provides a computer-readable storage medium comprising a program for an automatic segmentation method for minimal lesions based on diabetic retinopathy, wherein when the program for the automatic segmentation method for minimal lesions based on diabetic retinopathy is executed by a processor, the program implements the steps of the aforementioned automatic segmentation method for minimal lesions based on diabetic retinopathy.
[0102] Example 3
[0103] This embodiment uses specific data to verify and analyze the technology. Existing techniques for segmenting DR lesions involve scaling the entire DR fundus image to a fixed size before inputting it into a segmentation network to obtain the segmentation result. Furthermore, the scaled-down real labels are used to calculate the evaluation metrics. Microaneurysms within DR lesions are very small; scaling them proportionally may cause the lesion to disappear, hindering DR diagnosis. This invention, based on existing technologies, simultaneously addresses the foreground-background imbalance problem and the issue of "small inter-class distance and large intra-class distance" in DR lesions. Recall metrics are crucial in medical image processing, reflecting the performance of real samples. PR_AUC focuses on the accuracy of real data in prediction and has practical value, while AUC_ROC characterizes the model's effectiveness. This invention uses the fundus image segmentation metrics PR_AUC and AUC_ROC to evaluate the experimental results, which are shown in Table 1.
[0104] Table 1 Experimental Results of the DDR Dataset
[0105]
[0106] In this table, "ours" represents the method of this invention, BPNET represents the baseline model, RTNet represents the relation transformer network, and L-Seg represents the end-to-end unified framework for multi-lesion segmentation of fundus images. The table above illustrates that the method proposed in this invention can effectively segment four types of lesion structures. By using the proposed auxiliary segmentation module to enhance the high-level feature representation of small objects, the network's ability to distinguish between foreground and background is strengthened, resulting in better differentiation between them. This reduces the prediction of lesions as background, preventing missed diagnoses, and also reduces the prediction of background as lesions, reducing misdiagnoses. The proposed feature-level contrastive learning-based embedding module enhances the network's learning of background and four types of lesion structure features, enabling the network to better distinguish the four types of lesion structures and improving its ability to segment DR lesions.
[0107] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for automatic segmentation of minimal lesions based on diabetic retinopathy, characterized by, The method comprises the following steps: S1: obtaining a DR fundus image data set; S2: preprocessing the images and corresponding true labels in the data set, and using the true labels of the images to obtain preset first feature level labels and second feature level labels respectively; S3: dividing the preprocessed images, true labels, first feature level labels, and second feature level labels into a training set, a validation set, and a test set, and constructing a segmentation network model with an auxiliary segmentation module; S4: training the segmentation network model using the training set and the validation set to obtain a trained segmentation network model; S5: inputting the test set into the trained segmentation network model to output a segmentation result, and comparing the output result with the true labels to obtain a segmentation evaluation index; The specific steps of obtaining the preset first feature level labels using the true labels of the images are as follows: The height and width of the true labels are set as H and W, the height and width of the first feature level labels are set as h and w, size_h=H / h, size_w=W / w, and the size of the first feature level labels is h*w*c, wherein c is the number of lesion types plus 1; In the true labels of each size_h*size_w, if a pixel belongs to a class c, the value of the c channel in the corresponding feature level label is 1, and if no pixel belongs to the class c, the lesion of the class c is 0; The specific steps of obtaining the preset second feature level labels using the true labels of the images are as follows: The height and width of the true labels are set as H and W, the height and width of the second feature level labels are set as h and w, size_h=H / h, size_w=W / w, the size of the second feature level labels is h*w, and the value of the feature map at position i, j is equal to the maximum value in the i th size_h to j th size_w of the true label, wherein the value of i is from 0 to h, and the value of j is from 0 to w; The segmentation network model comprises a backbone segmentation network, an auxiliary segmentation module, and an embedded module, wherein the backbone segmentation network comprises an encoder, a decoder, and a feature map forward-backward fusion mechanism, the encoder is a ResNet18 network-based encoder for feature extraction, the decoder performs upsampling on the feature map to restore the resolution size of the feature map, and the feature map forward-backward fusion mechanism is used to realize the fusion of multi-scale feature maps in the decoder, thereby relieving the loss of spatial information as much as possible; The auxiliary segmentation module uses the first feature level labels and the first feature map output by the auxiliary segmentation module for comparison to enhance the feature representation of the foreground class; The embedded module uses the feature level vectors for comparison to narrow the feature vectors of the same type of lesions and to distance the feature vectors of different types of lesions.
2. The method of claim 1, wherein the method is based on a small lesion of diabetic retinopathy, and The preprocessing of the images and corresponding true labels in the data set comprises: randomly scaling the images and their corresponding labels in the DR fundus image data set in sequence, wherein the scaling ratio of the labels is completely the same as that of the images; normalizing the scaled images; randomly cropping the labels and the normalized images to a preset size, wherein the labels and the normalized images have the same preset size and the same cropping method.
3. The method of claim 1, wherein the method is based on a small lesion of diabetic retinopathy, characterized in that, The segmentation network model is trained by using the training set and the validation set to obtain a trained segmentation network model, and the specific steps are as follows: initializing a preset optimal evaluation index, inputting the training set into the segmentation network model to obtain a final segmentation result, an auxiliary segmentation result and a feature level output; The final segmentation result and the auxiliary segmentation result are compared with the real label, the feature level output is compared with the feature level label, the loss is calculated, the loss is back propagated, the network parameters affecting the model training and the model output are updated and calculated by using the optimizer SGD to make them approach or reach the optimal value, so as to minimize the loss function and obtain an optimal model; The images in the validation set are input into the optimal model one by one to obtain segmentation results, the segmentation results are compared with the real label to obtain an evaluation index, and the evaluation index is compared with the current optimal evaluation index; if the current optimal evaluation index is better than the current optimal evaluation index, the current model is saved, and the current evaluation index is assigned to the optimal evaluation index; the training is iterated to a specified number of times to obtain a final optimal model.
4. The method of claim 3, wherein the method is based on a small lesion of diabetic retinopathy, and The loss includes: a backbone segmentation loss an auxiliary segmentation loss , and , feature-level loss and contrastive learning loss wherein , , and The total loss is calculated as follows: (3) (4) (5) Wherein, the loss coefficient values are respectively: a = 1.0, β = 0.4, γ = 0.4, δ = 0.7, ε = 1.0, =1.
0.
5. The method of claim 1, wherein the method is based on a small lesion of diabetic retinopathy, and The preset optimal evaluation index is initialized as 0.
6. A system for automatic segmentation of minimal lesions based on diabetic retinopathy, characterized by, The system comprises a memory and a processor, the memory comprises a diabetic retinopathy-based automatic segmentation method program for a minimal lesion, and the diabetic retinopathy-based automatic segmentation method program for a minimal lesion is implemented by the processor to realize the following steps: S1: obtaining a DR fundus image data set; S2: preprocessing the images and corresponding real labels in the data set, and obtaining preset first feature level labels and second feature level labels from the real labels of the images; S3: dividing the preprocessed images, real labels, first feature level labels and second feature level labels into a training set, a validation set and a test set, and constructing a segmentation network model with an auxiliary segmentation module; S4: training the segmentation network model by using the training set and the validation set to obtain a trained segmentation network model; S5: inputting the test set into the trained segmentation network model to output a segmentation result, and comparing the output result with the real label to obtain a segmentation evaluation index; The specific steps of obtaining the preset first feature level labels from the real labels of the images are as follows: The height and width of the real label are set as H and W, the height and width of the first feature level label are set as h and w, size_h=H / h and size_w=W / w, the size of the first feature level label is h*w*c, and c is the number of lesion types plus 1; In the real label of each size_h*size_w, if a pixel belongs to class c, the value of the c channel in the corresponding feature level label is 1, and if no pixel belongs to class c, the lesion of this class is 0; The specific steps of obtaining the preset second feature level labels from the real labels of the images are as follows: The height and width of the real label are set as H and W, the height and width of the second feature level label are set as h and w, size_h=H / h, size_w=W / w, the size of the second feature level label is h*w, and the value of the feature map at position i, j is equal to the maximum value in the i th size_h to the j th size_w of the real label position, wherein the value of i is from 0 to h, and the value of j is from 0 to w; The segmentation network model comprises a main segmentation network, an auxiliary segmentation module and an embedding module, wherein the main segmentation network comprises an encoder, a decoder and a feature map forward-backward fusion mechanism, the encoder is a ResNet18 network-based encoder for feature extraction, the decoder performs up-sampling on the feature map to restore the resolution size of the feature map, and the feature map forward-backward fusion mechanism is used to realize the fusion of multi-scale feature maps in the decoder, thereby relieving the loss of spatial information as much as possible; The auxiliary segmentation module uses the first feature level label and the first feature map output by the auxiliary segmentation module for comparison to enhance the feature performance of the foreground class; The embedding module uses the feature level vector for comparison to narrow the feature vectors of the same type of lesion and widen the feature vectors of different types of lesion.
7. A computer readable storage medium characterized in that, The computer readable storage medium comprises a diabetic retinopathy-based minimal lesion automatic segmentation method program, and the diabetic retinopathy-based minimal lesion automatic segmentation method program is executed by the processor to realize the steps of the diabetic retinopathy-based minimal lesion automatic segmentation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Fundus image focus area labeling method based on deep learning
CN110097559A
Unsupervised domain adaptive remote sensing road semantic segmentation method based on GAN network
CN113888547A