Disc segmentation method, disc cup segmentation model training method, device, equipment and medium
Through the optic disc and optic cup segmentation method and model based on the attention mechanism, the problem of insufficient accuracy of expert labeling is solved, and efficient and accurate segmentation of the optic disc and optic cup is achieved, thereby improving the accuracy and efficiency of glaucoma diagnosis.
Patent Information
- Application Number
- CN202210135442.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-02-14
AI Technical Summary
In the prior art, the segmentation of the optic disc and optic cup in fundus images relies on expert annotation, which has the problem of insufficient accuracy.
An attention-based optic disc and optic cup segmentation method and model is adopted. By acquiring fundus images, the optic disc and optic cup are segmented using the encoding and decoding modules of the attention mechanism. The optic disc and optic cup segmentation model is trained with the weight parameters annotated by multiple experts to improve segmentation accuracy.
The efficient and accurate segmentation of the optic disc and cup is achieved, which improves the accuracy and efficiency of glaucoma diagnosis and reduces the error caused by human segmentation.
Smart Images

Figure CN114648634B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, specifically to the fields of artificial intelligence and intelligent medicine, and more particularly to a method for segmenting an optic disc and an optic cup, a model training method, an apparatus, a device, and a medium. Background Art
[0002] Glaucoma is a common eye disease that can irreversibly cause visual field loss or even permanent blindness. In this case, early diagnosis and interventional treatment are particularly important.
[0003] In clinical practice, the ratio of the optic disc to the optic cup in fundus images is a crucial indicator for glaucoma diagnosis. The greater the cup-to-disc ratio, the more likely glaucoma is suspected. This is why optic disc and cup segmentation is crucial for glaucoma diagnosis. Summary of the Invention
[0004] The present disclosure provides an optic disc and optic cup segmentation method, model training method, device, equipment and medium.
[0005] According to one aspect of the present disclosure, a method for segmenting an optic disc and an optic cup of a fundus image is provided, comprising:
[0006] Acquire fundus images;
[0007] Based on the attention mechanism, the optic disc and optic cup of the fundus image are segmented to obtain the segmented images of the optic disc and optic cup.
[0008] According to another aspect of the present disclosure, a method for training an optic disc and optic cup segmentation model is provided, comprising:
[0009] Obtaining weight parameters for multiple optic disc and optic cup segmentation annotations for training fundus images whose diagnosis result is glaucoma;
[0010] Based on the weight parameters of the multiple optic disc and optic cup segmentation annotations and the multiple optic disc and optic cup segmentation annotations, obtaining a label image of the optic disc and optic cup segmentation corresponding to the training fundus image;
[0011] The training fundus image and the label image of the optic disc and optic cup segmentation are used to train an optic disc and optic cup segmentation model based on an attention mechanism.
[0012] According to another aspect of the present disclosure, a device for segmenting an optic disc and an optic cup of a fundus image is provided, comprising:
[0013] An acquisition module, used for acquiring fundus images;
[0014] The segmentation module is used to segment the optic disc and optic cup of the fundus image based on the attention mechanism to obtain an image of the optic disc and optic cup segmentation.
[0015] According to yet another aspect of the present disclosure, a training device of an optic disc and optic cup segmentation model is provided, comprising:
[0016] a parameter acquisition module configured to acquire weight parameters of a plurality of optic disc and optic cup segmentation annotations of a training fundus image with a diagnosis result of glaucoma;
[0017] an image acquisition module configured to acquire a label image of optic disc and optic cup segmentation corresponding to the training fundus image based on the weight parameters of the plurality of optic disc and optic cup segmentation annotations and the plurality of optic disc and optic cup segmentation annotations;
[0018] a training module configured to train an optic disc and optic cup segmentation model based on an attention mechanism by using the training fundus image and the label image of the optic disc and optic cup segmentation.
[0019] According to still another aspect of the present disclosure, an electronic device is provided, comprising:
[0020] at least one processor; and
[0021] a memory communicatively connected to the at least one processor; wherein
[0022] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of the aspects and any possible implementation manner described above.
[0023] According to still another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, the computer instructions being used to cause the computer to perform the method of the aspects and any possible implementation manner described above.
[0024] According to yet another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method of the aspects and any possible implementation manner described above.
[0025] According to the technology of the present disclosure, the segmentation efficiency of the optic disc and optic cup can be effectively improved, and the accuracy of the trained optic disc and optic cup segmentation model can be effectively improved.
[0026] It should be understood that the contents described in this part are not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0027] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:
[0028] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0029] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0030] Figure 3 is an architectural diagram of the optic disc and optic cup segmentation model in use in an embodiment of the present disclosure;
[0031] Figure 4 is a schematic diagram according to a third embodiment of the present disclosure;
[0032] Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0033] Figure 6A is the original fundus image of the present disclosure;
[0034] Figure 6B Schematic diagram of various optic disc and optic cup segmentation and annotation images disclosed herein;
[0035] Figure 6C yes Figure 6B Infrared image of
[0036] Figure 6D is a label image of the optic disc and optic cup segmentation of the present disclosure;
[0037] Figure 7 1 is an architecture diagram of the optic disc and optic cup segmentation model training in an embodiment of the present disclosure;
[0038] Figure 8A is an architectural diagram of an optic disc and optic cup segmentation model provided in an embodiment of the present disclosure;
[0039] Figure 8B yes Figure 8A The working principle diagram of the given module in the figure;
[0040] Figure 8C yes Figure 8A The working principle diagram of the module in the figure;
[0041] Figure 9 is a schematic diagram according to a fifth embodiment of the present disclosure;
[0042] Figure 10 is a schematic diagram according to a sixth embodiment of the present disclosure;
[0043] Figure 11 is a block diagram of an electronic device for implementing the method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0045] Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0046] It should be noted that the terminal devices involved in the embodiments of the present disclosure may include but are not limited to mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers and other smart devices; display devices may include but are not limited to personal computers, televisions and other devices with display functions.
[0047] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0048] In the prior art, experts can segment and annotate the optic disc and cup in fundus images. However, this segmentation and annotation is a manual operation, limited by the experts' professional capabilities, and cannot guarantee the accuracy of optic disc and cup segmentation. Therefore, the present disclosure provides a non-manual optic cup and disc segmentation method to improve the accuracy and efficiency of optic cup and disc segmentation.
[0049] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure; Figure 1 As shown, this embodiment provides a method for segmenting the optic disc and optic cup of a fundus image, which can be applied to any device for segmenting the optic disc and optic cup of a fundus image, such as an electronic device or a terminal, and specifically may include the following steps:
[0050] S101, acquiring fundus images;
[0051] S102. Based on the attention mechanism, the optic disc and optic cup of the fundus image are segmented to obtain an image of the optic disc and optic cup segmentation.
[0052] In the optic disc and cup segmentation method for fundus images of this embodiment, the optic disc and cup of the fundus image can be segmented using an attention mechanism, effectively improving the accuracy of the segmented images. Furthermore, the highly accurate optic disc and cup segmentation images obtained in this embodiment can subsequently maximize the diagnosis of glaucoma in the fundus image, effectively improving the accuracy and efficiency of glaucoma diagnosis.
[0053] The method for segmenting the optic disc and cup of fundus images in this embodiment uses an attention mechanism to segment the optic disc and cup, effectively improving the accuracy of the resulting segmented images. Furthermore, the method eliminates the need for manual segmentation, effectively improving the efficiency of optic disc and cup segmentation in fundus images.
[0054] Optionally, the above Figure 1 In the illustrated embodiment, step S102 may use an attention mechanism algorithm to segment the optic disc and optic cup of the fundus image, thereby obtaining images of the segmented optic disc and optic cup, thereby making the video and optic cup segmentation more accurate.
[0055] Alternatively, a pre-trained optic disc and optic cup segmentation model based on the attention mechanism can be used to segment the optic disc and optic cup of the fundus image to obtain images of the optic disc and optic cup segmentation, making the video and optic cup segmentation more accurate.
[0056] Compared with the above-mentioned segmentation of the optic disc and optic cup of the fundus through the attention mechanism algorithm, the optic disc and optic cup segmentation model based on the attention mechanism is more intelligent, the segmentation results are more accurate, and the segmentation efficiency is higher.
[0057] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure; Figure 2 As shown, this embodiment provides a method for segmenting the optic disc and optic cup of a fundus image. The optic disc and optic cup segmentation model based on the attention mechanism is used to segment the optic disc and optic cup of the fundus image. Specifically, the method may include the following steps:
[0058] S201, acquiring fundus images;
[0059] S202, using each encoding module in the optic disc and cup segmentation model to encode the input feature information respectively to obtain encoding features; the feature information input by the first layer encoding module is the feature of the fundus image;
[0060] Figure 3 This is a diagram of the architecture of the optic disc and optic cup segmentation model used in the embodiment of the present disclosure. Figure 3As shown, the optic disc and cup segmentation model is a symmetrical structure, specifically including multiple layers of serially connected encoding modules and multiple layers of serially connected decoding modules. Furthermore, each intermediate layer encoding module is connected to a Give Model implemented based on an attention mechanism, which is connected to the corresponding Take Model implemented based on an attention mechanism in the decoding module of the symmetrical layer. That is, if there are N encoding modules and N decoding modules, there are N-2 Give modules and N-2 Take modules. No Give modules or Take modules are set at either end of the serially connected Give modules and Take modules. Instead, a Give module and a Take module are serially connected between the encoding modules and decoding modules of the symmetrical intermediate layers. Specifically, the symmetrical intermediate layers are such that the 2nd layer encoding module is symmetrical with the 2nd to last layer decoding module, the 3rd layer encoding module is symmetrical with the 3rd to last layer decoding module, and the N-1th layer encoding module is symmetrical with the N-1th to last layer decoding module.
[0061] Specifically, in the optic disc and cup segmentation model, the first-layer encoding module inputs the fundus image features. After the first layer of encoding, the resulting encoded features serve as the input feature information for the next layer of encoding modules. This continues in this manner until the final layer of encoding modules inputs the resulting encoded features into the first-layer decoding module.
[0062] S203, using each module in each attention processing unit in the optic disc and cup segmentation model to perform feature processing based on the attention mechanism on the encoding features of the encoding module of the corresponding layer, to obtain a processed first attention feature;
[0063] Specifically, if Figure 3 As shown in , in the 2nd to N-1th layers of the encoding module, each layer of the encoding module is connected to an attention processing unit based on the attention mechanism. Figure 3 As shown in the figure, each attention processing unit includes a giving module and a corresponding taking module. Each giving module performs feature processing based on the attention mechanism on the encoding features obtained by encoding the encoding module of the corresponding layer, obtains the first attention feature, and outputs it to the corresponding decoding module. Figure 3 In the structure shown, the encoding module of layer i is symmetrical with the decoding module of layer i to the last. The giving module connected to the encoding module of layer i corresponds to the taking module connected to the decoding module of layer i to the last, and they are located in the same attention processing unit. Furthermore, since the taking module is connected in series between decoding modules, specifically, the giving module located after the encoding module of layer i and connected to the encoding module of layer i corresponds to the decoding module located after the decoding module of layer i to the last, and connected to the decoding module of layer i to the last.
[0064] S204: Using the extraction module in each attention processing unit in the optic disc and cup segmentation model, perform feature processing based on the attention mechanism based on the decoding features of the corresponding decoding module and the corresponding first attention features output to the module, and obtain the processed second attention features as the input of the decoding module of the next layer;
[0065] S205 , using each decoding module in the optic disc and optic cup segmentation model to respectively decode the input feature information until the last layer of decoding modules decodes and obtains the segmented image of the optic disc and optic cup.
[0066] by Figure 3 Taking the giving module corresponding to the i-th layer encoding module as an example, the taking module connected to the decoding module corresponding to the i-th layer from the bottom can obtain the first attention feature input by the giving module corresponding to the i-th layer encoding module, and the decoding feature decoded by the corresponding decoding module, that is, the i-th layer from the bottom decoding module, and perform feature processing based on the attention mechanism to obtain the processed second attention feature.
[0067] If i is not equal to 2, each extraction module follows the above process to obtain the second attention feature and input it to the decoding module of the next layer. The decoding module of the next layer continues decoding based on the second attention feature, and the extraction module corresponding to the decoding module of the next layer continues feature processing in the above manner.
[0068] If i is equal to 2, Figure 3 Taking the given module corresponding to the second-layer encoding module as an example, the fetch module connected to the decoding module corresponding to the second-to-last layer can obtain the first attention feature input by the given module corresponding to the second-layer encoding module, as well as the decoded feature decoded by the corresponding decoding module, that is, the second-to-last layer decoding module. It performs feature processing based on the attention mechanism to obtain the processed second attention feature. This is then input into the decoding module of the first-to-last layer, at which point the decoding module can decode and obtain the image of the optic disc and optic cup segmentation.
[0069] Because the giving module is trained using an attention mechanism, the resulting first attention feature can be tuned to the structure of the optic disc and cup segmentation. The giving module then passes this first attention feature to the corresponding extraction module. The extraction module then processes the encoded feature based on this first attention feature, enabling it to also tune to the structure of the optic disc and cup segmentation, thereby generating a second attention feature. This feature is then fed into the decoding module in the next layer, enabling the decoding module to decode the second attention feature, thereby more accurately decoding the image of the optic disc and cup segmentation.
[0070] In use, the optic disc and cup segmented image obtained by the embodiment is input into the glaucoma diagnosis model trained in advance, so that whether the corresponding fundus is glaucoma can be accurately predicted. Since the optic disc and cup segmented image adopted is more accurate, the prediction of glaucoma is more accurate. Moreover, the prediction process is very intelligent and easy to implement.
[0071] In the embodiment, the processing of the attention mechanism is implemented by using a set of giving module and taking module in each attention processing unit in the optic disc and cup segmentation model. In actual application, each attention processing unit can be a whole. Specifically, each attention processing unit in the optic disc and cup segmentation model can be directly used to perform feature processing of the attention mechanism based on the encoding features of the encoding module of the corresponding layer and the decoding features of the corresponding decoding module, and the processed feature information is taken as the input of the decoding module of the next layer. Alternatively, each attention processing unit can also use other ways and other numbers of modules to implement the processing of the attention mechanism, which is not limited herein.
[0072] The method for segmenting the optic disc and cup of the fundus image in the embodiment can more accurately segment the optic disc and cup in the fundus image by using the giving module and the taking module in the optic disc and cup segmentation model to implement the processing of the attention mechanism, thereby obtaining more accurate optic disc and cup segmented images and further effectively improving the efficiency of image optic disc and cup segmentation. Moreover, since more accurate optic disc and cup segmented images are obtained, the diagnostic accuracy and efficiency of glaucoma can also be effectively improved. Furthermore, the use of the optic disc and cup segmentation model based on the attention mechanism can further improve the intelligence of the segmentation of the optic disc and cup of the fundus image.
[0073] Figure 4 is a schematic diagram according to the third embodiment of the present disclosure; as Figure 4 shown, the embodiment provides a training method of an optic disc and cup segmentation model, which can be applied to a training device of the optic disc and cup segmentation model, and the training device can be implemented by using a computer device. As Figure 4 shown, the training method of the optic disc and cup segmentation model in the embodiment can specifically include the following steps:
[0074] S401, obtaining a plurality of weight parameters of the segmentation annotation of the optic disc and cup of the training fundus image with a diagnosis result of glaucoma;
[0075] In the embodiment, the segmentation annotation of each type of optic disc and cup of the training fundus image can be a segmentation method of one type of optic disc and cup annotated by one expert. Since different experts have different business capabilities, in the embodiment, a plurality of segmentation schemes of the optic disc and cup annotated by different experts are adopted, that is, a plurality of segmentation annotations of the optic disc and cup are obtained.
[0076] Since different experts have different professional capabilities, the resulting optic disc and optic cup segmentation and annotation schemes are also different. Based on this, the weights of the optic disc and optic cup segmentation and annotation schemes of experts with strong professional capabilities can be configured slightly higher, while the weights of the optic disc and optic cup segmentation and annotation schemes of experts with low professional capabilities can be configured slightly lower. Specifically, the weight parameters of the various optic disc and optic cup segmentation and annotation of this embodiment can be pre-configured by professionals based on actual conditions, and can be directly obtained when used. Alternatively, in actual applications, other methods can also be used to obtain,
[0077] S402, based on the weight parameters of the multiple optic disc and optic cup segmentation annotations and the multiple optic disc and optic cup segmentation annotations, obtaining a label image of the optic disc and optic cup segmentation corresponding to the training fundus image;
[0078] Specifically, by comprehensively considering each optic disc and optic cup segmentation and annotation scheme of the training fundus image and the corresponding weight parameters, a label image of the optic disc and optic cup segmentation corresponding to the training fundus image is generated, which can improve the accuracy of the generated label image of the optic disc and optic cup segmentation.
[0079] S403: Using the training fundus image and the labeled image of the optic disc and optic cup segmentation, train an optic disc and optic cup segmentation model based on the attention mechanism.
[0080] Specifically, in this embodiment, when training the optic disc and optic cup segmentation model using training fundus images and label images for optic disc and optic cup segmentation, it can be implemented based on the attention mechanism, so that the attention mechanism is used in the trained optic disc and optic cup segmentation model to improve the accuracy of the optic disc and optic cup segmentation model.
[0081] In practical applications, multiple training fundus images may be collected, and the optic disc and optic cup segmentation model may be trained according to the method of this embodiment.
[0082] The training method for the optic disc and cup segmentation model of this embodiment utilizes multiple weight parameters and multiple optic disc and cup segmentation annotations to obtain labeled images for optic disc and cup segmentation corresponding to training fundus images, effectively improving the accuracy of the obtained labeled images. Furthermore, based on an attention mechanism, the training fundus images and labeled images for optic disc and cup segmentation are used to train the optic disc and cup segmentation model, effectively improving the accuracy of the trained optic disc and cup segmentation model. Furthermore, based on the trained optic disc and cup segmentation model, more accurate optic disc and cup images can be obtained, effectively improving the accuracy and efficiency of glaucoma diagnosis.
[0083] Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure; Figure 5As shown, this embodiment provides a training method for the optic disc and optic cup segmentation model. Figure 4 Based on the technical solutions of the embodiments shown, the technical solutions of the present disclosure are further described in detail. Figure 5 As shown, the training method of the optic disc and optic cup segmentation model of this embodiment may specifically include the following steps:
[0084] S501, collecting multiple training fundus images with a diagnosis result of glaucoma;
[0085] S502: For each training fundus image, based on the training fundus image and the diagnosis result of the training fundus image, a pre-trained glaucoma diagnosis model is used to obtain weight parameters for multiple optic disc and optic cup segmentation annotations;
[0086] S503, based on the weight parameters of the multiple optic disc and optic cup segmentation annotations, performing weighted averaging on the multiple optic disc and optic cup segmentation annotations to obtain a label image of the optic disc and optic cup segmentation corresponding to the training fundus image;
[0087] Specifically, an end-to-end glaucoma diagnosis model can be pre-trained on the training set. This network model uses the fundus image and the concatenated optic disc and optic cup segmentation image obtained by averaging multiple optic disc and optic cup segmentation annotations from multiple experts as input, uses the glaucoma diagnosis probability as output, and uses the glaucoma diagnosis annotations as training. Subsequently, the weight parameter is used as the learning parameter to obtain the weighted average of the multiple optic disc and optic cup segmentation annotations from multiple experts. The fundus image concatenated with this result is input into the trained network, and then the learning weight parameter is updated with the goal of maximizing diagnostic accuracy. Through this method, the weight parameters of a combination of multiple optic disc and optic cup segmentation annotations that can maximize diagnostic accuracy can be learned. In the present disclosure, the optic disc and optic cup segmentation image obtained by this method with reference to the combination of multiple optic disc and optic cup segmentation annotations from multiple experts can be called a DFSim fundus image.
[0088] For example, a set of random weights can be initialized for multiple optic disc and cup segmentation annotations, and then a weighted average is performed based on the set of weights and the multiple optic disc and cup segmentation annotations to obtain a training fundus image. The training fundus image is then input into a glaucoma diagnostic model, which can predict the probability that the training fundus image is glaucoma. If the probability is not 1, the weight parameters of the multiple optic disc and cup segmentation annotations are continuously adjusted until the glaucoma diagnostic model predicts that the probability that the training fundus image is glaucoma is 1. At this time, the weight parameters of the multiple optic disc and cup segmentation annotations can be obtained. Then, based on the obtained weight parameters of the multiple optic disc and cup segmentation annotations, the multiple optic disc and cup segmentation annotations are weighted averaged to obtain a label image of the optic disc and cup segmentation corresponding to the training fundus image.
[0089] For example, Figure 6A is the original fundus image of the present disclosure; Figure 6B Schematic diagram of various optic disc and optic cup segmentation and annotation images disclosed in the present invention. Figure 6B The multiple circles in the figure represent the segmentation marking of the optic disc and the optic cup. For example, the specific marking can also be recorded in text form, and the center and radius length of the ellipse corresponding to the optic disc and the optic cup can be recorded respectively. Figure 6C yes Figure 6B The infrared image can clearly show the segmentation of the optic disc and the optic cup. Figure 6D This is the labeled image of the optic disc and cup segmentation of the present disclosure. That is, using the method of the above embodiment, based on the weight parameters of the multiple optic disc and cup segmentation annotations, a weighted average is performed on the multiple optic disc and cup segmentation annotations to obtain the labeled image of the optic disc and cup segmentation, which can also be called a DFSim fundus image.
[0090] According to step S502 and step S503, multiple training fundus images and label images of optic disc and optic cup segmentation of each training fundus image can be obtained as multiple training data of the optic disc and optic cup segmentation model.
[0091] S504, selecting a training fundus image and a corresponding label image of optic disc and optic cup segmentation;
[0092] In this embodiment, one training fundus image and corresponding labeled image of optic disc and optic cup segmentation are used for each training. In practical applications, multiple training fundus images and corresponding labeled images of optic disc and optic cup segmentation may also be used for each training.
[0093] S505: Based on the training fundus image, obtain a predicted image of the optic disc and optic cup segmentation predicted by the optic disc and optic cup segmentation model according to the attention mechanism;
[0094] For example, combined with Figure 7 In the structure shown in FIG. 5 , step S505 of this embodiment obtains a predicted image of the optic disc and optic cup segmentation predicted by the optic disc and optic cup segmentation model according to the attention mechanism based on the training fundus image. Specifically, the following steps may be included in the implementation:
[0095] (1) Each encoding module in the optic disc and optic cup segmentation model is used to encode the input feature information to obtain the encoding features; the feature information input by the first layer encoding module is the feature of the fundus image; the working principle of this encoding module is the same as the above Figure 3 The encoding modules shown work on the same principle.
[0096] (2) using the given module in each attention processing unit in the optic disc and optic cup segmentation model, respectively, to perform feature processing based on the attention mechanism on the encoding features of the encoding module of the corresponding layer and the features of the label image of the optic disc and optic cup segmentation, so that the obtained first attention feature can pay attention to the features of the label image of the optic disc and optic cup segmentation relative to the encoding feature;
[0097] Each module is consistent with the above Figure 3 The working principle of the given module is different. In this embodiment, the given module input adds the features of the label image of the optic cup segmentation, so that the features of the label image of the optic cup segmentation are more noticed in the subsequent feature processing, that is, the recognizability of the features of the label image of the optic cup segmentation is enhanced.
[0098] (3) Using the extraction module in each attention processing unit in the optic disc and cup segmentation model, feature processing based on the attention mechanism is performed based on the decoding features of the corresponding decoding module and the first attention features output by the corresponding module, and the processed second attention features are obtained as the input of the decoding module of the next layer;
[0099] (4) Each decoding module in the optic disc and optic cup segmentation model is used to decode the input feature information respectively until the last layer of decoding module decodes and obtains the predicted image of the optic disc and optic cup segmentation.
[0100] When training the optic disc and optic cup segmentation model, the working principles of the giving module, taking module, and decoding module in each attention processing unit are the same as those when used for prediction. For details, please refer to the above Figure 3 The relevant records of the embodiment shown. The above steps are based on the example that each attention processing unit includes a giving module and a taking module. In actual applications, each attention processing unit can be an independent and complete structure. In this case, the above steps (3) and (4) can be replaced by the following steps: using each attention processing unit in the optic disc and optic cup segmentation model, respectively, based on the encoding features of the corresponding encoding module, the features of the label image of the optic disc and optic cup segmentation, and the decoding features of the corresponding decoding module, perform feature processing of the attention mechanism, and use the processed feature information as the input of the decoding module of the next layer.
[0101] In this embodiment, the attention processing units in the optic disc and cup segmentation model, including the giving module and the taking module, are used as an example to train a model that maximizes optic disc and cup segmentation. This network model uses fundus images as input and optic disc and cup segmentation images as output. Training is performed using the labeled images of the optic disc and cup segmentation obtained in step S503 as labels.
[0102] In this embodiment, the segmented optic disc and optic cup images can be used in a diagnostic network model to diagnose whether the corresponding fundus is glaucoma. Therefore, the features of the segmented optic disc and optic cup images, or the features of the labeled optic disc and optic cup segmented images, can be referred to as features of the diagnostic network. The optic disc and optic cup segmentation model of this embodiment is a neural network model used to segment the optic disc and optic cup in fundus images, and can also be referred to as a segmentation network.
[0103] Specifically, the give module in each attention processing unit is an attention-based module that connects the encoding module of the optic disc and cup segmentation model with the features of the diagnostic network. In each layer of the give module, the features of the segmentation network, namely the encoding features of the encoding module, serve as the query for the attention mechanism, while the corresponding diagnostic features, namely the features of the labeled image of the optic disc and cup segmentation, serve as the key and value. This structure effectively transforms the diagnostic features, based on maximizing the response of the results with the corresponding network features. This yields diagnostic features that incorporate diagnostic information. The take module in each attention processing unit adopts a symmetrical structure to the give module and connects the encoding module of the segmentation network with the diagnostic network, namely the give module. The take model uses the diagnostic network features, namely the give module's input, as the query for the attention mechanism, while the corresponding segmentation network features, namely the decoded features of the decoding module, serve as the key and value. This structure effectively transforms the features of the segmentation network, based on maximizing the response of the results with the corresponding diagnostic features. This yields segmentation features that incorporate diagnostic information. By applying the above-mentioned giving module and taking module, the segmentation network, i.e., the optic disc and optic cup segmentation model, can better learn the segmentation images of the optic cup and optic disc that maximize the diagnostic accuracy.
[0104] In this embodiment, the attention mechanism is implemented by taking the example of each attention processing unit in the optic disc and optic cup segmentation model including a pair of giving modules and taking modules. In actual applications, each attention processing unit can be an independent and complete structure, or other methods and other numbers of modules can be used to implement the attention mechanism, which is not limited here.
[0105] S506, constructing a loss function based on the label image of the optic disc and optic cup segmentation and the predicted image of the optic disc and optic cup segmentation;
[0106] Specifically, the loss function can be constructed based on the cross entropy of the label image of the optic disc and optic cup segmentation and the predicted image of the optic disc and optic cup segmentation.
[0107] S507, check whether the loss function converges; if not, execute step S508; if converged, execute step S509;
[0108] S508, adjusting the parameters of the optic disc and optic cup segmentation model based on the attention mechanism; returning to step S504 to select the next training data to continue training;
[0109] In this embodiment, adjusting the parameters of the optic disc and optic cup segmentation model includes adjusting the parameters of each encoding module, decoding module, input module, and output module.
[0110] S509 , checking whether the training termination condition is met. If so, the training ends and the parameters of the optic disc and optic cup segmentation model are obtained; if not, returning to step S504 to select the next training data to continue training.
[0111] The training termination condition in this embodiment can be whether the loss function always converges in a preset number of consecutive rounds of training. The preset number of consecutive rounds can include 50 rounds, 80 rounds, 100 rounds, or other rounds, which are not limited here. In actual applications, it can be set according to actual needs. Alternatively, the training termination condition can also be that the number of training times reaches a preset number threshold. The preset number threshold in this embodiment can be set to 100,000, 1 million, or other times according to actual needs, which is not limited here.
[0112] Figure 7 This is the architecture diagram of the optic disc and optic cup segmentation model training in the embodiment of the present disclosure. Figure 7 As shown, in Figure 3 Based on the illustrated architecture, the input of the give model module (give model) is supplemented with feature information. This feature information can be features of the label image based on the optic disc and optic cup segmentation. This allows the give model to perform feature processing based on the corresponding encoding features and the features of the label image based on the optic disc and optic cup segmentation, resulting in a first attention feature that is more attentive to the features of the label image based on the encoding features. The first attention feature is then output to the corresponding take model module. The take model module performs feature processing based on the input first attention feature and the decoded features obtained by the corresponding decoding module, resulting in a second attention feature that is more attentive to the features of the label image based on the input decoded features. In this way, the second attention feature is input to the decoding module of the next layer and then decoded, resulting in a more accurate predicted optic disc and optic cup segmentation image.
[0113] Figure 8A This is an architectural diagram of an optic disc and optic cup segmentation model provided in an embodiment of the present disclosure. Figure 8B yes Figure 8AThe working principle diagram of the given module in . Figure 8C yes Figure 8A The working principle diagram of the module in the figure. Figure 8A As shown in , the original image represents the fundus image, and the label image represents the label image of the corresponding optic disc and optic cup segmentation during training, which can also be called the DFSim fundus image. The predicted image is the predicted image of the predicted optic disc and optic cup segmentation. Figure 8A As shown, four layers of encoding modules and decoding modules are taken as an example. In actual applications, other numbers of multiple layers can be used, which is not limited here. The features of the original image are encoded by the four layers of encoding modules in sequence. In this embodiment, the features encoded by the encoding module of the last layer are decoded by U-NetDecoder, with the goal of obtaining the most ideal label image. The second-layer encoding module and the third-layer encoding module are each connected to a Give module, such as the Give module in the figure. Each Give module is connected to the features of the label image on the diagnostic network side and performs feature processing of the attention mechanism. And output to the corresponding take module, that is, the Take module in the figure. The Take module then processes the decoding features of the corresponding decoding layer and the attention features input to the Give module, and outputs them to the next layer of decoding module until the last layer of decoding module outputs the predicted image. During the training process, a cross entropy loss function can be constructed based on the label image and the predicted image to achieve supervised training. As shown in the figure, L BCE As shown in the figure. represents the encoding features of the encoding module at layer k, represents the decoding features of the decoding module at layer k, Features of the label image at layer k.
[0114] like Figure 8B As shown in Figure 8c, the giving module and taking module include the Multihead Attention module and the Multilayer Perceptron (MLP) respectively. The input of the giving module is and The corresponding output is The corresponding input of the module is and the input to the module The output features are given to the next layer decoding module for decoding, which can be expressed as Specifically, Figure 8A 、 Figure 8B and Figure 8C The detailed working principle shown can be referred to the relevant description of the above embodiment and will not be repeated here.
[0115] The training method of the optic disc and cup segmentation model of the embodiment can obtain the weight parameters of multiple optic disc and cup segmentation annotations by using the pre-trained glaucoma diagnosis model, and can obtain the label image of the optic disc and cup segmentation corresponding to the training fundus image by weighting and averaging the multiple optic disc and cup segmentation annotations based on the weight parameters of the multiple optic disc and cup segmentation annotations. The label image of the most accurate optic disc and cup segmentation can be obtained to the greatest extent by referring to the multiple optic disc and cup segmentation annotations, and the accuracy of the optic disc and cup segmentation model can be improved.
[0116] In the training of the optic disc and cup segmentation model of the embodiment, the learning of the attention mechanism of the giving module is controlled based on the features of the label image of the optic disc and cup segmentation and the encoding features of the encoding module, and the learning of the attention mechanism of the decoding model of the taking module is controlled based on the input features of the giving module. The giving module and the taking module can learn the label image of the optic disc and cup segmentation to the greatest extent, and the accuracy of the optic disc and cup segmentation model can be effectively improved. The accuracy of the trained optic disc and cup segmentation model can be effectively improved. Based on the trained optic disc and cup segmentation model, a more accurate optic disc and cup image can be obtained, and the accuracy and efficiency of glaucoma diagnosis can be effectively improved.
[0117] Figure 9 is a schematic view according to the fifth embodiment of the present disclosure; as Figure 9 shown, the embodiment provides an optic disc and cup segmentation device 900 of a fundus image, comprising:
[0118] The obtaining module 901 is configured to obtain a fundus image.
[0119] The segmentation module 902 is configured to segment the optic disc and cup of the fundus image based on the attention mechanism to obtain an image segmented by the optic disc and cup.
[0120] The optic disc and cup segmentation device 900 of the fundus image of the embodiment realizes the implementation principle and technical effect of the segmentation of the optic disc and cup of the fundus image by using the above modules, which is the same as the above related method embodiments. For details, please refer to the description of the above related method embodiments, which will not be repeated here.
[0121] Further, in one embodiment of the present disclosure, the segmentation module 902 is configured to:
[0122] The pre-trained optic disc and cup segmentation model based on the attention mechanism is used to segment the optic disc and cup of the fundus image to obtain an image segmented by the optic disc and cup.
[0123] Further, in one embodiment of the present disclosure, the segmentation module 902 is configured to:
[0124] The encoding modules in the optic disc and cup segmentation model are used to respectively encode the input feature information to obtain encoded features; the feature information input by the first layer encoding module is the feature of the fundus image;
[0125] The attention processing units in the optic disc and cup segmentation model are used to respectively perform feature processing based on the encoded features of the corresponding layer encoding module and the decoded features of the corresponding decoding module, and the processed feature information is used as the input of the decoding module of the next layer;
[0126] The decoding modules in the optic disc and cup segmentation model are used to respectively decode the input feature information until the image of the optic disc and cup segmentation is decoded by the last decoding module.
[0127] Further, in an embodiment of the present disclosure, the segmentation module 902 is configured to:
[0128] The giving module in each attention processing unit in the optic disc and cup segmentation model is used to respectively perform feature processing based on the attention mechanism on the encoded features of the corresponding layer encoding module to obtain the first attention features after processing;
[0129] The taking module in each attention processing unit in the optic disc and cup segmentation model is used to respectively perform feature processing based on the attention mechanism based on the decoded features of the corresponding decoding module and the first attention features output by the corresponding giving module to obtain the second attention features after processing as the input of the decoding module of the next layer.
[0130] The implementation principle and technical effects of the segmentation module 902 in the above embodiment are the same as those of the above-mentioned related method embodiments, and details can be referred to the description of the above-mentioned related method embodiments, which will not be repeated here.
[0131] Figure 10 is a schematic diagram according to the sixth embodiment of the present disclosure; as shown in Figure 10 The present embodiment provides a training device 1000 of an optic disc and cup segmentation model, which comprises:
[0132] The parameter acquisition module 1001 is configured to acquire the weight parameters of the multiple optic disc and cup segmentation annotations of the training fundus image whose diagnosis result is glaucoma;
[0133] The image acquisition module 1002 is configured to acquire the label image of the optic disc and cup segmentation corresponding to the training fundus image based on the weight parameters of the multiple optic disc and cup segmentation annotations and the multiple optic disc and cup segmentation annotations;
[0134] The training module 1003 is configured to train the optic disc and cup segmentation model based on the attention mechanism using the training fundus image and the label image of the optic disc and cup segmentation.
[0135] The training device 1000 of the optic disc and optic cup segmentation model of this embodiment uses the above modules to implement the optic disc and optic cup segmentation model. The implementation principle and technical effects are the same as those of the above-mentioned related method embodiments. For details, please refer to the description of the above-mentioned related method embodiments, which will not be repeated here.
[0136] Furthermore, in one embodiment of the present disclosure, the parameter acquisition module 1001 is configured to:
[0137] Based on the training fundus images and the diagnosis results of the training fundus images, a pre-trained glaucoma diagnosis model is used to obtain weight parameters for multiple optic disc and optic cup segmentation annotations.
[0138] Furthermore, in one embodiment of the present disclosure, the image acquisition module 1002 is configured to:
[0139] Based on the weight parameters of multiple optic disc and optic cup segmentation annotations, the multiple optic disc and optic cup segmentation annotations are weighted and averaged to obtain the label image of the optic disc and optic cup segmentation corresponding to the training fundus image.
[0140] Furthermore, in one embodiment of the present disclosure, the training module 1003 is configured to:
[0141] Based on the training fundus image, the predicted image of the optic disc and optic cup segmentation predicted by the optic disc and optic cup segmentation model according to the attention mechanism is obtained;
[0142] Constructing a loss function based on the label image of the optic disc and optic cup segmentation and the predicted image of the optic disc and optic cup segmentation;
[0143] When the loss function does not converge, adjust the parameters of the optic disc and optic cup segmentation model based on the attention mechanism.
[0144] Furthermore, in one embodiment of the present disclosure, the training module 1003 is configured to:
[0145] Each encoding module in the optic disc and cup segmentation model is used to encode the input feature information to obtain encoding features. The feature information input by the first layer encoding module is the feature of the fundus image.
[0146] Each attention processing unit in the optic disc and cup segmentation model performs feature processing of the attention mechanism based on the encoding features of the corresponding encoding module, the features of the label image of the optic disc and cup segmentation, and the decoding features of the corresponding decoding module, and the processed feature information is used as the input of the decoding module of the next layer;
[0147] Each decoding module in the optic disc and optic cup segmentation model is used to decode the input feature information respectively until the last layer of decoding module decodes and obtains the predicted image of the optic disc and optic cup segmentation.
[0148] Furthermore, in one embodiment of the present disclosure, the training module 1003 is configured to:
[0149] Using a given module in each attention processing unit in the optic disc and optic cup segmentation model, feature processing based on the attention mechanism is performed on the encoding features of the encoding module of the corresponding layer and the features of the label image of the optic disc and optic cup segmentation, so that the obtained first attention feature can pay attention to the features of the label image of the optic disc and optic cup segmentation compared with the encoding feature;
[0150] The extraction module in each attention processing unit in the optic disc and optic cup segmentation model is used to perform feature processing based on the attention mechanism based on the decoding features of the corresponding decoding module and the first attention features output to the module, and obtain the processed second attention features as the input of the decoding module of the next layer.
[0151] The above modules in the training device 1000 for the optic disc and optic cup segmentation model of the above embodiment realize the implementation principle and technical effects of the optic disc and optic cup segmentation model, which are the same as those of the above related method embodiments. For details, please refer to the description of the above related method embodiments, which will not be repeated here.
[0152] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0153] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0154] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0155] like Figure 11As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. Various programs and data required for the operation of the device 1100 can also be stored in the RAM 1103. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0156] Various components in device 1100 are connected to I / O interface 1105, including an input unit 1106, such as a keyboard and mouse; an output unit 1107, such as various types of displays and speakers; a storage unit 1108, such as a magnetic disk and optical disk; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0157] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as the above-mentioned methods of the present disclosure. For example, in some embodiments, the above-mentioned methods of the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the above-mentioned methods of the present disclosure described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to execute the above method of the present disclosure in any other appropriate manner (for example, by means of firmware).
[0158] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0159] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0160] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0161] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0162] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0163] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0164] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0165] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for segmenting the optic disc and optic cup of a fundus image, comprising: Acquire fundus images; Based on the attention mechanism, the optic disc and optic cup of the fundus image are segmented to obtain the segmented images of the optic disc and optic cup; Among them, based on the attention mechanism, the optic disc and optic cup of the fundus image are segmented to obtain the segmented images of the optic disc and optic cup, including: A pre-trained optic disc and optic cup segmentation model based on the attention mechanism is used to segment the optic disc and optic cup of the fundus image to obtain an image of the optic disc and optic cup segmentation; the optic disc and optic cup segmentation model is a symmetrical structure, including N layers of serially connected encoding modules and N layers of serially connected decoding modules; an attention processing unit is serially connected between the encoding module of each intermediate layer and the symmetrical decoding module of the intermediate layer, and the attention processing unit includes a giving module and a taking module; the N-1th layer encoding module is symmetrical to the N-1th layer decoding module from the bottom; the giving module in each of the attention processing units is used to perform feature processing of the attention mechanism on the encoding features obtained by encoding the encoding module in the corresponding layer; the taking module in each of the attention processing units is used to perform feature processing of the attention mechanism based on the decoding features obtained by the corresponding decoding module and the feature processing results obtained by the corresponding giving module.
2. The method according to claim 1, wherein Using a pre-trained optic disc and optic cup segmentation model based on an attention mechanism, the optic disc and optic cup of the fundus image are segmented to obtain an image of the optic disc and optic cup segmentation, including: Each encoding module in the optic disc and optic cup segmentation model is used to encode the input feature information to obtain encoding features; the feature information input by the first layer encoding module is the feature of the fundus image; Using the giving module and taking module in each attention processing unit in the optic disc and cup segmentation model, respectively performing feature processing of the attention mechanism based on the encoding features of the encoding module of the corresponding layer and the decoding features of the corresponding decoding module, and using the processed feature information as the input of the decoding module of the next layer; The decoding modules in the optic disc and optic cup segmentation model are used to respectively decode the input feature information until the last layer of decoding modules decodes and obtains the segmented image of the optic disc and optic cup.
3. The method according to claim 2, wherein: The giving module and taking module in each attention processing unit in the optic disc and cup segmentation model are used to perform feature processing of the attention mechanism based on the encoding features of the corresponding encoding module and the decoding features of the corresponding decoding module, and the processed feature information is used as the input of the decoding module of the next layer, including: Using the given modules in each of the attention processing units in the optic disc and optic cup segmentation model, respectively perform feature processing based on the attention mechanism on the encoding features of the encoding module of the corresponding layer to obtain a processed first attention feature; The extraction module in each of the attention processing units in the optic disc and optic cup segmentation model is used to perform feature processing based on the attention mechanism based on the decoding features of the corresponding decoding module and the first attention features output by the corresponding giving module, and obtain the processed second attention features as the input of the decoding module of the next layer.
4. A training method for an optic disc and optic cup segmentation model, comprising: Obtaining weight parameters for multiple optic disc and optic cup segmentation annotations for training fundus images with a diagnosis of glaucoma; Based on the weight parameters of the multiple optic disc and optic cup segmentation annotations and the multiple optic disc and optic cup segmentation annotations, obtaining a label image of the optic disc and optic cup segmentation corresponding to the training fundus image; The training fundus image and the labeled image of the optic disc and optic cup segmentation are used to train an optic disc and optic cup segmentation model based on the attention mechanism; the optic disc and optic cup segmentation model has a symmetrical structure, including N layers of serially connected encoding modules and N layers of serially connected decoding modules; an attention processing unit is serially connected between each intermediate layer encoding module and a symmetrical intermediate layer decoding module, and the attention processing unit includes a giving module and a taking module; the N-1th layer encoding module is symmetrical with the N-1th layer decoding module from the bottom; the giving module in each attention processing unit is used to perform feature processing of the attention mechanism on the encoding features obtained by encoding the encoding module in the corresponding layer; The extraction module in each of the attention processing units is used to perform feature processing of the attention mechanism based on the decoding features obtained by the corresponding decoding module and the feature processing results obtained by the corresponding giving module; the optic disc and optic cup segmentation model is used in the optic disc and optic cup segmentation method of fundus images described in any one of claims 1-3.
5. The method according to claim 4, wherein Obtain weight parameters for various optic disc and cup segmentation annotations for training fundus images, including: Based on the training fundus image and the diagnosis result of the training fundus image, a pre-trained glaucoma diagnosis model is used to obtain weight parameters of the multiple optic disc and optic cup segmentation annotations.
6. The method according to claim 4, wherein: Acquiring a label image of the optic disc and optic cup segmentation corresponding to the training fundus image based on the weight parameters of the multiple optic disc and optic cup segmentation annotations and the multiple optic disc and optic cup segmentation annotations, including: Based on the weight parameters of the multiple optic disc and optic cup segmentation annotations, the multiple optic disc and optic cup segmentation annotations are weighted and averaged to obtain a label image of the optic disc and optic cup segmentation corresponding to the training fundus image.
7. The method according to claim 4, wherein: The training fundus image and the labeled image of the optic disc and optic cup segmentation are used to train an optic disc and optic cup segmentation model based on an attention mechanism, including: Based on the training fundus image, obtaining a predicted image of the optic disc and optic cup segmentation predicted by the optic disc and optic cup segmentation model according to the attention mechanism; constructing a loss function based on the label image of the optic disc and optic cup segmentation and the predicted image of the optic disc and optic cup segmentation; When the loss function does not converge, the parameters of the optic disc and optic cup segmentation model implemented based on the attention mechanism are adjusted.
8. The method according to claim 7, wherein: Based on the training fundus image, obtaining a predicted image of the optic disc and optic cup segmentation predicted by the optic disc and optic cup segmentation model according to the attention mechanism, comprising: Each encoding module in the optic disc and optic cup segmentation model is used to encode the input feature information to obtain encoding features; the feature information input by the first layer encoding module is the feature of the fundus image; Using each attention processing unit in the optic disc and optic cup segmentation model, the attention mechanism performs feature processing based on the encoding features of the corresponding encoding module, the features of the label image of the optic disc and optic cup segmentation, and the decoding features of the corresponding decoding module, and the processed feature information is used as the input of the decoding module of the next layer; The decoding modules in the optic disc and optic cup segmentation model are used to respectively decode the input feature information until the last layer of decoding modules decodes and obtains the predicted image of the optic disc and optic cup segmentation.
9. The method according to claim 8, wherein Each attention processing unit in the optic disc and optic cup segmentation model is used to perform feature processing of the attention mechanism based on the encoding features of the corresponding encoding module, the features of the label image of the optic disc and optic cup segmentation, and the decoding features of the corresponding decoding module, and the processed feature information is used as the input of the decoding module of the next layer, including: Using a given module in each of the attention processing units in the optic disc and optic cup segmentation model, respectively performing feature processing based on the attention mechanism on the encoding features of the encoding module of the corresponding layer and the features of the label image of the optic disc and optic cup segmentation, so that the obtained first attention feature can pay attention to the features of the label image of the optic disc and optic cup segmentation relative to the encoding feature; The extraction modules in each of the attention processing units in the optic disc and optic cup segmentation model are used to perform feature processing based on the attention mechanism based on the decoding features of the corresponding decoding module and the first attention features output by the corresponding giving module, and obtain the processed second attention features as the input of the decoding module of the next layer.
10. A device for segmenting optic disc and optic cup of fundus images, comprising: An acquisition module, used for acquiring fundus images; A segmentation module is used to segment the optic disc and optic cup of the fundus image based on the attention mechanism to obtain images of the optic disc and optic cup segmentation; Wherein, the segmentation module is used to: A pre-trained optic disc and optic cup segmentation model based on an attention mechanism is used to segment the optic disc and optic cup of the fundus image to obtain an image of the optic disc and optic cup segmentation; the optic disc and optic cup segmentation model has a symmetrical structure, including N layers of serially connected encoding modules and N layers of serially connected decoding modules; an attention processing unit is serially connected between each intermediate layer encoding module and a symmetrical intermediate layer decoding module, and the attention processing unit includes a giving module and a taking module; the N-1th layer encoding module is symmetrical to the N-1th layer decoding module from the bottom; the giving module in each attention processing unit is used to perform feature processing of the attention mechanism on the encoding features obtained by encoding the encoding module in the corresponding layer; The extraction module in each of the attention processing units is used to perform feature processing of the attention mechanism based on the decoding features obtained by the corresponding decoding module and the feature processing results obtained by the corresponding giving module.
11. The device according to claim 10, wherein The segmentation module is used to: Using each encoding module in the optic disc and optic cup segmentation model, respectively encoding the input feature information to obtain encoding features; The feature information input by the first layer encoding module is the feature of the fundus image; Using the giving module and taking module in each attention processing unit in the optic disc and cup segmentation model, respectively performing feature processing of the attention mechanism based on the encoding features of the encoding module of the corresponding layer and the decoding features of the corresponding decoding module, and using the processed feature information as the input of the decoding module of the next layer; The decoding modules in the optic disc and optic cup segmentation model are used to respectively decode the input feature information until the last layer of decoding modules decodes and obtains the segmented image of the optic disc and optic cup.
12. The device according to claim 11, wherein The segmentation module is used to: Using the given modules in each of the attention processing units in the optic disc and optic cup segmentation model, respectively perform feature processing based on the attention mechanism on the encoding features of the encoding module of the corresponding layer to obtain a processed first attention feature; The extraction module in each of the attention processing units in the optic disc and optic cup segmentation model is used to perform feature processing based on the attention mechanism based on the decoding features of the corresponding decoding module and the first attention features output by the corresponding giving module, and obtain the processed second attention features as the input of the decoding module of the next layer.
13. A training device for an optic disc and optic cup segmentation model, comprising: a parameter acquisition module for acquiring weight parameters for multiple optic disc and optic cup segmentation annotations of training fundus images whose diagnosis result is glaucoma; an image acquisition module, configured to acquire a label image of the optic disc and optic cup segmentation corresponding to the training fundus image based on the weight parameters of the multiple optic disc and optic cup segmentation annotations and the multiple optic disc and optic cup segmentation annotations; A training module is configured to use the training fundus image and the labeled image of the optic disc and optic cup segmentation to train an optic disc and optic cup segmentation model based on an attention mechanism; the optic disc and optic cup segmentation model is a symmetrical structure, comprising N layers of serially connected encoding modules and N layers of serially connected decoding modules; an attention processing unit is serially connected between each intermediate layer encoding module and a symmetrical intermediate layer decoding module, the attention processing unit comprising a giving module and a taking module; the N-1th layer encoding module is symmetrical to the N-1th layer decoding module from the last; the giving module in each attention processing unit is configured to perform feature processing of the attention mechanism on the encoding features obtained by encoding the encoding module in the corresponding layer; The extraction module in each of the attention processing units is used to perform feature processing of the attention mechanism based on the decoding features obtained by the corresponding decoding module and the feature processing results obtained by the corresponding giving module; the optic disc and optic cup segmentation model is used in the optic disc and optic cup segmentation device for fundus images according to any one of claims 10-12.
14. The device according to claim 13, wherein The parameter acquisition module is used to: Based on the training fundus image and the diagnosis result of the training fundus image, a pre-trained glaucoma diagnosis model is used to obtain weight parameters of the multiple optic disc and optic cup segmentation annotations.
15. The device according to claim 13, wherein The image acquisition module is used to: Based on the weight parameters of the multiple optic disc and optic cup segmentation annotations, the multiple optic disc and optic cup segmentation annotations are weighted and averaged to obtain a label image of the optic disc and optic cup segmentation corresponding to the training fundus image.
16. The device according to claim 13, wherein The training module is used to: Based on the training fundus image, obtaining a predicted image of the optic disc and optic cup segmentation predicted by the optic disc and optic cup segmentation model according to the attention mechanism; constructing a loss function based on the label image of the optic disc and optic cup segmentation and the predicted image of the optic disc and optic cup segmentation; When the loss function does not converge, the parameters of the optic disc and optic cup segmentation model implemented based on the attention mechanism are adjusted.
17. The device according to claim 16, wherein The training module is used to: Using each encoding module in the optic disc and optic cup segmentation model, respectively encoding the input feature information to obtain encoding features; The feature information input by the first layer encoding module is the feature of the fundus image; Each attention processing unit in the optic disc and optic cup segmentation model is used to perform feature processing of the attention mechanism based on the encoding features of the corresponding encoding module, the features of the label image of the optic disc and optic cup segmentation, and the decoding features of the corresponding decoding module, and the processed feature information is used as the input of the decoding module of the next layer; each decoding module in the optic disc and optic cup segmentation model is used to decode the input feature information until the decoding module of the last layer decodes and obtains the predicted image of the optic disc and optic cup segmentation.
18. The device according to claim 17, wherein The training module is used to: Using a given module in each of the attention processing units in the optic disc and optic cup segmentation model, respectively performing feature processing based on the attention mechanism on the encoding features of the encoding module of the corresponding layer and the features of the label image of the optic disc and optic cup segmentation, so that the obtained first attention feature can pay attention to the features of the label image of the optic disc and optic cup segmentation relative to the encoding feature; The extraction modules in each of the attention processing units in the optic disc and optic cup segmentation model are used to perform feature processing based on the attention mechanism based on the decoding features of the corresponding decoding module and the first attention features output by the corresponding giving module, and obtain the processed second attention features as the input of the decoding module of the next layer.
19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 3 or 4 to 9.
20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-3 or 4-9.
21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1-3 or 4-9.
Citation Information
Patent Citations
Optic cup and optic disk segmentation method based on fundus image data set transfer learning
CN112541923A
Image segmentation method and device, computer equipment and storage medium
CN112598686A