Training method and system for cataract recognition model and storage medium

By acquiring and enhancing cataract eye image samples at different stages, extracting local details and global structural features, building a multi-task convolutional neural network and optimizing it, the problem of poor generalization ability of cataract recognition model is solved, and more efficient and accurate cataract recognition is achieved.

CN119599969AInactive Publication Date: 2025-03-11THE FIRST AFFILIATED HOSPITAL OF HEBEI NORTH UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411642793.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing cataract recognition model training methods are due to the complexity and privacy of medical image data, and the different cataracts in different types and development stages perform differently on the image, which increases the difficulty of classification work. At the same time, due to the unbalanced sample, the generalization ability of cataract recognition model training is poor.

Method used

By obtaining cataract eye image samples at different stages, including early, mid- and late stage samples, as well as normal eye image samples corresponding to non-cataracts, image synchronization simulation enhancement is performed, local detailed features and global structural features of cataract lesions are extracted, multi-task convolutional neural network learning framework is constructed, and cataract recognition optimization model is generated through focus weighted loss optimization and online incremental learning update.

Benefits of technology

The cataract recognition model's ability to identify different types of cataracts is improved, overfitting is avoided, the generalization ability and robustness of the model are improved, and the ability to segment, localize and quantify cataract lesions is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599969A_ABST
    Figure CN119599969A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medical image analysis, in particular to a training method and system for a cataract recognition model and a storage medium. The method comprises the following steps: acquiring cataract eye image samples and non-cataract eye image samples in different stages; lesion region segmentation and image synchronous simulation enhancement are carried out on the cataract eye image samples and the non-cataract eye image samples in different stages to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples; extracting local detail features of the lesion and extracting structural features of a mask pair, and constructing a multi-task convolutional neural network learning framework to train a cataract recognition model and optimize focus weighted loss; and obtaining a cataract related key feature set and carrying out online incremental learning updating to generate a cataract recognition online incremental updating model. According to the invention, the accuracy and robustness of cataract recognition model training can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image analysis, and in particular to a training method, system and storage medium for a cataract recognition model. Background Art

[0002] In recent years, with the rapid development of artificial intelligence (AI) technology, the automatic cataract recognition method based on computer vision has gradually become a hot topic of research. In particular, deep learning models, especially convolutional neural networks (CNN), have achieved remarkable results in the application of medical image analysis. Cataract recognition methods based on deep learning can self-learn through a large amount of labeled data, automatically extract features from eye images, and then judge the presence and severity of cataracts. They have the advantages of high efficiency, accuracy and repeatability. In addition, by optimizing the construction of data sets, balancing the distribution of samples, introducing transfer learning technology and enhancing the generalization ability of models, the training efficiency and accuracy of cataract recognition models are improved. However, the existing cataract recognition model training methods are difficult due to the complexity and privacy of medical image data, and cataracts of different types and different stages of development have different appearances in images, which increases the difficulty of classification. At the same time, due to the imbalance of samples, the generalization ability of cataract recognition model training is poor. Summary of the invention

[0003] Based on this, it is necessary for the present invention to provide a training method, system and storage medium for a cataract recognition model to solve at least one of the above technical problems.

[0004] To achieve the above object, a training method for a cataract recognition model comprises the following steps:

[0005] Step S1: acquiring eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; performing lesion area segmentation on the cataract eye image samples at different stages to obtain cataract lesion area image samples; performing image synchronization simulation enhancement on the cataract lesion area image samples and non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples;

[0006] Step S2: extracting local detail features of lesions from cataract lesion enhanced image samples to obtain a local detail feature set of cataract lesions; extracting global structural features from cataract lesion enhanced image samples and non-cataract enhanced image samples by mask alignment to obtain a global structural feature set of cataract lesions and a global structural feature set of non-cataract lesions corresponding to the same mask alignment coordinate system;

[0007] Step S3: constructing a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer, and training the multi-task convolutional neural network learning framework for a cataract recognition model based on a local detail feature set of cataract lesions and a corresponding global structure feature set of cataract lesions and a non-cataract global structure feature set in the same mask alignment coordinate system, and performing focal weighted loss optimization on the cataract classification task network layer and the cataract grading task network layer, respectively, to generate a cataract recognition optimization model;

[0008] Step S4: Obtain a cataract-related key feature set from eye image training samples through a residual network combined with an attention mechanism, and perform online incremental learning updates on the cataract recognition optimization model based on the cataract-related key feature set to generate an online incremental update model for cataract recognition.

[0009] Further, step S1 includes the following steps:

[0010] Step S11: acquiring eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages;

[0011] Step S12: performing image spectral band distribution analysis on cataract eye image samples at different stages to obtain the spectral band distribution law of cataract eye images; performing background noise removal on the corresponding cataract eye image samples based on the spectral band distribution law of cataract eye images to obtain cataract denoised image samples;

[0012] Step S13: performing eye lens fine texture analysis on the cataract denoising image sample to obtain cataract eye lens fine texture features;

[0013] Step S14: Based on the fine texture features of the cataract eye lens, the corresponding cataract denoised image samples are subjected to hierarchical fuzzy classification screening of the lesion area to obtain candidate layer samples of the cataract eye lesion area; the candidate layer samples of the cataract eye lesion area are subjected to boundary morphological correction to obtain precise cataract lesion area boundary image samples; based on the background environment variables of the non-lesion area in the cataract denoised image samples, the precise cataract lesion area boundary image samples are subjected to upper and lower boundary connection segmentation to obtain cataract lesion area image samples;

[0014] Step S15: Perform image synchronization simulation enhancement on the cataract lesion area image samples and the non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples.

[0015] Furthermore, the step S14 of performing hierarchical fuzzy classification screening of the lesion area on the corresponding cataract denoised image samples based on the fine texture features of the cataract eye lens includes the following steps:

[0016] Based on the fine texture features of the cataract eye lens, the corresponding cataract denoising image samples are divided into lesion area images to obtain cataract eye lesion area image samples;

[0017] Performing eye lens grayscale gradient calculation for each image in the cataract eye lesion area image sample to obtain an eye lens grayscale gradient value corresponding to each cataract eye lesion area image; performing eye lens chromaticity calculation for the corresponding images in the cataract eye lesion area image sample based on the eye lens grayscale gradient value corresponding to each cataract eye lesion area image to obtain an eye lens area chromaticity value corresponding to each cataract eye lesion area image;

[0018] Performing a regional spatial distribution analysis on the fine texture features of the cataractous eye lens to obtain a regional spatial distribution map of the cataractous eye lens texture features; calculating the eye lens opacity for each image in the cataractous eye lesion area image sample based on the regional spatial distribution map of the cataractous eye lens texture features to obtain an eye lens area opacity value corresponding to each cataractous lesion area image;

[0019] Based on the chromaticity value of the eye lens area and the turbidity value of the eye lens area corresponding to each cataract lesion area image, a regional fuzzy membership calculation is performed on each image in the cataract eye lesion area image sample to obtain a regional fuzzy membership matrix corresponding to each cataract lesion area image;

[0020] According to the regional fuzzy membership matrix corresponding to each cataract lesion area image, the corresponding images in the cataract eye lesion area image samples are screened by lesion area hierarchical fuzzy classification to obtain cataract eye lesion area candidate layer samples.

[0021] Furthermore, the step S14 of performing upper and lower boundary connection segmentation on the cataract precise lesion area boundary image sample based on the background environment variables of the non-lesion area in the cataract denoising image sample includes the following steps:

[0022] Perform background environment analysis on the non-lesion area of ​​the cataract denoised image samples to obtain background environment variables of the non-lesion area of ​​the cataract, including background illumination and background color of the non-lesion area.

[0023] The boundary background environmental characteristics of the cataract non-lesion area background environment variables are analyzed to obtain the boundary background environmental characteristics of the cataract non-lesion area;

[0024] Based on the boundary background environment characteristics of the cataract non-lesion area, the boundary contour of the non-lesion area in the cataract denoising image sample is sharpened to obtain the boundary contour of the cataract non-lesion background area;

[0025] Based on the boundary contour of the cataract non-lesion background area, the upper and lower boundary connection segmentation of the cataract lesion area boundary in the cataract precise lesion area boundary image sample is performed to obtain the cataract lesion area image sample.

[0026] Further, step S15 includes the following steps:

[0027] Step S151: performing image enhancement simulation design according to image color transformation, scale transformation and affine transformation to generate different image enhancement simulation environment constraint conditions;

[0028] Step S152: performing image simulation enhancement processing on the image samples of the cataract lesion area based on different image enhancement simulation environment constraints to obtain cataract lesion enhanced image samples;

[0029] Step S153: Based on different image enhancement simulation environment constraints and using a generative adversarial network, perform image synchronization simulation enhancement on non-cataract eye image samples to obtain non-cataract enhanced image samples.

[0030] Further, step S2 includes the following steps:

[0031] Step S21: thinning the local area of ​​the cataract lesion enhanced image sample to obtain a detail enhanced image sample of the local area of ​​the cataract lesion;

[0032] Step S22: performing a lesion area image gradient second-order matrix calculation on the cataract lesion local area detail enhancement image sample to obtain a cataract lesion area image gradient second-order matrix; performing a texture directional feature analysis on the corresponding cataract lesion local area detail enhancement image sample based on the cataract lesion area image gradient second-order matrix to obtain a local texture directional feature of the cataract lesion area;

[0033] Step S23: performing lesion area structural edge feature recognition analysis on the cataract lesion local area detail enhanced image sample to obtain the cataract lesion area local structural edge feature; performing lesion local feature fusion on the cataract lesion area local texture directional feature and the cataract lesion area local structural edge feature to obtain the cataract lesion local detail feature set;

[0034] Step S24: performing mask alignment processing on each image in the cataract lesion enhanced image samples and the non-cataract enhanced image samples to obtain corresponding cataract lesion image samples and non-cataract image samples in the same mask alignment coordinate system;

[0035] Step S25: extracting global structural features of the cataract lesion image samples and non-cataract image samples corresponding to the same mask alignment coordinate system, and obtaining a cataract lesion global structural feature set and a non-cataract global structural feature set corresponding to the same mask alignment coordinate system.

[0036] Further, step S3 includes the following steps:

[0037] Step S31: constructing a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer;

[0038] Step S32: inputting the local detail feature set of cataract lesions into the cataract grading task network layer in the multi-task convolutional neural network learning framework, inputting the corresponding cataract lesion global structure feature set and non-cataract global structure feature set in the same mask alignment coordinate system into the cataract classification task network layer in the multi-task convolutional neural network learning framework, and performing parallel training of cataract recognition models on the cataract classification task network layer and the cataract grading task network layer to obtain a cataract recognition parallel task network model;

