Machine learning device, machine learning method, and machine learning program
Patent Information
- Application Number
- JP2021003240
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-01-13
- Publication Date
- 2025-02-19
- Estimated Expiration
- 2041-01-13
AI Technical Summary
【0011】 本発明によれば、フィルタの飽和を緩和することができる機械学習技術を提供することができる。
Smart Images

Figure 0007631815000002 
Figure 0007631815000003 
Figure 0007631815000004
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. PackNet is one of the continual learning methods.
[0004] Patent Document 1 discloses a learning device that allows two or more learning modules to share model parameters updated by a plurality of learning modules. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2010-20446 A Summary of the Invention [Problem to be solved by the invention]
[0006] PackNet, one of the continuous learning methods, can avoid the fatal forgetting problem. However, PackNet has a problem that the number of filters in the model is limited, and when learning a new task, the filters become saturated, limiting the number of tasks that can be learned.
[0007] The present invention has been made in view of the above circumstances, and has an object to provide a machine learning technique that can alleviate filter saturation. [Means for solving the problem]
[0008] In order to solve the above problem, a machine learning device of one embodiment of the present invention includes a weight memory unit that stores weights of multiple filters used to detect features of a task; a continuous learning unit that continuously learns the weights of the multiple filters for an input task; a filter processing unit that locks weights of a predetermined percentage of the multiple filters after learning one task so that they are not used in learning another task, and initializes weights of the other filters to be used in learning another task; and a comparison unit that compares weights of the multiple filters after learning two or more tasks, and extracts overlapping filters whose weight similarity is equal to or greater than a predetermined threshold as shared filters between the tasks.
[0009] Another aspect of the present invention is a machine learning method, which includes a learning step of continuously learning weights of a plurality of filters used for detecting features of an input task, a filter processing step of locking weights of a predetermined ratio of the plurality of filters after learning one task so as not to use the filters in learning another task, and initializing weights of the remaining filters for use in learning the other task, and a comparison step of comparing weights of the plurality of filters after learning two or more tasks, and initializing weights of the remaining filters for use in learning the other task, except for one of the overlapping filters whose weight similarity is equal to or greater than a predetermined threshold.
[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 alleviate filter saturation. [Brief description of the drawings]
[0012] [Figure 1] 1(a) to 1(e) are diagrams for explaining continuous learning, which is a prerequisite technology. [Diagram 2] FIG. 1 is a configuration diagram of a machine learning device according to an embodiment. [Diagram 3] 3(a) to 3(e) are diagrams for explaining continuous learning by the machine learning device of FIG. [Figure 4] FIG. 3 is a diagram illustrating the operation of a comparison unit of the machine learning device in FIG. 2. [Diagram 5] 3 is a flowchart illustrating a continuous learning procedure by the machine learning device of FIG. 2. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Figures 1(a) to 1(e) are diagrams explaining continuous learning using PackNet, the underlying technology. In PackNet, the weights of multiple filters in a model are learned for a given task. Here, multiple filters in each layer of a convolutional neural network are illustrated as being arranged in a lattice pattern.
[0014] The PackNet training process consists of the following steps (A) to (E).
[0015] (A) The model learns task 1. Figure 1(a) shows the initial state of the filters after training task 1. All filters have been trained on task 1 and are shown in black.
[0016] (B) The filters are arranged in descending order of weight value, and 60% of the filters are initialized, starting with the filters with the smallest weight value. Figure 1(b) shows the final state of the filters after learning for Task 1. Initialized filters are shown in white.
[0017] (C) Next, task 2 is learned. In this step, the weight values of the black filters in Fig. 1(b) are locked, and only the white filters can change their weight values. Fig. 1(c) shows the initial state of the filters after learning task 2. All of the white filters in Fig. 1(b) have learned task 2, and are shown with diagonal lines in Fig. 1(c).
[0018] (D) As in step (B), the shaded filters that have been trained for Task 2 are sorted in descending order of weight value, and 60% of the filters are initialized, starting with the filters with the smallest weight value. Figure 1(d) shows the final state of the filters after training for Task 2. The initialized filters are shown in white.
[0019] (E) Further, task 3 is trained. In this step, the weight values of the black and shaded filters in Fig. 1(d) are locked, and only the white filters can change their weight values. Fig. 1(e) shows the initial state of the filters after training task 3. All of the white filters in Fig. 1(d) have trained task 3, and are shown with horizontal stripes in Fig. 1(e).
[0020] Thus, according to the PackNet learning process, if we continue learning up to task N, the number of initialized white filters will become smaller and smaller until it saturates. When the filters saturate, they will no longer be able to learn new tasks.
[0021] It is impossible to avoid that the filters of PackNet will eventually become saturated. However, it is possible to slow down the speed at which the filters become saturated. Therefore, in this embodiment, each time a new task is learned, overlapping filters with high similarity in weight are extracted as shared filters between tasks, one filter among the overlapping filters is left as a shared filter, and the weights of the filters other than the shared filter are initialized to 0. This makes it possible to increase the number of filters that can be learned with a new task, slow down the saturation speed of the filters, and increase the number of tasks that can be learned.
[0022] 2 is a configuration diagram of a machine learning device 100 according to an embodiment. The machine learning device 100 includes an input unit 10, a continuous learning unit 20, a filter processing unit 30, a comparison unit 40, a weight storage unit 50, an inference unit 60, and an output unit 70.
[0023] An input unit 10 supplies supervised tasks to a continuous learning unit 20 and unknown tasks to an inference unit 60. Here, as an example, the tasks are image recognition. For example, task 1 is recognizing a specific object in an image, such as recognizing a cat, and task 2 is recognizing a dog.
[0024] The weight storage unit 50 stores weights of a plurality of filters used for detecting the features of a task. By passing an image through a number of filters, the features of the image can be captured.
[0025] The continuous learning unit 20 continuously learns the weights of the multiple filters in the weight storage unit 50 for the input supervised task, and stores the updated filter weights in the weight storage unit 50.
[0026] The filter processing unit 30 locks the weights of a predetermined percentage of the filters after learning one task so as not to use them in learning another task, and initializes the weights of the remaining filters to use them in learning another task. For example, the filters are arranged in descending order of weight, the weights of 40% of the filters from the largest weight are locked, and the weights of the remaining 60% of the filters are initialized to use them in learning another task.
[0027] After the initialization by the filter processing unit 30 is completed, the comparison unit 40 compares the weights of the multiple filters after learning two or more tasks, and extracts overlapping filters whose weight similarity is equal to or greater than a predetermined threshold as shared filters between the tasks. Since the model is a multi-layer convolutional neural network, the similarity of the weights of the multiple filters is calculated in each layer. The comparison unit 40 leaves one filter out of the overlapping filters as a shared filter, initializes the weights of the filters other than the shared filter, and stores them in the weight storage unit 50.
[0028] The continuous learning unit 20 continuously learns the initialized weights of the filters other than the shared filter for a new task.
[0029] The inference unit 60 performs inference on the input unknown task using the filter weights stored in the weight storage unit 50. The output unit 70 outputs the inference result by the inference unit 60.
[0030] Figures 3(a) to 3(e) are diagrams explaining continuous learning by the machine learning device 100 of Figure 2. A plurality of filters in each layer of a convolutional neural network are illustrated arranged in a lattice pattern, and (i, j) indicates the filter in the i-th row and j-th column.
[0031] The learning process of the machine learning device 100 proceeds through the following steps (A) to (E).
[0032] (A) The model learns task 1. Figure 3(a) shows the initial state of the filters after learning task 1. All filters have been trained on task 1 and are shown in black.
[0033] (B) The filters are arranged in descending order of weight value, and 60% of the filters are initialized, starting with the smallest weight value. Figure 3(b) shows the final state of the filters after learning for Task 1. Initialized filters are shown in white.
[0034] (C) Next, task 2 is learned. In this step, the weight values of the black filters in Fig. 3(b) are locked, and only the white filters can change their weight values. Fig. 3(c) shows the initial state of the filters after learning task 2. All of the white filters in Fig. 3(b) have learned task 2, and are shown with diagonal lines in Fig. 3(c).
[0035] (D) As in step (B), the shaded filters that have been trained for Task 2 are sorted in descending order of weight value, and 60% of the filters are initialized, starting with the filters with the smallest weight value. Figure 3(d) shows the intermediate state of the filters after training for Task 2. The initialized filters are shown in white.
[0036] (E) Compare the weights between the black filter that learned task 1 and the diagonal filter that learned task 2, and extract filters whose similarity exceeds a certain threshold as duplicate filters. For example, in Figure 3(d), the diagonal filter (1,3) is similar to the black filter (1,2), so they are determined to be duplicate filters. Similarly, the diagonal filter (3,1) and the black filter (3,2) are similar duplicate filters, and the diagonal filter (3,5) and the black filter (4,5) are similar duplicate filters.
[0037] As shown in Figure 3(e), the diagonal filter (1,3) can be substituted with the similar black filter (1,2), so the weight of the diagonal filter (1,3) is initialized to become a white filter, and the black filter (1,2) becomes a common filter for tasks 1 and 2. Similarly, the diagonal filter (3,1) is substituted with the similar black filter (3,2), the weight of the diagonal filter (3,1) is initialized to become a white filter, and the black filter (3,2) becomes a common filter for tasks 1 and 2. In addition, the diagonal filter (3,5) is substituted with the similar black filter (4,5), the weight of the diagonal filter (3,5) is initialized to become a white filter, and the black filter (4,5) becomes a common filter for tasks 1 and 2.
[0038] Figure 3(e) shows the final state of the filter after learning for task 2, and the initialized white filter is used in learning for task 3, and the weight is changed. Thereafter, similarly, a filter with a small weight value is initialized for the initial state of the filter after learning for task 3, and the weights of the filter that learned task 3 are compared with the filter that learned task 1 and the filter that learned task 2. If there is a similar overlapping filter, the filter for task 3 is initialized. This is repeated up to task N.
[0039] FIG. 4 is a diagram illustrating the operation of the comparison unit 40 of the machine learning device 100 of FIG.
[0040] For the intermediate state of the filter after learning Task 2 shown in Figure 3(d), the weights of the filter trained for Task 1 and the weights of the filter trained for Task 2 are compared, and filters with highly similar weights are extracted and are targeted for initialization.
[0041] Since the model has multiple layers, the comparison is performed within each layer. For example, there are 128 filters in one layer. Among them, 51 filters have been trained for task 1, 30 filters have been trained for task 2, and the remaining filters are initialized. Then, the similarity between the 51 filters for task 1 and the 30 filters for task 2 is calculated.
[0042] The similarity is calculated by comparing the absolute values of the filter weights. For example, in the case of a 3x3 filter, the absolute values of the nine weights are compared. A threshold is set here. If the similarity exceeds the threshold, the two filters are determined to be overlapping, and the weight of the filter for task 2 is initialized to 0.
[0043] Each element of filter A is a ij , each element of filter B is b ij In this case, the absolute difference between the values at the same position between two filters A and B is expressed as d1(A,B), d2(A,B), and d ∞ (A,B), d m Calculate as (A,B).
number
[0044] In the above description, the similarity of filters is calculated by calculating the difference in absolute values of values at the same position between two filters, but the similarity may be calculated by other methods. For example, for each filter, the filter absolute difference sum SAD is calculated as the sum of the horizontal absolute difference sum SAD_H and the vertical absolute difference sum SAD_V, and SAD=SAD_H+SAD_V is calculated. If the difference between the filter absolute difference sum SAD_A of filter A and the filter absolute difference sum SAD_B of filter B is smaller than a threshold value, it may be determined that filter A and filter B overlap. Here, if the elements of the first row of a 3×3 filter are a1, a2, a3, the elements of the second row are a4, a5, a6, and the elements of the third row are a7, a8, a9, the horizontal absolute difference sum SAD_H and the vertical absolute difference sum SAD_V are given by the following equations. SAD_H=|a1-a2|+|a2-a3|+|a4-a5|+|a5-a6|+|a7-a8|+|a8-a9| SAD_V=|a1-a4|+|a2-a5|+|a3-a6|+|a4-a7|+|a5-a8|+|a6-a9| As another method for calculating the similarity, a comparison of Euclidean distance or cosine distance may be used.
[0045] If the similarity of the filter weights is high, it means that the filters have the same or no difference in features between tasks, and there is no need to retain duplicate filters. Therefore, one of the filters is initialized and used for learning another task. Note that here, we have explained that the weight is one element in the filter, or one cell in the matrix in the case of the 3x3 filter in Figure 4, but it is also possible to consider the weight on a filter-by-filter basis, that is, on a matrix-by-matrix basis.
[0046] More generally, to maximize the performance of task N, if there are overlapping filters between task N and task N+1, initialize the weights of the filter of task N+1 to 0. This allows maximum utilization of the limited filters.
[0047] FIG. 5 is a flowchart illustrating a continuous learning procedure by the machine learning device 100 of FIG.
[0048] The input unit 10 inputs the current supervised task to the continuous learning unit 20 (S10).
[0049] The continuous learning unit 20 continuously learns the weights of a plurality of filters for the current task (S20).
[0050] The filter processing unit 30 initializes a predetermined ratio of filters in ascending order of weighting of a plurality of filters that have learned the current task (S30).
[0051] The comparison unit 40 compares the filter that has learned the current task with the filter that has learned the past task, and calculates the similarity of the weights (S40).
[0052] The comparison unit 40 initializes a filter of the current task that has a high similarity to the filter of the past task (S50).
[0053] If there are still tasks, the process returns to step S10 and the next task is input (N in S60). If the task is completed, the continuous learning is ended (Y in S60).
[0054] The various processes of the machine learning device 100 described above can be realized not only as a device 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 a data broadcast of terrestrial or satellite digital broadcasting.
[0055] As described above, according to the machine learning device 100 of this embodiment, it is possible to alleviate the saturation speed of the filter of the continuous learning model and to efficiently use the filter to learn more tasks.
[0056] 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]
[0057] 10 input unit, 20 continuous learning unit, 30 filter processing unit, 40 comparison unit, 50 weight storage unit, 60 inference unit, 70 output unit, 100 machine learning device.
Claims
1. a weight storage unit that stores weights of a plurality of filters used for detecting features of a task; a continuous learning unit that continuously learns weights of the plurality of filters for an input task; a filter processing unit that locks weights of a predetermined ratio of filters among a plurality of filters after learning one task so as not to use the filters in learning another task, and initializes weights of the remaining filters so as to use them in learning another task; A machine learning device comprising: a comparison unit that compares the weights of a plurality of filters after learning two or more tasks, and for overlapping filters whose weight similarity is equal to or greater than a predetermined threshold, retains one shared filter and initializes the weights of the rest for use in learning another task.
2. The machine learning device according to claim 1 , wherein the continuous learning unit continuously learns the initialized weights of a filter other than the shared filter for another task.
3. A learning step of continuously learning weights of a plurality of filters used for detecting features of an input task; a filter processing step of locking weights of a predetermined ratio of filters among a plurality of filters after learning one task so as not to use the filters in learning another task, and initializing weights of the remaining filters so as to use them in learning another task; A machine learning method comprising: a comparison step of comparing the weights of a plurality of filters after learning two or more tasks, and for overlapping filters whose weight similarity is equal to or greater than a predetermined threshold, retaining one shared filter and initializing the weights of the rest for use in learning another task.
4. A learning step of continuously learning weights of a plurality of filters used for detecting features of an input task; a filter processing step of locking weights of a predetermined ratio of filters among a plurality of filters after learning one task so as not to use the filters in learning another task, and initializing weights of the remaining filters so as to use them in learning another task; A machine learning program that causes a computer to execute a comparison step of comparing the weights of multiple filters after learning two or more tasks, and for overlapping filters whose weight similarity is equal to or greater than a predetermined threshold, retaining one shared filter and initializing the weights of the rest for use in learning another task.
Citation Information
Patent Citations
Learning device, learning method, and program
JP2010020446A
Information processing apparatus, information processing method and program
JP2018055259A