Generation method of dual-order optimization self-adaptive sugar mesh screening model and lesion recognition equipment
Through the two-stage optimization adaptive diabetic retinopathy screening model, combined with medical knowledge graph and comprehensive evaluation method, the lesion type and feature weight are dynamically adjusted, which solves the shortcomings of traditional models in lesion feature recognition accuracy and adaptability, and improves the recognition accuracy of early lesions and the reliability of diagnosis.
Patent Information
- Application Number
- CN202510739092.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-16
AI Technical Summary
Existing diabetic retinopathy screening models have deficiencies in lesion feature recognition accuracy and adaptive adjustment capabilities, especially in early-stage lesions, which are prone to missed or misdiagnosis. They also lack multi-dimensional performance measurement standards, resulting in insufficient diagnostic efficiency and accuracy.
A two-stage optimized adaptive diabetic retinopathy screening model is adopted. By collecting fundus images and medical records of multiple samples, annotating them in combination with the medical knowledge graph, dynamically adjusting the weights of lesion types and features, and constructing a composite loss function, the model performance is comprehensively evaluated, including category consistency, feature deviation and logical consistency, to screen out the model with the highest comprehensive score.
It improves the accuracy of identifying early lesions, reduces the missed diagnosis rate, ensures that the model prediction results are consistent with clinical logic, provides a quantitative evaluation system for comprehensively measuring model performance, and improves the reliability and consistency of diagnosis.
Smart Images

