Machine learning program, device, and method

By generating masks to ensure similarity in score matrices between modules, the pruning effect is enhanced, reducing model parameters and improving efficiency in multi-class classification.

JP7559942B2Active Publication Date: 2024-10-02FUJITSU LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023523763
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-05-25
Publication Date
2024-10-02
Estimated Expiration
2041-05-25

AI Technical Summary

Technical Problem

Existing machine learning models that combine pruned individual models for multi-class classification face weakened pruning effects due to variations in edge structures between modules.

Method used

Generate base and training target masks to modularize neural networks, ensuring similarity in score matrices between modules, thereby increasing parameter sharing and reducing variations.

Benefits of technology

Enhances the pruning effect by increasing parameter sharing between modules, leading to a more efficient reduction in the number of model parameters while maintaining classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007559942000003
    Figure 0007559942000003
  • Figure 0007559942000004
    Figure 0007559942000004
  • Figure 0007559942000005
    Figure 0007559942000005
Patent Text Reader

Abstract

This machine learning device generates an N-class classifier (22) by machine learning using training data, generates a base mask for generating a base module by machine learning using the N-class classifier (22) and training data associated with a correct label indicating one class, generates a mask for generating each of other modules such that each of other modules becomes similar to the base module, and stores the generated masks as a mask set (24). A classification device stores the masks of modules corresponding to a task and a union part thereof as a specific class classifier 42, and integrates classification results, which are obtained by inputting operation data into each module generated by applying each mask to the union part, to output a definitive classification result.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The disclosed technology relates to a machine learning program, a machine learning device, and a machine learning method. [Background technology]

[0002] Conventionally, there is a technology for generating a machine learning model that classifies into multiple classes by pruning multiple individual machine learning models that classify only some of the classes, and combining them to generate a machine learning model that classifies into specific multiple classes. For example, a technology has been proposed that uses a supermask to extract a subnetwork from a machine-learned neural network. In this technology, a score matrix corresponding to the edge weights of the neural network is prepared, and a supermask in which the top k% elements of the score matrix are set to 1 and the other elements are set to 0 is applied to the weights of the neural network, and forward processing of machine learning is performed. In addition, in this technology, during backward processing, the edge weights of the neural network are fixed, and machine learning is performed using the normal gradient method for each score in the score matrix. [Prior art documents] [Non-patent literature]

[0003] [Non-Patent Document 1] Vivek Ramanujan, Mitchell Wortsman, Aniruddha Kembhavi, Ali Farhadi, and Mohammad Rastegari, "What's Hidden in a Randomly Weighted Neural Network?", CVPR, 31 Mar 2020. Summary of the Invention [Problem to be solved by the invention]

[0004] As described above, by selecting and combining individual machine learning models corresponding to the tasks during operation from among the individual machine learning models generated by pruning, there is an effect that the number of parameters of the machine learning models can be reduced compared to the original machine learning model. However, depending on the structure of the individual machine learning models, the effect of pruning may be weakened in the machine learning model generated by combining them.

[0005] In one aspect, the disclosed technology prevents the effects of pruning from being diluted when a machine learning model is generated by combining individual machine learning models that classify only some of the classes generated by pruning from an original machine learning model. [Means for solving the problem]

[0006] In one aspect, the disclosed technology generates parameters related to a first pruning process based on parameters of a machine learning model that classifies into a plurality of classes and training data including a first class among the plurality of classes in a correct answer label. The parameters related to the first pruning process are parameters for generating a first machine learning model that classifies the first class by executing a first pruning process on the machine learning model. The disclosed technology also generates parameters related to a second pruning process based on parameters of the machine learning model, training data including a second class among the plurality of classes in a correct answer label, and a loss function including parameters related to the first pruning process. The parameters related to the second pruning process are parameters for generating a second machine learning model that classifies the second class by executing a second pruning process on the machine learning model. Effect of the Invention

[0007] As one aspect, it has the effect of preventing the effects of pruning from being diluted when a machine learning model is generated by combining individual machine learning models that classify only some of the classes generated by pruning from the original machine learning model. [Brief description of the drawings]

