Electronic device and method of training a classification model for age-related macular degeneration
By calculating the loss function vector in the processor and updating the loss function value using penalty weights, a highly accurate classification model for age-related macular degeneration was trained. This solved the overfitting problem caused by annotations from different medical personnel, ensuring the accuracy of symptom classification and timely referral.
Patent Information
- Application Number
- CN202111004105.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-06-03
- Filing Date
- 2021-08-30
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2041-08-30
AI Technical Summary
In existing technologies, due to different medical personnel having different definitions of the macular region, the trained artificial intelligence models suffer from overfitting, which reduces the accuracy of age-related macular degeneration classification and may delay the referral of serious symptoms.
By configuring the processor to calculate the loss function vector and updating the loss function value using penalty weights and cluster penalty weights, a highly accurate age-related macular degeneration classification model is trained, avoiding overfitting and ensuring that severe symptoms are not misdiagnosed as mild symptoms.
It improves the accuracy of age-related macular degeneration classification models, reduces misdiagnosis of severe symptoms, ensures timely referral, and improves the accuracy of medical decisions.
Smart Images

Figure CN115440369B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to an electronic device and a method for training a classification model of age-related macular degeneration. BACKGROUND
[0002] Age-related macular degeneration (AMD) includes four classifications according to the severity of clinical signs, which are first stage (or stage I), second stage (or stage II), third stage (or stage III), and fourth stage (or stage IV). Currently, personnel analyze fundus images using artificial intelligence (AI) models to classify the severity of age-related macular degeneration. Personnel can train AI models using training data labeled by medical personnel. Generally, medical personnel classify age-related macular degeneration according to the macular region in the fundus image. However, different medical personnel may have different identifications of the macular region. Therefore, AI models trained by training data labeled by different medical personnel may have overfitting problems, thereby reducing the classification accuracy of the AI model.
[0003] On the other hand, medical personnel do not handle different stages of age-related macular degeneration in the same way. The third and fourth stages belong to more serious stages. If a patient has clinical signs of the third or fourth stage, the medical personnel need to immediately arrange a referral for the patient to further confirm the patient's condition. Relatively speaking, if a patient has clinical signs of the first or second stage, the urgency of arranging a referral for the patient is lower. Therefore, if the classification model incorrectly classifies age-related macular degeneration of the third (or fourth) stage as the first (or second) stage, the best opportunity for medical treatment may be missed. SUMMARY
[0004] The present disclosure provides an electronic device and a method for training a classification model of age-related macular degeneration, which can train a classification model of age-related macular degeneration with high accuracy.
[0005] An electronic device for training a classification model for age-related macular degeneration includes a processor and a transceiver. The processor is coupled to the transceiver, where the processor is configured to perform: obtaining training data via the transceiver; calculating a loss function vector corresponding to the training data based on a machine learning algorithm, where the loss function vector includes a first loss function value corresponding to a first classification of age-related macular degeneration and a second loss function value corresponding to a second classification of age-related macular degeneration, where the first classification corresponds to a first group and the second classification corresponds to one of the first group and a second group; in response to the second classification corresponding to the second group, updating the first loss function value based on the second loss function value and a group penalty weight to generate an updated loss function vector; and training the classification model based on the updated loss function vector.
[0006] In an embodiment of the disclosure, the processor is further configured to perform: in response to the second classification corresponding to the first group, updating the first loss function value based on the second loss function value to generate an updated loss function vector.
[0007] In an embodiment of the disclosure, the first classification and the second classification correspond to different stages of age-related macular degeneration, respectively, where the processor is further configured to perform: generating a first penalty weight based on a stage difference between the first classification and the second classification; and updating the first loss function value based on the second loss function value and the first penalty weight to generate an updated loss function vector.
[0008] In an embodiment of the disclosure, the loss function vector further includes a third loss function value corresponding to a third classification of age-related macular degeneration, where the processor is further configured to perform: generating a second penalty weight based on a second stage difference between the first classification and the third classification; and updating the first loss function value based on the third loss function value and the second penalty weight to generate an updated loss function vector.
[0009] In an embodiment of the disclosure, the third classification corresponds to one of the first group and the second group, where the processor is further configured to perform: in response to the third classification corresponding to the first group, updating the first loss function value based on the third loss function value and the second penalty weight to generate an updated loss function vector; and in response to the third classification corresponding to the second group, updating the first loss function value based on the third loss function value, the second penalty weight, and a group penalty weight to generate an updated loss function vector.
[0010] In an embodiment of the disclosure, the second stage difference is greater than the stage difference, and the second penalty weight is greater than the first penalty weight.
[0011] In an embodiment of the disclosure, the first penalty weight is proportional to the stage difference.
[0012] In an embodiment of the present application, the training data further comprises fundus images labeled with stages of age-related macular degeneration, wherein the loss function vector corresponds to a binary cross-entropy function.
[0013] In an embodiment of the present application, the processor calculates a product of the second loss function value and a cluster penalty weight to generate an updated loss function vector.
[0014] A method for training a classification model of age-related macular degeneration, comprising: obtaining training data; calculating a loss function vector corresponding to the training data based on a machine learning algorithm, wherein the loss function vector comprises a first loss function value corresponding to a first classification of age-related macular degeneration and a second loss function value corresponding to a second classification of age-related macular degeneration, wherein the first classification corresponds to a first cluster and the second classification corresponds to one of the first cluster and a second cluster; in response to the second classification corresponding to the second cluster, updating the first loss function value according to the second loss function value and a cluster penalty weight to generate an updated loss function vector; and training the classification model according to the updated loss function vector.
[0015] Based on the above, the electronic device of the present application can update the loss function value of the machine learning algorithm using the classification weight, and train the classification model according to the updated loss function value. The classification model of the present application is less likely to misjudge the third stage (or the fourth stage) of age-related macular degeneration with more serious symptoms as the first stage (or the second stage) with less serious symptoms. Medical personnel can determine whether the patient needs to be referred for treatment in real time according to the classification results. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 FIG. 1 shows a schematic diagram of an electronic device for training a classification model of age-related macular degeneration according to an embodiment of the present application;
[0017] Figure 2 FIG. 2 shows a schematic diagram of an updated loss function vector according to an embodiment of the present application;
[0018] Figure 3 FIG. 3 shows a flowchart of a method for training a classification model of age-related macular degeneration according to an embodiment of the present application.
[0019] REFERENCE SIGNS
[0020] 100: electronic device;
[0021] 110: processor;
[0022] 120: storage medium;
[0023] 130: transceiver;
[0024] 20: binary cross entropy function;
[0025] 21: normalized probability vector;
[0026] 22: one-hot encoded vector;
[0027] 23: loss function vector;
[0028] 24: weight matrix;
[0029] 25: updated loss function vector;
[0030] S301, S302, S303, S304: steps. DETAILED DESCRIPTION
[0031] Reference will now be made in detail to the exemplary embodiments of the present application, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers will be used in the different drawings and the description to refer to the same or like parts.
[0032] A classification model for classifying age-related macular degeneration can be generated based on training data annotated by medical personnel, such as fundus images annotated with stages of age-related macular degeneration. However, the annotations of the training data decided by the medical personnel can not be correct. For example, the medical personnel can classify the first stage of age-related macular degeneration as the second stage of age-related macular degeneration. If the classification model focuses too much on classifying these easily confused data, the classification model can lose generalization ability due to overfitting. On the other hand, the first and second stages of age-related macular degeneration belong to stages that do not need to be referred, and the third and fourth stages of age-related macular degeneration belong to stages that need to be referred. Therefore, if the classification model misclassifies the third (or fourth) stage as the first (or second) stage, it can cause the referral of the patient to be delayed, thereby missing the best opportunity for medical treatment. Based on the above, the present application proposes a method for training a classification model for age-related macular degeneration, which can avoid training an overfitted classification model. In addition, the classification model of the present application is less likely to misclassify a stage corresponding to a first group (e.g., a group of stages that do not need to be referred) as a stage corresponding to a second group (e.g., a group of stages that need to be referred).
[0033] Figure 1 According to an embodiment of the present application, a schematic diagram of an electronic device 100 for training a classification model for age-related macular degeneration is shown. The electronic device 100 can include a processor 110, a storage medium 120, and a transceiver 130. The classification model can be used to generate a classification of age-related macular degeneration from input data, wherein the classification can include a first stage, a second stage, a third stage, or a fourth stage of age-related macular degeneration.
[0034] The processor 110 is, for example, a central processing unit (CPU), or other programmable general purpose or special purpose micro control unit (MCU), microprocessor, digital signal processor (DSP), programmable controller, application specific integrated circuit (ASIC), graphics processing unit (GPU), image signal processor (ISP), image processing unit (IPU), arithmetic logic unit (ALU), complex programmable logic device (CPLD), field programmable gate array (FPGA), or other similar component or combination thereof. The processor 110 can be coupled to the storage medium 120 and the transceiver 130, and access and execute a plurality of modules and various application programs stored in the storage medium 120, thereby performing the functions of the electronic device 100.
[0035] The storage medium 120 is, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk drive (HDD), solid state drive (SSD), or similar component or combination thereof, and is used to store a plurality of modules or various application programs executable by the processor 110.
[0036] The transceiver 130 transmits and receives signals in a wireless or wired manner. The transceiver 130 can also perform operations such as low noise amplification, impedance matching, mixing, up or down frequency conversion, filtering, amplification, and the like.
[0037] The processor 110 can obtain, through the transceiver 130, a training data set for training a classification model, wherein the training data set can include a plurality of training data. The training data is, for example, a fundus image labeled with an age-related macular degeneration stage.
[0038] Figure 2 An exemplary diagram of updating the loss function vector 23 is shown according to an embodiment of the present disclosure. The classification model is, for example, a machine learning model. The processor 110 can calculate the loss function vector 23 corresponding to the training data based on the machine learning algorithm. Since the age-related macular degeneration includes the first stage, the second stage, the third stage, and the fourth stage, the loss function vector 23 can include four loss function values corresponding to the first stage, the second stage, the third stage, and the fourth stage, respectively. However, the present disclosure is not limited thereto. For example, the loss function vector 23 can include any number of loss function values. In the present embodiment, the loss function vector 23 can be represented as [e(1)e(2)e(3)e(4)], where e(1) is the loss function value corresponding to the first stage, e(2) is the loss function value corresponding to the second stage, e(3) is the loss function value corresponding to the third stage, and e(4) is the loss function value corresponding to the fourth stage.
[0039] In an embodiment, the first stage and the second stage of the age-related macular degeneration correspond to a first group (i.e., a group of stages that do not require referral), and the third stage and the fourth stage of the age-related macular degeneration correspond to a second group (i.e., a group of stages that require referral). The processor 110 can receive information through the transceiver 130 to obtain the correspondence between the age-related macular degeneration stages (e.g., the first stage, the second stage, the third stage, or the fourth stage) and the groups (e.g., the first group or the second group).
[0040] The loss function of the machine learning algorithm is, for example, a binary cross entropy function 20. The processor 110 can generate the loss function vector 23 according to the binary cross entropy function 20. Specifically, in the process of training the classification model, the Softmax function of the machine learning algorithm can output a normalized probability vector 21, where the normalized probability vector 21 can include four normalized probabilities corresponding to the first stage, the second stage, the third stage, and the fourth stage, respectively. However, the present disclosure is not limited thereto. For example, the normalized probability vector 21 can include any number of normalized probabilities. In the present embodiment, the normalized probability vector 21 can be represented as [p(1)p(2)p(3)p(4)], where p(1) is the normalized probability of the first stage, p(2) is the normalized probability of the second stage, p(3) is the normalized probability of the third stage, and p(4) is the normalized probability of the fourth stage. The normalized probability belongs to a closed interval of 0 to 1, as shown in equation (1), where p(j) is the normalized probability of the jth stage of the age-related macular degeneration.
[0041] p(j) ∈ [0, 1] … (1)
[0042] On the other hand, the processor 110 can generate a one-hot encoding vector 22 corresponding to the stage of age-related macular degeneration according to the annotation of the training data (i.e., the fundus image annotated with the stage of age-related macular degeneration). The one-hot encoding vector 22 can include four encoding values corresponding to the first stage, the second stage, the third stage, and the fourth stage, respectively. However, the present disclosure is not limited thereto. For example, the one-hot encoding vector 22 can include any number of encoding values. In the present embodiment, the one-hot encoding vector 22 can be represented as [c(1) c(2) c(3) c(4)], where c(1) is the encoding value of the first stage, c(2) is the encoding value of the second stage, c(3) is the encoding value of the third stage, and c(4) is the encoding value of the fourth stage. The encoding values can be "0" or "1". The one-hot encoding vector 22 can include one encoding value "1" and three encoding values "0", where the encoding value "1" corresponds to the stage of age-related macular degeneration annotated in the training data, and the encoding values "0" correspond to the stages of age-related macular degeneration not annotated in the training data. For example, if the training data is annotated as the third stage, the one-hot encoding vector 22 can be represented as [0 0 1 0].
[0043] After obtaining the normalized probability vector 21 and the one-hot encoding vector 22, the processor 110 can input the normalized probability vector 21 and the one-hot encoding vector 22 to the binary cross-entropy function 20 to generate a loss function vector 23.
[0044] Generally, two stages with a smaller absolute value of stage difference are more difficult to distinguish. Two stages with a larger absolute value of stage difference are easier to distinguish. For example, it is more difficult to classify the fundus image as one of the first stage and the second stage than to classify the fundus image as one of the first stage and the third stage. In other words, the probability of misjudging the first stage as the second stage is higher, and the probability of misjudging the first stage as the third stage is lower. Overfitting can occur if the classification model focuses too much on distinguishing stages with smaller stage differences. To avoid overfitting of the classification model, the processor 110 can update the loss function value of the classification model using a penalty weight, and train the classification model according to the updated loss function value. In addition, to avoid misjudgment of the classification model of the stages of age-related macular degeneration belonging to different groups, the processor 110 can update the loss function value of the classification model using a group penalty weight, and train the classification model according to the updated loss function value.
[0045] In particular, the processor 110 can multiply the loss function vector 23 by the weight matrix 24 to generate an updated loss function vector 25, and train the classification model according to the updated loss function vector 25. The size of the updated loss function vector 25 can be the same as the size of the loss function vector 23. Assuming the loss function vector 23 is represented as [e(l)e(2)e(3)e(4)], the processor 110 can calculate the updated loss function vector 25 according to equation (2), where M is the weight matrix 24, and [e(l)'e(2)'e(3)'e(4)'] is the updated loss function vector 25. The updated loss function vector 25 can include an updated loss function e(l)' for the first epoch, an updated loss function e(2)' for the second epoch, an updated loss function e(3)' for the third epoch, and an updated loss function e(4)' for the fourth epoch.
[0046] [e(l)'e(2)'e(3)'e(4)'] = [e(l)e(2)e(3)e(4)] · M... (2)
[0047] The updated loss function values in the updated loss function vector 25 can be represented by equation (3), where e(i)' represents an updated loss function value for the i-th epoch (or an element of the i-th row of the updated loss function vector 25), e(j) represents a loss function value for the j-th epoch (or an element of the j-th row of the loss function vector 23), a(i,j) represents an error weight corresponding to the i-th and j-th epochs, b(i,j) represents a penalty weight corresponding to the i-th and j-th epochs, and c(i,j) represents a weight index corresponding to the i-th and j-th epochs. i or j belongs to the closed interval of 1 to 4 (i.e., i ∈ [1, 4] and j ∈ [1, 4]). The error weights for different epochs can be the same or different.
[0048] e(i)' = ∑ j,j≠i e(j) · (a(i,j) + b(i,j) + c(i,j))... (3)
[0049] As shown in equation (3), the processor 110 can generate the updated loss function value e(l)' according to the loss function value e(2), the loss function value e(3), or the loss function value e(4). For example, the updated loss function value e(l)' can include the product e(2) · b(l,2) of the loss function value e(2) and the penalty weight b(l,2), the product e(3) · b(l,3) of the loss function value e(3) and the penalty weight b(l,3), and the product e(4) · b(l,4) of the loss function value e(4) and the penalty weight b(l,4).
[0050] The processor 110 can calculate the penalty weight b(i,j) corresponding to the ith stage and the jth stage according to the staging difference between the ith stage and the jth stage (i.e., i-j). In an embodiment, the penalty weight b(i,j) can be proportional to the absolute value of the staging difference between the ith stage and the jth stage, as shown in equation (4). For example, since the staging difference |1-3| between the first stage and the third stage is greater than the staging difference |1-2| between the first stage and the second stage, the penalty weight b(1,3) corresponding to the first stage and the third stage is greater than the penalty weight b(1,2) corresponding to the first stage and the second stage.
[0051] b(i,j)∝|i-j|…(4)
[0052] In an embodiment, if the ith stage and the jth stage belong to the same group, the weight index c(i,j) is equal to 0. If the ith stage and the jth stage belong to different groups, the weight index c(i,j) is equal to the group penalty weight C. In other words, if the ith stage and the jth stage both belong to the first group, the weight index c(i,j) is equal to 0. If the ith stage and the jth stage both belong to the second group, the weight index c(i,j) is equal to 0. If the ith stage belongs to the first group and the jth stage belongs to the second group, the weight index c(i,j) is equal to the group penalty weight C, as shown in equation (5), where S1 is the first group and S2 is the second group.
[0053]
[0054] Since the first stage and the second stage belong to the first group (i.e., S1) and the third stage and the fourth stage belong to the second group (i.e., S2), c(1,2) = c(3,4) = 0 and c(1,3) = c(2,3) = C. For example, according to equation (3) and equation (5), the updated loss function value e(1)' can include the product e(3)·C of the loss function value e(3) and the group penalty weight C, and can include the product e(4)·C of the loss function value e(4) and the group penalty weight C. As another example, the updated loss function value e(3)' can include the product e(1)·C of the loss function value e(1) and the group penalty weight C, and can include the product e(2)·C of the loss function value e(2) and the group penalty weight C.
[0055] Assuming each error weight a(i,j) is equal to 1, the penalty weight b(i,j) is equal to the difference between the i-th stage and the j-th stage multiplied by 0.1 (as shown in equation (6)), and the group penalty weight C is equal to 0.3. Accordingly, the weight matrix 24 in equation (2) can be represented by equation (7). The processor 110 can multiply the loss function vector 23 by the weight matrix 24 to generate an updated loss function vector 25. After obtaining the updated loss function vector 25, the processor 110 can train the classification model for age-related macular degeneration according to the updated loss function vector 25.
[0056] b(i,j) = 0.1 · |i - j|... (6)
[0057]
[0058] Figure 3 According to an embodiment of the disclosure, a flowchart of a method for training a classification model for age-related macular degeneration is shown, wherein the method can be implemented by an electronic device 100 as shown in Figure 1
[0059] In summary, the electronic device of the disclosure can update the loss function values of a machine learning algorithm using classification weights. The electronic device can update the loss function value of a particular classification using the loss function values of other classifications. If the other classifications belong to the same group as the particular classification, the electronic device does not need to give the other classifications a classification weight. If the other classifications belong to different groups from the particular classification, the electronic device gives the other classifications a classification weight. The classification model trained by the updated loss function is less likely to misclassify a stage of age-related macular degeneration as another stage corresponding to a different group. According to the classification results of the classification model, medical personnel will not misjudge a patient who needs to be referred as a patient who does not need to be referred, or misjudge a patient who does not need to be referred as a patient who needs to be referred.
[0060] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An electronic device that trains a classification model for age-related macular degeneration, comprising: comprising: a transceiver; and a processor coupled to the transceiver, wherein the processor is configured to perform: obtaining training data via the transceiver; computing a loss function vector corresponding to the training data based on a machine learning algorithm, wherein the loss function vector comprises a first loss function value corresponding to a first classification of the age-related macular degeneration and a second loss function value corresponding to a second classification of the age-related macular degeneration, wherein the first classification corresponds to a first group and the second classification corresponds to one of the first group and a second group, wherein the first classification and the second classification correspond to different stages of the age-related macular degeneration, respectively; generating a first penalty weight according to a stage difference between the first classification and the second classification, wherein the first penalty weight is proportional to the stage difference; in response to the second classification corresponding to the second group, updating the first loss function value according to the second loss function value, the first penalty weight, and a group penalty weight to generate an updated loss function vector; and training the classification model according to the updated loss function vector.
2. The electronic device of claim 1, wherein the processor is further configured to perform: in response to the second classification corresponding to the first group, updating the first loss function value according to the second loss function value to generate the updated loss function vector.
3. The electronic device of claim 1, wherein the loss function vector further comprises a third loss function value corresponding to a third classification of the age-related macular degeneration, wherein the processor is further configured to perform: generating a second penalty weight according to a second stage difference between the first classification and the third classification; and updating the first loss function value according to the third loss function value and the second penalty weight to generate the updated loss function vector.
4. The electronic device of claim 3, wherein the third classification corresponds to one of the first group and the second group, wherein the processor is further configured to perform: in response to the third classification corresponding to the first group, updating the first loss function value according to the third loss function value and the second penalty weight to generate the updated loss function vector; and in response to the third classification corresponding to the second group, updating the first loss function value according to the third loss function value, the second penalty weight, and the group penalty weight to generate the updated loss function vector.
5. The electronic device of claim 3, wherein the second stage difference is greater than the stage difference, and the second penalty weight is greater than the first penalty weight.
6. The electronic device of claim 1, wherein the training data further comprises fundus images labeled with age-related macular degeneration stages, wherein the loss function vector corresponds to a binary cross-entropy function.
7. The electronic device of claim 1, wherein the processor computes a product of the second loss function value and the group penalty weight to generate the updated loss function vector.
8. A method of training a classification model for age-related macular degeneration, characterized in that, comprising: obtaining training data; computing, based on a machine learning algorithm, a loss function vector corresponding to the training data, wherein the loss function vector comprises a first loss function value corresponding to a first classification of the age-related macular degeneration and a second loss function value corresponding to a second classification of the age-related macular degeneration, wherein the first classification corresponds to a first group and the second classification corresponds to one of the first group and a second group, wherein the first classification and the second classification correspond to different stages of the age-related macular degeneration, respectively; generating a first penalty weight according to a stage difference between the first classification and the second classification, wherein the first penalty weight is proportional to the stage difference; in response to the second classification corresponding to the second group, updating the first loss function value according to the second loss function value, the first penalty weight, and a group penalty weight to generate an updated loss function vector; and training the classification model according to the updated loss function vector.