[0039] Step S33: performing a focal loss calculation of the feature ratio between the normal eye and the cataract eye on the cataract classification task network layer in the cataract recognition parallel task network model to obtain a sample imbalance focal loss of the cataract classification task;

[0040] Step S34: performing hierarchical cross entropy loss calculation on the cataract grading task network layer in the cataract identification parallel task network model to obtain the cataract grading task cross entropy loss;

[0041] Step S35: Perform task-weighted average loss calculation on the sample imbalance focus loss of the cataract classification task and the cross entropy loss of the cataract grading task to obtain the average loss of the cataract recognition parallel task model; based on the average loss of the cataract recognition parallel task model, perform model loss optimization on the cataract classification task network layer and the cataract grading task network layer in the cataract recognition parallel task network model to generate a cataract recognition optimization model.

[0042] Furthermore, in step S33, the focus loss calculation of the feature ratio between the normal eye and the cataract eye in the cataract classification task network layer in the cataract recognition parallel task network model is calculated by the feature sample ratio focus loss calculation formula, wherein the feature sample ratio focus loss calculation formula is specifically:

[0043]

[0044] In the formula, is the sample imbalance focal loss of the cataract classification task, N is the total number of samples corresponding to the cataract classification task network layer, and p i is the predicted probability that the i-th sample belongs to the cataract eye class, γ is the focus loss adjustment factor, w0 is the weight factor of the normal eye class sample, y i is the true label of the i-th sample, y i ∈{0,1}, where 0 represents the normal eye category and 1 represents the cataract eye category, is the normal eye category indicator function, indicating that if y i =0, then it is 1, otherwise it is 0, w1 is the weight factor of cataract eye category samples, is the cataract eye category indicator function, indicating that if y i =1, then it is 1, otherwise it is 0, x i is the true feature corresponding to the i-th sample, η(x i ) is the regularization term, λ is the regularization coefficient, is the prediction feature corresponding to the i-th sample.

[0045] Furthermore, the present invention also provides a training system for a cataract recognition model, which is used to execute the training method for a cataract recognition model as described above. The training system for a cataract recognition model includes:

[0046] The eye image sample simulation enhancement module is used to obtain eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; perform lesion area segmentation on the cataract eye image samples at different stages to obtain cataract lesion area image samples; perform image synchronization simulation enhancement on the cataract lesion area image samples and non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples;

[0047] The eye image local and global feature extraction module is used to extract local detail features of lesions from cataract lesion enhanced image samples to obtain a local detail feature set of cataract lesions; perform mask alignment global structure feature extraction on cataract lesion enhanced image samples and non-cataract enhanced image samples, thereby obtaining a corresponding cataract lesion global structure feature set and non-cataract global structure feature set in the same mask alignment coordinate system;

[0048] A cataract recognition model training and optimization module is used to construct a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer, and the multi-task convolutional neural network learning framework is used to train a cataract recognition model based on a local detail feature set of cataract lesions and a global structure feature set of cataract lesions corresponding to the same mask alignment coordinate system and a non-cataract global structure feature set, and the cataract classification task network layer and the cataract grading task network layer are respectively optimized with focal weighted loss to generate a cataract recognition optimization model;

[0049] The online incremental update module of the cataract recognition model is used to obtain the cataract-related key feature set from the eye image training samples through the residual network and the attention mechanism, and to perform online incremental learning updates on the cataract recognition optimization model based on the cataract-related key feature set to generate an online incremental update model for cataract recognition.

[0050] Furthermore, the present invention also provides a storage medium having a computer program stored thereon, and when the computer program is executed, the training method for the cataract recognition model as described above is implemented.

[0051] Beneficial effects of the present invention:

[0052] 1. The training method of the cataract recognition model proposed in the present invention has the beneficial effect compared with the prior art in that by collecting cataract eye image samples at different stages, including samples at the early, middle and late stages, and normal eye image samples corresponding to non-cataract, the model is provided with multi-dimensional data support. By covering cataract image samples at different stages, the model can learn the visual characteristics of cataracts at different stages of development, including different degrees and regional distribution of lens opacity, thereby improving the model's ability to recognize different types of cataracts. The addition of non-cataract samples enables the model to better distinguish between healthy eyes and cataract eyes, avoid overfitting, and improve the generalization ability of the model. By segmenting the lesion area of ​​cataract eye image samples at different stages, the clear distinction between the lesion area and the background is further ensured. The final effect of this step is to obtain more accurate cataract lesion area image samples, which provides effective data support for the subsequent cataract image processing process. At the same time, by performing image synchronization simulation enhancement on image samples of cataract lesion areas and non-cataract eye image samples, this process can increase the diversity of the model during training and improve its performance under different conditions by performing data enhancement on training samples. Specifically, through image synchronization simulation enhancement technology, the contrast, brightness, color saturation and other factors of the image can be adjusted to simulate the cataract performance under different lighting, shooting angles, eye surface conditions and other conditions, making the training data richer and more diverse. This enhancement is not limited to cataract lesion areas, but also includes non-cataract healthy eye image samples to ensure that the model can have good performance on different types of eye images. The enhanced samples can significantly increase the amount of training data, avoid overfitting, and improve the robustness of the model. Secondly, by extracting local detail features of lesions from enhanced image samples of cataract lesions, the lesion area usually manifests as changes in tissue morphology, such as deformation, blur, and turbidity of the lens. By identifying local structural detail features, these morphological changes can be accurately captured, especially at the edge of the image. These changes are often the key manifestations of lesions, which can not only help identify the contour of the lesion area, but also provide shape information of the image in the local area. This is of great significance for the segmentation, positioning and quantitative analysis of cataract lesions, especially at different development stages of cataract lesions. Accurately extracting edge detail features can help better evaluate the extent of the lesion during model recognition.By performing mask alignment on each image in the cataract lesion enhanced image samples and the non-cataract enhanced image samples, it ensures the spatial consistency between different images, ensures the same spatial positioning between different samples, and extracts the global structural features of the image. The global structural features of the image can reflect the difference in overall distribution between the lesion area and the normal area, thereby providing important support for the classification and identification of the lesions. By extracting global structural features in a unified coordinate system, it can ensure that the comparison between the lesion image and the normal image is more fair, avoiding the influence of the difference in spatial position on the feature extraction. This not only helps to identify the global differences in the image, but also provides key information for subsequent classification tasks. For example, by comparing the global structural features of cataract images and normal images, the two types of images can be effectively distinguished, providing support for different types of cataract lesion identification and classification tasks, thereby reducing the difficulty of subsequent model classification tasks. Then, a multi-task convolutional neural network (CNN) learning framework is constructed to simultaneously solve the classification and grading problems of cataracts. The multi-task learning (MTL) framework enables the network to share low-level feature learning and learn specialized high-level features for specific tasks. By combining cataract classification and grading tasks in the same network, the network can automatically utilize the additional information of the grading task when performing classification, thereby improving the overall learning efficiency and accuracy. Specifically, the cataract classification task network layer is responsible for the binary classification task of distinguishing between normal eyes and cataractous eyes, while the cataract grading task network layer is responsible for grading the severity of cataracts. This multi-task structure can effectively improve the generalization ability and recognition accuracy of different tasks by sharing underlying features. The cataract recognition model is trained in parallel by inputting the local detail feature set of cataract lesions into the cataract grading task network layer within the multi-task convolutional neural network learning framework, and the corresponding global structure feature set of cataract lesions and non-cataract global structure feature set in the same mask alignment coordinate system into the cataract classification task network layer within the multi-task convolutional neural network learning framework. This step enables the network to take into account the mutual influence of various features during the learning process by inputting the local detail feature set of lesions and the global structure feature set (including cataract lesion features and non-cataract features) into the classification and grading tasks respectively. This parallel training strategy enables the cataract classification task and the grading task to be optimized simultaneously in the same network architecture and promote each other, thereby improving the accuracy and stability of the model.At the same time, by performing focal weighted loss optimization on the two tasks, the losses of the two tasks will be weighted averaged to balance the optimization objectives of different tasks. The weighted average loss adjusts the loss ratio of the classification task and the grading task so that the model can take both into account during the training process to avoid over-optimization of one task and ignoring the other task. Due to the different importance and difficulty of classification and grading tasks, a reasonable weighting strategy is crucial to improving model performance. By comprehensively considering the focal loss and cross entropy loss, the generated weighted average loss can effectively reflect the overall performance of the cataract recognition task, and the model is optimized on this basis. The loss optimization of the model is completed through the back propagation mechanism. During the optimization process, the network weights are gradually adjusted to ensure that the losses of the classification and grading tasks are effectively minimized. This can solve the problem of sample imbalance, thereby improving the generalization ability of cataract recognition model training. Finally, by combining the residual network with the attention mechanism, the key features related to cataracts are extracted from the eye image training samples, and the recognition model is updated using incremental learning, which can effectively improve the adaptability and continuous optimization ability of the model. The residual network helps to alleviate the gradient vanishing problem encountered by deep neural networks during training, allowing the network to more deeply mine the key information in the image. The introduction of the attention mechanism further enhances the model's refinement ability when processing images. It can automatically focus on important areas in the image, such as the lesion part of the cataract, thereby improving the model's sensitivity to key features. During the incremental learning process, the model will be continuously updated according to the new sample data, thereby avoiding the degradation of the model performance, and can be adjusted in time to cope with new data distribution or lesion characteristics, so that the cataract recognition model has stronger long-term learning ability.

[0053] 2. The cataract recognition model training system proposed in the present invention is generally composed of an eye image sample simulation enhancement module, an eye image local and global feature extraction module, a cataract recognition model training and optimization module, and a cataract recognition model online incremental update module. It can implement the training method of any cataract recognition model described in the present invention, and is used to combine the operations between computer programs running on each module to implement the cataract recognition model training method. The internal structures of the system cooperate with each other, which can greatly reduce duplication of work and manpower investment, and can quickly and effectively provide a more accurate and efficient cataract recognition model training process, thereby simplifying the operating procedures of the cataract recognition model training system. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments thereof made with reference to the following drawings:

[0055] Figure 1A schematic flow chart of the steps of the training method for a cataract recognition model of the present invention;

[0056] Figure 2 for Figure 1 Detailed step flow chart of step S1 in FIG. DETAILED DESCRIPTION

[0057] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.

[0058] To achieve this, please refer to Figure 1 to Figure 2 The present invention provides a training method for a cataract recognition model. In the embodiments of the present invention, please refer to Figure 1 FIG. 1 is a flow chart of the steps of the training method for a cataract recognition model of the present invention. In this example, the training method for a cataract recognition model includes the following steps:

[0059] Step S1: acquiring eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; performing lesion area segmentation on the cataract eye image samples at different stages to obtain cataract lesion area image samples; performing image synchronization simulation enhancement on the cataract lesion area image samples and non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples;

[0060] In an embodiment of the present invention, eye image samples containing cataracts at different stages are collected. These image samples must cover three different stages: early, middle and late cataracts, as well as corresponding non-cataract eye images. When acquiring images, high-quality eye images are captured by using professional ophthalmic equipment, such as a slit lamp microscope, a fundus camera, etc. During the shooting process, it is necessary to ensure that the collected images cover all areas of the eye of cataract patients, including the iris, lens and retinal areas. For each patient's image, the stage of cataract is marked, and the number of image samples at different stages is balanced. Non-cataract image samples should also cover people of different ages, genders, and visual health conditions to ensure the diversity and representativeness of image samples, thereby obtaining eye image training samples. The lens fine texture is analyzed for cataract eye image samples at different stages. The specific operation is to use texture analysis algorithms (such as Gabor filters, gray-level co-occurrence matrices, etc.) to extract texture features of the lens area. First, the lens area is accurately separated from the cataract image using an image segmentation algorithm, and the lens surface is carefully textured extracted using a multi-scale analysis method to analyze the fine structure of its surface. The lens surface at different stages of cataract will show different texture features. For example, in the early stages of cataract, the lens surface presents a relatively regular structure, while in the late stages it presents a more chaotic or irregular texture. Based on the lens fine texture features, the corresponding cataract image samples are segmented for the lesion area. The specific method is to use image segmentation technology and background environmental information to infer the transition boundary between the lesion area and the non-lesion area. The lesion area can be effectively distinguished from the non-lesion area through adaptive threshold segmentation or segmentation methods based on region growing, and the upper and lower boundaries can be accurately connected to obtain image samples of the cataract lesion area. Then, the image enhancement technology is applied to perform synchronous simulation enhancement on the image samples of the cataract lesion area and the non-cataract eye image samples, so as to amplify the visual features of the image samples of the cataract lesion area through enhancement algorithms such as image contrast enhancement, pseudo color processing, noise enhancement and other methods. The data enhancement methods used include operations based on image color transformation, scale transformation and affine transformation, or generate new enhanced samples through deep learning models such as generative adversarial networks (GANs). Through these enhancement operations, the cataract lesion area can be made more obvious, which is convenient for subsequent model training. In addition, similar enhancement operations are performed on non-cataract image samples to ensure the balance of model training and avoid overfitting, and finally cataract lesion enhanced image samples and non-cataract enhanced image samples are obtained.

[0061] Step S2: extracting local detail features of lesions from cataract lesion enhanced image samples to obtain a local detail feature set of cataract lesions; extracting global structural features from cataract lesion enhanced image samples and non-cataract enhanced image samples by mask alignment to obtain a global structural feature set of cataract lesions and a global structural feature set of non-cataract lesions corresponding to the same mask alignment coordinate system;

[0062] In an embodiment of the present invention, edge detection and local detail highlighting are performed on the previously enhanced cataract lesion enhanced image sample by using a high-pass filter or a Laplace operator, especially emphasizing the edge and center of the cataract area. At this time, the details of the local lesion area are clearer, and the background noise is effectively suppressed, making the cataract lesion area more prominent, and the gradient second-order matrix of the local area image of the cataract lesion is calculated to extract the detailed texture information of the cataract lesion area. The specific operation is as follows: first, the gray level co-occurrence matrix (GLCM) method is used to calculate the texture features of different directions (such as 0°, 45°, 90°, and 135°) from the gradient second-order matrix. The gray level co-occurrence matrix can reflect the spatial relationship between pixel pairs and is often used for image texture analysis. By calculating the contrast and homology of the texture, the gray level co-occurrence matrix can be used to extract the texture features of the cataract lesion area. The specific implementation method is as follows: first, the Canny edge detection algorithm is used to process the image samples after detail enhancement. The algorithm detects the edge information in the image through local gradient changes, and further identifies the edge structure of the lesion area by combining the edge detection result with the region growing algorithm. The texture feature vector obtained from texture analysis is concatenated with the edge structure feature vector obtained from edge recognition to form a multidimensional feature vector. The vector contains the texture characteristics, edge structure and gradient information of the cataract lesion area, which can comprehensively describe the detail characteristics of the lesion area. The dimensionality reduction techniques such as principal component analysis (PCA) or linear discriminant analysis (LDA) are used to optimize the fusion features, thereby obtaining the local detail feature set of cataract lesions. At the same time, image registration is performed on each image in the cataract lesion enhanced image sample and the non-cataract enhanced image sample after image enhancement, so as to align all image samples in the same coordinate system. An image registration algorithm (such as feature-based registration or intensity-based registration method) is applied to each cataract lesion enhanced image and non-cataract enhanced image to ensure that the content of each image is completely spatially corresponding. Then, global structural features are extracted from the image samples that have completed mask alignment. Global feature extraction often uses the overall texture, shape, color and other information of the image to analyze the macro structure of the image. The overall texture features of the image can be extracted through statistical features (such as gray level co-occurrence matrix (GLCM), texture energy, entropy, etc.), or the image can be analyzed in the frequency domain using Fourier transform, Wavelet transform and other methods to extract global structural features. Especially for cataract lesion images, in the extraction of structural features, the morphological changes of the lesion area need to be taken into account, and the special structural features of the lesion area can be identified from a global perspective. Finally, the corresponding global structural feature set of cataract lesions and the global structural feature set of non-cataracts in the same mask alignment coordinate system are obtained.

[0063] Step S3: constructing a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer, and training the multi-task convolutional neural network learning framework for a cataract recognition model based on a local detail feature set of cataract lesions and a corresponding global structure feature set of cataract lesions and a non-cataract global structure feature set in the same mask alignment coordinate system, and performing focal weighted loss optimization on the cataract classification task network layer and the cataract grading task network layer, respectively, to generate a cataract recognition optimization model;

[0064] In an embodiment of the present invention, a multi-task convolutional neural network (CNN) framework is designed, which includes two main task network layers: a cataract classification task network layer and a cataract grading task network layer. Each task network layer uses a convolutional neural network structure for feature extraction, and processes the classification and grading tasks of cataracts respectively. The cataract classification task network layer is responsible for binary classification of eye images to distinguish between normal eyes and cataract eyes; the cataract grading task network layer performs multi-classification tasks for different grades of cataracts to identify the severity of cataracts. To ensure efficient training of the two tasks, a shared convolutional layer is used to extract low-level features of the image when designing the network structure, while the task-specific fully connected layer or other layers separately process the classification and grading tasks, thereby constructing a multi-task convolutional neural network learning framework. The local detail feature set of cataract lesions obtained by local feature analysis is input into the cataract grading task network layer in the multi-task convolutional neural network learning framework, and the corresponding global structure feature set of cataract lesions and non-cataract global structure feature set in the same mask alignment coordinate system are input into the cataract classification task network layer for corresponding recognition task training, wherein the local detail feature set of cataract lesions is extracted. These features usually represent the specific lesion conditions of cataracts through fine-grained information of local areas. These local detail features are input into the cataract grading task network layer, which is responsible for identifying and classifying the grading of cataracts. Next, the global structure feature set is extracted, including the overall lesion area features of cataracts and the global structure features of normal eyes without cataracts. These global structure features are input into the cataract classification task network layer to perform the classification task of whether there is cataract in the eye. At the same time, the focal loss (Focal Loss) function is used for loss calculation. The focal loss reduces the loss weight of easy-to-classify samples by introducing an adjustment factor, and focuses on optimizing those difficult-to-classify samples. Specifically, for the imbalanced ratio of normal eye and cataract eye images in the training data, when calculating the focal loss, the difference between the category and the predicted probability of each sample is used, which can effectively reduce the training bias caused by sample imbalance, making the model more accurate in classification tasks. In order to train the cataract grading task network layer in the cataract recognition parallel task network model, the difference between the predicted result and the true label is calculated by using the cross entropy loss function. The cross entropy loss is usually used for multi-classification problems and can effectively measure the accuracy of the model's predicted category. The goal of the cataract grading task is to classify the input eye image into multiple different cataract grading categories. The calculation formula of the cross entropy loss is: H(p,q)=―∑ cp(c)log2q(c), where p(c) is the true label distribution of the sample, q(c) is the model predicted probability distribution of the sample, and c is a different cataract grading category. By calculating the cross entropy loss of the grading task, then, in this step, the losses of the cataract classification task and the cataract grading task are comprehensively considered to calculate the total loss function by weighted average, thereby guiding the optimization process of the entire network. Specifically, the focal loss of the cataract classification task and the cross entropy loss of the cataract grading task are first calculated, marked as L class and L grade Then, the task weighting coefficients λ1 and λ2 are used to adjust the loss weights of the two tasks, so as to calculate the average loss of the cataract recognition parallel task model: L total =λ1L class +λ2L grade , where λ1 and λ2 adjust the weights according to the relative importance of the tasks. At the same time, the average loss L is calculated based on the cataract identification parallel task model. total The back propagation algorithm (such as Adam optimizer) is used to train the cataract classification task network layer and the cataract grading task network layer, update the parameters in the network, and optimize the performance of the cataract recognition model. Through this optimization process, the model can improve the accuracy of grading while ensuring the classification accuracy, thereby generating a comprehensive optimized cataract recognition model and finally obtaining a cataract recognition optimization model.

[0065] Step S4: Obtain a cataract-related key feature set from eye image training samples through a residual network combined with an attention mechanism, and perform online incremental learning updates on the cataract recognition optimization model based on the cataract-related key feature set to generate an online incremental update model for cataract recognition.

[0066] In an embodiment of the present invention, a residual network (ResNet) and an attention mechanism are used to further extract features from eye image training samples. The residual network introduces a skip connection structure to avoid the gradient vanishing problem during the learning process, thereby improving the training effect of the deep network. The attention mechanism enables the model to focus on the key parts of the image, especially the cataract lesion area, thereby improving the accuracy of feature extraction. On this basis, based on the extracted cataract-related key feature set, the cataract recognition optimization model is updated by an online incremental learning method. The incremental learning process is to continuously adjust the model on new training samples without retraining the entire data set, thereby improving training efficiency and avoiding overfitting. Through the online update mechanism, the recognition model can be dynamically adjusted and optimized to enable it to adapt to new lesion samples or patient groups, further improving the recognition ability and adaptability of the model. The generated cataract recognition model can continue to learn and respond to new data input in a timely manner, thereby ensuring the long-term stability and accuracy of the cataract recognition system, and finally incrementally generating an online incremental update model for cataract recognition.