[0008] [Figure 1] FIG. 1 is a functional block diagram of a machine learning device. [Diagram 2] FIG. 1 illustrates an example of an N-class classifier. [Diagram 3] FIG. 1 is a diagram for explaining modularization of an N-class classifier. [Figure 4] FIG. 1 is a diagram for explaining modularization of an N-class classifier. [Diagram 5] FIG. 13 is a diagram for explaining generation of a base mask. [Figure 6] FIG. 13 is a diagram for explaining generation of a mask other than a base mask. [Figure 7] FIG. 2 is a functional block diagram of the classification device. [Figure 8] FIG. 2 is a diagram for explaining an example of processing of a machine learning device and a classification device. [Figure 9] FIG. 1 is a block diagram showing a schematic configuration of a computer that functions as a machine learning device. [Figure 10] FIG. 1 is a block diagram showing a schematic configuration of a computer functioning as a classification device. [Figure 11] 1 is a flowchart illustrating an example of a machine learning process. [Figure 12] 13 is a flowchart illustrating an example of a classification process. [Figure 13] 11A and 11B are diagrams for explaining an example of an experimental result of a parameter sharing ratio between modules in the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] Hereinafter, an example of an embodiment of the disclosed technology will be described with reference to the drawings. A machine learning system according to this embodiment includes a machine learning device and a classification device. The machine learning device generates a mask for modularizing an N-class classifier. The classifier uses the generated mask to generate a specific class classifier according to a task, and classifies operational data. Each of the machine learning device and the classification device will be described in detail below.

[0010] First, the machine learning device will be described. As shown in Fig. 1, the machine learning device 10 functionally includes an N-class classifier generation unit 12, a first mask generation unit 14, and a second mask generation unit 16. In addition, an N-class classifier 22 and a mask set 24 are stored in a predetermined storage area of ​​the machine learning device 10.

[0011] The N-class classifier generation unit 12 generates an N-class classifier 22, which is a classifier for classifying input data into one of N classes. For example, the N-class classifier 22 may be a neural network (NN) as shown in FIG. 2. In the example of FIG. 2, circles represent neurons, and neurons in each layer are connected by edges. The output layer (the portion indicated by the dashed line in FIG. 2) has N neurons corresponding to each class, and each neuron in the output layer outputs the probability that the input data will be classified into each class.

[0012] The N-class classifier generation unit 12 acquires the training data input to the machine learning device 10, and performs machine learning using the acquired training data to calculate edge weights, which are parameters of the N-class classifier 22. The training data is data in which data, such as image data, audio data, and sensor data, is associated with a correct answer label indicating the class to which the data belongs.

[0013] In this embodiment, a partial network capable of classifying only some classes is extracted as a module from the above-mentioned N-class classifier 22, and the modules are appropriately combined to generate a classifier capable of classifying any multi-class. The advantage of modularization is that the network becomes smaller, making risk verification easier, and the number of parameters of the classifier generated by combining modules can be reduced. The fewer the number of parameters of the classifier, the less the amount of calculation, and therefore the more practical it is as a classifier to be used during operation.

[0014] Here, the modularization of NN will be described. For example, as shown in the upper diagram of FIG. 3, it is assumed that the original NN classifies input data into one of three classes, namely, classes "cat", "dog", and "bird". The original NN includes a partial network that represents the class "cat", a partial network that represents the class "dog", and a partial network that represents the class "bird". The machine learning device extracts the partial network that represents the class "cat" as module A, the partial network that represents the class "dog" as module B, and the partial network that represents the class "bird" as module C. Then, as shown in the lower diagram of FIG. 3, when the task during operation is a task of classifying whether what the input data indicates is a cat or a dog, the machine learning device generates a classifier that combines module A and module B. Then, the machine learning device classifies the input data into the class "cat" or the class "dog" using the classifier that combines module A and module B. Similarly, if the task during operation is to classify whether input data indicates a cat or a bird, the machine learning device 10 generates a classifier that combines module A and module C, and classifies the input data into the class "cat" or the class "bird."

