Machine learning device, inference device, machine learning method, and machine learning program
The machine learning device and method optimize the number of tasks and accuracy by using initialization rates based on layer depth and task similarity to maintain high estimation accuracy during continuous learning, addressing the challenge of catastrophic forgetting in CNNs.
Patent Information
- Application Number
- JP2024163849
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-03-02
AI Technical Summary
Existing machine learning techniques, such as convolutional neural networks (CNNs), face challenges in continuous learning, leading to catastrophic forgetting, where new tasks cause a decrease in estimation accuracy and limit the number of additional tasks that can be learned effectively.
A machine learning device and method that utilizes a neural network with an initialization rate determination unit to set specific initialization rates based on layer depth and task similarity, allowing for the generation of trained neural network models that can learn new tasks without forgetting previous ones, by initializing weights of the neural network model for the first task and subsequently adjusting weights for subsequent tasks.
This approach optimizes the number of tasks that can be learned and maintains high accuracy for added tasks by reducing unnecessary weight updates and leveraging shared weights across similar tasks, enabling efficient continuous learning.
Smart Images

Figure 2024173962000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to machine learning techniques. [Background technology]
[0002] Humans can learn new knowledge and forget old knowledge through long-term experience. On the other hand, convolutional neural networks (Convolutional Neural Networks) The knowledge of a neural network (CNN) depends on the dataset used for training. To adapt to the change in distribution, the CNN parameters must be retrained for the entire dataset. As CNNs learn new tasks, they also lose their ability to perform old tasks. In this way, the estimation accuracy of a new task decreases as the CNN performs continuous learning. Catastrophic forgetting, in which learning results from previous tasks are forgotten during learning, is avoided. It can't be fixed.
[0003] As a method to avoid fatal forgetting, incremental learning (also called continual learning) is used. Continuous learning is the process of learning the model by which the model adapts to new tasks and new data. Instead of training a model from scratch, we train it by improving the current trained model. Learning method. One of the continuous learning methods is PackNet (Non-Patent Document 1). In the continuous training of PackNet, the weights used in the order of added tasks are changed. is doing. [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] In PackNet, the number of additional tasks that can be trained and the accuracy of the additional tasks are the same as the target task. There was an issue that the improvement was not being achieved.
[0006] The present invention has been made in view of the above circumstances, and its object is to provide a task that can be additionally learned. Machine learning techniques that can optimize the number of tasks and the accuracy of added tasks for the target task The aim is to provide the techniques. [Means for solving the problem]
[0007] In order to solve the above problems, a machine learning device according to an embodiment of the present invention is a neural network The weights of the neural network model for the first task are initialized according to the depth of the layers of the neural network model. an initialization rate determination unit that determines a first initialization rate for the first task by machine learning; a machine learning execution unit that generates a trained neural network model of the first task; The weights of the trained neural network model of the sq are initialized based on the first initialization rate. and generating an initialized trained neural network for the first task for use in the second task. and an initialization unit for generating a work model.
[0008] Another aspect of the present invention is an inference device. The device is configured to select one task from a plurality of tasks. A task input unit for selecting a task and a neural network model that has already learned the plurality of tasks. A new neural network is created by setting the weights of the model to 0 except for the weights used in the selected task. an inference model generation unit for generating a neural network model; and an inference unit that performs inference based on the new neural network model.
[0009] Yet another aspect of the present invention is a machine learning method, comprising: Initialize the weights of the neural network model for the first task according to the depth of the model layers. and a step of determining a first initialization rate for the first task by machine learning. A machine learning execution step that generates a trained neural network model for one task; The weights of the trained neural network model for the first task are adjusted based on the first initialization rate. The neural network is initialized based on the first task and used in the second task. and an initialization step for generating a network model.
[0010] Any combination of the above components and the expression of the present invention may be used as a method, an apparatus, a system, a recording medium, Conversions between the body, computer program, etc. are also valid aspects of the present invention. be. Effect of the Invention
[0011] According to the present invention, the number of tasks that can be additionally learned and the accuracy of the additional tasks are compared with the target task. It is possible to provide machine learning technology that can optimize the [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] FIG. 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, and an inference , and an inference result output unit 80.
[0014] Continuous learning requires learning new tasks without catastrophic forgetting. The machine learning device 100 in this state can add new tasks to the trained model during continuous learning. The purpose is to have people learn.
[0015] The machine learning device 100 acquires a target model and effective parameters by continuous learning from multiple tasks. This is a device that generates meter information. For simplicity, the following tasks are assumed here: Although the following explanation assumes there are three, the number and types of tasks are optional.
[0016] Task 1 is image recognition using the first dataset, the ImageNet dataset. Task 2 is a recognition task for the second dataset, the Places365 dataset. Task 3 is an image recognition task using the third dataset, CUBS B This is an image recognition task using the irds dataset. Task N is one of tasks 1 to 3 for which the target model has been trained. Here, we assigned different datasets to each task. This is not limited to the above, as long as the tasks are different. For example, we can split the 10 different classes in the ImageNet dataset into You can assign them to Task 1, Task 2, and Task 3. The images for each task are shown in Figure 1. It may be an image input to the task input unit 10 from an image acquisition unit such as a camera (not shown). For example, Task 1 is a data set of existing images, and Task 2 and onwards are images taken from a camera (not shown) The image data set may be input to the task input unit 10 from the image processing unit 10.
[0017] The task input unit 10 continues a number of tasks (here, task 1, task 2, and task 3). The data are sequentially supplied to the learning unit 20.
[0018] The continuous learning unit 20 sequentially learns a plurality of tasks (here, task 1, task 2, and task 3). The neural network model is continuously trained to obtain the target model and effective parameter information. Generates information.
[0019] The target model is a trained neural network model generated by the continuous training unit 20. The target model is then trained to eventually be able to perform multiple tasks (here, The trained neural network is the one for task 1, task 2, and task 3. The data information is used for the trained neural network model generated by the continuous training unit 20. ,The weights and other parameters of the trained neural network model to be enabled for each task are The valid parameter information is information for specifying the valid parameter.
[0020] The storage unit 30 stores the target model and the effective parameter information.
[0021] The inference device 200 uses the target model and effective parameters generated by the machine learning device 100. The present invention is an apparatus for generating inference results for multiple tasks using data information.
[0022] The task input unit 40 supplies the task N to the inference unit 70. The task determination unit 50 The task N provided to 70 is one of the learned tasks (in this case, task 1, task The inference model generation unit 60 determines which task is the current task (task 2 or task 3) and supplies the determination result to the inference model generation unit 60. In this embodiment, the user is assumed to specify which of task 1 to 3 the task is. However, the determination may be made automatically in some way.
[0023] The inference model generation unit 60 generates the target model obtained from the memory unit 30 of the machine learning device 100. The model and effective parameter information are stored, and the target model and effective parameter information are used to An inference model is generated and supplied to the inference unit 70.
[0024] The inference unit 70 generates a task based on the inference model generated by the inference model generation unit 60. N and supplies the inference result to the inference result output unit 80. The results are output.
[0025] FIG. 2 is a detailed configuration diagram of the continuous learning unit 20 of the machine learning device 100. The machine learning execution unit 24 includes a task similarity derivation unit 21, an initialization rate determination unit 22, an initialization unit 26, and a , and a fine tuning unit 28.
[0026] FIG. 3 is a flowchart explaining the operation of the continuous learning unit 20 for task 1. 2 and 3, the configuration and operation of the continuous learning unit 20 for task 1 will be described.
[0027] The task similarity derivation unit 21 calculates the task similarity for task 1 because it is the first task. is not calculated.
[0028] The initialization rate determination unit 22 determines the degree of the neural network according to the depth of the layer of the neural network. The initialization rate of the work model is determined to a predetermined value (S10). In task 1, the neural network All weights of the workpiece model are to be initialized. The predetermined values will be described later.
[0029] The machine learning execution unit 24 performs machine learning to create a neural network model for task 1. A trained neural network model is generated (S20).
[0030] FIG. 4 shows the structure of a neural network model used in the machine learning execution unit 24. FIG.
[0031] In this embodiment, the neural network model is a deep neural network. VGG16 has 13 convolutional layers (CONV) and 1 fully connected layer (D The training layer is a convolution layer and This is a fully connected layer. The pooling layer subsamples the feature maps that are the output of the convolutional layer. The layers closest to the input are called shallow layers, and the layers closest to the output are called deep layers. The model is not limited to VGG16, and the number of layers is not limited to that in this embodiment.
[0032] Figure 5(a) and Figure 5(b) show the initial results of the neural network model for Task 1. FIG. 13 is a diagram illustrating a predetermined value of the initialization rate.
[0033] The initialization rate for each layer of the neural network is set to a predetermined value. In Fig. 5(a), C ONV1-1, CONV1-2, CONV2-1, CONV2-2, CONV3-1, C The initialization rate for ONV3-2 and CONV3-3 is set to 0%, and the initialization rate for CONV4-1 and CONV4-2 is set to 0%. CONV4-2, CONV4-3, CONV5-1, CONV5-2, CONV5-3, For Dense6, Dense7, and Dense8, the initialization rate is set to 50%.
[0034] In Fig. 5(b), the initialization rate for CONV1-1 and CONV1-2 is set to 10%. The initialization rate for CONV2-1 and CONV2-2 is set to 20%, and the For V3-1, CONV3-2, and CONV3-3, the initialization rate is set to 30%, and C For ONV4-1, CONV4-2, and CONV4-3, the initialization rate is set to 40%. , CONV5-1, CONV5-2, CONV5-3, Dense6, Dense7, D For ense8 the initialization rate is set to 50%.
[0035] For the hierarchy of a neural network model, the initialization rate of deeper layers is larger than that of shallower layers. It is preferable to set it so that the initialization rate is as small as possible. The larger the initialization rate, the more available memory for task 2 and later. The weights are increased. Below, we consider the initialization rate of the neural network model for task 1. The predetermined value will be described as an example shown in FIG.
[0036] 2 and 3 again. The initialization unit 26 initializes the trained neural network model. The weights of the model are initialized based on the initialization rate of each layer (S30). The weights of the neural network are set to 0 (zero). For each layer of the network model, the weights of each layer are assigned a weight that corresponds to the initialization rate, starting from the weight closest to 0. Initialize the weights of all the nodes to 0.
[0037] The weights that are not initialized are used in Task 1, and the weights that are initialized are used in Task 2. These weights will be used from task 2 onwards.
[0038] The effective parameter information of task 1 is the weights used in task 1, i.e., the learning The initialization unit 26 is information for identifying weights that have not been initialized after learning. The parameter information is stored in the storage unit 30.
[0039] The effective parameter information is one bit for each weight of the neural network model. The initialization unit 26 initializes the neural network model. For all weights of a rule, if the weight is 0, the code is "0", if the weight is non-zero, the code is " Alternatively, the code string "1" may be assigned to the bit string and stored in the storage unit 30 as a code string.
[0040] Figure 6 shows the number of input / output channels and the distance between input / output channels in each layer of the neural network model. 1 is a diagram illustrating the number of weights in each layer, the total number of weights in each layer, and the number of parameters.
[0041] If the initialization rate is 50%, for example, CONV4-1 will have 1,179,648 Initialize 589824 weights, which is 50% of the weights.
[0042] 2 and 3 again. The fine tuning unit 28 changes the initialized weights. Refine the trained neural network model for task 1 without modifying the Fine-tuning is performed to generate a target model (S40). The weights,α,i,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] FIG. 7 is a flowchart explaining the operation of the continuous learning unit 20 for task 2. 2 and 7, the configuration and operation of continuous learning unit 20 for task 2 will be described.
[0045] The task similarity derivation unit 21 calculates a similarity between a learned task 1 and a target task The distance of the probability density function of the data distribution of task 2 is derived as the task similarity (S50). Here, we use the Jensen-Shannon divergence as the distance between two probability density functions. JS divergence is used. JS divergence takes values between 0 and 1. The smaller the JS divergence, the closer the distance between the two probability density functions is. The larger the divergence, the greater the distance between the two probability density functions. The smaller the JS divergence, the larger the task similarity. The larger the number, the smaller the task similarity.
[0046] Here, we used JS divergence to derive task similarity. It can evaluate the distance between two probability density functions, such as the Kleibler Divergence (KLD). Any scale that can be used may be used.
[0047] The initialization rate determination unit 22 determines the task according to the depth of the neural network layer and the task similarity. The initialization rate of the target model is set to a predetermined value (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 assigned to any task are not subject to initialization.
[0049] FIG. 8 illustrates the predetermined values of the initialization rate of the neural network model for task 2. This is a diagram.
[0050] Based on the depth of the neural network layers and task similarity, we set the initialization rate as follows: Set to a predetermined value.
[0051] CONV1-1 to CONV3-3 are not initialized in the trained task, Task 1. Since there are no weights to be initialized, the initialization rate is 0.
[0052] When task similarity is large, i.e., JS divergence (JSD) is small, the hierarchy The initialization rate for shallower layers is set to be larger, and the initialization rate for deeper layers is set to be smaller.
[0053] When the task similarity is large, i.e., JSD is small, the task similarity is small, i.e., J The initialization rate is set to be larger than when the SD is large.
[0054] When task similarity is large, i.e., JSD is small, CONV4-X(X=1,2,3 ) weights are not updated.
[0055] More specifically, as an example, when JSD<0.1, CONV For CONV4-1, CONV4-2, and CONV4-3, the initialization rate is set to 100%, and C For ONV5-1, CONV5-2, and CONV5-3, the initialization rate is set to 95%. For Dense6, Dense7, and Dense8, the initialization rate is set to 80%. .
[0056] When 0.1≦JSD<0.5, CONV4-1, CONV4-2, CONV4-3, For CONV5-1, CONV5-2, and CONV5-3, the initialization rate is set to 90%. For Dense6, Dense7, and Dense8, the initialization rate was set to 75%. do.
[0057] When 0.5≦JSD<0.9, CONV4-1, CONV4-2, CONV4-3, CONV5-1, CONV5-2, CONV5-3, Dense6, Dense7, De For nse8 the initialization rate is set to 75%.
[0058] When JSD is 0.9 or less, CONV4-1, CONV4-2, CONV4-3, CONV 5-1, CONV5-2, CONV5-3, Dense6, Dense7, Dense8 For , the initialization rate is set to 50%.
[0059] From the above, in the case of a task with high similarity, the higher-ranked features are similar to the trained task. Therefore, the initialization rate is increased for the layers that learn higher-level features, and the tasks added after that are We can leave the weights initialized for the
[0060] If task 1 and task 2 are highly similar, the weight assigned to task 1 is increased by the weight assigned to task 2. Since it is more likely that the new task can be shared for inference, Conversely, if the similarity between task 1 and task 2 is low, the number of weights to be initialized can be reduced. If the weights assigned to task 1 are not shared among task 2, then the weights assigned to task 1 can be shared for the inference of task 2. Since the probability is lower, we need to increase the number of newly initialized weights to assign to task 2. There is a need.
[0061] Referring again to FIG. 2 and FIG. 7, the machine learning execution unit 24 executes a task 2, we transfer learn the target model without changing the weights of the trained task. A trained neural network model is generated (S70). The weights of the tasks are those used in task 1. The weights assigned to the task do not change. Note that we do not change the weights of the tasks that have already been trained. Learning a target model by applying weights from a previously trained task is called transferring weights from one task to another. Although this has been referred to as transfer learning, it may also be referred to simply as learning.
[0062] The initialization unit 26 initializes the weights of the trained neural network model based on the initialization rate. Initialize and 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. can be assigned.
[0064] The effective parameter information of task 2 is the weights used in task 2, which are not initialized. The initialization unit 26 stores the effective parameter information of the task 2 in the storage unit 24. Remember it at 30.
[0065] The fine tuning unit 28 does not change the weights of the learned tasks and the initialized weights. In this way, we fine-tune the first candidate target model for task 2. A second candidate for the target model is generated (S90).
[0066] The fine tuning unit 28 selects a first candidate for the target model and a second candidate for the target model. Of the two candidates, the one with the higher accuracy is selected as the final target model (S1 00). Basically, the second candidate of the target model is selected as the final target model. However, in order to improve the generalization performance of the target model, The target model at the end of learning is generated using evaluation data that is different from the training data used for learning. The inference accuracy of the first and second candidates is evaluated, and the candidate with the higher accuracy is selected as the final target. It is more preferable to determine it as a get model.
[0067] In this way, we can predict the similarity between tasks based on the depth of the neural network model. Setting the initialization rate of a trained neural network model to train a new task This enables continuous learning, where new tasks are learned according to the characteristics of the tasks. This reduces the wasteful use of weights and increases the number of additional tasks that can be trained. Also, the initialization of useful weights is reduced, and the additional tasks can be It is possible to maintain high inference accuracy.
[0068] Task 3 is processed in the same way as Task 2, but the method of deriving task similarity is different. The differences are different.
[0069] The task similarity derivation unit 21 calculates the task similarity 31 between the task 3 and the task 1, and The task similarity 32 of task 2 is derived. The task with the greater task similarity is considered the learned task.
[0070] In general, the task similarity derivation unit 21 determines a target task from among a plurality of learned tasks. Select the one trained task with the highest similarity to as the trained task.
[0071] However, when the number of tasks increases, it becomes difficult to derive task similarity for all tasks. Therefore, the target for deriving task similarity should be selected as follows: It is also possible. (1) Prioritize the selection of new tasks as derivation targets. For example, A predetermined number of tasks are left as derivation targets in the order of the tasks. (2) Tasks with small initialization rates (dissimilar tasks) are selected as the derivation targets with priority. For example, a predetermined number of tasks are left as derivation targets in the order of the tasks with the smallest initialization rates. (3) Select tasks with an initialization rate smaller than a given value (dissimilar tasks) as derivation targets. For example, a predetermined number of tasks whose initialization rate is smaller than a predetermined value are left as the derivation target. (4) A combination of (1) and (2) above (5) A combination of (1) and (3) above In this way, the task with the highest similarity to the target task among multiple learned tasks is selected. By using a relatively large task as the learned task, the time required for the target task is reduced. The weight can be reduced.
[0072] Next, the inference device 200 and its operation will be described. FIG. 9 shows the inference device 200's operation for task N. 11 is a flowchart illustrating an operation.
[0073] The task determination unit 50 determines whether the task N input to the inference unit 70 is one of tasks 1 to 3. In this embodiment, the user determines which task it is (S200). Specify whether to
[0074] The inference model generation unit 60 generates an inference model based on the trained target model and the effective parameter information. Generate a neural network model for inference (hereinafter referred to as the "inference model") (S2 10) The target model is a neural network that has been trained for tasks 1 to 3. This is a work model. Task N is determined to be task i (i is 1 to 3). In this case, the inference model generation unit 60 generates a target model based on the effective parameter information of the task i. In this model, we generate an inference model in which all weights other than those used in task i are set to 0. Specifically, the inference model generating unit 60 reads out the code string of the valid parameter information and converts it into the code If the code is "1", the weight corresponding to the code is left unchanged. On the other hand, if the code is "0", If so, the weight corresponding to that code may be changed to 0.
[0075] The inference unit 70 generates an inference result of the input task N using the inference model generated for the task i. is generated (S220).
[0076] In this embodiment, the initialization unit 26 initializes the weights of the trained neural network model. The weights are initialized based on the initialization rate of the trained neural network. The weights of the network model may be initialized on a filter-by-filter basis based on an initialization rate.
[0077] The various processes of the machine learning device 100 and the inference device 200 described above are carried out by a CPU and a memory. It can be realized as a device using hardware such as a ROM ( Firmware stored in read-only memory (ROM) or flash memory, etc., The firmware program can also be implemented by software such as a computer. A program, a software program, etc., is recorded on a recording medium readable by a computer, etc. It can be provided to the server, or transmitted to and from the server via a wired or wireless network. It is also possible to transmit and receive the data as a terrestrial or satellite digital broadcast.
[0078] As described above, according to the machine learning device 100 of the present embodiment, a learned task and a target The utilization rate of weights of the target model that continuously learns according to the similarity or correlation of the target tasks By changing the number of additional tasks that can be trained and the accuracy of the additional tasks, can be optimized for
[0079] The present invention has been described above based on the embodiments. The embodiments are merely examples, and each of the structures The fact that various modifications are possible in the combination of components and each treatment process, and that such modifications It will be understood by those skilled in the art that such modifications are also within the scope of the present invention. [Explanation of symbols]
[0080] 10 task input unit, 20 continuous learning unit, 21 task similarity derivation unit, 22 initial 24 Machine learning execution unit, 26 Initialization unit, 28 Fine tuning 30 memory unit, 40 task input unit, 50 task judgment unit, 60 inference Model generation unit, 70 inference unit, 80 inference result output unit, 100 machine learning device, 200 Reasoning Apparatus.
Claims
1. a task input unit for selecting one task from a plurality of tasks; The effective parameter is information that specifies the weights that have not been initialized after the learning of the selected task. and learning the plurality of tasks based on the obtained effective parameter information. The weights of the neural network model that have been pre-installed are used as the weights to be used in the selected task. An inference model that generates an inference neural network model with all weights set to 0 except for the A generation unit; Inferring the selected task based on the neural network model for inference. and an inference unit for inferring the inference information.
2. a task input step of selecting one task from a plurality of tasks; The effective parameter is information that specifies the weights that have not been initialized after the learning of the selected task. and learning the plurality of tasks based on the obtained effective parameter information. The weights of the neural network model that have been pre-installed are used as the weights to be used in the selected task. An inference model that generates an inference neural network model with all weights set to 0 except for the A generating step; Inferring the selected task based on the neural network model for inference. and an inference step of inferring the same.
3. a task input step of selecting one task from a plurality of tasks; The effective parameter is information that specifies the weights that have not been initialized after the learning of the selected task. and learning the plurality of tasks based on the obtained effective parameter information. The weights of the neural network model that have been pre-installed are used as the weights to be used in the selected task. An inference model that generates an inference neural network model with all weights set to 0 except for the A generating step; Inferring the selected task based on the neural network model for inference. and an inference step of causing a computer to execute the inference step.
Citation Information
Patent Citations
Information processing device and information processing method
JP2017211799A
Information processing apparatus, information processing method, and program
JP2019192009A