[0067] Further, as an embodiment of the present invention, refer to Figure 2 As shown, Figure 1 Detailed step flow diagram of step S1 in FIG. 1 , in this embodiment, step S1 includes the following steps:

[0068] Step S11: acquiring eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages;

[0069] In an embodiment of the present invention, eye image samples containing cataracts at different stages are collected, and these image samples must cover three different stages: early, middle and late cataracts, as well as corresponding non-cataract eye images. When acquiring images, high-quality eye images are captured by using professional ophthalmic equipment, such as a slit lamp microscope, a fundus camera, etc. During the shooting process, it is necessary to ensure that the collected images cover all areas of the eye of cataract patients, including the iris, lens and retinal areas. For each patient's image, the stage of cataract is marked, and the number of image samples at different stages is ensured to be balanced. Non-cataract image samples should also cover people of different ages, genders, and visual health conditions to ensure the diversity and representativeness of image samples, and finally obtain eye image training samples, wherein the eye image training samples include cataract eye image samples at different stages and non-cataract eye image samples.

[0070] Step S12: performing image spectral band distribution analysis on cataract eye image samples at different stages to obtain the spectral band distribution law of cataract eye images; performing background noise removal on the corresponding cataract eye image samples based on the spectral band distribution law of cataract eye images to obtain cataract denoised image samples;

[0071] In an embodiment of the present invention, spectral band distribution analysis is performed on cataract eye image samples at different stages by utilizing spectral analysis technology, so as to obtain different spectral band data (such as visible light, near infrared, etc.) of cataract eye images through a spectral imaging instrument, and extract the reflectance value of each image in each band, perform spectral analysis of the bands of cataract samples at different stages in the image, and find the distribution pattern between the bands. In particular, in different development stages of cataract, the optical properties of the lens change, resulting in different distribution patterns of its reflectivity in different bands. The spectral characteristics of cataracts at different stages can be identified. For example, late-stage cataracts will show a significant increase in reflectivity in the near-infrared band, while early-stage cataracts will have more obvious reflection changes in the visible light band, thereby obtaining the spectral band distribution pattern of cataract eye images. At the same time, the frequency domain filtering technology is used to remove the background noise of the corresponding cataract eye image samples according to the distribution law of the cataract eye images in different spectral bands analyzed previously. The specific operation is to use a low-pass filter to remove the high-frequency noise in the non-cataract area of ​​the image, while retaining the effective spectral information of the cataract area. Through spectral analysis, it can be determined which frequency bands mainly contain background noise and which frequency bands contain valuable cataract lesion information. For each image, according to its spectral characteristics, a suitable frequency band is selected for denoising. In the process of noise removal, an adaptive threshold denoising algorithm is used to identify the noise area in the image. By comparing with the cataract area, representative lesion features are retained. After removing the background noise, the obtained image will be clearer, and finally a cataract denoised image sample is obtained.

[0072] Step S13: performing eye lens fine texture analysis on the cataract denoising image sample to obtain cataract eye lens fine texture features;

[0073] In an embodiment of the present invention, computer vision technology is used to analyze the lens fine texture of the denoised cataract image sample. The specific operation is to use a texture analysis algorithm (such as a Gabor filter, a grayscale co-occurrence matrix, etc.) to extract the texture features of the lens area. First, an image segmentation algorithm is used to accurately separate the lens area in the cataract image, and a multi-scale analysis method is used to perform detailed texture extraction on the lens surface to analyze the fine structure of its surface. The lens surface at different stages of cataract will show different texture features. For example, in the early stage of cataract, the lens surface presents a relatively regular structure, while in the late stage it presents a more chaotic or irregular texture. By extracting and quantifying these texture features, the pathological pattern of the cataract can be further revealed, and finally the fine texture features of the cataractous eye lens are obtained.

[0074] Step S14: Based on the fine texture features of the cataract eye lens, the corresponding cataract denoised image samples are subjected to hierarchical fuzzy classification screening of the lesion area to obtain candidate layer samples of the cataract eye lesion area; the candidate layer samples of the cataract eye lesion area are subjected to boundary morphological correction to obtain precise cataract lesion area boundary image samples; based on the background environment variables of the non-lesion area in the cataract denoised image samples, the precise cataract lesion area boundary image samples are subjected to upper and lower boundary connection segmentation to obtain cataract lesion area image samples;

[0075] In an embodiment of the present invention, hierarchical fuzzy classification and screening of lesion areas are performed on denoised cataract image samples based on lens fine texture features. The specific method is to use a fuzzy clustering algorithm (such as a fuzzy C-means algorithm) to identify and classify the lesion areas in the image, and combine the texture features extracted previously, use a multi-level classification model to fuzzily divide different areas in the image, and cluster areas with similar texture features together. Through this method, healthy areas and lesion areas in cataract images can be distinguished, and a hierarchical fuzzy classification model can be used to further subdivide them, determine the severity of the lesions and their locations in the lens, and form candidate layer samples of the lesion areas screened out by classification, thereby obtaining candidate layer samples of cataract eye lesion areas. At the same time, the boundary morphological correction method is used to further optimize the candidate layer samples of the cataract eye lesion area, so as to process the boundary of the lesion area by using morphological operations such as dilation and erosion. Through these operations, the noise is removed and the outline of the lesion area is corrected to avoid excessive roughness or discontinuity of the boundary due to noise and inaccurate segmentation. The degree of boundary correction can be controlled by the selection of structural elements, such as using a 3x3 square structural element for erosion operation to smooth the boundary and eliminate noise in small areas. For the tiny unconnected parts that still exist after morphological correction, the connected domain analysis technology can be used to connect the locally broken boundaries. The obtained boundary image sample will show the precise boundary of the cataract lesion area, thereby obtaining the precise boundary image sample of the cataract lesion area. Then, by extracting the background environment information of the non-lesion area from the cataract denoising image samples, the non-lesion area usually appears as healthy tissue around the lens, and the texture features are relatively stable and consistent. By analyzing the background environment variables of the area, such as local contrast, grayscale value distribution, etc., the background distribution pattern in the cataract image can be obtained, and combined with the precise lesion area boundary image samples obtained by previous analysis, the upper and lower boundaries of the lesion area are connected and segmented. The specific method is to use image segmentation technology to use the background environment information to infer the transition boundary between the lesion area and the non-lesion area. Through adaptive threshold segmentation or region growing-based segmentation methods, the lesion area can be effectively distinguished from the non-lesion area, and the upper and lower boundaries can be accurately connected, and finally the cataract lesion area image sample is obtained.

[0076] Step S15: Perform image synchronization simulation enhancement on the cataract lesion area image samples and the non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples.

[0077] In an embodiment of the present invention, image enhancement technology is applied to synchronously simulate enhancement of image samples of cataract lesion areas and non-cataract eye image samples, so as to amplify the visual features of image samples of cataract lesion areas through enhancement algorithms, such as image contrast enhancement, pseudo-color processing, noise enhancement and the like. The data enhancement methods used include operations based on image color transformation, scale transformation and affine transformation, or new enhanced samples are generated through deep learning models such as generative adversarial networks (GANs). Through these enhancement operations, the cataract lesion area can be made more obvious, which is convenient for subsequent model training. In addition, similar enhancement operations are performed on non-cataract image samples to ensure the balance of model training and avoid overfitting, and finally cataract lesion enhanced image samples and non-cataract enhanced image samples are obtained.

[0078] Furthermore, the step S14 of performing hierarchical fuzzy classification screening of the lesion area on the corresponding cataract denoised image samples based on the fine texture features of the cataract eye lens includes the following steps:

[0079] Based on the fine texture features of the cataract eye lens, the corresponding cataract denoising image samples are divided into lesion area images to obtain cataract eye lesion area image samples;

[0080] In an embodiment of the present invention, edge detection and segmentation of the lesion area are performed on the denoised cataract image samples that have been previously denoised by combining the previously acquired fine texture features of the cataract eye lens, so that edge detection technology, such as the Canny edge detection algorithm, can be used to identify edge features in the image, thereby effectively segmenting the lesion area. In addition, deep learning algorithms, such as convolutional neural networks (CNN), can also be used to identify the cataract lesion area through training models, which can improve the accuracy of image segmentation. The segmented lesion area will be extracted as independent image samples, which contain the fine texture features of the cataract eye lens. The image samples of these lesion areas will be used as input data for subsequent steps for further grayscale gradient, chromaticity and turbidity calculations, and ultimately image samples of cataract eye lesion areas are obtained.

[0081] Preferably, the eye lens grayscale gradient is calculated for each image in the cataract eye lesion area image sample to obtain the eye lens grayscale gradient value corresponding to each cataract lesion area image; based on the eye lens grayscale gradient value corresponding to each cataract lesion area image, the eye lens chromaticity is calculated for the corresponding image in the cataract eye lesion area image sample to obtain the eye lens area chromaticity value corresponding to each cataract lesion area image;

[0082] In an embodiment of the present invention, for each image of the cataract eye lesion area image sample, it is necessary to calculate the grayscale gradient value of the eye lens. First, a gradient operator (such as a Sobel operator or a Prewitt operator) is used to process the image, and the grayscale changes of each pixel in the horizontal and vertical directions are calculated. The horizontal gradient and vertical gradient of each pixel are combined to calculate the total grayscale gradient value of each pixel. This gradient value reflects the grayscale change of the eye lens and can effectively describe the texture information of the cataract area. In this step, if a deep learning method is used, a convolutional neural network can also be used to extract image features and automatically calculate the grayscale gradient value of each cataract lesion area image, thereby obtaining the eye lens grayscale gradient value corresponding to each cataract lesion area image. At the same time, by calculating the chromaticity of the eye lens for the corresponding lesion area image based on the grayscale gradient value of each cataract lesion area image, the original image can be converted from the RGB color space to the HSV color space or the Lab color space through color space conversion. In these color spaces, attributes such as hue, saturation, and value can effectively distinguish different chromaticity information. By calculating the hue and saturation values ​​of the pixels in each lesion area, the chromaticity characteristics of the eye lens can be obtained. Specifically, by calculating the hue value of each pixel and generating a chromaticity distribution map of each cataract lesion area based on these hue values, the chromaticity characteristics of the cataract area are reflected, and finally the chromaticity value of the eye lens area corresponding to each cataract lesion area image is obtained.

[0083] Preferably, the fine texture features of the cataract eye lens are analyzed for regional spatial distribution to obtain a regional spatial distribution map of the texture features of the cataract eye lens; based on the regional spatial distribution map of the texture features of the cataract eye lens, the turbidity of the eye lens is calculated for each image in the cataract eye lesion area image sample to obtain the turbidity value of the eye lens area corresponding to each cataract lesion area image;