[0015] As a method for modularizing a NN, there is a method of applying a supermask, as shown in the above-mentioned Non-Patent Document 1. Modularization by this method will be described by taking as an example a case where the original NN is a 10-class classification NN corresponding to the 10 numbers of MNIST, which is an image data set of handwritten numbers. As shown in FIG. 4, when the original NN is pruned using "mask 0" generated by machine learning based on training data with a correct answer label "0", the remaining partial network becomes module 0. Module 0 is a single-class classifier that classifies whether the number indicated by the input image data is "0" or other (1 to 9). Similarly, when the original NN is pruned using "mask 1" generated by machine learning based on training data with a correct answer label "1", the remaining partial network becomes module 1. Module 1 is a single-class classifier that classifies whether the number indicated by the input image data is "1" or other (0, 2 to 9). By combining module 1 and module 2, a two-class classification classifier that classifies whether it is "0" or "1" is generated.

[0016] As described above, the effect of modularization by pruning the original NN is that the number of parameters of the classifier generated by combining modules can be reduced. However, there are cases where the edges included in the modules vary between the generated modules. In such a case, the number of edges shared between the modules is small, that is, the ratio of the same parameters shared between the modules is low, so the effect of modularization by pruning is weakened. In particular, when the number of edges included in the original NN is large, the variation of pruning increases, so the variation of the edges included in the modules increases between the modules generated by pruning. Therefore, in this embodiment, each module is generated so as to suppress the variation of the edges between the modules. Hereinafter, the first mask generation unit 14 and the second mask generation unit 16 that generate masks for generating modules will be described in detail.

[0017] The first mask generation unit 14 generates parameters related to a first pruning process based on parameters of a machine learning model that classifies into a plurality of classes and training data that includes a first class among the plurality of classes in a correct answer label. The parameters related to the first pruning process are parameters for generating a first machine learning model that classifies into the first class by executing the first pruning process on the machine learning model.

[0018] Specifically, as shown in Fig. 5, the first mask generation unit 14 prepares a score matrix whose elements are scores corresponding to the edges of the original NN. {i,j} is a score corresponding to the j-th edge of the i-th layer of the original NN. The initial value of the score matrix may be set randomly. The first mask generation unit 14 generates a mask in which the top k% elements in the score matrix are set to 1 in descending order of score, and the other elements are set to 0. The first mask generation unit 14 may also generate a mask in which elements whose scores are equal to or greater than a predetermined value are set to 1, and elements whose scores are less than the predetermined value are set to 0 in the score matrix. The first mask generation unit 14 executes forward processing of machine learning using a partial network including edges corresponding to elements whose generated mask value is 1 and neurons connected by the edges in the original NN. In the left diagram of FIG. 5, the parts of the original NN corresponding to elements whose mask value is 1 are represented by solid lines, and the parts corresponding to elements whose mask value is 0 are represented by dotted lines. More specifically, the first mask generation unit 14 inputs training data to the part of the original NN corresponding to the mask value of 1 and propagates it in the forward direction. At this time, the first mask generation unit 14 sets the correct answer label y of the training data to a value indicating a positive example for a specific class, and a value indicating a negative example for other classes. The "specific class" is any one of the multiple classes classified by the original NN, and may be any of the multiple classes. Then, the first mask generation unit 14 obtains the classification result y^ (in the formula described later, there is a "^ (hat)" above "y").

[0019] In addition, the first mask generation unit 14 performs backward processing of machine learning on each score of the score matrix, not on the edge weights of the NN. Specifically, the first mask generation unit 14 updates each score of the score matrix by the backpropagation method so that the classification result y^ approaches the correct label y. For example, the first mask generation unit 14 updates each score of the score matrix so as to minimize the loss function shown in the following formula (1).

[0020]

number

