Deep learning model range determination program, range determination system, and range determination method
By determining value ranges through sequential parameter quantization and loss minimization, the accuracy and efficiency of quantized deep learning models are enhanced, addressing the challenge of estimation accuracy loss in existing models.
Patent Information
- Application Number
- JP2022541117
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-08-06
- Filing Date
- 2021-04-28
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2041-04-28
AI Technical Summary
The estimation accuracy of quantized deep learning models decreases due to parameter quantization, and the optimal value range for each layer is difficult to set without compromising accuracy.
A program and system for determining value ranges in quantization by sequentially changing parameter ranges, calculating loss, and minimizing it to optimize quantized deep learning models.
This approach allows for the creation of highly accurate and lightweight quantized deep learning models by effectively setting parameter ranges to minimize estimation errors.
Smart Images

Figure 0007556390000003 
Figure 0007556390000008 
Figure 0007556390000002
Abstract
Description
[Technical field]
[0001] The present invention relates to a deep learning model value range determination program, a value range determination system, and a value range determination method. [Background technology]
[0002] In recent years, edge computing technology has been developed to introduce AI (Artificial Intelligence) technology into various familiar devices.
[0003] Edge computing technology requires low cost and low power consumption, so quantized deep learning models that can perform calculations at high speed using small-scale circuits are attracting attention.
[0004] Quantized deep learning models are made lighter by quantization, which converts parameters expressed as 16- to 32-bit floating point numbers in conventional deep learning models into fixed point numbers of 8 bits or less. Summary of the Invention [Problem to be solved by the invention]
[0005] However, the estimation accuracy of a quantized deep learning model can be degraded by parameter quantization, and also varies considerably depending on how the ranges are set. For this reason, it is difficult to quantize parameters by setting ranges for each layer while preventing a decrease in estimation accuracy.
[0006] The present invention has been made to solve such problems. That is, an object of the present invention is to provide a deep learning model range determination program, a range determination system, and a range determination method that can obtain a highly accurate and lightweight quantized deep learning model by quantizing parameters. [Means for solving the problem]
[0007] The above-mentioned object of the present invention is achieved by the following means.
[0008] (1) A program for determining a value range in the quantization of parameters of a deep learning model, the program comprising: a step (a) of obtaining input data and ground truth data corresponding to the input data; and a step (b) of sequentially changing the value range in the quantization of the parameters to quantize the parameters, calculating the loss of the estimation result by the deep learning model based on the input data relative to the ground truth data, and determining the value range when the loss is minimized.
[0009] (2) The step (b) is a value range determination program for a deep learning model described in (1) above, which sequentially changes the value range in quantization of the parameters, quantizes the parameters, learns the deep learning model using training teacher data, calculates the loss of the estimation result based on the input data by the learned deep learning model relative to the ground truth data, and determines the value range when the loss is minimized.
[0010] (3) The program for determining a range of values for a deep learning model according to (2) above, wherein the step (b) includes the steps of: provisionally setting a range of values for quantizing the parameters of a predetermined target layer of the deep learning model; quantizing the parameters of the target layer with the range of values provisionally set in the step (b1), and learning the target layer or a specified layer using the training teacher data; calculating the loss of an estimation result based on the input data by the deep learning model trained in the step (b2) relative to the ground truth data; and determining the range of values when the loss calculated in the step (b3) is minimized by sequentially changing the provisionally set range of values and executing the steps (b2) and (b3).
[0011] (4) The program for determining a value range of the deep learning model described in (3) above, wherein the step (b) further includes a step (b5) of determining a value range of the parameters of the new target layer by performing the steps (b1) to (b4) on a layer one layer below the target layer as a new target layer, and a step (b6) of performing the step (b5) until the new target layer becomes the lowest layer.
[0012] (5) A value range determination program for a deep learning model described in (4) above, wherein the initial value of the target layer in (b1) is the top layer.
[0013] (6) A value range determination program for a deep learning model described in (4) above, wherein the initial value of the target layer in (b1) is a layer other than the top layer.
[0014] (7) A value range determination program for a deep learning model described in any of (3) to (6) above, wherein the parameters of each layer of the deep learning model include a weight and a bias, and the step (b2) includes a step (b21) of fixing the bias and learning the weight, and a step (b22) of fixing the weight and learning the bias.
[0015] (8) A value range determination program for a deep learning model described in any of (3) to (7) above, wherein the parameters of each layer of the deep learning model include weight, bias, and output, and the step (b4) calculates the value range of the bias based on the value range of the weight in the same layer as the bias layer and the value range of the output in the layer one layer above the bias layer.
[0016] (9) In the case of the deep learning model in which a layer below a convolutional layer is a Relu layer, the step (b4) sets the value range of the convolutional layer to be the same as the value range of the Relu layer. A value range determination program for a deep learning model according to any one of (3) to (8) above.
[0017] (10) A system for determining a value range in the quantization of parameters of a deep learning model, the system comprising: an acquisition unit that acquires input data and ground truth data corresponding to the input data; and a calculation unit that sequentially changes the value range in the quantization of the parameters to quantize the parameters, calculates a loss relative to the ground truth data of an estimation result by the deep learning model based on the input data, and determines the value range when the loss is minimized.
[0018] (11) A method for determining a value range for quantizing parameters of a deep learning model using a value range determination system, comprising: a step (a) of acquiring input data and ground truth data corresponding to the input data; and a step (b) of sequentially changing the value range for quantizing the parameters to quantize the parameters, calculating a loss relative to the ground truth data of an estimation result by the deep learning model based on the input data, and determining the value range when the loss is minimized. Effect of the Invention
[0019] The value range for quantizing the parameters of the deep learning model is changed sequentially to quantize the parameters, and the loss of the estimation results by the deep learning model based on the input data relative to the correct answer data is calculated to determine the value range when the loss is minimized. In this way, a highly accurate and lightweight quantized deep learning model can be obtained by quantizing the parameters. [Brief description of the drawings]
[0020] [Figure 1] FIG. 1 is a diagram illustrating a schematic configuration of a value range determination system for a deep learning model. [Diagram 2] FIG. 2 is a block diagram showing a hardware configuration of a range determination device. [Diagram 3]11 is a block diagram showing an example of the functions of a control unit of the range determination device; [Figure 4] FIG. 2 is an explanatory diagram showing an input image. [Diagram 5] FIG. [Figure 6] FIG. 11 is an explanatory diagram for explaining a value range in the quantization of model parameters that is provisionally set in sequence. [Figure 7] FIG. 1 is an explanatory diagram showing the transition in which the value range for quantization of model parameters is determined for each layer of a deep learning model. [Figure 8] 13 is a block diagram showing another example of the functions of the control unit of the range determination device. FIG. [Figure 9] 4 is a flowchart showing the operation of the range determining device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0021] Hereinafter, a deep learning model value range determination program, a value range determination system, and a value range determination method according to an embodiment of the present invention will be described with reference to the drawings. Note that in the drawings, the same elements are given the same reference numerals, and duplicated descriptions are omitted. Also, the dimensional ratios in the drawings are exaggerated for the convenience of explanation, and may differ from the actual ratios.
[0022] FIG. 1 is a diagram showing a schematic configuration of a deep learning model range determination system 10 according to an embodiment.
[0023] The range determination system 10 includes a range determination device 100, a photographing device 200, and a communication network 300. The range determination device 100 is connected to the photographing device 200 via the communication network 300 so that they can communicate with each other. In this specification, an object is an object whose position or partial position is estimated by the estimation unit 112 (see Fig. 3 and Fig. 8) of the range determination device 100. The object may include a plurality of categories. A category is a type of object, and includes a person, a dog, a cat, and the like. For the sake of simplicity, the following description will be given assuming that the object is a subject 500 (i.e., a "person"). The range determination device 100 determines a range in quantization of parameters (hereinafter also referred to as "model parameters") of a deep learning model of the estimation unit 112 that estimates the position or partial position of an object in an image (hereinafter also simply referred to as "input image 250") input to the range determination device 100. The input image 250 may be an image captured by the photographing device 200. The input image 250 constitutes the input data. Quantization means, for example, converting a model parameter expressed in a 16- to 32-bit floating point into a fixed point of 8 bits or less. In the following, for ease of explanation, quantization is assumed to convert a model parameter expressed in a 32-bit floating point into a value expressible in an 8-bit fixed point. For example, the value after quantization may be a value expressed in a floating point of more than 8 bits, as long as it is a value expressible in an 8-bit fixed point. In addition, the description is based on the premise that the model parameter expressed in a 32-bit floating point by learning in advance is converted into a model parameter expressible in an 8-bit fixed point by quantization. The model parameters include input, weight, bias, and output of each layer of the deep learning model. In addition, in order to ease of explanation, the estimation unit 112 of the value range determination device 100 estimates the position of a joint point 251 of the subject 500, which is an example of a partial position of an object, as a coordinate on the input image 250. Hereinafter, the positions of the joint points 251 and the like will also be simply referred to as the joint points 251 and the like.
[0024] The range determination device 100 may be integrated with the image capture device 200 and thereby be included in the image capture device 200 .
[0025] The photographing device 200 is arranged, for example, on the ceiling or upper part of a wall of the room of the subject 500, or on the ceiling or upper part of a wall of a store or the like. The photographing device 200 photographs a predetermined photographing range from a position where the subject 500 can be overlooked, and outputs an input image 250 (image data). The input image 250 includes an image including the subject 500. The photographing device 200 includes a wide-angle camera. The photographing device 200 may photograph the photographing area as an input image 250 of a video with a frame rate of, for example, 15 fps to 30 fps. The input image 250 includes a video and a still image. The input image 250 may be, for example, a black and white image, and an image of 128 pixels by 128 pixels. The input image 250 may be a color image. The photographing device 200 transmits the input image 250 to the range determining device 100 or the like.
[0026] A network interface based on a wired communication standard such as Ethernet (registered trademark) may be used for the communication network 300. A network interface based on a wireless communication standard such as Bluetooth (registered trademark) or IEEE802.11 may also be used for the communication network 300.
[0027] 2 is a block diagram showing the hardware configuration of value range determination device 100. Value range determination device 100 includes a control unit 110, a storage unit 120, a display unit 130, an input unit 140, and a communication unit 150. These components are connected to each other via a bus 160. Value range determination device 100 may be configured by a computer.
[0028] The control unit 110 is constituted by a CPU (Central Processing Unit) and performs control and calculation processing of each part of the range determining device 100 in accordance with a program. The operation of the control unit 110 will be described in detail later.
[0029] The storage unit 120 may be composed of a RAM (Random Access Memory), a ROM (Read Only Memory), and an SSD (Solid State Drive). The RAM temporarily stores programs and data as a working area for the control unit 110. The ROM stores various programs and data in advance. The SSD stores various programs including an operating system and various data.
[0030] The display unit 130 is, for example, a liquid crystal display, and displays various information.
[0031] The input unit 140 is configured with, for example, a touch panel and various keys, and is used for various operations and inputs.
[0032] The communication unit 150 is an interface for communicating with external devices. For communication, a network interface based on a standard such as Ethernet (registered trademark), SATA, PCI Express, USB, or IEEE 1394 may be used. For communication, a wireless communication interface such as Bluetooth (registered trademark), IEEE 802.11, or 4G may be used.
[0033] The operation of control unit 110 will now be described in detail.
[0034] 3 is a block diagram showing an example of the functions of the control unit 110 of the value range determination device 100. The control unit 110 functions as an acquisition unit 111, an estimation unit 112, a value range provisional setting unit 113, a loss calculation unit 114, and a value range determination unit 115. The estimation unit 112 may be configured using a deep learning model, which is a neural network. The estimation unit 112, the value range provisional setting unit 113, the loss calculation unit 114, and the value range determination unit 115 configure a calculation unit.
[0035] The acquisition unit 111 acquires an input image 250 and correct answer data of a joint point 251 corresponding to the input image 250 .
[0036] Fig. 4 is an explanatory diagram showing an input image 250. Fig. 5 is an explanatory diagram showing a joint point 251.
[0037] In the example input image 250 of FIG. 4, the input image 250 includes an image of a subject 500 .
[0038] 5 shows an example of 14 joint points 251. The joint points 251 include, for example, a right ankle, a right knee, a right hip, a left hip, a left knee, a left ankle, a right wrist, a right elbow, a right shoulder, a left wrist, a left elbow, a left shoulder, a neck, and a head.
[0039] The estimation unit 112 quantizes the model parameters expressed in 32-bit floating point in the value range provisionally set by the value range provisional setting unit 113 by converting them into values expressible in 8-bit fixed point. As described later, the value range provisional setting unit 113 provisionally sets different value ranges in sequence. The estimation unit 112 sequentially quantizes the model parameters in each value range provisionally set in sequence by the value range provisional setting unit 113. Note that the model parameters expressed in 32-bit floating point before quantization may be model parameters generated by learning in advance using a large amount of teacher data (a combination of an image and correct answer data corresponding to the image) by a relatively high-performance computer.
[0040] The estimation unit 112 may quantize the model parameters for each layer of the deep learning model in a value range provisionally set for each layer by the value range provisional setting unit 113. The estimation unit 112 may quantize the model parameters for each model parameter of the deep learning model in a value range provisionally set for each model parameter of the deep learning model by the value range provisional setting unit 113. For ease of explanation, the following description will be given assuming that the estimation unit 112 quantizes the model parameters for each layer in a value range provisionally set for each layer of the deep learning model.
[0041] The estimation unit 112 quantizes the model parameters for each layer of the deep learning model in the value range provisionally set by the value range provisional setting unit 113, and estimates the joint points 251 using the deep learning model based on the input image 250.
[0042] The provisional value range setting unit 113 provisionally sets the value range for quantization of the model parameters by sequentially changing the range.
[0043] Fig. 6 is an explanatory diagram for explaining the value range in the quantization of the model parameters, which are provisionally set in sequence. The horizontal axis of each graph in Fig. 6 indicates the value of the model parameter, and the vertical axis indicates the frequency. The frequency on the vertical axis is the frequency of the value that the model parameter takes when learning the deep learning model.
[0044] In FIG. 6, the dashed line indicates n , 2 n-1 , 2 n-2 represents the range (more precisely, the upper limit of the range). For example, in an 8-bit fixed-point representation, the exponent n is 8, and the range 2 n is 256 (decimal) = 11111111 (binary). Range 2 n For example, values from -128 to 127 (decimal) can be expressed in increments of 1 (decimal) = 1 (binary). n-1 For example, values from -64 to 63.5 (decimal) can be expressed in increments of 0.5 (decimal) = 0.1 (binary). Therefore, increasing the range of values increases the range of values that the model parameters can take, but the quantization error increases. Conversely, decreasing the range of values decreases the range of values that the model parameters can take, but the quantization error decreases.
[0045] As shown in the example of FIG. 6, the provisional range setting unit 113 sets the range for quantization of the model parameters as follows: n , 2 n-1 , 2 n-2 The provisional setting can be performed in the order of the above.
[0046] The loss calculation unit 114 calculates the loss of the estimation result of the joint point 251 based on the input image 250 by the estimation unit 112 with respect to the correct answer data. The loss may be, for example, the mean square of the difference (distance) between the joint point 251 and the correct answer data calculated for all the joint points 251. The loss calculation unit 114 calculates the loss in the provisionally set value range for each layer of the deep learning model.
[0047] The value range determination unit 115 determines, for each layer of the deep learning model, the value range when the loss calculated by the loss calculation unit 114 is minimized, and stores the determined value range in the storage unit 120 as a value range parameter.
[0048] FIG. 7 is an explanatory diagram showing the transition in which the value range in the quantization of model parameters is determined for each layer of a deep learning model.
[0049] The diagram on the left side of FIG. 7 shows a state in which Layer 1, the top layer of the deep learning model, has been quantized and a value range has been determined. The diagram on the right side shows a state in which Layer 1, the top layer of the deep learning model, has been quantized and a value range has been determined, and then Layer 2, which is one layer below the top layer, has been quantized and a value range has been determined. In this way, the deep learning model can be quantized layer by layer from the top layer to the bottom layer, and a value range can be determined. At this time, the quantization of the lower layer is performed in a state in which the quantization of the upper layer has been performed.
[0050] The deep learning model may be quantized and a value range may be determined only for a predetermined target layer. The predetermined target layer may be a plurality of target layers. Also, the deep learning model may be quantized and a value range may be determined only for a target layer set by inputting the target layer from the input unit 140 by a user or the like.
[0051] The deep learning model may be quantized layer by layer from a predetermined target layer to the bottom layer, and a value range may be determined. In this case, the predetermined target layer may be the top layer of the deep learning model, or a layer other than the top layer. That is, the initial value of the predetermined target layer may be the top layer, or a layer other than the top layer.
[0052] The value range determination section 115 can calculate (determine) the value range of bias, which is a model parameter, based on the value range of weight in the same layer as the bias, and the value range of output in the layer one layer above the bias layer.
[0053] In a deep learning model in which the layer below the convolutional layer is a relu layer, the range determination unit 115 can determine the range of the convolutional layer to be the same as the range of the relu layer.
[0054] 8 is a block diagram showing another example of the functions of the control unit 110 of the range determination device 100. The control unit 110 can function as an acquisition unit 111, an estimation unit 112, a temporary range setting unit 113, a loss calculation unit 114, a range determination unit 115, and a training loss calculation unit 116.
[0055] The acquisition unit 111 acquires an input image 250 and correct answer data of a joint point 251 corresponding to the input image 250. The acquisition unit 111 further acquires a learning input image and correct answer data for learning of the joint point 251 corresponding to the learning input image. In order to prevent overlearning of the deep learning model, it is preferable to use a learning input image and learning correct answer data that are different from the input image 250 and the correct answer data, respectively. The learning input image and learning correct answer data may be the same as the input image 250 and the correct answer data, respectively. A combination of the learning input image and the learning correct answer data constitutes learning teacher data.
[0056] The estimation unit 112 quantizes the model parameters expressed in 32-bit floating point by converting them into values expressible in 8-bit fixed point in the value range provisionally set by the value range provisional setting unit 113. The estimation unit 112 sequentially quantizes the model parameters in each value range provisionally set for each layer of the deep learning model by the value range provisional setting unit 113, and learns the deep learning model using the training teacher data as follows.
[0057] The learning loss calculation unit 116 calculates a learning loss for the learning super-answer data of the estimation result of the joint point 251 based on the learning input image by the estimation unit 112. The learning loss is a difference (distance) between the joint point 251 and the learning super-answer data, and is calculated for each joint point 251. The learning loss calculation unit 116 calculates the learning loss in the provisionally set value range for each layer of the deep learning model.
[0058] The estimation unit 112 learns the deep learning model by backpropagation so that the training losses calculated for each joint point 251 by the training loss calculation unit 116 become zero.
[0059] The estimation unit 112 quantizes the model parameters for each layer of the deep learning model in the value range provisionally set by the value range provisional setting unit 113, learns the deep learning model using the training teacher data (i.e., learns all layers of the deep learning model), and estimates the joint points 251 based on the input image 250 by the learned deep learning model. Thereby, when quantizing each layer of the deep learning model, the model parameters are fine-tuned for each layer. Note that the estimation unit 112 may quantize the model parameters for each layer of the deep learning model in the value range provisionally set by the value range provisional setting unit 113, and learn (update the model parameters) for each quantized layer. That is, quantization and learning may be performed for each predetermined layer. In this case, layers other than the predetermined layer are learned without updating the model parameters.
[0060] The provisional value range setting unit 113 provisionally sets the value range for quantization of the model parameters by sequentially changing the range.
[0061] The loss calculation unit 114 calculates the loss of the estimation result of the joint point 251 based on the input image 250 by the estimation unit 112 with respect to the correct answer data. The loss may be, for example, the mean square of the difference (distance) between the joint point 251 and the correct answer data calculated for all the joint points 251. The loss calculation unit 114 calculates the loss in the provisionally set value range for each layer of the deep learning model.
[0062] The value range determination unit 115 determines, for each layer of the deep learning model, a value range when the loss calculated by the loss calculation unit 114 is minimized.
[0063] The deep learning model may be quantized, trained, and ranged only for a given target layer.
[0064] The deep learning model may be quantized and trained layer by layer from a predetermined target layer to the bottom layer, and a value range may be determined. In this case, the predetermined target layer may be the top layer of the deep learning model, or a layer other than the top layer. That is, the initial value of the predetermined target layer may be the top layer, or a layer other than the top layer.
[0065] The layer-by-layer training of a deep learning model can be done in the following order: fix the bias model parameters and train the weights, then fix the weights and train the biases.
[0066] In this way, the value range of the model parameters is determined, and the learned estimation unit 112 detects the joint point 251 with high accuracy based on the input image 250. At this time, the estimation unit 112 reflects the learned model parameters stored in the storage unit 120 in the deep learning model to estimate the joint point 251. In addition, the estimation unit 112 reads out the parameters of the value range for each layer stored in the storage unit 120, and quantizes the model parameters for each layer based on the parameters of the value range.
[0067] The operation of the range determining device 100 will now be described.
[0068] 9 is a flowchart showing the operation of the range determining device 100. This flowchart is executed by the control unit 110 in accordance with a program stored in the storage unit 120.
[0069] The control unit 110 acquires an input image 250 and correct answer data of the joint points 251 corresponding to the input image 250 (S101). The control unit 110 may acquire the input image 250 and the correct answer data of the joint points 251 by reading them out from the storage unit 120. The control unit 110 may also acquire the input image 250 and the correct answer data of the joint points 251 by receiving them via the communication unit 150.
[0070] The control unit 110 provisionally sets a value range for quantization of a target layer of a deep learning model (S102).
[0071] The control unit 110 uses the training data to train the target layer with the model parameters quantized in the provisionally set value range (S103).
[0072] The control unit 110 estimates the joint points 251 from the input image using the learned deep learning model (S104).
[0073] The control unit 110 calculates the loss of the estimated joint point 251 relative to the correct data (S105).
[0074] The control unit 110 determines whether the loss has been calculated for all ranges (S106). If the control unit 110 determines that the loss has been calculated for all ranges (S106: YES), it executes step S107. If the control unit 110 determines that the loss has not been calculated for all ranges (S106: NO), it executes step S102.
[0075] The control unit 110 determines the provisionally set value range when the loss is minimized as the value range of the target layer (S107).
[0076] The control unit 110 determines whether the value ranges have been determined for all layers of the deep learning model (S108). If the control unit 110 determines that the value ranges have been determined for all layers of the deep learning model (S108: YES), the process ends. If the control unit 110 determines that the value ranges have not been determined for all layers of the deep learning model (S108: NO), the control unit 110 moves the target layer to the layer one layer below and executes steps S102 to S107.
[0077] This embodiment provides the following advantages.
[0078] The value range for quantizing the parameters of the deep learning model is changed sequentially to quantize the parameters, and the loss of the estimation results by the deep learning model based on the input data relative to the correct answer data is calculated to determine the value range when the loss is minimized. In this way, a highly accurate and lightweight quantized deep learning model can be obtained by quantizing the parameters.
[0079] Furthermore, the value range for quantizing the model parameters is sequentially changed, the parameters are quantized, and the deep learning model is trained using training data, while the loss of the estimation result based on the input data by the trained deep learning model relative to the ground truth is calculated, and the value range when the loss is minimized is determined. This makes it possible to further improve the estimation accuracy by the quantized deep learning model.
[0080] Furthermore, for a specified target layer, the value range in quantization of the deep learning model parameters is sequentially changed, the parameters are quantized, and the target layer or a specified layer is trained, while the loss of the estimation result by the deep learning model based on the input data relative to the ground truth is calculated, and the value range when the loss is minimized is determined. This makes it possible to obtain a highly accurate and lightweight quantized deep learning model more simply and flexibly.
[0081] Furthermore, the parameter quantization is performed by sequentially changing the value range for the deep learning model parameters for each layer from the specified target layer to the bottom layer, and the loss of the estimation result by the deep learning model based on the input data relative to the correct answer data is calculated to determine the value range when the loss is minimized. This allows the quantization error of the upper layers to be absorbed in the lower layers of the deep learning model, making it possible to obtain a highly accurate and lightweight quantized deep learning model more effectively.
[0082] In addition, the initial value of the target layer is set to the top layer, which makes it possible to obtain a highly accurate and lightweight quantized deep learning model more effectively.
[0083] In addition, the initial value of the target layer is set to a layer other than the top layer. This makes it possible to effectively and flexibly obtain a highly accurate and lightweight quantized deep learning model.
[0084] Furthermore, the deep learning model is trained layer by layer in the following order: fix the bias model parameter and train the weights. Then, fix the weights and train the biases. This can further improve the estimation accuracy of the quantized deep learning model.
[0085] Furthermore, the range of bias is calculated based on the range of weight in the same layer as the bias and the range of output in the layer one layer above the bias. This makes it easier to obtain a highly accurate and lightweight quantized deep learning model without changing the existing hardware configuration.
[0086] Furthermore, in the case of a deep learning model in which the layer below the convolutional layer is a Relu layer, the range of the convolutional layer is made the same as the range of the Relu layer. This makes it easier to obtain a highly accurate and lightweight quantized deep learning model in certain cases.
[0087] The above-described configurations of the deep learning model value range determination program, value range determination system 10, and value range determination method are the main configurations described in order to explain the features of the above-described embodiments, and are not limited to the above-described configurations and can be modified in various ways within the scope of the claims. In addition, configurations of general position estimation systems and value range determination devices are not excluded.
[0088] For example, the functions of the range determining device 100 may be provided in an imaging device 200 that includes a built-in computer.
[0089] Furthermore, the range determination device 100 and the photographing device 200 may each be configured by a plurality of devices, or any two or more devices may be configured as a single device.
[0090] In addition, in the above-described flowchart, some steps may be omitted and other steps may be added. Furthermore, some of the steps may be executed simultaneously, and one step may be divided into multiple steps and executed.
[0091] In addition, in the embodiment, the conversion of model parameters expressed in 32-bit floating point to 8-bit fixed point has been described as an example of quantization, but quantization also includes the conversion of model parameters expressed in 32-bit floating point to floating point of less than 32 bits.
[0092] The means and methods for performing various processes in the above-mentioned range determination system 10 and range determination device 100 can be realized by either a dedicated hardware circuit or a programmed computer. The above-mentioned programs may be provided by a computer-readable recording medium such as a USB memory or a DVD (Digital Versatile Disc)-ROM, or may be provided online via a network such as the Internet. In this case, the programs recorded on the computer-readable recording medium are usually transferred to and stored in a storage unit such as a hard disk. The above-mentioned programs may be provided as independent application software, or may be incorporated as a function into the software of the device such as the imaging device.
[0093] This application is based on a Japanese patent application (Patent Application No. 2020-133972) filed on August 6, 2020, the disclosure of which is hereby incorporated by reference in its entirety. [Explanation of symbols]
[0094] 10 Range determination system, 100 range determination device, 110 control section, 111 Acquisition Department; 112 Estimation Department, 113 Value range provisional setting section, 114 Loss calculation section, 115 Range determination unit, 116 learning loss calculation unit, 120 storage section, 130 Communications Department, 140 input section, 150 Communications Department, 200 imaging equipment, 250 input images, 251 articulation points, 500 subjects.
Claims
1. A program for determining a range of values for quantizing parameters of a deep learning model, A step (a) of acquiring input data and correct answer data corresponding to the input data; (b) sequentially changing the value range in the quantization of the parameter, quantizing the parameter, calculating a loss of the estimation result by the deep learning model based on the input data with respect to the ground truth data, and determining the value range when the loss is minimized; A deep learning model value range determination program for causing a computer to execute a process having the above-mentioned steps.
2. 2. The deep learning model range determination program of claim 1, wherein the step (b) sequentially changes the value range in quantization of the parameters, quantizes the parameters, learns the deep learning model using training teacher data, calculates the loss of the estimation result based on the input data by the learned deep learning model relative to the ground truth data, and determines the value range when the loss is minimized.
3. The step (b) comprises: A step (b1) of provisionally setting the range in quantization of the parameters of a predetermined target layer of the deep learning model; A step (b2) of quantizing the parameters of the target layer in the range provisionally set in the step (b1) and learning the target layer or a specified layer using the training teacher data; A step (b3) of calculating the loss of the estimation result based on the input data by the deep learning model trained in the step (b2) with respect to the ground truth data; a step (b4) of sequentially changing the provisionally set value range, executing the step (b2) and the step (b3), and determining, among the provisionally set value ranges, the value range when the loss calculated in the step (b3) is minimized; The deep learning model range determination program according to claim 2, comprising:
4. The step (b) comprises: a step (b5) of determining a value range of the parameter of the new target layer by performing the steps (b1) to (b4) on the layer one layer below the target layer as a new target layer; A step (b6) of executing the step (b5) until the new target layer becomes the bottom layer; The deep learning model range determination program according to claim 3, further comprising:
5. The deep learning model range determination program according to claim 4 , wherein the initial value of the target layer in (b1) is the top layer.
6. The deep learning model range determination program of claim 4 , wherein the initial value of the target layer in (b1) is a layer other than the top layer.
7. The parameters of each layer of the deep learning model include weight and bias; The step (b2) A procedure (b21) of fixing the bias and learning the weight; A procedure (b22) of fixing the weight and learning the bias; The deep learning model range determination program according to any one of claims 3 to 6, comprising:
8. The parameters of each layer of the deep learning model include weight, bias, and output; The step (b4) calculates the value range of the bias based on the value range of the weight in the same layer as the bias layer and the value range of the output in the layer one layer above the bias layer. The deep learning model value range determination program according to any one of claims 3 to 7.
9. In the case of the deep learning model in which a lower layer of a convolutional layer is a relu layer, the step (b4) makes the range of the convolutional layer the same as the range of the relu layer. A deep learning model range determination program according to any one of claims 3 to 8.
10. A system for determining a range of values for quantizing parameters of a deep learning model, comprising: An acquisition unit that acquires input data and correct answer data corresponding to the input data; a calculation unit that sequentially changes the value range in the quantization of the parameter to quantize the parameter, calculates a loss of the estimation result by the deep learning model based on the input data with respect to the ground truth data, and determines the value range when the loss is minimized; A range determination system for a deep learning model having the above.
11. A method for determining a range for quantizing a parameter of a deep learning model by a range determination system, comprising: (a) acquiring input data and answer data corresponding to the input data; (b) sequentially changing the range in the quantization of the parameters to quantize the parameters, and calculating a loss of the estimation result by the deep learning model based on the input data with respect to the ground truth data, and determining the range when the loss is minimized; A method for determining a range of a deep learning model having the above-mentioned
Citation Information
Patent Citations
Compression method and apparatus for deep neural network model, terminal and storage medium
CN108734266A
Learning device and learning method
JP2019040414A
Method and device for neural network quantization
JP2020113273A
