Intelligent cornea difference recognition system and method based on deep learning
Through the intelligent corneal difference recognition method based on deep learning, the corneal difference recognition model with multi-tower structure is used to automatically judge the corneal shaping effect, which solves the problem that corneal topographic analysis relies on artificial experience in the prior art, and improves the evaluation accuracy and efficiency.
Patent Information
- Application Number
- CN202510725264.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-06-03
AI Technical Summary
In the prior art, the analysis of corneal topographic maps mainly relies on the doctor's manual experience. There are differences in subjective judgments, making it difficult to accurately judge complex corneal morphological changes, affecting the accuracy of the evaluation of corneal shaping effect.
The corneal difference intelligent identification method based on deep learning is adopted. By obtaining the corneal topographic map and corneal difference map before and after the patient wears the corneal resizing lens, the corneal difference recognition model with a multi-tower structure is used to automatically judge the corneal shaping effect.
It improves the accuracy of the evaluation of corneal shaping effect, reduces the time and error of manual analysis, and can quickly and accurately evaluate the corneal shaping effect, replacing some manual judgments.
Smart Images

Figure CN120236154A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ophthalmic medical technology, and specifically to a corneal difference intelligent recognition system, method and electronic device based on deep learning. Background Technique
[0002] Orthokeratology lenses (OK lenses) are a non-surgical means to temporarily correct vision by changing the shape of the cornea, and are widely used in the field of vision correction. In order to evaluate the correction effect of OK lenses, doctors usually use corneal topographic equipment to record the changes in corneal morphology before and after a patient wears OK lenses. A corneal topogram is a two-dimensional or three-dimensional image that can display the corneal morphology, and it represents the height and depression of the corneal surface through different colors or grayscales, so as to intuitively reflect the morphological characteristics of the cornea.
[0003] However, in the prior art, the analysis of corneal difference maps of corneal topograms mainly relies on the artificial experience of doctors. Doctors need to observe the changes in corneal morphology in the corneal difference map, such as the central alignment and integrity of the annular structure, etc., to judge the quality of the corneal shaping effect. However, this artificial analysis method has many defects and deficiencies. For example: doctors at different levels may draw different conclusions when analyzing the same corneal difference map of a corneal topogram, and this difference in subjective judgment directly affects the accuracy of the subsequent lens fitting process; in addition, artificial analysis is limited by the experience and knowledge level of doctors, and it is difficult to accurately judge complex corneal morphological changes, which may lead to misjudgment of the corneal shaping effect, thereby affecting the correction effect of patients. Summary of the Invention
[0004] To achieve the above object, the present invention provides the following technical solutions: The first aspect of the present invention provides a corneal difference intelligent recognition method based on deep learning, and the method includes: Step S100: Obtain corneal topograms before and after a patient wears orthokeratology lenses and form a corneal difference map; Step S200: Perform recognition and analysis on the corneal difference map, divide the corneal difference map into different categories according to the analysis results, and evaluate the corneal shaping effect according to the classification results to obtain an image data set corresponding to different categories and corneal shaping effects; Step S300: Based on deep learning technology, train and learn the image data set of different categories and corneal shaping effects, construct a corneal difference recognition model with a multi-tower structure, and construct a corneal difference recognition model with a multi-tower structure for intelligent recognition and analysis of the topographic map differences before and after corneal shaping, and automatically judge the corneal shaping effect according to the output result of the model.
[0005] Preferably, the step S100 includes: step S101: Export the corneal topographic maps and the anterior and posterior corneal difference maps of the patient before and after wearing the contact lens through corneal topographic map acquisition software; Step S102: Define the fixed pixel point range of the corneal region in the three images according to the characteristics of the corneal topographic map: The four vertices of the corneal topographic map pixels before shaping are Q = [x1, y1][x2, y1][x1, y2][x2, y2]; The four vertices of the corneal topographic map pixels after shaping are H = [a1, b1][a2, b1][a1, b2][a2, b2]; The four vertices of the corneal difference map pixels are Y = [e1, f1][e2, f1][e1, f2][e2, f2]; Cut the image according to the fixed pixel point range. Step S103: Adjust the cut image and uniformly compress the image to the set pixel size according to the model input requirements.
[0006] In the above technical solution, by obtaining the corneal topographic maps and the corneal difference maps of the patient before and after wearing the corneal reshaping lens, it provides a necessary data basis for subsequent analysis, which helps to improve the recognition accuracy and efficiency of the model; by defining the fixed pixel point range of the corneal region, cutting and resizing the image, the corneal region can be accurately cut out, ensuring the unity and consistency of the image data input into the model, avoiding the interference of irrelevant information, and improving the efficiency and accuracy of image processing.
[0007] Preferably, the step S200 includes: step S201: Identify the center point position of the defocus ring in the corneal difference map and calculate the Euclidean distance from the center point of the cornea to obtain the offset C of the center of the defocus ring relative to the center of the cornea: ; where C x and C y respectively represent the coordinates of the center point of the cornea, where P x and P y respectively represent the coordinates of the center point of the defocus ring; Highlight the structural features of the defocus ring through morphological processing, use the contour detection algorithm to detect the contour of the defocus ring in the morphologically processed corneal difference image, and calculate the perimeter L and the area A of the contour; Obtain the shape regularity measurement value of the defocus ring by calculating the roundness and compactness indexes of the contour: ; where S represents the shape regularity measurement value of the defocus ring, w1 and w2 respectively represent the weights of the roundness and compactness of the defocus ring contour in the shape regularity measurement, and w1 + w2 = 1; where represents the roundness of the contour, represents the compactness index; Based on the contour area, contour perimeter, and shape regularity metric values, a contour integrity index is defined to evaluate the integrity of the defocus ring: ; where R represents the contour integrity evaluation index; calculate the R values of all corneal difference maps and determine the maximum value R max and the minimum value R min , and normalize the index R, R ∈ (0, 1]; Step S202: Set the defocus ring center offset thresholds C1 and C2 and the integrity degree threshold R1. According to the position and structural integrity of the defocus ring in the corneal difference map, the corneal topographic corneal difference map types are divided into the following three categories: The first category: When C <= C1 and R = 1, it means that the defocus ring in the image is located at the center of the cornea, with centered positioning and intact structure; The second category: When C1 < C <= C2 and R1 <= R < 1, it means that the position of the defocus ring in the image deviates from the center of the cornea but is still within the allowable deviation range, and the overall structure remains intact; The third category: When C > C2, it means that the position of the defocus ring in the image deviates from the center of the cornea and has exceeded the allowable deviation range; when R < R1, it means that the defocus ring structure is incomplete; both of the above situations are classified as the third category; Step S203: After classification, the doctor checks the classification results and judges the shaping effect according to the results. Among them, the first and second categories are judged to have good shaping effects, and the third category is judged to have poor shaping effects; create a database, and associate the judgment results with the corresponding corneal difference maps to form an image data set.
[0008] In the above technical solution, by calculating parameters such as the offset of the defocus ring center relative to the corneal center, the perimeter and area of the contour, the shape regularity metric value, and the evaluation index of contour integrity, the position and structural integrity of the defocus ring can be comprehensively evaluated, providing an objective basis for subsequent classification and effect evaluation; dividing the corneal difference map into three categories according to the position and structural integrity of the defocus ring helps the doctor quickly understand the corneal shaping effect of the patient and provides guidance for subsequent treatment; through the doctor's review, the accuracy and reliability of the classification results can be ensured. At the same time, associating the judgment results with the corresponding corneal difference maps to form an image data set provides rich data support for subsequent model training.
[0009] Preferably, the step S300 includes: Step S301: Use the Pytorch framework to construct a corneal difference recognition model including three independent Resnet50 model branches. Each branch is respectively used to receive and process the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map. Among them, the model structures of the three branches are the same, but the parameters are independent, and can respectively extract the basic features in the three kinds of images. The model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. The input layer is used to receive the three kinds of picture data. The three-tower layer contains three independent Resnet50 branches, and each branch is respectively used to extract the features of the corresponding image. The merging layer is used to splice the outputs of the three branches. The fully connected layer is used to perform feature fusion and classification judgment on the merged features. The output layer is used to output the probability of the final shaping effect of the corneal difference map. Step S302: Extract a complete data set including the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map from the database. Adopt the method of stratified sampling and divide it into a training set, a test set, and a validation set according to a ratio. Further divide the training set data into m batches and set the learning rate and the number of iterations and input them into the model for training. Input the training set data into the model batch by batch, perform forward propagation and backward propagation, and continuously update the model parameters. During the training process, evaluate the performance of the model by calculating the loss function and the accuracy.
[0010] After the model training is completed, input the test set into the model batch by batch, perform forward propagation to obtain the prediction results, and calculate the loss function and the accuracy to evaluate the performance of the model. Continuously optimize the model performance according to the evaluation results.
[0011] In the above technical solution, constructing a corneal difference recognition model, and three independent Resnet50 model branches respectively extract the basic features in the three kinds of images, which helps the model to better learn and recognize image features. By steps such as stratified sampling, batch input, forward propagation, and backward propagation to train the model, the model parameters can be continuously updated, and the recognition accuracy and generalization ability of the model can be improved. By using the test set to evaluate the performance of the model, the recognition accuracy and generalization ability of the model can be comprehensively understood. At the same time, optimizing the model according to the evaluation results can further improve the performance of the model.
[0012] Preferably, the method further includes; Step S400: Use the trained model to perform batch prediction on a large number of unknown corneal difference maps. Hand over the prediction results of the model to the doctor for verification and judgment, and determine the true type of each corneal difference map. Combine the true type verified by the doctor with the prediction results to form a new data set and continuously optimize and upgrade the model. The step S400 includes: Step S401: Use the trained model to batch predict a large number of unknown corneal topographic corneal difference maps, obtain the predicted type and corresponding probability value of each corneal difference map, and submit the prediction result of the model to the doctor for verification and judgment to determine the true type of each corneal difference map; Step S402: Combine the true type verified by the doctor with the prediction result to form a new data set, and then return to Step S302 and Step S303 to use the new data set to train and predict the model; after the training is completed, use the validation set to evaluate the model performance, and continuously optimize the model according to the evaluation result.
[0013] In the above technical solution, by using the trained model to batch predict a large number of unknown corneal topographic corneal difference maps, the predicted type and corresponding probability value of each corneal difference map can be quickly obtained, and through the verification and judgment of the doctor, the accuracy and reliability of the prediction result can be ensured. Combine the true type verified by the doctor with the prediction result to form a new data set, continuously update and optimize the model, improve the recognition accuracy and generalization ability of the model. In addition, using the validation set to evaluate the model performance can ensure the stability and reliability of the model in practical applications.
[0014] The second aspect of the present invention provides a corneal difference intelligent recognition system based on deep learning. The system includes a data acquisition and preprocessing module, a data annotation module, and an identification model training module, where: The data acquisition and preprocessing module is used to obtain the corneal topographic maps before and after the patient wears the orthokeratology lens and form a corneal difference map, and respectively cut and adjust the size of the three acquired images; The data annotation module is used to identify and analyze the corneal difference map, divide the corneal difference map into different categories according to the analysis result, and evaluate the orthokeratology effect according to the classification result to obtain an image data set corresponding to different categories and orthokeratology effects; The model construction module trains and learns the image data set of different categories and orthokeratology effects based on deep learning technology, constructs a corneal difference recognition model with a multi-tower structure, and constructs a corneal difference recognition model with a multi-tower structure for intelligently identifying and analyzing the topographic map differences before and after orthokeratology, and automatically judging the orthokeratology effect according to the output result of the model.
[0015] The data acquisition and preprocessing module includes a data acquisition unit and a data preprocessing unit; the data acquisition unit exports the corneal topographic maps before and after the patient wears the lens and the pictures of the anterior and posterior corneal difference maps through corneal topographic map acquisition software; the data preprocessing unit defines the fixed pixel point range of the corneal area in the three images according to the characteristics of the corneal topographic map: The four vertices of the corneal topographic image pixels before shaping are Q = [x1, y1][x2, y1][x1, y2][x2, y2]; The four vertices of the corneal topographic image pixels after shaping are H = [a1, b1][a2, b1][a1, b2][a2, b2]; The four vertices of the corneal difference image pixels are Y = [e1, f1][e2, f1][e1, f2][e2, f2]; The image is cut according to the fixed pixel point range; The cut image is adjusted and uniformly compressed to the set pixel size according to the model input requirements; The data annotation module includes a corneal difference map evaluation unit and a corneal difference map classification unit; The corneal difference map evaluation unit identifies the center point position of the defocus ring in the corneal difference map and calculates the Euclidean distance from the corneal center point to obtain the offset C of the defocus ring center relative to the corneal center: The structural features of the defocus ring are highlighted through morphological processing. The contour detection algorithm is used to detect the contour of the defocus ring in the morphologically processed corneal difference image, and the perimeter L and area A of the contour are calculated; The shape regularity metric value S of the defocus ring is obtained by calculating the roundness and compactness indexes of the contour; A contour integrity index R is defined based on the contour area, contour perimeter, and shape regularity metric value to evaluate the integrity of the defocus ring; The corneal difference map classification unit sets the defocus ring center offset thresholds C1 and C2 and the integrity degree threshold R1. According to the position and structural integrity of the defocus ring in the corneal difference map, the corneal topographic map corneal difference map types are divided into the following three categories: The first category: When C <= C1 and R = 1, it means that the defocus ring in the image is located at the corneal center, with a centered position and an intact structure; The second category: When C1 < C <= C2 and R1 <= R < 1, it means that the position of the defocus ring in the image deviates from the corneal center but is still within the allowable deviation range, and the overall structure remains intact; The third category: When C > C2, it means that the position of the defocus ring in the image deviates from the corneal center and has exceeded the allowable deviation range; When R < R1, it means that the defocus ring structure is incomplete; Both of the above situations are classified as the third category; After classification, the doctor checks the classification results and judges the shaping effect according to the results. Among them, the first category and the second category are judged to have a good shaping effect, and the third category is judged to have a poor shaping effect; A database is created, and the judgment results are associated with the corresponding corneal difference maps to form an image data set.
[0016] The model construction module uses the Pytorch framework to construct a corneal difference recognition model with three independent Resnet50 model branches. Each branch is used to receive and process the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map. The model structures of the three branches are the same, but the parameters are independent, and they can extract the basic features in the three types of images respectively. The model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. The input layer is used to receive the three types of picture data. The three-tower layer contains three independent Resnet50 branches, and each branch is used to extract the features of the corresponding image. The merging layer is used to splice the outputs of the three branches. The fully connected layer is used to perform feature fusion and classification judgment on the merged features. The output layer is used to output the probability of the final shaping effect of the corneal difference map. Extract a complete data set containing the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map from the database. Using the method of stratified sampling, divide it into a training set, a test set, and a validation set according to a ratio. Further divide the training set data into m batches and set the learning rate and the number of iterations, and input them into the model for training. Input the training set data into the model batch by batch, perform forward propagation and backward propagation, and continuously update the model parameters. During the training process, evaluate the performance of the model by calculating the loss function and the accuracy rate.
[0017] After the model training is completed, input the test set into the model batch by batch, perform forward propagation to obtain the prediction results, and calculate the loss function and the accuracy rate to evaluate the performance of the model. Continuously optimize the model performance according to the evaluation results.
[0018] Preferably, the system further includes: A model optimization module. The model optimization module uses the trained model to perform batch prediction on a large number of unknown corneal topographic maps and corneal difference maps, obtains the prediction types and corresponding probability values of each corneal difference map, and gives the prediction results of the model to the doctor for verification and judgment to determine the true type of each corneal difference map. Combine the true types verified by the doctor with the prediction results to form a new data set, and then return to step S302 and step S303 to use the new data set to train and predict the model. After the training is completed, evaluate the performance of the model using the validation set, and continuously optimize the model according to the evaluation results.
[0019] The third aspect of the present invention provides an electronic device, and the electronic device includes: A processor; A memory, on which computer-readable instructions are stored. When the computer-readable instructions are executed by the processor, the above-mentioned method is implemented.
[0020] Compared with the prior art, the beneficial effects of the present invention are: The present invention uses corneal topographies before and after wearing orthokeratology lenses and corneal topography corneal difference maps as input features, classifies corneal difference maps by identifying the position and structural integrity of defocus rings, and combines the review and verification by doctors to form a comprehensive analysis method, improving the evaluation accuracy of corneal reshaping effects and reducing the possibility of misjudgment and missed judgment.
[0021] The present invention uses a large amount of data to train a multi-level Resnet50 corneal difference recognition model to achieve automatic recognition and analysis of corneal difference maps, can quickly and accurately evaluate corneal reshaping effects, reduces the time and error of manual analysis, and can replace senior ophthalmologists to assist in judging the effects of orthokeratology lenses. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a method flow chart of a method for intelligent recognition of corneal differences based on deep learning according to the present invention; Figure 2 is a schematic diagram of model construction and optimization of a method for intelligent recognition of corneal differences based on deep learning according to the present invention; Figure 3 is a schematic diagram of the structural composition of a system for intelligent recognition of corneal differences based on deep learning according to the present invention; Figure 4 is a schematic diagram of the application structure of an electronic device according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the drawings denote elements having the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings do not have to be drawn to scale unless otherwise specified.
[0024] The special term "exemplary" here means "serving as an example, embodiment, or illustration". Any embodiment described as "exemplary" here does not have to be construed as superior to or better than other embodiments.
[0025] In addition, for a better description of the present disclosure, numerous specific details are given in the following detailed description. Those skilled in the art should understand that the present disclosure can be implemented without some specific details. In some instances, well-known means, elements, and circuits have not been described in detail so as to highlight the gist of the present disclosure.
[0026] All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention. Embodiment 1
[0027] AsFigure 1-2 As shown in the figure, the present invention provides an intelligent corneal difference recognition method based on deep learning, and the method includes: Step S100: Obtain corneal topographic maps before and after a patient wears orthokeratology lenses and form a corneal difference map, and perform cutting and size adjustment on the three obtained images respectively; Step S200: Perform recognition and analysis on the corneal difference map, divide the corneal difference map into different categories according to the analysis results, and evaluate the orthokeratology effect according to the classification results to obtain an image data set corresponding to different categories and orthokeratology effects; Step S300: Based on deep learning technology, train and learn the image data set with different categories and orthokeratology effects, construct a corneal difference recognition model with a multi-tower structure, and construct a corneal difference recognition model with a multi-tower structure for intelligent recognition and analysis of the topographic map differences before and after orthokeratology, and automatically judge the orthokeratology effect according to the output result of the model; Step S400: Use the trained model to perform batch prediction on a large number of unknown corneal difference maps, submit the prediction results of the model to a doctor for verification and judgment, and determine the true type of each corneal difference map. Combine the true type verified by the doctor with the prediction results to form a new data set and continuously optimize and upgrade the model.
[0028] Preferably, the step S100 includes: Step S101: Export the corneal topographic maps before and after the patient wears the lenses and the pictures of the anterior and posterior corneal difference maps through corneal topographic map acquisition software; Step S102: According to the characteristics of the corneal topographic map, define the fixed pixel point range of the corneal area in the three images: The four vertices of the corneal topographic map pixels before shaping are Q = [x1, y1][x2, y1][x1, y2][x2, y2]; The four vertices of the corneal topographic map pixels after shaping are H = [a1, b1][a2, b1][a1, b2][a2, b2]; The four vertices of the corneal difference map pixels are Y = [e1, f1][e2, f1][e1, f2][e2, f2]; Step S103: Cut the image according to the fixed pixel point range, adjust the cut image, and uniformly compress the image to the set pixel size according to the model input requirements.
[0029] In the above technical solution, by obtaining the corneal topographies and corneal difference maps before and after the patient wears orthokeratology lenses, it provides a necessary data basis for subsequent analysis, which helps to improve the recognition accuracy and efficiency of the model; by defining the fixed pixel point range of the corneal area, cutting and resizing the image, the corneal area can be accurately cut out, ensuring the unity and consistency of the image data input into the model, avoiding the interference of irrelevant information, and improving the efficiency and accuracy of image processing.
[0030] Through the pictures of the corneal topographies before and after the patient wears the lenses and the pictures of the anterior and posterior corneal difference maps, the difference features can be identified through deep learning technology and the anterior and posterior difference images can be output, so as to realize the intelligent and rapid analysis of the difference image features, and be able to identify the corneal topographic change features before and after the patient wears the lenses. The following will take the generation of the anterior and posterior corneal difference maps by the CNN convolutional neural network as an example to illustrate: 1. Image Preprocessing and Registration 1.1 Image Normalization Purpose: To ensure that the input images have consistent brightness and contrast for subsequent processing.
[0031] Principle: Normalize the corneal topographies before and after shaping respectively, and scale the pixel values to a fixed range (such as [0,1] or normalize to a mean of 0 and a variance of 1) to eliminate the differences in illumination and acquisition equipment.
[0032] 1.2 Image Registration Purpose: To ensure that the images before and after shaping are spatially aligned so that the same pixel point corresponds to the same corneal position.
[0033] Principle: Use feature point detection algorithms (such as SIFT, ORB) to extract key points in the images.
[0034] Calculate the transformation matrix (such as affine transformation or homography matrix) between the two images through a matching algorithm (such as FLANN or RANSAC).
[0035] Align the image after shaping to the image coordinate system before shaping through the transformation matrix.
[0036] 2. Feature Extraction and Comparison 2.1 Dual-Stream CNN Feature Extraction Purpose: Extract high-dimensional features from the images before and after shaping respectively.
[0037] Principle: Use a convolutional neural network (CNN) with shared weights to process the images before and after shaping respectively.
[0038] The CNN extracts the local and global features of the image through multiple convolutional and pooling operations, generating a high-dimensional feature map.
[0039] Each pixel point of the feature map corresponds to a local region of the original image, containing the semantic information of that region.
[0040] 2.2 Feature Difference Calculation Purpose: To compare the feature differences between the images before and after shaping and capture the changes in corneal shape.
[0041] Principle: Perform pixel-by-pixel comparison on the feature maps before and after shaping to calculate the feature differences.
[0042] The difference calculation can use Euclidean distance, cosine similarity, or directly calculate the difference in eigenvalues.
[0043] The change degree of corneal topography before and after shaping is reflected through the difference map.
[0044] 3. Difference Map Generation 3.1 Difference Map Calculation Purpose: To visualize the feature differences and generate an intuitive difference map.
[0045] Principle: Restore the feature difference map to the original image resolution through deconvolution or upsampling operations.
[0046] Normalize the difference values and map them to the range of [0, 255] to generate a grayscale difference map.
[0047] The brightness value in the difference map represents the change degree, and the higher the brightness, the greater the difference.
[0048] 3.2 Difference Map Post-Processing Purpose: To enhance the readability and visualization effect of the difference map.
[0049] Principle: Perform smoothing processing (such as Gaussian filtering) on the difference map to remove noise.
[0050] Use pseudo-color mapping (such as Jet or Viridis) to convert the grayscale difference map into a color map for easy observation.
[0051] Overlay the contour of the original image to help locate the difference region.
[0052] 4. Result Analysis and Application 4.1 Difference Map Interpretation Purpose: Combine the difference map with clinical significance to evaluate the corneal shaping effect.
[0053] Principle: High-difference regions may indicate significant changes in the local cornea caused by orthokeratology lenses.
[0054] Low-difference regions may indicate weak shaping effects or no obvious changes.
[0055] Combined with the doctor's experience, judge whether the difference is within the expected range.
[0056] 4.2 Clinical Applications Visually display the changes before and after orthokeratology through the difference map.
[0057] Combined with the classification model, automatically evaluate the shaping effect (such as "significant effect", "general effect", "parameters need to be adjusted"). For specific understanding, please refer to the subsequent evaluation of the shaping effect of the present invention.
[0058] Provide decision-making support for doctors and optimize the wearing plan of orthokeratology lenses.
[0059] Advantages of using CNN to generate difference maps: 1. High-precision registration: Ensure that the images before and after shaping are aligned at the pixel level to avoid errors.
[0060] 2. Feature-level comparison: Extract high-dimensional features through CNN to capture subtle corneal changes.
[0061] 3. Visualized difference map: Convert abstract difference values into intuitive images for easy interpretation by doctors.
[0062] 4. Clinical application orientation: Combine medical knowledge, integrate the difference map with the evaluation of the shaping effect, and provide decision-making support.
[0063] Through the above steps, intelligent analysis of the topographic maps of the patient's cornea before and after wearing orthokeratology lenses can be achieved, generating intuitive difference maps to provide strong support for clinical evaluation.
[0064] The corneal shaping effect can be evaluated according to the classification results in the following two ways.
[0065] Solution 1: Preferably, the step S200 includes: Step S201: Identify the center point position of the defocus ring in the corneal difference map and calculate the Euclidean distance from it to the corneal center point to obtain the offset C of the defocus ring center relative to the corneal center: ; where C x and C y respectively represent the coordinates of the corneal center point, where P x and P y respectively represent the coordinates of the defocus ring center point; Highlight the structural features of the defocus ring through morphological processing. Use a contour detection algorithm (user's self-selection) to detect the contour of the defocus ring in the corneal difference image after morphological processing, and calculate the perimeter L and the contour area A of the contour. Obtain the measure value of the defocus ring shape regularity by calculating the roundness and compactness indices of the contour: , where S represents the measure value of the defocus ring shape regularity, w1 and w2 respectively represent the weights of the roundness and compactness of the defocus ring contour in the measure of shape regularity, and w1 + w2 = 1; where represents the roundness of the contour, represents the compactness index; Based on the contour area, contour perimeter, and measure value of shape regularity, define a contour integrity index to evaluate the integrity of the defocus ring: ; where R represents the contour integrity evaluation index; Calculate the R values of all corneal difference maps, and determine the maximum value R max and the minimum value R min , and perform normalization processing on the index R, R ∈ (0, 1]; Step S202: Set the defocus ring center offset thresholds C1 and C2 and the integrity degree threshold R1. According to the position and structural integrity of the defocus ring in the corneal difference map, classify the corneal topographic corneal difference map types into the following three categories: The first category: When C <= C1 and R = 1, it means that the defocus ring in the image is located at the center of the cornea, with centered positioning and intact structure; The second category: When C1 < C <= C2 and R1 <= R < 1, it means that the position of the defocus ring in the image deviates from the center of the cornea but is still within the allowable deviation range, and the overall structure remains intact; The third category: When C > C2, it means that the position of the defocus ring in the image deviates from the center of the cornea and has exceeded the allowable deviation range; when R < R1, it means that the defocus ring structure is incomplete; Both of the above situations are classified into the third category; Step S203: After classification, let the doctor check the classification results and judge the orthokeratology effect according to the results. Among them, the first category and the second category are judged to have good orthokeratology effects, and the third category is judged to have poor orthokeratology effects; Create a database, and associate the judgment results with the corresponding corneal difference maps to form an image data set.
[0066] Solution 2: Based on the design and application parameters of the orthokeratology lens, etc., based on the treatment zone size (TZ), defocus amount (Q), curvature change amount (ΔK_post), and regularity index (SRI), etc., combined with empirical value weights for evaluation: Let the calculation formula of the orthokeratology effect score S be as follows: , Where: T is the target shaping amount (the target refractive correction amount calculated according to the fitting formula, unit: D); Each weight coefficient (needs to be calibrated according to clinical data, example values): w1 = 0.3 (proportion of curvature change); w2 = 0.25 (proportion of treatment area size); Where: T is the target shaping amount (the target refractive correction amount calculated according to the fitting formula, unit: D); Each weight coefficient (needs to be calibrated according to clinical data, example values): w1 = 0.3 (proportion of curvature change); w2 = 0.25 (proportion of treatment area size); Symbol Definition ΔK_post Calculation formula for the amount of corneal curvature change after shaping (unit: D): ΔK_post = K_post - K_pre (K_pre is the flat K value before shaping, and K_post is the flat K value after shaping) TZ Treatment zone diameter (unit: mm), calculated by comparing the corneal topographies to find the diameter of the area with a diopter of 0 Q Defocus amount (unit: D), measured by the peak change in peripheral corneal refractive power in the tangent comparison chart SRI Corneal surface regularity index (normal value 0.2 ± 0.2) TFSQ Tear film surface quality index (>0.2 is abnormal) The shaping effect is classified as follows: Scoring range (S) Category Evaluation criteria S≥85 Excellent The treatment area is uniform, the defocus amount meets the standard (≥2.5 D), and the amount of curvature change ≥ 90% of the target value 70≤S<85 Good The treatment area is slightly eccentric, the defocus amount is 1.5 - 2.5 D, and the amount of curvature change ≥ 80% of the target value 50≤S<70 Fair The treatment area is significantly eccentric, the defocus amount < 1.5D, and the curvature change amount ≥ 60% of the target value S<50 Needs adjustment Shaping is ineffective or abnormal (unstable tear film, irregular cornea) The curvature change amount (ΔK_post): reflects the change in central refractive power after corneal shaping, and the effectiveness needs to be evaluated in combination with the target shaping amount T. When overcorrection is designed, an additional compensation amount of 0.75D is required (ΔK_post = actual change amount + 0.75D).
[0067] The diameter of the treatment area (TZ) Ideal value: 5.0 - 6.5 mm (related to pupil size). If it is too small (<4.5 mm), it may cause glare; if it is too large (>7.0 mm), it may reduce the defocus effect.
[0068] The defocus amount (Q): directly affects the myopia control effect, and it needs to be ≥2.0D to effectively delay the axial length growth of the eye.
[0069] The tear film stability (TFSQ): Abnormal tear film (TFSQ > 0.2) will result in a scoring penalty item. 4. Application example Suppose the fitting parameters of a certain patient are: Kpre = 46.0D, the target shaping amount T = 4.0D, and the actual measurement is: Kpost = 42.5D; TZ = 6.0mm, Q = 2.8D, SRI = 0.33, TFSQ = 0.15; After substitution and calculation: S = 89.5 Classification result: Excellent (S = 89.5).
[0070] In the above technical solution, by calculating the offset of the defocus ring center relative to the corneal center, the perimeter and area of the contour, the shape regularity metric, and the evaluation index of the contour integrity, the position and structural integrity of the defocus ring can be comprehensively evaluated, providing an objective basis for subsequent classification and effect evaluation; classifying the corneal difference map into three categories according to the position and structural integrity of the defocus ring helps doctors quickly understand the corneal reshaping effect of patients and provides guidance for subsequent treatment; through the review by doctors, the accuracy and reliability of the classification results can be ensured. At the same time, associating the judgment results with the corresponding corneal difference maps to form an image dataset (i.e., the image dataset saved in the database for training later) provides rich data support for subsequent model training.
[0071] The image dataset consists of several groups of corresponding pictures (corneal topographies or corneal difference maps before and after wearing orthokeratology lenses), their classification categories, and corneal reshaping effects (the categories and effects can be marked on the picture features in a marked form).
[0072] Preferably, the step S300 includes: Step S301: Use the Pytorch framework to build a corneal difference recognition model containing three independent Resnet50 model branches. Each branch is respectively used to receive and process the corneal topography before shaping, the corneal topography after shaping, and the corneal difference map. Among them, the model structures of the three branches are the same, but the parameters are independent, and can respectively extract the basic features in the three images; the model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. The input layer is used to receive the three types of picture data; the three-tower layer contains three independent Resnet50 branches, and each branch is respectively used to extract the features of the corresponding image; the merging layer is used to splice the outputs of the three branches; the fully connected layer is used to perform feature fusion and classification judgment on the merged features; the output layer is used to output the probability of the final corneal difference map shaping effect. Step S302: Extract a complete (image) dataset containing the corneal topography before shaping, the corneal topography after shaping, and the corneal difference map from the database, and use the stratified sampling method to divide it into a training set, a test set, and a validation set according to a ratio. Further divide the training set data into m batches and set the learning rate and the number of iterations and input them into the model for training; input the training set data into the model batch by batch, perform forward propagation and backward propagation, and continuously update the model parameters. During the training process, evaluate the performance of the model by calculating the loss function and the accuracy.
[0073] After the model training is completed, input the test set into the model batch by batch, perform forward propagation to obtain the prediction results, and calculate the loss function and the accuracy to evaluate the performance of the model, and continuously optimize the model performance according to the evaluation results.
[0074] In the above technical solution, a corneal difference recognition model is constructed. Three independent Resnet50 model branches respectively extract the basic features in three types of images, which helps the model better learn and recognize image features. By training the model through steps such as stratified sampling, batch input, forward propagation, and backpropagation, the model parameters can be continuously updated, improving the recognition accuracy and generalization ability of the model. By evaluating the performance of the model using a test set, the recognition accuracy and generalization ability of the model can be comprehensively understood. At the same time, optimizing the model according to the evaluation results can further improve the performance of the model.
[0075] The following design steps can be referred to: The structure of ResNet50, including the composition of each layer, will not be described here. The steps for the Resnet50 model to extract image features from corneal topographic images can be referred to as follows: Feature extraction by ResNet50 usually includes steps such as input preprocessing, forward propagation of the model (removing the fully connected layer), and obtaining feature vectors. For example, when using a pre-trained ResNet50 model, the last fully connected layer is usually removed, and only the convolutional layer and pooling layer are retained to extract features. The input image needs to undergo specific preprocessing, such as resizing, normalization, etc., to meet the input requirements of the model. In addition, post-processing after feature extraction, such as flattening operations, is also a common step.
[0076] I. Input preprocessing stage 1. Image size standardization; The input images are uniformly adjusted to a resolution of 224×224, meeting the input requirements of ResNet50; Apply the ImageNet standard normalization parameters.
[0077] 2. Data augmentation strategy Random cropping (RandomResizedCrop) and horizontal flipping (RandomHorizontalFlip) are used during the training stage to improve the generalization ability II. Model loading and structure adaptation 1. Load the pre-trained model resnet = models.resnet50(pretrained=True) ```:ml-citation{ref="1,3" data="citationList"}; 2. Remove the classification layer Intercept the front feature extraction module of ResNet50: features = nn.Sequential(list(resnet.children())[:-1]) ```:ml-citation{ref="1,5" data="citationList"} Keep the convolutional layers and residual blocks from conv1 to layer4 (a total of 49 layers). III. Feature Extraction Process 1. Forward Propagation Path The input image goes through: 7×7 convolutional layer (output channels 64, stride 2); 3×3 max pooling (stride 2); 4 groups of residual blocks (layer1 - layer4); Finally, a feature map with 2048 channels is output. 2. Feature Map Dimension Changes Input: 3×224×224 (RGB image); Output: 2048×7×7 (the last convolutional feature map); After global average pooling: 2048×1×1. IV. Feature Vector Obtaining 1. Feature Flattening Process flattened_features = features(x).flatten(1) Output dimension is 2048 ```:ml-citation{ref="1,5" data="citationList"}。
[0078] 2. Frozen Parameter Optimization It is recommended to freeze the parameters of the first 4 stages and only fine-tune layer4 to improve training efficiency. In tasks such as corneal difference recognition, multiple ResNet50 branches can be run in parallel to process input images of different modalities respectively Feature Fusion Strategy By concatenating the 2048-dimensional feature vectors of different branches, a 6144-dimensional composite feature (in the case of 3 branches) is formed.
[0079] Users build a model with three independent ResNet50 branches by themselves using PyTorch for corneal difference recognition. Each branch processes different images: the corneal topographies before and after shaping, and the difference map. The model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. It is necessary to ensure that the three branch structures are the same but the parameters are independent, which is achieved by creating three separate ResNet50 instances, and each instance does not share parameters. It is necessary to ensure that each branch is independent during initialization, for example, using models.resnet50(pretrained=True) three times and processing the inputs separately; finally, merge the features for classification.
[0080] During design: The input layer needs to receive three different types of image data. The inputs of each branch need to be passed in separately, and each ResNet50 processes one image. Then, the merging layer needs to concatenate the outputs of the three branches. The output of ResNet50 is usually the feature before the last fully connected layer, and the feature vector can be obtained by removing the classification layer, and then the three feature vectors are concatenated. Among them, the feature extraction and concatenation methods are as follows: 1. Define as follows (taking a group as an example): Topography before shaping: Xpre ∈ R 3×224×224 ; Topography after shaping: Xpost ∈ R 3×224×224 ; Difference map: Xdiff ∈ R 3×224×224 ; 2. ResNet50 branch structure Each branch contains 5 stages (according to the original ResNet50 structure): Initial convolutional layer: F conv1 (X) = ReLU(BN(Conv 7×7 (X)))(Output size: 64×112×112); Max pooling layer: F maxpool (X) = MaxPool 3×3 (X)(Output size: 64×56×56); Residual block sequence (including 4 groups of Bottleneck structures): F layer1 (X) = Bottleneck1(X) ⊗ Bottleneck1(X) ⊗ Bottleneck1(X); F layer2 (X) = Bottleneck2(X) ⊗ ⋯ ⊗ Bottleneck2(X)(4 times in total); F layer3 (X), Flayer4(X) and so on (output size: 2048×7×7); Symbol description: ⊗ represents the residual connection operation: H(X)=F(X)⊕X, where ⊕ is element-wise addition; Bottleneck i Represents the residual block structure of the i-th stage.
[0081] 3. Global branch feature generation .
[0082] The three branches share the structure but have independent parameters. The loss function of the branches and the weights of each layer are functions and parameter allocation data defined by the administrator. Just keep the branches isolated.
[0083] The fully connected layer part needs to process the merged features for feature fusion and classification. Several fully connected layers can also be designed, and Dropout can be added to prevent overfitting. The output layer uses the Sigmoid activation function to output probabilities.
[0084] In terms of data preprocessing, unify the image size, normalize, etc. The data loading part needs to customize the Dataset class and load the paths and labels of three types of images at the same time.
[0085] During training, the parameters of each branch should be updated independently. Therefore, the optimizer needs to include the parameters of all three branches and the parameters of the fully connected layer. The loss function selects BCEWithLogitsLoss, which is suitable for binary classification tasks.
[0086] The verification part needs to ensure that the model is in the evaluation mode and turn off Dropout, etc. The test function can calculate metrics such as accuracy.
[0087] The following is the technical implementation plan and the main code implementation framework of the three-branch ResNet50 corneal difference recognition model based on the PyTorch framework: I. Model architecture design Input layer Receives three types of inputs simultaneously: pre-operative corneal topographic map (pre_img), post-operative corneal topographic map (post_img), and difference map (diff_img), with a unified size of 3×224×224.
[0088] Three-tower layer (independent feature extraction branch) Create three independent ResNet50 branches, each branch containing: from torchvision import models class ResNetBranch(nn.Module): def __init__(self): super().__init__() resnet = models.resnet50(pretrained=True) self.features= nn.Sequential(list(resnet.children())[:-1]) Remove the original classification layer:ml-citation{ref="4,6" data="citationList"} Independent parameter initialization: Instantiate three branches (pre_branch, post_branch, diff_branch) separately through ResNetBranch().
[0089] Merge layer Flatten and concatenate the feature vectors output by the three branches (each with a dimension of 2048×1×1): merged = torch.cat([pre_feat, post_feat, diff_feat], dim=1) Output dimension 6144:ml-citation{ref="3" data="citationList"} Fully connected layer (feature fusion and classification) Structure design: self.fc = nn.Sequential( nn.Linear(6144, 1024), nn.ReLU(), nn.Dropout(0.5), nn.Linear(1024, 512), nn.ReLU(), nn.Dropout(0.3), nn.Linear(512, 1) ):ml-citation{ref="1,7" data="citationList"} Output layer Output probability through the Sigmoid function: nn.Sigmoid().
[0090] II. Key code implementation import torch import torch.nn as nn from torchvision import models class TripleResNet50(nn.Module): def __init__(self): super().__init__() Three independent branches self.pre_branch = ResNetBranch() self.post_branch = ResNetBranch() self.diff_branch = ResNetBranch() Fully connected layer self.fc = nn.Sequential( nn.Linear(6144, 1024), nn.ReLU(), nn.Dropout(0.5), nn.Linear(1024, 512), nn.ReLU(), nn.Dropout(0.3), nn.Linear(512, 1), nn.Sigmoid() ) def forward(self, pre_img, post_img, diff_img): Feature extraction pre_feat = self.pre_branch(pre_img).flatten(1) post_feat = self.post_branch(post_img).flatten(1) Merging and classification merged = torch.cat([pre_feat, post_feat, diff_feat], dim=1) return self.fc(merged) class ResNetBranch(nn.Module): def __init__(self): super().__init__() resnet = models.resnet50(pretrained=True) self.features = nn.Sequential(list(resnet.children())[:-1]) def forward(self, x): return self.features(x) III. Training Configuration Suggestions Data Preprocessing Uniformly use the ImageNet standardization parameters: transform = transforms.Compose( transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) ):ml-citation{ref="4,6" data="citationList"} Training Parameters Optimizer: AdamW (learning rate 3e-4, weight decay 1e-4); Loss function: BCEWithLogitsLoss; Batch Size: It is recommended to be 8 - 16. Feature Alignment Add a contrastive loss to constrain the similarity of the feature spaces of the three branches; Implement multi-modal feature extraction through a three-branch structure with independent parameters, and combine the advantages of pre-trained models in PyTorch to quickly adapt to the corneal topographic analysis task.
[0091] Preferably, the step S400 includes: Step S401: Use the trained model to batch predict a large number of unknown corneal topographic corneal difference maps, obtain the predicted type and corresponding probability value of each corneal difference map, and submit the prediction result of the model to the doctor for verification and judgment to determine the true type of each corneal difference map; Step S402: Combine the true type verified by the doctor with the prediction result to form a new data set, and then return to Step S302 and Step S303 to use the new data set to train and predict the model; after the training is completed, use the validation set to evaluate the model performance, and continuously optimize the model according to the evaluation result.
[0092] In the above technical solution, by using the trained model to batch predict a large number of unknown corneal topographic corneal difference maps, the predicted type and corresponding probability value of each corneal difference map can be quickly obtained, and through the verification and judgment of the doctor, the accuracy and reliability of the prediction result can be ensured. Combine the true type verified by the doctor with the prediction result to form a new data set, continuously update and optimize the model, improve the recognition accuracy and generalization ability of the model. In addition, using the validation set to evaluate the model performance can ensure the stability and reliability of the model in practical applications.
[0093] Specific implementation process of the present invention: Based on the medmont corneal topographic acquisition software, export and obtain the corneal topographic maps before and after wearing the orthokeratology lens and form a corneal difference map, and the total number of picture pixels is 1,603,868; Cut out the topographic map before shaping, the topographic map after shaping, and the corneal difference map from the above collected pictures respectively, and use fixed pixel points for cutting: The four vertices of the pixel of the topographic map before shaping are:
[8038]
[39838]
[80310] [398310]; The four vertices of the pixel of the topographic map after shaping are:
[80482] [398482]
[80756] [398756]; The four vertices of the pixel of the corneal difference map are:
[77943] [1432 43][779600][1432 600]; Compress the three pictures of different sizes to pixels of 224×224 respectively; Obtain the coordinates of the defocus ring in the corneal difference map as P x = 112, P y = 112; The coordinates of the corneal center are C x = 115, C y = 118; Calculate the offset C = 5.8; The structural features of the defocus ring are highlighted through morphological processing. The contour detection algorithm is used to detect the contour of the defocus ring in the corneal difference image after morphological processing. The perimeter of the defocus ring contour is L = 200 pixels, and the area is A = 1500 pixels. Set w1 = 0.6 and w2 = 0.4. According to the formula, it is calculated that S≈0.6×0.4712 + 0.4×1.459≈0.8663; According to the formula, the integrity index R is calculated to be approximately equal to 7.4999. By calculating the R values of all corneal difference maps, select R max = 10 and R min = 1. Then, according to the normalization formula R = (7.4999 - 1) / (10 - 1)≈0.72; Set the thresholds C1 = 3, C2 = 10, and R1 = 0.6. According to the classification requirements, when C1 < C <= C2 and R1 <= R < 1, it means that the position of the defocus ring in the image deviates from the center of the cornea but is still within the allowable deviation range, and the overall structure remains intact, belonging to the second category. After classification, the doctor checks the classification results and judges that the orthokeratology effect is good according to the results. Create a database, associate the judgment results with the corresponding corneal difference maps to form an image dataset to build a model.
[0094] Obviously, those skilled in the art should understand that to implement all or part of the processes in the above embodiments, it can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above control embodiments. Those skilled in the art can understand that to implement all or part of the processes in the above embodiments, it can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above control embodiments. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memories. Embodiment 2
[0095] As Figure 3 shown, based on the application of Embodiment 1, this embodiment also proposes an intelligent corneal difference recognition system based on deep learning. The system includes a data acquisition and preprocessing module, a data annotation module, an identification model training module, and an identification model optimization module; The data acquisition and preprocessing module is used to obtain corneal topographies before and after the patient wears orthokeratology lenses and form a corneal difference map, and perform cutting and size adjustment on the three acquired images respectively; The data annotation module is used to identify and analyze the corneal difference map, divide the corneal difference map into different categories according to the analysis results, and evaluate the orthokeratology effect according to the classification results to obtain an image data set corresponding to different categories and orthokeratology effects; The model construction module trains and learns the image data set of different categories and orthokeratology effects based on deep learning technology, constructs a corneal difference recognition model with a multi-tower structure, and constructs a corneal difference recognition model with a multi-tower structure for intelligently identifying and analyzing the topographic map differences before and after orthokeratology, and automatically judging the orthokeratology effect according to the output result of the model; The model optimization module uses the trained model to perform batch prediction on a large number of unknown corneal difference maps, submits the prediction results of the model to a doctor for verification and judgment to determine the true type of each corneal difference map, combines the true type verified by the doctor with the prediction results, and forms a new data set to continuously iterate and optimize the model.
[0096] The data acquisition and preprocessing module includes a data acquisition unit and a data preprocessing unit; the data acquisition unit exports the corneal topographies before and after the patient wears the lenses and the pictures of the anterior and posterior corneal difference maps through corneal topography acquisition software; the data preprocessing unit defines the fixed pixel point range of the corneal area in the three images according to the characteristics of the corneal topography: The four vertices of the pre-orthokeratology corneal topographic image pixels are Q = [x1, y1][x2, y1][x1, y2][x2, y2]; The four vertices of the post-orthokeratology corneal topographic image pixels are H = [a1, b1][a2, b1][a1, b2][a2, b2]; The four vertices of the corneal difference image pixels are Y = [e1, f1][e2, f1][e1, f2][e2, f2]; cut the image according to the fixed pixel point range; adjust the cut image, and uniformly compress the image to the set pixel size according to the model input requirements; The data annotation module includes a corneal difference map evaluation unit and a corneal difference map classification unit; the corneal difference map evaluation unit identifies the center point position of the defocus ring in the corneal difference map and calculates the Euclidean distance from it to the corneal center point to obtain the offset C of the defocus ring center relative to the corneal center; Highlight the structural features of the defocus ring through morphological processing. Use a contour detection algorithm to detect the contour of the defocus ring in the corneal difference image after morphological processing, and calculate the perimeter L and the contour area A of the contour. Obtain the shape regularity metric value S of the defocus ring by calculating the roundness and compactness indices of the contour. Define a contour integrity index R based on the contour area, the contour perimeter, and the shape regularity metric value to evaluate the integrity of the defocus ring. The corneal difference map classification unit sets the defocus ring center offset thresholds C1 and C2 and the integrity degree threshold R1. According to the position and structural integrity of the defocus ring in the corneal difference map, the corneal topographic corneal difference map types are divided into the following three categories: The first category: When C <= C1 and R = 1, it means that the defocus ring in the image is located at the center of the cornea, with a centered position and an intact structure. The second category: When C1 < C <= C2 and R1 <= R < 1, it means that the position of the defocus ring in the image deviates from the center of the cornea but is still within the allowable deviation range, and the overall structure remains intact. The third category: When C > C2, it means that the position of the defocus ring in the image deviates from the center of the cornea and has exceeded the allowable deviation range; when R < R1, it means that the structure of the defocus ring is incomplete; both of the above situations are classified as the third category. After classification, the doctor checks the classification results and judges the shaping effect based on the results. Among them, the first category and the second category are judged to have a good shaping effect, and the third category is judged to have a poor shaping effect. Create a database, and associate the judgment results with the corresponding corneal difference maps to form an image data set.
[0097] The model construction module uses the Pytorch framework to construct a corneal difference recognition model containing three independent Resnet50 model branches. Each branch is used to receive and process the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map. Among them, the model structures of the three branches are the same, but the parameters are independent, and they can respectively extract the basic features in the three images. The model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. Among them, the input layer is used to receive the three types of picture data; the three-tower layer contains three independent Resnet50 branches, and each branch is used to extract the features of the corresponding image; the merging layer is used to splice the outputs of the three branches; the fully connected layer is used to perform feature fusion and classification judgment on the merged features; the output layer is used to output the probability of the final shaping effect of the corneal difference map. Extract a complete dataset containing corneal topographies before shaping, corneal topographies after shaping, and corneal difference maps from the database. Using the method of stratified sampling, divide it into a training set, a test set, and a validation set according to a ratio. Further divide the training set data into m batches, set the learning rate and the number of iterations, and input them into the model for training; Input the training set data into the model batch by batch, perform forward propagation and backward propagation, continuously update the model parameters, and evaluate the performance of the model by calculating the loss function and accuracy during the training process.
[0098] After the model training is completed, input the test set into the model batch by batch, perform forward propagation to obtain the prediction results, and calculate the loss function and accuracy to evaluate the performance of the model. Continuously optimize the model performance according to the evaluation results.
[0099] The model optimization module uses the trained model to perform batch predictions on a large number of unknown corneal topography corneal difference maps, obtains the predicted types and corresponding probability values of each corneal difference map, and gives the prediction results of the model to the doctor for verification and judgment to determine the true type of each corneal difference map; Combine the true types verified by the doctor with the prediction results to form a new dataset, and then return to step S302 and step S303 to use the new dataset to train and predict the model; After the training is completed, use the validation set to evaluate the performance of the model, and continuously optimize the model according to the evaluation results.
[0100] For the interaction of the above-mentioned various modules, please understand and implement it in combination with Embodiment 1, and this embodiment will not be elaborated here.
[0101] The above-mentioned various modules or steps of the present invention can be implemented by a general computing system. They can be concentrated on a single computing system or distributed on a network composed of multiple computing systems. Optionally, they can be implemented by program codes executable by the computing system. Thus, they can be stored in the storage system and executed by the computing system, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software. Embodiment 3
[0102] As Figure 4 shown, further, on the other hand, the present application also proposes an electronic device, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to implement the method described in Embodiment 1 when executing the executable instructions.
[0103] An electronic device according to an embodiment of the present disclosure includes a processor and a memory for storing processor-executable instructions. The processor is configured to implement the method described in the previous Embodiment 1 when executing the executable instructions.
[0104] Here, it should be noted that the number of processors can be one or more. At the same time, in the electronic device according to an embodiment of the present disclosure, an input system and an output system may also be included. Among them, the processor, the memory, the input system and the output system can be connected through a bus or in other ways, which is not specifically limited here.
[0105] The memory, as a computer-readable storage medium, can be used to store software programs, computer-executable programs and various modules, such as: the programs or modules corresponding to a method for intelligent recognition of corneal differences based on deep learning according to an embodiment of the present disclosure. The processor executes various functional applications and data processing of the electronic device by running the software programs or modules stored in the memory.
[0106] The input system can be used to receive input numbers or signals. Among them, the signal can be a key signal related to the user settings and function control of the device / terminal / server. The output system may include a display device such as a display screen.
[0107] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An intelligent corneal difference recognition method based on deep learning, characterized in that: The method includes: Step S100: Obtain the corneal topographies before and after the patient wears orthokeratology lenses and form a corneal difference map; Step S200: Identify and analyze the corneal difference map, divide the corneal difference map into different categories according to the analysis results, and evaluate the orthokeratology effect according to the classification results to obtain an image dataset corresponding to different categories and orthokeratology effects; Step S300: Based on deep learning technology, train and learn the image dataset with different categories and orthokeratology effects, and construct a corneal difference recognition model with a multi-tower structure, which is used to intelligently identify and analyze the topographic map differences before and after orthokeratology, and automatically judge the orthokeratology effect according to the output result of the model.
2. The intelligent corneal difference recognition method based on deep learning according to claim 1, wherein: The said step S100 includes: Step S101: Export the corneal topographies before and after the patient wears the lenses and the pictures of the anterior and posterior corneal difference maps through corneal topography acquisition software; Step S102: According to the characteristics of the corneal topography, define the fixed pixel point ranges of the corneal regions in the three images: The four vertices of the corneal topography pixels before shaping are: Q = [x1, y1][x2, y1][x1, y2][x2, y2]; The four vertices of the corneal topography pixels after shaping are: H = [a1, b1][a2, b1][a1, b2][a2, b2]; The four vertices of the corneal difference image pixels are Y = [e1, f1][e2, f1][e1, f2][e2, f2]; Step S103: Cut and adjust the sizes of the three obtained images according to the fixed pixel point ranges, and uniformly compress the images to the set pixel size according to the model input requirements.
3. The intelligent corneal difference recognition method based on deep learning according to claim 1, wherein: The said step S200 includes: Step S201: Identify the center point position of the defocus ring in the corneal difference map and calculate the Euclidean distance from it to the corneal center point to obtain the offset C of the defocus ring center relative to the corneal center: ; Among them, C x and C y respectively represent the coordinates of the center point of the cornea, where P x and P y respectively represent the coordinates of the center point of the defocus ring; Highlight the structural features of the defocus ring through morphological processing, use the contour detection algorithm to detect the contour of the defocus ring in the morphologically processed corneal difference image, and calculate the perimeter L and contour area A of the contour; obtain the shape regularity measurement value of the defocus ring by calculating the roundness and compactness indexes of the contour: ; Where S represents the shape regularity measurement value of the defocus ring, w1 and w2 respectively represent the weights of the roundness and compactness of the defocus ring contour in the shape regularity measurement, and w1 + w2 = 1; Based on the contour area, contour perimeter and shape regularity measurement value, define a contour integrity index to evaluate the integrity of the defocus ring: ; where R represents the contour integrity evaluation index; calculate the R values of all corneal difference maps to determine the maximum value R max and the minimum value R min , and normalize the index R; Step S202: Set the defocus ring center offset thresholds C1 and C2 and the integrity degree threshold R1, and divide the corneal topography corneal difference map types into the following three categories according to the position and structural integrity of the defocus ring in the corneal difference map: The first category: When C <= C1 and R = 1, it means that the defocus ring in the image is located at the corneal center, with centered positioning and intact structure; Category 2: When C1 < C <= C2 and R1 <= R < 1, it means that the defocus ring position in the image deviates from the corneal center but is still within the allowable deviation range, and the overall structure remains intact; Category 3: When C > C2, it means that the defocus ring position in the image deviates from the corneal center and has exceeded the allowable deviation range; when R < R1, it means that the defocus ring structure is incomplete; both of the above situations are classified as Category 3; Step S203: After classification, the doctor checks the classification results and judges the shaping effect based on the results. Among them, Category 1 and Category 2 are judged to have good shaping effects, and Category 3 is judged to have poor shaping effects; create a database, and associate the judgment results with the corresponding corneal difference map to form an image dataset.
4. The intelligent corneal difference recognition method based on deep learning according to claim 1, characterized in that: The step S300 includes: Step S301: Use the Pytorch framework to build a corneal difference recognition model containing three independent Resnet50 model branches. Each branch is used to receive and process the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map. Among them, the model structures of the three branches are the same, but the parameters are independent, and they can respectively extract the basic features in the three images; the model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. The input layer is used to receive the three types of picture data; the three-tower layer contains three independent Resnet50 branches, and each branch is used to extract the features of the corresponding image; the merging layer is used to splice the outputs of the three branches; the fully connected layer is used to perform feature fusion and classification judgment on the merged features; the output layer is used to output the probability of the final corneal difference map shaping effect; Step S302: Extract a complete dataset containing the corneal topographic map before shaping, the corneal topographic map after shaping, and the corneal difference map from the database. Using the method of stratified sampling, divide it into a training set, a test set, and a validation set according to a ratio. Further divide the training set data into m batches and set the learning rate and the number of iterations, and input them into the model for training; input the training set data into the model batch by batch, perform forward propagation and backward propagation, and continuously update the model parameters. During the training process, evaluate the performance of the model by calculating the loss function and the accuracy; Step S303: After the model training is completed, input the test set into the model batch by batch, perform forward propagation to obtain the prediction results, and calculate the loss function and the accuracy to evaluate the performance of the model. Continuously optimize the model performance according to the evaluation results.
5. The intelligent corneal difference recognition method based on deep learning according to claim 4, characterized in that: The method further includes: Step S400: Use the trained model to perform batch prediction on a large number of unknown corneal difference maps. Hand over the prediction results of the model to the doctor for verification and judgment, and determine the true type of each corneal difference map. Combine the true type verified by the doctor with the prediction results to form a new dataset and continuously optimize and upgrade the model; The step S400 includes: Step S401: Use the trained model to perform batch prediction on a large number of unknown corneal topographic map corneal difference maps, obtain the prediction type and the corresponding probability value of each corneal difference map, and hand over the prediction results of the model to the doctor for verification and judgment to determine the true type of each corneal difference map; Step S402: Combine the true type verified by the doctor with the prediction result to form a new data set, and then return to Step S302 and Step S303 to use the new data set to train and predict the model; after the training is completed, use the validation set to evaluate the model performance and continuously optimize the model according to the evaluation result.
6. An intelligent corneal difference recognition system based on deep learning, characterized in that: The system includes a data acquisition and preprocessing module, a data annotation module, and an identification model training module, where: The data acquisition and preprocessing module is used to obtain the corneal topographic maps before and after the patient wears orthokeratology lenses and form a corneal difference map, and perform cutting and size adjustment on the three acquired images respectively; The data annotation module is used to identify and analyze the corneal difference map, divide the corneal difference map into different categories according to the analysis result, and evaluate the orthokeratology effect according to the classification result to obtain an image data set corresponding to different categories and orthokeratology effects; The model construction module trains and learns the image data set of different categories and orthokeratology effects based on deep learning technology, constructs a corneal difference recognition model with a multi-tower structure, and constructs a corneal difference recognition model with a multi-tower structure for intelligently identifying and analyzing the topographic map differences before and after orthokeratology, and automatically judging the orthokeratology effect according to the output result of the model.
7. The intelligent corneal difference recognition system based on deep learning according to claim 6, characterized in that: The data acquisition and preprocessing module includes a data acquisition unit and a data preprocessing unit; the data acquisition unit exports the corneal topographic maps before and after the patient wears the lenses and the pictures of the anterior and posterior corneal difference maps through corneal topographic map acquisition software; the data preprocessing unit defines the fixed pixel point range of the corneal area in the three images according to the characteristics of the corneal topographic map: The four vertices of the pre-orthokeratology corneal topographic image pixels are: Q = [x1, y1][x2, y1][x1, y2][x2, y2]; The four vertices of the post-orthokeratology corneal topographic image pixels are: H = [a1, b1][a2, b1][a1, b2][a2, b2]; The four vertices of the corneal difference image pixels are Y = [e1, f1][e2, f1][e1, f2][e2, f2]; Cut the image according to the fixed pixel point range; adjust the cut image, and uniformly compress the image to the set pixel size according to the model input requirements; The data annotation module includes a corneal difference map evaluation unit and a corneal difference map classification unit; the corneal difference map evaluation unit identifies the center point position of the defocus ring in the corneal difference map and calculates the Euclidean distance from it to the corneal center point to obtain the offset C of the defocus ring center relative to the corneal center: Highlight the structural features of the defocus ring through morphological processing, use the contour detection algorithm to detect the contour of the defocus ring in the morphologically processed corneal difference image, and calculate the perimeter L and area A of the contour; obtain the shape regularity measurement value S of the defocus ring by calculating the roundness and compactness indexes of the contour; define a contour integrity index R based on the contour area, contour perimeter and shape regularity measurement value to evaluate the integrity of the defocus ring; The corneal difference map classification unit sets the decentration ring center offset thresholds C1 and C2 and the integrity degree threshold R1. According to the position and structural integrity of the decentration ring in the corneal difference map, the corneal topographic corneal difference map types are divided into the following three categories: The first category: When C <= C1 and R = 1, it means that the decentration ring in the image is located at the center of the cornea, with centered positioning and intact structure; The second category: When C1 < C <= C2 and R1 <= R < 1, it means that the position of the decentration ring in the image deviates from the center of the cornea but is still within the allowable deviation range, and the overall structure remains intact; The third category: When C > C2, it means that the position of the decentration ring in the image deviates from the center of the cornea and has exceeded the allowable deviation range; when R < R1, it means that the structure of the decentration ring is incomplete; both of the above situations are classified as the third category; After the classification is completed, the doctor then checks the classification results and judges the orthokeratology effect based on the results. Among them, the first and second categories are judged to have good orthokeratology effects, and the third category is judged to have poor orthokeratology effects; a database is created, and the judgment results are associated with the corresponding corneal difference maps to form an image data set.
8. The intelligent corneal difference recognition system based on deep learning according to claim 6, characterized in that: The model construction module uses the Pytorch framework to construct a corneal difference recognition model containing three independent Resnet50 model branches. Each branch is respectively used to receive and process the corneal topographic map before orthokeratology, the corneal topographic map after orthokeratology, and the corneal difference map. Among them, the model structures of the three branches are the same, but the parameters are independent, and they can respectively extract the basic features in the three types of images; the model structure includes an input layer, a three-tower layer, a merging layer, a fully connected layer, and an output layer. Among them, the input layer is used to receive the three types of picture data; the three-tower layer contains three independent Resnet50 branches, and each branch is respectively used to extract the features of the corresponding image; the merging layer is used to splice the outputs of the three branches; the fully connected layer is used to perform feature fusion and classification judgment on the merged features; the output layer is used to output the probability of the final corneal difference map orthokeratology effect; Extract a complete data set containing the corneal topographic map before orthokeratology, the corneal topographic map after orthokeratology, and the corneal difference map from the database. Using the method of stratified sampling, it is divided into a training set, a test set, and a validation set according to a ratio. The training set data is further divided into m batches and the learning rate and the number of iterations are set and input into the model for training; the training set data is input into the model batch by batch, forward propagation and backward propagation are performed, and the model parameters are continuously updated. During the training process, the performance of the model is evaluated by calculating the loss function and the accuracy; After the model training is completed, the test set is input into the model batch by batch, forward propagation is performed to obtain the prediction results, and the loss function and the accuracy are calculated to evaluate the performance of the model. The model performance is continuously optimized according to the evaluation results.
9. The intelligent corneal difference recognition system based on deep learning according to claim 6, wherein: The system further includes: A model optimization module. The model optimization module uses the trained model to perform batch prediction on a large number of unknown corneal topographic corneal difference maps, obtains the predicted type and the corresponding probability value of each corneal difference map, and hands the prediction results of the model to the doctor for verification and judgment to determine the true type of each corneal difference map; Combine the true type verified by the doctor with the prediction result to form a new data set, and then return to steps S302 and S303 to use the new data set to train and predict the model. After training is completed, use the validation set to evaluate the model performance, and continuously optimize the model according to the evaluation results.
10. An electronic device, characterized in that, The electronic device includes: A processor; A memory, on which computer-readable instructions are stored. When the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data processing system based on corneal topography
CN110675929A
Intelligent evaluation auxiliary system and method for orthokeratology lens
CN113935809A
Cornea conus automatic grading method and device and storage medium
CN116246331A
Cornea conus grading detection device
CN116525099A
OK lens corneal topography wearing condition identification and classification method
CN117132834A