[0021] Here, CE(y, y^) is the cross entropy between y and y^. The first mask generation unit 14 repeats the forward process and the backward process until the machine learning end judgment is satisfied. As a result, in the score matrix, the score corresponding to an edge that is more suitable to be left as an edge of a module for classifying a specific class among the edges included in the original NN becomes a larger value. The first mask generation unit 14 uses a mask generated from the score matrix when the machine learning is completed as a mask for generating a module for classifying a specific class. Hereinafter, the mask generated by the first mask generation unit 14 is referred to as a "base mask", and the module generated by the base mask is referred to as a "base module". The first mask generation unit 14 adds the generated base mask to the mask set 24 and stores it, and transfers the score matrix corresponding to the base mask to the second mask generation unit 16.

[0022] The second mask generation unit 16 generates parameters related to the second pruning process based on parameters of the machine learning model, training data including a second class among the multiple classes in a correct answer label, and a loss function including parameters related to the first pruning process. The parameters related to the second pruning process are parameters for generating a second machine learning model that classifies the second class by performing a second pruning process on the machine learning model that classifies into multiple classes.

[0023] Specifically, the second mask generation unit 16 generates a mask for generating a module for classifying each class, similar to the first mask generation unit 14, by machine learning based on training data to which each correct answer label indicating a class other than a specific class is associated. Hereinafter, the mask generated by the second mask generation unit 16 is referred to as a "training target mask", and the module generated by the training target mask is referred to as a "training target module". During this machine learning, as shown in FIG. 6, the second mask generation unit 16 updates each score of the score matrix corresponding to the training target mask so that the score matrix corresponding to the training target mask is similar to the score matrix corresponding to the base mask. For example, the second mask generation unit 16 updates each score of the score matrix for each training target mask so as to minimize a loss function L as shown in the following formula (2).

[0024]

number

[0025] In addition, s {i,j} is the value of each element of the score matrix corresponding to the training target mask, s {i,j} * is the value of each element of the score matrix corresponding to the base mask, and λ is a hyperparameter. That is, the loss function shown in formula (2) is obtained by adding a regularization term in which the difference in the score matrix between modules is used as a penalty to the loss function shown in formula (1). This allows a training object mask for performing a pruning process similar to the base module to be generated, and a training object module similar to the base module to be generated. The second mask generation unit 16 adds the generated training object mask to the mask set 24 and stores it.

[0026] Next, the classification device will be described. As shown in Fig. 7, the classification device 30 functionally includes a specific class classifier generating unit 32 and a classification unit 34. In addition, a specific class classifier 42 is stored in a predetermined storage area of ​​the classification device 30.

[0027] The specific class classifier generation unit 32 receives task information related to a task during operation. The task information includes information specifying a module according to the task. The specific class classifier generation unit 32 acquires a mask corresponding to the specified module from the mask set 24 based on the received task information. The specific class classifier generation unit 32 also acquires an original NN that is the N-class classifier 22. The specific class classifier generation unit 32 extracts a union of parts corresponding to each of the masks acquired from the mask set 24 (hereinafter, referred to as a "union part") from the acquired original NN. By applying the acquired mask to the union part, a module corresponding to the mask is generated. The specific class classifier generation unit 32 stores the extracted union part and the acquired mask as a specific class classifier 42.

[0028] The classification unit 34 acquires operational data, inputs the operational data to the specific class classifier 42, and outputs the class to which the operational data belongs among the classes according to the task as the classification result. The operational data is similar to the training data except that the correct label is unknown. Specifically, the classification unit 34 applies each of the masks included in the specific class classifier 42 to the union part to generate each of the modules for classifying each of the classes according to the task. The classification unit 34 inputs the operational data to each module to obtain a classification result, and integrates each of the classification results to determine the final classification result. The classification unit 34 may determine the classification result output from each module, that is, the classification result output from the module showing the highest probability among the probabilities that the operational data belongs to the class corresponding to each module, as the final classification result. The classification unit 34 outputs the determined final classification result.

[0029] Here, referring to FIG. 8, an example of the processing of the machine learning device 10 and the classification device 30 will be described using an example task of modularizing a 10-class classification NN corresponding to the 10 digits from 0 to 9 in MNIST and classifying operational data into class "3" or class "5."

