Machine learning device, inference device, machine learning method, and machine learning program
By determining initialization rates for neural network weights based on layer depth and task similarity, the machine learning technique optimizes the number of tasks that can be learned and maintains high accuracy, addressing limitations in existing incremental learning methods.
Patent Information
- Application Number
- JP2021032801
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-03-02
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-03-02
AI Technical Summary
Existing incremental learning methods, such as PackNet, face limitations in the number of additional tasks that can be learned and the accuracy of the added tasks, leading to suboptimal performance.
A machine learning technique that determines initialization rates for neural network weights based on layer depth and task similarity to optimize the number of tasks that can be learned and maintain accuracy, using a machine learning device with components like an initialization rate determination unit and a machine learning execution unit to generate neural network models for new tasks.
Enhances the number of tasks that can be learned and maintains high accuracy for the target task by optimizing weight initialization rates based on layer depth and task similarity, reducing unnecessary weight usage and improving inference accuracy.
Smart Images

Figure 0007600768000001 
Figure 0007600768000002 
Figure 0007600768000003
Abstract
Description
[Technical field]
[0001] The present invention relates to machine learning techniques. [Background technology]
[0002] Humans can learn new knowledge through long-term experience and can retain old knowledge without forgetting it. On the other hand, the knowledge of a Convolutional Neural Network (CNN) depends on the dataset used for training, and in order to adapt to changes in the data distribution, the parameters of the CNN must be retrained for the entire dataset. As CNN learns new tasks, its estimation accuracy for old tasks decreases. Thus, when CNN performs continuous training, it is inevitable that it will suffer from catastrophic forgetting, in which the learning results of old tasks are forgotten while learning a new task.
[0003] Incremental learning or continual learning has been proposed as a method to avoid fatal forgetting. Incremental learning is a learning method in which, when a new task or new data occurs, the model is not trained from scratch, but rather the currently trained model is improved and trained. PackNet is one of the continuous learning methods (Non-Patent Document 1). In the continuous learning with PackNet, the weights used are changed in the order of tasks to be added. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] Mallya, Arun, and Svetlana Lazebnik. “Packnet: Adding multiple tasks to a single network by iterative pruning.” Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018. Summary of the Invention [Problem to be solved by the invention]
[0005] PackNet had the problem that the number of additional tasks that could be learned and the accuracy of the additional tasks did not improve relative to the target task.
[0006] The present invention has been made in consideration of these circumstances, and its purpose is to provide a machine learning technique that can optimize the number of tasks that can be additionally learned and the accuracy of the added tasks for the target task. [Means for solving the problem]
[0007] In order to solve the above problem, a machine learning device of one embodiment of the present invention includes an initialization rate determination unit that determines a first initialization rate for initializing weights of a neural network model of a first task in accordance with the depth of a layer of the neural network model, a machine learning execution unit that performs machine learning on the first task to generate a trained neural network model of the first task, and an initialization unit that initializes the weights of the trained neural network model of the first task based on the first initialization rate to generate an initialized, trained neural network model of the first task for use in a second task.
[0008] Another embodiment of the present invention is an inference device including a task input unit that selects one task from a plurality of tasks, an inference model generation unit that generates a new neural network model by setting weights of a neural network model that has learned the plurality of tasks to 0 except for weights used in the selected task, and an inference unit that infers the selected task based on the new neural network model.
[0009] Yet another embodiment of the present invention is a machine learning method, which includes an initialization rate determination step of determining a first initialization rate for initializing weights of a neural network model of a first task according to a layer depth of the neural network model, a machine learning execution step of generating a trained neural network model of the first task by machine learning the first task, and an initialization step of initializing weights of the trained neural network model of the first task based on the first initialization rate to generate an initialized trained neural network model of the first task for use in a second task.
[0010] Any combination of the above components, and any transformation of the present invention into a method, device, system, recording medium, computer program, etc., are also effective as aspects of the present invention. Effect of the Invention
[0011] According to the present invention, it is possible to provide a machine learning technique that can optimize the number of tasks that can be additionally learned and the accuracy of the added tasks for a target task. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a configuration diagram of a machine learning device and an inference device according to an embodiment. [Diagram 2] FIG. 2 is a detailed configuration diagram of a continuous learning unit of the machine learning device of FIG. 1. [Diagram 3] 3 is a flowchart illustrating the operation of the continuous learning unit in FIG. 2 for task 1. [Figure 4] FIG. 3 is a diagram showing the structure of a neural network model used in the machine learning execution unit of FIG. 2. [Diagram 5] 5(a) and 5(b) are diagrams for explaining the predetermined value of the initialization rate of the neural network model for task 1. FIG. [Figure 6] 1 is a diagram for explaining the number of input / output channels in each layer of a neural network model, the number of weights between the input / output channels, the total number of weights in each layer, and the number of parameters. [Figure 7] 3 is a flowchart illustrating the operation of the continuous learning unit in FIG. 2 for task 2. [Figure 8] FIG. 13 is a diagram for explaining a predetermined value of the initialization rate of the neural network model for task 3. [Figure 9] 4 is a flowchart illustrating the operation of the inference device of FIG. 1 for task N. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] 1 is a configuration diagram of a machine learning device 100 and an inference device 200 according to an embodiment. The machine learning device 100 includes a task input unit 10, a continuous learning unit 20, and a storage unit 30. The inference device 200 includes a task input unit 40, a task determination unit 50, an inference model generation unit 60, an inference unit 70, and an inference result output unit 80.
[0014] In continuous learning, it is necessary to learn a new task without causing fatal forgetting. The machine learning device 100 according to the present embodiment aims to additionally learn a new task to a trained model during continuous learning.
[0015] The machine learning device 100 is a device that generates a target model and effective parameter information from multiple tasks through continuous learning. For simplicity of explanation, the following three tasks will be described here, but the number and types of tasks are arbitrary.
[0016] Task 1 is an image recognition task using the ImageNet dataset, which is a first dataset. Task 2 is an image recognition task using the Places365 dataset, which is a second dataset. Task 3 is an image recognition task using the CUBS Birds dataset, which is a third dataset. Task N input to the inference device 200 is any one of tasks 1 to 3, which are tasks for which a target model has already been trained. Here, different datasets are assigned to each task, but this is not limited as long as each task is a different recognition task. One dataset may be divided into multiple tasks. For example, 10 different classes in the ImageNet dataset may be assigned to task 1, task 2, and task 3, respectively. In addition, the images of each task may be images input to the task input unit 10 from an image acquisition unit such as a camera (not shown). For example, task 1 may be a dataset of existing images, and task 2 and subsequent tasks may be datasets of images input to the task input unit 10 from a camera (not shown).
[0017] The task input unit 10 sequentially supplies a plurality of tasks (here, task 1, task 2, and task 3) to the continuous learning unit 20.
[0018] The continuous learning unit 20 continuously learns the neural network model by sequentially using a plurality of tasks (here, task 1, task 2, and task 3) to generate a target model and effective parameter information.
[0019] The target model is a trained neural network model generated by the continuous learning unit 20. The target model eventually becomes a trained neural network for multiple tasks (task 1, task 2, and task 3 in this case) through continuous learning. The effective parameter information is information that specifies parameters such as weights of the trained neural network model that are to be enabled for each task for the trained neural network model generated by the continuous learning unit 20. Details of the effective parameter information will be described later.
[0020] The storage unit 30 stores the target model and the effective parameter information.
[0021] The inference device 200 is a device that generates inference results for a plurality of tasks, using the target model and effective parameter information generated by the machine learning device 100.
[0022] The task input unit 40 supplies task N to the inference unit 70. The task determination unit 50 determines which of the learned tasks (here, task 1, task 2, or task 3) the task N supplied to the inference unit 70 is, and supplies the determination result to the inference model generation unit 60. In this embodiment, the user specifies which of task 1 to task 3 it is, but the determination may be made automatically by some method.
[0023] The inference model generation unit 60 stores the target model and effective parameter information acquired from the memory unit 30 of the machine learning device 100, generates an inference model based on the target model and the effective parameter information, and supplies it to the inference unit 70.
[0024] The inference unit 70 infers the task N based on the inference model generated by the inference model generation unit 60, and supplies the inference result to the inference result output unit 80. The inference result output unit 90 outputs the inference result.
[0025] 2 is a detailed configuration diagram of the continuous learning unit 20 of the machine learning device 100. The continuous learning unit 20 includes a task similarity derivation unit 21, an initialization rate determination unit 22, a machine learning execution unit 24, an initialization unit 26, and a fine tuning unit .
[0026] 3 is a flowchart for explaining the operation of the continuous learning unit 20 for task 1. The configuration and operation of the continuous learning unit 20 for task 1 will be described with reference to FIGS.
[0027] The task similarity derivation unit 21 does not calculate the task similarity for task 1 because it is the first task.
[0028] The initialization rate determination unit 22 determines the initialization rate of the neural network model to a predetermined value according to the depth of the layer of the neural network (S10). In task 1, all weights of the neural network model are to be initialized. The predetermined value will be described later.
[0029] The machine learning execution unit 24 performs machine learning to generate a neural network model for task 1 and generates a trained neural network model (S20).
[0030] FIG. 4 is a diagram showing the structure of a neural network model used in the machine learning execution unit 24.
[0031] In this embodiment, the neural network model is VGG16, which is a deep neural network. VGG16 is composed of 13 convolutional layers (CONV), 3 fully connected layers (Dense), and 5 pooling layers. The layers to be learned are the convolutional layers and the fully connected layers. The pooling layer is a layer that subsamples the feature map that is the output of the convolutional layer. A layer closer to the input is called a shallow layer, and a layer closer to the output is called a deep layer. The neural network model is not limited to VGG16, and the number of layers is not limited to this embodiment.
[0032] 5(a) and 5(b) are diagrams for explaining the predetermined value of the initialization rate of the neural network model for task 1. FIG.
[0033] The initialization rate is set to a predetermined value for each layer of the neural network. In Fig. 5(a), the initialization rate is set to 0% for CONV1-1, CONV1-2, CONV2-1, CONV2-2, CONV3-1, CONV3-2, and CONV3-3, and the initialization rate is set to 50% for CONV4-1, CONV4-2, CONV4-3, CONV5-1, CONV5-2, CONV5-3, Dense6, Dense7, and Dense8.
[0034] In FIG. 5(b), the initialization rate is set to 10% for CONV1-1 and CONV1-2, 20% for CONV2-1 and CONV2-2, 30% for CONV3-1, CONV3-2, and CONV3-3, 40% for CONV4-1, CONV4-2, and CONV4-3, and 50% for CONV5-1, CONV5-2, CONV5-3, Dense6, Dense7, and Dense8.
[0035] It is preferable to set the initialization rate of a deeper layer of a neural network model higher than that of a shallower layer. The higher the initialization rate, the more weights will be available for task 2 and onward. In the following, the predetermined value of the initialization rate of the neural network model for task 1 will be described as the example in FIG. 5(a).
[0036] 2 and 3 again. Initialization unit 26 initializes the weights of the trained neural network model based on the initialization rate of each layer (S30). Here, initialization means setting the weights of the neural network to 0 (zero). For each layer of the trained neural network model, weights of each layer are initialized to 0 in proportion to the initialization rate, starting from the weight closest to 0.
[0037] The weights that are not initialized are used for task 1, and the weights that are initialized are used for task 2 and onward.
[0038] The effective parameter information of task 1 is information that identifies the weights used in task 1, i.e., the weights that have not been initialized after learning of task 1. The initialization unit 26 stores the effective parameter information of task 1 in the storage unit 30.
[0039] The effective parameter information is binary information in which one bit is assigned to each of all weights in the neural network model. The initialization unit 26 may assign a code "0" to all weights in the neural network model if the weight is 0, or a code "1" to all weights other than 0, and store the code in the storage unit 30 as a code string.
[0040] FIG. 6 is a diagram for explaining the number of input / output channels in each layer of a neural network model, the number of weights between the input / output channels, the total number of weights in each layer, and the number of parameters.
[0041] If the initialization rate is 50%, for example, in CONV4-1, 50% of the 1,179,648 weights, or 589,824 weights, are initialized.
[0042] 2 and 3 again, fine tuning unit 28 fine-tunes the trained neural network model for task 1 while leaving the initialized weights unchanged to generate a target model (S40). The weights to be fine-tuned are the uninitialized weights used in task 1.
[0043] Next, the operation of the continuous learning unit 20 for task 2 will be described.
[0044] 7 is a flowchart illustrating the operation of the continuous learning unit 20 for task 2. The configuration and operation of the continuous learning unit 20 for task 2 will be described with reference to FIGS.
[0045] The task similarity derivation unit 21 derives the distance between the probability density functions of the data distribution of task 1, which is a learned task, and task 2, which is a target task, as the task similarity (S50). Here, Jensen-Shannon divergence (JS divergence) is used as the distance between the two probability density functions. JS divergence takes values from 0 to 1. The smaller the JS divergence, the closer the distance between the two probability density functions is, and the larger the JS divergence, the greater the distance between the two probability density functions is. Therefore, the task similarity is set to be larger as the JS divergence is smaller, and the task similarity is set to be smaller as the JS divergence is larger.
[0046] Here, we used JS divergence to derive task similarity, but any measure that can evaluate the distance between two probability density functions, such as Kullback-Leibler divergence (KLD), may be used.
[0047] The initialization rate determination unit 22 determines the initialization rate of the target model to a predetermined value according to the depth of the neural network layer and the task similarity (S60). The predetermined value will be described later.
[0048] The weights to which the initialization rate is applied are those that are not assigned to any task. Weights that are assigned to any task are not subject to initialization.
[0049] FIG. 8 is a diagram for explaining the predetermined value of the initialization rate of the neural network model for task 2. In FIG.
[0050] The initialization rate is set to a predetermined value based on the depth of the neural network layer and the task similarity as follows:
[0051] The weights of CONV1-1 to CONV3-3 that are not initialized in Task 1, which is a learned task, are not subject to initialization, so the initialization rate is 0.
[0052] When the task similarity is large, i.e., when the JS divergence (JSD) is small, the initialization rate for the shallower hierarchy is set to be large and the initialization rate for the deeper hierarchy is set to be small.
[0053] When the task similarity is large, that is, when the JSD is small, the initialization rate is set to a larger value than when the task similarity is small, that is, when the JSD is large.
[0054] When the task similarity is large, i.e., the JSD is small, the weights of CONV4-X (X=1, 2, 3) are not updated.
[0055] More specifically, as an example, as shown in FIG. 8, when JSD<0.1, the initialization rate is set to 100% for CONV4-1, CONV4-2, and CONV4-3, the initialization rate is set to 95% for CONV5-1, CONV5-2, and CONV5-3, and the initialization rate is set to 80% for Dense6, Dense7, and Dense8.
[0056] If 0.1≦JSD<0.5, the initialization rate is set to 90% for CONV4-1, CONV4-2, CONV4-3, CONV5-1, CONV5-2, and CONV5-3, and the initialization rate is set to 75% for Dense6, Dense7, and Dense8.
[0057] If 0.5≦JSD<0.9, the initialization rate is set to 75% for CONV4-1, CONV4-2, CONV4-3, CONV5-1, CONV5-2, CONV5-3, Dense6, Dense7, and Dense8.
[0058] If JSD is 0.9 or less, the initialization rate is set to 50% for CONV4-1, CONV4-2, CONV4-3, CONV5-1, CONV5-2, CONV5-3, Dense6, Dense7, and Dense8.
[0059] As a result, for tasks with high similarity, the higher-level features are similar to the learned tasks, so the layers that learn the higher-level features can have a larger initialization rate and retain the initialized weights for tasks that are added later.
[0060] When the similarity between Task 1 and Task 2 is high, the probability that the weights assigned to Task 1 can be shared for inference of Task 2 increases, so the number of weights newly initialized for assignment to Task 2 can be reduced. Conversely, when the similarity between Task 1 and Task 2 is low, the probability that the weights assigned to Task 1 can be shared for inference of Task 2 decreases, so the number of weights newly initialized for assignment to Task 2 needs to be increased.
[0061] 2 and 7 will be referred to again. The machine learning execution unit 24 performs transfer learning of the target model using task 2, which is the target task, without changing the weights of the learned task, to generate a trained neural network model (S70). Here, the weights of the learned task are the weights used in task 1. The weights assigned to the learned task do not change before and after transfer learning. Note that here, learning the target model without changing the weights of the learned task is referred to as transfer learning, as it transfers the weights of the learned task to another task, but it may also be simply referred to as learning.
[0062] The initialization unit 26 initializes the weights of the trained neural network model based on the initialization rate to generate a first candidate for the target model (S80).
[0063] Weights that are not initialized, including weights of trained tasks, are assigned as weights to be used in Task 2.
[0064] The effective parameter information of task 2 is the weights used in task 2, and is information that identifies the uninitialized weights. The initialization unit 26 stores the effective parameter information of task 2 in the storage unit 30.
[0065] Fine tuning unit 28 fine-tunes the first candidate target model for task 2 while leaving the learned task weights and the initialized weights unchanged, to generate a second candidate target model (S90).
[0066] The fine tuning unit 28 determines the more accurate candidate of the first target model candidate and the second target model candidate as the final target model (S100). Basically, it is sufficient to select the second target model candidate as the final target model, but in order to improve the generalization performance of the target model, it is more preferable to evaluate the inference accuracy of the first and second target model candidates at the end of learning using evaluation data different from the training data used to learn the weights of the target model, and determine the more accurate candidate as the final target model.
[0067] In this way, by setting the initialization rate of the trained neural network model based on the depth of the neural network model layers and the similarity between tasks and training a new task, continuous training is possible in which a new task is trained according to the characteristics of the task. This reduces the wasteful use of weights and increases the number of tasks that can be trained additionally. In addition, the initialization of useful weights is reduced, and the inference accuracy of the added task can be maintained at a high level.
[0068] Task 3 is processed in the same way as task 2, except for the method of deriving task similarity.
[0069] The task similarity derivation unit 21 derives a task similarity 31 between task 3 and task 1, and a task similarity 32 between task 3 and task 2. Of task similarity 31 and task similarity 32, the task with the greater task similarity is determined to be the learned task.
[0070] In general, the task similarity derivation unit 21 selects, as the learned task, one learned task having the highest similarity to the target task from among a plurality of learned tasks.
[0071] However, when the number of tasks increases, it is not efficient to derive task similarity for all tasks. Therefore, the targets for deriving task similarity can be selected as follows. (1) New tasks are given priority in selection as derivation targets. For example, a predetermined number of tasks are left as derivation targets in the order of newly input tasks. (2) Tasks with small initialization rates (tasks that are not similar) are preferentially selected as derivation targets. For example, a predetermined number of tasks are left as derivation targets in the order of the tasks with the smallest initialization rates. (3) Tasks with an initialization rate smaller than a predetermined value (dissimilar tasks) are selected as derivation targets. For example, a predetermined number of tasks with an initialization rate smaller than a predetermined value are left as derivation targets. (4) A combination of (1) and (2) above (5) A combination of (1) and (3) above
[0072] In this way, by selecting a task among multiple learned tasks that has the highest or a relatively highest similarity to the target task as the learned task, it is possible to reduce the weight required for the target task.
[0073] Next, a description will be given of the operation of inference device 200. Fig. 9 is a flowchart illustrating the operation of inference device 200 for task N.
[0074] The task determination unit 50 determines whether the task N input to the inference unit 70 is any one of tasks 1 to 3 (S200). In this embodiment, the user specifies which task it is.
[0075] The inference model generating unit 60 generates an inference neural network model (hereinafter referred to as an "inference model") based on the trained target model and the effective parameter information (S210). The target model is a neural network model trained for tasks 1 to 3. When task N is determined to be task i (i is any one of 1 to 3), the inference model generating unit 60 generates an inference model in which weights other than the weights used in task i in the target model are set to 0 based on the effective parameter information of task i. Specifically, the inference model generating unit 60 may read the code string of the effective parameter information, and if the code is "1", leave the weight corresponding to the code unchanged, while if the code is "0", change the weight corresponding to the code to 0.
[0076] The inference unit 70 generates an inference result for the input task N using the inference model generated for the task i (S220).
[0077] In this embodiment, the initialization unit 26 initializes the weights of the trained neural network model on a weight-by-weight basis based on the initialization rate, but the initialization unit 26 may also initialize the weights of the trained neural network model on a filter-by-filter basis based on the initialization rate.
[0078] The various processes of the machine learning device 100 and the inference device 200 described above can be realized not only as devices using hardware such as a CPU and a memory, but also as firmware stored in a ROM (read-only memory) or a flash memory, or as software for a computer, etc. The firmware program or software program can be provided by recording it on a recording medium readable by a computer, etc., or can be transmitted and received with a server via a wired or wireless network, or can be transmitted and received as data broadcasting of terrestrial or satellite digital broadcasting.
[0079] As described above, according to the machine learning device 100 of this embodiment, by changing the utilization rate of the weight of the target model that continues to learn depending on the similarity or correlation between the learned task and the target task, it is possible to optimize the number of tasks that can be additionally learned and the accuracy of the added tasks with respect to the target task.
[0080] The present invention has been described above based on the embodiments. The embodiments are merely examples, and it will be understood by those skilled in the art that various modifications are possible in the combination of each component and each treatment process, and that such modifications are also within the scope of the present invention. [Explanation of symbols]
[0081] 10 task input unit, 20 continuous learning unit, 21 task similarity derivation unit, 22 initialization rate determination unit, 24 machine learning execution unit, 26 initialization unit, 28 fine tuning unit, 30 memory unit, 40 task input unit, 50 task determination unit, 60 inference model generation unit, 70 inference unit, 80 inference result output unit, 100 machine learning device, 200 inference device.
Claims
1. an initialization rate determination unit that determines a first initialization rate for initializing weights of the neural network model of the first task in accordance with a depth of a layer of the neural network model; a machine learning execution unit that performs machine learning on the first task to generate a trained neural network model of the first task; and an initialization unit that initializes weights of the trained neural network model for the first task based on the first initialization rate to generate an initialized, trained neural network model for the first task to be used in a second task.
2. 2. The machine learning device according to claim 1, wherein the initialization rate determination unit sets the first initialization rate of a convolutional layer closer to an input layer of a neural network model to be smaller than the first initialization rate of a convolutional layer closer to an output layer.
3. a task similarity derivation unit for deriving a task similarity between the first task and the second task; the initialization rate determination unit determines a second initialization rate for initializing weights of the neural network model of the second task according to a layer depth of the neural network model and the task similarity; the machine learning execution unit performs transfer learning on the initially trained neural network model of the first task for the second task to generate a trained neural network model of the second task; 3. The machine learning device according to claim 1, wherein the initialization unit initializes weights of the trained neural network model for the second task based on the second initialization rate to generate an initialized, trained neural network model for the second task to be used in a third task.
4. The machine learning device according to claim 3 , wherein the initialization rate determination unit increases the second initialization rate as the task similarity increases.
5. an initialization rate determination step of determining a first initialization rate for initializing weights of the neural network model of the first task according to a depth of a layer of the neural network model; a machine learning execution step of performing machine learning on the first task to generate a trained neural network model of the first task; and an initialization step of initializing weights of the trained neural network model for the first task based on the first initialization rate to generate an initialized trained neural network model for the first task for use in a second task.
6. an initialization rate determination step of determining a first initialization rate for initializing weights of the neural network model of the first task according to a depth of a layer of the neural network model; a machine learning execution step of performing machine learning on the first task to generate a trained neural network model of the first task; and an initialization step of initializing weights of the trained neural network model for the first task based on the first initialization rate to generate an initialized, trained neural network model for the first task for use in a second task.
Citation Information
Patent Citations
Information processing device and information processing method
JP2017211799A
Information processing apparatus, information processing method, and program
JP2019192009A
