This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2020-165332, filed on Sep. 30, 2020, the entire contents of which are incorporated herein by reference.
The embodiment discussed herein is related to a storage medium, an information processing device, and an information processing method.
Deep neural networks (DNNs) are known as machine learning models that solve problems such as regression and classification.
Continuous learning is intended to increase the ability of a model by sequentially giving data to the model such as the DNN. In the presence of a learned DNN, if this learned DNN is learned with other data in an attempt to learn new things, previously learned content may be erased by catastrophic forgetting.
Therefore, many methods for preventing the catastrophic forgetting have been discussed.
Kirkpatrick, James, et al. “Overcoming catastrophic forgetting in neural networks.” Proceedings of the national academy of sciences 114.13 (2017): 3521-3526 is disclosed as related art.
According to an aspect of the embodiments, A non-transitory computer-readable storage medium storing an information processing program that causes at least one computer to execute a process, the process includes acquiring a first machine learning model trained by using a training data set including first data and a second machine learning model not trained with the specific data; and retraining the first machine learning model so that an output of the first machine learning model and an output of the second machine learning second model when data corresponding to the first data is input get close to each other.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
For the continuous learning, there are some cases where it is necessary not only to prevent the catastrophic forgetting but also to selectively forget the learned content. For example, in a case of receiving an attack such as poisoning that performs an attack using a specific method by a back door of a system, it is assumed to erase information of a specific user for privacy protection. Furthermore, in a case of learning a medical diagnostic image that includes patient information or learning an image of a car that includes a license plate, it is also assumed that a phenomenon called leakage occurs in which personal information, and the like not related to an intended task are input.
In one aspect, it is intended to enable modification of a learned model independently of past training data.
In one aspect, a learned model can be modified independently of past training data.
To forget specific data in relearning a learning model, if data used in previous learning remains, a data set is created by removing data to be forgotten from the data used in the previous learning and simply relearning the data set.
For example, to learn handwritten numbers from 0 to 9 and forget 0, relearning is simply performed using a data set from 1 to 9. That is, 0 is forgotten by catastrophic forgetting.
However, there are some cases where the data used in the previous learning does not remain due to circumstances such as performing learning using data temporarily provided by a customer. Furthermore, in a case where the data used in the previous learning is large, relearning may take a long time.
Therefore, it is assumed to give a random label to the data to be forgotten and learn the data.
For example, to remember the handwritten numbers from 0 to 9 and forget 0, relearning is simply performed giving the random label to 0.
Meanwhile, for data that is not desired to be forgotten (for example, the numbers from 1 to 9), a method of including the data used in the previous learning in the re-learning to prevent the catastrophic forgetting may be used. As the method of preventing the catastrophic forgetting, for example, a regularization term for preventing forgetting can be constructed by calculating through previous learning data only once by EWC.
EWC is a method of calculating moving which parameters is unlikely to forget the previous learning content, and mainly operating those parameters in the next learning.
Assume relearning processing from task A (for example, learning handwritten numbers from 0 to 9) to task B (for example, learning to forget 0). The hatched ellipse illustrated in
As illustrated by sign A1, a loss function value of the task A (in other words, a previous learning task) does not increase even if a specific parameter is moved. In other words, there is a high possibility that the data to be forgotten is not forgotten.
The low error for the task B is guaranteed in parameter change by EWC indicated by the solid arrow and parameter change by L2 indicated by the broken line arrow. Note that L2 is an operation of performing a change not to deviate from a parameter θA illustrated in the center of the ellipse.
Meanwhile, in no penalty illustrated by the alternate long and short dash line as illustrated by sign A2, only regularization is simply performed so as not to move the parameters. Therefore, inappropriate parameters are moved.
In EWC, moving which parameter increases a quadratic approximation of a loss function is calculated using the data set used in the previous learning and the loss function, and a calculation result is added as a loss to the regularization term.
An i-th element of a parameter θ is θi, an i-th element of a parameter θold for the previous learning is θold,i, the loss function for additional learning is L(θ), and the original loss function is LB(θ). Furthermore, the following equation 1 holds where a value indicating how much the movement of the i-th parameter is likely to affect the previous learning when the i-th parameter moves is Fi.
However, if the data to be forgotten is given the random label according to a certain distribution by the relearning using EWC, an unnatural result may be output as a “forgotten” state. For example, it is considered that, when the handwritten 0 is input, 6 or 9 having a shape close to the forgotten 0 should be output, but there is a possibility that the values from 1 to 9 are evenly output.
Hereinafter, an embodiment will be described with reference to the drawings. Note that the embodiment to be described below is merely an example, and there is no intention to exclude application of various modifications and techniques not explicitly described in the embodiment. In other words, for example, the present embodiment may be modified in various ways to be implemented without departing from the spirit of the embodiment. Furthermore, each drawing is not intended to include only the constituent elements illustrated in the drawing and may include other functions and the like.
Hereinafter, each same reference numeral represents a similar part in the drawings, and thus description thereof will be omitted.
As illustrated in
The memory unit 12 is an example of a storage unit, which is, for example, a read only memory (ROM), a random access memory (RAM), and the like. Programs such as a basic input/output system (BIOS) may be written into the ROM of the memory unit 12. A software program of the memory unit 12 may be appropriately read and executed by the CPU 11. Furthermore, the RAM of the memory unit 12 may be used as a temporary recording memory or a working memory.
The display control unit 13 is connected to a display device 130 and controls the display device 130. The display device 130 is a liquid crystal display, an organic light-emitting diode (OLED) display, a cathode ray tube (CRT), an electronic paper display, or the like, and displays various kinds of information for an operator or the like. The display device 130 may be combined with an input device and may be, for example, a touch panel.
The storage device 14 is a storage device having high input/output (IO) performance, and for example, a dynamic random access memory (DRAM), a solid state drive (SSD), a storage class memory (SCM), and a hard disk drive (HDD) may be used.
The input IF 15 may be connected to an input device such as a mouse 151 and a keyboard 152, and may control the input device such as the mouse 151 and the keyboard 152. The mouse 151 and the keyboard 152 are examples of the input devices, and an operator performs various kinds of input operation through these input devices.
The external recording medium processing unit 16 is configured so that a recording medium 160 can be attached thereto. The external recording medium processing unit 16 is configured to be capable of reading information recorded in the recording medium 160 in a state where the recording medium 160 is attached thereto. In the present example, the recording medium 160 is portable. For example, the recording medium 160 is a flexible disk, an optical disk, a magnetic disk, a magneto-optical disk, a semiconductor memory, or the like.
The communication IF 17 is an interface for enabling communication with an external device.
The CPU 11 is an example of a processor, and is a processing device that performs various controls and calculations. The CPU 11 implements various functions by executing an operating system (OS) or a program loaded in the memory unit 12.
A device for controlling operation of the entire information processing device 1 is not limited to the CPU 11 and may be, for example, any one of an MPU, a DSP, an ASIC, a PLD, or an FPGA. Furthermore, the device for controlling operation of the entire information processing device 1 may be a combination of two or more of the CPU, MPU, DSP, ASIC, PLD, and FPGA. Note that the MPU is an abbreviation for a micro processing unit, the DSP is an abbreviation for a digital signal processor, and the ASIC is an abbreviation for an application specific integrated circuit. Furthermore, the PLD is an abbreviation for a programmable logic device, and the FPGA is an abbreviation for a field programmable gate array.
As illustrated in
The acquisition unit 111 acquires a first machine learning model trained using a training data set including specific data to be forgotten. Furthermore, the acquisition unit 111 acquires a second machine learning model that has not been trained using the specific data to be forgotten.
The retraining unit 112 retrains the first machine learning model so that an output of the first machine learning model and an output of the second machine learning model when data corresponding to the specific data is input get close to each other.
In the relearning processing in one example of the embodiment, a random DNN (in other words, the second machine learning model) randomly initialized and fixed parameters illustrated by sign B2 is prepared in addition to a learned DNN (in other words, the first machine learning model) illustrated by sign B1.
Then, the random DNN is distilled to the learned DNN using the data to be forgotten. An output error is minimized when the same data (the handwritten 0 in the example illustrated in
Here, distillation is a method of inputting the same data to the DNN with fixed parameters and the DNN to be learned to regress the DNN to be learned to the output of the DNN with fixed parameters.
The distillation is mainly used when compressing a large DNN. For example, by causing a small DNN (in other words, a student) to imitate the output of a large DNN (in other words, a teacher), thereby efficiently implementing a small DNN with similar performance.
In a production line for mechanical parts, semiconductors, and textile products, a certain product is manufactured by any of a plurality of manufacturing devices, and inspection data such as an appearance image is acquired by any of the plurality of inspection devices. Some products are labeled as non-defective/detective, defective type, or the like by sampling inspection.
A production line 100 illustrated in
Information of the manufacturing device, the inspection device, inspection data, a sampling inspection result, and the like used for manufacturing each product is accumulated for a certain period of time and deleted after the elapse of a certain period of time.
In the example illustrated in
For example, as illustrated by signs D1 and D2, the sampling inspection result of the product with ID 003 manufactured by the manufacturing device B and inspected by the inspection device X is registered as defective.
In the defect inspection learning processing, labeled data is used from the accumulated data to generate a classification model.
In the example illustrated in
When the certain period of time elapses and the next data is accumulated, the classification model is updated by continuous learning (in other words, additional learning) using EWC or the like.
In the example illustrated in
The classification model predicts non-defective/defective labels for each of accumulated product data.
In the example illustrated in
In a case where the accuracy of the model deteriorates, the inspection device that causes defective learning data is checked as an analysis of the cause of the deterioration. In a case where defectiveness is found in the inspection device (for example, dirt on a camera lens for capturing the appearance image), it means that the data created by the inspection device has been contaminated, and the classification model has been learned with the contaminated data.
In the example illustrated in
The inspection device in which the defectiveness has been found is separated from the production line 100, and a part of the product is applied to the inspection device in which the defectiveness is found, and forgetting data is collected for a certain period of time. Then, by applying the forgetting data to the classification model, the influence of the contaminated data is recovered.
In the example illustrated in
The relearning processing in the information processing device 1 illustrated in
In the relearning processing illustrated in
The retraining unit 112 trains MNIST as usual (step S1).
The retraining unit 112 uses the MNIST data set to configure the EWC regularization term (step S2).
The retraining unit 112 forgets 0 by bringing the output for 0 closer to the random DNN (step S3). In the forgetting processing, backpropagation or an error propagation method is performed by differentiating the loss function illustrated by the following Math 2. Then, the relearning processing ends.
MSE(DNN(x,θ),RandomDNN(x))+λEWC(θ,θold) [Math 2]
In the equation of Math 2, the first term is a term for forgetting 0, and the second term is a term for not forgetting 1 to 9. The loss function is calculated so that the sum of the first and second terms is minimized. MSE is a mean square error, DNN is the DNN to be learned, RandomDNN is the random DNN with fixed parameters, x is input data, and θ is the DNN parameter to be learned. Furthermore, EWC is the regularization term by EWC, λ is a hyperparameter that determines how much EWC is emphasized, and θold is a parameter in the previous learning about the DNN to be learned.
Due to the forgetting operation, the correct answer rate of 0 after forgetting is 0%. Meanwhile, the correct answer rate from 1 to 9 is 95% before forgetting whereas 93% after forgetting, which shows no significant change.
According to the above-described example of the embodiment, the following effects may be obtained, for example.
The acquisition unit 111 acquires the first machine learning model trained using the training data set including the specific data and the second machine learning model not trained with the specific data. The retraining unit 112 retrains the first machine learning model so that an output of the first machine learning model and an output of the second machine learning model when data corresponding to the specific data is input get close to each other. Thereby, the learned model may be modified independently of past training data. In other words, any data may be selectively forgotten from the training data set.
The second machine learning model is a deep neural network in which the first machine learning model is randomly initialized and the parameters are fixed. Thereby, the learned data may be efficiently modified.
The retraining unit 112 performs the retraining on the basis of a loss function represented by a sum of a variable for forgetting the specific data and a variable for not forgetting data other than the specific data of the training data set. Thereby, the learned data may be efficiently modified.
The disclosed technique is not limited to the above-described embodiment, and various modifications may be made without departing from the spirit of the present embodiment. Each of the configurations and processes according to the present embodiment may be selected as needed, or may be combined as appropriate.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2020-165332 | Sep 2020 | JP | national |