[0030] First, the N-class classifier generating unit 12 generates an N (N=10)-class classifier 22 by machine learning using training data. The first mask generating unit 14 generates a base mask by machine learning based on the training data associated with a correct answer label indicating one class and the N-class classifier 22. FIG. 8 shows an example in which a module 0 mask for generating a module 0 that is a single-class classifier that classifies whether a number indicated by input image data is 0 or not 0 based on training data associated with a correct answer label "0". The second mask generating unit 14 generates each of the module 1 mask to module 9 mask for generating each of the module 1 to module 9. At this time, the second mask generating unit 16 generates each of the module 1 mask to module 9 mask so that each of the score matrices corresponding to the module 1 mask to module 9 mask is similar to the score matrix corresponding to the base mask. As a result, 10 masks corresponding to the modules 0 to 9 are generated and stored as a mask set 24.

[0031] The specific class classifier generation unit 32 receives task information specifying the module 3 and the module 5, and acquires the module 3 mask and the module 5 mask from the mask set 24. The specific class classifier generation unit 32 extracts a union part of a part corresponding to the module 3 mask and a part corresponding to the module 5 mask from the N-class classifier 22, and stores it together with the module 3 mask and the module 5 mask as a specific class classifier 42. The specific class classifier generation unit 32 applies the module 3 mask to the union part to generate the module 3, and applies the module 5 mask to the union part to generate the module 5. The classification unit 34 acquires image data of handwritten digits as operation data, and inputs the operation data to the module 3 to obtain a classification result indicating the probability that the digit indicated by the operation data is 3. Similarly, the classification unit 34 inputs the operation data to the module 5 to obtain a classification result indicating the probability that the digit indicated by the operation data is 5. The classification unit 34 outputs the classification result with the higher probability as the final classification result. For example, if the classification result of module 3 is 90% and the classification result of module 5 is 10%, the classification unit 34 outputs a classification result indicating that the number indicated by the operational data is "3".

[0032] The machine learning device 10 may be realized by, for example, a computer 50 shown in FIG. 9. The computer 50 includes a CPU (Central Processing Unit) 51, a memory 52 as a temporary storage area, and a non-volatile storage unit 53. The computer 50 also includes an input / output device 54 such as an input unit and a display unit, and an R / W (Read / Write) unit 55 that controls reading and writing of data from and to a storage medium 59. The computer 50 also includes a communication I / F (Interface) 56 that is connected to a network such as the Internet. The CPU 51, the memory 52, the storage unit 53, the input / output device 54, the R / W unit 55, and the communication I / F 56 are connected to one another via a bus 57.

[0033] The storage unit 53 may be realized by a hard disk drive (HDD), a solid state drive (SSD), a flash memory, or the like. The storage unit 53 as a storage medium stores a machine learning program 60 for causing the computer 50 to function as the machine learning device 10. The machine learning program 60 has an N-class classifier generation process 62, a first mask generation process 64, and a second mask generation process 66. The storage unit 53 also has an information storage area 70 in which information constituting each of the N-class classifier 22 and the mask set 24 is stored.

[0034] The CPU 51 reads out the machine learning program 60 from the storage unit 53, expands it in the memory 52, and sequentially executes the processes of the machine learning program 60. The CPU 51 operates as the N-class classifier generation unit 12 shown in FIG. 1 by executing the N-class classifier generation process 62. The CPU 51 also operates as the first mask generation unit 14 shown in FIG. 1 by executing the first mask generation process 64. The CPU 51 also operates as the second mask generation unit 16 shown in FIG. 1 by executing the second mask generation process 66. The CPU 51 also reads out information from the information storage area 70, and expands each of the N-class classifier 22 and the mask set 24 in the memory 52. ​​As a result, the computer 50 that has executed the machine learning program 60 functions as the machine learning device 10. The CPU 51 that executes the program is hardware.

