Learning device, learning method, and learning program
By converting data into frequency components and optimizing generator parameters to align frequency distributions, the learning device addresses overfitting and improves model accuracy in deep generative models.
Patent Information
- Application Number
- JP2022553336
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2024-08-21
- Estimated Expiration
- 2040-09-30
AI Technical Summary
Conventional deep generative models, such as GANs, suffer from overfitting and accuracy issues due to reliance on high-frequency components not present in the training data, leading to overlearning and deteriorating generation quality.
A learning device that converts input data and generated data into frequency components, calculates the error between these components, and updates the generator's parameters to minimize this error, using methods like discrete Fourier transform and mean squared error to align frequency distributions.
This approach suppresses overfitting and improves model accuracy by reducing the influence of high-frequency components, enhancing the generation quality and stability of the model.
Smart Images

Figure 0007537506000007 
Figure 0007537506000009 
Figure 0007537506000005
Abstract
Description
[Technical field]
[0001] The present invention relates to a learning device, a learning method, and a learning program. [Background technology]
[0002] Conventionally, deep generative models are known that are based on deep learning technology and generate samples that are close to the real thing by learning the distribution of trained data. For example, GANs (Generative Adversarial Networks) are known as deep learning models (see, for example, Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] Goodfellow, Ian, et al. "Generative adversarial nets." Advances in neural information processing systems. 2014. (NIPS 2014) Summary of the Invention [Problem to be solved by the invention]
[0004] However, conventional techniques have the problem that overfitting may occur and the accuracy of the model may not improve. For example, samples generated by a trained GAN generator contain high-frequency components that are not included in the actual training data. As a result, the classifier may rely on high-frequency components to determine authenticity, which may cause overfitting. [Means for solving the problem]
[0005] In order to solve the above-mentioned problems and achieve the objective, the learning device is characterized by having a conversion unit that converts first data into a first frequency component and converts second data generated by a generator that constitutes an adversarial learning model into a second frequency component, a calculation unit that calculates an error between the first frequency component and the second frequency component, and an update unit that updates parameters of the generator so that the error calculated by the calculation unit is reduced. Effect of the Invention
[0006] According to the present invention, it is possible to prevent overlearning and improve the accuracy of the model. [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 is a diagram illustrating a deep learning model according to the first embodiment. [Diagram 2] FIG. 2 is a diagram illustrating the influence of high-frequency components. [Diagram 3] FIG. 3 is a diagram illustrating an example of the configuration of the learning device according to the first embodiment. [Figure 4] FIG. 4 is a flowchart showing a flow of processing of the learning device according to the first embodiment. [Diagram 5] FIG. 5 shows the results of the experiment. [Figure 6] FIG. 6 shows the results of the experiment. [Figure 7] FIG. 7 shows the results of the experiment. [Figure 8] FIG. 8 is a diagram illustrating an example of a computer that executes a learning program. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a learning device, a learning method, and a learning program according to the present application will be described in detail with reference to the accompanying drawings. Note that the present invention is not limited to the following embodiments.
[0009] GAN is a technology that learns a data distribution p_data(x) using two deep learning models: a generator G and a discriminator D. G learns to deceive D, and D learns to distinguish between G and the training data. A model in which multiple models are in an adversarial relationship is sometimes called an adversarial learning model.
[0010] Adversarial learning models such as GANs are used in the generation of images, text, speech, etc. Reference 1: Karras, Tero, et al. "Analyzing and improving the image quality of stylegan." Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2020. (CVPR 2020) Reference 2: Donahue, Chris, Julian McAuley, and Miller Puckette. "Adversarial audio synthesis." arXiv preprint arXiv:1802.04208 (2018). (ICLR 2019) Reference 3: Yu, Lantao, et al. "Seqgan: Sequence generative adversarial nets with policy gradient." Thirty-first AAAI conference on artificial intelligence. 2017. (AAAI 2017)
[0011] Here, GAN has a problem that D overfits the training samples as the learning progresses. As a result, each model cannot meaningfully update the data generation, and the generation quality by the generator deteriorates. This is shown, for example, in Figure 1 of Reference 4. Reference 4: Karras, Tero, et al. "Training Generative Adversarial Networks with Limited Data." arXiv preprint arXiv:2006.06676 (2020).
[0012] In addition, Reference 5 describes that the trained CNN output makes predictions depending on the high-frequency components of the input. Reference 5: Wang, Haohan, et al. "High-frequency Component Helps Explain the Generalization of Convolutional Neural Networks." Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2020.(CVPR 2020)
[0013] In addition, Reference 6 describes that the neural networks that constitute the generator G and discriminator D of a GAN tend to learn low frequencies first, followed by high frequencies. Reference 6: Rahaman, Nasim, et al. "On the spectral bias of neural networks." International Conference on Machine Learning. 2019. (ICML 2019)
[0014] Therefore, in the first embodiment, one object is to prevent overlearning and improve the accuracy of the model by reducing the influence of high frequency components of the data on the generator G and the discriminator D. Fig. 1 is a diagram for explaining a deep learning model according to the first embodiment. Fig. 2 is a diagram for explaining the influence of high frequency components.
[0015] As shown in Figure 2, the CIFAR-10 (two-dimensional power spectrum) is different between real data (Real) and data generated by a generator (GAN). Reference 7 also shows that data generated by various GANs has an increased power spectrum at high frequencies compared to real data. Reference 7: Durall, Ricard, Margret Keuper, and Janis Keuper. "Watch your Up-Convolution: CNN Based Generative Deep Neural Networks are Failing to Reproduce Spectral Distributions." Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2020. (CVPR 2020)
[0016] Returning to FIG. 1, in the deep learning model of this embodiment, a discriminator D discriminates which data is Real (or Fake) between data (Real) contained in a real data set X and data (Fake) generated by a generator G from a random number z.
[0017] In conventional GANs, the optimization of the classifier D is performed to improve the classification accuracy of the classifier D, i.e., to increase the probability that the classifier D classifies Real as Real. The optimization of the generator G is also performed to increase the ability of the generator G to deceive the generator G, i.e., to increase the probability that the classifier D classifies Real as Fake.
[0018] In this embodiment, in addition to the above optimization, the generator G is optimized so that the frequency components of Real and Fake match. Hereinafter, the configuration of the learning device of this embodiment and the details of the learning process of the deep learning model will be described.
[0019] [Configuration of the first embodiment] 3 is a diagram illustrating an example of the configuration of a learning device according to the first embodiment. The learning device 10 receives input of learning data and updates parameters of a deep learning model. The learning device 10 may also output the updated parameters. As illustrated in FIG. 3, the learning device 10 includes an input / output unit 11, a storage unit 12, and a control unit 13.
[0020] The input / output unit 11 is an interface for inputting and outputting data. For example, the input / output unit 11 may be a communication interface such as a network interface card (NIC) for performing data communication with other devices via a network. The input / output unit 11 may also be an interface for connecting an input device such as a mouse or keyboard, and an output device such as a display.
[0021] The storage unit 12 is a storage device such as a hard disk drive (HDD), a solid state drive (SSD), an optical disk, etc. The storage unit 12 may be a semiconductor memory in which data can be rewritten, such as a random access memory (RAM), a flash memory, or a non-volatile static random access memory (NVSRAM). The storage unit 12 stores an operating system (OS) and various programs executed by the learning device 10. The storage unit 12 also stores model information 121.
[0022] The model information 121 is information such as parameters for constructing a deep learning model, and is appropriately updated in the learning process. In addition, the updated model information 121 may be output to another device or the like via the input / output unit 11.
[0023] The control unit 13 controls the entire learning device 10. The control unit 13 is, for example, an electronic circuit such as a central processing unit (CPU), a micro processing unit (MPU), or a graphics processing unit (GPU), or an integrated circuit such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). The control unit 13 also has an internal memory for storing programs that define various processing procedures and control data, and executes each process using the internal memory. The control unit 13 also functions as various processing units by the operation of various programs. For example, the control unit 13 has a generation unit 131, a conversion unit 132, a calculation unit 133, and an update unit 134.
[0024] The generating unit 131 inputs the random number z to a generator G to generate second data.
[0025] The conversion unit 132 converts the first data into a first frequency component, and converts the second data generated by a generator G constituting an adversarial learning model into a second frequency component.
[0026] The transform unit 132 transforms the first data and the second data into frequency components using a differentiable function. This is to enable updating of parameters by the back-propagation method. For example, the transform unit 132 transforms the first data and the second data into frequency components by a discrete Fourier transform (DFT) or a discrete cosine transform (DCT).
[0027] The calculation unit 133 calculates the error between the first frequency component and the second frequency component. The calculation unit 133 can calculate the error by any method such as MSE (Mean Square Error), RMSE (Root Mean Square Error), L1, etc. Here, the calculation unit 133 calculates the error L as shown in equation (1).freq shall be calculated.
[0028]
number
[0029] where X real and X fake are batches of Real and Fake, respectively. Also, |X real | and |X fake | is the batch size of each. Real is real data. And Fake is data generated by generator G.
[0030] Also, F(·) is a function that converts spatial domain data into frequency components. x real i and x fake j are X real The i-th data and X fake The j-th data is an example of the first data and the second data. real i ) corresponds to the first frequency component. fake j ) corresponds to the second frequency component.
[0031] In this way, the calculation unit 133 calculates the error between the batch average of the multiple first frequency components obtained by converting each of the multiple first data and the batch average of the multiple second frequency components obtained by converting each of the multiple second data. In other words, the error here corresponds to the error between the batch averages, not the error between the individual data samples.
[0032] Furthermore, the calculation unit 133 calculates a loss function L that increases as the error between the first frequency component and the second frequency component increases and increases as the classification accuracy between the first data and the second data by the classifier constituting the adversarial learning model decreases. G is calculated as in (2), where λ is a hyperparameter that functions as a weight.
[0033]
number
[0034] G(·) is a function that outputs data (Fake) generated by generator G based on arguments. Also, D(·) is a function that outputs the probability that discriminator D will classify data input as an argument as Real.
[0035] The update unit 134 updates the parameters of the generator G so as to reduce the error calculated by the calculation unit 133. Specifically, the update unit 134 updates the parameters of the loss function L G Update the parameters of the generator G so that
[0036] Furthermore, the update unit 134 updates the parameters of the classifier D so as to optimize the loss function of equation (3). Here, x is real data (Real).
[0037]
number
[0038] [Processing of the first embodiment] Fig. 4 is a flowchart showing a process flow of the learning device according to the first embodiment. As shown in Fig. 4, first, the learning device 10 reads learning data (step S101). Here, the learning device 10 reads real data (Real) as the learning data.
[0039] Next, the learning device 10 samples a random number z from a normal distribution and generates a sample (Fake) by G(z) (step S102). The learning device 10 also converts the Real and Fake into frequency components by DCT or DFT, and calculates the batch average of the frequency components (step S103).
[0040] Here, the learning device 10 calculates the GAN loss function of the generator G (step S104). The GAN loss of the generator G corresponds to the first term on the right side of equation (2). Then, the learning device 10 calculates the frequency component matching loss from the batch average of the Real-Fake frequency components (step S105). The frequency component matching loss is calculated by L freq is equivalent to.
[0041] Furthermore, the learning device 10 calculates the sum of the GAN loss function for G and the frequency component matching loss as the overall loss (step S106). The overall loss is calculated by L G The learning device 10 may multiply the frequency component matching loss by a weight λ. The learning device 10 updates the parameters of the generator G by backpropagation of the total loss (step S107).
[0042] Furthermore, the learning device 10 performs learning of the classifier D (step S108). Specifically, the learning device 10 updates the parameters of the classifier D by the back-propagation method of the loss function of equation (3).
[0043] At this time, if the maximum number of learning steps>the number of learning steps (step S109, True), the learning device 10 returns to step S101 and repeats the process. On the other hand, if the maximum number of learning steps>the number of learning steps is not satisfied (step S109, False), the learning device 10 ends the process.
[0044] [Advantages of the first embodiment] As described above, the conversion unit 132 converts the first data into a first frequency component, and converts the second data generated by a generator constituting an adversarial learning model into a second frequency component. The calculation unit 133 calculates the error between the first frequency component and the second frequency component. The update unit 134 updates the parameters of the generator so that the error calculated by the calculation unit 133 becomes smaller. In this way, the learning device 10 can reflect the influence of the frequency component in the learning. As a result, according to this embodiment, it is possible to prevent overlearning and improve the accuracy of the model.
[0045] The transform unit 132 transforms the first data and the second data into frequency components using a differentiable function. For example, the transform unit 132 transforms the first data and the second data into frequency components by a discrete Fourier transform or a discrete cosine transform. This enables the update of parameters by the back error propagation method in this embodiment.
[0046] The calculation unit 133 calculates the error between the batch average of the multiple first frequency components obtained by converting each of the multiple first data and the batch average of the multiple second frequency components obtained by converting each of the multiple second data. In this way, in this embodiment, not only the frequency components occurring in each data, but also the overall tendency observed in the occurring frequency components can be reflected in the learning.
[0047] The calculation unit 133 calculates a loss function that increases as the error between the first frequency component and the second frequency component increases and increases as the classification accuracy between the first data and the second data by the classifier constituting the adversarial learning model decreases. The update unit 134 updates the parameters of the generator so that the loss function is optimized. This allows the learning of the entire model to be performed efficiently in this embodiment.
[0048] [experiment] An experiment was conducted by actually implementing the above embodiment, and the experimental setup is as follows. Experimental setup Dataset: CIFAR-100 (image dataset, 100 classes) Training data set: 50,000 images Neural network architecture: Resnet-SNGAN (Reference 8: Miyato, Takeru, et al. "Spectral normalization for generative adversarial networks." arXiv preprint arXiv:1802.05957 (ICLR 2018).) Experimental Procedure (1) 100,000 iterations of training data (2) Measure the generation quality (FID) every 1,000 iterations (Reference 9: Heusel, Martin, et al. "Gans trained by a two time-scale update rule converge to a local nash equilibrium." Advances in neural information processing systems. 2017. (NIPS 2017)) (3) The model with the best FID score is used as the final training model. (4) Perform the experiment 10 times and calculate the average and standard deviation of the FID. Experimental Pattern SNGAN: Baseline (normal GAN) (Reference 8) CVPR20: Existing method to minimize frequency content of generated images (using 1D DFT and binary cross-entropy) (Reference 7) FreqMSE: Frequency component matching loss (using 2D DCT, Mean Squared Error) SSD2GAN: Simultaneous learning of spatial and frequency domains (2D DCT) SSD2GAN + Tradeoff: Introduce tradeoff coefficient α (use α=0.8) SSD2GAN + SSCR:D s and D f Introduce consistency loss (with λ=0.001)
[0049] FreqMSE corresponds to the first embodiment. SSD2GAN is another method for improving the accuracy of a model by taking into account the influence of frequency components in a method different from that of the first embodiment.
[0050] 5, 6, and 7 are diagrams showing the results of the experiment. As shown in FIG. 5, in FreqMSE and SSD2GAN + Tradeoff + SSCR, the FID of the generator G is reduced, and it can be said that the generation quality is improved.
[0051] In addition, as shown in Figure 6, overfitting is suppressed in all methods except SNGAN. In SNGAN, overfitting occurs after 40,000 iterations, and the FID continues to deteriorate.
[0052] As shown in Figure 7, for the transformation functions of each frequency component, FreqMSE and SSD2GAN have the effect of suppressing non-existent high-frequency components contained in the generated samples.
[0053] [System configuration, etc.] In addition, each component of each device shown in the figure is a functional concept, and does not necessarily have to be physically configured as shown in the figure. In other words, the specific form of distribution and integration of each device is not limited to that shown in the figure, and all or a part of it can be functionally or physically distributed or integrated in any unit according to various loads, usage conditions, etc. Furthermore, each processing function performed by each device can be realized in whole or in any part by a CPU (Central Processing Unit) and a program analyzed and executed by the CPU, or can be realized as hardware by wired logic. Note that the program may be executed not only by the CPU but also by other processors such as a GPU.
[0054] Furthermore, among the processes described in this embodiment, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically by a known method. In addition, the information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed arbitrarily unless otherwise specified.
[0055] [program] In one embodiment, the learning device 10 can be implemented by installing a learning program that executes the above learning process as package software or online software on a desired computer. For example, the above learning program can be executed by an information processing device, causing the information processing device to function as the learning device 10. The information processing device here includes desktop and notebook personal computers. In addition, the information processing device also includes mobile communication terminals such as smartphones, mobile phones, and PHS (Personal Handyphone Systems), as well as slate terminals such as PDAs (Personal Digital Assistants).
[0056] The learning device 10 can also be implemented as a learning server device that provides a service related to the above learning process to a client, the client being a terminal device used by a user. For example, the learning server device is implemented as a server device that provides a learning service that receives learning data as input and outputs information on a trained model. In this case, the learning server device may be implemented as a web server or as a cloud that provides a service related to the above learning process by outsourcing.
[0057] 8 is a diagram showing an example of a computer that executes a learning program. The computer 1000 has, for example, a memory 1010 and a CPU 1020. The computer 1000 also has a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. Each of these components is connected by a bus 1080.
[0058] The memory 1010 includes a read only memory (ROM) 1011 and a random access memory (RAM) 1012. The ROM 1011 stores a boot program such as a basic input output system (BIOS). The hard disk drive interface 1030 is connected to a hard disk drive 1090. The disk drive interface 1040 is connected to a disk drive 1100. A removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1100. The serial port interface 1050 is connected to a mouse 1110 and a keyboard 1120, for example. The video adapter 1060 is connected to a display 1130, for example.
[0059] The hard disk drive 1090 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, a program that defines each process of the learning device 10 is implemented as a program module 1093 in which computer-executable code is written. The program module 1093 is stored, for example, in the hard disk drive 1090. For example, a program module 1093 for executing processes similar to those of the functional configuration of the learning device 10 is stored in the hard disk drive 1090. The hard disk drive 1090 may be replaced by an SSD (Solid State Drive).
[0060] Furthermore, setting data used in the processing of the above-described embodiment is stored as program data 1094, for example, in the memory 1010 or the hard disk drive 1090. Then, the CPU 1020 reads out the program module 1093 or the program data 1094 stored in the memory 1010 or the hard disk drive 1090 into the RAM 1012 as necessary, and executes the processing of the above-described embodiment.
[0061] Note that the program module 1093 and the program data 1094 are not limited to being stored in the hard disk drive 1090, but may be stored in, for example, a removable storage medium and read by the CPU 1020 via the disk drive 1100 or the like. Alternatively, the program module 1093 and the program data 1094 may be stored in another computer connected via a network (such as a local area network (LAN) or wide area network (WAN)). The program module 1093 and the program data 1094 may then be read by the CPU 1020 from the other computer via the network interface 1070. [Explanation of symbols]
[0062] 10 Learning Device 11 Input / output section 12 Storage section 121 Model Information 13 Control section 131 Generation part 132 Conversion unit 133 Calculation Department 134 Update Department
Claims
1. A conversion unit that converts first data into a first frequency component and converts second data generated by a generator constituting an adversarial learning model into a second frequency component; a calculation unit that calculates an error between a first value calculated based on a plurality of first frequency components obtained by converting each of a plurality of first data included in a first batch, and a second value calculated based on a plurality of second frequency components obtained by converting each of a plurality of second data included in a second batch; an update unit that updates parameters of the generator so as to reduce the error calculated by the calculation unit; A learning device comprising:
2. 2. The learning device according to claim 1, wherein the conversion unit converts the first data and the second data into frequency components using a differentiable function.
3. 3. The learning device according to claim 2, wherein the transform unit transforms the first data and the second data into frequency components by a discrete Fourier transform or a discrete cosine transform.
4. 2. The learning device according to claim 1, wherein the calculation unit calculates an error between the first value, which is a batch average of the first frequency components obtained by transforming each of the first data, and the second value, which is a batch average of the second frequency components obtained by transforming each of the second data.
5. the calculation unit calculates a loss function that increases as an error between the first value and the second value increases and that increases as a classification accuracy between the first data and the second data by a classifier constituting the adversarial learning model decreases; The learning device according to claim 1 , wherein the update unit updates parameters of the generator so as to optimize the loss function.
6. A learning method performed by a learning device, comprising: A conversion step of converting the first data into a first frequency component and converting the second data generated by a generator constituting an adversarial learning model into a second frequency component; a calculation step of calculating an error between a first value calculated based on a plurality of first frequency components obtained by converting each of a plurality of first data included in a first batch, and a second value calculated based on a plurality of second frequency components obtained by converting each of a plurality of second data included in a second batch; an updating step of updating parameters of the generator so as to reduce the error calculated by the calculating step; A learning method comprising:
7. A learning program for causing a computer to function as the learning device according to any one of claims 1 to 5.
Citation Information
Patent Citations
MRI imaging method and device based on conditional generative adversarial network
CN111612865A
Learning method, computer program, classifier, and generator
JP2020087103A