[0084] In an embodiment of the present invention, a regional spatial distribution analysis is performed on the fine texture features of the cataractous eye lens obtained through the previous analysis. This step helps to further understand the pathological pattern of cataracts by calculating the spatial distribution of the texture on the surface of the lens. The specific operation includes block analysis of the fine texture of the cataractous eye image, and the texture features in each area are extracted. Common texture features include gray-level co-occurrence matrix (GLCM), local binary pattern (LBP), etc. By calculating the texture features of these areas, such as contrast, homogeneity, energy and other indicators, a texture feature description of each area can be generated, and a spatial distribution map of the texture of the cataractous eye lens can be obtained through specific clustering analysis or heat map analysis. In this process, an image-based local feature analysis method, such as local scale-invariant feature transform (SIFT) or speeded up robust features (SURF), can be used to locate and regionally analyze the texture, thereby obtaining a regional spatial distribution map of the texture features of the cataractous eye lens. At the same time, the opacity of the eye lens is calculated for each cataract lesion area image according to the regional spatial distribution map of the texture characteristics of the cataractous eye lens, so as to analyze the regional opacity of the lens based on the previously obtained texture spatial distribution map. The opacity of cataracts usually manifests as reduced transparency of the lens, thereby affecting its texture characteristics. The opacity of each area can be evaluated by calculating the local contrast or texture complexity of the area. Specifically, the local contrast measurement method can be used to calculate the difference in grayscale values ​​of different areas to obtain the degree of the turbid area, and further calculate the degree of influence of the turbid area, and finally obtain the eye lens area opacity value corresponding to each cataract lesion area image.

[0085] Preferably, a regional fuzzy membership calculation is performed on each image in the cataract eye lesion area image sample based on the eye lens area chromaticity value and the eye lens area turbidity value corresponding to each cataract lesion area image, to obtain a regional fuzzy membership matrix corresponding to each cataract lesion area image;

[0086] In the embodiment of the present invention, the chromaticity value and turbidity value of the eye lens corresponding to each cataract lesion area image are used to calculate the regional fuzzy membership. The fuzzy membership is calculated by fuzzy mathematics theory and is intended to evaluate the degree to which different areas in the image belong to a specific lesion category. For each cataract lesion area image, a fuzzy logic algorithm (such as a fuzzy C-means algorithm or a membership function calculation) is used to perform membership analysis on each pixel in the image. The membership function takes into account the chromaticity value and the turbidity value, for example Among them, H is the chromaticity value, C is the turbidity value, exp is the exponential function, H0 is the target chromaticity value of the lens area, σ His the standard deviation of the chromaticity value, α is the chromaticity weighting coefficient, C0 is the target turbidity value of the lens area, σ C is the standard deviation of the turbidity value, and β is the turbidity weighting coefficient to comprehensively evaluate the regional properties of the lens in the image. Specifically, the chromaticity value and the turbidity value are first normalized to a certain range, and then the membership value of each position area is determined by setting fuzzy rules or membership functions, so that the membership corresponding to each position area is constructed to obtain a regional fuzzy membership matrix, which can effectively reflect whether each area meets the standard of a specific degree of lesion, and finally the regional fuzzy membership matrix corresponding to each cataract lesion area image is obtained.

[0087] Preferably, the corresponding images in the cataract eye lesion area image samples are screened by lesion area hierarchical fuzzy classification according to the regional fuzzy membership matrix corresponding to each cataract lesion area image, so as to obtain cataract eye lesion area candidate layer samples.

[0088] In an embodiment of the present invention, hierarchical fuzzy classification screening of lesion areas is performed on the corresponding cataract eye lesion area image based on the regional fuzzy membership matrix calculated previously. The main purpose of this operation is to judge the possibility of each area belonging to different degrees of lesions according to the membership value in the fuzzy membership matrix. Specifically, a fuzzy classification algorithm (such as a fuzzy C-means clustering algorithm or a hierarchical clustering method) is used to perform hierarchical processing on the image, and the areas in the image are divided into multiple levels, each level representing a different degree of lens lesions (such as mild, moderate, severe opacity, etc.). By calculating the difference between the membership value in the fuzzy membership matrix and the predetermined lesion standard, the classification of the lesion area level is determined, and the image area that meets a certain lesion standard is screened out to form a candidate layer sample of the cataract eye lesion area. The layer sample will be used in subsequent training or analysis to help improve the accuracy and robustness of the cataract recognition model, and finally obtain a candidate layer sample of the cataract eye lesion area.

[0089] Furthermore, the step S14 of performing upper and lower boundary connection segmentation on the cataract precise lesion area boundary image sample based on the background environment variables of the non-lesion area in the cataract denoising image sample includes the following steps:

[0090] Perform background environment analysis on the non-lesion area of ​​the cataract denoised image samples to obtain background environment variables of the non-lesion area of ​​the cataract, including background illumination and background color of the non-lesion area.

[0091] In an embodiment of the present invention, a detailed background environment analysis is performed on the non-lesion area in the cataract denoising image sample that has been previously denoised, so that the non-lesion area is distinguished from the lesion area by using an image processing algorithm and a threshold segmentation method, and the original image is converted from the RGB space to the HSV space by using color space conversion, so as to better extract the background illumination and background color features in the image. Specifically, the background illumination in the image can be evaluated by calculating the mean and variance of the brightness (Value channel) distribution in the HSV space, and the background color is determined by calculating the mean and variance of the hue (Hue channel) and saturation (Saturation channel). These variables will provide data support for subsequent boundary feature analysis, ensuring that the illumination and color features of the non-lesion area are accurately extracted, and finally obtaining the background environment variables of the non-lesion area of ​​cataract, including the background illumination of the non-lesion area and the background color of the non-lesion area.

[0092] Preferably, the boundary background environment characteristics of the cataract non-lesion area are analyzed for the background environment variables to obtain the boundary background environment characteristics of the cataract non-lesion area;

[0093] In an embodiment of the present invention, the background environmental variables of the non-lesion area obtained previously are further analyzed in order to extract environmental features related to the boundary of the non-lesion area. First, the boundary of the non-lesion area is identified using an edge detection algorithm (such as the Canny operator). The edge image is then smoothed to remove noise and enhance the continuity of the background area. The background environmental features of the area can be obtained by counting the light intensity and color distribution at the boundary of the non-lesion area. These features include brightness changes and color transitions at the boundary, as well as morphological features of the boundary, such as edge smoothness and mutation points. The boundaries of the non-lesion areas can be accurately identified, and interference of the lesion area with the background analysis can be avoided. Finally, the background environmental features of the boundary of the non-lesion area of ​​cataract can be obtained.

[0094] Preferably, the boundary contour of the non-lesion area in the cataract denoised image sample is sharpened based on the boundary background environment characteristics of the non-lesion area of ​​the cataract to obtain the boundary contour of the non-lesion background area of ​​the cataract;

[0095] In an embodiment of the present invention, by combining the background environment features of the boundary of the non-lesion area obtained by the previous analysis, the boundary contour of the non-lesion area in the denoised image is further sharpened, so as to perform gradient enhancement processing on the edge image, such as using the Sobel operator or the Laplacian operator for image sharpening. Through these algorithms, the contour of the boundary of the non-lesion area is enhanced to make it clearer, especially in the low-contrast area, and the accuracy of the boundary is further improved. Afterwards, in combination with the aforementioned background environment features, the sharpened image is refined through the adaptive threshold segmentation technology to ensure that the boundary of the non-lesion area is effectively displayed. This process helps to eliminate noise, highlight the boundary contour of the cataract non-lesion background area, and finally obtain the boundary contour of the cataract non-lesion background area.

[0096] Preferably, the cataract lesion area boundary in the cataract precise lesion area boundary image sample is segmented by upper and lower boundary connection based on the cataract non-lesion background area boundary contour to obtain the cataract lesion area image sample.

[0097] In an embodiment of the present invention, the upper and lower boundaries of the cataract lesion area boundary in the precise lesion area boundary image sample are connected and segmented by combining the previously acquired cataract non-lesion background area boundary contour. First, the background boundary information of the non-lesion area is used as a reference. The boundary image of the cataract lesion area is accurately aligned through image registration technology, and the upper and lower boundaries of the cataract lesion area are effectively connected based on image gradient and connected domain analysis to ensure that the boundary of the lesion area is clear and continuous. Through the region growing algorithm or the dynamic programming method, the upper and lower boundaries can be gradually expanded and connected according to the boundary characteristics of the lesion area to form a complete cataract lesion area segmentation image. The obtained cataract lesion area image sample will clearly mark the upper and lower boundaries of the lesion area, and finally the cataract lesion area image sample is obtained.

[0098] Further, step S15 includes the following steps:

[0099] Step S151: performing image enhancement simulation design according to image color transformation, scale transformation and affine transformation to generate different image enhancement simulation environment constraint conditions;

[0100] In the embodiment of the present invention, the input eye image is subjected to color transformation processing. Specifically, by adjusting the hue, saturation and brightness parameters of the image, the color of the image presents different visual effects. For example, the HSV (hue, saturation, brightness) color space can be used to control the H (hue), S (saturation) and V (brightness) of the original image respectively to simulate the image changes under different lighting conditions. Next, the image is scaled, that is, the image is processed by different scaling ratios to change the size of the image. This can be achieved by linear interpolation or bicubic interpolation methods to ensure that the transformed image has It has appropriate resolution and clarity, and implements affine transformation at the same time. It performs geometric transformation on the image through translation, rotation, scaling and shearing operations. The affine transformation defines a 2x3 transformation matrix to transform the image coordinates, thereby simulating deformations such as different shooting angles and image tilt. During the entire enhancement process, the transformed image will retain its original retinal structural characteristics, thereby providing diverse image samples for subsequent cataract lesion area processing. The corresponding parameter settings need to be optimized according to the preset environmental constraints to ensure the authenticity and effectiveness of the image changes. Finally, different image enhancement simulation environmental constraints are designed and generated.

[0101] Step S152: performing image simulation enhancement processing on the image samples of the cataract lesion area based on different image enhancement simulation environment constraints to obtain cataract lesion enhanced image samples;

[0102] In an embodiment of the present invention, in the step of enhancing the image samples of the cataract lesion area, eye image samples with typical cataract features are first selected as input, and these lesion area image samples are processed by color transformation, scale transformation and affine transformation according to the previously defined different image enhancement simulation environment constraints. In particular, for the cataract lesion area, the color transformation will simulate the performance of the lesion area under different lighting environments by enhancing the yellow or gray tones; the scale transformation can enlarge or reduce the lesion area to simulate different shooting distances or changes in the focal length of the device; the affine transformation can simulate the different changes in the viewing angle of the cataract lesion area. Furthermore, different image quality degradation conditions can be simulated by using techniques such as Gaussian blurring or noise addition to simulate the distortion effect of the eye image of a cataract patient. The obtained enhanced image samples visually show obvious cataract lesion characteristics and have different environmental and equipment influencing conditions, and finally the cataract lesion enhanced image samples are obtained.