[0035] The classification device 30 may be realized by, for example, a computer 80 shown in Fig. 10. The computer 80 includes a CPU 81, a memory 82 as a temporary storage area, and a non-volatile storage unit 83. The computer 80 also includes an input / output device 84 such as an input unit and a display unit, an R / W unit 85 that controls reading and writing of data from and to a storage medium 89, and a communication I / F 86. The CPU 81, the memory 82, the storage unit 83, the input / output device 84, the R / W unit 85, and the communication I / F 86 are connected to one another via a bus 87.

[0036] The storage unit 83 may be realized by an HDD, an SSD, a flash memory, or the like. A classification program 90 for causing the computer 80 to function as the classification device 30 is stored in the storage unit 83 as a storage medium. The classification program 90 has a specific class classifier generation process 92 and a classification process 94. The storage unit 83 also has an information storage area 100 in which information constituting the specific class classifier 42 is stored.

[0037] The CPU 81 reads out the classification program 90 from the storage unit 83, loads it in the memory 82, and sequentially executes the processes of the classification program 90. The CPU 81 operates as the specific class classifier generation unit 32 shown in FIG. 7 by executing a specific class classifier generation process 92. The CPU 81 also operates as the classification unit 34 shown in FIG. 7 by executing a classification process 94. The CPU 81 also reads out information from the information storage area 100, and loads the specific class classifier 42 in the memory 82. As a result, the computer 80 that has executed the classification program 90 functions as the classification device 30. The CPU 81 that executes the program is hardware.

[0038] The functions realized by each of the machine learning program 60 and the classification program 90 can also be realized by, for example, a semiconductor integrated circuit, more specifically, an ASIC (Application Specific Integrated Circuit) or the like.

[0039] Next, the operation of the machine learning system according to the present embodiment will be described. When training data is input to the machine learning device 10 and an instruction is given to generate a mask for modularization, the machine learning device 10 executes the machine learning process shown in FIG. 11. When task information and operation data are input to the classification device 30 and an instruction is given to classify the operation data, the classification device 30 executes the classification process shown in FIG. 12. Each of the machine learning process and the classification process will be described below. Note that the machine learning process and the classification process are examples of the machine learning method of the disclosed technology.

[0040] First, the machine learning process will be described with reference to FIG. In step S10, the N-class classifier generation unit 12 acquires training data input to the machine learning device 10. Next, in step S12, the N-class classifier generation unit 12 generates the N-class classifier 22 by machine learning using the acquired training data.

[0041] Next, in step S14, the first mask generation unit 14 prepares a score matrix whose elements are scores corresponding to each edge of the N-class classifier 22. The first mask generation unit 14 also sets the correct answer label y of the acquired training data as a positive example for a specific class and as a negative example for the other classes. The first mask generation unit 14 then inputs the training data to a portion of the score matrix where a mask in which the top k% elements in descending order of score are set to 1 and the other elements are set to 0 is applied to the N-class classifier 22, and propagates the data forward to obtain a classification result y^. Furthermore, the first mask generation unit 14 updates each score of the score matrix by the backpropagation method so that the classification result y^ approaches the correct answer label y, and generates a base mask from the score matrix when the machine learning is completed.

[0042] Next, in step S16, similar to step S14, the second mask generation unit 16 generates a training object mask for generating each of the training object modules for classifying classes other than the specific class. At this time, the second mask generation unit 16 generates each of the training object masks so that the score matrix is ​​similar to the score matrix of the base mask. Next, in step S18, each of the first mask generation unit 14 and the second mask generation unit 16 stores the generated mask as a mask set 24, and the machine learning process ends.

[0043] Next, the classification process will be described with reference to FIG. In step S20, the specific class classifier generation unit 32 acquires task information including information specifying a module according to the task. Next, in step S22, the specific class classifier generation unit 32 acquires a mask corresponding to the module specified in the task information from the mask set 24. In addition, the specific class classifier generation unit 32 cuts out a union part of the parts corresponding to each of the acquired masks from the N-class classifier 22, and stores it as the specific class classifier 42 together with the acquired masks.

