A method for anterior chamber angle image grading based on weakly supervised metric learning
By integrating the deep neural network model with weakly supervised metric learning, the problem of low efficiency and low accuracy of the anterior chamber angle image classification method is solved, fast and accurate anterior chamber angle image classification and glaucoma diagnosis are achieved, and the detection of important structural features is enhanced. learning ability.
Patent Information
- Application Number
- CN202111358270.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-11-16
AI Technical Summary
The existing anterior chamber angle image grading method has low efficiency and low accuracy, and it is difficult to effectively extract the characteristic areas of the four important structures, making it difficult to determine glaucoma diagnosis and treatment plans.
Using a deep neural network model that incorporates weakly supervised metric learning, through image screening, preprocessing, and constructing image-level and pixel-level labels, it combines the backbone network, classification module, segmentation module, and embedding module, and uses cross-entropy loss, dice loss, and discriminant Loss is used for training to improve the ability to distinguish the structure of the anterior chamber angle.
It achieves fast and accurate classification of anterior chamber angle images, improves the accuracy of glaucoma diagnosis and the certainty of treatment plans, reduces interference from background information, and enhances the ability to learn important structural features.
Smart Images

Figure CN113963217B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and more specifically, to an anterior chamber angle image grading method integrating weakly supervised metric learning. Background Art
[0002] Glaucoma is a complex disease that causes nerve damage and, if not diagnosed and treated early, can lead to irreversible blindness. Anterior chamber angle grading is one of the main methods used by doctors to assess glaucoma and develop treatment plans.
[0003] 1. Glaucoma detection. In recent years, with the widespread application of deep neural networks in medical image analysis, more and more deep neural network models have been designed for glaucoma detection. Most of these network models are used for anterior segment optical coherence tomography (AS-OCT) images or fundus images. For example, some researchers focus on the anterior chamber angle structure by segmenting the collective structure in AS-OCT, and some researchers have proposed a method for automatically segmenting the corneal boundary, iris area, and trabecular-iris contact point to achieve glaucoma diagnosis. However, there has not been much progress in deep learning methods for automatic grading using anterior chamber angle images.
[0004] 2. Deep neural network. Image analysis of medical images belongs to the field of computer vision. The most commonly used network for solving computer vision tasks is the convolutional neural network. Through the operation of convolutional layers, pooling layers and fully connected layers, the convolutional neural network can retain the connection between neighborhoods and the local characteristics of space, thereby realizing feature extraction. However, models that perform well in natural images (ImageNet, PASCAL VOC dataset) or other medical images (AS-OCT images, fundus images, X-ray images, etc.) are not suitable for anterior chamber angle images. This is mainly due to the following two reasons: ① The targets of natural images are very obvious, and the images of natural images are clear and colorful, which are easy for computers to recognize; ② Although the networks used for other medical images can solve the problems of insufficient image contrast and irregular organizational structure of the target, the design of these networks is very targeted. At the same time, the four important structures used to judge the grade of the anterior chamber angle in the anterior chamber angle image: Schwalbe line, trabecular meshwork, scleral process and ciliary body band occupy a small area in the whole image. The existing classification network is difficult to achieve effective feature extraction due to the extremely small feature area.
[0005] The prior art discloses a multi-feature classification method for the degree of anterior chamber angle opening based on OCT images. First, the OCT image of the anterior chamber angle is segmented, the posterior edge of the cornea and the anterior edge of the iris are obtained from the segmented image, and the intersection of the two edges is used as a reference to take the part of the anterior chamber angle including the complete angle recess as the region of interest; then, three image features, namely gradient, co-occurrence gradient direction histogram and Edgelet, are obtained in the region of interest to comprehensively describe the angle recess area from local to global; finally, a support vector machine is used to classify the degree of angle opening in the image according to the three obtained features. This scheme does not involve angle grading, but uses a support vector machine to classify the degree of angle opening of a multi-feature image, and the accuracy of this classification method is not high. Summary of the invention
[0006] In order to overcome the defects of low efficiency and low accuracy of the above-mentioned existing anterior chamber angle classification methods, the present invention provides an anterior chamber angle image grading method integrating weakly supervised metric learning.
[0007] The primary purpose of the present invention is to solve the above technical problems. The technical solutions of the present invention are as follows:
[0008] A method for grading anterior chamber angle images by integrating weakly supervised metric learning comprises the following steps:
[0009] S1: Acquire anterior chamber angle images and perform image screening;
[0010] S2: preprocessing the screened images to obtain an anterior chamber angle dataset, wherein the anterior chamber angle dataset includes: a training set, a validation set, and a test set;
[0011] S3: construct image-level labels and pixel-level labels respectively, and set the established labels corresponding to the images in the anterior chamber angle dataset;
[0012] S4: Construct a deep neural network model integrating weakly supervised metric learning;
[0013] S5: Use the training set and validation set to train and validate the constructed model to obtain the optimal network model;
[0014] S6: Input the test set into the optimal network model to obtain the anterior chamber angle image grading.
[0015] Furthermore, the image screening of the acquired anterior chamber angle images includes: eliminating images whose anterior chamber angle grade cannot be distinguished due to objective conditions, and eliminating images whose grade features are not obvious and whose anterior chamber angle grade cannot be distinguished manually; the images whose anterior chamber angle grade cannot be distinguished due to objective conditions include: images without anterior chamber angle structure, and images with unclear anterior chamber angle structure due to excessive light or dark light.
[0016] Furthermore, the screened images are preprocessed to obtain anterior chamber angle data set. The specific steps are as follows: all screened anterior chamber angle images are uniformly processed in the horizontal direction so that the cornea in each image is above the iris;
[0017] Use YoLo target detection algorithm to detect key areas and obtain key area images by cropping;
[0018] Scale the key area images to a uniform size;
[0019] The scaled images are divided into training set, validation set and test set according to the preset ratio.
[0020] Furthermore, the key area is the area where the four structures of Schwalbe line, trabecular meshwork, scleral process and ciliary body are located.
[0021] Furthermore, the image-level labels and pixel-level labels are constructed respectively in step S3, and the established labels are set correspondingly for the images in the anterior chamber angle data set. The specific process is as follows:
[0022] The anterior chamber angle is divided into 5 levels, and each image in the preprocessed anterior chamber angle dataset is set with an anterior chamber angle level, thus completing the creation of image-level labels;
[0023] The structures of Schwalbe lines, trabecular meshwork, scleral processes, and ciliary body bands in the anterior chamber angle images in the training set and the validation set are framed with lines of different colors, thus completing the creation of pixel-level labels.
[0024] Furthermore, the deep neural network model integrating weakly supervised metric learning includes: a backbone network, a classification module, a segmentation module, and an embedding module, wherein the backbone network includes: an encoder, a decoder, and a pyramid fusion mechanism, wherein the encoder is used for feature extraction and construction of a multi-scale feature map, and the decoder is used for restoring the resolution size of the feature map; the feature pyramid fusion mechanism is used to realize the fusion of multi-scale feature maps in the decoder to alleviate the loss of spatial information;
[0025] The classification module includes: a global pooling unit and a multi-layer perceptron, wherein the global pooling unit replaces the fully connected layer to reduce the number of parameters and prevent overfitting in the layer; the multi-layer perceptron includes a linear layer, a batch normalization, an activation function and a random inactivation layer, and is used to realize automatic evaluation of the anterior chamber angle image;
[0026] The segmentation module and the embedding module both include: a number of convolutional layers, batch standard layers and activation layers.
[0027] Furthermore, the constructed model is trained and verified using the anterior chamber angle dataset to obtain the optimal network model. The specific process is as follows:
[0028] S501: Selecting images for training from a training set, and performing data enhancement processing on the selected images;
[0029] S502: Input the enhanced image data into the model to obtain three types of outputs, which are: evaluation results of the classification module, dense predictions of the segmentation module, and pixel embeddings of the embedding module. The three types of outputs of the model are compared with the true labels respectively, and the corresponding losses are calculated, which are respectively recorded as: cross entropy loss, dice loss, and discriminant loss. The three losses are summed to obtain the total loss;
[0030] S503: Using the optimizer SGD to calculate and update the network parameters of the model, and obtain the model after the parameters are updated;
[0031] S504: Input the validation set images into the model with updated network parameters, calculate the classification accuracy of the updated model, and when the accuracy is greater than the previous accuracy, save the current model as the optimal model;
[0032] S505: Repeat steps S501-S504 to continuously minimize the total loss function until the number of repeated rounds reaches the preset maximum number of rounds, stop training and verification, and obtain the optimal network model.
[0033] Furthermore, the cross entropy loss is denoted as L cla , dice loss L seg And the discriminative loss L em , sum up the three losses to get the total loss, the total loss is recorded as L total , the expression of total loss is:
[0034] L total =α·L cla +β·L seg +γ·L em , (1)
[0035] Among them, α, β, and γ are weight coefficients, and their values are all 1.0.
[0036] Furthermore, the dice loss L seg The expression is:
[0037]
[0038] in, For the calculation of Dice loss for images with pixel-level labels, For image dice loss calculation without pixel-level labels, the expressions are as follows:
[0039]
[0040]
[0041] in are the probability value predicted by the model for pixel i and the true value of pixel i; N s N represents the total number of pixel categories including background in the pixel-level label. j Indicates the number of pixels of structure j in an image; m i ∈0,1 refers to whether pixel i uses a pseudo label. If a pseudo label is used, then m i =1, otherwise m i =0.
[0042] Furthermore, the discriminative loss L em The expression is as follows:
[0043] L em =λ·L var +ρ·L dist +ω·L reg , (5)
[0044]
[0045]
[0046]
[0047] in, is the embedding vector of pixel i, λ, ρ, ω represent weight coefficients respectively; L var Indicates the tension loss, L dist Indicates thrust loss, L reg represents the regularization term, μ j represents the cluster center of structure j, μ jA represents the cluster center of structure jA, μ jB represents the cluster center of structure jB, δ v ,δ d is the boundary between the two distances.
[0048] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0049] The target detection-based image preprocessing method proposed in the present invention can reduce the interference of background information. At the same time, by constructing a deep neural network model integrating weakly supervised metric learning, the segmentation module in the model uses pixel-level semantic information to help the network learn domain knowledge, thereby capturing useful structural information; the embedding module based on metric learning in the model improves the network's ability to distinguish four structures and strengthens the learning of four important structural features. The present invention can quickly and accurately realize the grading of anterior chamber angle images, and further efficiently complete the diagnosis of glaucoma and the determination of treatment plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of an anterior chamber angle image grading method integrating weakly supervised metric learning according to an embodiment of the present invention.
[0051] Figure 2 This is an example diagram of anterior chamber angle image provided by an embodiment of the present invention.
[0052] Figure 3 This is a framework diagram of a deep neural network model that integrates weakly supervised metric learning in an embodiment of the present invention.
[0053] Figure 4 The present invention provides a flow chart for training and validating the model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0055] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0056] Example 1
[0057] like Figure 1 As shown, a method for grading anterior chamber angle images by integrating weakly supervised metric learning includes the following steps:
[0058] S1: Acquire anterior chamber angle images and perform image screening;
[0059] It should be noted that, first, anterior chamber angle images are collected, for example, at least 1000 anterior chamber angle images (such as Figure 2 The anterior chamber angle images are shown), and the collected anterior chamber angle images are screened, including: eliminating images where the anterior chamber angle grade cannot be identified due to objective conditions, and the images where the anterior chamber angle grade cannot be identified due to objective conditions include: images without anterior chamber angle structure images, images where the anterior chamber angle structure is unclear due to excessive light or too dark light; eliminating images where the grade features are not obvious and the grade of the anterior chamber angle cannot be identified, for example, an image of the anterior chamber angle has unclear grade features, and multiple doctors cannot confirm the specific grade of the image, so it is eliminated.
[0060] S2: preprocessing the screened images to obtain an anterior chamber angle dataset, wherein the anterior chamber angle dataset includes: a training set, a validation set, and a test set;
[0061] It should be noted that the preprocessing of the screened images is performed to obtain the anterior chamber angle data set, and the specific steps are: uniformly processing all the screened anterior chamber angle images in the horizontal direction so that the cornea in each image is above the iris;
[0062] Use YoLo target detection algorithm to detect key areas and obtain key area images by cropping;
[0063] The key area is the area where the four structures of Schwalbe line, trabecular meshwork, scleral process and ciliary body are located. The key area is also the junction of iris and cornea. The key area is cropped to obtain new key area images of different sizes.
[0064] Scale the key area images to a uniform size;
[0065] The scaled images are divided into training set, validation set and test set according to the preset ratio.
[0066] In a specific embodiment, the scaled images are divided into a training set, a validation set, and a test set according to a ratio of 8:2:2.
[0067] S3: construct image-level labels and pixel-level labels respectively, and set the established labels corresponding to the images in the anterior chamber angle dataset;
[0068] It should be noted that the image-level label refers to determining the level of anterior chamber angle of an image given an anterior chamber angle image. The present invention divides the anterior chamber angle into five levels, namely, narrow one, narrow two, narrow three, narrow four, and wide angle. Each image in the preprocessed anterior chamber angle data set is set with an anterior chamber angle level, and the creation of the image-level label is completed. At the same time, images of the same level can be placed in the same folder, and the level of the image is used as the name of the folder.
[0069] The pixel-level labeling described in the present invention is to give an anterior chamber angle image, and frame the structures of "Schwalbe lines, trabecular meshwork, scleral processes and ciliary body bands" in the image with lines of different colors. In a specific embodiment, the structures of Schwalbe lines, trabecular meshwork, scleral processes and ciliary body bands in the anterior chamber angle images in the training set and the validation set are framed with lines of different colors. The labelme tool can be used to complete the pixel-level labeling work.
[0070] It should be noted that each anterior chamber angle image in the dataset has an image-level label, but both the training set and the validation set have pixel-level labels, and the test set has no pixel-level labels.
[0071] S4: Construct a deep neural network model integrating weakly supervised metric learning;
[0072] like Figure 3 As shown, the deep neural network model integrating weakly supervised metric learning includes: a backbone network, a classification module, a segmentation module, and an embedding module, wherein the backbone network includes: an encoder, a decoder, and a feature pyramid fusion mechanism, wherein the encoder is used for feature extraction and construction of a multi-scale feature map, and the decoder is used for restoring the resolution size of the feature map; the feature pyramid fusion mechanism is used to realize the fusion of multi-scale feature maps in the decoder to alleviate the loss of spatial information;
[0073] The classification module includes: a global pooling unit and a multi-layer perceptron, wherein the global pooling unit replaces the fully connected layer to reduce the number of parameters and prevent overfitting in the layer; the multi-layer perceptron includes a linear layer, a batch normalization, an activation function and a random inactivation layer, and is used to realize automatic evaluation of the anterior chamber angle image;
[0074] The segmentation module and the embedding module both include: a number of convolutional layers, batch standard layers and activation layers.
[0075] Example 2
[0076] This embodiment describes step S5 in detail based on the above steps.
[0077] S5: Use the training set and validation set to train and validate the constructed model to obtain the optimal network model;
[0078] like Figure 4 As shown, the specific process is:
[0079] S501: Selecting images for training from a training set, and performing data enhancement processing on the selected images;
[0080] The data enhancement process is as follows: randomly horizontally mirror the selected anterior chamber angle image with a probability of 0.5 (for example, randomly select 50% of the images to be enhanced for horizontal mirroring), add salt and pepper noise to the image with a probability of 0.5, where the signal-to-noise ratio is 0.95; scale the image; and finally normalize and regularize the image so that the image before input into the model is in tensor format and the values are distributed between [-1, 1].
[0081] S502: Input the enhanced image data into the model to obtain three types of outputs, which are: evaluation results of the classification module, dense predictions of the segmentation module, and pixel embeddings of the embedding module. The three types of outputs of the model are compared with the true labels respectively, and the corresponding losses are calculated, which are respectively recorded as: cross entropy loss, dice loss, and discriminant loss. The three losses are summed to obtain the total loss;
[0082] It should be noted that in the model training and verification process of the present invention, the input of the model is the anterior chamber angle image, and the output of the model includes three categories: the evaluation result of the classification module, the dense prediction of the segmentation module, and the pixel embedding of the embedding module, wherein the evaluation result of the classification module is the anterior chamber angle category. The dense prediction of the segmentation module is denoted as Pixel embedding of the embedding module is pixel feature map Compare the three types of outputs of the model with the true labels and calculate the losses, which are recorded as cross entropy loss L cla , dice loss L seg And the discriminative loss L em , sum up the three losses to get the total loss, the total loss is recorded as L total , the expression of total loss is:
[0083] L total =α·L cla +β·L seg +γ·L em , (1)
[0084] Among them, α, β, and γ are weight coefficients, and their values are all 1.0.
[0085] In the deep neural network model integrating weakly supervised metric learning described in the present invention, the backbone network includes an encoder, a decoder, and a feature pyramid. The structure of the decoder is built with reference to the jump connection and symmetric structure of UNet, and the encoder is a ResNet structure. Therefore, the input of the backbone network is the anterior chamber angle image, and the output of the backbone network is: 5 and f, e 5 represents the latent feature map, and f represents the feature map.
[0086] Get the hidden feature map e 5 Finally, global average pooling is used to obtain the context information of the anterior chamber angle image, and then a multi-layer perceptron is used as a classifier to obtain the probability values of the five categories of the anterior chamber angle image: The present invention uses the cross entropy loss function to optimize the model, thereby using the cross entropy loss to measure the evaluation result of the classification module.
[0087] It should be noted that in clinical practice, ophthalmologists judge the level of the anterior chamber angle based on the above four structures. Therefore, the spatial distribution of these features is crucial to the classification of the anterior chamber angle. Based on this phenomenon, the present invention designs a segmentation module to induce the backbone network and classification module to pay attention to these four structures. The segmentation module assigns a class label to each pixel, and finally obtains the pixel-level prediction result. It should be noted that there are only a small number of pixel-level labels. For those anterior chamber angle images without pixel-level labels, pseudo labels based on weakly supervised learning are used to complete the calculation of the loss function. The total Dice loss is as follows:
[0088]
[0089] in, For the calculation of Dice loss for images with pixel-level labels, For image dice loss calculation without pixel-level labels, the expressions are as follows:
[0090]
[0091]
[0092] in are the probability value predicted by the model for pixel i and the true value of pixel i; N s Indicates the total number of pixel categories including background in the pixel-level label, N j Indicates the number of pixels of structure j in an image; m i ∈0,1 refers to whether pixel i uses a pseudo label. If a pseudo label is used, then m i =1, otherwise m i =0, for example, the probability value score is greater than the set threshold Then use pseudo labels; is the pseudo label of pixel i.
[0093] It should be noted that the Schwalbe lines, trabecular meshwork, scleral processes, and ciliary body bands are distributed between the iris and cornea. Not only do they account for a small proportion of the entire image, but they also face the problem of large intra-class distance and small inter-class distance. For example, large intra-class distance refers to the same structure in different anterior chamber angle images, which may show different colors or shapes due to individual differences; small inter-class distance means that the colors and textures of adjacent structures in the same anterior chamber angle image may be very similar. This poses a difficulty for the feature learning structure of the network, thereby affecting the classification performance. Therefore, the present invention designs an embedding module to assist the network in distinguishing the four structures, and proposes a discriminant loss based on metric learning to better optimize the network. It should be noted that only training samples with pixel-level labels will use the discriminant loss L. em , defined as follows:
[0094] L em =λ·L var +ρ·L dist +ω·L reg , (5)
[0095]
[0096]
[0097]
[0098] in, is the embedding vector of pixel i, λ, ρ, ω represent weight coefficients respectively; L var Indicates the tension loss, L dist Indicates thrust loss, L reg represents the regularization term, μ j represents the cluster center of structure j, μ jA represents the cluster center of structure jA, μ jB represents the cluster center of structure jB, δ v ,δ d is the boundary between the two distances.
[0099] S503: Using the optimizer SGD to calculate and update the network parameters of the model, and obtain the model after the parameters are updated;
[0100] S504: Input the validation set images into the model with updated network parameters, calculate the classification accuracy of the updated model, and when the accuracy is greater than the previous accuracy, save the current model as the optimal model;
[0101] S505: Repeat steps S501-S504 to continuously minimize the total loss function until the number of repeated rounds reaches the preset maximum number of rounds, stop training and verification, and obtain the optimal network model.
[0102] S6: Input the test data set into the optimal network model to obtain the anterior chamber angle image grading.
[0103] Example 3
[0104] In this embodiment, the prior art is divided into traditional networks and weakly supervised networks. Traditional networks include: VGG, GoogLeNet and ResNet. Traditional networks are composed of a large number of convolutional layers, pooling layers, batch normalization layers and activation layers, which are several classic models of deep convolutional neural networks; the methods of weakly supervised networks are mainly divided into three types: consistency regularization, pseudo-label annotation, and combined use of consistency regularization and pseudo-label annotation. These three methods are respectively compared with CCT, UPS, and FixMatch as representative methods, where Ours represents the method of the present invention. The experimental results are shown in Tables 1 and 2.
[0105] Table 1 Comparison of classification performance on anterior chamber angle images and fundus images
[0106]
[0107] Table 2 Ablation experiment results on anterior chamber angle image and fundus image
[0108]
[0109]
[0110] The present invention improves the network's learning ability for the four structures by introducing a segmentation module, thereby improving the classification accuracy of the anterior chamber angle image; the proposed embedding module strengthens the network's discrimination of domain knowledge (color, shape, and shape of four structures such as Schwalbe lines, trabecular meshwork, scleral processes, and ciliary body bands), and uses discriminant loss to guide the network to capture the features of the four structures with the learned domain knowledge, thereby strengthening the network's feature learning and representation capabilities and improving the anterior chamber angle classification capability. The method of the present invention can be used not only for anterior chamber angle data, but also for other public data sets, such as the public REFUGE data set.
[0111] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for grading anterior chamber angle images by integrating weakly supervised metric learning, characterized in that: The following steps are involved: S1: Acquire anterior chamber angle images and perform image screening; S2: preprocessing the screened images to obtain an anterior chamber angle dataset, wherein the anterior chamber angle dataset includes: a training set, a validation set, and a test set; The specific steps include: uniformly processing all the screened anterior chamber angle images in the horizontal direction so that the cornea in each image is above the iris; Use YoLo target detection algorithm to detect key areas and obtain key area images by cropping; Scale the key area images to a uniform size; Divide the scaled images into training set, validation set, and test set according to the preset ratio; The key areas are the areas where the four structures of Schwalbe's line, trabecular meshwork, scleral process and ciliary body are located; S3: construct image-level labels and pixel-level labels respectively, and set the established labels corresponding to the images in the anterior chamber angle dataset; The specific process is: The anterior chamber angle is divided into 5 levels, and each image in the preprocessed anterior chamber angle dataset is set with an anterior chamber angle level, thus completing the creation of image-level labels; The Schwalbe lines, trabecular meshwork, scleral processes, and ciliary band structures in the anterior chamber angle images in the training set and the validation set are framed with lines of different colors, thus completing the creation of pixel-level labels. S4: Construct a deep neural network model integrating weakly supervised metric learning; The deep neural network model integrating weakly supervised metric learning includes: a backbone network, a classification module, a segmentation module, and an embedding module, wherein the backbone network includes: an encoder, a decoder, and a feature pyramid fusion mechanism, wherein the encoder is used for feature extraction and construction of a multi-scale feature map, and the decoder is used for restoring the resolution size of the feature map; the feature pyramid fusion mechanism is used to realize the fusion of multi-scale feature maps in the decoder to alleviate the loss of spatial information; The classification module includes: a global pooling unit and a multi-layer perceptron, wherein the global pooling unit replaces the fully connected layer to reduce the number of parameters and prevent overfitting in the layer; the multi-layer perceptron includes a linear layer, a batch normalization, an activation function and a random inactivation layer, and is used to realize automatic evaluation of the anterior chamber angle image; The segmentation module and the embedding module both include: a number of convolutional layers, batch standard layers and activation layers; S5: Use the training set and validation set to train and validate the constructed model to obtain the optimal network model; The constructed model is trained and verified using the anterior chamber angle dataset to obtain the optimal network model. The specific process is as follows: S501: Selecting images for training from a training set, and performing data enhancement processing on the selected images; S502: Input the enhanced image data into the model to obtain three types of outputs, which are: evaluation results of the classification module, dense predictions of the segmentation module, and pixel embeddings of the embedding module. The three types of outputs of the model are compared with the true labels respectively, and the corresponding losses are calculated, which are respectively recorded as: cross entropy loss, dice loss, and discriminant loss. The three losses are summed to obtain the total loss; S503: Using the optimizer SGD to calculate and update the network parameters of the model, and obtain the model after the parameters are updated; S504: Input the validation set images into the model with updated network parameters, calculate the classification accuracy of the updated model, and when the accuracy is greater than the previous accuracy, save the current model as the optimal model; S505: Repeat steps S501-S504 to continuously minimize the total loss function until the number of repeated rounds reaches a preset maximum number of rounds, stop training and verification, and obtain the optimal network model; S6: Input the test set into the optimal network model to obtain the anterior chamber angle image grading.
2. The anterior chamber angle image grading method integrating weakly supervised metric learning according to claim 1, characterized in that: The image screening of the acquired anterior chamber angle images includes: eliminating images where the anterior chamber angle grade cannot be distinguished due to objective conditions, and eliminating images where the grade features are not obvious and the anterior chamber angle grade cannot be distinguished manually; the images where the anterior chamber angle grade cannot be distinguished due to objective conditions include: images without anterior chamber angle structure, and images where the anterior chamber angle structure is unclear due to excessive light or too dark light.
3. The anterior chamber angle image grading method integrating weakly supervised metric learning according to claim 1, characterized in that: The cross entropy loss is denoted by L cla , dice loss L seg And the discriminative loss L em , sum up the three losses to get the total loss, the total loss is recorded as L total , the expression of total loss is: L total =α·L cla +β·L seg +γ·L em , (1) Among them, α, β, and γ are weight coefficients, and their values are all 1.
0.
4. The anterior chamber angle image grading method integrating weakly supervised metric learning according to claim 3, It is characterized in that Dice loss L seg The expression is: in, For the calculation of Dice loss for images with pixel-level labels, For image dice loss calculation without pixel-level labels, the expressions are as follows: in are the probability value predicted by the model for pixel i and the true value of pixel i; N s N represents the total number of pixel categories including background in the pixel-level label. j Indicates the number of pixels of structure j in an image; m i ∈0,1 refers to whether pixel i uses a pseudo label. If a pseudo label is used, then m i =1, otherwise m i =0.
5. The anterior chamber angle image grading method integrating weakly supervised metric learning according to claim 3, characterized in that: Discriminative loss L em The expression is as follows: L em =λ·L var +p·L dist +ω·L reg , (5) in, is the embedding vector of pixel i, λ, ρ, ω represent weight coefficients respectively; L var Indicates the tension loss, L dist Indicates thrust loss, L reg represents the regularization term, μ j represents the cluster center of structure j, μ jA represents the cluster center of structure jA, μ jB represents the cluster center of structure jB, δ v ,δ d is the boundary between the two distances.
