Learning device, learning method, learning program, estimation device, estimation method, and estimation program
The learning device optimizes model cascades by updating lightweight and high-precision models with a customized loss function, enhancing accuracy and reducing computational overhead without needing an IDK classifier.
Patent Information
- Application Number
- JP2024029580
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2040-03-06
AI Technical Summary
Conventional model cascades incur computational cost and resource overhead due to the need for additional IDK classifiers alongside lightweight and high-precision classifiers.
A learning device optimizes a model cascade by updating parameters of lightweight and high-precision models based on a customized loss function that minimizes computational cost and resource overhead without requiring an IDK classifier, using a high-precision model only when the lightweight model's estimation is unreliable.
This approach improves the accuracy of the model cascade while reducing computational cost and resource overhead, without modifying the model architecture or limiting optimization methods.
Smart Images

Figure 0007772117000004 
Figure 0007772117000005 
Figure 0007772117000006
Abstract
Description
[Technical Field]
[0001] The present invention relates to a learning device, a learning method, a learning program, an estimation device, an estimation method, and an estimation program. [Background technology]
[0002] Recently, real-time applications using deep neural networks (DNNs), such as video surveillance, voice assistants, and autonomous driving, are emerging. These real-time applications require processing a large number of queries in real time with limited resources while maintaining the accuracy of the DNNs. To address this issue, a technology called model cascade has been proposed that uses a fast, low-accuracy lightweight model and a slow, high-accuracy high-accuracy model to accelerate inference processing with minimal degradation in accuracy.
[0003] A model cascade uses multiple models, including lightweight models and high-precision models. When performing inference using a model cascade, estimation is first performed using a lightweight model, and if the result is reliable, the result is adopted and the process is terminated. On the other hand, if the estimation result of the lightweight model is unreliable, inference is then performed using a high-precision model, and the result is adopted. For example, IDK Cascade (see, for example, Non-Patent Document 1) is known, which introduces an IDK (I Don't Know) classifier to determine whether the estimation result of the lightweight model is reliable. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] Wang, Xin, et al. "Idk cascades: Fast deep learning by learning not to overthink." arXiv preprint arXiv:1706.00885 (2017). Summary of the Invention [Problem to be solved by the invention]
[0005] However, conventional model cascades have the problem of incurring overhead in terms of computational costs and resources. For example, the technology of Non-Patent Document 1 requires an IDK classifier in addition to a lightweight classifier and a high-precision classifier. This adds one model, resulting in overhead in terms of computational costs and resources. [Means for solving the problem]
[0006] In order to solve the above-mentioned problems and achieve the object, a learning device is characterized by having an estimation unit that inputs training data to a first model that outputs an estimation result based on the input data and obtains a first estimation result, and an update unit that updates parameters of the first model based on the first estimation result and a second estimation result obtained by inputting the training data to a second model that outputs an estimation result based on the input data and has a slower processing speed than the first model or higher estimation accuracy than the first model, so as to optimize a loss calculated based on a loss function of a model cascade including the first model and the second model, the loss function increasing as the confidence of the first estimation result decreases. [Effects of the Invention]
[0007] According to the present invention, it is possible to suppress the computational cost and computational resource overhead of a model cascade. [Brief explanation of the drawings]
[0008] [Figure 1] FIG. 1 is a diagram illustrating a model cascade. [Figure 2] FIG. 2 is a diagram illustrating an example of the configuration of the learning device according to the first embodiment. [Figure 3] FIG. 3 is a diagram showing an example of loss for each case. [Figure 4]FIG. 4 is a flowchart showing the flow of the learning process for the high-precision model. [Figure 5] FIG. 5 is a flowchart showing the flow of the learning process of the lightweight model. [Figure 6] FIG. 6 is a diagram illustrating an example of the configuration of an estimation system according to the second embodiment. [Figure 7] FIG. 7 is a flowchart showing the flow of the estimation process. [Figure 8] FIG. 8 shows the experimental results. [Figure 9] FIG. 9 shows the experimental results. [Figure 10] FIG. 10 shows the experimental results. [Figure 11] FIG. 11 shows the experimental results. [Figure 12] FIG. 12 shows the experimental results. [Figure 13] FIG. 13 is a diagram illustrating an example of the configuration of an estimation device according to the third embodiment. [Figure 14] FIG. 14 is a diagram illustrating a model cascade including three or more models. [Figure 15] FIG. 15 is a flowchart showing the flow of the learning process for three or more models. [Figure 16] FIG. 16 is a flowchart showing the flow of estimation processing using three or more models. [Figure 17] FIG. 17 is a diagram illustrating an example of a computer that executes a learning program. DETAILED DESCRIPTION OF THE INVENTION
[0009] Hereinafter, embodiments of a learning device, a learning method, a learning program, an estimation device, an estimation method, and an estimation program according to the present application will be described in detail with reference to the accompanying drawings. Note that the present invention is not limited to the embodiments described below.
[0010] [First embodiment] A learning device according to the first embodiment uses input learning data to learn a high-precision model and a lightweight model. The learning device then outputs information about the trained high-precision model and information about the trained lightweight model. For example, the learning device outputs parameters necessary to build each model.
[0011] The high-precision model and the lightweight model are models that output estimation results based on input data. In the first embodiment, the high-precision model and the lightweight model are multi-class classification models that input an image and estimate the probability of each class of an object appearing in the image. However, the high-precision model and the lightweight model are not limited to such multi-class classification models and may be any model to which machine learning can be applied.
[0012] The high-precision model has a slower processing speed and higher estimation accuracy than the lightweight model. Note that the high-precision model may simply be known to have a slower processing speed than the lightweight model. In this case, the high-precision model is expected to have higher estimation accuracy than the lightweight model. Note that the high-precision model may simply be known to have higher estimation accuracy than the lightweight model. In this case, the lightweight model is expected to have a faster processing speed than the high-precision model.
[0013] The high-precision model and the lightweight model constitute a model cascade. Figure 1 is a diagram illustrating the model cascade. For the sake of explanation, two images are shown in Figure 1, but both are the same image. As shown in Figure 1, the lightweight model outputs the probability of each class for the object appearing in the input image. For example, the lightweight model outputs the probability that the object appearing in the image is a cat as approximately 0.5. Also, the lightweight model outputs the probability that the object appearing in the image is a dog as approximately 0.35.
[0014] Here, if the output of the lightweight model, i.e., the estimation result, satisfies the condition, the estimation result is adopted. In other words, the estimation result of the lightweight model is output as the final estimation result of the model cascade. On the other hand, if the estimation result of the lightweight model does not satisfy the condition, the estimation result obtained by inputting the same image into the high-precision model is output as the final estimation result of the model cascade. However, like the lightweight model, the high-precision model outputs the probability of each class for objects appearing in the input image. For example, the condition is that the maximum value of the probabilities output by the lightweight model exceeds a threshold.
[0015] For example, the high-precision model is ResNet18 and runs on a server, etc. Also, for example, the lightweight model is MobileNetV2 and runs on IoT devices and various terminal devices. Note that the high-precision model and the lightweight model may run on the same computer.
[0016] [Configuration of the first embodiment] Fig. 2 is a diagram showing an example of the configuration of a learning device according to the first embodiment. As shown in Fig. 2, the learning device 10 receives input of learning data and outputs trained high-precision model information and trained lightweight model information. The learning device 10 also includes a high-precision model training unit 11 and a lightweight model training unit 12.
[0017] The high-precision model learning unit 11 has an estimation unit 111, a loss calculation unit 112, and an update unit 113. The high-precision model learning unit 11 also stores high-precision model information 114. The high-precision model information 114 is information such as parameters for constructing a high-precision model. The learning data is assumed to be data with known labels. For example, the learning data is a combination of an image and a label (correct class).
[0018] The estimation unit 111 inputs learning data into a high-accuracy model constructed based on the high-accuracy model information 114, and acquires an estimation result. The estimation unit 111 accepts input of learning data and outputs an estimation result.
[0019] The loss calculation unit 112 calculates a loss based on the estimation result acquired by the estimation unit 111. The loss calculation unit 112 receives input of the estimation result and the label, and outputs the loss. For example, the loss calculation unit 112 calculates a loss such that the smaller the confidence level for the label in the estimation result acquired by the estimation unit 111, the larger the loss. For example, the confidence level is a degree of likelihood that the estimation result is correct. For example, the confidence level may be the probability output by the multi-class classification model described above. Specifically, the loss calculation unit 112 can calculate the softmax cross entropy, which will be described later, as the loss.
[0020] The update unit 113 updates the parameters of the high-precision model so as to optimize the loss. For example, if the high-precision model is a neural network, the update unit 113 updates the parameters of the high-precision model by backpropagation or the like. Specifically, the update unit 113 updates the high-precision model information 114. The update unit 113 receives an input of the loss calculated by the loss calculation unit 112 and outputs information on the updated model.
[0021] The lightweight model learning unit 12 includes an estimation unit 121, a loss calculation unit 122, and an update unit 123. The lightweight model learning unit 12 also stores lightweight model information 124. The lightweight model information 124 is information such as parameters for constructing a lightweight model.
[0022] The estimation unit 121 inputs learning data into a lightweight model constructed based on the lightweight model information 124, and acquires an estimation result. The estimation unit 121 accepts input of learning data and outputs an estimation result.
[0023] Here, the high-precision model learning unit 11 learns the high-precision model based on the output of the high-precision model, while the lightweight model learning unit 12 learns the lightweight model based on the outputs of both the high-precision model and the lightweight model.
[0024] The loss calculation unit 122 calculates the loss based on the estimation result obtained by the estimation unit. The loss calculation unit 122 receives input of the estimation result by the high-precision model, the estimation result by the lightweight model, and the label, and outputs the loss. The estimation result by the high-precision model may be an estimation result obtained by inputting further learning data into the high-precision model after learning by the high-precision model learning unit 11. More specifically, the lightweight model learning unit 12 receives input of whether the estimation result by the high-precision model was correct. For example, if the class with the highest probability output by the high-precision model matches the label, the estimation result is correct.
[0025] The loss calculation unit 122 calculates the loss with the aim of maximizing the estimation accuracy of a single lightweight model, as well as maximizing the profit when a model cascade is configured. Here, the profit increases as the estimation accuracy increases and as the calculation cost decreases.
[0026] For example, a high-precision model is characterized by high estimation accuracy but high calculation costs. On the other hand, a light-weight model is characterized by low estimation accuracy but low calculation costs. Therefore, the loss calculation unit 122 calculates the loss as shown in equation (1), where w is a weight and is a parameter that is set in advance.
[0027]
number
[0028] where L classifier is the softmax entropy in a multi-class classification model. classifier is an example of the first term that increases as the confidence in the correct answer in the estimation result by the lightweight model decreases. classifieris expressed as in equation (2). Here, N is the number of samples, k is the number of classes, y is the label representing the correct class, q is the probability output by the lightweight model, i is the number identifying the sample, and j is the number identifying the class. The label y i,j is 1 if the jth class is correct for the ith sample, and 0 if it is incorrect.
[0029]
number
[0030] Also, L cascade is the term for maximizing profit when constructing a model cascade. L cascade represents the loss when the estimation results of the high-precision model and the lightweight model are adopted for each sample based on the confidence of the lightweight model. Here, the loss includes the penalty for inappropriate confidence and the cost of using the high-precision model. Furthermore, the loss is divided into four patterns depending on whether the estimation result of the high-precision model is correct or not and whether the estimation result of the lightweight model is correct or not. Details will be explained later, but if the estimation of the high-precision model is incorrect and the confidence of the lightweight model is low, the penalty will be large. On the other hand, if the estimation of the lightweight model is correct and the confidence of the lightweight model is high, the penalty will be small. L cascade is expressed as in equation (3).
[0031]
number
[0032] 1 fast is an indicator function that returns 0 if the estimation result of the lightweight model is correct, and 1 if the estimation result of the lightweight model is incorrect. acc is an indicator function that returns 0 if the estimation result of the high-precision model is correct, and 1 if the estimation result of the high-precision model is incorrect. accis the cost required to perform estimation using a high-precision model, and is a parameter that is set in advance.
[0033] max j q i,j is the maximum probability output by the lightweight model, and is an example of a confidence level. If the estimation result is correct, the higher the confidence level, the higher the estimation accuracy. On the other hand, if the estimation result is incorrect, the higher the confidence level, the lower the estimation accuracy.
[0034] (3) max j q i,j 1 fast is an example of the second term that increases as the confidence level of the estimation result by the lightweight model increases when the estimation result by the lightweight model is incorrect. j q i,j )1 acc is an example of the third term that increases as the confidence level of the estimation result by the lightweight model decreases when the estimation result by the high-precision model is incorrect. j q i,j )COST acc is an example of the fourth term that increases as the confidence level of the estimation result by the lightweight model decreases. In this case, minimizing the loss by the update unit 123 corresponds to optimizing the loss.
[0035] The update unit 123 updates the parameters of the lightweight model so as to optimize the loss. That is, the update unit 123 updates the parameters of the lightweight model so as to optimize the model cascade including the lightweight model and the high-precision model based on the estimation result from the lightweight model and the estimation result obtained by inputting learning data into a high-precision model, which is a model that outputs an estimation result based on input data and has a slower processing speed and higher estimation accuracy than the lightweight model. The update unit 123 accepts input of the loss calculated by the loss calculation unit 122 and outputs information about the updated model.
[0036] FIG. 3 shows an example of loss for each case. The vertical axis is L cascadeThe horizontal axis is the value of max j q i,j Also, the COST acc =0.5. max j q i,j is the confidence level of the estimation result by the lightweight model, and is simply referred to as the confidence level here.
[0037] The "□" in Figure 3 indicates the L confidence when the estimation results of both the lightweight model and the high-precision model are correct. cascade In this case, the greater the confidence, the greater the value of L cascade This is because if the estimation result using the lightweight model is correct, the greater the confidence level, the more likely the lightweight model is to be adopted.
[0038] In Figure 3, the "◇" indicates the L of the confidence when the estimation result of the lightweight model is correct and the estimation result of the high-precision model is incorrect. cascade In this case, the greater the confidence, the greater the value of L cascade The value of L is smaller than that of "□". cascade This is because if the estimation result by the high-precision model is incorrect and the estimation result by the lightweight model is correct, the tendency for the lightweight model to be adopted increases as the confidence level increases.
[0039] The "■" in Figure 3 indicates the L of confidence when the estimation result of the lightweight model is incorrect and the estimation result of the high-precision model is correct. cascade In this case, the greater the confidence, the greater the value of L cascade This is because even if the estimation result of the lightweight model is incorrect, the smaller the confidence level, the less likely the estimation result is to be adopted.
[0040] The "◆" in Figure 3 indicates the L confidence when both the lightweight model and the high-precision model are incorrect. cascade In this case, the greater the confidence, the greater the value of L cascade However, the value of L is smaller than in the case of "□". cascadeThe value of is large because the loss is always large due to incorrect estimation results from both models, and in such situations the lite model should be able to provide an accurate estimate.
[0041] [Processing of the first embodiment] 4 is a flowchart showing the flow of the learning process for the high-accuracy model. As shown in FIG. 4, first, the estimation unit 111 estimates the class of the learning data using the high-accuracy model (step S101).
[0042] Next, the loss calculation unit 112 calculates the loss based on the estimation result of the high-precision model (step S102). Then, the update unit 113 updates the parameters of the high-precision model so as to optimize the loss (step S103). Note that the learning device 10 may repeat the processes from step S101 to step S103 until a termination condition is satisfied. The termination condition may be that the processes have been repeated a predetermined number of times, or that the update width of the parameters has converged.
[0043] Fig. 5 is a flowchart showing the flow of the learning process of the lightweight model. As shown in Fig. 5, first, the estimation unit 121 estimates the class of the learning data using the lightweight model (step S201).
[0044] Next, the loss calculation unit 122 calculates the loss based on the estimation result of the lightweight model, the estimation result of the high-precision model, and the cost of estimation using the high-precision model (step S202). Then, the update unit 123 updates the parameters of the lightweight model so as to optimize the loss (step S203). Note that the learning device 10 may repeat the processes from step S201 to step S203 until a termination condition is satisfied.
[0045] [Effects of the first embodiment] As described above, the estimation unit 121 inputs training data to a lightweight model that outputs an estimation result based on the input data, and obtains a first estimation result. Furthermore, the update unit 123 updates the parameters of the lightweight model based on the first estimation result and a second estimation result obtained by inputting training data to a high-precision model that outputs an estimation result based on the input data and that has a slower processing speed and higher estimation accuracy than the lightweight model, so that the model cascade including the lightweight model and the high-precision model is optimized. As described above, in the first embodiment, in a model cascade composed of a lightweight model and a high-precision model, the lightweight model can perform estimation suitable for the model cascade without providing a model such as an IDK classifier, thereby improving the performance of the model cascade. As a result, according to the first embodiment, not only is the accuracy of the model cascade improved, but the computational cost and overhead of computational resources can be reduced. Furthermore, since the first embodiment modifies the loss function, there is no need to modify the model architecture, and there are no limitations on the model or optimization method to be applied.
[0046] The update unit 123 updates the parameters of the lightweight model so as to minimize a loss calculated based on a loss function including: a first term that increases as the confidence level of the first estimation result decreases; a second term that increases as the confidence level of the first estimation result increases when the first estimation result is incorrect; a third term that increases as the confidence level of the first estimation result decreases when the second estimation result is incorrect; and a fourth term that increases as the confidence level of the first estimation result decreases. As a result, in the first embodiment, in a model cascade composed of a lightweight model and a high-precision model, it is possible to improve the estimation accuracy of the model cascade while taking into account the cost of adopting the estimation result of the high-precision model.
[0047] [Second embodiment] [Configuration of the second embodiment] In the second embodiment, an estimation system that performs estimation using a trained high-precision model and a lightweight model will be described. According to the estimation system of the second embodiment, estimation by a model cascade can be performed with high accuracy without providing an IDK classifier or the like. In the following description of the embodiments, the same reference numerals will be used to denote units having the same functions as those in the previously described embodiments, and descriptions thereof will be omitted where appropriate.
[0048] As shown in Fig. 6, the estimation system 2 includes a high-accuracy estimation device 20 and a light-weight estimation device 30. The high-accuracy estimation device 20 and the light-weight estimation device 30 are connected via a network N. The network N is, for example, the Internet. In this case, the high-accuracy estimation device 20 may be a server provided in a cloud environment. The light-weight estimation device 30 may be an IoT device or various terminal devices.
[0049] 6, the high-accuracy estimation device 20 stores high-accuracy model information 201. The high-accuracy model information 201 is information such as parameters of a trained high-accuracy model. The high-accuracy estimation device 20 also includes an estimation unit 202.
[0050] The estimation unit 202 inputs estimation data into a high-precision model constructed based on the high-precision model information 201, and obtains an estimation result. The estimation unit 202 accepts the input of estimation data and outputs the estimation result. The estimation data is assumed to be data with unknown labels. For example, the estimation data is an image.
[0051] Here, the high-accuracy estimation device 20 and the light-weight estimation device 30 constitute a model cascade. Therefore, the estimation unit 202 does not always perform estimation on the estimation data. When it is determined not to adopt the estimation result of the light-weight model, the estimation unit 202 performs estimation using the high-accuracy model.
[0052] The lightweight estimating device 30 stores lightweight model information 301. The lightweight model information 301 is information such as parameters of a trained lightweight model. The lightweight estimating device 30 also includes an estimating unit 302 and a determining unit 303.
[0053] The estimation unit 302 acquires an estimation result by inputting estimation data into a lightweight model in which parameters trained in advance are set so as to optimize a model cascade including the lightweight model and the high-precision model, based on an estimation result obtained by inputting learning data into a lightweight model that outputs an estimation result based on input data, and an estimation result obtained by inputting learning data into a high-precision model that outputs an estimation result based on input data and has higher estimation accuracy than the lightweight model. The estimation unit 302 accepts input of estimation data and outputs an estimation result.
[0054] The determination unit 303 also determines whether the estimation result based on the lightweight model satisfies a predetermined condition regarding estimation accuracy. For example, if the confidence level is equal to or greater than a threshold, the determination unit 303 determines that the estimation result based on the lightweight model satisfies the condition. In this case, the estimation system 2 adopts the estimation result based on the lightweight model.
[0055] Furthermore, when the determination unit 303 determines that the estimation result based on the lightweight model does not satisfy the conditions, the estimation unit 202 of the high-accuracy estimation device 20 inputs the data for estimation into the high-accuracy model to obtain the estimation result. In this case, the estimation system 2 adopts the estimation result of the high-accuracy model.
[0056] [Processing of the second embodiment] Fig. 7 is a flowchart showing the flow of the estimation process. As shown in Fig. 7, first, the estimation unit 302 estimates the class of the estimation data using the lightweight model (step S301).
[0057] Here, the determination unit 303 determines whether the estimation result satisfies the condition (step S302). If the estimation result satisfies the condition (step S302, Yes), the estimation system 2 outputs the estimation result of the lightweight model (step S303).
[0058] On the other hand, if the estimation result does not satisfy the condition (step S302, No), the estimation unit 202 estimates the class of the estimation data using the high-accuracy model (step S304), and the estimation system 2 outputs the estimation result of the high-accuracy model (step S305).
[0059] [Effects of the second embodiment] As described above, the estimation unit 302 inputs the estimation data into a lightweight model in which pre-trained parameters are set so that a model cascade including the lightweight model and the high-precision model is optimized, based on the estimation result obtained by inputting training data into a lightweight model that outputs an estimation result based on the input data and the high-precision model that outputs an estimation result based on the input data and has higher estimation accuracy than the lightweight model, to obtain the estimation result. Furthermore, the determination unit 303 determines whether the estimation result from the lightweight model satisfies a predetermined condition regarding estimation accuracy. As a result, in the second embodiment, a model cascade consisting of a lightweight model and a high-precision model can perform highly accurate estimation while suppressing the occurrence of overhead.
[0060] When the determination unit 303 determines that the estimation result based on the lightweight model does not satisfy the conditions, the estimation unit 202 inputs the data for estimation into the high-precision model to obtain the estimation result. As a result, according to the second embodiment, even when the estimation result based on the lightweight model cannot be adopted, a high-precision estimation result can be obtained.
[0061] The estimation system 2 according to the second embodiment can be expressed as follows. Specifically, the estimation system 2 includes a high-accuracy estimation device 20 and a lightweight estimation device 30. The lightweight estimation device 30 includes an estimation unit 302 that inputs estimation data into a lightweight model, which outputs an estimation result based on input data and obtains a first estimation result, based on the estimation result obtained by inputting learning data into a lightweight model that outputs an estimation result based on input data and a high-accuracy model that outputs an estimation result based on the input data and has a slower processing speed than the lightweight model or higher estimation accuracy than the lightweight model. The lightweight estimation device 302 also includes a determination unit 303 that determines whether the first estimation result satisfies a predetermined condition regarding estimation accuracy. The high-accuracy estimation device 20 includes an estimation unit 202 that inputs estimation data into the high-accuracy model and obtains a second estimation result when the determination unit 303 determines that the first estimation result does not satisfy the condition. The high-accuracy estimation device 20 may also obtain estimation data from the lightweight estimation device 30.
[0062] The estimation unit 202 performs estimation according to the result of estimation by the lightweight estimation device 30. That is, the estimation unit 202 inputs the estimation data to the high-precision model according to the first estimation result obtained by the lightweight estimation device 30 inputting the estimation data into the lightweight model in which parameters learned in advance are set so that a model cascade including the lightweight model and the high-precision model is optimized, based on an estimation result obtained by inputting learning data into a lightweight model that outputs an estimation result based on the input data, and an estimation result obtained by inputting learning data into a high-precision model that outputs an estimation result based on the input data and has a slower processing speed than the lightweight model or higher estimation accuracy than the lightweight model, and acquires a second estimation result.
[0063] [experiment] Here, an experiment conducted to confirm the effects of the embodiment and the results thereof will be described. Fig. 8 and Fig. 9 are diagrams showing the experimental results. In the experiment, the determination unit 303 in the second embodiment determines whether or not the confidence level exceeds a threshold value. The settings in the experiment are as follows: Dataset: CIFAR100 train:45000, validation:5000, test:10000 Lightweight model: MobileNetV2 High-precision model: ResNet18 How the model is trained Momentum SGD lr=0.01, momentum=0.9, weight decay=5e-4 LR is 0.2 times for 60, 120, and 160 epochs batch size: 128 Comparison methods (five experiments each) Base: Use the maximum class probability IDK Cascades (see Non-Patent Document 1) ConfNet (see Reference 1) Temperature Scaling (see Reference 2) Second embodiment Accuracy: Accuracy when performing inference using a model cascade configuration Offload count: Number of times inference was performed using a high-precision model (Reference 1) Wan, Sheng, et al. "Confnet: Predict with Confidence." 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2018. (Reference 2) Guo, Chuan, et al. "On calibration of modern neural networks." Proceedings of the 34th International Conference on Machine Learning-Volume 70. JMLR. org, 2017.
[0064] Using the above test data, estimation was actually performed using each method, including the second embodiment, and the relationship between the number of offloads and accuracy when the threshold was changed in increments of 0.01 from 0 to 1 is shown in Figure 8. As shown in Figure 8, the method of the embodiment (proposed) showed higher accuracy than the other methods, even when the number of offloads was reduced.
[0065] 9 and 10 show the relationship between the number of offloads and accuracy when estimating test data using the threshold value that provides the highest accuracy in the validation data. This shows that the second embodiment reduces the number of offloads to the greatest extent while maintaining the accuracy of the high-accuracy model.
[0066] 11 and 12 show the relationship between the number of offloads and accuracy when the number of offloads is minimized while maintaining the accuracy of the high-precision model using test data. This shows that the number of offloads is reduced the most according to the second embodiment.
[0067] [Third embodiment] In the second embodiment, an example has been described in which the device that performs estimation using a lightweight model and the device that performs estimation using a high-precision model are separate. On the other hand, estimation using a lightweight model and estimation using a high-precision model may be performed by the same device.
[0068] 13 is a diagram showing an example of the configuration of an estimation device according to the third embodiment. The estimation device 2a has the same functions as the estimation system 2 according to the second embodiment. The high-accuracy estimation unit 20a has the same functions as the high-accuracy estimation device 20 according to the second embodiment. The light estimation unit 30a has the same functions as the light estimation device 30 according to the second embodiment. Unlike the second embodiment, the estimation unit 202 and the determination unit 303 are located in the same device, and therefore, no data exchange occurs over a network during the estimation process.
[0069] [Fourth embodiment] While the embodiments have been described so far in which there are two models, a lightweight model and a high-precision model, the embodiments described so far can be expanded to cases in which there are three or more models.
[0070] FIG. 14 is a diagram illustrating a model cascade including three or more models. Here, it is assumed that there are M models (M>3). The (m+1)th model (M-1≧m≧1) has a slower processing speed than the mth model or a higher estimation accuracy than the mth model. In other words, the relationship between the (m+1)th model and the mth model is similar to the relationship between a high-precision model and a lightweight model. Furthermore, it can be said that the Mth model is the most accurate model and the 1st model is the most lightweight model.
[0071] In the fourth embodiment, estimation processing using three or more models can be realized using the estimation system 2 described in the second embodiment. First, the estimation system 2 replaces the high-precision model information 201 with information on the second model, and replaces the light-weight model information 301 with information on the first model. Then, the estimation system 2 executes the same estimation processing as in the second embodiment.
[0072] Thereafter, if the estimation result of the first model does not satisfy the condition and the estimation result of the second model does not satisfy the condition, the estimation system 2 replaces the high-precision model information 201 with information of the third model, replaces the lightweight model information 301 with information of the second model, and further executes the estimation process. The estimation system 2 repeats this process until an estimation result that satisfies the condition is obtained or the estimation process using the Mth model is completed. Note that a similar process can also be realized by the lightweight estimation device 30 alone by replacing the lightweight model information 301.
[0073] Furthermore, in the fourth embodiment, the learning device 10 described in the first embodiment can be used to realize learning processing for three or more models. The learning device 10 extracts two models with consecutive numbers from M models and performs learning processing using information on those models. First, the learning device 10 replaces the high-precision model information 114 with information on the Mth model and replaces the lightweight model information 124 with information on the (M-1)th model. Then, the learning device 10 performs learning processing similar to that of the first embodiment. In general, the learning device 10 replaces the high-precision model information 114 with information on the mth model and replaces the lightweight model information 124 with information on the (m-1)th model, and then performs learning processing similar to that of the first embodiment.
[0074] Fig. 15 is a flowchart showing the flow of the learning process for three or more models. Here, it is assumed that the learning process is performed by the learning device 10 of the first embodiment. As shown in Fig. 15, first, the learning device 10 sets M as the initial value of m (step S401). The estimation unit 121 estimates the class of the learning data using the (m-1)th model (step S402).
[0075] Next, the loss calculation unit 122 calculates the loss based on the estimation result of the (m-1)th model, the estimation result of the mth model, and the cost of estimation by the mth model (step S403). Then, the update unit 123 updates the parameters of the (m-1)th model so as to optimize the loss (step S404).
[0076] Here, the learning device 10 decreases m by 1 (step S405). If m has reached 1 (step S406, Yes), the learning device 10 ends the process. On the other hand, if m has not reached 1 (step S406, No), the learning device 10 returns to step S402 and repeats the process.
[0077] Fig. 16 is a flowchart showing the flow of estimation processing using three or more models. Here, it is assumed that the light estimation device 30 of the second embodiment performs the estimation processing. As shown in Fig. 16, first, the light estimation device 30 sets 1 as the initial value of m (step S501). The estimation unit 302 estimates the class of the estimation data using the mth model (step S502).
[0078] Here, the determination unit 303 determines whether the estimation result satisfies the condition and whether m reaches M (step S503). If the estimation result satisfies the condition or m reaches M (step S503, Yes), the light estimation device 30 outputs the estimation result of the m-th model (step S504).
[0079] On the other hand, if the estimation result does not satisfy the condition and m does not reach M (step S503, No), the estimation unit 302, the light estimation device 30, increases m by 1 (step S505), returns to step S502, and repeats the process.
[0080] For example, in conventional techniques, as the number of models increases, the number of IDK classifiers also increases, resulting in increased computational costs and overhead in computational resources. On the other hand, according to the fourth embodiment, even if the number of models constituting the model cascade increases to three or more, such an overhead problem does not arise.
[0081] [System configuration, etc.] Furthermore, the components of each device shown in the figure are conceptual functional units and do not necessarily have to be physically configured as shown. In other words, the specific form of distribution and integration of each device is not limited to that shown, and all or part of the devices can be functionally or physically distributed or integrated in any unit depending on various loads, usage conditions, etc. Furthermore, all or any part of the processing functions performed by each device can be realized by a CPU and a program analyzed and executed by the CPU, or can be realized as hardware using wired logic.
[0082] Furthermore, among the processes described in this embodiment, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically using a known method.In addition, the information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed as desired unless otherwise specified.
[0083] [program] In one embodiment, the learning device 10 and the lightweight estimation device 30 can be implemented by installing a program that executes the above-described learning process or estimation process as package software or online software on a desired computer. For example, by executing the above-described program on an information processing device, the information processing device can function as the learning device 10 or the lightweight estimation device 30. The information processing device referred to here includes desktop and notebook personal computers. Other information processing devices also include mobile communication terminals such as smartphones, mobile phones, and PHS (Personal Handyphone Systems), as well as slate terminals such as PDAs (Personal Digital Assistants).
[0084] The learning device 10 and the lightweight estimation device 30 can also be implemented as a server device that provides services related to the above-mentioned learning process or estimation process to a client terminal device used by a user. For example, the server device is implemented as a server device that receives learning data as input and outputs information about a trained model. In this case, the server device may be implemented as a web server or as a cloud that provides services related to the above-mentioned process through outsourcing.
[0085] 17 is a diagram showing an example of a computer that executes a learning program. The estimation program may also be executed by a similar computer. The computer 1000 includes, for example, a memory 1010 and a processor 1020. The computer 1000 also includes a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. These components are connected by a bus 1080.
[0086] The memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM 1012. The ROM 1011 stores a boot program such as a BIOS (Basic Input Output System). The processor 1020 includes a CPU 1021 and a GPU (Graphics Processing Unit) 1022. The hard disk drive interface 1030 is connected to a hard disk drive 1090. The disk drive interface 1040 is connected to a disk drive 1100. A removable storage medium such as a magnetic disk or optical disk is inserted into the disk drive 1100. The serial port interface 1050 is connected to a mouse 1110 and a keyboard 1120, for example. The video adapter 1060 is connected to a display 1130, for example.
[0087] The hard disk drive 1090 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, the program that defines each process of the learning device 10 is implemented as a program module 1093 in which computer-executable code is written. The program module 1093 is stored, for example, in the hard disk drive 1090. For example, a program module 1093 for executing processes similar to those of the functional configuration of the learning device 10 is stored in the hard disk drive 1090. Note that the hard disk drive 1090 may be replaced by an SSD.
[0088] Furthermore, setting data used in the processing of the above-described embodiment is stored as program data 1094, for example, in the memory 1010 or the hard disk drive 1090. Then, the CPU 1020 reads the program module 1093 or the program data 1094 stored in the memory 1010 or the hard disk drive 1090 into the RAM 1012 as necessary, and executes the processing of the above-described embodiment.
[0089] The program module 1093 and program data 1094 are not limited to being stored in the hard disk drive 1090, but may also be stored in, for example, a removable storage medium and read by the CPU 1020 via the disk drive 1100 or the like. Alternatively, the program module 1093 and program data 1094 may be stored in another computer connected via a network (such as a local area network (LAN) or a wide area network (WAN)). The program module 1093 and program data 1094 may then be read by the CPU 1020 from the other computer via the network interface 1070. [Explanation of symbols]
[0090] 2. Estimation System 2a Estimator 10 Learning Device 11 High-precision model learning unit 12 Lightweight Model Learning Unit 20 High precision estimation device 20a High-precision estimation section 30 Lightweight Estimation Device 30a Lightweight Estimation Section 111, 121, 202, 302 Estimation part 112, 122 Loss calculation section 113, 123 update section 114, 201 High-precision model information 124, 301 lightweight model information 303 Judgment section
Claims
1. an estimation unit that inputs learning data to a first model that outputs an estimation result based on the input data and obtains a first estimation result; an update unit that updates parameters of the first model based on the first estimation result and a second estimation result obtained by inputting the training data into a second model that outputs an estimation result based on input data and has a processing speed slower than that of the first model or has estimation accuracy higher than that of the first model, so as to optimize a loss calculated based on a loss function of a model cascade including the first model and the second model, the loss function representing a cost of using the second model by including a term that increases as the confidence of the first estimation result decreases; A learning device comprising:
2. A learning method executed by a learning device, comprising: an estimation step of inputting learning data into a first model that outputs an estimation result based on the input data, and acquiring a first estimation result; an updating step of updating parameters of the first model based on the first estimation result and a second estimation result obtained by inputting the training data into a second model that outputs an estimation result based on input data and has a processing speed slower than that of the first model or higher estimation accuracy than that of the first model, so as to optimize a loss calculated based on a loss function of a model cascade including the first model and the second model, the loss function representing a cost of using the second model by including a term that increases as the confidence of the first estimation result decreases; A learning method comprising:
3. A learning program for causing a computer to function as the learning device according to claim 1.
4. a first estimation unit that acquires a third estimation result by inputting estimation data into the first model, based on a first estimation result obtained by inputting learning data into a first model that outputs an estimation result based on input data, and a second estimation result obtained by inputting the learning data into a second model that outputs an estimation result based on input data and has a processing speed slower than the first model or has estimation accuracy higher than the first model, and that has parameters set in advance to be trained so as to optimize a loss calculated based on a loss function of a model cascade including the first model and the second model, the loss function including a term that increases as the confidence of the first estimation result decreases, thereby expressing a cost of using the second model; a determination unit that determines whether the third estimation result satisfies a predetermined condition regarding estimation accuracy; An estimation device comprising:
5. and a second estimation unit that, based on a first estimation result obtained by inputting training data into a first model that outputs an estimation result based on input data, and a second estimation result obtained by inputting the training data into a second model that outputs an estimation result based on input data and has a processing speed slower than the first model or has estimation accuracy higher than the first model, calculates a fourth estimation result by inputting estimation data into the first model, the first model having pre-trained parameters set so as to optimize a loss calculated based on a loss function of a model cascade including the first model and the second model, the loss function representing a cost of using the second model by including a term that becomes larger as the confidence in the first estimation result decreases.
6. An estimation method performed by an estimation device, comprising: a first estimation step of inputting estimation data into a first model that outputs an estimation result based on input data, the first model having parameters set in advance so as to optimize a loss calculated based on a loss function of a model cascade including the first model and the second model, the loss function including a term that increases as the confidence level of the first estimation result decreases, thereby expressing a cost of using the second model, based on a first estimation result obtained by inputting learning data into the first model and a second estimation result obtained by inputting the learning data into a second model that outputs an estimation result based on input data and has a processing speed slower than the first model or higher estimation accuracy than the first model; and a determination step of determining whether the third estimation result satisfies a predetermined condition regarding estimation accuracy; An estimation method comprising:
7. An estimation program for causing a computer to function as the estimation device according to claim 4 or 5.
Citation Information
Patent Citations
Probability-based guider
WO2018170175A1