[0103] Step S153: Based on different image enhancement simulation environment constraints and using a generative adversarial network, perform image synchronization simulation enhancement on non-cataract eye image samples to obtain non-cataract enhanced image samples.

[0104] In an embodiment of the present invention, by combining different image enhancement simulation environment constraints generated by previous analysis and using a generative adversarial network (GAN) to enhance non-cataract eye image samples, specifically, firstly, a training data set containing normal eye (no cataract lesions) images is prepared, and then the same enhancement simulation environment constraints as before are applied, including color transformation, scale transformation and affine transformation, etc. In order to ensure that the enhanced image is realistic and similar to the actual lesion area image, the discriminator part of the generative adversarial network will evaluate the authenticity of the generated image, and the generator will generate images with different environmental changes through network learning. Non-cataract eye image samples under different conditions (such as lighting, viewing angle, focal length, etc.). During the training process, the generator will continuously optimize the quality of its generated images so that they can visually show diverse non-cataract sample characteristics. The non-cataract image samples enhanced by this method will be used to train the model so that it can distinguish between cataract and non-cataract images and improve the model's generalization ability for actual clinical images. It should be noted that the training process in the generative adversarial network should ensure that the generated image samples can still maintain the basic structural characteristics of the non-cataract eye under different environmental conditions, avoid excessive image distortion, and finally obtain non-cataract enhanced image samples.

[0105] Further, step S2 includes the following steps:

[0106] Step S21: thinning the local area of ​​the cataract lesion enhanced image sample to obtain a detail enhanced image sample of the local area of ​​the cataract lesion;

[0107] In an embodiment of the present invention, edge detection and local detail highlighting are performed on the previously enhanced cataract lesion enhanced image sample by using a high-pass filter or a Laplace operator, especially emphasizing the edge and center of the cataract area. At this time, the details of the local lesion area are clearer, and the background noise is effectively suppressed, making the cataract lesion area more prominent, providing clearer visual information for subsequent analysis, and finally obtaining an image sample with enhanced details of the local cataract lesion area.

[0108] Step S22: performing a lesion area image gradient second-order matrix calculation on the cataract lesion local area detail enhancement image sample to obtain a cataract lesion area image gradient second-order matrix; performing a texture directional feature analysis on the corresponding cataract lesion local area detail enhancement image sample based on the cataract lesion area image gradient second-order matrix to obtain a local texture directional feature of the cataract lesion area;

[0109] In an embodiment of the present invention, the gradient second-order matrix of the image of the local area of ​​the cataract lesion is calculated to extract the detail texture information of the cataract lesion area. First, the gradient of the enhanced image is calculated using the Sobel operator or the Prewitt operator to obtain the horizontal and vertical gradient maps of the image. Next, the second-order matrix of the gradient image is calculated, that is, by performing a quadratic differential operation on the gradient map, the detail changes in the image are extracted to obtain the gradient second-order matrix of the cataract lesion area image. The gradient second-order matrix is ​​mainly used to describe the area with drastic changes in the image and can effectively capture the subtle texture information of the lesion area. In the cataract lesion area, the texture features of the corresponding local cataract lesion area image samples are analyzed by combining the previously calculated second-order matrix of the cataract lesion area image gradient to further extract the texture directional features of the cataract lesion area. The specific operations are as follows: First, the gray level co-occurrence matrix (GLCM) method is used to calculate the texture features of different directions (such as 0°, 45°, 90°, and 135°) from the second-order matrix of the gradient. The gray level co-occurrence matrix can reflect the spatial relationship between pixel pairs and is often used for image texture analysis. By calculating indicators such as texture contrast, homogeneity, and entropy, quantitative data reflecting the texture features of the lesion area can be obtained. The texture distribution characteristics of the cataract lesion area can also be determined through directional analysis. For example, the cataract area presents a specific linear or speckle texture. This information is of great value for the classification and discrimination of cataracts, and finally the local texture directional features of the cataract lesion area are obtained.

[0110] Step S23: performing lesion area structural edge feature recognition analysis on the cataract lesion local area detail enhanced image sample to obtain the cataract lesion area local structural edge feature; performing lesion local feature fusion on the cataract lesion area local texture directional feature and the cataract lesion area local structural edge feature to obtain the cataract lesion local detail feature set;

[0111] In an embodiment of the present invention, the structural edges of the cataract lesion area are identified and analyzed to extract the structural features of the lesion area. The specific implementation method is as follows: first, the image sample after detail enhancement is processed using the Canny edge detection algorithm. The algorithm detects edge information in the image through local gradient changes, and further identifies the edge structure of the lesion area by using the edge detection result in combination with the regional growing algorithm. This process helps to reveal the shape, distribution and edge features of the cataract lesions in the image, especially at the junction of the lesion area and the normal area, where the edge features are significant. By extracting these edge features, the type and degree of the lesion can be further judged, thereby obtaining the local structural edge features of the cataract lesion area. At the same time, by combining the previously extracted texture directional features with the structural edge features for fusion, the specific operations include firstly concatenating the texture feature vector obtained from texture analysis with the edge feature vector obtained from edge recognition to form a multidimensional feature vector, which contains the texture characteristics, edge structure and gradient information of the cataract lesion area, and can comprehensively describe the detailed features of the lesion area. Dimensionality reduction techniques such as principal component analysis (PCA) or linear discriminant analysis (LDA) are used to optimize the fused features, reduce redundant information and highlight key features, so as to ensure that the cataract lesion area can be accurately and comprehensively identified and graded, and finally a local detail feature set of cataract lesions is obtained.

[0112] Step S24: performing mask alignment processing on each image in the cataract lesion enhanced image samples and the non-cataract enhanced image samples to obtain corresponding cataract lesion image samples and non-cataract image samples in the same mask alignment coordinate system;

[0113] In an embodiment of the present invention, an image registration operation is performed on each image in the cataract lesion enhanced image sample and the non-cataract enhanced image sample after previous image enhancement, so as to align all image samples in the same coordinate system, and an image registration algorithm (such as feature-based registration or intensity-based registration method) is applied to each cataract lesion enhanced image and non-cataract enhanced image to ensure that the content of each image is completely spatially corresponding. Usually, common registration techniques are used, such as mutual information method or SIFT / SURF feature-based registration method to automatically detect and match key points in the image. After registration, the generated mask is used to determine the boundary of the lesion area and ensure that the cataract and non-cataract images are compared in the same standard coordinate system. The mask alignment process not only ensures the consistency of the image, but also effectively eliminates the deviation caused by different viewing angles, angles or sizes, and finally obtains the corresponding cataract lesion image samples and non-cataract image samples in the same mask alignment coordinate system.

[0114] Step S25: extracting global structural features of the cataract lesion image samples and non-cataract image samples corresponding to the same mask alignment coordinate system, and obtaining a cataract lesion global structural feature set and a non-cataract global structural feature set corresponding to the same mask alignment coordinate system.

[0115] In an embodiment of the present invention, global structural features are extracted from image samples that have completed mask alignment. Global feature extraction often uses information such as the overall texture, shape, and color of the image to analyze the macroscopic structure of the image. The overall texture features of the image can be extracted through statistical features (such as gray-level co-occurrence matrix (GLCM), texture energy, entropy, etc.), or the image can be analyzed in the frequency domain using methods such as Fourier transform and Wavelet transform to extract global structural features. Especially for cataract lesion images, the morphological changes of the lesion area need to be taken into account in the extraction of structural features, and the special structural features of the lesion area can be identified from a global perspective. By comparing the global structural features of cataract lesion images and non-cataract images, effective information support can be provided for subsequent classification and recognition tasks, and finally a set of global structural features of cataract lesions and a set of global structural features of non-cataracts corresponding to the same mask alignment coordinate system are obtained.

[0116] Further, step S3 includes the following steps:

[0117] Step S31: constructing a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer;

[0118] In an embodiment of the present invention, a multi-task convolutional neural network (CNN) framework is designed, which includes two main task network layers: a cataract classification task network layer and a cataract grading task network layer. Each task network layer uses a convolutional neural network structure for feature extraction, and processes the classification and grading tasks of cataracts respectively. The cataract classification task network layer is responsible for binary classification of eye images to distinguish normal eyes from cataract eyes; the cataract grading task network layer performs multi-classification tasks for different grading of cataracts to identify the severity of cataracts. To ensure efficient training of the two tasks, a shared convolutional layer is used to extract low-level features of the image when designing the network structure, while task-specific fully connected layers or other layers separately process classification and grading tasks. Such a design helps the network to share underlying features when training different tasks, thereby improving the training efficiency and generalization ability of the model, and finally constructing a multi-task convolutional neural network learning framework.

[0119] Step S32: inputting the local detail feature set of cataract lesions into the cataract grading task network layer in the multi-task convolutional neural network learning framework, inputting the corresponding cataract lesion global structure feature set and non-cataract global structure feature set in the same mask alignment coordinate system into the cataract classification task network layer in the multi-task convolutional neural network learning framework, and performing parallel training of cataract recognition models on the cataract classification task network layer and the cataract grading task network layer to obtain a cataract recognition parallel task network model;

[0120] In an embodiment of the present invention, a local detail feature set of cataract lesions previously obtained through local feature analysis is input into a cataract grading task network layer within a multi-task convolutional neural network learning framework, and a global structural feature set of cataract lesions and a non-cataract global structural feature set corresponding to the same mask alignment coordinate system are input into a cataract classification task network layer for corresponding recognition task training to extract a local detail feature set of cataract lesions. These features usually represent the specific lesion conditions of cataracts through fine-grained information of local areas. These local detail features are input into a cataract grading task network layer, which is responsible for identifying and classifying the grading of cataracts. Next, a global structural feature set is extracted, including overall lesion area features of cataracts and global structural features of normal eyes without cataracts. These global structural features are input into a cataract classification task network layer to perform a classification task of whether there is cataract in the eye. In this way, cataract classification and grading tasks are executed in parallel within the same framework, which can not only improve training efficiency, but also ensure that the features of the two tasks are effectively shared during the training process, and finally a cataract recognition parallel task network model is trained.

[0121] Step S33: performing a focal loss calculation of the feature ratio between the normal eye and the cataract eye on the cataract classification task network layer in the cataract recognition parallel task network model to obtain a sample imbalance focal loss of the cataract classification task;

