Classification method, device, equipment, storage medium and computer program product
Through retinal image analysis, pre-trained and secondary training classification models are used to distinguish diabetic nephropathy from other renal diseases, providing a non-invasive tool, solving the distinguishing difficulties in the prior art, and improving classification efficiency and diagnostic accuracy.
Patent Information
- Application Number
- CN202410575366.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-05-10
AI Technical Summary
The prior art is difficult to non-invasively distinguish diabetic nephropathy (DN) from renal diseases (NDKD) caused by other causes, resulting in different treatment methods and irreversible renal damage.
A non-invasive tool is provided by acquiring retinal images and using pre-trained and quadratic classification models for disease-induced factors, including feature extraction and classification.
It improves the efficiency of disease type classification, reduces the risk of invasive examinations, narrows the scope of diagnosis, and improves the accuracy of DKD screening.
Smart Images

Figure CN118570123B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer vision and medical image processing, and in particular to a classification method, apparatus, device and storage medium. Background Art
[0002] Diabetic Kidney Disease (DKD) occurs in approximately 40% of diabetic patients and is closely associated with significantly increased morbidity and mortality. Early detection and intervention of DKD through regular screening has become an established and essential clinical strategy in diabetes management.
[0003] Among diabetic patients with DKD, some have diabetic nephropathy (DN) caused by diabetes, and some have kidney diseases (NDKD) caused by other reasons. The treatments for kidney diseases caused by different reasons are completely different. Many forms of NDKD can be successfully treated (for example, glomerulonephritis treated with immunosuppressive therapy). On the contrary, isolated DN has a more progressive course in the vast majority of patients and may cause irreversible kidney damage. Therefore, how to provide a non-invasive method to distinguish diabetic nephropathy (DN) from kidney diseases caused by other reasons (NDKD) has become a technical problem that needs to be urgently solved in the current medical field. Summary of the invention
[0004] Based on this, it is necessary to provide a classification method, device, equipment and storage medium that can distinguish diabetic nephropathy (DN) from kidney disease caused by other reasons (NDKD) in response to the above technical problems.
[0005] In a first aspect, the present application provides a classification method, the method comprising:
[0006] acquiring a first retinal image of a first target object;
[0007] The first retinal image is input into a first classification model for classification to obtain a first classification result; the first classification result is used to indicate the inducing factors of the target disease suffered by the first target subject.
[0008] In one embodiment, the method further comprises:
[0009] acquiring a first retinal image of a second target object;
[0010] Input the second retinal image into the second classification model for classification to obtain a second classification result; the second classification result includes information indicating whether the second target object has the target disease and the risk level of having the target disease; the type of the target disease is different from the type of retinal-related diseases.
[0011] In one embodiment, the classification model includes a feature extraction sub-model and a classification sub-model. Input the first retinal image into the first classification model for classification to obtain a first classification result, including:
[0012] Input the first retinal image into the feature extraction sub-model for feature extraction to obtain image features; the feature extraction sub-model is obtained through pre-training and secondary training;
[0013] Input the image features into the classification sub-model for classification to obtain a first classification result; the classification sub-model is obtained through secondary training.
[0014] In one embodiment, the method further includes:
[0015] Pre-train the initial encoder according to the first retinal sample image to obtain a pre-trained encoder;
[0016] Train the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain a first classification model;
[0017] Train the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0018] In one embodiment, pre-training the initial encoder according to the first retinal sample image to obtain a pre-trained encoder includes:
[0019] Input the first retinal sample image into the initial encoder to obtain a first encoded output result;
[0020] Process the first retinal sample image to obtain multiple fourth retinal sample images, and input the multiple fourth retinal sample images into a preset momentum encoder to obtain a second encoded output result;
[0021] Determine the target loss according to the first encoded output result and the second encoded output result;
[0022] Pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
[0023] In one embodiment, determining the target loss according to the first encoded output result and the second encoded output result includes:
[0024] Determine a contrastive loss based on a first encoded output result and a second encoded output result;
[0025] Determine a weakly supervised loss based on the first encoded output result and the second encoded output result;
[0026] Determine an objective loss based on the contrastive loss and the weakly supervised loss.
[0027] In one embodiment, training a first initial classification model based on a second retinal sample image and a pre-trained encoder to obtain a first classification model, includes:
[0028] Input the second retinal sample image into the pre-trained encoder to obtain a first encoded feature;
[0029] Input the first encoded feature into the first initial classification model to obtain a first output result;
[0030] Determine a first loss based on the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0031] In one embodiment, training a second initial classification model based on a third retinal sample image and a pre-trained encoder to obtain a second classification model, includes:
[0032] Input the third retinal sample image into the pre-trained encoder to obtain a second encoded feature;
[0033] Input the second encoded feature into the second initial classification model to obtain a second output result;
[0034] Determine a second loss based on the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0035] In a second aspect, the present application further provides a classification device, the device includes:
[0036] A first acquisition module, configured to acquire a first retinal image of a first target object;
[0037] A first classification module, configured to input the first retinal image into the first classification model for classification to obtain a first classification result; the first classification result is used to represent an inducing factor of a target disease suffered by the first target object.
[0038] In a third aspect, the present application further provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0039] Obtain a first retinal image of a first target object;
[0040] Input the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0041] Fourthly, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0042] Obtain a first retinal image of a first target object;
[0043] Input the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0044] Fifthly, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0045] Obtain a first retinal image of a first target object;
[0046] Input the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0047] In the above classification method, device, equipment and storage medium, the method obtains a first retinal image of a first target object, and then inputs the first retinal image into a first classification model for classification to obtain a first classification result, where the first classification result is used to represent the inducing factors of the target disease suffered by the first target object. The above method provides a simpler and non-invasive tool to analyze the inducing factors of the target disease suffered by the target object by analyzing the retinal image, so as to replace the irreversible damage caused by the existing invasive tool, assist in narrowing the diagnosis range and improve the classification efficiency. In addition, since the type of the target disease is different from the type of retinal-related diseases, the ability to classify disease types using retinal images also belongs to the unique application effect of this method. Description of the Drawings
[0048] Figure 1 It is the internal structure diagram of a computer device in an embodiment;
[0049] Figure 2 It is the flowchart of the classification method in an embodiment;
[0050] Figure 3 It is a schematic flow chart of a classification method in another embodiment;
[0051] Figure 4 It is a schematic flow chart of a classification method in another embodiment;
[0052] Figure 5 It is a schematic flow chart of a classification method in another embodiment;
[0053] Figure 6 It is a schematic flow chart of a classification method in another embodiment;
[0054] Figure 7 It is a schematic flow chart of a classification method in another embodiment;
[0055] Figure 8 It is a schematic flow chart of a classification method in another embodiment;
[0056] Figure 9 It is a schematic flow chart of a classification method in another embodiment;
[0057] Figure 10 It is a schematic flow chart of a classification method in another embodiment;
[0058] Figure 11 It is a structural block diagram of a classification device in an embodiment. Detailed implementation manners
[0059] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] Diabetic Kidney Disease (DKD) occurs in approximately 40% of diabetic patients and is closely related to a significantly increased morbidity and mortality. In diabetes management, early detection and intervention of DKD through regular screening have become an established and essential clinical strategy. Currently, DKD screening is mainly based on collecting blood and urine samples, and calculating the urine albumin / creatinine ratio (ACR) by measuring the estimated glomerular filtration rate (eGFR) in the blood and albuminuria (as the earliest sign of kidney damage) in the urine.
[0061] Among diabetic patients with DKD, some have diabetic nephropathy (DN) caused by diabetes, and some have kidney diseases (NDKD) caused by other reasons. The treatment methods for kidney diseases caused by different reasons are completely different. Many forms of NDKD can be successfully treated (for example, glomerulonephritis treated by immunosuppressive therapy). On the contrary, isolated DN has a more progressive process in the vast majority of patients and may cause irreversible kidney damage. Therefore, how to provide a non-invasive way to distinguish diabetic nephropathy (DN) from kidney diseases (NDKD) caused by other reasons has become a technical problem that needs to be solved urgently in the current medical field. This application provides a classification method to solve the above technical problems. The following examples will specifically illustrate the classification method described in this application.
[0062] The classification method provided in the embodiment of the present application can be applied to Figure 1 The computer device shown in the figure can be a terminal or a server, and its internal structure diagram can be as shown in Figure 1 As shown, the computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a classification method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0063] Those skilled in the art will understand that Figure 1The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0064] In one embodiment, as Figure 2 shown, a classification method is provided. Taking the computer device to which this method is applied Figure 1 as an example for illustration, it includes the following steps:
[0065] S101, obtain the first retinal image of the first target object.
[0066] Among them, the first target object is a patient with diabetic kidney disease, that is, a patient suffering from diabetes and kidney disease. The first retinal image is the retinal image of a patient with diabetic kidney disease.
[0067] In the embodiment of the present application, when it is necessary to distinguish the inducing factors of the target disease suffered by the first target object, the computer device can obtain the first retinal image of the first target object. Specifically, the computer device can start its own image acquisition device to actively obtain the first retinal image of the first target object. Optionally, the computer device obtains the first retinal image of the first target object by receiving images sent by other devices.
[0068] S102, input the first retinal image into the first classification model for classification to obtain the first classification result.
[0069] Among them, the first classification result is used to represent the inducing factors of the target disease suffered by the first target object. For example, the inducing factor is kidney disease caused by diabetes or kidney disease caused by other reasons. The first classification model is used to classify diabetic kidney disease (DKD) into diabetic nephropathy (DN) and kidney disease caused by other reasons (NDKD). The first classification model can be a neural network model or a machine learning model, and can be a supervised network model or an unsupervised network model.
[0070] In the embodiment of the present application, the computer device can pre-train an initial network model based on the first retinal image sample images to obtain the first classification model. After the computer device obtains the first retinal image of the first target object based on the above steps, it can input the first retinal image into the pre-trained first classification model for classification, and classify the inducing factors of the target disease suffered by the first target object through the first classification model to obtain the first classification result.
[0071] The classification method provided by the embodiments of the present application obtains the first retinal image of the first target object, and then inputs the first retinal image into the first classification model for classification to obtain the first classification result, where the first classification result is used to represent the inducing factors of the target disease suffered by the first target object. The above method provides a simpler and non-invasive tool to analyze the inducing factors of the target disease suffered by the first target object, replacing the irreversible damage caused by existing invasive tools, assisting in narrowing the diagnosis scope and improving the classification efficiency. In addition, since the type of the target disease is different from the type of retinal-related diseases, the ability to classify disease types using retinal images also belongs to the unique application effect of this method.
[0072] In one embodiment, a classification method is further provided, as Figure 3 shown, Figure 2 the method described in the embodiment further includes:
[0073] S103, obtain the second retinal image of the second target object.
[0074] Among them, the second target object includes at least one of a normal person and a patient with diabetic kidney disease (DKD). The second retinal image includes at least one of the retinal image of a normal person, the retinal image of diabetic nephropathy (DN), and the retinal image of kidney disease caused by other reasons (NDKD).
[0075] In the embodiments of the present application, when it is necessary to determine whether the second target object has a target disease, the computer device can obtain the second retinal image of the second target object. Specifically, the computer device can activate its own image acquisition device to actively obtain the second retinal image of the second target object. Optionally, the computer device obtains the second retinal image of the second target object by receiving images sent by other devices.
[0076] S104, input the second retinal image into the second classification model for classification to obtain the second classification result.
[0077] Among them, the second classification model is used to confirm whether the target disease is present, for example, whether diabetic kidney disease (DKD) is present. The second classification model can be a neural network model or a machine learning model, and can be a supervised network model or an unsupervised network model. The second classification result includes whether the second target object has the target disease and the risk level of having the target disease. The risk level includes a non-DKD group, a DKD - moderately increased risk group, a DKD - high risk group, or a DKD - extremely high risk group. The type of the target disease is different from the type of retinal-related diseases. For example, the target disease is diabetic kidney disease (DKD).
[0078] In the embodiments of the present application, the computer device may pre-train an initial network model based on the second retinal image sample image to obtain a second classification model. After the computer device obtains the second retinal image of the second target object based on the above steps, the second retinal image may be input into the pre-trained second classification model for judgment. The second classification model is used to judge whether the second target object has the target disease and the risk level of having the target disease, so as to obtain a second classification result.
[0079] Optionally, in the actual application process, when the second classification result indicates that the second target object has the target disease, the second classification result may be used as the input of the first classification model, and the first classification model is used to classify the inducing factors of the target disease suffered by the second target object, so as to obtain a first classification result.
[0080] The method described in the embodiments of the present application can determine whether the second target object has the target disease by using the second retinal image, which helps to improve the challenges of the existing DKD screening method using urine or blood samples in primary care and resource-poor environments. The above method can improve the screening efficiency of DKD.
[0081] In one embodiment, the above classification model includes a feature extraction sub-model and a classification sub-model. On this basis, a specific implementation manner for obtaining the first classification result is also provided, as Figure 4 shown, the "inputting the first retinal image into the first classification model for classification to obtain a first classification result" in the above step S102 includes:
[0082] S201, inputting the first retinal image into the feature extraction sub-model for feature extraction to obtain image features.
[0083] Among them, the feature extraction sub-model is obtained through pre-training and secondary training. The classification model includes a feature extraction sub-model and a classification sub-model. The feature extraction sub-model may be a neural network model or a machine learning model, and may be a supervised network model or an unsupervised network model. The classification sub-model may be a neural network model or a machine learning model, and may be a supervised network model or an unsupervised network model.
[0084] In the embodiments of the present application, the computer device may pre-train and secondary-train the initial feature extraction sub-network model based on the first retinal image sample image to obtain a feature extraction sub-model. Then, after the computer device obtains the first retinal image, the first retinal image may be input into the feature extraction sub-model for feature extraction to obtain image features.
[0085] S202, inputting the image features into the classification sub-model for classification to obtain a first classification result.
[0086] Among them, the classification sub-model is obtained through secondary training.
[0087] In the embodiments of the present application, the computer device can first perform secondary training on the initial classification sub-network model based on the first retinal image sample image to obtain the classification sub-model. Then, after the computer device obtains the image features of the first retinal image based on the above steps, it can input the image features into the classification sub-model for classification to obtain the first classification result.
[0088] In one embodiment, a method for training a second initial classification model to obtain a second classification model is also provided, as Figure 5 shown. The method includes:
[0089] S301, pre-train the initial encoder according to the first retinal sample image to obtain the pre-trained encoder.
[0090] Among them, the first retinal sample image includes the retinal images of normal people and the fundus images of diabetic patients who have undergone kidney biopsy.
[0091] In the embodiments of the present application, the computer device can obtain the first retinal sample image through web crawling technology. Specifically, the first retinal sample image can utilize 734,084 fundus images from 90,067 participants, and the fundus images of 267 diabetic patients who have undergone kidney biopsy. Then, pre-train the initial encoder based on the first retinal sample image to obtain the pre-trained encoder. Specifically, this process can be completed through a supervised training method or an unsupervised training method.
[0092] Specifically, the process of the computer device pre-training the initial encoder according to the first retinal sample image to obtain the pre-trained encoder is pre-trained based on a self-supervised method. Existing self-supervised methods based on instance discrimination face the problem of class conflict, that is, when highly similar instances are forcibly separated, it will lead to a decrease in the quality of visual representation. This embodiment uses the similarity of instances as an inherent weak supervision to alleviate the class collision problem in contrast learning. Assuming that there is a common semantics between similar samples, this embodiment will assign similar weak labels to these samples. This embodiment uses the nearest neighbor graph for label assignment and adopts the Hoshen-Kopelman algorithm for graph segmentation. After segmentation, samples in the same connected component will obtain the same weak label. In addition to the initial encoder , momentum encoder and projection head in common self-supervised methods (such as MoCo and SimCLR), To explore the similarity of samples in retinal fundus images. By utilizing momentum updates and emphasizing temporal consistency, parameters of are adjusted for learning in accordance with where the encoder momentum coefficient has an initial value set to 0.996 and is adjusted to 1 according to a cosine function.
[0093] S302. Train the first initial classification model based on the second retinal sample image and the pre-trained encoder to obtain the first classification model.
[0094] Among them, the second retinal sample image is a retinal image of a patient with diabetic kidney disease (DKD).
[0095] In an embodiment of this application, the computer device can obtain the second retinal sample image through web crawling technology, and then train the first initial classification model based on the second retinal sample image and the pre-trained encoder to obtain the first classification model. This process can be completed through a supervised training method or an unsupervised training method.
[0096] S303. Train the second initial classification model based on the third retinal sample image and the pre-trained encoder to obtain the second classification model.
[0097] Among them, the third retinal sample image includes retinal images of normal people and patients with diabetic kidney disease (DKD).
[0098] In an embodiment of this application, the computer device can obtain the third retinal sample image through web crawling technology, and then train the second initial classification model based on the third retinal sample image and the pre-trained encoder to obtain the second classification model. This process can be completed through a supervised training method or an unsupervised training method.
[0099] In one embodiment, a specific implementation method for pre-training the initial encoder to obtain the pre-trained encoder is also provided. As Figure 6 shown, "Pre-train the initial encoder based on the first retinal sample image to obtain the pre-trained encoder" in the above step S301 includes:
[0100] S401. Input the first retinal sample image into the initial encoder to obtain the first encoded output result.
[0101] In an embodiment of this application, as Figure 7 shown, the computer device inputs the first retinal sample image (corresponding to Figure 7 in ) into the initial encoder (corresponding to Figure 7the encoder in ), to obtain the first encoded output result (corresponding to Figure 7 in and .
[0102] S402. Process the first retinal sample image to obtain multiple fourth retinal sample images, and input the multiple fourth retinal sample images into a preset momentum encoder to obtain a second encoded output result.
[0103] Among them, the fourth retinal sample image is an image obtained by processing the first retinal sample image.
[0104] In the embodiment of the present application, after obtaining the first retinal sample image, the computer device can perform at least one of horizontal flipping, image compression, random brightness / contrast adjustment, random gamma correction, adding Gaussian noise, rotation, shearing, and random size cropping on the first retinal sample image to obtain a processed image, and use the processed image as the fourth retinal sample image (corresponding to Figure 7 in ), and then input the multiple fourth retinal sample images into a preset momentum encoder (corresponding to Figure 7 the encoder in ), to obtain a second encoded output result (corresponding to Figure 7 in and ).
[0105] S403. Determine the target loss according to the first encoded output result and the second encoded output result.
[0106] Specifically, as Figure 8 shown, "determine the target loss according to the first encoded output result and the second encoded output result" in the above step S403 includes:
[0107] S4030. Determine the contrast loss according to the first encoded output result and the second encoded output result.
[0108] In the embodiment of the present application, after the computer device obtains the first encoded output result and the second encoded output result, it can determine the contrast loss according to the first encoded output result and the second encoded output result. Specifically, use the contrast loss to maximize the similarity of the positive sample pairs and minimize the similarity of the negative sample pairs, expressed as:
[0109]
[0110] Among them, represents the query sample The similarity score with the positive samples indicates the negative samples sampled from a dataset of samples in total for one batch, and is the temperature parameter that controls the smoothness of the distribution. The auxiliary projection head maps a batch of samples of size n { } to the embedding space . For each sample , its closest sample is determined using cosine similarity . Subsequently, an adjacency matrix A(i,j) is defined to establish a symmetric nearest neighbor graph, where indicates that and are considered to be nearest neighbors, otherwise .
[0111] S4031. Determine the weakly supervised loss according to the first encoding output result and the second encoding output result.
[0112] In the embodiments of the present application, after the computer device obtains the first encoding output result and the second encoding output result, the weakly supervised loss can be determined according to the first encoding output result and the second encoding output result. Specifically, the Hoshen-Kopelman algorithm is used to identify all similar samples. After assigning weak labels to each sample, a supervised loss function is obtained, that is:[[]]
[0113]
[0114] where the weak label indicates that the sample embedding and are nearest neighbors, indicates the similarity score between the sample embeddings and . In this process, considering that the similarity between samples may cause the supervised loss function to be too low, the present invention exchanges the weak labels of each embedding space after data augmentation to enhance robustness:
[0115]
[0116] where indicates the new supervised loss function, respectively represent the sample embedding spaces and the corresponding weak labels under data augmentation method 1 and data augmentation method 2。
[0117] S4032. Determine the target loss according to the contrast loss and the weak supervision loss.
[0118] In the embodiment of the present application, after the computer device obtains the contrast loss and the weak supervision loss based on the above steps, it can determine the target loss according to the contrast loss and the weak supervision loss. During the pre-training process, the target loss can be expressed as: , where the hyperparameter is set to 0.2. The supervision loss generates a supervision signal through weak labels to attract relevant instances, while the contrast loss focuses on instance-level information and ensures convergence in the presence of noisy weak labels.
[0119] S404. Pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
[0120] In the embodiment of the present application, after the computer device obtains the target loss based on the above steps, it can pre-train the initial encoder according to the target loss to obtain a pre-trained encoder. Specifically, when selecting hyperparameters for the pre-training model, this embodiment uses the LARS optimizer with a default weight decay value of 1e-6 and trains the model for 800 epochs. The learning rate for model pre-training is set to 0.01, the temperature is 0.07, and the sample batch size is 256. Regarding the data augmentation strategy, this embodiment adopts Gaussian blur, rotation, random cropping, and color transformation with an image resolution of 512×512. Finally, this embodiment selects the checkpoint with the minimum contrast loss to form a weakly supervised momentum contrast learning pre-training model, which can extract the visual representation of retinal fundus images for further training of the classification model (i.e., the Deep DKD system).
[0121] In one embodiment, there is also provided a method for training a first initial classification model to obtain a first classification model, as Figure 9 shown. This method includes:
[0122] S501. Input the second retinal sample image into the pre-trained encoder to obtain a first encoded feature.
[0123] In the embodiment of the present application, after the computer device obtains the pre-trained encoder, it can use the pre-trained encoder as the feature extraction encoder, or use the parameters of the pre-trained encoder as the initial parameters of the feature extraction encoder. After the computer device obtains the second retinal sample image (corresponding to Figure 7 the DKD training set in Figure 7In the feature extraction encoder), the first encoded feature is obtained. Specifically, in this embodiment, ResNet-50 is used as the backbone network to train the DKD classifier for detecting DKD, and its initial weights are set according to the above-mentioned weakly supervised momentum contrast learning model. During the training and validation of the DKD classifier, the input retinal fundus images are center-cropped to obtain square images of size 512×512. To further improve the generalization performance of the classifier, various data augmentation techniques are adopted for image preprocessing during the training process. These techniques include horizontal flipping, image compression, random brightness / contrast adjustment, random gamma correction, adding Gaussian noise, rotation, shearing, and random size cropping. The invention uses cross-entropy as the loss function and classifies the retinal fundus images into 4 categories (non-DKD group, DKD-medium risk increase group, DKD-high risk group, or DKD-extremely high risk group). Regarding the details of hyperparameter settings, in this embodiment, the Adam optimizer is used, the initial learning rate is 1e-5, the step size of the StepLR strategy is 20, and the gamma value is 0.1. The DKD classifier is trained for 100 epochs, and model selection is performed according to metrics such as the area under the receiver operating characteristic curve (AUC) and Cohen's kappa coefficient on the internal validation set.
[0124] S502, Input the first encoded feature into the first initial classification model to obtain the first output result.
[0125] Among them, the first initial classification model can use a neural network model with the ResNet-50 architecture.
[0126] In the embodiment of the present application, after the computer device obtains the first encoded feature based on the above steps, it can input the first encoded feature into the first initial classification model to obtain the first output result.
[0127] S503, Determine the first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0128] In the embodiment of the present application, after the computer device obtains the first output result based on the above steps, it can determine the first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model (corresponding to Figure 7 the DKD classifier in).
[0129] In one example, a method for training a second initial classification model to obtain a second classification model is also provided, such asFigure 10 As shown, the method includes:
[0130] S601: Input the third retinal sample image into the pre-trained encoder to obtain the second encoded feature.
[0131] In the embodiments of the present application, after obtaining the pre-trained encoder, the computer device can use the pre-trained encoder as the feature extraction encoder, or use the parameters of the pre-trained encoder as the initial parameters of the feature extraction encoder. After the computer device obtains the third retinal sample image (corresponding to the DN training set in Figure 7 ), it can input the third retinal sample image into the pre-trained encoder (corresponding to the feature extraction encoder in Figure 7 ) to obtain the second encoded feature.
[0132] S602: Input the second encoded feature into the second initial classification model to obtain the second output result.
[0133] Among them, the second initial classification model can use a neural network model with a ResNet-50 architecture.
[0134] In the embodiments of the present application, after the computer device obtains the second encoded feature based on the above steps, it can input the second encoded feature into the second initial classification model to obtain the second output result.
[0135] S603: Determine the second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0136] In the embodiments of the present application, after the computer device obtains the second output result based on the above steps, it can determine the second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model (corresponding to the DN classifier in Figure 7 ). Optionally, the DN classifier is used to distinguish isolated DNs and NDKDs. Considering that there is not enough training data to mitigate the overfitting of the model, the encoder of the DKD classifier can be frozen, and a new linear classifier can be trained to distinguish isolated DNs and NDKDs. This method can utilize the transferable implicit knowledge about the retina-kidney correlation obtained in the previous steps. The data augmentation and other hyperparameter settings are consistent with those of the DKD classifier.
[0137] In summary of all the above embodiments, a classification method is further provided. The method includes:
[0138] S701. Train the first initial classification model to obtain the first classification model, and train the second initial classification model to obtain the second classification model. The steps of S801 include steps S1 - S12.
[0139] S1. Input the first retinal sample image into the initial encoder to obtain the first encoded output result.
[0140] S2. Process the first retinal sample image to obtain multiple fourth retinal sample images, and input the multiple fourth retinal sample images into the preset momentum encoder to obtain the second encoded output result.
[0141] S3. Determine the contrast loss according to the first encoded output result and the second encoded output result.
[0142] S4. Determine the weakly supervised loss according to the first encoded output result and the second encoded output result.
[0143] S5. Determine the target loss according to the contrast loss and the weakly supervised loss.
[0144] S6. Pre - train the initial encoder according to the target loss to obtain the pre - trained encoder.
[0145] S7. Input the second retinal sample image into the pre - trained encoder to obtain the first encoded feature.
[0146] S8. Input the first encoded feature into the first initial classification model to obtain the first output result.
[0147] S9. Determine the first loss according to the first output result, and adjust the parameters of the pre - trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0148] S10. Input the third retinal sample image into the pre - trained encoder to obtain the second encoded feature.
[0149] S11. Input the second encoded feature into the second initial classification model to obtain the second output result.
[0150] S12. Determine the second loss according to the second output result, and adjust the parameters of the pre - trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0151] S702. Obtain the first retinal image of the second target object.
[0152] S703, input the second retinal image into the second classification model for classification to obtain a second classification result. The second classification result includes an indication of whether the second target object has the target disease and the risk level of having the target disease; the type of the target disease is different from the types of retinal-related diseases.
[0153] S704, obtain the first retinal image of the first target object.
[0154] S705, input the first retinal image into the feature extraction sub-model for feature extraction to obtain image features. The feature extraction sub-model is obtained through pre-training and secondary training.
[0155] S706, input the image features into the classification sub-model for classification to obtain a first classification result. The classification sub-model is obtained through secondary training, and the first classification result is used to indicate the inducing factors of the target disease suffered by the first target object.
[0156] The method described in this embodiment helps to address the challenges of current DKD screening methods (such as using urine or blood samples) in primary care and resource-poor settings. By developing a rapid retinal fundus image-based test, it improves the screening efficiency of doctors and diabetic patients for DKD. Moreover, a simpler and non-invasive tool is developed to distinguish simple DN and NDKD in patients suspected of having NDKD, as opposed to the contraindications and risks of bleeding and infection associated with invasive kidney biopsies used to diagnose NDKD, which can assist experts and nephrologists in narrowing the diagnosis. Additionally, the weakly supervised momentum contrast pre-training model developed in this embodiment can effectively extract the visual representation of retinal fundus images and provide assistance for downstream classification and other tasks.
[0157] The methods described in the above steps have been explained in the foregoing embodiments. For detailed content, please refer to the foregoing descriptions and will not be elaborated here.
[0158] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless specifically stated in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps in other steps.
[0159] Based on the same inventive concept, an embodiment of the present application further provides a classification device for implementing the classification method involved above. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the classification device provided below can refer to the limitations on the classification method in the above text, and will not be elaborated here.
[0160] In one embodiment, as Figure 11 shown, a classification device is provided, including:
[0161] A first acquisition module 10, configured to acquire a first retinal image of a first target object.
[0162] A first classification module 11, configured to input the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0163] In one embodiment, the above classification device further includes:
[0164] A second acquisition module, configured to acquire a first retinal image of a second target object.
[0165] A second classification module, configured to input the second retinal image into a second classification model for classification to obtain a second classification result; the second classification result includes whether the second target object suffers from the target disease and the risk level of suffering from the target disease; the type of the target disease is different from the type of retinal-related diseases.
[0166] In one embodiment, the above first classification module 11 includes:
[0167] An extraction unit, configured to input the first retinal image into a feature extraction sub-model for feature extraction to obtain image features; the feature extraction sub-model is obtained through pre-training and secondary training.
[0168] A first classification unit, configured to input the image features into a classification sub-model for classification to obtain a first classification result; the classification sub-model is obtained through secondary training.
[0169] In one embodiment, the above classification device further includes:
[0170] A first training module, configured to pre-train an initial encoder according to first retinal sample images to obtain a pre-trained encoder.
[0171] A second training module, configured to train a first initial classification model according to second retinal sample images and the pre-trained encoder to obtain a first classification model.
[0172] A third training module, configured to train a second initial classification model according to a third retinal sample image and a pre-trained encoder to obtain a second classification model.
[0173] In one embodiment, the above-mentioned first training module includes:
[0174] A first encoding unit, configured to input a first retinal sample image into an initial encoder to obtain a first encoding output result.
[0175] A processing unit, configured to process the first retinal sample image to obtain a plurality of fourth retinal sample images, and input the plurality of fourth retinal sample images into a preset momentum encoder to obtain a second encoding output result.
[0176] A determination unit, configured to determine a target loss according to the first encoding output result and the second encoding output result.
[0177] A first training unit, configured to pre-train the initial encoder according to the target loss to obtain a pre-trained encoder
[0178] In one embodiment, the above-mentioned determination unit includes:
[0179] A first determination subunit, configured to determine a contrast loss according to the first encoding output result and the second encoding output result.
[0180] A second determination subunit, configured to determine a weakly supervised loss according to the first encoding output result and the second encoding output result.
[0181] A third determination subunit, configured to determine a target loss according to the contrast loss and the weakly supervised loss.
[0182] In one embodiment, the above-mentioned second training module includes:
[0183] A second encoding unit, configured to input a second retinal sample image into the pre-trained encoder to obtain a first encoding feature.
[0184] A second classification unit, configured to input the first encoding feature into a first initial classification model to obtain a first output result.
[0185] A second training unit, configured to determine a first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0186] In one embodiment, the above-mentioned third training module includes:
[0187] A third encoding unit, configured to input a third retinal sample image into a pre-trained encoder to obtain a second encoded feature.
[0188] A third classification unit, configured to input the second encoded feature into a second initial classification model to obtain a second output result.
[0189] A third training unit, configured to determine a second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0190] Each module in the above classification device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0191] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0192] Obtain a first retinal image of a first target object;
[0193] Input the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0194] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0195] Obtain a first retinal image of a second target object;
[0196] Input the second retinal image into a second classification model for classification to obtain a second classification result; the second classification result includes whether the second target object has the target disease and the risk level of having the target disease; the type of the target disease is different from the type of retinal-related diseases.
[0197] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0198] Input the first retinal image into a feature extraction sub-model for feature extraction to obtain image features; the feature extraction sub-model is obtained through pre-training and secondary training;
[0199] Input the image features into a classification sub-model for classification to obtain a first classification result; the classification sub-model is obtained through secondary training.
[0200] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0201] Pre-train the initial encoder according to the first retinal sample image to obtain a pre-trained encoder;
[0202] Train the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain a first classification model;
[0203] Train the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0204] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0205] Input the first retinal sample image into the initial encoder to obtain a first encoded output result;
[0206] Process the first retinal sample image to obtain a plurality of fourth retinal sample images, and input the plurality of fourth retinal sample images into a preset momentum encoder to obtain a second encoded output result;
[0207] Determine the target loss according to the first encoded output result and the second encoded output result;
[0208] Pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
[0209] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0210] Determine the contrast loss according to the first encoded output result and the second encoded output result;
[0211] Determine the weakly supervised loss according to the first encoded output result and the second encoded output result;
[0212] Determine the target loss according to the contrast loss and the weakly supervised loss.
[0213] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0214] Input the second retinal sample image into the pre-trained encoder to obtain a first encoded feature;
[0215] Input the first encoded feature into the first initial classification model to obtain a first output result;
[0216] Determine a first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0217] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0218] Input the third retinal sample image into the pre-trained encoder to obtain the second encoded feature;
[0219] Input the second encoded feature into the second initial classification model to obtain the second output result;
[0220] Determine the second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0221] For the computer device provided in the above embodiment, its implementation principle and technical effects are similar to those of the above method embodiment, and will not be elaborated here.
[0222] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0223] Obtain the first retinal image of the first target object;
[0224] Input the first retinal image into the first classification model for classification to obtain the first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0225] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0226] Obtain the first retinal image of the second target object;
[0227] Input the second retinal image into the second classification model for classification to obtain the second classification result; the second classification result includes whether the second target object has the target disease and the risk level of having the target disease; the type of the target disease is different from the type of retinal-related diseases.
[0228] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0229] Input the first retinal image into the feature extraction sub-model for feature extraction to obtain the image feature; the feature extraction sub-model is obtained through pre-training and secondary training;
[0230] Input the image feature into the classification sub-model for classification to obtain the first classification result; the classification sub-model is obtained through secondary training.
[0231] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0232] Pre-train the initial encoder according to the first retinal sample image to obtain a pre-trained encoder;
[0233] Train the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain a first classification model;
[0234] Train the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0235] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0236] Input the first retinal sample image into the initial encoder to obtain a first encoded output result;
[0237] Process the first retinal sample image to obtain multiple fourth retinal sample images, and input the multiple fourth retinal sample images into a preset momentum encoder to obtain a second encoded output result;
[0238] Determine the target loss according to the first encoded output result and the second encoded output result;
[0239] Pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
[0240] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0241] Determine the contrastive loss according to the first encoded output result and the second encoded output result;
[0242] Determine the weakly supervised loss according to the first encoded output result and the second encoded output result;
[0243] Determine the target loss according to the contrastive loss and the weakly supervised loss.
[0244] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0245] Input the second retinal sample image into the pre-trained encoder to obtain a first encoded feature;
[0246] Input the first encoded feature into the first initial classification model to obtain a first output result;
[0247] Determine a first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0248] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0249] Input the third retinal sample image into the pre-trained encoder to obtain the second encoded feature;
[0250] Input the second encoded feature into the second initial classification model to obtain the second output result;
[0251] Determine the second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0252] For a computer-readable storage medium provided in the above embodiment, its implementation principle and technical effects are similar to those of the above method embodiment, and will not be elaborated here.
[0253] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0254] Obtain the first retinal image of the first target object;
[0255] Input the first retinal image into the first classification model for classification to obtain the first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object.
[0256] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0257] Obtain the first retinal image of the second target object;
[0258] Input the second retinal image into the second classification model for classification to obtain the second classification result; the second classification result includes whether the second target object has the target disease and the risk level of having the target disease; the type of the target disease is different from the type of retinal-related diseases.
[0259] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0260] Input the first retinal image into the feature extraction sub-model for feature extraction to obtain the image feature; the feature extraction sub-model is obtained through pre-training and secondary training;
[0261] Input the image feature into the classification sub-model for classification to obtain the first classification result; the classification sub-model is obtained through secondary training.
[0262] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0263] Pre-train the initial encoder according to the first retinal sample image to obtain a pre-trained encoder;
[0264] Train the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain a first classification model;
[0265] Train the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0266] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0267] Input the first retinal sample image into the initial encoder to obtain a first encoded output result;
[0268] Process the first retinal sample image to obtain multiple fourth retinal sample images, and input the multiple fourth retinal sample images into a preset momentum encoder to obtain a second encoded output result;
[0269] Determine the target loss according to the first encoded output result and the second encoded output result;
[0270] Pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
[0271] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0272] Determine the contrastive loss according to the first encoded output result and the second encoded output result;
[0273] Determine the weakly supervised loss according to the first encoded output result and the second encoded output result;
[0274] Determine the target loss according to the contrastive loss and the weakly supervised loss.
[0275] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0276] Input the second retinal sample image into the pre-trained encoder to obtain a first encoded feature;
[0277] Input the first encoded feature into the first initial classification model to obtain a first output result;
[0278] Determine a first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
[0279] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0280] Input the third retinal sample image into the pre-trained encoder to obtain the second encoded feature;
[0281] Input the second encoded feature into the second initial classification model to obtain the second output result;
[0282] Determine the second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
[0283] For a computer program product provided in the foregoing embodiment, its implementation principle and technical effects are similar to those of the foregoing method embodiment, and will not be elaborated herein.
[0284] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0285] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0286] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A classification method, characterized in that, The method includes: Obtaining a first retinal image of a first target object; the first target object is a patient with diabetic kidney disease who has diabetes and kidney disease; Inputting the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object; the inducing factors include kidney diseases caused by diabetes and kidney diseases caused by other reasons; Among them, the first classification model is trained based on a second retinal sample image and a pre-trained encoder, and the pre-trained encoder is trained based on a first retinal sample image, a fourth retinal sample image, and a preset momentum encoder; the first retinal sample image includes retinal images of normal people and fundus images of diabetic patients who have undergone kidney biopsy, the second retinal sample image is the retinal image of the patient with diabetic kidney disease, and the fourth retinal sample image is an image obtained by processing the first retinal sample image, and the processing includes at least one of horizontal flipping, image compression, random brightness / contrast adjustment, random gamma correction, adding Gaussian noise, rotation, shearing, and random size cropping.
2. The method according to claim 1, wherein The method further includes: Obtaining a second retinal image of a second target object; Inputting the second retinal image into a second classification model for classification to obtain a second classification result; the second classification result includes whether the second target object has the target disease and the risk level of having the target disease; the type of the target disease is different from the type of retinal-related diseases.
3. The method according to claim 1 or 2, characterized in that, The classification model includes a feature extraction sub-model and a classification sub-model. The step of inputting the first retinal image into the first classification model for classification to obtain a first classification result includes: Inputting the first retinal image into the feature extraction sub-model for feature extraction to obtain image features; the feature extraction sub-model is obtained through pre-training and secondary training; Inputting the image features into the classification sub-model for classification to obtain a first classification result; the classification sub-model is obtained through the secondary training.
4. The method according to claim 2, characterized in that, The method further includes: Pre-training an initial encoder according to the first retinal sample image to obtain the pre-trained encoder; Training a first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain the first classification model; Training a second initial classification model according to a third retinal sample image and the pre-trained encoder to obtain the second classification model.
5. The method according to claim 4, wherein The step of pre-training the initial encoder according to the first retinal sample image to obtain the pre-trained encoder includes: Inputting the first retinal sample image into the initial encoder to obtain a first encoding output result; Processing the first retinal sample image to obtain a plurality of fourth retinal sample images, and inputting the plurality of fourth retinal sample images into the preset momentum encoder to obtain a second encoding output result; Determine a target loss according to the first encoded output result and the second encoded output result; Pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
6. The method according to claim 5, wherein The determining the target loss according to the first encoded output result and the second encoded output result includes: Determine a contrastive loss according to the first encoded output result and the second encoded output result; Determine a weakly supervised loss according to the first encoded output result and the second encoded output result; Determine the target loss according to the contrastive loss and the weakly supervised loss.
7. The method according to claim 4, wherein The training the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain the first classification model includes: Input the second retinal sample image into the pre-trained encoder to obtain a first encoded feature; Input the first encoded feature into the first initial classification model to obtain a first output result; Determine a first loss according to the first output result, and adjust the parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and use the trained first initial classification model as the first classification model.
8. The method according to claim 4, characterized in that, The training the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain the second classification model includes: Input the third retinal sample image into the pre-trained encoder to obtain a second encoded feature; Input the second encoded feature into the second initial classification model to obtain a second output result; Determine a second loss according to the second output result, and adjust the parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and use the trained second initial classification model as the second classification model.
9. A classification device, characterized in that, The apparatus includes: A first acquisition module, configured to acquire a first retinal image of a first target object; the first target object is a diabetic nephropathy patient who has diabetes and has kidney disease; A first classification module, configured to input the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result is used to represent the inducing factors of the target disease suffered by the first target object; the inducing factors include kidney diseases caused by diabetes and kidney diseases caused by other reasons; wherein, the first classification model is trained based on a second retinal sample image and a pre-trained encoder, and the pre-trained encoder is trained based on a first retinal sample image, a fourth retinal sample image, and a preset momentum encoder; the first retinal sample image includes retinal images of normal people and fundus images of diabetic patients who have received kidney biopsies, the second retinal sample image is a retinal image of the diabetic nephropathy patient, and the fourth retinal sample image is an image obtained by processing the first retinal sample image, and the processing includes at least one of horizontal flipping, image compression, random brightness / contrast adjustment, random gamma correction, adding Gaussian noise, rotation, shearing, and random size cropping.
10. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Image-based detection of ophthalmic and systemic diseases
CN113646805A
Construction method of intelligent diagnosis model for diabetic retinopathy
CN115458174A