An improved KNN algorithm-based ophthalmic MGD intelligent diagnosis and treatment system
Patent Information
- Application Number
- CN202511390973.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2045-09-26
AI Technical Summary
[0007]针对现有MGD诊断方法存在的主观性强、定量指标不足和分类准确率有限等问题,本发明提供了一种基于改进KNN算法的眼科MGD智能诊疗系统,旨在构建一个集成图像预处理、腺体分割、特征提取和智能分类的完整系统,实现对眼科睑板腺功能障碍的自动分级诊断,提高诊断的客观性、一致性和准确性
[0019](1)客观准确:本发明通过图像分割和定量特征提取,客观反映睑板腺的形态学变化,相比人工经验判断显著提高了MGD分级诊断的准确性和一致性。实验结果表明,本发明改进的KNN算法(PLMKNN)相较传统KNN和局部均值KNN具有更高的分类精度,可有效识别早期细微的腺体异常。
Smart Images

Figure CN121305167B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, specifically to an ophthalmic MGD intelligent diagnosis and treatment system based on an improved KNN algorithm. Background Technology
[0002] Meibomian gland dysfunction (MGD) is one of the main causes of dry eye syndrome. It is mainly characterized by abnormal secretion of the meibomian glands in the eyelids, resulting in insufficient quality or quantity of the tear film lipid layer, which in turn causes dryness and irritation symptoms in the eyes.
[0003] Clinically, the diagnosis of meibomian gland dysfunction (MGD) typically relies on the physician's subjective judgment based on imaging of the eyelids and meibomian glands. For example, physicians observe the meibomian gland structure using a slit-lamp microscope or specialized ocular surface imaging equipment, grading MGD based on the degree of glandular absence, morphological changes, and secretory activity. However, traditional manual assessment methods lack standardized and objective diagnostic criteria, and discrepancies may exist between different physicians, making it difficult to quantify subtle glandular changes. This subjectivity not only affects the accuracy and consistency of diagnosis but also hinders the objective evaluation of treatment outcomes.
[0004] With the development of medical imaging technology and artificial intelligence algorithms, image-based objective quantitative diagnostic methods have gained importance in the field of ophthalmology. Particularly for meibomian gland dysfunction (MGD), research shows that morphological parameters of the meibomian glands (such as gland length, width, area, and curvature) are closely related to their functional status. Some domestic and international studies have proposed obtaining objective indicators of the glands through image analysis and have attempted to use them for MGD grading and diagnosis. For example, the Japanese MGD research group and the TFOS International Dry Eye Symposium proposed a new definition and classification system for MGD, subdividing it into different types and introducing gland morphological indicators to assess disease severity. Furthermore, algorithms based on machine learning and deep learning are gradually being applied to the field of ocular surface image analysis. Some studies utilize infrared images of the meibomian glands to extract indicators such as gland area ratio, combining them with classifiers for automatic MGD discrimination; others attempt to use convolutional neural networks to directly perform end-to-end grading and classification of meibomian gland images. However, these existing technical solutions still have the following shortcomings:
[0005] Some solutions extract only simple indicators, failing to comprehensively characterize changes in glandular structure; some deep learning methods lack interpretability and heavily rely on large amounts of labeled data; traditional KNN and other algorithms do not consider the differences in importance of features in high-dimensional feature spaces, potentially leading to low classification accuracy. While the traditional KNN (K-Nearest Neighbor) classification method is relatively simple to implement, its drawbacks include equal weighting of features across dimensions in distance calculations, making it difficult to highlight the features most contributing to classification, and its sensitivity to noise and heterogeneous data. To improve the discriminative power of KNN, improved methods such as Local Means KNN (LMKNN) have been proposed, using the average nearest neighbor method to mitigate the susceptibility of KNN to noise from single samples, but these still do not fully utilize the information differences between different features.
[0006] Given that MGD diagnosis requires comprehensive consideration of multiple glandular morphological parameters, there is an urgent need for an overall solution that integrates advanced image segmentation, feature extraction, and improved classification algorithms to improve the accuracy and practicality of objective MGD diagnosis. Summary of the Invention
[0007] To address the problems of strong subjectivity, insufficient quantitative indicators, and limited classification accuracy in existing MGD diagnostic methods, this invention provides an intelligent ophthalmic MGD diagnosis and treatment system based on an improved KNN algorithm. The system aims to build a complete system integrating image preprocessing, gland segmentation, feature extraction, and intelligent classification to achieve automatic hierarchical diagnosis of ophthalmic meibomian gland dysfunction, thereby improving the objectivity, consistency, and accuracy of diagnosis.
[0008] This invention provides an intelligent ophthalmic MGD diagnosis and treatment system based on an improved KNN algorithm, comprising: an image acquisition and preprocessing module for acquiring and preprocessing original grayscale MGD eye images to obtain preprocessed MGD eye images; a gland region segmentation module for segmenting the meibomian gland region of the preprocessed MGD eye image using a U-Net convolutional neural network model to obtain a binary mask representing the gland region; an image enhancement and mask processing module for extracting gland region pixels from the original grayscale MGD eye image using the binary mask to generate a grayscale image of the gland region, and performing contrast enhancement processing on the grayscale image of the gland region using the CLAHE algorithm, and performing threshold segmentation on the contrast-enhanced grayscale image of the gland region to obtain a gland binary map; a feature extraction module for extracting gland morphological feature parameters based on the gland binary map; and an intelligent diagnosis module for inputting the gland morphological feature parameters into an improved KNN algorithm model based on feature grouping and weighting for classification calculation, and outputting MGD graded diagnosis results.
[0009] Optionally, the image acquisition and preprocessing module is specifically used to: acquire meibomian gland infrared images as the original grayscale MGD eye image using an ocular surface analyzer or infrared camera, wherein the meibomian gland infrared images include upper meibomian gland infrared images and lower meibomian gland infrared images; and perform size adjustment and grayscale normalization processing on the original grayscale MGD eye image to obtain the preprocessed MGD eye image, wherein the preprocessed MGD eye image includes preprocessed upper meibomian gland infrared images and preprocessed lower meibomian gland infrared images.
[0010] Optionally, the gland region segmentation module is specifically used to: use a pre-trained U-Net convolutional neural network model to segment the meibomian gland region of the preprocessed upper meibomian gland infrared image and the preprocessed lower meibomian gland infrared image, respectively, to obtain an upper meibomian gland mask and a lower meibomian gland mask as the binary mask representing the gland region.
[0011] Optionally, in the image enhancement and masking module, threshold segmentation is performed on the contrast-enhanced grayscale image of the gland region to obtain a gland binary image, including: setting an empirical threshold; setting pixels in the contrast-enhanced grayscale image of the gland region above the empirical threshold to white to represent glands; setting pixels in the contrast-enhanced grayscale image of the gland region below the empirical threshold to black to represent non-glandules; generating the gland binary image based on the white and black pixels, the gland binary image including a gland binary image of the upper eyelid and a gland binary image of the lower eyelid.
[0012] Optionally, the gland morphological feature parameters are 12-dimensional, including gland area, gland height, gland width, gland perimeter, gland curvature, and gland density of the upper and lower eyelids. The gland height is the length of the gland along the vertical direction, the gland width is characterized by the ratio of gland area to height, the gland curvature is characterized by the ratio of gland perimeter to gland height, and the gland density is the proportion of the pixel area of the gland region to the effective area of the meibomian gland.
[0013] Optionally, the intelligent diagnostic module is specifically used for: inputting the glandular morphological feature parameters into an improved KNN algorithm model based on feature grouping and weighting; the improved KNN algorithm model weights the glandular morphological feature parameters using preset weight coefficients to obtain weighted glandular morphological features; dividing the weighted glandular morphological features into four feature groups—area, length, width, and structural density—based on the semantic relevance of glandular structure and function; classifying the glandular morphological feature samples within each feature group using a local mean KNN classification strategy to obtain classification results for each feature group; and weighting and fusing the classification results of each feature group using an information entropy-driven weight fusion mechanism to obtain the MGD grading diagnostic result.
[0014] Optionally, the step of using the Local Mean KNN classification strategy to classify and discriminate the glandular morphological feature test samples within each feature group to obtain the classification and discrimination results of each feature group includes: calculating the distance between the glandular morphological feature test samples and the training samples of each category in the feature subspace corresponding to each feature group, and selecting the K nearest neighbor training samples of each category to calculate the local mean vector of each category; based on the distance between the glandular morphological feature test samples and the local mean vectors of each category, determining the category to which the glandular morphological feature test samples belong, and obtaining the classification and discrimination results of each feature group.
[0015] Optionally, the step of using an information entropy-driven weighted fusion mechanism to weightedly fuse the classification results of each feature group to obtain the MGD hierarchical diagnosis result includes: comprehensively evaluating the classification results of each feature group using an information entropy-driven weighted fusion mechanism; calculating the conditional entropy of each feature group in each category of training samples; and assigning weights according to the entropy value, wherein the feature group with the smaller entropy value has a larger weight, and the feature group with the larger entropy value has a smaller weight; and weighting and accumulating the classification results of each feature group according to the weights assigned to each feature group to fuse and obtain the MGD hierarchical diagnosis result.
[0016] Optionally, the MGD grading diagnosis result is one of normal, mild MGD, moderate MGD, or severe MGD.
[0017] Optionally, the system further includes a visualization module for visually displaying the MGD grading diagnosis results, the original grayscale MGD eye image, the binary mask representing the glandular region, and the index values of the extracted glandular morphological feature parameters.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] (1) Objective and accurate: This invention objectively reflects the morphological changes of meibomian glands through image segmentation and quantitative feature extraction, significantly improving the accuracy and consistency of MGD grading diagnosis compared to manual experience judgment. Experimental results show that the improved KNN algorithm (PLMKNN) of this invention has higher classification accuracy than traditional KNN and local mean KNN, and can effectively identify early and subtle glandular abnormalities.
[0020] (2) Intelligent Integration: This invention combines a deep learning segmentation model with an improved machine learning classifier to form a complete automated diagnostic process. The modules of gland segmentation, feature extraction, and hierarchical discrimination are closely integrated to achieve end-to-end intelligent processing from the original image to the diagnostic conclusion, thereby improving diagnostic efficiency.
[0021] (3) Practical and easy to promote: The invention has a clear process and moderate computational load, can run in real time on conventional computer hardware, and is easy to integrate into clinical equipment or software systems. The required ocular images can be obtained through common ocular surface analyzers, and the algorithm model can be repeatedly trained and ported, demonstrating good practicality and scalability. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0023] Figure 1 This is a system framework diagram of the present invention.
[0024] Figure 2 To and Figure 1 The corresponding flowchart of the present invention.
[0025] Figure 3 This is a schematic diagram of meibomian gland image segmentation in the system of the present invention.
[0026] Figure 4 Schematic diagram of gland morphological feature parameter extraction. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Specifically, see Figure 1 The present invention discloses an intelligent ophthalmic MGD diagnosis and treatment system based on an improved KNN algorithm, comprising:
[0029] The image acquisition and preprocessing module 10 is used to acquire the original grayscale MGD eye image and perform preprocessing to obtain the preprocessed MGD eye image;
[0030] The gland region segmentation module 20 is used to segment the meibomian gland region of the preprocessed MGD eye image using a U-Net convolutional neural network model to obtain a binary mask representing the gland region.
[0031] The image enhancement and masking module 30 is used to apply the binary mask to extract pixels of the gland region from the original grayscale MGD eye image, generate a grayscale image of the gland region, and use the CLAHE algorithm to perform contrast enhancement processing on the grayscale image of the gland region. The contrast-enhanced grayscale image of the gland region is then segmented by thresholding to obtain a binary image of the gland.
[0032] Feature extraction module 40 is used to extract morphological feature parameters of glands based on the gland binary image;
[0033] The intelligent diagnostic module 50 is used to input the gland morphological feature parameters into an improved KNN algorithm model based on feature grouping and weighting for classification calculation, and output the MGD graded diagnostic results.
[0034] Optionally, the image acquisition and preprocessing module is specifically used to: acquire meibomian gland infrared images as the original grayscale MGD eye image using an ocular surface analyzer or infrared camera, wherein the meibomian gland infrared images include upper meibomian gland infrared images and lower meibomian gland infrared images; and perform size adjustment and grayscale normalization processing on the original grayscale MGD eye image to obtain the preprocessed MGD eye image, wherein the preprocessed MGD eye image includes preprocessed upper meibomian gland infrared images and preprocessed lower meibomian gland infrared images.
[0035] Optionally, the gland region segmentation module is specifically used to: use a pre-trained U-Net convolutional neural network model to segment the meibomian gland region of the preprocessed upper meibomian gland infrared image and the preprocessed lower meibomian gland infrared image, respectively, to obtain an upper meibomian gland mask and a lower meibomian gland mask as the binary mask representing the gland region.
[0036] Optionally, in the image enhancement and masking module, threshold segmentation is performed on the contrast-enhanced grayscale image of the gland region to obtain a gland binary image, including: setting an empirical threshold; setting pixels in the contrast-enhanced grayscale image of the gland region above the empirical threshold to white to represent glands; setting pixels in the contrast-enhanced grayscale image of the gland region below the empirical threshold to black to represent non-glandules; generating the gland binary image based on the white and black pixels, the gland binary image including a gland binary image of the upper eyelid and a gland binary image of the lower eyelid.
[0037] Optionally, the gland morphological feature parameters are 12-dimensional, including gland area, gland height, gland width, gland perimeter, gland curvature, and gland density of the upper and lower eyelids. The gland height is the length of the gland along the vertical direction, the gland width is characterized by the ratio of gland area to height, the gland curvature is characterized by the ratio of gland perimeter to gland height, and the gland density is the proportion of the pixel area of the gland region to the effective area of the meibomian gland.
[0038] Specifically, the morphological characteristics of the glands include the area of the upper eyelid glands, the area of the lower eyelid glands, the height of the upper eyelid glands, the height of the lower eyelid glands, the width of the upper eyelid glands, the width of the lower eyelid glands, the circumference of the upper eyelid glands, the circumference of the lower eyelid glands, the curvature of the upper eyelid glands, the curvature of the lower eyelid glands, the density of the upper eyelid glands, and the density of the lower eyelid glands.
[0039] Optionally, the intelligent diagnostic module is specifically used for: inputting the glandular morphological feature parameters into an improved KNN algorithm model based on feature grouping and weighting; the improved KNN algorithm model weights the glandular morphological feature parameters using preset weight coefficients to obtain weighted glandular morphological features; dividing the weighted glandular morphological features into four feature groups—area, length, width, and structural density—based on the semantic relevance of glandular structure and function; classifying the glandular morphological feature samples within each feature group using a local mean KNN classification strategy to obtain classification results for each feature group; and weighting and fusing the classification results of each feature group using an information entropy-driven weight fusion mechanism to obtain the MGD grading diagnostic result.
[0040] Optionally, the step of using the Local Mean KNN classification strategy to classify and discriminate the glandular morphological feature test samples within each feature group to obtain the classification and discrimination results of each feature group includes: calculating the distance between the glandular morphological feature test samples and the training samples of each category in the feature subspace corresponding to each feature group, and selecting the K nearest neighbor training samples of each category to calculate the local mean vector of each category; based on the distance between the glandular morphological feature test samples and the local mean vectors of each category, determining the category to which the glandular morphological feature test samples belong, and obtaining the classification and discrimination results of each feature group.
[0041] Optionally, the step of using an information entropy-driven weighted fusion mechanism to weightedly fuse the classification results of each feature group to obtain the MGD hierarchical diagnosis result includes: comprehensively evaluating the classification results of each feature group using an information entropy-driven weighted fusion mechanism; calculating the conditional entropy of each feature group in each category of training samples; and assigning weights according to the entropy value, wherein the feature group with the smaller entropy value has a larger weight, and the feature group with the larger entropy value has a smaller weight; and weighting and accumulating the classification results of each feature group according to the weights assigned to each feature group to fuse and obtain the MGD hierarchical diagnosis result.
[0042] Optionally, the MGD grading diagnosis result is one of normal, mild MGD, moderate MGD, or severe MGD.
[0043] Optionally, the system further includes a visualization module for visually displaying the MGD grading diagnosis results, the original grayscale MGD eye image, the binary mask representing the glandular region, and the index values of the extracted glandular morphological feature parameters.
[0044] In summary, this invention constructs a complete system integrating image preprocessing, gland segmentation, feature extraction, and intelligent classification, realizing automatic hierarchical diagnosis of ophthalmic meibomian gland dysfunction and improving the objectivity, consistency, and accuracy of diagnosis.
[0045] Specifically, the system of the present invention is further described with reference to the following examples:
[0046] The following seven steps describe the overall process of the system of the present invention from image acquisition to diagnostic output.
[0047] Step 1: Image Acquisition and Cropping
[0048] like Figure 2 As shown, the subject's meibomian gland infrared image, i.e., the original grayscale MGD eye image, is first obtained through an ocular surface analyzer or infrared camera.
[0049] Preferably, one image of the meibomian glands is acquired from the upper eyelid and one from the lower eyelid for each subject (an infrared image of the upper meibomian gland and an infrared image of the lower meibomian gland), ensuring that the images are clear, unobstructed, and have low glare interference. The acquired raw images are preprocessed: for example, the images are uniformly adjusted to a fixed resolution (e.g., 512×512 pixels) to eliminate size differences introduced by different devices or shooting distances, and the pixel grayscale is linearly normalized (e.g., the grayscale values are scaled to the [0,1] range) to improve the stability and comparability of subsequent algorithms. If necessary, the raw images can also be cropped to remove excess peripheral eyelid areas, ensuring that the remaining effective area precisely includes the meibomian gland distribution area, providing a focused field of view for subsequent analysis.
[0050] Step 2, U-Net segmentation:
[0051] The preprocessed MGD eye image is input into the gland segmentation model for further processing. In this embodiment, the U-Net deep convolutional neural network model is used to automatically segment the meibomian gland region.
[0052] The U-Net model, with its encoder-decoder symmetric structure, excels at detecting target regions in medical images. By training the U-Net model using training data labeled with glandular regions, it learns to identify the morphology of meibomian glands from complex eye backgrounds. The trained U-Net model performs pixel-by-pixel classification on input upper or lower eyelid images, outputting a probability map of the same size as the input, representing the probability that each pixel belongs to "gland" or "non-gland." Applying a threshold (e.g., 0.5) to this probability map yields a binarized segmentation result. Ultimately, this invention achieves the following... Figure 3 The binary mask for meibomian glands shown. Figure 3 It contains the original grayscale MGD eye image, i.e., the meibomian gland infrared image. Figure 3 The upper and middle half) and the binary mask representing the glandular region obtained through the U-Net convolutional neural network model, namely the meibomian gland binary mask ( Figure 3 (lower half) Figure 3 In the lower half of the binary mask for meibomian glands, the white area represents the identified gland area, and the black area is the background. This mask accurately depicts the distribution and basic shape of the meibomian glands, laying the foundation for subsequent feature extraction.
[0053] Step 3, CLAHE enhancement and masking:
[0054] To further highlight the glandular structure, this invention performs image enhancement and cleanup on the segmented glandular regions. For example... Figure 2 As shown in the flowchart, the binary mask obtained in step 2 is first applied to the original grayscale MGD eye image. That is, the pixels in the original image corresponding to the glands in the mask are retained, while the pixels in non-glandular areas are set to zero. The resulting image only contains the grayscale information of the meibomian glands themselves, while the background is removed.
[0055] Next, the extracted glandular region grayscale image is enhanced for contrast using the CLAHE algorithm. CLAHE (Contrast-Limited Adaptive Histogram Equalization) can improve image contrast locally while limiting noise caused by over-enhancement. By adjusting parameters such as the pruning threshold of CLAHE, the texture and edges of the glandular region can be made more apparent, which is beneficial for accurately calculating glandular morphological indicators.
[0056] After enhancement processing, binarization (threshold segmentation) is performed on the resulting contrast-enhanced grayscale image of the gland region: an empirical threshold is selected (e.g., pixel intensity value 127 or adaptively determined according to histogram distribution), pixels above the threshold are set to white (glands), and pixels below the threshold are set to black.
[0057] After the above steps, a "purified" binary image of the gland is obtained, which essentially removes background noise and weak reactive areas, retaining only a clear and coherent gland structure. This result provides a reliable basis for quantitative analysis.
[0058] Step 4, Feature Extraction:
[0059] After obtaining a clear binary map of the glands, this invention extracts multi-dimensional morphological feature parameters of the glands to quantitatively describe the pathological changes of MGD.
[0060] Specifically, for each binary image of glands in the upper or lower eyelid, all independent connected regions of glands are first identified (a unique label is assigned to each gland using a connected component analysis algorithm). Then, the following morphological parameters are calculated for each gland region: gland area (represented by the number of pixels), gland height (the maximum length of the gland in the vertical direction, i.e., the height H of its bounding box), gland width (calculated by dividing the gland area by the height, approximately reflecting the average lateral thickness W of the gland), gland perimeter (the pixel length P along the edge of the gland, which can be calculated with sub-pixel precision to obtain a more accurate value), and gland curvature (defined as the ratio of the gland's half-perimeter to its height, i.e., P / 2H, e.g., ...). Figure 4 (As shown in the diagram, used to quantify the curvature of the gland).
[0061] To avoid the influence of small noise areas on statistics, a minimum area threshold (e.g., 20 pixels) can be set to filter out excessively small pseudo-glandular regions. The above parameters of all glands in an eyelid image are averaged to obtain the average area, average height, average width, average perimeter, and average curvature of the eyelid. These average morphological parameters can represent the overall condition of the eyelid glands.
[0062] Furthermore, this invention also calculates a gland density index, which is the proportion of the total area of gland pixels to the entire meibomian gland analysis area, to reflect the overall coverage of the glands. Feature values for the upper and lower eyelids are calculated separately in a similar manner, resulting in a feature vector containing six features for each eye. Combining the upper and lower eyelids forms a 12-dimensional structured feature descriptor, i.e., multi-dimensional gland morphological feature parameters. These features comprehensively reflect the structural changes of the meibomian glands during MGD lesions: for example, gland area and density gradually decrease as MGD progresses from mild to severe, indicating increased glandular atrophy and loss; gland height and width also tend to decrease, while gland curvature may increase in the early stages of MGD (the glands become more curved). These objective indicators are consistent with clinical observations of glandular changes.
[0063] Step 5, PLMKNN classification:
[0064] The upper and lower meibomian gland features obtained in step 4 are combined to form a complete feature set, which is then input into the intelligent diagnosis module. The classification algorithm of this invention is an improvement on KNN, abbreviated as PLMKNN (Local Mean KNN based on feature grouping weighting).
[0065] First, the input feature vector, i.e., the gland morphology feature parameters, is standardized, and each dimension of the feature is weighted according to a predetermined weight to highlight the role of key features. For example, features such as area and density can be assigned larger weight coefficients based on their ability to distinguish different MGD levels in the training samples.
[0066] Then, based on the semantic relevance of gland features, the feature vectors are divided into four subsets (i.e., area group, length group, width group, and structural density group, as described above).
[0067] During classification, for each feature group, the following local mean KNN discrimination process is performed: calculate the distance between the sample to be diagnosed and each class of samples in the training set in the feature subspace of this group; for each class, find the K nearest neighbor samples (K is a positive integer, for example, K = 5 or 7) in this class; calculate the feature mean of these K neighbor samples in this feature group to obtain the local mean vector representing this class.
[0068] Next, the distance between the test sample and the local mean vector of each category is calculated. The smaller the distance, the closer the test sample is to the category in that feature group.
[0069] Therefore, each feature group will provide a preliminary classification judgment for the sample to be tested (such as the confidence level or voting result of belonging to a certain MGD level).
[0070] Step 6, Feature Group Weighting Mechanism:
[0071] Considering that different feature groups may contribute differently to MGD classification, this invention introduces an information entropy-driven group-level weight fusion mechanism to integrate the judgment results of each group.
[0072] Specifically, the category conditional entropy of each feature group is pre-calculated based on the training data: a low entropy value indicates that the distribution of the features in this group differs significantly across different MGD levels, indicating high discriminative information; a high entropy value indicates that the features in this group contribute limitedly to the distinction level. The entropy values of each group are normalized and their reciprocals are taken to obtain the weighting factors for each feature group. During classification decisions, the results within each group are merged using weighted voting or weighted summation.
[0073] In other words, for a given sample, classification results from feature groups with strong discriminative power (low entropy) will carry greater weight in the final decision, while results from groups with weak discriminative power (high entropy) will have relatively smaller weights. This weighted fusion maximizes the informational value of effective features, reduces the impact of individual differences and noise, and improves the accuracy and robustness of the final MGD diagnosis.
[0074] Step 7, System Output:
[0075] Finally, this invention outputs the fused MGD grading diagnostic results and generates a corresponding visualization interface through a visualization module for clinical use.
[0076] The diagnostic results include the severity level of MGD in the input image, such as outputting level information like "normal (no obvious MGD)", "mild MGD", "moderate MGD" or "severe MGD".
[0077] The system of this invention can also overlay and display the gland segmentation results with the original grayscale MGD eye image through a visualization module (e.g., Figure 3 The interface (shown as an example) allows physicians to visually view the glandular regions and morphology identified by the algorithm. Simultaneously, it displays the extracted quantitative feature parameter values, i.e., glandular morphological feature parameters, enhancing the interpretability of the results. For example, the interface can list indicators such as upper eyelid gland density and curvature, along with their comparisons to normal ranges.
[0078] Through the above methods, the ophthalmic MGD intelligent diagnosis and treatment system based on the improved KNN algorithm constructed in this invention not only provides automated and objective grading results, but also provides auxiliary decision support for clinicians. Physicians can more accurately assess the severity of the disease based on the MGD level and characteristic changes provided by the system, thereby developing personalized treatment plans and interventions.
[0079] In addition, the system of the present invention also includes an efficacy evaluation module, which can quantitatively compare the glandular characteristics of patients before and after treatment, help evaluate the treatment effect, and verify the reliability of the efficacy.
[0080] In summary, this invention combines the advantages of medical image processing and artificial intelligence algorithms to achieve intelligent diagnosis of meibomian gland dysfunction, thereby improving the objectivity, consistency, and accuracy of the diagnosis.
[0081] Specific embodiments of the invention have now been described. Other embodiments are within the scope of the appended claims. In some cases, the actions described in the claims can be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing can be advantageous.
[0082] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the patent protection scope of the embodiments of the present invention should be defined by the claims.
Claims
1. An intelligent ophthalmic MGD diagnosis and treatment system based on an improved KNN algorithm, characterized in that, include: The image acquisition and preprocessing module is used to acquire the original grayscale MGD eye image and perform preprocessing to obtain the preprocessed MGD eye image; The gland region segmentation module is used to segment the meibomian gland region of the preprocessed MGD eye image using a U-Net convolutional neural network model to obtain a binary mask representing the gland region. The image enhancement and masking module is used to extract pixels of the gland region from the original grayscale MGD eye image using the binary mask, generate a grayscale image of the gland region, and perform contrast enhancement processing on the grayscale image of the gland region using the CLAHE algorithm. The contrast-enhanced grayscale image of the gland region is then segmented by thresholding to obtain a binary image of the gland. The feature extraction module is used to extract morphological feature parameters of the glands based on the binary image of the glands; The intelligent diagnostic module is used to input the gland morphological feature parameters into an improved KNN algorithm model based on feature grouping and weighting for classification operations, and output MGD grading diagnostic results. Specifically, it is used for: The gland morphological feature parameters are input into an improved KNN algorithm model based on feature grouping and weighting; The improved KNN algorithm model weights the gland morphological feature parameters using preset weight coefficients to obtain weighted gland morphological features. Based on the semantic correlation between gland structure and function, the weighted morphological features of glands are divided into four feature groups: area, length, width, and structural density. The local mean KNN classification strategy was used to classify and discriminate the gland morphology features of the test samples within each feature group, and the classification results of each feature group were obtained. The classification results of each feature group are weighted and fused using an information entropy-driven weight fusion mechanism to obtain the MGD hierarchical diagnosis result.
2. The system according to claim 1, characterized in that, The image acquisition and preprocessing module is specifically used for: The meibomian gland infrared image is obtained by an ocular surface analyzer or an infrared camera as the original grayscale MGD ocular image, and the meibomian gland infrared image includes an upper meibomian gland infrared image and a lower meibomian gland infrared image; The original grayscale MGD eye image is resized and normalized to obtain the preprocessed MGD eye image, which includes a preprocessed upper meibomian gland infrared image and a preprocessed lower meibomian gland infrared image.
3. The system according to claim 2, characterized in that, The gland region segmentation module is specifically used for: A pre-trained U-Net convolutional neural network model was used to segment the meibomian gland region in the preprocessed infrared images of the upper and lower meibomian glands, respectively, to obtain upper and lower meibomian gland masks as binary masks representing the gland regions.
4. The system according to claim 1, characterized in that, In the image enhancement and masking module, threshold segmentation is performed on the contrast-enhanced grayscale image of the gland region to obtain a binary image of the gland, including: Set an experience threshold; In the contrast-enhanced grayscale image of the gland region, pixels above the empirical threshold are set to white to represent glands; In the contrast-enhanced grayscale image of the gland region, pixels below the empirical threshold are set to black to represent non-glandular areas. The gland binary image is generated based on white and black pixels, and the gland binary image includes a gland binary image of the upper eyelid and a gland binary image of the lower eyelid.
5. The system according to claim 1, characterized in that, The gland morphological feature parameters comprise 12 dimensions, including gland area, gland height, gland width, gland circumference, gland curvature, and gland density for the upper and lower eyelids. Glandular height is the length of the gland along the vertical direction, gland width is characterized by the ratio of gland area to height, gland curvature is characterized by the ratio of gland circumference to gland height, and gland density is the proportion of the pixel area of the gland region to the effective area of the meibomian gland.
6. The system according to claim 1, characterized in that, The local mean KNN classification strategy is used to classify and discriminate the glandular morphological features of the test samples within each feature group, and the classification results of each feature group are obtained, including: In the feature subspace corresponding to each feature group, the distance between the test sample of gland morphology features and the training samples of each category is calculated, and the local mean vector of each category is calculated by selecting the K nearest neighbor training samples of each category. Based on the distance between the test sample of the gland morphology features and the local mean vector of each category, the category to which the test sample of the gland morphology features belongs is determined, and the classification results of each feature group are obtained.
7. The system according to claim 1, characterized in that, The weighted fusion mechanism driven by information entropy is used to weight and fuse the classification results of each feature group to obtain the MGD hierarchical diagnosis result, including: The classification results of each feature group are comprehensively evaluated using an information entropy-driven weight fusion mechanism. The conditional entropy of each feature group in each category of training samples is calculated, and weights are assigned according to the entropy value. The feature group with the smaller entropy value has a larger weight, and the feature group with the larger entropy value has a smaller weight. The classification results of each feature group are weighted and accumulated according to the weights assigned to each feature group to obtain the MGD grading diagnosis result.
8. The system according to claim 1, characterized in that, The MGD grading diagnosis result is one of the following: normal, mild MGD, moderate MGD, or severe MGD.
9. The system according to claim 1, characterized in that, The system also includes: The visualization module is used to visually display the MGD grading diagnosis results, the original grayscale MGD eye image, the binary mask representing the glandular region, and the index values of the extracted glandular morphological feature parameters.