[0122] In an embodiment of the present invention, a focal loss function is used to calculate the loss for the sample imbalance problem of the network layer of the cataract classification task in the network model. The focal loss reduces the loss weight of easy-to-classify samples by introducing an adjustment factor, and concentrates on optimizing those difficult-to-classify samples. Specifically, in view of the imbalance in the proportion of normal eye and cataract eye images in the training data, when calculating the focal loss, the loss value is weighted according to the difference between the category and the predicted probability of each sample, so that the model pays more attention to those minority classes (cataract eye images) that are difficult to classify, and the regularization term is used to control the loss penalty of easy-to-classify samples. In this way, the training bias caused by sample imbalance can be effectively reduced, making the model more accurate in the classification task, and finally obtaining the sample imbalance focal loss for the cataract classification task.

[0123] Step S34: performing hierarchical cross entropy loss calculation on the cataract grading task network layer in the cataract identification parallel task network model to obtain the cataract grading task cross entropy loss;

[0124] In an embodiment of the present invention, in order to train the cataract grading task network layer in the cataract identification parallel task network model, the difference between the predicted result and the true label is calculated by using the cross entropy loss function. The cross entropy loss is usually used for multi-classification problems and can effectively measure the accuracy of the model prediction category. The goal of the cataract grading task is to classify the input eye image into multiple different cataract grading categories. The calculation formula of the cross entropy loss is: H(p,q)=―∑ c p(c)log2q(c), where p(c) is the true label distribution of the sample, q(c) is the model predicted probability distribution of the sample, and c is a different cataract grading category. By calculating the cross entropy loss of the grading task, the model can effectively optimize the grading accuracy of cataracts. The smaller the loss value, the closer the grading result predicted by the model is to the true label, thereby improving the accuracy of the grading task, and finally obtaining the cross entropy loss of the cataract grading task.

[0125] Step S35: Perform task-weighted average loss calculation on the sample imbalance focus loss of the cataract classification task and the cross entropy loss of the cataract grading task to obtain the average loss of the cataract recognition parallel task model; based on the average loss of the cataract recognition parallel task model, perform model loss optimization on the cataract classification task network layer and the cataract grading task network layer in the cataract recognition parallel task network model to generate a cataract recognition optimization model.

[0126] In this embodiment of the present invention, by comprehensively considering the losses of the cataract classification task and the cataract grading task in this step, the total loss function is calculated by weighted average, thereby guiding the optimization process of the entire network. Specifically, the focal loss of the cataract classification task and the cross entropy loss of the cataract grading task are first calculated, which are marked as L class and L grade Then, the task weight coefficients λ1 and λ2 are used to adjust the loss weights of the two tasks, so as to calculate the average loss of the cataract recognition parallel task model: L total =λ1L class +λ2L grade , where λ1 and λ2 adjust the weights according to the relative importance of the tasks. At the same time, the average loss L is calculated based on the cataract identification parallel task model. total The back propagation algorithm (such as Adam optimizer) is used to train the cataract classification task network layer and the cataract grading task network layer, update the parameters in the network, and optimize the performance of the cataract recognition model. Through this optimization process, the model can improve the accuracy of grading while ensuring the classification accuracy, thereby generating a comprehensive optimized cataract recognition model and finally obtaining a cataract recognition optimization model.

[0127] Furthermore, in step S33, the focus loss calculation of the feature ratio between the normal eye and the cataract eye in the cataract classification task network layer in the cataract recognition parallel task network model is calculated by the feature sample ratio focus loss calculation formula, wherein the feature sample ratio focus loss calculation formula is specifically:

[0128]

[0129] In the formula, is the sample imbalance focal loss of the cataract classification task, N is the total number of samples corresponding to the cataract classification task network layer, and p i is the predicted probability that the i-th sample belongs to the cataract eye class, γ is the focus loss adjustment factor, w0 is the weight factor of the normal eye class sample, y i is the true label of the i-th sample, y i ∈{0,1}, where 0 represents the normal eye category and 1 represents the cataract eye category, is the normal eye category indicator function, indicating that if y i =0, then it is 1, otherwise it is 0, w1 is the weight factor of cataract eye category samples, is the cataract eye category indicator function, indicating that if y i =1, then it is 1, otherwise it is 0, x i is the true feature corresponding to the i-th sample, η(x i) is the regularization term, λ is the regularization coefficient, is the prediction feature corresponding to the i-th sample.

[0130] The present invention obtains a feature sample ratio focal loss calculation formula by using a specific mathematical model and verifying it, which is used to calculate the feature ratio focal loss between normal eyes and cataract eyes in the cataract classification task network layer in the cataract recognition parallel task network model. In the actual cataract classification task, it is often encountered that the number of "normal eye" category samples is greater than the number of "cataract eye" category samples. This category imbalance will cause the network to tend to make predictions for the "normal eye" category, resulting in a deviation in the classification result. The feature sample ratio focal loss adjusts the impact of category imbalance by introducing a weight factor and a focal loss adjustment factor. w0 and w1 are respectively The weight factors of normal eye and cataract eye categories can be dynamically adjusted according to the number of samples of different categories in the dataset to balance the influence between categories. For example, if there are fewer samples of cataract eyes, the weight of w1 can be increased to make the network pay more attention to the classification task of cataract eyes during training. γ is the focal loss adjustment factor, which can adjust the influence of the loss function according to the confidence of the prediction. When the confidence of the wrongly predicted samples is low, the focal loss will make the model pay more attention to these difficult samples. This helps the model improve its sensitivity to difficult-to-classify samples when facing the minority class (cataract eyes), thereby avoiding the training bias caused by class imbalance. The core idea of ​​focal loss is to increase the weight of difficult-to-classify samples so that the model pays more attention to these difficult samples. In this formula, (1-p i ) γ and (p i ) γ is an adjustment item for normal eyes and cataract eyes, indicating that when the predicted probability of a sample is closer to the true label, its loss is smaller, and when the sample is difficult to classify (i.e., the predicted probability is far from the true label), its loss is larger. This mechanism helps the model to give more learning opportunities during training, especially for minority samples (such as cataract eyes), thereby improving the accuracy of these difficult-to-classify samples. i When η(x) is close to 0 (normal eye) or close to 1 (cataract eye), the loss will be relatively small, and the training focus of the network will shift to samples with intermediate prediction probabilities, which are usually more difficult to classify. Therefore, the network can improve its performance on these samples. i ) is a regularization term used to control model complexity and prevent overfitting. It calculates the Euclidean distance between the true feature and the predicted feature of each sample. To perform regularization, such regularization can effectively limit the degree of freedom of the model and help the network focus on more representative features. During the training process, the model must not only optimize the classification task, but also maintain the stability and consistency of the features. Among them, λ is the regularization coefficient, which balances the weights of the loss term and the regularization term and controls the strength of the regularization. Appropriate regularization helps prevent the model from being too dependent on certain specific training samples, thereby avoiding overfitting. In addition, in the multi-task learning framework, cataract classification and cataract grading tasks are trained in parallel. The feature sample ratio focal loss can help the classification task adjust the sample imbalance, thereby making the loss of the classification task more reasonable and fairer. This optimization process will have a positive effect on the two tasks in the entire framework (cataract classification and cataract grading), which will help improve the overall model performance of the framework. In summary, this formula fully considers the sample imbalance focal loss of the cataract classification task. The total number of samples N corresponding to the cataract classification task in the network layer, and the predicted probability p that the i-th sample belongs to the cataract eye class i , focus loss adjustment factor γ, normal eye category sample weight factor w0, the true label y of the i-th sample i ,y i ∈{0,1}, where 0 represents the normal eye category, 1 represents the cataract eye category, and the normal eye category indicator function It means if y i =0, then it is 1, otherwise it is 0, cataract eye category sample weight factor w1, cataract eye category indicator function It means if y i =1, then it is 1, otherwise it is 0, the true feature x corresponding to the i-th sample i , the regularization term η(x i ), regularization coefficient λ, prediction feature corresponding to the i-th sample Among them, through the regularization coefficient λ, the total number of samples N corresponding to the cataract classification task network layer, the true feature x corresponding to the i-th sample i And the prediction features corresponding to the i-th sample It constitutes a regularization term η(x i ) Imbalanced focal loss based on sample of cataract classification task The correlation between the above parameters constitutes a functional relationship This formula can realize the focal loss calculation process of the feature ratio between the normal eye and the cataract eye in the cataract classification task network layer within the cataract recognition parallel task network model, thereby improving the accuracy and robustness of the classification task within the cataract classification task network layer.

[0131] Furthermore, the present invention also provides a training system for a cataract recognition model, which is used to execute the training method for a cataract recognition model as described above. The training system for a cataract recognition model includes:

[0132] The eye image sample simulation enhancement module is used to obtain eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; perform lesion area segmentation on the cataract eye image samples at different stages to obtain cataract lesion area image samples; perform image synchronization simulation enhancement on the cataract lesion area image samples and non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples;

[0133] The eye image local and global feature extraction module is used to extract local detail features of lesions from cataract lesion enhanced image samples to obtain a local detail feature set of cataract lesions; perform mask alignment global structure feature extraction on cataract lesion enhanced image samples and non-cataract enhanced image samples, thereby obtaining a corresponding cataract lesion global structure feature set and non-cataract global structure feature set in the same mask alignment coordinate system;

[0134] A cataract recognition model training and optimization module is used to construct a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer, and the multi-task convolutional neural network learning framework is used to train a cataract recognition model based on a local detail feature set of cataract lesions and a global structure feature set of cataract lesions corresponding to the same mask alignment coordinate system and a non-cataract global structure feature set, and the cataract classification task network layer and the cataract grading task network layer are respectively optimized with focal weighted loss to generate a cataract recognition optimization model;

[0135] The online incremental update module of the cataract recognition model is used to obtain the cataract-related key feature set from the eye image training samples through the residual network and the attention mechanism, and to perform online incremental learning updates on the cataract recognition optimization model based on the cataract-related key feature set to generate an online incremental update model for cataract recognition.

[0136] Furthermore, the present invention also provides a storage medium having a computer program stored thereon, and when the computer program is executed, the training method for the cataract recognition model as described above is implemented.