[0044] Next, in step S24, the classification unit 34 acquires the operation data input to the classification device 30. Next, in step S26, the classification unit 34 applies each of the masks included in the specific class classifier 42 to the union portion to generate each of the modules for classifying each of the classes according to the task. Then, the classification unit 34 inputs the operation data to each module to obtain a classification result, integrates each of the classification results, determines and outputs a final classification result. Then, the classification process ends.

[0045] As described above, according to the machine learning system of the present embodiment, the machine learning device generates a base mask to be used in pruning processing to generate a base module based on the N-class classifier and training data including a first class among the N classes in the correct answer label. The base mask is generated by binarizing a score matrix having scores corresponding to each edge of the N-class classifier as elements. In addition, the machine learning device generates a mask to be used in pruning processing to generate other modules based on the N-class classifier, training data including a second class among the N classes in the correct answer label, and a loss function including the value of the score matrix corresponding to the base mask. By applying the mask generated in this way to the N-class classifier to generate each module, the proportion of modules sharing the same parameters is increased. Therefore, it is possible to suppress the weakening of the effect of pruning, which can reduce the number of parameters of a classifier generated by combining modules.

[0046] With reference to FIG. 13, an example of an experimental result of the parameter sharing ratio between modules in this embodiment will be described. In this experiment, 10 modules for classifying each class from 0 to 9 were generated from a 10-class classifier (original NN) in the same way as the example of MNIST described in FIG. 8. Each module was generated by performing a branch pruning process so that the number of parameters (weights of each edge) was 5% of that of the original NN. Comparative Example 1 and Comparative Example 2 shown in FIG. 13 are methods in which the loss function used when updating the score matrix for mask creation does not include a regularization term with the difference in score matrix between modules as a penalty. Comparative Example 1 is a case in which the initial value of the score matrix is ​​not shared between modules, and Comparative Example 2 is a case in which it is shared. In addition, Method 1 and Method 2 are methods in which the loss function includes a regularization term with the difference in score matrix between modules as a penalty, as in the above embodiment. In Method 1, the hyperparameter λ for the regularization term was set to λ=1, and in Method 2, λ=10. In both Methods 1 and 2, the initial value of the score matrix was shared between modules.

[0047] In addition, in FIG. 13, "proportion of the number of parameters when combined with respect to the original NN" is the ratio of the number of parameters when two modules are combined with respect to the number of parameters of the original NN. In addition, this value is the average of all 45 combinations of two modules out of 10 modules. As described above, each module is generated so that the number of parameters is 5% of that of the original NN, so this value is 0.05 to 0.1, and the smaller this value, the more similar the two modules are. In addition, in FIG. 13, "proportion of shared parameters" is the ratio of the number of parameters shared by the two modules to be combined.

[0048] As described above, when modules are similar to each other, there is an effect that the number of parameters of the model when the modules are combined can be reduced. In order to obtain this effect, unlike the present method, it is also possible to share the initial value of the score matrix between modules. However, as shown in FIG. 13, when comparing Comparative Example 1 and Comparative Example 2, the ratio of shared parameters is somewhat improved by sharing the initial value of the score matrix between modules. In contrast, in the present method 1 and the present method 2, the ratio of shared parameters is greatly improved. That is, compared to Comparative Example 1 and Comparative Example 2, the present method 1 and the present method 2 have a higher effect of reducing the number of data of the model. In addition, when the influence of the regularization term included in the loss function is made larger as in the present method 2, the effect is more prominent.

[0049] In the above embodiment, an example of modularizing in units of one class has been described, but the present invention is not limited to this. For example, it is sufficient to modularize a partial network capable of classifying some of the classes that can be classified by the original machine learning model, such as generating a module for classifying two classes or a module for classifying three classes from a 10-class classifier.

[0050] Furthermore, in the above embodiment, the machine learning device and the classification device are implemented by separate computers. However, the machine learning device and the classification device may be implemented by a single computer.

[0051] In the above embodiment, the machine learning program and the classification program are pre-stored (installed) in the storage unit, but the present invention is not limited to this. The program according to the disclosed technology can also be provided in a form stored in a storage medium such as a CD-ROM, a DVD-ROM, or a USB memory. [Explanation of symbols]

