Machine learning apparatus and method
By calculating the first and second losses and adjusting the model parameters, the problem of spurious correlation in machine learning is solved, and the accuracy of object detection and data prediction is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2026-03-24
AI Technical Summary
In existing machine learning techniques, spurious correlations exist in the feature extraction and feature classification processes, leading to a decrease in the prediction accuracy of object detection and data prediction.
The processor calculates the first and second losses, and uses the independence loss and average treatment effect loss to adjust the model parameters, remove explicit and implicit spurious correlations, and improve model performance.
Effective removal of spurious correlations improves the prediction accuracy and efficiency of classification models.
Smart Images

Figure CN114648094B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to a machine learning technique, and in particular, to a machine learning technique for eliminating spurious correlation. BACKGROUND
[0002] Techniques such as machine learning, neural network, etc. are widely applied in the field of artificial intelligence. One of the important applications of artificial intelligence is to recognize objects (e.g. face, license plate, etc.) or to predict data (e.g. stock prediction, medical prediction, etc.). Object detection and data prediction can be achieved through feature extraction and feature classification.
[0003] However, spurious correlation often occurs between features used for feature extraction and feature classification, and spurious correlation always leads to a decrease in the prediction accuracy of object detection and data prediction. SUMMARY
[0004] One embodiment of the present disclosure discloses a machine learning method, comprising: obtaining, by a processor, model parameters from a memory, and executing a classification model according to the model parameters, wherein the classification model comprises a plurality of neural network structure layers; calculating, by the processor, a first loss and a second loss according to a plurality of training samples, wherein the first loss corresponds to an output layer in the plurality of neural network structure layers, and the second loss corresponds to a layer before the output layer in the plurality of neural network structure layers; and performing, by the processor, a plurality of update operations on the model parameters according to the first loss and the second loss to train the classification model.
[0005] In some embodiments, the step of calculating the first loss and the second loss according to the training samples comprises: generating, by the processor, a plurality of predicted labels from the output layer of the plurality of neural network structure layers according to the training samples; and comparing, by the processor, the predicted labels and a plurality of training labels of the training samples to calculate the first loss.
[0006] In some embodiments, the step of calculating the first loss and the second loss according to the training samples comprises: generating, by the processor, a plurality of extracted features from the classification model according to the training samples; and calculating, by the processor, the second loss according to the statistical independence between the extracted features, wherein the extracted features correspond to a layer in the plurality of neural network structure layers.
[0007] In some embodiments, performing the update operations on the model parameters according to the first loss and the second loss to train the classification model comprises: calculating, by the processor, a plurality of loss differences according to the first loss and the second loss; and performing, by the processor, a plurality of backpropagation operations on the classification model according to the loss differences to update the model parameters.
[0008] In some embodiments, the machine learning method further comprises: calculating, by the processor, a third loss according to the extracted features and the average processing effect between the training labels of the training samples.
[0009] In some embodiments, performing the update operations on the model parameters according to the first loss and the second loss to train the classification model comprises: calculating, by the processor, loss differences according to the first loss, the second loss, and the third loss; and performing, by the processor, backpropagation operations on the classification model according to the loss differences to update the model parameters.
[0010] In some embodiments, calculating the first loss and the second loss according to the training samples comprises: generating, by the processor, extracted features from the classification model according to the training samples; and calculating, by the processor, the second loss according to the extracted features and the average processing effect between the training labels of the training samples, wherein the extracted features correspond to a layer of the neural network structure layers.
[0011] In some embodiments, performing the update operations on the model parameters according to the first loss and the second loss to train the classification model comprises: calculating, by the processor, loss differences according to the first loss and the second loss; and performing, by the processor, backpropagation operations on the classification model according to the loss differences to update the model parameters.
[0012] In some embodiments, the output layer comprises at least one fully connected layer, and one of the neural network structure layers comprises at least one convolutional layer.
[0013] In some embodiments, the classification model is related to a neural network.
[0014] Another embodiment of the present disclosure discloses a machine learning device comprising a memory and a processor. The memory is used to store a plurality of instructions and model parameters. The processor is connected to the memory, wherein the processor is used to run a classification model and execute a plurality of instructions to: obtain the model parameters from the memory and execute the classification model according to the model parameters, wherein the classification model comprises a plurality of neural network structure layers; calculate a first loss and a second loss according to a plurality of training samples, wherein the first loss corresponds to an output layer of the neural network structure layers, and the second loss corresponds to a layer of the neural network structure layers before the output layer; and perform a plurality of update operations on the model parameters according to the first loss and the second loss to train the classification model.
[0015] In some embodiments, the processor is further configured to generate predicted labels from the output layer of the neural network structure layers according to the training samples; and compare the predicted labels with training labels of the training samples to calculate the first loss.
[0016] In some embodiments, the processor is further configured to generate extracted features from the classification model according to the training samples; and calculate the second loss according to statistical independence between the extracted features, wherein the extracted features correspond to one of the neural network structure layers.
[0017] In some embodiments, the processor is further configured to calculate loss differences according to the first loss and the second loss; and perform backpropagation operations on the classification model according to the loss differences to update the model parameters.
[0018] In some embodiments, the processor is further configured to calculate a third loss according to average processing effects between the extracted features and training labels of the training samples.
[0019] In some embodiments, the processor is further configured to calculate loss differences according to the first loss, the second loss and the third loss; and perform backpropagation operations on the classification model according to the loss differences to update the model parameters.
[0020] In some embodiments, the processor is further configured to generate extracted features from the classification model according to the training samples; and calculate the second loss according to average processing effects between the extracted features and training labels of the training samples, wherein the extracted features correspond to one of the neural network structure layers.
[0021] In some embodiments, the processor is further configured to calculate loss differences according to the first loss and the second loss; and perform backpropagation operations on the classification model according to the loss differences to update the model parameters.
[0022] In some embodiments, the output layer comprises at least one fully connected layer, and one of the neural network structure layers comprises at least one convolutional layer.
[0023] In some embodiments, the classification model is related to a neural network.
[0024] In computer vision and computer prediction, the accuracy of deep learning largely depends on a large amount of labeled training data. As the quality, quantity, and variety of training data increase, the performance of classification models typically improves. However, explicit or implicit spurious correlations always exist between extracted features and training labels in classification models. Removing these spurious correlations would lead to higher efficiency and accuracy. In the embodiments described above, a method is proposed to adjust the model based on independence loss and average treatment effect loss to remove explicit or implicit spurious correlations in the classification model. Therefore, adjusting the model parameters based on independence loss and average treatment effect loss can improve the overall performance of the model. Attached Figure Description
[0025] Figure 1 A schematic diagram of a machine learning apparatus according to one embodiment of the present disclosure is shown.
[0026] Figure 2 A schematic diagram of a machine learning method according to an embodiment of the present disclosure is shown.
[0027] Figure 3 A schematic diagram of a classification model and loss according to one embodiment of the present disclosure is shown.
[0028] Figure 4 In some embodiments shown Figure 2 A detailed flowchart of the first step.
[0029] Figure 5 In some other embodiments shown Figure 2 A detailed flowchart of the first step.
[0030] Figure 6 In some embodiments shown Figure 2 A flowchart detailing the steps of another step in the process.
[0031] Figure 7 In some embodiments shown Figure 2 Flowchart of additional steps.
[0032] Figure 8 In some other embodiments shown Figure 2 A flowchart detailing the steps of another step in the process.
[0033] Symbol explanation:
[0034] 100: Machine Learning Device
[0035] 110: Processor
[0036] 120: Memory
[0037] MP: Model parameters
[0038] 111: classification model
[0039] SL1, SL2,... SLt: neural network structure layer
[0040] : training sample
[0041] : predicted label
[0042] : training label
[0043] : extracted feature
[0044] L1: first loss
[0045] L2, L3: second loss
[0046] S210-S230, S221-S223, S224A, 224B, S231A, S231B, S232-S233, S220': step DETAILED DESCRIPTION
[0047] Reference will now be made in detail to present embodiments of the disclosure, examples of which are illustrated in the accompanying drawings. Wherever possible, the same or like reference numbers are used in the drawings and the description to refer to the same or like parts.
[0048] Referring to Figure 1 , Figure 1 A schematic diagram of a machine learning device according to an embodiment of the disclosure is shown. The machine learning device 100 includes a processor 110 and a memory 120. The processor 110 and the memory 120 are connected to each other.
[0049] In some embodiments, the machine learning device 100 can be established by a computer, a server or a processing center. In some embodiments, the processor 110 can be implemented by a central processing unit or a computing unit. In some embodiments, the memory 120 can be implemented by a flash memory, a read-only memory, a hard disk or any equivalent storage component.
[0050] In some embodiments, the machine learning device 100 is not limited to including the processor 110 and the memory 120, and the machine learning device 100 can further include other elements required in operation and application. For example, the machine learning device 100 can further include an output interface (such as a display panel for displaying information), an input interface (such as a touch panel, a keyboard, a microphone, a scanner or a flash memory reader) and a communication circuit (such as a WiFi communication module, a Bluetooth communication module, a wireless telecommunication network communication module, etc.).
[0051] As shown in Figure 1 , the processor 110 is configured to run the classification model 111 based on the corresponding software / firmware instruction program stored in the memory 120.
[0052] In some embodiments, the classification model 111 can be configured to classify the input data (e.g. the data enhanced image as described above), such as detecting the presence of a vehicle, a face, a license plate, a text, a picture, or other image feature objects in the input image. The classification model 111 can generate a corresponding label according to the classification result. It is to be noted that the classification model 111 needs to refer to the model parameters MP when performing the classification operation.
[0053] As shown in FIG. 1, the memory 120 is configured to store the model parameters MP. In some embodiments, the model parameters MP can include a plurality of weight parameter contents.
[0054] In the present embodiment, the classification model 111 includes a plurality of neural network structure layers. In some embodiments, each neural network structure layer can correspond to a weight parameter content (for determining the operation of a neural network structure layer) in the model parameters MP. Alternatively, each neural network structure layer of the classification model 111 can correspond to an independent weight parameter content. In other words, each neural network structure layer can correspond to a set of weight values, and the set of weight values can include a plurality of weight values.
[0055] In some embodiments, the neural network structure layer can be a convolutional layer, a pooling layer, a linear rectification layer, a fully connected layer, or other types of neural network structure layers. In some embodiments, the classification model 111 can be related to a neural network (e.g. the classification model 111 can be composed of a deep residual network (ResNet) and a fully connected layer, or an EfficentNet and a fully connected layer).
[0056] Please refer to Figure 2 , Figure 2 for a schematic diagram of a machine learning method according to an embodiment of the present disclosure, Figure 1 The machine learning device 100 shown in Figure 2 may be configured to perform the machine learning method in
[0057] As shown in Figure 2 , first in step S210, the model parameters MP are obtained from the memory 120, and the classification model 111 is executed according to the model parameters MP. In an embodiment, the model parameters MP in the memory 120 can be an average value obtained from past training experience, a manually given preset value, or a random value.
[0058] At step S220, a first loss and a second loss are calculated according to the training samples, where the first loss corresponds to an output layer in the neural network structure layers, and the second loss corresponds to a layer before the output layer in the neural network structure layers. In an embodiment, the first loss is generated by the processor 110 from the output layer of the neural network structure layers of the classification model 111, and the second loss is generated by the processor 110 from the neural network structure layer before the output layer. In some embodiments, the output layer can include at least one fully connected layer. The detailed steps of step S220 in some embodiments will be further described in conjunction with specific examples.
[0059] At step S230, a plurality of update operations are performed on the model parameters MP according to the first loss and the second loss to train the classification model 111. In an embodiment, the processor 110 updates the model parameters MP according to the first loss and the second loss in the update operations to generate updated model parameters MP, and trains the classification model 111 according to the updated model parameters MP to generate a trained classification model 111. The detailed steps of step S230 in some embodiments will be further described in conjunction with specific examples.
[0060] Thus, the trained classification model 111 can be used for subsequent applications. For example, the trained classification model 111 can be used for object recognition, face recognition, audio recognition, or dynamic detection in input pictures, images, streams, etc., or can be used for data prediction on stock data or weather information.
[0061] Please refer to Figure 3 and Figure 4 , Figure 3 a schematic diagram of a classification model and losses in an embodiment according to the present disclosure is shown. Figure 4 a flowchart of detailed steps S221-S224A of step S220 in some embodiments is shown.
[0062] As Figure 3 shown, the classification model 111 includes neural network structure layers SL1, SL2, … SLt. In some embodiments, t is a positive integer. Generally, the total number of layers in the classification model 111 can be determined according to the requirements of actual applications (e.g., the accuracy of classification, the complexity of the target of classification, the difference of input images). In some cases, the common range of t can be between 16 and 128, but the present disclosure is not limited to a specific number of layers.
[0063] For example, the neural network structure layers SL1 and SL2 can be convolution layers, the neural network structure layer SL3 can be a pooling layer, the neural network structure layers SL4 and SL5 can be convolution layers, the neural network structure layer SL6 can be a pooling layer, the neural network structure layer SL7 can be a convolution layer, the neural network structure layer SL8 can be a linear rectification layer, and the neural network structure layer SLt can be a fully connected layer, but the present disclosure is not limited thereto.
[0064] In some embodiments, the classification model 111 can have a plurality of residual mapping blocks. By using the structure of the residual mapping blocks, t can be greatly reduced. The following further illustrates steps S221 to S224A by taking the structure of the classification model 111 as an example.
[0065] It should be particularly noted that, for the sake of convenience in illustration, Figure 3 The classification model 111 in the above is merely illustratively shown as a model (e.g., a ResNet model) having residual mapping blocks, but the present disclosure is not limited thereto. In actual applications, the classification model 111 can be other types of convolutional neural networks. In some embodiments, the classification model 111 can be an EfficientNet model.
[0066] As shown in Figure 3 and Figure 4 , in step S221, the processor 110 generates a plurality of predicted labels from the output layer SLt of the neural network structure layers SL1, SL2, … SLt according to the training samples . It should be noted that n is the number of the training samples , n is also the number of the predicted labels , n can be a positive integer, and i can be a positive integer not greater than n. As shown in Figure 3 , when the training sample Xi is input to the classification model 111, the predicted label can be generated from the neural network structure layer SLt (i.e., the output layer) of the classification model 111 via the operation of the neural network structure layers SL1, SL2, … SLt. In the same way, the training sample can be input to the classification model 111 to generate the predicted label .
[0067] As shown in Figure 3 and Figure 4 , in step S222, the processor 110 performs a comparison algorithm to compare the predicted labels with the plurality of training labels of the training samples to generate a first loss L1. As shown inFigure 3 The predicted label and the training label yi of the training sample Xi are compared to calculate a loss. In other words, the predicted label and the training label are compared by the comparison algorithm executed by the processor 110 to calculate a plurality of losses, and the first loss L1 is generated by the processor 110 according to these losses (i.e. a conventional loss function). In some embodiments, the predicted label and the training label yi of the training sample Xi are compared to calculate a loss. In other words, the predicted label and the training label are compared by the comparison algorithm executed by the processor 110 to calculate a plurality of losses, and the first loss L1 is generated by the processor 110 according to these losses (i.e. a conventional loss function). In some embodiments, the predicted label Cross-entropy calculation is performed on the predicted label and the training label yi of the training sample Xi to obtain the first loss L1.
[0068] As shown in Figure 3 and Figure 4 , in step S223, a plurality of extracted features H are generated from the classification model 111 according to the training sample . As shown in FIG. 3, after the training sample Xi is input into the classification model 111, the extracted features H i,1 , H i,2 , … H i,m may be calculated from the artificial neurons of the neural network structure layer Lt-1 of the classification model 111 via the operations of the neural network structure layers SL1, SL2, … SLt-1, where m can be a positive integer and equal to the number of artificial neurons, and the extracted features H i,1 , H i,2 , … H i,m correspond to the artificial neurons of the neural network structure layer Lt-1 respectively. In addition, the extracted features H i,1 , H i,2 , … H i,m may also correspond to the artificial neurons of any neural network structure layer before the neural network structure layer Lt-1 respectively. In other words, the extracted features H corresponding to the training sample Xi can be calculated from the artificial neurons.
[0069] It is worth noting that the extracted features H and the training label yi of the training sample Xi are compared to calculate a loss. In other words, the predicted label and the training label are compared by the comparison algorithm executed by the processor 110 to calculate a plurality of losses, and the first loss L1 is generated by the processor 110 according to these losses (i.e. a conventional loss function). In some embodiments, the predicted label Spurious Correlation between the second extracted feature and the training label yi. When the value of the second extracted feature linearly increases with the change of the label, there is a Spurious Correlation between the second extracted feature and the training label yi. If the extracted feature that causes the Spurious Correlation (i.e., the relationship between the first extracted feature, the second extracted feature, and the training label yi) can be observed, the Spurious Correlation is Explicit. Otherwise, the Spurious Correlation can be considered as Implicit (i.e., the relationship between the second extracted feature and the training label yi). The Spurious Correlation will cause the predicted label and the training label to be more different.
[0070] For example, if the patient clinical image has a cell tissue of the lesion and a bone with a color similar to the cell tissue, it causes an Explicit Spurious Correlation between the extracted feature of the bone and the label of the lesion. In another example, the patient clinical image usually has a background, and the lesion in the patient clinical image is similar to the background. Therefore, it causes an Implicit Spurious Correlation between the extracted feature of the background and the label of the lesion.
[0071] To avoid the Spurious Correlation, the following paragraphs further describe the details of using Statistical Independence to eliminate the Explicit Spurious Correlation and using Average Treatment Effect (ATE) to eliminate the Implicit Spurious Correlation.
[0072] As shown in Figure 3 and Figure 4 , in step S224A, the processor 110 calculates a second loss L2 according to the Statistical Independence between the extracted features corresponding to one of the neural network structure layers SL1, SL2, … SLt (i.e., the neural network structure layer SLt-1). Specifically, the Statistical Independence of the random variables is shown in the following equation (1).
[0073] E(a p b q )=E(a p )E(b q ) ……(1)
[0074] where E(.) denotes the expected value of a random variable, a and b are random variables, and p and q are positive integers. According to equation (1), the independence loss can be represented by equation (2) as follows.
[0075] independent loss = -|E(a p b q )- E(a p )E(b q )| ……(2)
[0076] As shown in FIG. 3, the random variable is replaced by the extracted feature , equation (2) can be rewritten as equation (3) as follows, which represents the second loss L2 (i.e., the independence loss between the extracted features ).
[0077]
[0078] ……(3)
[0079] where j and k are positive integers and are not greater than m. According to equation (3), the second loss L2 is calculated based on the extracted features . In some embodiments, the second loss of equation (3) can be further multiplied by an importance value to generate the second loss L2, where the importance value is greater than zero and is a hyperparameter that controls the importance of the independence loss.
[0080] Please refer to Figure 5 , Figure 5 a flowchart of detailed steps S221-S224B of step S220 in some other embodiments is shown.
[0081] It is noted that Figure 4 is different from Figure 5 only in step S224B. In other words, in addition to performing step S224A to generate the second loss, step S224B can also be optionally performed to generate the second loss. Therefore, only step S224B is described below, and the remaining steps are not described again.
[0082] As shown in Figure 3 and Figure 5 , in step S224B, the second loss L3 is calculated by the processor 110 based on the average processing effect between the extracted features corresponding to one of the neural network structure layers SL1, SL2, …, SLt (i.e., the neural network structure layer SLt-1) and the training label of the training sample. In detail, the average processing effect (i.e., the causality) of the random variable is shown in equation (4) as follows.
[0083]
[0084] Where p(.) represents the probability of the random variable Y i and T i It is a random variable. And it represents treatment. And these are observation results. And it is a covariate vector, and .
[0085] As shown in Figure 3, by using Y i And T i Replace with training labels and extracted features processed by a strong activation function (HardSigmoid) Formula (4) can be rewritten as formula (5) below.
[0086] ……(5)
[0087] The loss of the j-th extracted feature refers to the causal loss (i.e., the average treatment effect loss) corresponding to the extracted features H1,j, H2,j, ..., Hn,j. It refers to the range of The strong activation function. Based on formula (5), the extracted features are indicated. The second loss L3 of the average treatment effect is shown in the following formula (6).
[0088]
[0089] The second loss L3 is calculated using formula (6) based on the extracted features and the training labels of the training samples. In some embodiments, the second loss of formula (6) may be further multiplied by another importance value to produce the second loss L3, wherein the other importance value is also greater than zero and is another hyperparameter that controls the importance of the average treatment effect loss.
[0090] Please refer to the above as well. Figure 6 , Figure 6 A flowchart illustrating the detailed steps S231A to S233 of step S230 in some embodiments is shown.
[0091] like Figure 6 As shown, in step S231A, the processor 110 calculates the loss difference based on the first loss and the second loss. Specifically, the processor 110 performs a difference calculation between the first loss and the second loss to generate the loss difference (i.e., the first loss minus the second loss). It is worth noting that the second loss can be obtained from... Figure 4 Step S224A orFigure 5 Step S224B produces a loss difference. In other words, the loss difference can be calculated according to the first loss and the independent loss or according to the first loss and the average processing effect loss.
[0092] In addition, the loss difference can also be calculated according to the first loss, the second loss produced in step S224A in FIG. 4, and the second loss produced in step S224B. Figure 5 The loss difference can be calculated according to the first loss and the second loss produced in step S224B (more details will be illustrated by some examples in the following paragraphs).
[0093] In step S232, it is determined whether the loss difference converges. In some embodiments, when the loss difference converges, the loss difference can be close to or equal to a difference threshold value produced according to the statistical experiment result.
[0094] In this embodiment, if the loss difference does not converge, step S233 is performed. In step S233, the processor 110 performs a backpropagation operation on the classification model according to the first loss and the second loss to update the model parameters MP. In other words, according to the backpropagation based on the first loss and the second loss, an updated model parameter is generated from the model parameters MP.
[0095] In this way, steps S233, S220, and S231A are repeatedly continued to gradually update the model parameters MP in an iterative manner. In this way, the loss difference will be gradually minimized (i.e., the second loss is gradually maximized) until the loss difference is close to or equal to the difference threshold value. Conversely, if the loss difference converges, it means that the machine learning device 100 has completed the training, and the trained classification model 111 can be used to perform subsequent applications.
[0096] Based on the above embodiments, by using the second loss in step S224A, the extracted features belonging to the explicit pseudo-relevance can be removed in step S230. In addition, by using the second loss in step S224B, the extracted features belonging to the implicit pseudo-relevance can be removed in step S230.
[0097] Please refer to Figure 7 , Figure 6 a flowchart of additional steps after step S224A in some embodiments is shown.
[0098] As shown in Figure 7 , step S220’A calculates a third loss in the same way as calculating the second loss in step S224B. In other words, this means that after generating the first loss by the processor 110, an independent loss and an average processing effect loss are generated. Since step S220’A is similar to step S224B, this step will not be described again.
[0099] Please refer to Figure 8, Figure 8 A flowchart showing detailed steps S231B-S233 of step S230 is shown in some other embodiments.
[0100] It is noted that Figure 6 and Figure 8 differ only in step S231B. In other words, in addition to performing step S231A to generate the loss difference, step S231B can also be optionally performed to generate the loss difference. Therefore, only step S231B is described below, and the remaining steps are not described again.
[0101] As shown in Figure 8 , after step S220' is performed, step S231B is performed. In step S231B, the processor 110 calculates the loss difference based on the first loss, the second loss, and the third loss. In detail, the processor 110 performs a difference operation between the first loss and the second loss to generate a first difference, and then performs another difference operation between the first difference and the third loss to generate the loss difference (i.e., the first loss minus the second loss, and then minus the third loss). Therefore, in step S233, the updated model parameters are generated from the model parameters MP based on the backpropagation based on the first loss, the second loss, and the third loss. In this way, steps S233, S220, and S231B are also repeatedly continued to gradually update the model parameters MP in an iterative manner. In this way, similarly, the loss difference is also gradually minimized (i.e., the second loss and the third loss are gradually maximized) until the loss difference approaches or equals the difference threshold.
[0102] Based on the above embodiments, by simultaneously using the second loss in step S224A and the third loss in S220', the extracted features belonging to the explicit pseudo-relevance and the implicit pseudo-relevance can be removed in step S230.
[0103] As shown in Figure 1 , in the training process of the machine learning device 100, the model parameters MP of the classification model 111 are updated based on the first loss and the second loss to avoid the explicit pseudo-relevance or the implicit pseudo-relevance between the extracted features and the training labels, where the second loss can be the independence loss or the average processing effect loss. In addition, by adjusting the model parameters MP using the independence loss and the average processing effect loss, the explicit pseudo-relevance and the implicit pseudo-relevance can be removed, thereby greatly improving the prediction accuracy of the classification model 111.
[0104] In the field of computer vision and computer prediction, the accuracy of deep learning mainly depends on a large amount of labeled training data. With the increase of the quality, quantity and variety of training data, the performance of the classification model is usually relatively improved. However, there is always explicit or implicit pseudo-correlation between the feature extraction and the training label of the classification model. If we can remove the explicit or implicit pseudo-correlation, the efficiency will be higher and more accurate. In the above embodiments of the present disclosure, it is proposed to adjust the model according to the independence loss and the average treatment effect loss to remove the explicit or implicit pseudo-correlation in the classification model. Therefore, adjusting the model parameters according to the independence loss and the average treatment effect loss can improve the overall performance of the model.
[0105] At the application level, the machine learning method and the machine learning system of the present disclosure can be used in various fields with machine vision, image classification, data prediction or data classification. For example, the machine learning method can be used in the classification of medical images, such as identifying normal X-ray images, images of patients with pneumonia, images of patients with bronchitis, images of patients with heart disease, or identifying normal ultrasound images, images of abnormal fetal position. The machine learning method can also be used to predict the rise or fall of future stock data. On the other hand, the machine learning method can also be used in the classification of images collected by autonomous driving, such as identifying normal road conditions, road conditions with obstacles and other vehicles. There are other similar machine learning fields, for example, the machine learning method and the machine learning system of the present disclosure can also be used in the field of machine learning such as pitch recognition, spectrum recognition, big data analysis, data feature recognition and other related fields.
[0106] Although the specific embodiments of the present disclosure have been disclosed with respect to the above embodiments, these embodiments are not intended to limit the present disclosure. Various alternatives and modifications can be performed by those skilled in the art without departing from the principles and spirit of the present disclosure. Therefore, the scope of protection of the present disclosure is determined by the appended application patent claims.
Claims
1. A machine learning method, characterized in that, Used in clinical imaging, including: A processor retrieves model parameters from a memory and executes a classification model based on the model parameters, wherein the classification model includes multiple neural network structure layers; The processor calculates a first loss based on multiple predicted labels generated from multiple training samples and multiple training labels of those training samples, and calculates a second loss based on multiple extracted features generated from the multiple training samples. The first loss corresponds to an output layer in the neural network structure, and the second loss corresponds to a layer in the neural network structure preceding the output layer. Spurious correlations exist between the multiple extracted features and the multiple training labels. The processor trains the classification model by performing multiple update operations on the model parameters based on the first loss and the second loss to remove spurious correlations between the extracted features and the training labels, wherein the second loss is... n is a positive integer representing the number of training samples, p and q are positive integers, and H i,j and H i,k It is to extract features, where j and k are positive integers and not greater than m; The pseudo-correlation includes explicit pseudo-correlation and implicit pseudo-correlation. If the clinical image has lesion cellular tissue and bone with a similar color to the cellular tissue, there is an explicit pseudo-correlation between the extracted bone features and the lesion label. If the lesion in the clinical image is similar to the background, there is an implicit pseudo-correlation between the extracted background features and the lesion label.
2. The machine learning method of claim 1, wherein the step of calculating the first loss based on the plurality of predicted labels generated from the training samples includes: The processor generates the multiple predicted labels from the output layer of the neural network structure layers based on the training samples; as well as The processor calculates the first loss by comparing the predicted labels with multiple training labels of the training samples.
3. The machine learning method according to claim 1, wherein the step of calculating the second loss based on the plurality of extracted features generated from the training samples includes: The processor generates the multiple extracted features from the classification model based on the training samples, wherein the extracted features correspond to one layer of the neural network structure.
4. The machine learning method of claim 3, wherein performing the update operations on the model parameters based on the first loss and the second loss to train the classification model comprises: The processor calculates multiple loss differences based on the first loss and the second loss; as well as The processor performs multiple backpropagation operations on the classification model based on these loss differences to update the model parameters.
5. The machine learning method according to claim 3, further comprising: The processor calculates a third loss based on the extracted features and the average processing effect among multiple training labels of the training samples.
6. The machine learning method of claim 5, wherein performing the update operations on the model parameters based on the first loss and the second loss to train the classification model comprises: The processor calculates multiple loss differences based on the first loss, the second loss, and the third loss; as well as The processor performs multiple backpropagation operations on the classification model based on these loss differences to update the model parameters.
7. The machine learning method of claim 1, wherein the output layer comprises at least one fully connected layer, and one of the neural network structure layers comprises at least one convolutional layer.
8. The machine learning method of claim 1, wherein the classification model is related to a neural network.
9. A machine learning device, characterized in that, Used in clinical imaging, including: A memory for storing multiple instructions and a model parameter; A processor, connected to the memory, wherein the processor is used to run a classification model and execute the instructions to: The model parameters are retrieved from the memory, and the classification model is executed based on the model parameters, wherein the classification model includes multiple neural network structure layers; A first loss is calculated based on multiple predicted labels generated from multiple training samples and multiple training labels of those training samples, and a second loss is calculated based on multiple extracted features generated from those training samples. The first loss corresponds to an output layer in the neural network structure, and the second loss corresponds to a layer in the neural network structure preceding the output layer. Spurious correlations exist between the multiple extracted features and the multiple training labels. The classification model is trained by performing multiple update operations on the model parameters based on the first loss and the second loss to remove spurious correlations between the extracted features and the training labels, where the second loss is... n is a positive integer representing the number of training samples, p and q are positive integers, and H i,j and H i,k It is to extract features, where j and k are positive integers and not greater than m; The pseudo-correlation includes explicit pseudo-correlation and implicit pseudo-correlation. If the clinical image has lesion cellular tissue and bone with a similar color to the cellular tissue, there is an explicit pseudo-correlation between the extracted bone features and the lesion label. If the lesion in the clinical image is similar to the background, there is an implicit pseudo-correlation between the extracted background features and the lesion label.
10. The machine learning apparatus of claim 9, wherein the processor is further configured to: The multiple predicted labels are generated from the output layer of the neural network structure layers based on the training samples; and The predicted labels and multiple training labels of the training samples are compared to calculate the first loss.
11. The machine learning apparatus of claim 9, wherein the processor is further configured to: The multiple extracted features are generated from the classification model based on the training samples, wherein the extracted features correspond to one layer of the neural network structure.
12. The machine learning apparatus of claim 11, wherein the processor is further configured to: Calculate multiple loss differences based on the first loss and the second loss; and Based on these loss differences, perform multiple backpropagation operations on the classification model to update the model parameters.
13. The machine learning apparatus of claim 11, wherein the processor is further configured to: A third loss is calculated based on the extracted features and the average processing effect among multiple training labels of the training samples.
14. The machine learning apparatus of claim 13, wherein the processor is further configured to: Calculate multiple loss differences based on the first loss, the second loss, and the third loss; and Based on these loss differences, perform multiple backpropagation operations on the classification model to update the model parameters.
15. The machine learning apparatus of claim 9, wherein the output layer comprises at least one fully connected layer, and one of the neural network structure layers comprises at least one convolutional layer.
16. The machine learning apparatus of claim 9, wherein the classification model is related to a neural network.
Citation Information
Patent Citations
Data processing method and equipment and computer storage medium
CN110738403A