[0137] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A training method for a cataract recognition model, characterized in that: The following steps are involved: Step S1: acquiring eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; performing lesion area segmentation on the cataract eye image samples at different stages to obtain cataract lesion area image samples; performing image synchronization simulation enhancement on the cataract lesion area image samples and non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples; Step S2: extracting local detail features of lesions from cataract lesion enhanced image samples to obtain a local detail feature set of cataract lesions; extracting global structural features from cataract lesion enhanced image samples and non-cataract enhanced image samples by mask alignment to obtain a global structural feature set of cataract lesions and a global structural feature set of non-cataract lesions corresponding to the same mask alignment coordinate system; Step S3: constructing a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer, and training the multi-task convolutional neural network learning framework for a cataract recognition model based on a local detail feature set of cataract lesions and a corresponding global structure feature set of cataract lesions and a non-cataract global structure feature set in the same mask alignment coordinate system, and performing focal weighted loss optimization on the cataract classification task network layer and the cataract grading task network layer, respectively, to generate a cataract recognition optimization model; Step S4: Obtain a cataract-related key feature set from eye image training samples through a residual network combined with an attention mechanism, and perform online incremental learning updates on the cataract recognition optimization model based on the cataract-related key feature set to generate an online incremental update model for cataract recognition.

2. The training method for cataract recognition model according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: acquiring eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; Step S12: performing image spectral band distribution analysis on cataract eye image samples at different stages to obtain the spectral band distribution law of cataract eye images; performing background noise removal on the corresponding cataract eye image samples based on the spectral band distribution law of cataract eye images to obtain cataract denoised image samples; Step S13: performing eye lens fine texture analysis on the cataract denoising image sample to obtain cataract eye lens fine texture features; Step S14: Based on the fine texture features of the cataract eye lens, the corresponding cataract denoised image samples are subjected to hierarchical fuzzy classification screening of the lesion area to obtain candidate layer samples of the cataract eye lesion area; the candidate layer samples of the cataract eye lesion area are subjected to boundary morphological correction to obtain precise cataract lesion area boundary image samples; based on the background environment variables of the non-lesion area in the cataract denoised image samples, the precise cataract lesion area boundary image samples are subjected to upper and lower boundary connection segmentation to obtain cataract lesion area image samples; Step S15: Perform image synchronization simulation enhancement on the cataract lesion area image samples and the non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples.

3. The training method for cataract recognition model according to claim 2, characterized in that: The step S14 of performing hierarchical fuzzy classification screening of the lesion area on the corresponding cataract denoised image sample based on the fine texture features of the cataract eye lens comprises the following steps: Based on the fine texture features of the cataract eye lens, the corresponding cataract denoising image samples are divided into lesion area images to obtain cataract eye lesion area image samples; Performing eye lens grayscale gradient calculation for each image in the cataract eye lesion area image sample to obtain an eye lens grayscale gradient value corresponding to each cataract eye lesion area image; performing eye lens chromaticity calculation for the corresponding images in the cataract eye lesion area image sample based on the eye lens grayscale gradient value corresponding to each cataract eye lesion area image to obtain an eye lens area chromaticity value corresponding to each cataract eye lesion area image; Performing a regional spatial distribution analysis on the fine texture features of the cataractous eye lens to obtain a regional spatial distribution map of the cataractous eye lens texture features; calculating the eye lens opacity for each image in the cataractous eye lesion area image sample based on the regional spatial distribution map of the cataractous eye lens texture features to obtain an eye lens area opacity value corresponding to each cataractous lesion area image; Based on the chromaticity value of the eye lens area and the turbidity value of the eye lens area corresponding to each cataract lesion area image, a regional fuzzy membership calculation is performed on each image in the cataract eye lesion area image sample to obtain a regional fuzzy membership matrix corresponding to each cataract lesion area image; According to the regional fuzzy membership matrix corresponding to each cataract lesion area image, the corresponding images in the cataract eye lesion area image samples are screened by lesion area hierarchical fuzzy classification to obtain cataract eye lesion area candidate layer samples.

4. The training method for cataract recognition model according to claim 2, characterized in that: The step S14 of performing upper and lower boundary connection segmentation on the cataract precise lesion area boundary image sample based on the background environment variables of the non-lesion area in the cataract denoising image sample comprises the following steps: Perform background environment analysis on the non-lesion area of ​​the cataract denoised image samples to obtain background environment variables of the non-lesion area of ​​the cataract, including background illumination and background color of the non-lesion area. The boundary background environmental characteristics of the cataract non-lesion area background environment variables are analyzed to obtain the boundary background environmental characteristics of the cataract non-lesion area; Based on the boundary background environment characteristics of the cataract non-lesion area, the boundary contour of the non-lesion area in the cataract denoising image sample is sharpened to obtain the boundary contour of the cataract non-lesion background area; Based on the boundary contour of the cataract non-lesion background area, the upper and lower boundary connection segmentation of the cataract lesion area boundary in the cataract precise lesion area boundary image sample is performed to obtain the cataract lesion area image sample.

5. The training method for cataract recognition model according to claim 2, characterized in that: Step S15 includes the following steps: Step S151: performing image enhancement simulation design according to image color transformation, scale transformation and affine transformation to generate different image enhancement simulation environment constraint conditions; Step S152: performing image simulation enhancement processing on the image samples of the cataract lesion area based on different image enhancement simulation environment constraints to obtain cataract lesion enhanced image samples; Step S153: Based on different image enhancement simulation environment constraints and using a generative adversarial network, perform image synchronization simulation enhancement on non-cataract eye image samples to obtain non-cataract enhanced image samples.

6. The training method for cataract recognition model according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: thinning the local area of ​​the cataract lesion enhanced image sample to obtain a detail enhanced image sample of the local area of ​​the cataract lesion; Step S22: performing a lesion area image gradient second-order matrix calculation on the cataract lesion local area detail enhancement image sample to obtain a cataract lesion area image gradient second-order matrix; performing a texture directional feature analysis on the corresponding cataract lesion local area detail enhancement image sample based on the cataract lesion area image gradient second-order matrix to obtain a local texture directional feature of the cataract lesion area; Step S23: performing lesion area structural edge feature recognition analysis on the cataract lesion local area detail enhanced image sample to obtain the cataract lesion area local structural edge feature; performing lesion local feature fusion on the cataract lesion area local texture directional feature and the cataract lesion area local structural edge feature to obtain the cataract lesion local detail feature set; Step S24: performing mask alignment processing on each image in the cataract lesion enhanced image samples and the non-cataract enhanced image samples to obtain corresponding cataract lesion image samples and non-cataract image samples in the same mask alignment coordinate system; Step S25: extracting global structural features of the cataract lesion image samples and non-cataract image samples corresponding to the same mask alignment coordinate system, and obtaining a cataract lesion global structural feature set and a non-cataract global structural feature set corresponding to the same mask alignment coordinate system.

7. The training method for cataract recognition model according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: constructing a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer; Step S32: inputting the local detail feature set of cataract lesions into the cataract grading task network layer in the multi-task convolutional neural network learning framework, inputting the corresponding cataract lesion global structure feature set and non-cataract global structure feature set in the same mask alignment coordinate system into the cataract classification task network layer in the multi-task convolutional neural network learning framework, and performing parallel training of cataract recognition models on the cataract classification task network layer and the cataract grading task network layer to obtain a cataract recognition parallel task network model; Step S33: performing a focal loss calculation of the feature ratio between the normal eye and the cataract eye on the cataract classification task network layer in the cataract recognition parallel task network model to obtain a sample imbalance focal loss of the cataract classification task; Step S34: performing hierarchical cross entropy loss calculation on the cataract grading task network layer in the cataract recognition parallel task network model to obtain the cataract grading task cross entropy loss; Step S35: Perform task-weighted average loss calculation on the sample imbalance focus loss of the cataract classification task and the cross entropy loss of the cataract grading task to obtain the average loss of the cataract recognition parallel task model; based on the average loss of the cataract recognition parallel task model, perform model loss optimization on the cataract classification task network layer and the cataract grading task network layer in the cataract recognition parallel task network model to generate a cataract recognition optimization model.

8. The training method for cataract recognition model according to claim 7, characterized in that: The focus loss calculation of the feature ratio between the normal eye and the cataract eye for the cataract classification task network layer in the cataract recognition parallel task network model in step S33 is calculated by the feature sample ratio focus loss calculation formula, wherein the feature sample ratio focus loss calculation formula is specifically: In the formula, is the sample imbalance focal loss of the cataract classification task, N is the total number of samples corresponding to the cataract classification task network layer, and p i is the predicted probability that the i-th sample belongs to the cataract eye class, γ is the focus loss adjustment factor, w0 is the weight factor of the normal eye class sample, y i is the true label of the i-th sample, y i ∈{0,1}, where 0 represents the normal eye category and 1 represents the cataract eye category, is the normal eye category indicator function, indicating that if y i =0, then it is 1, otherwise it is 0, w1 is the weight factor of cataract eye category samples, is the cataract eye category indicator function, indicating that if y i =1, then it is 1, otherwise it is 0, x i is the true feature corresponding to the i-th sample, η(x i ) is the regularization term, λ is the regularization coefficient, is the prediction feature corresponding to the i-th sample.

9. A training system for a cataract recognition model, characterized in that: Used to execute the training method for cataract recognition model according to claim 1, the training system for cataract recognition model comprises: The eye image sample simulation enhancement module is used to obtain eye image training samples, wherein the eye image training samples include cataract eye image samples and non-cataract eye image samples at different stages, wherein the different stages include early, middle and late stages; perform lesion area segmentation on the cataract eye image samples at different stages to obtain cataract lesion area image samples; perform image synchronization simulation enhancement on the cataract lesion area image samples and non-cataract eye image samples to obtain cataract lesion enhanced image samples and non-cataract enhanced image samples; The eye image local and global feature extraction module is used to extract local detail features of lesions from cataract lesion enhanced image samples to obtain a local detail feature set of cataract lesions; perform mask alignment global structure feature extraction on cataract lesion enhanced image samples and non-cataract enhanced image samples, thereby obtaining a corresponding cataract lesion global structure feature set and non-cataract global structure feature set in the same mask alignment coordinate system; A cataract recognition model training and optimization module is used to construct a multi-task convolutional neural network learning framework, wherein the multi-task convolutional neural network learning framework includes a cataract classification task network layer and a cataract grading task network layer, and the multi-task convolutional neural network learning framework is used to train a cataract recognition model based on a local detail feature set of cataract lesions and a global structure feature set of cataract lesions corresponding to the same mask alignment coordinate system and a non-cataract global structure feature set, and the cataract classification task network layer and the cataract grading task network layer are respectively optimized with focal weighted loss to generate a cataract recognition optimization model; The online incremental update module of the cataract recognition model is used to obtain the cataract-related key feature set from the eye image training samples through the residual network and the attention mechanism, and to perform online incremental learning updates on the cataract recognition optimization model based on the cataract-related key feature set to generate an online incremental update model for cataract recognition.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the training method for a cataract recognition model as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Medical image analysis processing method based on AI

    CN120298329A

  • Intraocular lens implantation monitoring method and operating microscope system

    CN120643181A