[0052] 10 Machine Learning Device 12 N-class classifier generation unit 14 First mask generator 16 Second mask generator 22 N-class classifier 24 Mask Collection 30 Classifier 32 Specific class classifier generator 34 Classification Department 42 Specific Class Classifier 50, 80 Computer 51, 81 CPU 52, 82 memory 53, 83 Storage section 59, 89 Storage medium 60 Machine Learning Programs 90 Classification Program

Claims

1. generating parameters for a first pruning process for generating a first machine learning model that classifies the first class by performing a first pruning process on the machine learning model based on parameters of the machine learning model that classifies the first class and training data that includes a first class among the first class as a correct answer label; generating parameters related to a second pruning process for generating a second machine learning model that classifies the second class by performing a second pruning process on the machine learning model based on parameters of the machine learning model, training data that includes a second class among the multiple classes as a correct answer label, and a loss function including parameters related to the first pruning process; A machine learning program that causes a computer to execute processing.

2. The process of generating parameters related to the second pruning process includes minimizing the loss function including a term representing a difference between the classification result of the second class by the second machine learning model and the correct label, and a term representing a difference between parameters related to the first pruning process and parameters related to the second pruning process. The machine learning program according to claim 1 .

3. the machine learning model is a neural network; the parameter related to the first pruning process corresponds to each edge included in the machine learning model that classifies into the plurality of classes, and has a score that increases with an edge's suitability to be left as an edge of the first machine learning model; The parameter related to the second pruning process corresponds to each edge included in the machine learning model that classifies into the plurality of classes, and has a score that is larger as the edge has a higher suitability to be left as an edge of the second machine learning model.

3. The machine learning program according to claim 1 or 2.

4. generating a first mask indicating that edges included in the machine learning model for classifying into the plurality of classes are to be left in the first machine learning model, the first mask indicating that a top predetermined percentage of edges in descending order of the size of a parameter related to the corresponding first pruning process, or edges whose corresponding parameter related to the first pruning process is equal to or greater than a predetermined value; generating a second mask indicating that a top predetermined percentage of edges in descending order of the size of a parameter related to the second pruning process, or edges whose corresponding parameter related to the second pruning process is equal to or greater than a predetermined value, are to be left in the second machine learning model, among edges included in the machine learning model for classifying into the plurality of classes; The machine learning program according to claim 3, which causes the computer to execute a process.

5. generating a third machine learning model that classifies the classes corresponding to the one or more selected masks by applying each of the one or more selected masks to a portion of the machine learning model that classifies the classes corresponding to a union of the one or more selected masks from the first mask and the second mask; The machine learning program according to claim 4, which causes the computer to execute a process.

6. inputting data, the class of which is unknown, into the third machine learning model, and classifying the data into a class corresponding to the selected one or more masks; The machine learning program according to claim 5, which causes the computer to execute a process.

7. generating parameters for a first pruning process for generating a first machine learning model that classifies the first class by performing a first pruning process on the machine learning model based on parameters of the machine learning model that classifies the first class and training data that includes a first class among the first class as a correct answer label; generating parameters related to a second pruning process for generating a second machine learning model that classifies the second class by performing a second pruning process on the machine learning model based on parameters of the machine learning model, training data that includes a second class among the multiple classes as a correct answer label, and a loss function including parameters related to the first pruning process; A machine learning device comprising a control unit that executes processing.

8. generating parameters for a first pruning process for generating a first machine learning model that classifies the first class by performing a first pruning process on the machine learning model based on parameters of the machine learning model that classifies the first class and training data that includes a first class among the first class as a correct answer label; generating parameters related to a second pruning process for generating a second machine learning model that classifies the second class by performing a second pruning process on the machine learning model based on parameters of the machine learning model, training data that includes a second class among the multiple classes as a correct answer label, and a loss function including parameters related to the first pruning process; A machine learning method characterized in that processing is executed by a computer.

Citation Information

Patent Citations

  • Client device, information processing method, and program

    JP2020160764A

  • Compression of deep neural networks with proper use of mask

    US20180046915A1