CN-121998903-A - Keratoconus element learning diagnosis method under unbalanced small sample condition
Abstract
The invention discloses a keratoconus element learning diagnosis method under the condition of an unbalanced small sample, which comprises two parts of model training and auxiliary reasoning. The model training part firstly carries out preprocessing and labeling on the acquired cornea topographic map, and then adopts a balance task sampler to construct a meta-learning task which ensures complete category. The multiscale depth features of the image were acquired using a pre-trained Swin transducer as the feature extractor. K-means clustering is used for generating a plurality of prototypes for early keratoconus categories with high diagnosis difficulty, and other categories adopt uniform grouping. And finishing classification by calculating the distance between the query sample and the prototype and carrying out probability aggregation, and carrying out meta-learning optimization by adopting a joint loss function combining the enhanced focus loss and the contrast learning loss. The auxiliary reasoning part extracts the characteristics of the input image by using the trained model, compares the characteristics with the learned prototype and outputs the diagnosis category and the confidence level. The invention obviously improves the auxiliary diagnosis accuracy and generalization capability of the keratoconus.
Inventors
- YE FENG
- LIN WEN
- ZENG SHUMIN
- LIN XIAODONG
- LIN XIAN
- YANG JUNSHENG
- CHEN XING
- WU WENTING
- HE HONGYU
Assignees
- 福建师范大学
- 福州东南视觉眼科研究所
Dates
- Publication Date
- 20260508
- Application Date
- 20251219
Claims (10)
- 1. A keratoconus element learning diagnosis method under the condition of unbalanced small samples is characterized by comprising a model training part and an auxiliary reasoning part, and comprises the following steps: Model training part: Step 1-1, data preprocessing, namely collecting PENTACAM HR cornea topographic map marked as three types of samples of normal cornea, early keratoconus and keratoconus by an ophthalmologist, and performing cutting, denoising, standardization and size normalization on the images to obtain a preprocessed data set; Step 1-2, task construction, namely dividing a preprocessing data set into a training set, a verification set and a test set in proportion, and constructing a meta-learning task set by adopting a balance task sampler, wherein each task comprises a support set and a query set, and the support set and the query set are respectively used for prototype calculation and model evaluation; Step 1-3, extracting the characteristics, namely performing multi-stage characteristic extraction on an input image by using a pre-trained Swin transducer as a characteristic extractor to output 512-dimensional characteristic vectors; Step 1-4, multiple prototype calculation, namely generating multiple prototype vectors by adopting a K-means clustering algorithm for early keratoconus categories and generating prototype vectors by adopting a uniform grouping strategy for normal cornea and keratoconus categories based on feature vectors extracted by support set samples, and step 1-5, classifying and deciding, namely calculating Euclidean distances between the feature vectors of query set samples and all the prototype vectors, converting and normalizing the Euclidean distances into probability distribution through negative exponential transformation and softmax functions, and aggregating multiple prototype probabilities of the same category by adopting a category probability aggregation mechanism for categories with multiple prototypes to obtain final category probability distribution; Step 1-6, loss optimization, namely constructing a joint loss function by combining the enhanced focus loss and the contrast learning loss, and optimizing a model by using the joint loss function; Step 1-7, meta-learning updating, namely optimizing parameters of a feature extractor through multi-task learning by adopting an outer circulation updating mechanism, calculating average loss based on query set loss of a plurality of tasks, and updating the parameters of the feature extractor by utilizing a back propagation algorithm until a model converges to obtain a trained meta-learning model; auxiliary reasoning part: Step 2-1, inputting a pretreated cornea topographic map to be diagnosed in an auxiliary way; Step 2-2, extracting feature vectors of the images by using a feature extractor of the trained meta learning model; Step 2-3, calculating Euclidean distance between the corresponding feature vector and each class prototype vector, and aggregating the multiple prototype output through a softmax function to obtain class probability distribution; and 2-4, outputting a diagnosis result of the auxiliary reasoning and the corresponding confidence according to the maximum probability, wherein the diagnosis category comprises normal cornea, early keratoconus or keratoconus.
- 2. The method for diagnosing keratoconus element learning under the condition of small unbalanced samples according to claim 1, wherein the balanced task sampler in the step 1-2 is characterized in that the balanced task sampler adjusts preset task configuration parameters, and a multi-stage priority sampling strategy is utilized in combination to ensure that each task contains all three diagnosis categories, and meanwhile, no-return sampling is preferentially used, and the automatic switching is performed to have return sampling when the number of category samples is insufficient, so that the generated element learning tasks reach balance on category distribution.
- 3. The method for learning and diagnosing keratoconus under the condition of small unbalanced sample according to claim 1, wherein the task construction formula in the step 1-2 is as follows: Wherein S i represents a support set of the ith task, Q i represents a query set of the ith task, N represents the number of categories contained in the task, M represents the number of samples contained in each category in the support set, and Q represents the number of samples contained in each category in the support set.
- 4. The method for learning and diagnosing keratoconus under the condition of small unbalanced sample according to claim 1, wherein the characteristic extraction process of the Swin transducer in the step 1-3 comprises the following steps: Step 1-3-1, dividing an input image into small blocks of 4×4 pixels through Patch Embedding layers, mapping the small blocks to a 96-dimensional feature space, and generating an initial feature representation of 56×56×96; step 1-3-2, carrying out feature extraction processing through a plurality of Swin transform blocks in four stages in sequence, wherein each Swin transform block comprises a window multi-head self-attention, a moving window multi-head self-attention and a multi-layer perceptron; and step 1-3-3, compressing the features extracted through four stages into 512-dimensional feature vectors through global average pooling and linear projection layers.
- 5. The method for learning and diagnosing keratoconus under the condition of small unbalanced sample of claim 4 wherein the calculation characteristics of the moving window multi-head self-attention mechanism in the step 1-3-2 are expressed by the following formula: Wherein Q, K, V represents the query, key value, and numerical matrix, respectively, d represents the feature dimension, and B represents the relative position offset.
- 6. The method for learning and diagnosing keratoconus under the condition of small unbalanced sample according to claim 1, wherein 4 prototypes are generated by adopting a K-means clustering algorithm in the steps 1-4: 2 prototypes were generated using a uniform grouping strategy for normal cornea and keratoconus categories: Wherein f represents a sample feature vector in the dataset, and P represents a prototype; Representing a kth cluster of class c, Indicating class c, group l.
- 7. The method for learning and diagnosing keratoconus under the condition of small unbalanced samples according to claim 1, wherein the class with a plurality of prototypes in the steps 1-5 adopts a maximum aggregation strategy to select the maximum probability of all prototypes in the query sample and the corresponding class as the final probability of the corresponding class.
- 8. The method for learning and diagnosing keratoconus under unbalanced small sample conditions as claimed in claim 1, wherein: The Euclidean distance calculation formula between each query sample and all prototypes in steps 1-5 is as follows: The expression for the euclidean distance conversion into probability distribution and then the probability of the same-class polytype is as follows: where f q denotes the query sample; The model is the kth prototype of the C class, C represents the total number of classes, tau represents a temperature parameter, K c represents the number of prototypes of the C class, C 'is an index variable of all classes, K c′ represents the number of prototypes of the C' class; Is the kth ′ prototype for class c'.
- 9. The method for learning and diagnosing keratoconus under the condition of small unbalanced samples according to claim 1 wherein the characteristics extractor parameters are optimized in the steps 1-6 by using an Adam optimizer and ReduceLROnPlateau learning rate scheduling strategy, and the expression of the joint loss function is as follows: L total =L focal +λ contrastive ×L contrastive ; Wherein L focal is the enhanced focus loss, L contrastive is the contrast learning loss, and lambda contrastive is the weight coefficient of the contrast learning loss; Representing class weight, p i representing the probability that the model predictive sample belongs to the ith class, gamma representing the focus parameter, H representing the mining scale through the hard negative sample, f q being the eigenvector of the query sample, The feature vector representing the support sample belonging to the same class as the query sample f q , τ being the temperature parameter, Representing feature vectors of support samples belonging to a different class than the query sample f q .
- 10. The method for diagnosis of keratoconus element learning under the condition of small unbalanced sample of claim 1, wherein a plurality of element learning tasks are constructed in each iteration round in steps 1-7, the tasks are processed in batches, model prototypes are recalculated and classified in distance measure for each task, then a joint loss function is calculated, the average loss is calculated by collecting query set losses of all the tasks, and parameters of a feature extractor are updated through a back propagation algorithm.
Description
Keratoconus element learning diagnosis method under unbalanced small sample condition Technical Field The invention relates to the field of medical image analysis, in particular to a keratoconus element learning diagnosis method under the condition of unbalanced small samples. Background Keratoconus (Keratoconus, KC) is a progressive, bilateral keratolytic disease characterized primarily by a steep taper of the cornea, irregular thinning of the stroma and a significant decrease in vision. The disease usually occurs in adolescence or early adulthood, and the smaller the age of onset, the faster the disease progression. Early keratoconus symptoms tend to be insignificant and patients may exhibit only mild vision blur or astigmatism, which makes them easily overlooked in conventional ophthalmic examinations. It is counted that in developing countries only about 30% of early cases are found by routine screening, whereas the undiagnosed rate in refractive surgery candidates is as high as 17.5%. But early keratoconus was not intervened and had significant progressivity, studies showed that early cases had an average annual mean corneal curvature (Kmax) increase of 0.65D, the thinnest point cornea thickness was reduced by 15 μm, and about 20% of patients would develop a severe keratoconus within 10 years, requiring corneal transplants. If intervention is performed in time, the incidence rate of severe keratoconus is reduced by 83% by early treatment, and the cornea transplantation requirement is reduced by 92%. Early diagnosis of keratoconus has important clinical value for preventing iatrogenic corneal dilatation, performing corneal collagen cross-linking treatment, and reducing corneal transplantation requirements. However, medical data presents fragmentation characteristics due to privacy limitations, single hospital patient data is limited, the available research sample size is small, and the requirement of a mainstream deep learning method on large-scale labeling data is difficult to meet. In addition, the existing AI model tends to have preference for a plurality of categories when processing category imbalance data, and has weak recognition capability for a few categories. In practical diagnosis, early keratoconus patients are far fewer than normal and keratoconus patients, and this imbalance makes it difficult for the model to learn the characterization of early keratoconus, resulting in a high rate of misdiagnosis. Disclosure of Invention The invention aims to provide a keratoconus element learning diagnosis method under the condition of unbalanced small samples, solves the problem of unbalanced small samples and categories, and improves the early keratoconus identification accuracy. The technical scheme adopted by the invention is as follows: a keratoconus element learning diagnosis method under the condition of unbalanced small sample comprises a model training part and an auxiliary reasoning part, and comprises the following steps: Model training part: Step 1-1, data preprocessing, namely collecting PENTACAM HR cornea topographic map marked as three types of samples of normal cornea, early keratoconus and keratoconus by an ophthalmologist, and performing cutting, denoising, standardization and size normalization on the images to obtain a preprocessed data set; Step 1-2, task construction, namely dividing a preprocessing data set into a training set, a verification set and a test set in proportion, and constructing a meta-learning task set by adopting a balance task sampler, wherein each task comprises a support set and a query set, and the support set and the query set are respectively used for prototype calculation and model evaluation; Step 1-3, extracting the characteristics, namely performing multi-stage characteristic extraction on an input image by using a pre-trained Swin transducer as a characteristic extractor to output 512-dimensional characteristic vectors; Step 1-4, multiple prototype calculation, namely generating multiple prototype vectors by adopting a K-means clustering algorithm for early keratoconus categories and generating prototype vectors by adopting a uniform grouping strategy for normal cornea and keratoconus categories based on feature vectors extracted by support set samples, and step 1-5, classifying and deciding, namely calculating Euclidean distances between the feature vectors of query set samples and all the prototype vectors, converting and normalizing the Euclidean distances into probability distribution through negative exponential transformation and softmax functions, and aggregating multiple prototype probabilities of the same category by adopting a category probability aggregation mechanism for categories with multiple prototypes to obtain final category probability distribution; Step 1-6, loss optimization, namely constructing a joint loss function by combining the enhanced focus loss and the contrast learning loss, and optimizing a model by using the joint loss fu