Figure CN120656688A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of diabetic retinopathy screening, and specifically to a method for generating a dual-stage optimized adaptive diabetic retinopathy screening model and a lesion identification device. Background Art
[0002] Diabetic retinopathy (DR) is a common and serious complication of diabetes and a leading cause of blindness in adults. Early and accurate diagnosis of DRD is crucial for timely intervention and treatment to prevent irreversible vision loss. Currently, clinical diagnosis of DRD relies primarily on fundus imaging by professional ophthalmologists, but this method has many limitations.
[0003] On the one hand, the diagnosis of diabetic retinopathy requires extensive professional knowledge and clinical experience. Professional ophthalmologists are scarce, making it difficult for patients in resource-poor areas to obtain a timely and accurate diagnosis. On the other hand, manual diagnosis is inefficient and cannot meet the needs of large-scale diabetic patient screening. Furthermore, manual diagnosis is subject to subjectivity, and different doctors may produce different diagnostic results for the same fundus image, impacting diagnostic accuracy and consistency.
[0004] With the development of artificial intelligence technology, diabetic retinopathy screening models based on machine learning and deep learning have emerged. Although traditional single-stage diabetic retinopathy screening models have improved diagnostic efficiency to a certain extent, they still have many shortcomings: some models have low recognition accuracy for lesion characteristics such as microaneurysms and bleeding spots, especially in the early stages of lesions or when lesion characteristics are not obvious, which can easily lead to missed diagnoses or misdiagnoses; moreover, these models often lack adaptive adjustment capabilities and cannot perform two-stage optimization and adaptive adjustment of the weights of lesion types and lesion characteristics; in addition, the evaluation criteria of a single model are relatively simple, and it is impossible to comprehensively and accurately measure the model's performance in lesion location detection, area measurement, and other aspects, resulting in a lack of targeted model optimization.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0006] The purpose of the present invention is to provide a method for generating a dual-stage optimized adaptive diabetic retinopathy screening model and a lesion identification device to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for generating a dual-stage optimized adaptive diabetic retinopathy screening model, comprising the following steps:
[0009] S1. Collect fundus images of various samples, including patients without diabetic retinopathy and patients with varying degrees of diabetic retinopathy, and collect medical records of the patients corresponding to each fundus image;
[0010] S2. Normalize the fundus images and medical record data. Based on the logical rules of the medical knowledge graph, annotate the normalized fundus images and standardized medical record data. The annotations include lesion type and lesion characteristics. Lesion characteristics include the location and area of microaneurysms and the location and area of bleeding points.
[0011] S3. Divide the samples into a training set, a validation set, and a test set in proportion. Use the fundus images and medical records of the samples in the training set as input features and the corresponding annotations as output labels to construct a training dataset. Traverse each preset machine learning detection model in the database and train the machine learning detection model using the training dataset. During the training process, use a similarity measurement method to calculate the matching value between the model prediction results and the annotation content of the samples in the training set. Combine the matching value with the basic loss function to construct a composite loss function. At the same time, dynamically adjust the weight coefficients of lesion type and lesion characteristics based on the real-time matching degree during training to achieve two-stage optimization and adaptive adjustment of model parameters.
[0012] S4. Input the fundus images and medical record data of the validation set into each trained machine learning detection model, calculate the category consistency coefficient between the lesion type predicted by each model and the lesion type annotated by the samples in the validation set, calculate the feature deviation coefficient between the lesion characteristics predicted by each model and the lesion characteristics annotated by the corresponding samples, retrieve relevant logical rules in the medical knowledge graph based on the lesion type and lesion characteristics predicted by the model, calculate the logical consistency coefficient between the model prediction results and the logical rules, obtain a comprehensive scoring coefficient by weighted calculation of the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient, compare the comprehensive scoring coefficient of each model with a preset threshold, and sort the comprehensive scoring coefficients of each model from high to low, screening out the top three machine learning detection models with the top comprehensive scoring coefficients as candidate models;
[0013] S5. Input the fundus images and medical record data of the test set into the screened candidate model, calculate the comprehensive scoring coefficient of the model on the test set, and determine the candidate model with the highest comprehensive scoring coefficient as the two-stage optimized adaptive diabetic retinopathy screening model.
[0014] Furthermore, the medical record data include age, duration of medical history, fasting blood glucose value, blood glucose value 2 hours after meal, and glycosylated hemoglobin value, and the lesion types include no lesion, mild, moderate, severe, and proliferative lesions.
[0015] Furthermore, the similarity measurement method is used to calculate the matching degree between the model prediction results and the annotation content of the training set samples. The specific process is as follows:
[0016] Calculate the similarity of lesion types and use the inverse of the cross entropy loss value as the similarity. The smaller the cross entropy loss value, the higher the similarity. The formula is as follows:
[0017] SIM class =exp(-CE)
[0018]
[0019] Among them, SIM class is the similarity between the model prediction value and the actual value for the lesion type of the samples in the training set, CE is the cross entropy loss value, and p f For a sample in the training set, the model predicts the probability of it being the fth lesion type, q f is the unique hot encoding of the sample belonging to the fth lesion type. If the annotation content of the sample is the fth lesion type, then q f =1, otherwise, q f = 0, f is the index of the lesion type, f∈[1,5], 1, 2,…, 5 correspond to no lesion, mild, moderate, severe, and proliferative lesions, respectively;
[0020] The similarity of lesion features is calculated based on the following formula:
[0021]
[0022] Among them, SIM num is the similarity between the model prediction value and the actual value for the lesion characteristics of the samples in the training set. The lesion characteristic model prediction value refers to the lesion characteristic output by the model, and the lesion characteristic actual value refers to the lesion characteristic of the sample in the training set. d is the Euclidean distance between the model prediction value and the actual value for the lesion characteristic of the samples in the training set. ζ is the weight coefficient of the Euclidean distance, ζ∈[0.1,1]. For a sample in the training set, the model predicts the rth lesion feature value, R r is the actual value of the rth lesion feature of the sample, r is the index of the lesion feature, r∈[1,4], 1, 2, …, 4 correspond to the location of microaneurysm, the area of microaneurysm, the location of bleeding point and the area of bleeding point respectively;
[0023] SIM=η1SIM class +η2SIM num
[0024] Among them, SIM is the matching value;
[0025] Where η1 is the weight coefficient of lesion type similarity, η2 is the weight coefficient of lesion feature similarity, and on the basis of η1+η2=1, let 0<η2<η1<1.
[0026] Furthermore, the weights of lesion types and lesion features are dynamically adjusted based on the real-time matching degree during training. The specific process is as follows:
[0027] During model training, when the accuracy of the model in classifying lesion types is lower than a first preset threshold, and the accuracy of the model in identifying lesion features is lower than a second preset threshold, the weight coefficient η1 of the lesion type similarity and the weight coefficient η2 of the lesion feature similarity remain unchanged;
[0028] When the accuracy of the model in classifying lesion types is lower than the first preset threshold, and the accuracy of the model in identifying lesion features is higher than the second preset threshold, the weight coefficient η1 of the lesion type similarity is increased, and the weight coefficient η2 of the lesion feature similarity is reduced, but η1+η2=1 is always ensured;
[0029] When the accuracy of the model in classifying lesion types is higher than a first preset threshold, and the accuracy of the model in identifying lesion features is lower than a second preset threshold, the weight coefficient η1 of the lesion type similarity is reduced, and the weight coefficient η2 of the lesion feature similarity is increased, but η1+η2=1 is always ensured;
[0030] When the accuracy of the model in classifying lesion types is higher than the first preset threshold and the accuracy of lesion feature recognition is higher than the second preset threshold, the weight coefficient η1 of lesion type similarity and the weight coefficient η2 of lesion feature similarity are kept unchanged.
[0031] Furthermore, the matching value and the basic loss function are combined to construct a composite loss function. The specific process is as follows:
[0032] JCS base =JCS class +JCS num
[0033] JCS class =CE
[0034]
[0035] Among them, JCS base is the basic loss function, JCS class is the cross entropy loss function, JCS num is the deviation between the model prediction value and the actual value;
[0036] JCS comp =JCS base +λ×(1-SIM)
[0037] Among them, JCS comp is the composite loss function;
[0038] Where λ is the penalty coefficient, λ∈[0.1,1], (1-SIM) is the penalty term;
[0039] For the lesion types and lesion features of the samples in the training set, when the model prediction value and the actual value completely match, SIM = 1 and the penalty term = 0.
[0040] Furthermore, the category consistency coefficient between the lesion type predicted by each model and the lesion type annotated by the corresponding sample in the validation set was calculated according to the following formula:
[0041]
[0042] Among them, κ l is the category consistency coefficient between the true value and the predicted value of the lth model for the lesion type of the samples in the validation set;
[0043] Where, is the actual consistency mean of the lth model, is the expected consistency mean of the lth model, For the samples in the validation set, the true value and the predicted value of the lth model are both the number of the fth type of lesions. For the samples in the validation set, the number of lesion types predicted by the lth model is the fth type, is the sample in the validation set, the true value is the number of lesion types of type f, l is the index of the machine learning detection model, and O is the total number of samples in the validation set.
[0044] Furthermore, the characteristic deviation coefficient between the lesion features predicted by each model and the lesion features annotated by the corresponding validation set samples was calculated according to the following formula:
[0045]
[0046] in, is the relative difference between the true value and the lth model predicted value for the σth microaneurysm position in the validation set, x is the horizontal and vertical coordinates of the position of the σth microaneurysm predicted by the lth model, σ,w1 、y σ,w1 For the validation set samples, the horizontal and vertical coordinates of the actual position of the σth microaneurysm, σ is the index of the microaneurysm, σ∈[1,m], m is the number of microaneurysms;
[0047]
[0048] in, is the relative difference between the true value and the lth model predicted value for the μth bleeding point position in the validation set, x is the horizontal and vertical coordinates of the μth bleeding point position predicted by the lth model, μ,cx1 、y μ,cx1 For the sample in the validation set, the horizontal and vertical coordinates of the actual μth bleeding point position, μ is the index of the bleeding point, μ∈[1,h], h is the number of bleeding points;
[0049]
[0050] in, is the relative difference between the true value and the lth model predicted value of the σth microaneurysm area in the validation set, S σ,w1 For the validation set samples, the actual area of the σth microaneurysm is, is the area of the σth microaneurysm predicted by the lth model;
[0051]
[0052] in, S is the relative difference between the true value and the lth model predicted value of the μth bleeding point area in the validation set. μ,cx1 For the sample in the validation set, the actual area of the μth bleeding point, is the μth bleeding point area predicted by the lth model;
[0053]
[0054] Among them, PDI l is the characteristic deviation coefficient between the true value and the predicted value of the lth model for the lesion feature of the samples in the validation set;
[0055] In the formula, α1 is the weight coefficient of the relative difference in the position of microaneurysm, α2 is the weight coefficient of the relative difference in the area of microaneurysm, α3 is the weight coefficient of the relative difference in the position of bleeding points, and α4 is the weight coefficient of the relative difference in the area of bleeding points. On the basis of α1+α2+α3+α4=1, let 0<α2<α4<α1<α3<1.
[0056] Furthermore, the logical consistency coefficient between the model prediction results and the logical rules is calculated. The specific steps are as follows:
[0057] Based on the logical rules of medical knowledge, a mapping relationship between fundus images, lesion areas, lesion types and lesion characteristics is established. Based on this mapping relationship, a medical knowledge graph of diabetic retinopathy is formed. For each sample in the validation set, it is judged whether the lesion type prediction value and lesion feature prediction value output by the model meet the above mapping relationship. After counting the number of samples that meet the mapping relationship, the ratio of the number to the total number of samples in the validation set is used as the logical consistency coefficient of the machine learning detection model.
[0058] Furthermore, the comprehensive scoring coefficient is obtained by weighting the category consistency coefficient, feature deviation coefficient and logical consistency coefficient according to the following formula:
[0059] ZP l =β1·κ l -β2·PDI l +β3·Cl l
[0060] Among them, ZPxs l is the comprehensive scoring coefficient of the lth model;
[0061] Where, CL l is the logical consistency coefficient of the lth machine learning detection model;
[0062] β1, β2, and β3 are the weight coefficients of the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient, respectively, and the specific values of β1, β2, and β3 are determined by the hierarchical analysis method.
[0063] A lesion identification device includes a model generated by any of the above-mentioned two-stage optimization adaptive diabetic retinopathy screening methods.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] This invention dynamically adjusts the weights of lesion types and lesion features through real-time matching values, solving the problem that traditional models cannot be adaptively optimized. In particular, it improves the missed diagnosis rate of early lesions. By combining basic loss and similarity measurement, it forces the model to learn the association between pathological features and types, reducing misdiagnosis caused by logical contradictions.
[0066] Breaking through the limitations of traditional single evaluation standards, the model is comprehensively evaluated from multiple dimensions such as the category consistency coefficient of lesion type, the characteristic deviation coefficient of lesion characteristics, and the logical consistency coefficient of logical rules. By comparing the calculated model output results with the preset threshold, a quantitative evaluation system is formed. This can not only comprehensively measure the model performance and solve the problem of insufficient feature recognition accuracy of traditional models, but also ensure that the prediction is in line with clinical logic and improve the reliability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 Schematic diagram of the overall method of the present invention. DETAILED DESCRIPTION
[0068] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to specific embodiments.
[0069] It should be noted that, unless otherwise defined, the technical or scientific terms used in the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0070] Example 1:
[0071] See also Figure 1 , the present invention provides a technical solution:
[0072] A method for generating a dual-stage optimized adaptive diabetic retinopathy screening model, comprising the following steps:
[0073] S1. Collect fundus images of various samples, including patients without diabetic retinopathy and patients with varying degrees of diabetic retinopathy, and collect medical records of the patients corresponding to each fundus image;
[0074] Based on the above embodiment, the patient's medical history data includes age, duration of medical history, fasting blood glucose value, blood glucose value 2 hours after meal, and glycosylated hemoglobin value;
[0075] Based on the above embodiment, the fundus image can be obtained from any channel including a hospital ophthalmology database, a community health screening center, and a diabetes specialist clinic.
[0076] Based on the above embodiments, fundus images of different degrees of diabetic retinopathy include fundus images of mild non-proliferative diabetic retinopathy, moderate non-proliferative diabetic retinopathy, severe non-proliferative diabetic retinopathy, and proliferative diabetic retinopathy, and the lesion types include no lesion, mild, moderate, severe, and proliferative lesions.
[0077] Based on the above embodiment, the method for collecting the patient's age, medical history, fasting blood glucose level, 2-hour postprandial blood glucose level, and glycosylated hemoglobin level is as follows:
[0078] The patient's age is obtained by checking the patient's ID card, household registration booklet and other valid documents;
[0079] The duration of the patient's medical history can be determined by communicating with the patient or their family to understand the specific time when the patient was first diagnosed with diabetes. For patients who cannot accurately recall the date of diagnosis, a comprehensive assessment can be made based on the time when the patient first experienced diabetes-related symptoms and the first medical record, and the duration of the medical history can be accurately calculated to the month.
[0080] After fasting for more than 8 hours, blood samples are collected from patients in the morning using venous blood sampling. The glucose concentration in the blood samples is measured using laboratory testing methods such as the glucose oxidase method and the hexokinase method to obtain the patient's fasting blood glucose value;
[0081] Have the patient eat normally, and start timing from the first bite of food. Two hours later, a blood sample is collected from the vein, and the blood glucose concentration is measured using the same laboratory test method as the fasting blood glucose test.
[0082] The patient's venous blood is collected and the percentage of glycated hemoglobin in the total hemoglobin in the blood is determined using high-performance liquid chromatography or immunoturbidimetry. Glycated hemoglobin reflects the average blood sugar level in the past 2-3 months.
[0083] S2. Normalize the fundus images and medical record data. Based on the logical rules of the medical knowledge graph, annotate the normalized fundus images and standardized medical record data. The annotations include lesion type and lesion characteristics. Lesion characteristics include the location and area of microaneurysms and the location and area of bleeding points.
[0084] Based on the above embodiments, the lesion types include no lesion, mild, moderate, severe, and proliferative lesions, among which no diabetic retinopathy, mild non-proliferative diabetic retinopathy, moderate non-proliferative diabetic retinopathy, severe non-proliferative diabetic retinopathy, proliferative diabetic retinopathy and no lesion, mild, moderate, severe, and proliferative lesions correspond one to one.
[0085] On the basis of the above embodiment, the normalized fundus images and the standardized medical record data are annotated based on the logical rules of the medical knowledge graph. The specific method is as follows:
[0086] Data preprocessing: First, normalize the brightness and size of the fundus image, and then standardize the medical record data (such as blood sugar and medical history) into a unified format;
[0087] Image annotation: Using the lesion feature rules defined in the knowledge graph (such as microaneurysms being circular and having a specific color range), the lesion area in the image is automatically detected and the location and area of the microaneurysms and bleeding points are annotated;
[0088] Medical record annotation: Based on the association rules between diseases and indicators in the atlas (such as high blood sugar and diabetic retinopathy), risk factors (such as blood sugar level and disease course) are extracted from standardized medical records and the lesion type is annotated;
[0089] Cross-data association: Combine image lesion features and medical record risk factors to generate comprehensive annotation results through graph logic rules (e.g., "microangioma + hyperglycemia = early diabetic retinopathy");
[0090] Manual optimization: Manual review of complex or conflicting cases (such as no history of diabetes but with lesions), correction of annotations and update of atlas rules.
[0091] Based on the above embodiment, the method for obtaining the location and area of microaneurysms and the location and area of bleeding points is as follows:
[0092] On the retina of the fundus, microaneurysms appear as small red dots with clear boundaries. They are usually caused by damage to the endothelial cells of the retinal blood vessels, resulting in local bulging of the blood vessel walls. These microaneurysms may increase and grow in size as the disease progresses, and may leak blood or other fluids, thereby affecting the normal function of the retina and leading to problems such as decreased vision.
[0093] First, the input fundus image is divided into I×I grid units. The features of each unit are extracted through the convolutional neural network. After multi-layer convolution and pooling, the feature map is obtained. Each grid unit predicts B bounding boxes and confidence levels and category probabilities. The bounding box with high confidence and belonging to the microaneurysm category is selected, and its upper left corner coordinates (x1, y1) and lower right corner coordinates (x2, y2) are used to represent the position of the microaneurysm in the image. The horizontal and vertical coordinates (x w ,y w ),in,
[0094] The precise contour of the microaneurysm is marked to generate a binary mask image (the pixel value of the microaneurysm area is 1 and the background is 0) as the U-Net model training label. After the U-Net outputs the binary mask, the contour is obtained using the contour extraction algorithm. The mask image pixels are traversed to determine whether they are within the contour, and the number of pixels N1 is obtained by counting. According to the image pixel resolution, the formula Calculate the area of microaneurysm S w , where L represents the image pixel resolution.
[0095] Bleeding spots refer to the phenomenon of punctate hemorrhages with a diameter of less than 2 mm that appear on the surface of the skin or mucous membranes. In fundus examination, hemorrhage spots are also one of the common signs of eye diseases such as diabetic retinopathy and hypertensive retinopathy, which appear as small red dot-like hemorrhages on the retina.
[0096] Threshold segmentation is performed on the fundus image. The bleeding spots are separated from the background according to the grayscale difference between the bleeding spots and the background. Common threshold segmentation algorithms such as the Otsu algorithm can automatically determine the optimal threshold. Morphological operations are performed to remove small noise and protrusions at the edge of the bleeding spots by corrosion, and to fill the internal holes and connect the adjacent areas by expansion. Connected domain analysis is used to calculate the horizontal and vertical coordinates (x c ,y c ), the formula is Where (x i ,y i ) are the horizontal and vertical coordinates of each pixel in the connected area, n is the total number of pixels in the connected area, i is the index of the pixel in the connected area, and the centroid coordinates are the bleeding point location;
[0097] After determining the connected area of the bleeding point, count the number of pixels in the connected area and use the formula according to the pixel resolution of the image Calculate the area S of the bleeding point c , N2 is the number of pixels in the connected area.
[0098] S3. Divide the samples into a training set, a validation set, and a test set in proportion. Use the fundus images and medical records of the samples in the training set as input features and the corresponding annotations as output labels to construct a training dataset. Traverse each preset machine learning detection model in the database and train the machine learning detection model using the training dataset. During the training process, use a similarity measurement method to calculate the matching value between the model prediction results and the annotation content of the samples in the training set. Combine the matching value with the basic loss function to construct a composite loss function. At the same time, dynamically adjust the weight coefficients of lesion type and lesion characteristics based on the real-time matching degree during training to achieve two-stage optimization and adaptive adjustment of model parameters.
[0099] Based on the above embodiment, the similarity measurement method is used to calculate the matching degree between the model prediction result and the training set sample annotation content. The specific process is as follows:
[0100] Calculate the similarity of lesion types and use the inverse of the cross entropy loss value as the similarity. The smaller the cross entropy loss value, the higher the similarity. The formula is as follows:
[0101] SIM class =exp(-CE)
[0102]
[0103] Among them, SIM class is the similarity between the model prediction value and the actual value for the lesion type of the samples in the training set, CE is the cross entropy loss value, and p f For a sample in the training set, the model predicts the probability of it being the fth lesion type, q f is the unique hot encoding of the sample belonging to the fth lesion type. If the annotation content of the sample is the fth lesion type, then q f =1, otherwise, q f = 0, f is the index of the lesion type, f∈[1,5], 1, 2,…, 5 correspond to no lesion, mild, moderate, severe, and proliferative lesions, respectively;
[0104] The similarity of lesion features is calculated based on the following formula:
[0105]
[0106] Among them, SIM num is the similarity between the model prediction value and the actual value for the lesion characteristics of the samples in the training set. The lesion characteristic model prediction value refers to the lesion characteristic output by the model, and the lesion characteristic actual value refers to the lesion characteristic of the sample in the training set. d is the Euclidean distance between the model prediction value and the actual value for the lesion characteristic of the samples in the training set. ζ is the weight coefficient of the Euclidean distance, ζ∈[0.1,1]. For a sample in the training set, the model predicts the rth lesion feature value, R r is the actual value of the rth lesion feature of the sample, r is the index of the lesion feature, r∈[1,4], 1, 2, …, 4 correspond to the location of microaneurysm, the area of microaneurysm, the location of bleeding point and the area of bleeding point respectively;
[0107] In medical image analysis, differences in lesion features (such as location and area) need to maintain reasonable sensitivity. The lower limit of ζ is set to 0.1 to ensure that distance differences have a perceptible impact on similarity, and the model can effectively optimize feature prediction accuracy. The upper limit of ζ is set to 1 to prevent similarity from fluctuating dramatically due to distance amplification, which meets the clinical "tolerance" requirements for feature differences (such as allowing measurement errors within a certain range).
[0108] It is a hyperbolic function. When ζ∈[0.1,1], the similarity value is distributed in It can reflect the differences without being too sensitive.
[0109] SIM=η1SIM class +η2SIM num
[0110] Among them, SIM is the matching value, which is used to combine the two index parameters of lesion type similarity and lesion feature similarity to evaluate the matching degree between the model prediction results and the sample annotation content in the training set. The larger the matching value, the higher the matching degree between the model prediction results and the sample annotation content in the training set.
[0111] Where η1 is the weight coefficient of lesion type similarity, η2 is the weight coefficient of lesion feature similarity, and on the basis of η1+η2=1, let 0<η2<η1<1.
[0112] On this basis, it should be noted that:
[0113] The more consistent the model prediction is with the actual lesion type, the stronger the model's ability to identify the grade of retinal lesions is, and the higher the matching value is.
[0114] The closer the model prediction is to the actual lesion location and size, the more accurate the model's measurement of the lesion's physical characteristics is and the higher the matching value is.
[0115] Therefore, the higher the similarity, the stronger the consistency between the model prediction and the actual pathological features, the larger the matching value, and the better the model performance.
[0116] It can be seen that the model prediction results are positively correlated with the matching values of the sample annotation content in the training set, the similarity of lesion types, and the similarity of lesion characteristics.
[0117] In addition, lesion type and lesion characteristics are independent and complementary dimensions in the diagnosis of diabetic retinopathy. The type reflects the severity of the disease (such as "mild" vs. "proliferative"), and the characteristics reflect the specific physical properties (such as the location and area of the bleeding point). There is no direct causal relationship between the two, and the model performance needs to be comprehensively judged after independent evaluation.
[0118] In summary, a linear addition function is used to express the functional relationship between the model prediction results and the matching values of the sample annotation content in the training set and the similarity of the lesion type and the similarity of the lesion characteristics.
[0119] Where η1 is the weight coefficient of lesion type similarity, η2 is the weight coefficient of lesion feature similarity,
[0120] The type of lesion (such as microaneurysm and hemorrhage spots) directly corresponds to the pathological mechanism and clinical classification of the disease (such as diabetic retinopathy) and is the key label for distinguishing the types of diseases. Lesion characteristics (such as location and area) are used to describe the severity of the lesion or individual differences, but cannot independently define the type of disease. The lesion type is the "threshold" for disease classification, and feature similarity is the "degree description" under the same category. The former has a more critical impact on diagnosis and classification, so it has a higher weight. On the basis of η1+η2=1, let 0<η2<η1<1.
[0121] As an implementation manner, the value range of η1 is 0.5-1, and the value range of η2 is 0-0.5. The specific values are set by technical personnel according to actual conditions and are not limited here.
[0122] On the basis of the above embodiment, the weights of lesion type and lesion feature are dynamically adjusted according to the real-time matching degree during training. The specific process is as follows:
[0123] During model training, when the accuracy of the model in classifying lesion types is lower than a first preset threshold, and the accuracy of the model in identifying lesion features is lower than a second preset threshold, the weight coefficient η1 of the lesion type similarity and the weight coefficient η2 of the lesion feature similarity remain unchanged;
[0124] When the accuracy of the model in classifying lesion types is lower than the first preset threshold, and the accuracy of the model in identifying lesion features is higher than the second preset threshold, the weight coefficient η1 of the lesion type similarity is increased, and the weight coefficient η2 of the lesion feature similarity is reduced, but η1+η2=1 is always ensured;
[0125] When the accuracy of the model in classifying lesion types is higher than a first preset threshold, and the accuracy of the model in identifying lesion features is lower than a second preset threshold, the weight coefficient η1 of the lesion type similarity is reduced, and the weight coefficient η2 of the lesion feature similarity is increased, but η1+η2=1 is always ensured;
[0126] When the accuracy of the model in classifying lesion types is higher than the first preset threshold and the accuracy of lesion feature recognition is higher than the second preset threshold, the weight coefficient η1 of lesion type similarity and the weight coefficient η2 of lesion feature similarity are kept unchanged.
[0127] Based on the above embodiment, the matching value and the basic loss function are combined to construct a composite loss function. The specific process is as follows:
[0128] JCS base =JCS class +JCS num
[0129] JCS class =CE
[0130]
[0131] Among them, JCS base is the basic loss function, JCS class is the cross entropy loss function, JCS num is the deviation between the model prediction value and the actual value;
[0132] JCS comp =JCSbase +λ×(1-SIM)
[0133] Among them, JCS comp is the composite loss function;
[0134] Where λ is the penalty coefficient, λ∈[0.1,1], (1-SIM) is the penalty term;
[0135] When the lesion types and lesion characteristics of the samples in the training set are completely matched with the model prediction values and actual values, SIM = 1 and the penalty term = 0.
[0136] S4. Input the fundus images and medical record data of the validation set into each trained machine learning detection model, calculate the category consistency coefficient between the lesion type predicted by each model and the lesion type annotated by the samples in the validation set, calculate the feature deviation coefficient between the lesion characteristics predicted by each model and the lesion characteristics annotated by the corresponding samples, retrieve relevant logical rules in the medical knowledge graph based on the lesion type and lesion characteristics predicted by the model, calculate the logical consistency coefficient between the model prediction results and the logical rules, obtain a comprehensive scoring coefficient by weighted calculation of the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient, compare the comprehensive scoring coefficient of each model with a preset threshold, and sort the comprehensive scoring coefficients of each model from high to low, screening out the top three machine learning detection models with the top comprehensive scoring coefficients as candidate models;
[0137] Based on the above embodiment, the category consistency coefficient between the lesion type predicted by each model and the lesion type annotated by the samples in the corresponding validation set is calculated according to the following formula:
[0138]
[0139] Among them, κ l is the category consistency coefficient between the true value of the lesion type of the sample in the validation set and the predicted value of the lth model. The category consistency coefficient is used to combine the two proportional parameters of the actual consistency mean and the expected consistency mean to measure the degree of consistency between the true value of the lesion type of the sample in the validation set and the model predicted value. The larger the category consistency coefficient, the higher the degree of consistency between the lesion type predicted by the model and the sample in the validation set.
[0140] Where, is the actual consistency mean of the lth model, is the expected consistency mean of the lth model, For the samples in the validation set, the true value and the predicted value of the lth model are both the number of the fth type of lesions. For the samples in the validation set, the number of lesion types predicted by the lth model is the fth type, is the sample in the validation set, the true value is the number of lesion types of type f, l is the index of the machine learning detection model, and O is the total number of samples in the validation set.
[0141] Based on the above embodiment, the characteristic deviation coefficient between the lesion characteristics predicted by each model and the lesion characteristics annotated by the corresponding sample in the validation set is calculated according to the following formula:
[0142]
[0143] in, is the relative difference between the true value and the lth model predicted value for the σth microaneurysm position in the validation set, x is the horizontal and vertical coordinates of the position of the σth microaneurysm predicted by the lth model, σ,w1 、y σ,w1 For the validation set samples, the horizontal and vertical coordinates of the actual position of the σth microaneurysm, σ is the index of the microaneurysm, σ∈[1,m], m is the number of microaneurysms;
[0144]
[0145] in, is the relative difference between the true value and the lth model predicted value for the μth bleeding point position in the validation set, x is the horizontal and vertical coordinates of the μth bleeding point position predicted by the lth model, μ,cx1 、y μ,cx1 For the sample in the validation set, the horizontal and vertical coordinates of the actual μth bleeding point position, μ is the index of the bleeding point, μ∈[1,h], h is the number of bleeding points;
[0146]
[0147] in, is the relative difference between the true value and the lth model predicted value of the σth microaneurysm area in the validation set, S σ,w1 For the validation set samples, the actual area of the σth microaneurysm is, is the area of the σth microaneurysm predicted by the lth model;
[0148]
[0149] in, S is the relative difference between the true value and the lth model predicted value of the μth bleeding point area in the validation set. μ,cx1 For the sample in the validation set, the actual area of the μth bleeding point, is the μth bleeding point area predicted by the lth model;
[0150]
[0151] Among them, PDI l The characteristic deviation coefficient is the coefficient between the true value and the predicted value of the first model for the lesion characteristics of the samples in the validation set. The characteristic deviation coefficient is used to evaluate the predictive performance of the machine learning detection model by combining four indicator parameters: the relative difference in the location and area of microaneurysms, and the relative difference in the location and area of bleeding points. The smaller the characteristic deviation coefficient, the closer the model's prediction of the lesion location and area is to the true value of the samples in the validation set, and the better the performance.
[0152] On this basis, it should be noted that:
[0153] Relative difference in microaneurysm location The smaller the value, the closer the model's predicted microaneurysm location is to its actual location, indicating a stronger ability for the model to spatially localize the lesion and more accurately capture its location in the image. Therefore, in clinical applications, this high-precision localization helps doctors accurately identify lesions, reducing the risk of missed or misdiagnosed diagnoses, thereby reducing the feature deviation coefficient and improving model performance.
[0154] Relative difference in microaneurysm area The smaller the value, the closer the model's predicted microaneurysm area is to the true value, demonstrating that the model accurately measures lesion size. In practical applications, accurate area predictions help doctors assess disease progression and develop targeted treatment strategies. For example, if the model overestimates or underestimates microaneurysm area, it may lead to misdiagnosis. Therefore, the higher the area prediction accuracy and the lower the characteristic deviation coefficient, the better the model's performance in quantifying lesion characteristics.
[0155] Relative difference in bleeding point location The smaller the error, the more accurately the model can locate bleeding points, avoiding missing tiny lesions or misidentifying normal tissue as lesions. In clinical scenarios, accurate bleeding point location helps doctors quickly identify lesions and assess disease severity, thereby improving diagnostic efficiency and accuracy. Therefore, models with smaller position prediction errors also have lower characteristic deviation coefficients, resulting in better performance.
[0156] Relative difference in bleeding point area The smaller the area, the more accurate the model's prediction of the bleeding point area, providing doctors with reliable quantitative information about the lesion. For example, when monitoring treatment effectiveness, accurate area prediction can help determine whether the bleeding point is shrinking or expanding. Therefore, models with high area prediction accuracy have a smaller characteristic deviation coefficient in comprehensive evaluation, better meeting the accuracy and reliability requirements of clinical applications, and achieving better model performance.
[0157] Therefore, the relative difference in the location of microaneurysms, the relative difference in the area of microaneurysms, the relative difference in the location of bleeding points, and the relative difference in the area of bleeding points are all positively correlated with the characteristic deviation coefficient.
[0158] Since the prediction errors of the location and area of microaneurysms and the location and area of bleeding points can be regarded as independent random variables, there is no direct correlation between the model's positioning error (pixel level) of the microaneurysm and the area measurement error (percentage); the position deviation of the bleeding point and the area deviation of the microaneurysm do not affect each other. According to the error propagation law, if each error term is independent, the total error can be expressed as a linear combination of each sub-item error. The linear addition model quantifies the relative contribution of each error term through the weight coefficient, which conforms to the physical principle that "independent errors can be linearly superimposed."
[0159] In summary, the above linear addition summation formula is used to express the functional relationship between the characteristic deviation coefficient and the relative difference in microaneurysm position, the relative difference in microaneurysm area, the relative difference in bleeding point position, and the relative difference in bleeding point area.
[0160] Wherein, α1 is the weight coefficient of the relative difference in the position of microaneurysm, α2 is the weight coefficient of the relative difference in the area of microaneurysm, α3 is the weight coefficient of the relative difference in the position of bleeding points, and α4 is the weight coefficient of the relative difference in the area of bleeding points;
[0161] According to the priority of clinical needs, the weight coefficient ranking should follow the following principles:
[0162] Clinical urgency of lesion type: acute lesions (bleeding spots) > chronic lesions (microaneurysms);
[0163] Diagnostic priority of feature attributes: location (existence) > area (quantification);
[0164] Severity of error consequences: Position error may lead to missed diagnosis, misdiagnosis or delayed treatment, with more serious consequences; area error mainly affects assessment accuracy and can be compensated by dynamic monitoring.
[0165] Clinical urgency: Bleeding points are acute lesions that require rapid and accurate positioning to determine whether emergency intervention is needed. Positioning errors may lead to treatment delays or misoperation, directly threatening the patient's prognosis. Microaneurysms are chronic lesions, and positional errors have little impact on short-term diagnosis. They are more used for lesion distribution trend analysis and can be corrected through multiple reexaminations.
[0166] Diagnostic Priority: In clinical diagnosis, doctors typically prioritize identifying obvious acute lesions, such as bleeding points, before analyzing subtle chronic features, such as microaneurysms. While incorrect location of bleeding points can lead to a distorted diagnosis, incorrect location of microaneurysms has no direct impact on emergency treatment decisions.
[0167] In patients with acute retinal hemorrhage, the model's positioning accuracy of the bleeding point directly determines whether to initiate emergency surgery, and its weight must be significantly higher than the location of the microaneurysm, that is, α3>α1.
[0168] Diagnostic priority: Location is the basic characteristic of the lesion. The location distribution of microaneurysms can indicate the severity of the lesion. Positional errors can lead to errors in regional risk assessment. Area is more used to assist in judging the progression rate of the disease and is a secondary characteristic.
[0169] Difficulty in error processing: Microaneurysms are small in size and are easily affected by noise in images. Accurate positioning requires higher-resolution algorithms, and their position errors can better reflect the underlying feature extraction capabilities of the model. Area errors can be reduced through algorithm smoothing or statistical averaging.
[0170] Application scenario: In the early screening of diabetic retinopathy, the location density of microaneurysms is needed to determine whether the patient has entered the proliferative stage. At this time, the priority of location information is significantly higher than that of area, that is, α1>α2.
[0171] Clinical urgency: Changes in the area of bleeding spots directly reflect the progression of the disease or the effectiveness of treatment. Errors may lead to misjudgment of the disease transition, requiring higher accuracy. The area of microaneurysms is a static feature in most cases, and its error has limited impact on a single diagnosis, which can be compensated by long-term trend analysis.
[0172] Physician attention: Clinically, the need for quantification of bleeding spots is higher than for microaneurysms. For example, in monitoring hypertensive retinopathy, an increase in the size of bleeding spots is a direct indicator of worsening vascular damage, requiring a more precise quantification model. Therefore, a higher weight is assigned to this area, i.e., α4 > α2.
[0173] Microaneurysm location is a core indicator for early screening, and its weight reflects the model's ability to capture subtle lesions. Although the area of the bleeding point is important, its urgency is lower than the location of the bleeding point and higher than the area of the microaneurysm.
[0174] Clinical scenario: In the early screening of diabetic retinopathy, the stage of the disease needs to be determined by the location and density of microaneurysms. In this case, α1>α4.
[0175] Therefore, on the basis of α1+α2+α3+α4=1, let 0<α2<α4<α1<α3<1.
[0176] As an implementation manner, the value range of α1 is 0.3-0.4, the value range of α2 is 0-0.2, the value range of α3 is 0.4-1, and the value range of α4 is 0.2-0.3. The specific values are set by technicians according to actual conditions and are not limited here.
[0177] Based on the above embodiment, the logical consistency coefficient between the model prediction result and the logical rule is calculated. The specific steps are as follows:
[0178] Based on the logical rules of medical knowledge, a mapping relationship between fundus images, lesion areas, lesion types, and lesion characteristics is established. For example, the location of microaneurysms near the macular area indicates severe lesions, while the number of microaneurysms ≤ 5 and the total bleeding area < 2 indicates mild lesions.
[0179] Based on this mapping relationship, a medical knowledge graph of diabetic retinopathy is formed. For each sample in the validation set, it is determined whether the lesion type prediction value and lesion feature prediction value output by the model satisfy the above mapping relationship. After counting the number of samples that satisfy the mapping relationship, the ratio of the number to the total number of samples in the validation set is used as the logical consistency coefficient of the machine learning detection model.
[0180] On the basis of the above embodiment, the comprehensive scoring coefficient is obtained by weighted calculation of the category consistency coefficient, the feature deviation coefficient and the logical consistency coefficient, according to the following formula:
[0181] ZP l =β1·κ l -β2·PDI l +β3·CL l
[0182] Among them, ZPxs l is the comprehensive scoring coefficient of the first model. The comprehensive scoring coefficient is used to combine the three index parameters of category consistency coefficient, feature deviation coefficient, and logical consistency coefficient to evaluate the overall performance of the machine learning detection model in diabetic retinopathy detection. The larger the comprehensive scoring coefficient, the better the prediction accuracy, feature quantification accuracy, and medical logical consistency of the model.
[0183] Where, CL l is the logical consistency coefficient of the lth machine learning detection model;
[0184] On this basis, it should be noted that:
[0185] A higher category consistency coefficient indicates a higher degree of agreement between the model's lesion classification and the gold standard. This precise classification capability can directly reduce misdiagnosis rates (e.g., correctly distinguishing between proliferative and non-proliferative diabetic retinopathy). In clinical diagnosis, accurate category judgment is the foundation for subsequent feature analysis and logical verification. Therefore, high category consistency can significantly improve the overall predictive credibility of the model, thereby increasing the comprehensive score coefficient and reflecting the model's superior performance in lesion classification.
[0186] The smaller the feature deviation coefficient, the smaller the model's prediction error for quantitative features such as lesion location and area, and the deviation between its output result and the true value is controlled within a clinically acceptable range. The high-precision feature quantification capability provides doctors with a reliable diagnostic basis, reduces misjudgments of treatment plans due to data deviation, and thus positively affects the comprehensive scoring coefficient, reflecting the model's advantage in depicting detailed features.
[0187] The larger the logical consistency coefficient, the more consistent the model's prediction results are with the medical knowledge graph rules. This logical consistency ensures that the model output complies with clinical guidelines and pathological mechanisms, avoiding conclusions that violate medical common sense. High logical consistency enhances the model's interpretability and clinical trust, thereby driving an increase in the comprehensive score coefficient and highlighting the model's reliability at the medical reasoning level.
[0188] Therefore, the category consistency coefficient, logical consistency coefficient and comprehensive score coefficient are positively correlated, and the characteristic deviation coefficient and comprehensive score coefficient are negatively correlated.
[0189] Furthermore, the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient evaluate model performance from different dimensions, without a direct causal relationship between them. Category consistency focuses on the model's accuracy in determining lesion classification, the feature deviation coefficient focuses on the accuracy of predictions for quantitative features such as lesion location and area, and the logical consistency coefficient measures the degree of fit between the model's predictions and the rules of the medical knowledge graph. Like rays of light illuminating the model from different angles, each independently reflects a specific aspect of the model's characteristics and can therefore be linearly combined.
[0190] In summary, the linear addition and subtraction formula is used to express the functional relationship between the comprehensive scoring coefficient and the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient.
[0191] β1, β2, and β3 are weight coefficients of category consistency coefficient, feature deviation coefficient, and logical consistency coefficient, respectively. The specific values of β1, β2, and β3 are determined by the hierarchical analysis method. The specific logic is as follows:
[0192] The three indicators of category consistency coefficient, feature deviation coefficient and logical consistency coefficient are marked, and the relative importance between each two is determined by the nine-scale method to construct a judgment matrix, in which the index of category consistency coefficient is marked as 1, the index of feature deviation coefficient is marked as 2, and the index of logical consistency coefficient is marked as 3. The constructed judgment matrix [q ab ] 3×3 for:
[0193]
[0194] Among them, a and b are the indexes of the coefficients, and a∈[1,3], b∈[1,3], which means the importance of the coefficient with index a to the comprehensive score coefficient relative to the coefficient with index b, q ab The specific value of q is determined by relevant experts using a 1-9 scoring method. ab =9 means that the coefficient with index a is more important to the comprehensive score coefficient than the coefficient with index b. ab =1 means that the coefficient with index a is extremely unimportant to the overall score coefficient compared to the coefficient with index b;
[0195] Each element value in the judgment matrix is divided by the sum of its columns to obtain a normalized judgment matrix. The mean of the element values in each row of the normalized judgment matrix is calculated, and the mean of the element values in the first row is used as the proportional coefficient of the category consistency coefficient, the mean of the element values in the second row is used as the proportional coefficient of the feature deviation coefficient, and the mean of the element values in the third row is used as the proportional coefficient of the logical consistency coefficient. With the constraint that the sum of the scaled values is equal to 1, the three proportional coefficients are scaled equally, and the values obtained after scaling are used as the weights of the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient.
[0196] S5. Input the fundus images and medical record data of the test set into the screened candidate model, calculate the comprehensive scoring coefficient of the model on the test set, and determine the candidate model with the highest comprehensive scoring coefficient as the two-stage optimized adaptive diabetic retinopathy screening model.
[0197] Based on the above examples, the test set must be completely independent of the training set and validation set, contain fundus images that the model has not been exposed to, and cover different levels of diabetic retinopathy severity (such as mild / moderate / severe non-proliferative, proliferative);
[0198] Gold standard annotation is completed by senior ophthalmologists, including: lesion category (such as whether it is proliferative diabetic retinopathy); lesion characteristics (such as microaneurysm location and bleeding point area); and logical rule compliance (such as "whether the proliferative lesion is accompanied by neovascularization").
[0199] Input the selected candidate models into the test set and recalculate the category consistency coefficient, feature deviation coefficient, logical consistency coefficient, and comprehensive score coefficient;
[0200] The candidate model with the highest comprehensive score coefficient was determined as the two-stage optimized adaptive diabetic retinopathy screening model.
[0201] A lesion identification device includes a model generated by any of the above-mentioned two-stage optimization adaptive diabetic retinopathy screening methods.
[0202] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0203] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will appreciate that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by computer software, electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution.
[0204] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.
[0205] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A method for generating a dual-stage optimized adaptive diabetic retinopathy screening model, characterized by: The specific steps include: S1. Collect fundus images of various samples, including patients without diabetic retinopathy and patients with varying degrees of diabetic retinopathy, and collect medical records of the patients corresponding to each fundus image; S2. Normalize the fundus images and medical record data. Based on the logical rules of the medical knowledge graph, annotate the normalized fundus images and standardized medical record data. The annotations include lesion type and lesion characteristics. Lesion characteristics include the location and area of microaneurysms and the location and area of bleeding points. S3. Divide the samples into a training set, a validation set, and a test set in proportion. Use the fundus images and medical records of the samples in the training set as input features and the corresponding annotations as output labels to construct a training dataset. Traverse each preset machine learning detection model in the database and train the machine learning detection model using the training dataset. During the training process, use a similarity measurement method to calculate the matching value between the model prediction results and the annotation content of the samples in the training set. Combine the matching value with the basic loss function to construct a composite loss function. At the same time, dynamically adjust the weight coefficients of lesion type and lesion characteristics based on the real-time matching degree during training to achieve two-stage optimization and adaptive adjustment of model parameters. S4. Input the fundus images and medical record data of the validation set into each trained machine learning detection model, calculate the category consistency coefficient between the lesion type predicted by each model and the lesion type annotated by the samples in the validation set, calculate the feature deviation coefficient between the lesion characteristics predicted by each model and the lesion characteristics annotated by the corresponding samples, retrieve relevant logical rules in the medical knowledge graph based on the lesion type and lesion characteristics predicted by the model, calculate the logical consistency coefficient between the model prediction results and the logical rules, obtain a comprehensive scoring coefficient by weighted calculation of the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient, compare the comprehensive scoring coefficient of each model with a preset threshold, and sort the comprehensive scoring coefficients of each model from high to low, screening out the top three machine learning detection models with the top comprehensive scoring coefficients as candidate models; S5. Input the fundus images and medical record data of the test set into the screened candidate model, calculate the comprehensive scoring coefficient of the model on the test set, and determine the candidate model with the highest comprehensive scoring coefficient as the two-stage optimized adaptive diabetic retinopathy screening model.
2. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 1, characterized in that: Medical records included age, duration of medical history, fasting blood glucose level, 2-hour postprandial blood glucose level, and glycosylated hemoglobin level. Lesion types included no lesion, mild, moderate, severe, and proliferative lesions.
3. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 2, characterized in that: The similarity measurement method is used to calculate the degree of match between the model prediction results and the annotation content of the training set samples. The specific process is as follows: Calculate the similarity of lesion types and use the inverse of the cross entropy loss value as the similarity. The smaller the cross entropy loss value, the higher the similarity. The formula is as follows: card class =exp(-CE) Among them, SIM class is the similarity between the model prediction value and the actual value for the lesion type of the samples in the training set, CE is the cross entropy loss value, and p f For a sample in the training set, the model predicts the probability of it being the fth lesion type, q f is the unique hot encoding of the sample belonging to the fth lesion type. If the annotation content of the sample is the fth lesion type, then q f =1, otherwise, q f = 0, f is the index of the lesion type, f∈[1,5], 1, 2,…, 5 correspond to no lesion, mild, moderate, severe, and proliferative lesions, respectively; The similarity of lesion features is calculated based on the following formula: Among them, SIM num is the similarity between the model prediction value and the actual value for the lesion characteristics of the samples in the training set. The lesion characteristic model prediction value refers to the lesion characteristic output by the model, and the lesion characteristic actual value refers to the lesion characteristic of the sample in the training set. d is the Euclidean distance between the model prediction value and the actual value for the lesion characteristic of the samples in the training set. ζ is the weight coefficient of the Euclidean distance, ζ∈[0.1,1]. For a sample in the training set, the model predicts the rth lesion feature value, R r is the actual value of the rth lesion feature of the sample, r is the index of the lesion feature, r∈[1,4], 1, 2, …, 4 correspond to the location of microaneurysm, the area of microaneurysm, the location of bleeding point and the area of bleeding point respectively; SIM=η1SIM class +η2SIM num Among them, SIM is the matching value; Where η1 is the weight coefficient of lesion type similarity, η2 is the weight coefficient of lesion feature similarity, and on the basis of η1+η2=1, let 0<η2<η1<1.
4. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 3, characterized in that: According to the real-time matching degree during training, the weights of lesion type and lesion characteristics are dynamically adjusted. The specific process is as follows: During model training, when the accuracy of the model in classifying lesion types is lower than a first preset threshold, and the accuracy of the model in identifying lesion features is lower than a second preset threshold, the weight coefficient η1 of the lesion type similarity and the weight coefficient η2 of the lesion feature similarity remain unchanged; When the accuracy of the model in classifying lesion types is lower than the first preset threshold, and the accuracy of the model in identifying lesion features is higher than the second preset threshold, the weight coefficient η1 of the lesion type similarity is increased, and the weight coefficient η2 of the lesion feature similarity is reduced, but η1+η2=1 is always ensured; When the accuracy of the model in classifying lesion types is higher than a first preset threshold, and the accuracy of the model in identifying lesion features is lower than a second preset threshold, the weight coefficient η1 of the lesion type similarity is reduced, and the weight coefficient η2 of the lesion feature similarity is increased, but η1+η2=1 is always ensured; When the accuracy of the model in classifying lesion types is higher than the first preset threshold and the accuracy of lesion feature recognition is higher than the second preset threshold, the weight coefficient η1 of lesion type similarity and the weight coefficient η2 of lesion feature similarity are kept unchanged.
5. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 4, characterized in that: Combine the matching value and the basic loss function to construct a composite loss function. The specific process is as follows: JCS base =JCS class +JCS num JCS class =CE Among them, JCS base is the basic loss function, JCS class is the cross entropy loss function, JCS num is the deviation between the model prediction value and the actual value; JCS comp =JCS base +λ×(1-SIM) Among them, JCS comp is the composite loss function; Where λ is the penalty coefficient, λ∈[0.1,1], (1-SIM) is the penalty term; For the lesion types and lesion features of the samples in the training set, when the model prediction value and the actual value completely match, SIM = 1 and the penalty term = 0.
6. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 2, characterized in that: The category consistency coefficient between the lesion type predicted by each model and the lesion type annotated by the corresponding sample in the validation set was calculated according to the following formula: Among them, κ l is the category consistency coefficient between the true value and the predicted value of the lth model for the lesion type of the samples in the validation set; Where, is the actual consistency mean of the lth model, is the expected consistency mean of the lth model, For the samples in the validation set, the true value and the predicted value of the lth model are both the number of the fth type of lesions. For the samples in the validation set, the number of lesion types predicted by the lth model is the fth type, is the sample in the validation set, the true value is the number of lesion types of type f, l is the index of the machine learning detection model, and O is the total number of samples in the validation set.
7. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 6, characterized in that: The characteristic deviation coefficient between the lesion features predicted by each model and the lesion features annotated by the corresponding samples in the validation set was calculated according to the following formula: in, is the relative difference between the true value and the lth model predicted value for the σth microaneurysm position in the validation set, x is the horizontal and vertical coordinates of the position of the σth microaneurysm predicted by the lth model, σ,w1 、y σ,w1 For the validation set samples, the horizontal and vertical coordinates of the actual position of the σth microaneurysm, σ is the index of the microaneurysm, σ∈[1,m], m is the number of microaneurysms; in, is the relative difference between the true value and the lth model predicted value for the μth bleeding point position in the validation set, x is the horizontal and vertical coordinates of the μth bleeding point position predicted by the lth model, μ,cx1 、y μ,cx1 For the sample in the validation set, the horizontal and vertical coordinates of the actual μth bleeding point position, μ is the index of the bleeding point, μ∈[1,h], h is the number of bleeding points; in, is the relative difference between the true value and the lth model predicted value of the σth microaneurysm area in the validation set, S σ,w1 For the validation set samples, the actual area of the σth microaneurysm is, is the area of the σth microaneurysm predicted by the lth model; in, S is the relative difference between the true value and the lth model predicted value of the μth bleeding point area in the validation set. μ,cx1 For the sample in the validation set, the actual area of the μth bleeding point, is the μth bleeding point area predicted by the lth model; Among them, PDI l is the characteristic deviation coefficient between the true value and the predicted value of the lth model for the lesion feature of the samples in the validation set; In the formula, α1 is the weight coefficient of the relative difference in the position of microaneurysm, α2 is the weight coefficient of the relative difference in the area of microaneurysm, α3 is the weight coefficient of the relative difference in the position of bleeding points, and α4 is the weight coefficient of the relative difference in the area of bleeding points. On the basis of α1+α2+α3+α4=1, let 0<α2<α4<α1<α3<1.
8. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 7, characterized in that: Calculate the logical consistency coefficient between the model prediction results and the logical rules. The specific steps are as follows: Based on the logical rules of medical knowledge, a mapping relationship between fundus images, lesion areas, lesion types and lesion characteristics is established. Based on this mapping relationship, a medical knowledge graph of diabetic retinopathy is formed. For each sample in the validation set, it is judged whether the lesion type prediction value and lesion feature prediction value output by the model meet the above mapping relationship. After counting the number of samples that meet the mapping relationship, the ratio of the number to the total number of samples in the validation set is used as the logical consistency coefficient of the machine learning detection model.
9. The method for generating a dual-stage optimized adaptive diabetic retinopathy screening model according to claim 8, characterized in that: The comprehensive scoring coefficient is obtained by weighting the category consistency coefficient, feature deviation coefficient and logical consistency coefficient. The formula is as follows: ZPxs l =β1·k l -β2·PDI l +β3·CL l Among them, ZPxs l is the comprehensive scoring coefficient of the lth model; Where, CL l is the logical consistency coefficient of the lth machine learning detection model; β1, β2, and β3 are the weight coefficients of the category consistency coefficient, feature deviation coefficient, and logical consistency coefficient, respectively, and the specific values of β1, β2, and β3 are determined by the hierarchical analysis method.
10. A lesion identification device, characterized in that: The lesion identification device includes a model generated by a two-stage optimization adaptive diabetic retinopathy screening method according to any one of claims 1-9.
Citation Information
Cited By
Automatic screening system for fundus color illumination sugar net lesions based on image discrimination
CN122023950A