Corneal ulcer classification detection method and system based on neural network model
Patent Information
- Application Number
- CN202011638346.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-12-31
AI Technical Summary
The existing technology has differences in professional knowledge and experience when judging the type of corneal ulcer, resulting in inconsistent judgment results and time, and the lack of efficient automated classification methods.
The Inception-ResNet-V2 neural network model is combined with the support vector machine (SVM) to collect corneal images from multiple cameras and angles, perform morphological operations and preprocessing, and use K-Means clustering and adaptive histogram equalization to achieve Automatic classification of punctate, punctate-flaky mixed, and flaky corneal ulcers.
It improves the accuracy and detection efficiency of corneal ulcer types, reduces the difference in judgment between doctors, and achieves rapid and accurate identification of corneal ulcer types.
Smart Images

Figure CN112712122B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of corneal ulcer classification detection and disease identification, and in particular to a corneal ulcer classification detection method and system based on a neural network model. Background Art
[0002] Corneal ulcer is the most common symptom of corneal disease. As the transparent film at the front of the eyeball, the cornea is often exposed to the air and has many opportunities to contact germs, thus increasing the incidence of corneal ulcer. In addition, factors such as vitamin A deficiency, chemical burns, long-term use of contact lenses, dry eyes or herpes can also cause corneal ulcers. Corneal ulcers are very harmful to the human body, especially visual function. If not treated promptly and correctly, it will lead to decreased vision and even blindness, which is medically called corneal blindness.
[0003] With the gradual improvement of medical standards, more and more effective corneal ulcer treatment plans have been proposed, but when judging the specific type of corneal ulcer in patients, the more primitive subjective experience judgment is adopted by most doctors. Considering the differences in professional knowledge and experience between different doctors, there may be certain differences in the final judgment results and the time spent. The concept of artificial intelligence was first proposed in 1956, and it has developed rapidly in all walks of life for more than 60 years. In recent years, AI technologies such as deep learning in the medical industry have been widely used at home and abroad. In some aspects, the effect is no worse than that of professional doctors, or even better. In this case, it is more convenient and effective to classify the condition of corneal ulcers through the reasonable and effective use of deep learning technology.
[0004] Inception-ResNet-V2 is a deep learning model proposed by Google. It combines the Inception structure with a residual connection, which has good performance and low computational complexity, to greatly accelerate the convergence of the network. At the same time, Inception-ResNet-V2 also improves the performance of the network with a larger-scale network model, achieving a Top-5 error rate of 4.9%, which can achieve good results in the classification of corneal images. Summary of the invention
[0005] In order to solve the shortcomings of the prior art, the Inception-ResNet-V2 neural network model is used to classify spot-like corneal ulcers, mixed spot-like and sheet-like corneal ulcers, and sheet-like corneal ulcers, and the final corneal ulcer type judgment is made for the subject according to the multi-angle image classification results. The present invention adopts the following technical solutions:
[0006] The classification and detection method of corneal ulcer based on the neural network model includes the following steps:
[0007] S10, collecting corneal images of the subject after fluorescent staining at multiple angles through multiple cameras;
[0008] S20, making and adding a mask through morphological operations to extract the effective part of the corneal image;
[0009] S30, preprocessing the extracted valid corneal image and marking the data type;
[0010] S40, setting training parameters of the neural network model, and inputting the annotated corneal image into the model for training;
[0011] S50, saving the trained model, and completing the classification of spot-like corneal ulcer, spot-like and sheet-like mixed corneal ulcer, and sheet-like corneal ulcer;
[0012] S60, takes the corneal image detection results at different angles as input, adds a support vector machine (SVM) after the model, automatically assigns different weights to different angles, and outputs the final detection results.
[0013] Furthermore, in step S10, multiple cameras are used to collect corneal images at multiple angles, and white light source is used for fill-in light. The shooting angles include flat angle, elevation / depression angle of 45°, and left / right front angle of 45°.
[0014] Furthermore, in step S20, a mask is made by morphological operation and K-Means clustering method and added to the collected corneal image to extract the effective image area, thereby improving the detection and recognition efficiency of the entire system. The closing operation in the morphological operation, i.e., the expansion followed by the corrosion operation, is used to fill the small holes in the collected corneal image, disconnect the narrow discontinuities and eliminate the small protrusions, thereby improving the subsequent image segmentation efficiency. The classic K-Means clustering algorithm based on partitioning is selected for image segmentation. The greatest advantage of this algorithm is its simplicity and speed. This system aims to distinguish between spot-like corneal ulcers, spot-flaky mixed corneal ulcers and lamellar corneal ulcers. At the same time, considering the darker area around the eyeball, the K value in the algorithm is taken as 3, that is, the image sample set is divided into 3 categories. The sample set in the algorithm is D={X1,X2,…,X m}, the cluster center set is U={U1,U2,…,U k}, the set of clusters is C = {C1,C2,…,C k}, the objective function selected in the algorithm is:
[0015]
[0016] In the formula The smaller the E value, the higher the similarity within the cluster.
[0017] Furthermore, in step S30, the details in the effective image extracted in step S20 are not prominent enough, so the adaptive histogram equalization (Adaptive Histogram Equalization, AHE) method is used to further process the extracted image to further improve the detection and recognition efficiency of the entire system. Different from the ordinary histogram equalization algorithm, the AHE algorithm changes the image contrast by calculating the local histogram of the image and then redistributing the brightness. It is more suitable for improving the local contrast of the image and obtaining more image details. The principle of the algorithm is: the moving template M moves line by line on the image P, and the center c (x0, y0) of the template M corresponds to the point f (x0, y0) on the image. The histogram equalization change relationship of the template M area is calculated:
[0018] g(x,y)=T(f(x,y))
[0019] Calculate the equalized corresponding pixel value of the template center point c(x0,y0): g(x0,y0)=T(f(x0,y0)), replace f(x0,y0) with g(x0,y0), and calculate the adaptive histogram equalization image of the entire image row by row.
[0020] Furthermore, in step S40, the tensorflow framework is used to build the Inception-ResNet-V2 neural network model, and the network parameters are reasonably adjusted according to the corneal image data and the trial training effect. In the model, the linear rectified function (Rectified Linear Unit, ReLU) is selected as the activation function, and the ReLu function expression is:
[0021]
[0022] Finally, the softmax function is used to output three types of classification. The expression of the softmax function is:
[0023]
[0024] In the formula, S i is the output of the i-th category, and there are three categories in the present invention, x i is the output of the previous layer unit;
[0025] During the training process, the stochastic gradient descent (SGD) algorithm is used as the optimization algorithm. The SGD formula is:
[0026] θ=θ-η*▽ θ J(θ;x i ;y i )
[0027] In the formula, η represents the learning rate, which determines how large the step size is to update the parameters, ▽ θ J(θ;x i ;y i ) indicates that the loss function calculates the first-order derivative of the parameter θ on each data;
[0028] Due to the uneven distribution of training data, the weighted modified cross entropy loss function (Categoricalcrossentropy function) is selected as the multi-classification loss function for training Inception-ResNet-V2. The weight calculation and weighted cross entropy loss function calculation formula are as follows
[0029]
[0030]
[0031] In the formula, N is the number of types, N all is the total number of samples, N x , x=0,1,2, there are three types of diseases, is the number of samples in the corresponding category, Y and P are the actual label matrix and probability matrix of the samples, and M is the number of calculated samples;
[0032] The monitoring indicator is accuracy (acc). During the training process, a callback function is set to dynamically adjust the learning rate and save the model parameters in a timely manner.
[0033] Furthermore, the initial training parameters of the Inception-ResNet-V2 neural network model include: learning rate LR=0.0001, number of training times EPOCH=500, training batch size BATCH_SIZE=64, and image input size SIZE=299×299×3.
[0034] Furthermore, in step S50, the trained neural network model is saved, and the corneal image processed in step S30 is input into the neural network model to achieve automatic classification of punctate corneal ulcer, punctate-lamellar mixed corneal ulcer and lamellar corneal ulcer.
[0035] Furthermore, in step S60, the classification results obtained at different angles in step S50 are used as the input of the final support vector machine, different weights are assigned to different angles, and the final detection result is output.
[0036] Furthermore, a one-to-many approach is selected to enable SVM to achieve multi-classification. During training, samples of a certain category are classified into one category, and the remaining samples are classified into another category. That is, three SVMs are constructed based on samples of three categories, and the classification speed is faster.
[0037] A classification detection system for corneal ulcer based on a neural network model comprises an image acquisition module, a mask adding module, an image processing module, a model classification module and a comprehensive judgment module which are connected in sequence;
[0038] The image acquisition module uses a camera to acquire corneal images of the subject after fluorescent staining at multiple angles;
[0039] The mask adding module performs mask making and adding to extract the effective part of the image;
[0040] The image processing module pre-processes the extracted effective corneal image;
[0041] The model classification module uses the trained model to automatically identify and detect various types of corneal ulcers in the collected corneal images;
[0042] The comprehensive judgment module processes multiple detection results at different angles through a support vector machine to obtain a final detection result.
[0043] The advantages and beneficial effects of the present invention are:
[0044] The present invention uses multi-camera multi-angle collection of corneal images with the Inception-ResNet-V2 neural network model and SVM classification to more accurately distinguish between spot-like corneal ulcers, spot-sheet mixed corneal ulcers and sheet-like corneal ulcers. At the same time, through morphological operations, K-Means clustering method to create and add masks and AHE operations, the accuracy and efficiency of the overall system are improved to a certain extent. The present invention can be easily transplanted and developed to multiple platforms, and the intermediate and final data collected and processed by the system can be uploaded to the cloud server, which can conveniently analyze the specific situation of the corneal ulcer of the subject. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of the method of the present invention.
[0046] Figure 2 It is a system block diagram of the present invention. DETAILED DESCRIPTION
[0047] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0048] The corneal ulcer classification detection method provided by the example of the present invention uses the Inception-ResNet-V2 neural network model and SVM to classify and identify the collected and processed corneal images into spot-type corneal ulcers, spot-type mixed corneal ulcers and sheet-type corneal ulcers. At the same time, this example also provides a corneal ulcer classification detection system based on the above method. In order to more thoroughly understand the purpose and scheme of the present invention, the specific implementation method of the example of the present invention is described in detail below in conjunction with the accompanying drawings.
[0049] like Figure 1 As shown, a classification detection method for corneal ulcer based on the Inception-ResNet-V2 neural network model specifically includes the following steps:
[0050] S10, collecting corneal images of the subject after fluorescent staining at multiple angles through multiple cameras;
[0051] S20, making a mask through morphological operation and K-Means clustering method, adding the mask to extract the effective part of the corneal image;
[0052] S30, preprocessing the extracted effective corneal image by AHE means and marking the data type;
[0053] S40, setting the training parameters of the Inception-ResNet-V2 neural network model, and inputting the labeled cornea image into the model for training;
[0054] S50, saving the trained model, and completing the classification of spot-like corneal ulcer, spot-like and sheet-like mixed corneal ulcer, and sheet-like corneal ulcer;
[0055] S60, taking the corneal image detection results at different angles as input, adding a SVM layer after the model, automatically assigning different weights to different angles, and outputting the final detection results.
[0056] like Figure 2As shown, a classification detection system for corneal ulcers based on the Inception-ResNet-V2 neural network model specifically includes the following modules: image acquisition module 1, mask adding module 2, image processing module 3, model classification module 4, and comprehensive judgment module 5. The image acquisition module uses multiple cameras to collect corneal images of the subject after fluorescent staining from multiple angles. The mask adding module uses morphological operations and K-Means clustering method to make masks, add masks to the collected corneal images, and extract effective parts. The image processing module uses AHE to preprocess the extracted effective corneal images. The model classification module uses the trained model to automatically identify and detect various types of corneal ulcers on the collected corneal images. The comprehensive judgment module uses SVM to process the detection results of corneal images at different angles, automatically assigns different weights to different angles, and obtains the final detection results.
[0057] The present invention proposes a classification detection method and system for corneal ulcers based on the Inception-ResNet-V2 neural network model. Figure 2 The system is based on Figure 1 The method in the embodiment is constructed, so the specific implementation method of the example of this application is introduced according to the system block diagram.
[0058] Image acquisition module 1 uses multiple cameras to collect corneal images from multiple angles. To obtain images with better features, the subject needs to perform fluorescent staining on the cornea in advance. If necessary, the subject can open the eyelids by himself and look straight ahead. The system is equipped with a white light source for fill light. The shooting angles include but are not limited to flat angle, 45° elevation (dip), 45° left (right) front, etc.
[0059] The mask adding module 2 creates a mask through morphological operations and K-Means clustering method, and adds a mask to extract the effective part of the corneal image. The specific steps are as follows:
[0060] 1. Using the closing operation in morphological operation, that is, dilation followed by erosion, to fill the tiny holes in the collected corneal image, disconnect the narrow discontinuities and eliminate the tiny protrusions, thus improving the efficiency of image segmentation.
[0061] 2. Use K-Means clustering algorithm to segment corneal images. Considering the existence of corneal ulcer area, eyeball area and surrounding useless area in corneal images, the K value in the algorithm is taken as 3, that is, the image sample set is divided into 3 categories.
[0062] The sample set in the algorithm is D = {X1, X2, ..., X m}, the cluster center set is U={U1,U2,…,U k}, the set of clusters is C = {C1,C2,…,C k}. The objective function selected in the algorithm is
[0063]
[0064] In the formula The smaller the E value, the higher the similarity within the cluster.
[0065] 3. Obtain the corresponding mask based on K-Means clustering, add the mask to the corneal image, delete the useless area around the eyeball, and realize the extraction of the eyeball area and the main area of the corneal ulcer.
[0066] The image processing module 3 further processes the corneal image after adding the mask through AHE to improve the local contrast of the image, obtain more image details, and improve the efficiency and accuracy of subsequent model training.
[0067] Algorithm principle: The moving template M moves line by line on the image P, and the center c(x0, y0) of the template M corresponds to the point f(x0, y0) on the image. Calculate the histogram equalization change relationship of the template M area:
[0068] g(x,y)=T(f(x,y))
[0069] Calculate the equalized corresponding pixel value of the template center point c(x0,y0): g(x0,y0) = T(f(x0,y0)). Replace f(x0,y0) with g(x0,y0). Calculate row by row to obtain the adaptive histogram equalization image of the entire image.
[0070] Model classification module 4 uses the tensorflow framework to build the Inception-ResNet-V2 neural network model. First, the model is trained on the existing data, and the trained model is saved and used to classify the types of corneal ulcers.
[0071] During the model training process, the network parameters are adjusted reasonably according to the corneal image data and the training results. In the model, the linear rectifier function (ReLU) is selected as the activation function, and the softmax function is finally used to output the three-category classification. During the training process, the stochastic gradient descent algorithm (SGD) is used as the optimization algorithm. Due to the uneven distribution of training data, the weighted modified cross entropy loss function (Categorical crossentropy function) is selected as the multi-classification loss function for training Inception-ResNet-V2. The weight calculation and weighted cross entropy loss function calculation formula are shown below
[0072]
[0073]
[0074] In the formula, N is the number of types, N all is the total number of samples, N x (x=0, 1, 2, three types of diseases) is the number of samples in the corresponding category. Y and P are the actual label matrix and probability matrix of the samples, and M is the number of calculated samples.
[0075] The monitoring indicator is accuracy (acc). At the same time, a callback function is set during the training process to dynamically adjust the learning rate and save the model parameters in time. The initial training parameters of the Inception-ResNet-V2 neural network model include: learning rate LR = 0.0001, number of training times EPOCH = 500, training batch size BATCH_SIZE = 64, image input size SIZE = 299 × 299 × 3.
[0076] The trained Inception-ResNet-V2 model is saved, and the corneal image processed in step S30 is input into the model to realize automatic classification of punctate corneal ulcer, punctate-lamellar mixed corneal ulcer and lamellar corneal ulcer.
[0077] In the comprehensive judgment module 5, the classification results of the corneal images collected at different angles after the above processing are used as the input of the final SVM layer. Similar to the training of the Inception-ResNet-V2 neural network model, the SVM determines the weights of the classification results corresponding to the images at different angles by training the existing multi-angle classification data, realizes the comprehensive judgment of the results at different angles, and outputs the final classification results. In this module, the one-to-many method is selected to enable the SVM to realize multi-classification. During training, samples of a certain category are classified into one category in turn, and the remaining samples are classified into another category, that is, 3 SVMs are constructed based on samples of 3 categories. Experiments show that the classification speed is faster and the accuracy is higher at this time.
[0078] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A classification and detection method for corneal ulcers based on a neural network model, characterized in that The steps include: S10, collecting corneal images of the subject after fluorescent staining at multiple angles through multiple cameras; S20, making and adding a mask through morphological operations to extract the effective part of the corneal image; S30, preprocessing the extracted valid corneal image and marking the data type; S40, setting training parameters of the neural network model, and inputting the annotated corneal image into the model for training; The tensorflow framework was used to build the Inception-ResNet-V2 neural network model. The network parameters were reasonably adjusted according to the corneal image data and the trial training results. In the model, the linear rectification function was selected as the activation function. The ReLu function expression is: Finally, the softmax function is used to output three types of classification. The expression of the softmax function is: In the formula, S i is the output of the i-th category, x i is the output of the previous layer unit; The stochastic gradient descent algorithm is used as the optimization algorithm during training, and the formula is: In the formula, η represents the learning rate, which determines how large the step size is to update the parameters. Indicates that the loss function calculates the first-order derivative of the parameter θ on each piece of data; The weighted modified cross entropy loss function is selected as the multi-classification loss function for training Inception-ResNet-V2. The weight calculation and weighted cross entropy loss function calculation formula are as follows In the formula, N is the number of types, N all is the total number of samples, N x , x=0,1,2, there are three types of diseases, is the number of samples in the corresponding category, Y and P are the actual label matrix and probability matrix of the samples, and M is the number of calculated samples; The monitoring indicator is accuracy, and during the training process, a callback function is set to dynamically adjust the learning rate; S50, saving the trained model, and completing the classification of spot-like corneal ulcer, spot-like and sheet-like mixed corneal ulcer, and sheet-like corneal ulcer; S60, taking the corneal image detection results at different angles as input, adding a support vector machine after the model, automatically assigning different weights to different angles, and outputting the final detection results.
2. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 1, characterized in that In the step S10, multiple cameras are used to collect corneal images at multiple angles, and white light is used for fill-in light. The shooting angles include flat angle, 45° elevation / depression angle, and 45° left / right front angle.
3. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 1, characterized in that In step S20, a mask is made by morphological operation and K-Means clustering method and added to the collected corneal image to extract the effective image area. The K value is 3, that is, the image sample set is divided into 3 categories. The sample set in the algorithm is D = {X1, X2, ..., X m }, the cluster center set is U={U1,U2,…,U k }, the set of clusters is C = {C1,C2,…,C k }, the objective function selected in the algorithm is: In the formula The smaller the E value, the higher the similarity within the cluster.
4. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 1, characterized in that In step S30, the extracted image is further processed by using an adaptive histogram equalization method. The algorithm principle is: the moving template M moves line by line on the image P, and the center c(x0, y0) of the template M corresponds to the point f(x0, y0) on the image. The histogram equalization change relationship of the template M area is calculated: g(x,y)=T(f(x,y)) Calculate the equalized corresponding pixel value of the template center point c(x0,y0): g(x0,y0)=T(f(x0,y0)), replace f(x0,y0) with g(x0,y0), and calculate the adaptive histogram equalization image of the entire image row by row.
5. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 1, characterized in that The initial training parameters of the Inception-ResNet-V2 neural network model include: learning rate LR = 0.0001, training times EPOCH = 500, training batch size BATCH_SIZE = 64, and image input size SIZE = 299 × 299 × 3.
6. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 1, characterized in that In step S50, the trained neural network model is saved, and the corneal image processed in step S30 is input into the neural network model to achieve automatic classification of punctate corneal ulcer, punctate-lamellar mixed corneal ulcer and lamellar corneal ulcer.
7. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 1, characterized in that In step S60, the classification results obtained at different angles in step S50 are used as the input of the final support vector machine, different weights are assigned to different angles, and the final detection result is output.
8. The method for classifying and detecting corneal ulcers based on a neural network model as claimed in claim 7, characterized in that A one-to-many approach is selected to enable SVM to achieve multi-classification. During training, samples of a certain category are classified into one category, and the remaining samples are classified into another category. That is, three SVMs are constructed based on samples of three categories.
9. A classification detection system for the classification detection method of corneal ulcer based on a neural network model according to claim 1, comprising an image acquisition module (1), a mask adding module (2), an image processing module (3), a model classification module (4) and a comprehensive judgment module (5) connected in sequence, characterized in that: The image acquisition module (1) has a camera that acquires corneal images of the subject after fluorescent staining at multiple angles; The mask adding module (2) performs mask making and adding to extract the effective part of the image; The image processing module (3) pre-processes the extracted effective corneal image; The model classification module (4) uses the trained model to automatically identify and detect various types of corneal ulcers in the collected corneal images; The comprehensive judgment module (5) processes multiple detection results at different angles through a support vector machine to obtain a final detection result.
Citation Information
Patent Citations
Diabetic foot ulcer (DFU) classification method based on convolutional neural network
CN108108757A
Corneal disease image serialization feature extraction and classification method and device based on deep neural network
CN110188767A
Diabetic retinopathy classification device based on local lesion characteristics
CN110648344A
Diabetic retinopathy classification system based on uncertainty
CN112016626A
