Image classification method and apparatus, device and storage medium and computer program product
By using a retinal image classification model to distinguish between diabetic nephropathy and non-diabetic kidney disease, the problem of non-invasive differentiation in existing technologies has been solved, enabling simple and efficient diagnosis and treatment guidance.
Patent Information
- Application Number
- PCT/CN2024/095779
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-10
- Filing Date
- 2024-05-28
- Publication Date
- 2025-12-11
AI Technical Summary
Current technologies struggle to non-invasively differentiate between diabetic nephropathy (DN) and non-diabetic kidney disease (NDKD), leading to different treatment methods but diagnostic tools causing irreversible damage.
By acquiring retinal images and using neural networks or machine learning models for classification, feature extraction and classification sub-models are trained to distinguish diabetic nephropathy from kidney diseases caused by non-diabetic reasons.
It provides a simple, non-invasive tool that improves diagnostic efficiency, reduces damage caused by invasive tools, and can distinguish between different types of kidney disease caused by different precipitating factors.
Smart Images

Figure CN2024095779_11122025_PF_FP_ABST
Abstract
Description
Image classification method, device, equipment, storage medium and computer program product
[0001] Related applications
[0002] The present application claims priority to the Chinese patent application No. 202410575366.5, filed on May 10, 2024, entitled "Classification method, device, equipment, storage medium and computer program product", the contents of which are hereby incorporated by reference in its entirety. TECHNICAL FIELD
[0003] The present application relates to the technical field of computer vision and medical image processing, in particular to an image classification method, device, equipment and storage medium. BACKGROUND
[0004] Diabetic Kidney Disease (DKD) occurs in about 40% of diabetic patients, and is closely related to significantly increased morbidity and mortality. In the management of diabetes, early detection and intervention of DKD through regular screening has become an established and essential clinical strategy.
[0005] In diabetic patients with DKD, some are Diabetic Nephropathy (DN) caused by diabetes, and some are Non Diabetic Kidney Kisease (NDKD) caused by non-diabetic causes. 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), while, on the contrary, isolated DN has a more progressive course in the vast majority of patients, which can lead to irreversible kidney damage. Therefore, how to provide a non-invasive way to distinguish Diabetic Nephropathy (DN) from Non Diabetic Kidney Kisease (NDKD) has become a technical problem to be solved in the medical field.
[0006] SUMMARY
[0007] Therefore, it is necessary to provide an image classification method, device, equipment and storage medium capable of distinguishing Diabetic Nephropathy (DN) from Non Diabetic Kidney Kisease (NDKD) in view of the above technical problems.
[0008] In a first aspect, the present application provides an image classification method, which comprises:
[0009] obtaining a first retinal image of a first target object;
[0010] inputting the first retinal image into a first classification model for classification to obtain a first classification result, wherein the first classification result comprises a target disease of the first target object caused by different inducing factors, and a type of the target disease is different from a type of a retinal related disease.
[0011] In one of the embodiments, the method further comprises:
[0012] obtaining a first retinal image of a second target object;
[0013] inputting the second retinal image into a second classification model for classification to obtain a second classification result, wherein the second classification result comprises information indicating whether the second target object has the target disease and a risk level of having the target disease.
[0014] In one of the embodiments, the first classification model comprises a feature extraction sub-model and a classification sub-model, and the first classification model is inputted into the first classification model for classification to obtain the first classification result, comprising:
[0015] inputting the first retinal image into the feature extraction sub-model for feature extraction to obtain an image feature; the feature extraction sub-model is obtained through pre-training and secondary training;
[0016] inputting 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.
[0017] In one of the embodiments, the method further comprises:
[0018] pre-training an initial encoder according to a first retinal sample image to obtain a pre-trained encoder;
[0019] training a first initial classification model according to a second retinal sample image and the pre-trained encoder to obtain the first classification model;
[0020] training a second initial classification model according to a third retinal sample image and the pre-trained encoder to obtain the second classification model.
[0021] In one of the embodiments, the pre-training of the initial encoder according to the first retinal sample image to obtain the pre-trained encoder comprises:
[0022] inputting the first retinal sample image into the initial encoder to obtain a first encoding output result;
[0023] 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 a preset momentum encoder to obtain a second encoding output result;
[0024] determine a target loss according to the first encoding output result and the second encoding output result;
[0025] pre-train the initial encoder according to the target loss to obtain a pre-trained encoder.
[0026] In one of the embodiments, determining the target loss according to the first encoding output result and the second encoding output result comprises:
[0027] determining a contrastive loss according to the first encoding output result and the second encoding output result;
[0028] determining a weakly supervised loss according to the first encoding output result and the second encoding output result;
[0029] determining the target loss according to the contrastive loss and the weakly supervised loss.
[0030] In one of the embodiments, training the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain the first classification model comprises:
[0031] inputting the second retinal sample image into the pre-trained encoder to obtain a first encoding feature;
[0032] inputting the first encoding feature into the first initial classification model to obtain a first output result;
[0033] determining a first loss according to the first output result, and adjusting parameters of the pre-trained encoder and the first initial classification model based on the first loss until the training is completed, and taking the trained first initial classification model as the first classification model.
[0034] In one of the embodiments, training the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain the second classification model comprises:
[0035] inputting the third retinal sample image into the pre-trained encoder to obtain a second encoding feature;
[0036] inputting the second encoding feature into the second initial classification model to obtain a second output result;
[0037] determining a second loss according to the second output result, and adjusting parameters of the pre-trained encoder and the second initial classification model based on the second loss until the training is completed, and taking the trained second initial classification model as the second classification model.
[0038] In one of the embodiments, the acquiring the first retinal image of the first target object comprises: starting an image acquisition device to actively acquire the first retinal image of the first target object. The first classification model is a neural network model, a machine learning model, a supervised network model, or an unsupervised network model.
[0039] In one of the embodiments, the second classification model can be a neural network model, a machine learning model, a supervised network model, or an unsupervised network model.
[0040] In one of the embodiments, the contrast loss is
[0041] wherein sim(q, k) represents a similarity score between a query sample q and a positive sample k, k j represents a negative sample sampled from a data set of a total of K samples in a batch, and τ is a temperature parameter for controlling the smoothness of the distribution.
[0042] In a second aspect, the present application further provides an image classification device, which comprises a first acquisition module and a first classification module.
[0043] The first acquisition module is configured to acquire a first retinal image of a first target object.
[0044] The first classification module is configured to input the first retinal image into a first classification model for classification to obtain a first classification result, wherein the first classification result contains a target disease of the first target object caused by different inducing factors; the type of the target disease is different from a type of a retinal related disease.
[0045] In a third aspect, the present application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0046] acquiring a first retinal image of a first target object;
[0047] inputting the first retinal image into a first classification model for classification to obtain a first classification result, wherein the first classification result contains a target disease of the first target object caused by different inducing factors; the type of the target disease is different from a type of a retinal related disease.
[0048] In a fourth aspect, the present application further provides a non-volatile computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0049] acquiring a first retinal image of a first target object;
[0050] inputting the first retinal image into a first classification model for classification to obtain a first classification result, wherein the first classification result comprises a target disease of the first target object caused by different inducing factors; and the type of the target disease is different from a retinal related disease type.
[0051] In a fifth aspect, the present application further provides a computer program product, comprising computer executable instructions, which, when executed by a processor, implement the following steps:
[0052] obtaining a first retinal image of a first target object;
[0053] inputting the first retinal image into a first classification model for classification to obtain a first classification result; the first classification result comprises an inducing factor of a target disease of the first target object caused by different inducing factors; and the type of the target disease is different from a retinal related disease type.
[0054] The above image classification method, device, equipment and storage medium, the method obtains a first retinal image of a first target object, then inputs the first retinal image into a first classification model for classification to obtain a first classification result, wherein the first classification result comprises an inducing factor of a target disease of the first target object caused by different inducing factors; and the type of the target disease is different from a retinal related disease type. The above method provides a more simple and non-invasive tool to replace the irreversible damage caused by the existing invasive tool, which can help to narrow the diagnosis range and improve the classification efficiency. In addition, since the type of the target disease is different from the retinal related disease type, the disease type classification using the retinal image also belongs to the unique application effect of the method. BRIEF DESCRIPTION OF DRAWINGS
[0055] FIG. 1 is an internal structure diagram of a computer device in an embodiment of the present application;
[0056] FIG. 2 is a flowchart of an image classification method in an embodiment of the present application;
[0057] FIG. 3 is a flowchart of an image classification method in another embodiment of the present application;
[0058] FIG. 4 is a flowchart of an image classification method in another embodiment of the present application;
[0059] FIG. 5 is a flowchart of an image classification method in another embodiment of the present application;
[0060] FIG. 6 is a flowchart of an image classification method in another embodiment of the present application;
[0061] FIG. 7 is a flowchart of an image classification method according to another embodiment of the present application;
[0062] FIG. 8 is a flowchart of an image classification method according to another embodiment of the present application;
[0063] FIG. 9 is a flowchart of an image classification method according to another embodiment of the present application;
[0064] FIG. 10 is a flowchart of an image classification method according to another embodiment of the present application;
[0065] FIG. 11 is a block diagram of an image classification device according to an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the present application clearer, further detailed description will be given below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.
[0067] Diabetic Kidney Disease (DKD) occurs in about 40% of diabetic patients and is closely related to significantly increased morbidity and mortality. In diabetes management, early detection and intervention of DKD through regular screening has become an established and essential clinical strategy. Currently, DKD screening is mainly based on collection of blood and urine samples, and the urinary albumin / creatinine ratio (ACR) is calculated by measuring the estimated glomerular filtration rate (eGFR) in the blood and albuminuria (as the earliest marker of kidney damage) in the urine.
[0068] In diabetic patients with DKD, some are Diabetic Nephropathy (DN) caused by diabetes, and some are Non Diabetic Kidney Kisease (NDKD) caused by non-diabetic causes. The treatment methods for kidney diseases caused by different causes are completely different. Many forms of NDKD can be successfully treated (e.g., glomerulonephritis treated by immunosuppressive therapy), while, on the contrary, for isolated DN, it has a more progressive course in the vast majority of patients, which can lead to irreversible kidney damage. Therefore, how to provide a non-invasive way to distinguish Diabetic Nephropathy (DN) from Non Diabetic Kidney Kisease (NDKD) has become a technical problem to be solved in the medical field. The present application provides an image classification method to solve the above technical problem, and the following embodiments will specifically describe the image classification method described in the present application.
[0069] The image classification method provided by the embodiments of the present application can be applied to a computer device as shown in FIG. 1. The computer device can be a terminal or a server. The internal structure of the computer device can be as shown in FIG. 1. 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. 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 configured 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 running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement an image classification method. The display unit of the computer device is configured to form a visually visible picture. The display unit 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. The input device of the computer device can be a touch layer overlaid on the display screen. Alternatively, the input device can be a key, a trackball or a touchpad arranged on the shell of the computer device. Alternatively, the input device can be an external keyboard, touchpad or mouse, etc.
[0070] Those skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0071] In one embodiment, as shown in FIG. 2, the present application provides an image classification method. Taking the computer device in FIG. 1 as an example, the method includes the following steps S101 and S102.
[0072] S101, obtaining a first retinal image of a first target object.
[0073] The first target object is a diabetic kidney disease patient, i.e., a patient who has diabetes and kidney disease. The first retinal image is a retinal image of a diabetic kidney disease patient.
[0074] In the embodiments 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 acquire the first retinal image of the first target object. Specifically, the computer device can start the image acquisition device thereof to actively acquire the first retinal image of the first target object. Alternatively, the computer device can acquire the first retinal image of the first target object by receiving the image sent by other devices.
[0075] S102, inputting the first retinal image into the first classification model for classification to obtain a first classification result.
[0076] The first classification result includes the target disease of the first target object caused by different inducing factors, for example, kidney disease caused by diabetes or kidney disease caused by non-diabetic causes. The type of the target disease is different from the type of the retinal related disease. The first classification model is used to classify diabetic kidney disease (DKD) into diabetic nephropathy (DN) and non-diabetic kidney disease (NDKD). The first classification model can be a neural network model, a machine learning model, a supervised network model, or an unsupervised network model.
[0077] In the embodiments of the present application, the computer device can pre-train an initial network model based on the first retinal image sample image to obtain the first classification model. After the computer device acquires the first retinal image of the first target object based on the above steps, the first retinal image can be input into the pre-trained first classification model for classification, and the inducing factors of the target disease suffered by the first target object are classified by the first classification model to obtain the first classification result.
[0078] The image classification method provided by the embodiments of the present application includes acquiring the first retinal image of the first target object, and then inputting the first retinal image into the first classification model for classification to obtain the first classification result, wherein 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 more simple and non-invasive tool to replace the irreversible damage caused by the existing invasive tool, which can help to narrow the diagnosis range and improve the classification efficiency. In addition, since the type of the target disease is different from the type of the retinal related disease, the disease type classification using the retinal image also belongs to the unique application effect of the method.
[0079] In one embodiment, as shown in FIG. 3, the image classification method of the present application further includes steps S103 and S104.
[0080] S103, acquiring a second retinal image of a second target object.
[0081] The second target object includes at least one of a normal person and a diabetic kidney disease (DKD) patient. The second retinal image includes at least one of a retinal image of a normal person, a retinal image of diabetic nephropathy (DN), and a retinal image of a kidney disease (NDKD) caused by a non-diabetic cause.
[0082] 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 a second retinal image of the second target object. Specifically, the computer device can start the image acquisition device of the computer device to actively obtain the second retinal image of the second target object. Alternatively, the computer device can obtain the second retinal image of the second target object by receiving an image sent by another device.
[0083] S104, inputting the second retinal image into the second classification model for classification to obtain a second classification result.
[0084] The second classification model is used to determine whether the second target object has a target disease, for example, whether the second target object has diabetic kidney disease (DKD). 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 information indicating whether the second target object has a target disease and a risk level of having the target disease. The risk level includes a non-DKD group, a DKD-moderate risk increase group, a DKD-high risk group, or a DKD-very high risk group. The type of the target disease is different from the type of the retinal-related disease, for example, the target disease is diabetic kidney disease (DKD).
[0085] In the embodiments of the present application, the computer device can pre-train an initial network model based on a second retinal image sample to obtain the second classification model. After the computer device obtains the second retinal image of the second target object based on the above steps, the computer device can input the second retinal image into the pre-trained second classification model for judgment. The second classification model is used to determine whether the second target object has a target disease and a risk level of having the target disease, and the second classification result is obtained.
[0086] Alternatively, in actual application, when the second classification result indicates that the second target object has a target disease, the second classification result can be used as an input of the first classification model, and the first classification model is used to classify the inducing factors of the target disease of the second target object to obtain a first classification result.
[0087] The method provided in the embodiments of the present application can determine whether the second target object has the target disease by using the second retinal image, and help to improve the challenge of the existing DKD screening method using urine or blood samples in primary care and resource-poor environments, and improve the screening efficiency of DKD through the method.
[0088] In one embodiment, the first classification model includes a feature extraction sub-model and a classification sub-model. On this basis, the method of the present application further provides a specific implementation manner of obtaining the first classification result. As shown in FIG. 4, the step S102 inputs the first retinal image into the first classification model for classification to obtain the first classification result, including:
[0089] S201, inputting the first retinal image into the feature extraction sub-model for feature extraction to obtain image features.
[0090] The feature extraction sub-model is obtained through pre-training and secondary training. The first classification model includes the feature extraction sub-model and the classification sub-model. The feature extraction sub-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 classification sub-model can be a neural network model or a machine learning model, and can be a supervised network model or an unsupervised network model.
[0091] In the embodiments of the present application, the computer device can pre-train and secondarily train an initial feature extraction sub-network model based on first retinal image sample images to obtain the feature extraction sub-model, and then the computer device can input the first retinal image into the feature extraction sub-model for feature extraction to obtain image features after obtaining the first retinal image.
[0092] S202, inputting the image features into the classification sub-model for classification to obtain the first classification result.
[0093] The classification sub-model is obtained through secondary training.
[0094] In the embodiments of the present application, the computer device can pre-train and secondarily train an initial classification sub-network model based on first retinal image sample images to obtain the classification sub-model, and then the computer device can input the image features into the classification sub-model for classification to obtain the first classification result after obtaining the image features of the first retinal image based on the above steps.
[0095] In one embodiment, the image classification method of the present application further includes the steps of training a first initial classification model to obtain a first classification model, and training a second initial classification model to obtain a second classification model, as shown in FIG. 5, specifically including steps S301 to S303.
[0096] S301, pre-training an initial encoder according to a first retinal sample image to obtain a pre-trained encoder.
[0097] The first retinal sample image includes a retinal image of a normal person and a fundus image of a diabetic patient who has received a kidney biopsy.
[0098] 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 use 734,084 retinal fundus images from 90,067 participants, and use 267 fundus images of diabetic patients who have received a kidney biopsy. Then, the initial encoder is pre-trained based on the first retinal sample image to obtain the pre-trained encoder. Specifically, this process can be completed by a supervised training method, or by an unsupervised training method.
[0099] Specifically, the computer device pre-trains the initial encoder according to the first retinal sample image to obtain the pre-trained encoder. The process is pre-trained based on a self-supervised method. The existing self-supervised method based on instance discrimination faces the problem of class collision, that is, when highly similar instances are forced to be separated, it will cause the quality of visual representation to decrease. The embodiments of the present application use the similarity of instances as internal weak supervision to alleviate the class collision problem in contrast learning. Assuming that there is common semantics between similar samples, the embodiments of the present application will assign similar weak labels to these samples. The embodiments of the present application use the nearest neighbor graph for label assignment, and use the Hoshen-Kopelman algorithm for graph segmentation. After segmentation, the samples in the same connected component will obtain the same weak label. In addition to the initial encoder f q (·), momentum encoder f k (·) and projection head g(·) in common self-supervised methods (such as Mo Co and Sim CLR), the embodiments of the present application introduce an auxiliary projection head φ(·) to explore the similarity of samples in the retinal fundus image. By using momentum update and emphasizing temporal consistency, the parameters θ k of f k are adjusted in the manner of θ k ←mθ k +(1-m)θ q , where the initial value of the encoder momentum coefficient m is set to 0.996 and is adjusted to 1 according to the cosine.
[0100] S302, training a first initial classification model according to a second retinal sample image and the pre-trained encoder to obtain a first classification model.
[0101] The second retinal sample image is a retinal image of a diabetic kidney disease (DKD) patient.
[0102] In the embodiment of the present application, the computer device can obtain the second retinal sample image through web crawling technology, and then train the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain the first classification model. The process can be completed through supervised training or unsupervised training.
[0103] S303, training the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain the second classification model.
[0104] The third retinal sample image includes retinal images of normal people and retinal images of diabetic kidney disease (DKD) patients.
[0105] In the embodiment of the present application, the computer device can obtain the third retinal sample image through web crawling technology, and then train the second initial classification model according to the third retinal sample image and the pre-trained encoder to obtain the second classification model. The process can be completed through supervised training or unsupervised training.
[0106] In one embodiment, a specific implementation of pre-training an initial encoder to obtain a pre-trained encoder is also provided, as shown in FIG. 6. The step S301 of pre-training the initial encoder according to the first retinal sample image to obtain the pre-trained encoder includes:
[0107] S401, inputting the first retinal sample image into the initial encoder to obtain a first encoding output result.
[0108] In the embodiment of the present application, as shown in FIG. 7, the computer device inputs the first retinal sample image (corresponding to X q in FIG. 7) into the initial encoder (corresponding to the encoder f q (X q in FIG. 7), to obtain the first encoding output result (corresponding to g(f q (X q ) and φ(f q (X q ) in FIG. 7).
[0109] S402, 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 a preset momentum encoder to obtain a second encoding output result.
[0110] The fourth retinal sample image is an image obtained by processing the first retinal sample image.
[0111] In this embodiment, after obtaining the first retinal sample image, the computer device can perform at least one of the following processing on the first retinal sample image: horizontal flipping, image compression, random brightness / contrast adjustment, random gamma correction, addition of Gaussian noise, rotation, cropping, and random size cropping, to obtain a processed image, and use the processed image as the fourth retinal sample image (corresponding to X in Figure 7). k Then, multiple fourth retinal sample images are input into a preset momentum encoder (corresponding to momentum encoder f in Figure 7). k (X k In the process, the second encoded output result is obtained (corresponding to g(f) in Figure 7). k (X k )) and φ(f k (X k ))).
[0112] S403, determine the target loss based on the first encoding output and the second encoding output.
[0113] Specifically, in the embodiments of this application, as shown in FIG8, the above step S403 determines the target loss based on the first encoding output result and the second encoding output result, specifically including steps S4030 to S4032.
[0114] S4030, determine the contrast loss based on the first encoding output result and the second encoding output result.
[0115] In this embodiment of the application, after the computer device obtains the first encoded output result and the second encoded output result, it can determine the contrast loss based on the first encoded output result and the second encoded output result. Specifically, the contrast loss is used. To maximize the similarity of positive sample pairs and minimize the similarity of negative sample pairs. Represented as:
[0116] Where sim(q, k) represents the similarity score between the query sample q and the positive sample k, and k j This represents a negative sample sampled from a dataset of K samples in a batch, where τ is a temperature parameter controlling the smoothness of the distribution. The auxiliary projection head φ(·) projects a batch of n samples {x1, x2, ..., x}... n Mapped to the embedding space V = {v1, v2, ..., v} n}, where v i =φ(f(x) i For each sample v i Cosine similarity is used to determine the closest sample v. j. Subsequently, an adjacency matrix A(i,j) is defined to establish a symmetric nearest neighbor graph, where A(i,j) = 1 indicates that v i and v j are considered nearest neighbors, otherwise A(i,j) = 0.
[0117] S4031, determining a weak supervision loss according to the first encoding output result and the second encoding output result.
[0118] In the embodiment of the application, after the computer device obtains the first encoding output result and the second encoding output result, the weak supervision 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 a weak label to each sample, a supervised loss function is obtained that is:
[0119] where the weak label y ij = 1 indicates that the sample embedding v i and v j are nearest neighbors, and sim(v i , v j ) represents the similarity score between the sample embeddings v i and v j . In this process, considering that the similarity between samples can cause the supervised loss function to be too low, the weak label y of each embedding space V mapped after data augmentation is exchanged to enhance robustness:
[0120] where represents the weak supervision loss function, V 1 , V 2 , y 1 , y 2 respectively represent the sample embedding space V and the corresponding weak label y using data augmentation method 1 and data augmentation method 2.
[0121] S4032, determining a target loss according to the contrastive loss and the weak supervision loss.
[0122] In the embodiment of the application, after the computer device obtains the contrastive loss and the weak supervision loss based on the above steps, the target loss can be determined according to the contrastive loss and the weak supervision loss. In the pre-training process, the target loss can be represented as: where the hyperparameter λ is set to 0.2. The weak supervision loss generates a supervision signal through the weak label to attract related instances, while the contrastive loss It focuses on instance-level information and ensures convergence in the presence of noisy weak labels.
[0123] S404, pre-training the initial encoder according to the target loss to obtain a pre-trained encoder.
[0124] In the embodiments of the present application, after the computer device obtains the target loss based on the above steps, the initial encoder can be pre-trained according to the target loss to obtain a pre-trained encoder. Specifically, when selecting the hyperparameters for the pre-training model, the embodiments of the present application use the LARS optimizer with a default weight decay value of 1x10 -6 -4, and the model is trained for 800 rounds. The learning rate of the 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, the embodiments of the present application use image resolution of 512x512 including Gaussian blur, rotation, random cropping, and color transformation. Finally, the embodiments of the present application select 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 the retinal fundus image for further training of the classification model (i.e., the Deep DKD system).
[0125] In one embodiment, as shown in FIG. 9, the step S302 of the present application trains the first initial classification model according to the second retinal sample image and the pre-trained encoder to obtain the first classification model, including the following steps S501 to S503.
[0126] S501, inputting the second retinal sample image into the pre-trained encoder to obtain first encoding features.
[0127] In the embodiments of the present application, after obtaining the pre-trained encoder, the computer device can use the pre-trained encoder as a feature extraction encoder, or use the parameters of the pre-trained encoder as the initial parameters of the feature extraction encoder. After obtaining the second retinal sample image (corresponding to DKD training set in FIG. 7), the computer device can input the second retinal sample image into the pre-trained encoder (corresponding to the feature extraction encoder in FIG. 7) to obtain the first encoded feature. Specifically, the present embodiment uses ResNet-50 as the backbone network to train the DKD classifier for detecting DKD, and sets the initial weight according to the above-mentioned weakly supervised momentum contrast learning model. During the training and verification of the DKD classifier, the input retinal fundus image is center cropped to obtain a square image with a size of 512x512. In order to further improve the generalization performance of the classifier, various data augmentation techniques are used 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, cropping and random size cropping. The present application uses cross-entropy as the loss function, and divides the retinal fundus image into 4 categories (non-DKD group, DKD-moderate risk increase group, DKD-high risk group or DKD-very high risk group). As for the details of the hyperparameter setting, the present embodiment uses the Adam optimizer with an initial learning rate of 1x10 -5 , the step size of the step learning rate (StepLR) strategy is 20, and the gamma value is 0.1. The DKD classifier is trained for a total of 100 rounds, and the model is selected according to the area under the receiver operating characteristic curve (AUC) and the Cohen's kappa coefficient on the internal validation set.
[0128] S502, input the first encoded feature into the first initial classification model to obtain a first output result.
[0129] The first initial classification model can use a neural network model with a ResNet-50 architecture.
[0130] In the embodiments of the present application, after the computer device obtains the first encoded feature based on the above steps, the computer device can input the first encoded feature into the first initial classification model to obtain a first output result.
[0131] S503, 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.
[0132] In the embodiments of the present application, after the computer device obtains the first output result based on the above steps, the computer device can determine a first loss according to the first output result, and adjust the pre-training encoder and the first initial classification model parameters based on the first loss until the training is completed, and take the trained first initial classification model as the first classification model (corresponding to the DKD classifier in FIG. 7).
[0133] In one example, as shown in FIG. 10, the step S303 of the present application trains the second initial classification model according to the third retinal sample image and the pre-training encoder to obtain the second classification model, specifically including steps S601 to S603.
[0134] S601, input the third retinal sample image into the pre-training encoder to obtain second encoding features.
[0135] In the embodiments of the present application, after the computer device obtains the pre-training encoder, the computer device can take the pre-training encoder as a feature extraction encoder, or take the parameters of the pre-training encoder as initial parameters of the feature extraction encoder. After the computer device obtains the third retinal sample image (corresponding to the DN training set in FIG. 7), the computer device can input the third retinal sample image into the pre-training encoder (corresponding to the feature extraction encoder in FIG. 7) to obtain the second encoding features.
[0136] S602, input the second encoding features into the second initial classification model to obtain a second output result.
[0137] The second initial classification model can use a neural network model with a ResNet-50 architecture.
[0138] In the embodiments of the present application, after the computer device obtains the second encoding features based on the above steps, the computer device can input the second encoding features into the second initial classification model to obtain a second output result.
[0139] S603, determine a second loss according to the second output result, and adjust the pre-training encoder and the second initial classification model parameters based on the second loss until the training is completed, and take the trained second initial classification model as the second classification model.
[0140] In the embodiments of the present application, after the computer device obtains the second output result based on the above steps, the second loss can be determined according to the second output result, and the pre-training encoder and the second initial classification model parameter are adjusted based on the second loss until the training is completed, and the trained second initial classification model is taken as the second classification model (corresponding to the DN classifier in FIG. 7). Optionally, the DN classifier is used to distinguish isolated DN and NDKD. Considering that there is not enough training data to reduce the overfitting of the model, the encoder of the DKD classifier can be frozen, and a new linear classifier is trained to distinguish isolated DN and NDKD. This method can utilize the transferable implicit knowledge about the retinal-kidney correlation obtained in the foregoing steps. The data augmentation and other hyperparameter settings are consistent with the DKD classifier.
[0141] In summary of all the above embodiments, the present application further provides an image classification method, which comprises the following steps.
[0142] S701, training the first initial classification model to obtain the first classification model, and training the second initial classification model to obtain the second classification model. Step S701 comprises steps S1-S12.
[0143] S1, inputting the first retinal sample image into the initial encoder to obtain a first encoding output result.
[0144] S2, 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 a preset momentum encoder to obtain a second encoding output result.
[0145] S3, determining a contrast loss according to the first encoding output result and the second encoding output result.
[0146] S4, determining a weak supervision loss according to the first encoding output result and the second encoding output result.
[0147] S5, determining a target loss according to the contrast loss and the weak supervision loss.
[0148] S6, pre-training the initial encoder according to the target loss to obtain a pre-training encoder.
[0149] S7, inputting the second retinal sample image into the pre-training encoder to obtain a first encoding feature.
[0150] S8, inputting the first encoding feature into the first initial classification model to obtain a first output result.
[0151] S9, determine a first loss according to the first output result, and adjust the pre-training encoder and the first initial classification model parameters based on the first loss until the training is completed, and take the trained first initial classification model as the first classification model.
[0152] S10, input the third retinal sample image into the pre-training encoder to obtain second encoding features.
[0153] S11, input the second encoding features into the second initial classification model to obtain a second output result.
[0154] S12, determine a second loss according to the second output result, and adjust the pre-training encoder and the second initial classification model parameters based on the second loss until the training is completed, and take the trained second initial classification model as the second classification model.
[0155] S702, obtain a first retinal image of a second target object.
[0156] S703, 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 a target disease and a risk level of having the target disease. The type of the target disease is different from the type of the retinal-related disease.
[0157] S704, obtain a first retinal image of a first target object.
[0158] S705, 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.
[0159] S706, 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, and the first classification result is used to indicate an inducing factor of the target disease suffered by the first target object.
[0160] The method described in the embodiment helps to improve the challenges of current DKD screening methods (such as using urine or blood samples) in primary care and resource-poor environments, and improves the screening efficiency of doctors and diabetic patients for DKD by developing a fast retinal fundus image-based test. Moreover, a more simple and non-invasive tool is developed to distinguish simple DN from NDKD in patients suspected of having NDKD, which is different from the contraindications and bleeding and infection risks produced by invasive kidney biopsy for diagnosing NDKD, and can help experts and nephrologists narrow down the diagnosis range. In addition, the weakly supervised momentum contrast pre-training model developed in the embodiment can effectively extract the visual representation of the retinal fundus image, which helps the downstream classification and other tasks.
[0161] The method described in each of the above steps is described in the foregoing embodiments, and the details are described in the foregoing description, which is not repeated here.
[0162] It should be understood that, although each step in the flowchart involved in each of the above-described embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0163] Based on the same inventive concept, the embodiments of the present application also provide an image classification device for implementing the above-mentioned image classification method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more image classification device embodiments provided below can refer to the limitations of the image classification method in the above text, which will not be repeated here.
[0164] In one embodiment, as shown in FIG. 11, a classification device is provided, including a first acquisition module 10 and a first classification module 11.
[0165] The first acquisition module 10 is configured to acquire a first retinal image of a first target object.
[0166] The first classification module 11 is configured to input the first retinal image into a first classification model for classification to obtain a first classification result. The first classification result includes a target disease of the first target object caused by different inducing factors.
[0167] In one embodiment, the above classification device further includes a second acquisition module and a second classification module.
[0168] The second acquisition module is configured to acquire a first retinal image of a second target object.
[0169] The second classification module is 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 has a target disease and a risk level of having the target disease.
[0170] In one embodiment, the first classification module 11 includes an extraction unit and a first classification unit.
[0171] The extraction unit is configured to input the first retinal image into a feature extraction sub-model to perform feature extraction, and obtain image features. The feature extraction sub-model is obtained through pre-training and secondary training.
[0172] The first classification unit is configured to input the image features into a classification sub-model to perform classification, and obtain a first classification result. The classification sub-model is obtained through secondary training.
[0173] In one embodiment, the classification device further includes a first training module, a second training module, and a third training module.
[0174] The first training module is configured to pre-train an initial encoder according to a first retinal sample image, and obtain a pre-trained encoder.
[0175] The second training module is configured to train a first initial classification model according to a second retinal sample image and the pre-trained encoder, and obtain a first classification model.
[0176] The third training module is configured to train a second initial classification model according to a third retinal sample image and the pre-trained encoder, and obtain a second classification model.
[0177] In one embodiment, the first training module includes a first encoding unit, a processing unit, a determination unit, and a first training unit.
[0178] The first encoding unit is configured to input the first retinal sample image into the initial encoder, and obtain a first encoding output result.
[0179] The processing unit is 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.
[0180] The determination unit is configured to determine a target loss according to the first encoding output result and the second encoding output result.
[0181] The first training unit is configured to pre-train the initial encoder according to the target loss, and obtain the pre-trained encoder.
[0182] In one embodiment, the determination unit includes a first determination sub-unit, a second determination sub-unit, and a third determination sub-unit.
[0183] The first determination sub-unit is configured to determine a contrast loss according to the first encoding output result and the second encoding output result.
[0184] The second determination sub-unit is configured to determine a weakly supervised loss according to the first encoding output result and the second encoding output result.
[0185] The third determining sub-unit is configured to determine a target loss according to the contrast loss and the weakly supervised loss.
[0186] In an embodiment, the second training module comprises a second encoding unit, a second classification unit and a second training unit.
[0187] The second encoding unit is configured to input the second retinal sample image into the pre-trained encoder to obtain first encoding features.
[0188] The second classification unit is configured to input the first encoding features into the first initial classification model to obtain a first output result.
[0189] The second training unit is configured to determine a first loss according to the first output result, adjust the pre-trained encoder and the first initial classification model parameters based on the first loss until the training is completed, and take the trained first initial classification model as the first classification model.
[0190] In an embodiment, the third training module comprises a third encoding unit, a third classification unit and a third training unit.
[0191] The third encoding unit is configured to input the third retinal sample image into the pre-trained encoder to obtain second encoding features.
[0192] The third classification unit is configured to input the second encoding features into the second initial classification model to obtain a second output result.
[0193] The third training unit is configured to determine a second loss according to the second output result, adjust the pre-trained encoder and the second initial classification model parameters based on the second loss until the training is completed, and take the trained second initial classification model as the second classification model.
[0194] Each module in the classification device can be realized by software, hardware and a combination thereof in whole or in part. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform the operations corresponding to each module.
[0195] In an embodiment, a computer device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: obtaining a first retinal image of a first target object; inputting the first retinal image into a first classification model for classification to obtain a first classification result. The first classification result contains a target disease of the first target object caused by different inducing factors. The type of the target disease is different from the type of the retinal related disease.
[0196] In one embodiment, the processor, when executing the computer program, further implements the following steps: obtaining a first 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 information indicating whether the second target object has the target disease and a risk level of having the target disease.
[0197] In one embodiment, the processor, when executing the computer program, further implements the following steps: inputting the first retinal image into a feature extraction sub-model for feature extraction to obtain image features, wherein the feature extraction sub-model is obtained through pre-training and secondary training; inputting 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.
[0198] In one embodiment, the processor, when executing the computer program, further implements the following steps: pre-training an initial encoder according to a first retinal sample image to obtain a pre-trained encoder; training a first initial classification model according to a second retinal sample image and the pre-trained encoder to obtain a first classification model; training a second initial classification model according to a third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0199] In one embodiment, the processor, when executing the computer program, further implements the following steps: inputting the first retinal sample image into an 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 a preset momentum encoder to obtain a second encoding output result; determining a target loss according to the first encoding output result and the second encoding output result; pre-training the initial encoder according to the target loss to obtain a pre-trained encoder.
[0200] In one embodiment, the processor, when executing the computer program, further implements the following steps: determining a contrast loss according to the first encoding output result and the second encoding output result; determining a weakly supervised loss according to the first encoding output result and the second encoding output result; determining a target loss according to the contrast loss and the weakly supervised loss.
[0201] In one embodiment, the processor, when executing the computer program, further implements the following steps: inputting the second retinal sample image into the pre-trained encoder to obtain a first encoding feature; inputting the first encoding feature into the first initial classification model to obtain a first output result; determining a first loss according to the first output result, and adjusting parameters of the pre-trained encoder and the first initial classification model based on the first loss until training is completed, and taking the trained first initial classification model as the first classification model.
[0202] In an embodiment, the processor, when executing the computer program, also implements the following steps: inputting the third retinal sample image into the pre-trained encoder to obtain second encoded features; inputting the second encoded features into the second initial classification model to obtain a second output result; determining a second loss according to the second output result, and adjusting the pre-trained encoder and the second initial classification model parameters based on the second loss until the training is completed, and taking the trained second initial classification model as the second classification model.
[0203] The computer device provided in the above embodiment has similar implementation principles and technical effects to the above method embodiments, and thus detailed description is omitted here.
[0204] In an embodiment, a non-volatile computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program, when executed by a processor, implements the following steps: obtaining a first retinal image of a first target object; and inputting the first retinal image into a first classification model for classification to obtain a first classification result. The first classification result includes different types of target diseases of the first target object caused by different inducing factors. The types of the target diseases are different from types of retinal related diseases.
[0205] In an embodiment, the computer program, when executed by the processor, also implements the following steps: obtaining a first retinal image of a second target object; and 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 a target disease and a risk level of having the target disease.
[0206] In an embodiment, the computer program, when executed by the processor, also implements the following steps: inputting 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; inputting the image features into a classification sub-model for classification to obtain the first classification result; the classification sub-model is obtained through secondary training.
[0207] In an embodiment, the computer program, when executed by the processor, also implements the following steps: pre-training an initial encoder according to a first retinal sample image to obtain a pre-trained encoder; training a first initial classification model according to a second retinal sample image and the pre-trained encoder to obtain a first classification model; and training a second initial classification model according to a third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0208] In an embodiment, the computer program, when executed by the processor, further implements the following steps: 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; determining a target loss according to the first encoding output result and the second encoding output result; and pre-training the initial encoder according to the target loss to obtain a pre-trained encoder.
[0209] In an embodiment, the computer program, when executed by the processor, further implements the following steps: determining a contrast loss according to the first encoding output result and the second encoding output result; determining a weak supervision loss according to the first encoding output result and the second encoding output result; and determining a target loss according to the contrast loss and the weak supervision loss.
[0210] In an embodiment, the computer program, when executed by the processor, further implements the following steps: inputting the second retinal sample image into the pre-trained encoder to obtain a first encoding feature; inputting the first encoding feature into the first initial classification model to obtain a first output result; determining a first loss according to the first output result, and adjusting parameters of the pre-trained encoder and the first initial classification model based on the first loss until training is completed, and taking the trained first initial classification model as the first classification model.
[0211] In an embodiment, the computer program, when executed by the processor, further implements the following steps: inputting the third retinal sample image into the pre-trained encoder to obtain a second encoding feature; inputting the second encoding feature into the second initial classification model to obtain a second output result; determining a second loss according to the second output result, and adjusting parameters of the pre-trained encoder and the second initial classification model based on the second loss until training is completed, and taking the trained second initial classification model as the second classification model.
[0212] The non-volatile computer readable storage medium provided in the above embodiment has similar implementation principles and technical effects to the method embodiments described above, and thus will not be described here again.
[0213] In an embodiment, a computer program product is provided, including computer executable instructions, which, when executed by a processor, implement the following steps: obtaining a first retinal image of a first target object; inputting the first retinal image into a first classification model for classification to obtain a first classification result. The first classification result contains a target disease of the first target object caused by different inducing factors. The type of the target disease is different from the type of a retinal related disease.
[0214] In an embodiment, the computer program, when executed by the processor, further implements the following steps: obtaining a first 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 information indicating whether the second target object has the target disease and a risk level of having the target disease.
[0215] In an embodiment, the computer program, when executed by the processor, further implements the following steps: inputting the first retinal image into a feature extraction sub-model for feature extraction to obtain image features, wherein the feature extraction sub-model is obtained through pre-training and secondary training; inputting 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.
[0216] In an embodiment, the computer program, when executed by the processor, further implements the following steps: pre-training an initial encoder according to a first retinal sample image to obtain a pre-trained encoder; training a first initial classification model according to a second retinal sample image and the pre-trained encoder to obtain a first classification model; training a second initial classification model according to a third retinal sample image and the pre-trained encoder to obtain a second classification model.
[0217] In an embodiment, the computer program, when executed by the processor, further implements the following steps: inputting the first retinal sample image into an 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 a preset momentum encoder to obtain a second encoding output result; determining a target loss according to the first encoding output result and the second encoding output result; pre-training the initial encoder according to the target loss to obtain a pre-trained encoder.
[0218] In an embodiment, the computer program, when executed by the processor, further implements the following steps: determining a contrast loss according to the first encoding output result and the second encoding output result; determining a weakly supervised loss according to the first encoding output result and the second encoding output result; determining a target loss according to the contrast loss and the weakly supervised loss.
[0219] In an embodiment, the computer program, when executed by the processor, further implements the following steps: inputting the second retinal sample image into the pre-trained encoder to obtain a first encoding feature; inputting the first encoding feature into the first initial classification model to obtain a first output result; determining a first loss according to the first output result, and adjusting parameters of the pre-trained encoder and the first initial classification model based on the first loss until training is completed, and taking the trained first initial classification model as the first classification model.
[0220] In one embodiment, the computer program, when executed by the processor, further implements the following steps: inputting the third retinal sample image into the pre-trained encoder to obtain second encoded features; inputting the second encoded features into the second initial classification model to obtain a second output result; determining a second loss according to the second output result, and adjusting the pre-trained encoder and the second initial classification model parameters based on the second loss until the training is completed, and taking the trained second initial classification model as the second classification model.
[0221] The computer program product provided in the above embodiment has similar implementation principles and technical effects to the above method embodiments, and thus detailed description is omitted here.
[0222] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments can be included. Any reference to a memory, database or other medium used in the embodiments provided in the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical memory, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., but is not limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0223] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, as long as the combinations do not conflict with each other, they should be considered to be within the scope of the present disclosure.
[0224] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, 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. An image classification method, comprising: obtaining a first retinal image of a first target object; inputting the first retinal image into a first classification model for classification to obtain a first classification result, wherein the first classification result comprises a target disease of the first target object caused by different inducing factors; and the type of the target disease is different from a type of a retinal-related disease.
2. The method of claim 1, further comprising: 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, wherein the second classification result comprises information indicating whether the second target object has the target disease and a risk level of having the target disease.
3. The method according to claim 1 or 2, characterized in that, The first classification model comprises a feature extraction sub-model and a classification sub-model; The method further comprises: pre-training an initial encoder according to a first retinal sample image to obtain a pre-trained encoder; training a first initial classification model according to a second retinal sample image and the pre-trained encoder to obtain the first classification model; 4. The method of claim 2, wherein, training a second initial classification model according to a third retinal sample image and the pre-trained encoder to obtain the second classification model. The method further comprises: 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 a preset momentum encoder to obtain a second encoding output result; 5. The method of claim 4, wherein, determining a target loss according to the first encoding output result and the second encoding output result; pre-training the initial encoder according to the target loss to obtain the pre-trained encoder. The method further comprises: determining a contrast loss according to the first encoding output result and the second encoding output result; determining a weakly supervised loss according to the first encoding output result and the second encoding output result; 6. The method of claim 5, wherein, determining the target loss according to the contrast loss and the weakly supervised loss. The method further comprises: inputting the second retinal sample image into the pre-trained encoder to obtain a first encoding feature; inputting the first encoding feature into the first initial classification model to obtain a first output result; and 7. The method of claim 4, wherein, inputting the first encoding feature into the first initial classification model to obtain a first output result. According to the first output result, a first loss is determined, and the pre-training encoder and the first initial classification model parameters are adjusted based on the first loss until the training is completed, and the trained first initial classification model is taken as the first classification model.
8. The method of claim 4, wherein, The training of the second initial classification model according to the third retinal sample image and the pre-training encoder to obtain the second classification model comprises: The third retinal sample image is input into the pre-training encoder to obtain a second encoding feature; The second encoding feature is input into the second initial classification model to obtain a second output result; According to the second output result, a second loss is determined, and the pre-training encoder and the second initial classification model parameters are adjusted based on the second loss until the training is completed, and the trained second initial classification model is taken as the second classification model.
9. The method of any one of claims 1-8, wherein: The first retinal image of the first target object is obtained by starting an image acquisition device to actively acquire the first retinal image of the first target object. The first classification model is a neural network model, a machine learning model, a supervised network model, or an unsupervised network model.
10. The method of claim 2, wherein: The second classification model can be a neural network model, a machine learning model, a supervised network model, or an unsupervised network model.
11. The method of claim 6, wherein, The contrast loss is where sim(q, k) denotes the similarity score between the query sample q and the positive sample k, k j denotes a negative sample sampled from a data set of K total samples from a batch, and τ is a temperature parameter that controls the smoothness of the distribution.
12. An image classification device, comprising: a first acquisition module configured to acquire a first retinal image of a first target object; 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 includes a target disease of the first target object caused by different inducing factors; and the type of the target disease is different from the type of a retinal related disease.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1-11.
14. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-11.
15. A computer program product comprising computer executable instructions, characterised in that, The computer executable instructions are executed by the processor to implement the steps of the method of any one of claims 1-11.