Patent Publication Number: US-11657267-B2

Title: Neural network apparatus, vehicle control system, decomposition device, and program

Description:
RELATED APPLICATION 
     The present application claims priority to Japanese Patent Application No. 2016-143705, filed on Jul. 21, 2016, in Japan, the entire disclosure of which is hereby incorporated by reference herein. 
     TECHNICAL FIELD 
     The present technique relates to a neural network apparatus and a program inputting input information into an input layer of a neural network model and acquiring output information from an output layer, a vehicle control system including the neural network apparatus, and a decomposition device for building the neural network. 
     BACKGROUND ART 
     By processing input information with use of a neural network, the input information can be classified, and predetermined information can be detected from the input information.  FIG.  16    illustrates an example of a neural network classifying a four-dimensional input vector into three classes (identifying to which of the three classes the input vector belongs). As illustrated in  FIG.  16   , when a four-dimensional input vector (referred to as an input map as well) to be identified is input as an input layer a 0 , the input information passes through middle layers a l  to a 3  and is output as a three-dimensional output layer a 4 . 
     Between the input layer a 0  and the middle layer a 1 , a weight matrix (referred to as filters as well) W 1  and a bias vector b l  are defined, and the middle layer a 1  is derived by Formula (1) shown below.
 
[Equation 1]
 
 a   1   =f  ( W   1   T   a   0   +b   1 )   (1)
 
     In this equation, f(⋅) is an activating function, and the following function (ReLU) is used, for example. 
     
       
         
           
             
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     2 
                   
                   ] 
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     f 
                     ⁡ 
                     
                       ( 
                       z 
                       ) 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           0 
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               z 
                             
                             &lt; 
                             0 
                           
                         
                       
                       
                         
                           z 
                         
                         
                           otherwise 
                         
                       
                     
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
     In a similar manner, the middle layers a 2  and a 3  are derived by Formulae (2) and (3) shown below, and the output layer a 4  is derived by Formula (4) shown below.
 
[Equation 3]
 
 a   2   =f ( W   2   T   a   1   +b   2 )   (2)
 
 a   3   =f ( W   3   T   a   2   +b   3 )   (3)
 
 a   4 =softmax( W   4   T   a   3   +b   4 )   (4)
 
     In this manner, in each layer of the neural network, when an input vector from a previous layer is x (D I  dimension), and a weight matrix W (D I  rows and D O  columns) and a bias b (D O  dimension) are defined, an output vector (before applying the activating function) y (D O  dimension) to a subsequent layer is expressed as Formula (5) shown below.
 
[Equation 4]
 
x∈   D     I    
 
W∈   D     I     D     O    
 
b∈   D     O    
 
 y=W   T   x+b    (5)
 
     SUMMARY OF INVENTION 
     In the above neural network, it is known that increasing the number of layers (deepening the layer) causes information processing accuracy to be improved. However, when the number of layers is increased, processing cost also increases. Specifically, the memory amount required for operation of Formula (5) increases, and the processing time is extended. 
     For example, in a fully connected layer (hereinbelow referred to as “an FC layer”), in a case in which the weight matrix W is a single-precision real number (32 bits), the memory as much as 32 D I D O  bits is consumed. Also, in each layer, a product-sum operation of the single-precision real number is required D I D O  times, and this operation particularly requires processing time. Meanwhile, the FC layer is normally arranged at the end of the neural network. In a convolutional layer (hereinbelow referred to as “a CONV layer”), by appropriately cutting out an input map according to a sliding window and performing sorting, the CONV layer can be regarded as the FC layer. 
     The present technique is accomplished by taking such problems as mentioned above into consideration thereof, and an object thereof is to reduce the memory consumption amount and the operation amount in a neural network apparatus. 
     A neural network apparatus according to an aspect includes a storage unit ( 24 ) storing a neural network model, and an arithmetic unit ( 22 ) inputting input information into an input layer of the neural network model and outputting an output layer. A weight matrix (W) of at least one layer of the neural network model is constituted by a product (M w C w ) of an integer matrix serving as a weight basis matrix (M w ) and a real number matrix serving as a weight coefficient matrix (C w ). 
     A neural network apparatus according to an aspect is a neural network apparatus performing recognition with use of a neural network model, and logical operation is conducted as operation of at least one layer of the neural network model. 
     A neural network apparatus according to an aspect is a neural network apparatus performing recognition with use of a neural network model, and a binary or ternary matrix for use in operation of at least one layer of the neural network model is stored. 
     A vehicle control system according to an aspect includes the aforementioned neural network apparatus ( 20 ), an in-vehicle sensor ( 30 ) acquiring the input information, and a vehicle control apparatus ( 40 ) controlling a vehicle based on the output. 
     A decomposition device according to an aspect includes an acquisition unit ( 11 ) acquiring a neural network model, a weight decomposition unit ( 12 ) decomposing a weight matrix of at least one layer of the neural network model into a product (M w C w ) of an integer matrix serving as a weight basis matrix (M w ) and a real number matrix serving as a weight coefficient matrix (C w ), and an output unit (14) outputting the weight basis matrix (M w ) and the weight coefficient matrix (C w ). 
     A program according to an aspect is a program causing a computer to function as a neural network apparatus inputting input information into an input layer of a neural network model and acquiring output information from an output layer. A storage unit ( 24 ) of the computer has stored therein a weight basis matrix (M w ) of integers and a weight coefficient matrix (C w ) of real numbers acquired by decomposing a weight matrix (W) of at least one fully connected layer of the neural network model, an input coefficient vector (c x ) out of the input coefficient vector (c x ) and an input bias (b x ) acquired by learning for decomposing an input vector (x) into a sum of a product of an input basis matrix (M x ) of integers and the input coefficient vector (c x ) of real numbers and the input bias (b x ), and a lookup table (LUT) specifying a relationship between a value (x j ) of each of respective elements of the input vector and a value (m x   (j) ) of the input basis matrix for the value acquired based on the input coefficient vector (c x ) and the input bias (b x ) acquired by the learning. The program causes the computer to function as an arithmetic unit, in the at least one fully connected layer of the neural network model, using an output vector from a previous layer as the input vector (x) to derive a product of the input vector (x) and the weight matrix (W) with use of the weight basis matrix (M w ), the weight coefficient matrix (C w ) of real numbers, and the input coefficient vector (c x ) read from the storage unit ( 24 ) and the input basis matrix (M x ) corresponding to the input vector (x) acquired by looking up the lookup table (LUT) read from the storage unit ( 24 ). 
     A program according to an aspect is a program causing a computer to function as a neural network apparatus inputting input information into an input layer of a neural network model and acquiring output information from an output layer. A storage unit ( 24 ) of the computer has stored therein a weight basis matrix (M w ) of integers and a weight coefficient matrix (C w ) of real numbers acquired by decomposing a weight matrix (w) of at least one fully connected layer of the neural network model, an input coefficient vector (c x ) out of the input coefficient vector (c x ) and an input bias (b x ) acquired by learning for decomposing an input vector (x) into a sum of a product of an input basis matrix (M x ) of integers and the input coefficient vector (c x ) of real numbers and the input bias (b x ), and, for respective elements (x j ) of the input vector, all combinations (β) of rows of the input basis matrix corresponding to the respective elements (x j ) of the input vector and midpoints (mp i ) obtained when approximate candidates (p) of the respective elements (x j ) of the input vector acquired by the combination (β) are arranged according to size, acquired based on the input coefficient vector (c x ) and the input bias (b x ) acquired by the learning. The program causes the computer to function as an arithmetic unit ( 22 ), in the at least one fully connected layer of the neural network model, using an output vector from a previous layer as the input vector (x) to derive a product of the input vector and the weight matrix with use of the weight basis matrix (M w ), the weight coefficient matrix (C w ) of real numbers, and the input coefficient vector (c x ) read from the storage unit ( 24 ), and all the combinations (β) of the rows of the input basis matrix and the midpoints (mp i ). 
     A neural network apparatus according to an aspect includes a storage unit ( 24 ) storing a neural network model, and an arithmetic unit ( 22 ) inputting input information into an input layer of the neural network model and outputting an output layer. In at least one layer of the neural network model, the arithmetic unit ( 22 ) uses an output vector from a previous layer as an input vector (x) to decompose the input vector (x) into a sum of a product (M x c x ) of an integer matrix serving as an input basis matrix (M x ) and a real number vector serving as an input coefficient vector (c x ) and an input bias (b x ) (x=M x c x +b x 1) and derives a product of the input vector (M x c x +b x 1) decomposed and a weight matrix (W) (W T x=W(M x c x +b x 1)) 
     As described below, the present technique has other aspects. Accordingly, disclosure of the present technique is intended to provide part of the present technique and is not intended to limit the scope of the invention described and claimed herein. 
    
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         FIG.  1    describes calculation of an integer-decomposed product of an input vector and a weight matrix according to an embodiment. 
         FIG.  2    illustrates a configuration of a decomposition device according to the embodiment. 
         FIG.  3    illustrates processing of decomposing the weight matrix into a basis matrix and a coefficient matrix according to the embodiment. 
         FIG.  4    is a flowchart of an algorithm conducted in a decomposition method according to the embodiment. 
         FIG.  5    illustrates a modification example of the processing of decomposing the weight matrix into the basis matrix and the coefficient matrix according to the embodiment. 
         FIG.  6    illustrates a modification example of processing of decomposing the input vector into a product of the basis matrix and a coefficient vector and a bias according to the embodiment. 
         FIG.  7    describes update of the basis matrix of the input vector by means of full search according to the embodiment. 
         FIG.  8    describes optimization of the basis matrix of the input vector according to the embodiment. 
         FIG.  9    describes the optimization of the basis matrix of the input vector according to the embodiment. 
         FIG.  10    describes the optimization of the basis matrix of the input vector according to the embodiment. 
         FIG.  11    illustrates a configuration of a neural network apparatus according to the embodiment. 
         FIG.  12    illustrates processing of an arithmetic unit in an FC layer of a neural network model according to the embodiment. 
         FIG.  13    illustrates a relationship between an input map and an output map of a CONV layer according to the embodiment. 
         FIG.  14    illustrates the relationship between the input map and the output map of the CONV layer according to the embodiment. 
         FIG.  15    illustrates decomposition of the weight matrix of the CONV layer according to the embodiment. 
         FIG.  16    illustrates an example of a neural network classifying a four-dimensional input vector into three classes. 
         FIG.  17    describes optimization of the basis matrix of the input vector according to a modification example of the embodiment. 
         FIG.  18    describes the optimization of the basis matrix of the input vector according to the modification example of the embodiment. 
         FIG.  19    illustrates a number line on which prototypes and midpoints are plotted according to the modification example of the embodiment. 
         FIG.  20    illustrates the number line on which the prototypes and the midpoints are plotted according to the modification example of the embodiment. 
         FIG.  21    describes assignment of β according to the modification example of the embodiment. 
         FIG.  22    illustrates a configuration of the neural network apparatus according to a modification example of the embodiment. 
         FIG.  23    describes a binary tree search according to the modification example of the embodiment. 
         FIG.  24    describes the binary tree search according to the modification example of the embodiment. 
         FIG.  25    describes the binary tree search according to the modification example of the embodiment. 
         FIG.  26    describes the binary tree search according to the modification example of the embodiment. 
         FIG.  27    describes a binary partition tree according to the modification example of the embodiment. 
         FIG.  28    illustrates a configuration of a vehicle control system according to the embodiment. 
     
    
    
     DESCRIPTION OF EMBODIMENTS 
     Hereinbelow, embodiments will be described with reference to the drawings. It is to be noted that the embodiments described below are provided as examples of a case of carrying out the present technique and are not intended to limit the technique to the below-mentioned specific configurations. In carrying out the present technique, a specific configuration in accordance with an embodiment may arbitrarily be employed. 
     A neural network apparatus according to an aspect includes a storage unit ( 24 ) storing a neural network model, and an arithmetic unit ( 22 ) inputting input information into an input layer of the neural network model and outputting an output layer. A weight matrix (W) of at least one layer of the neural network model is constituted by a product (M w C w ) of an integer matrix serving as a weight basis matrix (M w ) and a real number matrix serving as a weight coefficient matrix (C w ). 
     In this configuration, since the weight matrix (W) of a fully connected layer in the neural network is constituted by the product (M w C w ) of the weight basis matrix (M w ) of integers and the weight coefficient matrix (C w ) of real numbers, the memory consumption amount can be reduced in operation in the layer. 
     In the above neural network apparatus, in the at least one layer, the arithmetic unit ( 22 ) may use an output vector from a previous layer as an input vector (x) to decompose the input vector (x) into a sum of a product (M w C w ) of an integer matrix serving as an input basis matrix (M x ) and a real number vector serving as an input coefficient vector (c x ) and an input bias (b x ) (x=M x c x +b x 1) and derive a product of the input vector (x) and the weight matrix (W) (W T x=(M w C w ) T  (M x c x +b x 1)). 
     In this configuration, since, in the operation of deriving the product of the input vector (x) and the weight matrix (W), the product operation between the input basis matrix (M x ) and the weight basis matrix (M w ) can be product operation between integer matrices, the memory consumption amount can be reduced, and the operation amount can be reduced. 
     In the above neural network apparatus, the weight basis matrix (M w ) may be a binary matrix, and the input basis matrix (M x ) may be a binary matrix, and the arithmetic unit ( 22 ) may conduct product operation (M w M x ) between the weight basis matrix (M w ) and the input basis matrix (M x ) with use of logical operation and bit count. 
     In this configuration, since the product operation between the input basis matrix (M x ) and the weight basis matrix (M w ) in the operation of deriving the product of the input vector (x) and the weight matrix (W) can be product operation between binary matrices and can be conducted with use of the logical operation and the bit count, the operation of deriving the product of the input vector (x) and the weight matrix (W) can be performed at high speed. 
     In the above neural network apparatus, the weight basis matrix (M w ) may be a ternary matrix, and the input basis matrix (M x ) may be a binary matrix, and the arithmetic unit ( 22 ) may conduct product operation (M w M x ) between the weight basis matrix (M w ) and the input basis matrix (M x ) with use of logical operation and bit count. 
     In this configuration, since the product operation between the input basis matrix (M x ) and the weight basis matrix (M w ) in the operation of deriving the product of the input vector (x) and the weight matrix (W) can be product operation between a binary matrix and a ternary matrix and can be conducted with use of the logical operation and the bit count, the operation of deriving the product of the input vector (x) and the weight matrix (W) can be performed at high speed. 
     In the above neural network apparatus, the arithmetic unit ( 22 ) may decompose the input vector (x) by optimizing the input basis matrix (M x ) for the input vector (x). 
     In this configuration, the input coefficient vector (c x ) and the input bias (b x ) do not need to be derived each time the input vector (x) for the fully connected layer is acquired, and the operation amount of the fully connected layer can be reduced. 
     In the above neural network apparatus, for respective elements (x j ) of the input vector (x), the arithmetic unit ( 22 ) may optimize the input basis matrix (M x ) by selecting a nearest candidate from sums (βc x +b x ) of products between all combinations (β) of rows of the input basis matrix corresponding to the respective elements of the input vector and the input coefficient vector (c x ) learned and the input bias (b x ) learned. 
     In this configuration, the input basis matrix (M x ) can be optimized by means of a one-dimensional nearest neighbor search. 
     In the neural network apparatus, the storage unit ( 24 ) may store a lookup table (LUT) specifying a relationship between a value of each of the respective elements (x) of the input vector and a value (m x   (j) ) of the input basis matrix in the nearest candidate for the value, and the arithmetic unit ( 22 ) may optimize the input basis matrix (M x ) for the input vector (x) by looking up the lookup table (LUT). 
     In this configuration, the optimization of the input basis matrix (M x ) for the input vector (x) can be performed at high speed. 
     In the above neural network apparatus, the storage unit ( 24 ) may store, for the respective elements (x i ) of the input vector, all the combinations (β) of the rows of the input basis matrix corresponding to the respective elements (x i ) of the input vector and midpoints (mp i ) obtained when approximate candidates (p) of the respective elements of the input vector acquired by combinations (β) are arranged according to size, and the arithmetic unit ( 22 ) may determine, for the respective elements (x i ) of the input vector, the rows (m x   (j) ) of the input basis matrix corresponding to the respective elements (x i ) of the input vector by means of a binary tree search method using the midpoints (mp i ) to optimize the input basis matrix (M x ). 
     In this configuration, the optimization of the input basis matrix (M x ) for the input vector (x) can be performed at high speed, and the memory capacity required for operation in the arithmetic unit ( 22 ) can be reduced. 
     In the above neural network apparatus, the neural network model may be a convolutional neural network model, in the convolutional neural network model, a plurality of filters of a convolutional layer may be collected and be regarded as the weight matrix (W), the convolutional layer may be regarded as a fully connected layer, and the weight matrix (W) may be constituted by a product of a weight basis matrix (M w ) of integers and a weight coefficient matrix (C w ) of real numbers, and the arithmetic unit ( 22 ) may derive a product of the input vector (x) decomposed and the weight matrix (W) decomposed in the convolutional layer regarded as the fully connected layer. 
     In this configuration, in the operation of the convolutional layer in the convolutional neural network model, the memory consumption amount can be reduced, and the operation amount can be reduced. 
     A neural network apparatus according to an aspect is a neural network apparatus performing recognition with use of a neural network model, and logical operation is conducted as operation of at least one layer of the neural network model. 
     In this configuration, the operation of the neural network model can be performed at high speed by means of the logical operation. 
     A neural network apparatus according to an aspect is a neural network apparatus performing recognition with use of a neural network model, and a binary or ternary matrix for use in operation of at least one layer of the neural network model is stored. 
     In this configuration, the operation of the neural network model can be performed at high speed by the binary or ternary matrix. 
     A vehicle control system according to an aspect includes the aforementioned neural network apparatus ( 20 ), an in-vehicle sensor ( 30 ) acquiring the input information, and a vehicle control apparatus ( 40 ) controlling a vehicle based on the output. 
     In this configuration, the vehicle can be controlled based on recognition by means of the neural network model. 
     A decomposition device according to an aspect includes an acquisition unit ( 11 ) acquiring a neural network model, a weight decomposition unit ( 12 ) decomposing a weight matrix of at least one layer of the neural network model into a product (M w C w ) of an integer matrix serving as a weight basis matrix (M w ) and a real number matrix serving as a weight coefficient matrix (C w ), and an output unit ( 14 ) outputting the weight basis matrix (M w ) and the weight coefficient matrix (C w ). 
     In this configuration, the weight basis matrix (M w ) and the weight coefficient matrix (C w ) for building the above neural network apparatus can be acquired. 
     The above decomposition device may further include a before-input decomposition unit ( 13 ) learning an input coefficient vector (c x ) and an input bias (b x ) for decomposing an input vector (x) into a sum of a product of an integer matrix serving as an input basis matrix (M x ) and a real number vector serving as an input coefficient vector (c x ) and the input bias (b x ) (x=M x c x +b x 1), and the output unit ( 14 ) may output the input coefficient vector (c x ) acquired by the learning. 
     In this configuration, the coefficient vector (c x ) and the input bias (b x ) for decomposing the input vector (x) can be acquired by learning beforehand. 
     In the above decomposition device, the before-input decomposition unit ( 13 ) may generate a lookup table (LUT) for optimizing the input basis matrix (M x ) for the input vector (x), and the output unit ( 14 ) may output the lookup table (LUT). 
     In this configuration, the lookup table (LUT) for decomposing the input vector (x) at high speed can be acquired beforehand. 
     A program according to an aspect is a program causing a computer to function as a neural network apparatus inputting input information into an input layer of a neural network model and acquiring output information from an output layer. A storage unit ( 24 ) of the computer has stored therein a weight basis matrix (M w ) of integers and a weight coefficient matrix (C w ) of real numbers acquired by decomposing a weight matrix (W) of at least one fully connected layer of the neural network model, an input coefficient vector (c x ) out of the input coefficient vector (c x ) and an input bias (b x ) acquired by learning for decomposing an input vector (x) into a sum of a product of an input basis matrix (M x ) of integers and the input coefficient vector (c x ) of real numbers and the input bias (b x ), and a lookup table (LUT) specifying a relationship between a value (x j ) of each of respective elements of the input vector and a value (m x   (j) ) of the input basis matrix for the value acquired based on the input coefficient vector (c x ) and the input bias (b x ) acquired by the learning. The program causes the computer to function as an arithmetic unit, in the at least one fully connected layer of the neural network model, using an output vector from a previous layer as the input vector (x) to derive a product of the input vector (x) and the weight matrix (W) with use of the weight basis matrix (M w ), the weight coefficient matrix (C w ) of real numbers, and the input coefficient vector (c x ) read from the storage unit ( 24 ) and the input basis matrix (M x ) corresponding to the input vector (x) acquired by looking up the lookup table (LUT) read from the storage unit ( 24 ). 
     In this configuration, the weight matrix (W) of the fully connected layer in the neural network is constituted by the product (M w C w ) of the weight basis matrix (M w ) of integers and the weight coefficient matrix (C w ) of real numbers, and in the operation of deriving the product of the input vector (x) and the weight matrix (W), the product operation between the input basis matrix (M x ) and the weight basis matrix (M w ) can be product operation between integer matrices. Accordingly, the memory consumption amount can be reduced, and the operation amount can be reduced. Since the input basis matrix (M x ) is optimized for the input vector (x) by looking up the lookup table, the operation of deriving the product of the input vector (x) and the weight matrix (W) can be performed at high speed. 
     A program according to an aspect is a program causing a computer to function as a neural network apparatus inputting input information into an input layer of a neural network model and acquiring output information from an output layer. A storage unit ( 24 ) of the computer has stored therein a weight basis matrix (M w ) of integers and a weight coefficient matrix (C w ) of real numbers acquired by decomposing a weight matrix (W) of at least one fully connected layer of the neural network model, an input coefficient vector (c x ) out of the input coefficient vector (c x ) and an input bias (b x ) acquired by learning for decomposing an input vector (x) into a sum of a product of an input basis matrix (M x ) of integers and the input coefficient vector (c x ) of real numbers and the input bias (b x ), and, for respective elements (x j ) of the input vector, all combinations (β) of rows of the input basis matrix corresponding to the respective elements (x j ) of the input vector and midpoints (mp i ) obtained when approximate candidates (p) of the respective elements (x j ) of the input vector acquired by combinations (β) are arranged according to size, acquired based on the input coefficient vector (c x ) and the input bias (b x ) acquired by the learning. The program causes the computer to function as an arithmetic unit ( 22 ), in the at least one fully connected layer of the neural network model, using an output vector from a previous layer as the input vector (x) to derive a product of the input vector and the weight matrix with use of the weight basis matrix (M w ), the weight coefficient matrix (C w ) of real numbers, and the input coefficient vector (c x ) read from the storage unit ( 24 ), and all the combinations (β) of the rows of the input basis matrix and the midpoints (mp i ). 
     In this configuration, the optimization of the input basis matrix (M x ) for the input vector (x) can be performed at high speed, and the memory capacity required for operation in the arithmetic unit ( 22 ) can be reduced. 
     A neural network apparatus according to an aspect includes a storage unit ( 24 ) storing a neural network model, and an arithmetic unit ( 22 ) inputting input information into an input layer of the neural network model and outputting an output layer. In at least one layer of the neural network model, the arithmetic unit ( 22 ) uses an output vector from a previous layer as an input vector (x) to decompose the input vector (x) into a sum of a product (M x c x ) of an integer matrix serving as an input basis matrix (M x ) and a real number vector serving as an input coefficient vector (c x ) and an input bias (b x ) (x=M x c x +b x 1) and derives a product of the input vector (M x c x +b x 1) decomposed and the weight matrix (W) (W T x=W(M x c x +b x 1)). 
     In this configuration, in a case in which the weight matrix (W) is constituted by binary or ternary elements, in the operation of deriving the product of the input vector (x) and the weight matrix (W), the product operation between the input basis matrix (M x ) and the weight matrix (W) can be product operation between an integer matrix and a binary or ternary matrix, and the operation amount can thus be reduced. 
     Hereinbelow, embodiments will be described with reference to the drawings. In the present embodiment, a decomposition device  10  for building a memory-saving and high-speed neural network model and a neural network apparatus  20  acquiring output information from input information with use of the neural network model will be described. First, basic ideas in the present embodiment will be described. As described above, in an FC layer of the neural network, a process of calculating a product W T x of a weight matrix (filters) W and an input vector (input map) x is included. By decomposing the weight matrix W into a basis matrix of integers and a coefficient matrix of real numbers (integer decomposition) and decomposing the input vector x into a basis matrix of integers and a coefficient vector of real numbers (integer decomposition), the memory consumption amount can be reduced, the operation amount can be reduced, and the processing time can be shortened. 
       FIG.  1    describes calculation of the integer-decomposed product W T x. Note that a bias b is omitted in  FIG.  1   . Also, a basis number k w  is determined depending on the degree of the weight matrix W and is about ⅛ to ¼ of the weight matrix W. The basis number k x  is about 2 to 4, for example. The product W T x, including the bias b, can be expressed as Formula (6) shown below. 
     
       
         
           
             
               
                 
                   
                       
                   
                   ⁢ 
                   
                     [ 
                     
                       Equation 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       5 
                     
                     ] 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       
                         
                           W 
                           T 
                         
                         ⁢ 
                         x 
                       
                       + 
                       b 
                     
                     ≈ 
                     
                       
                         
                           
                             ( 
                             
                               
                                 M 
                                 w 
                               
                               ⁢ 
                               
                                 C 
                                 w 
                               
                             
                             ) 
                           
                           T 
                         
                         ⁢ 
                         
                           ( 
                           
                             
                               
                                 M 
                                 x 
                               
                               ⁢ 
                               
                                 c 
                                 x 
                               
                             
                             + 
                             
                               
                                 b 
                                 x 
                               
                               ⁢ 
                               1 
                             
                           
                           ) 
                         
                       
                       + 
                       b 
                     
                   
                   = 
                   
                     
                       
                         C 
                         w 
                         T 
                       
                       ⁢ 
                       
                         M 
                         w 
                         T 
                       
                       ⁢ 
                       
                         M 
                         x 
                       
                       ⁢ 
                       
                         c 
                         x 
                       
                     
                     + 
                     
                       
                         b 
                         x 
                       
                       ⁢ 
                       
                         C 
                         w 
                         T 
                       
                       ⁢ 
                       
                         M 
                         w 
                         T 
                       
                       ⁢ 
                       1 
                     
                     + 
                     b 
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
     A basis matrix M w   T  obtained by decomposing the weight matrix W is a binary or ternary matrix, and a basis matrix M x  obtained by decomposing the input vector x is a binary matrix. Note that the basis matrix M x  may be a ternary matrix as in a below example. “M w   T M x ” in the first term of the right-hand side of Formula (6) is a product of a binary or ternary matrix and a binary or ternary matrix and can be calculated with use of logical operation (AND, XOR) and bit count. Also, a sum of a second term and a third term of the right-hand side can be calculated beforehand as described below. Accordingly, due to the decomposition in  FIG.  1    and Formula (6), most of the operation can be covered by logical operation. 
       FIG.  2    illustrates a configuration of a decomposition device for building the deep neural network according to the present embodiment. As illustrated in FIG.  2 , the decomposition device  10  includes a data acquisition unit  11 , a weight decomposition unit  12 , a before-input decomposition unit  13 , and a decomposition result output unit  14 . The data acquisition unit  11  acquires component information of the neural network model according to the present embodiment (including the weight (filters) W and the bias b of each layer) and the input vector for learning. 
     The weight decomposition unit  12  decomposes the weight matrix W into a product of a coefficient matrix C w  of real numbers and a binary or ternary basis matrix M w . The before-input decomposition unit  13  derives by learning a product of a coefficient vector c x  and a bias b x  for decomposing an input vector x into a sum of the product of a binary or ternary basis matrix M x  and the coefficient vector c x  of real numbers and the bias b x , and generates a lookup table LUT for deriving the basis matrix M x  from the input vector x. The decomposition result output unit  14  uses the product of the coefficient matrix C w  and the binary or ternary basis matrix M w  acquired in the weight decomposition unit  12  and the lookup table LUT acquired in the before-input decomposition unit  13  to rebuild the neural network model and outputs the model to the neural network apparatus  20  to be described below. Hereinbelow, the respective functions will be described in detail. 
     (Decomposition of Weight Matrix) 
     The weight decomposition unit  12  decomposes the weight matrix W into the product of the coefficient matrix C w  of real numbers and the basis matrix M w  of integers.  FIG.  3    illustrates processing of decomposing the weight matrix W into the basis matrix M w  whose basis number is k w  and the coefficient matrix C w . In the present embodiment, the weight decomposition unit  12  decomposes the weight matrix W into the binary or ternary basis matrix M w  and the coefficient matrix C w  of real numbers. Hereinbelow, first to fourth methods for decomposing the weight matrix W into the binary or ternary basis matrix M w  and the coefficient matrix C w  of real numbers in the weight decomposition unit  12  according to the present embodiment will be described. 
     (First Decomposition Method) 
     As a first decomposition method, a data-independent decomposition method will be described. In the first decomposition method, the weight decomposition unit  12  conducts decomposition by solving a cost function g 1  expressing a decomposition error in the below formula.
 
[Equation 6]
 
 g   1 ( M   w   , C   w )=∥ W−M   w   C   w ∥ F   2    (7)
 
     In the formula, the basis matrix M w  is a binary matrix, and ME∈{−1, 1} D0×kw  is established. 
     Specifically, the weight decomposition unit  12  solves the above cost function g 1  in the following procedure. 
     (1) Randomly initialize the basis matrix M w  and the coefficient matrix C w . 
     (2) Fix the elements of the basis matrix M w , and optimize the elements of the coefficient matrix C w  by means of the least-square method. Update the elements of the coefficient matrix C w  so that the cost function g 1  may be minimum. 
     (3) Fix the elements of the coefficient matrix C w , and update the elements of the basis matrix M w  by means of full search so that the cost function g 1  may be minimum. 
     (4) Repeat steps (2) and (3) until the results converge. For example, the convergence is determined when the cost function g 1  satisfies a predetermined convergence condition (for example, the reduction amount reaches a predetermined value or lower). 
     (5) Retain solutions obtained by steps (1) to (4) as candidates. 
     (6) Repeat steps (1) to (5), and adopt as final results the candidate basis matrix M w  and the candidate coefficient matrix C w  that can minimize the cost function g 1 . Meanwhile, steps (1) to (5) may not be repeated. However, repeating the steps several times can avoid a problem dependent on an initial value. 
     Next, processing of updating the basis matrix M w  in step (3) will be described. An element of the jth row vector in the basis matrix M w  depends only on the jth element of the weight matrix W. Thus, since a value of each row vector in the basis matrix M w  can be optimized independently from the other rows, exhaustive search (full search) can be performed per row in the basis matrix M w . The binary decomposition according to the present embodiment provides the jth row vector in the basis matrix M w  only in 2 kw  forms (ternary decomposition in another case provides the jth row vector only in 3 kw  forms). Accordingly, all of the elements are exhaustively checked, and a row vector that minimizes the cost function g 1  is adopted. This method is applied to all of the row vectors in the basis matrix M to update the elements of the basis matrix M. 
     (Second Decomposition Method) 
     As a second decomposition method, a data-independent decomposition method making the coefficient matrix C w  sparse will be described. In the second decomposition method, the weight decomposition unit  12  conducts decomposition by solving a cost function g 2  expressing a decomposition error in the below formula.
 
[Equation 7]
 
 g   2 ( M, C )=∥ W−M   w   C   w ∥ F   2   +λ|C   w | 1   (8)
 
     In the formula, the basis matrix M is a binary matrix, and M∈{−1, 1} D0×k  is established. Also, |C w | 1  is L1 norm of the elements of the coefficient matrix C w , and λ is a coefficient thereof. 
     The weight decomposition unit  12  solves the above cost function g 2  in the following procedure. 
     (1) Randomly initialize the basis matrix M w  and the coefficient matrix C w . 
     (2) Fix the elements of the basis matrix M w , and optimize the elements of the coefficient matrix C w  by means of the proximal gradient method. 
     (3) Fix the elements of the coefficient matrix C w , and update the elements of the basis matrix M by means of full search so that the cost function g 2  may be minimum. 
     (4) Repeat steps (2) and (3) until the results converge. For example, the convergence is determined when the cost function g 2  satisfies a predetermined convergence condition (for example, the reduction amount reaches a predetermined value or lower). 
     (5) Retain solutions obtained by steps (1) to (4) as candidates. 
     (6) Repeat steps (1) to (5), and adopt as final results the candidate basis matrix M w  and the candidate coefficient matrix C w  that can minimize the cost function g 2 . Meanwhile, steps (1) to (5) may not be repeated. However, repeating the steps several times can avoid a problem dependent on an initial value. 
     According to the second decomposition method, the coefficient matrix C w  can be sparse. By making the coefficient matrix C w  sparse, in calculation of the product C w   T M w   T M x  in Formula 6, calculation of portions of the coefficient matrix C w  related to zero elements can be omitted, and inner product calculation can be performed at higher speed. 
     (Third Decomposition Method) 
     Next, a third decomposition method will be described. In the first decomposition method, the decomposition error
 
∥W−M w C w ∥ F   2    [Equation 8]
 
is defined as the cost function g l  and is minimized.
 
     However, the goal is to approximate the product W T x of the input vector x and the weight matrix W after the weight matrix W is approximated to the product of the basis matrix M w  and the coefficient matrix C w . 
     In the third decomposition method, S sample input vectors x are previously collected into X∈R D0×s . The decomposition error is defined as
 
|W T X−(M w C w ) T X∥ F   2    [Equation 9]
 
and is minimized. In the third decomposition method, the weight decomposition unit  12  conducts decomposition by solving a cost function g 3  in the below formula.
 
[Equation 10]
 
 g   3 ( M, C )=∥ W   T   X −( M   w   C   w ) T   X∥   F   2    (9)
 
     According to this cost function g 3 , the weight matrix W is decomposed in accordance with the actual data distribution, and approximation accuracy at the time of decomposition is thus improved. 
     This approximation decomposition can be performed by sequentially deriving basis vectors m m   (j)  constituting the basis matrix M w . The procedure of the third decomposition method is as follows. 
     (1) Derive the basis matrix M w  and the coefficient matrix C w  in the first or second decomposition method to set these values as initial values. 
     (2) Fix the elements of the basis matrix M w , and optimize the elements of the coefficient matrix C w  by means of the least-square method. 
     (3) Fix the elements of the coefficient matrix C w , and optimize the elements of the basis matrix M w  to update the elements of the basis matrix M w . Processing of updating the basis matrix M w  will be described below. 
     (4) Repeat steps (2) and (3) until the results converge, and retain the basis matrix M w  and the coefficient matrix C w  that minimize the cost function g 3  as candidates. 
     (5) Repeat steps (1) to (6), and adopt as final results the basis matrix M w  and the coefficient matrix C w  that minimize the cost function g 3 . Meanwhile, in step (1), since the basis matrix M w  and the coefficient matrix C w  are optimized again in the first or second decomposition method, the initial values are changed. Also, step (5) may not be repeated. However, repeating the step several times can avoid a problem dependent on an initial value. 
     Next, processing of updating the basis matrix M w  in step (3) will be described. In a case of data-dependent decomposition, a value of each row vector in the basis matrix M w  is not independent from the other rows but is dependent. Since the elements of the basis matrix M w  are binary or ternary values or discrete values, the combinatorial optimization is applicable to optimization of the basis matrix M w . Hence, for optimization of the basis matrix M w , algorithms such as Greedy algorithm, Tabu search, and Simulated annealing can be used. Since good initial values are obtained in step (1), these algorithms can also successfully minimize the decomposition error. 
     For example, in a case of using the Greedy algorithm, the basis matrix M w  is optimized in the following steps. 
     (3-1) Randomly select T elements of the basis matrix M w . 
     (3-2) Try combinations in 2 T  forms (3 T  forms in a case of below-mentioned ternary decomposition), and adopt a combination that minimizes the cost function g 3 . 
     (3-3) Repeat steps (3-1) and (3-2) until the results converge. 
     (Fourth Decomposition Method) 
     A fourth decomposition method is a combination of the second and third decomposition methods. Specifically, decomposition is performed by solving a cost function g 4  in the below formula.
 
[Equation 11]
 
 g   4 ( M, C )=∥ W   T   X −( M   w   C   w ) T   X∥   F   2   +λ|C   w | 1    (10)
 
     According to this cost function g 4 , the weight matrix W is decomposed in accordance with the actual data distribution. Thus, approximation accuracy at the time of decomposition is improved, and the coefficient matrix C w  can be sparse. That is, advantages of the second and third decomposition methods can be obtained. The specific decomposition procedure is similar to that of the third decomposition method. 
     In the decomposition according to the second embodiment, the weight matrix W is collectively decomposed. As the basis number k increases, decomposition will be difficult. In the present method, the real number matrix may sequentially be decomposed by means of the following algorithm. 
       FIG.  4    is a flowchart of an algorithm conducted in the present decomposition method. It is to be noted that, in the following description, a procedure of decomposing the weight matrix W into the basis matrix M w  containing k w  bases and the coefficient matrix C w  in the above first to fourth decomposition methods is expressed as the following formula.
 
[Equation 12]
 
[ M, C ]=decompose( W, k )   (11)
 
     First, the weight decomposition unit  12  acquires the weight matrix W to be decomposed (step S41). Subsequently, the weight decomposition unit  12  sets an index j (j=1 to N) to 1 and substitutes the weight matrix W for a residual matrix R (step S42). The residual matrix R is a difference between a sum of inner products between the basis matrix M w   (j)  and the coefficient matrix C w(j)  decomposed by sequential decomposition and the weight matrix W. 
     Subsequently, the weight decomposition unit  12  decomposes the residual matrix R into the basis matrix M w  and the coefficient matrix C w  by the method according to the first or second embodiment (step S 43 ). At this time, the basis number is k wj . The basis number k w   (j) =k w   (1) , k w   (2) , . . . k w   (N)  is stored in the weight decomposition unit  12  in advance. When M w   (j) C w   (j)  is acquired, the weight decomposition unit  12  sets a difference between the original residual matrix R and M w   (j) C w   (j)  as a new residual matrix R (step S 44 ), increments the index j (step S 45 ), and determines if the index j is higher than N, that is, if N-stage sequential decomposition is completed (step S 46 ). 
     In a case in which the index j is N or lower (NO in step S 46 ), the weight decomposition unit  12  returns to step S 43  and decomposes the new residual matrix R acquired in step S 44  again with use of the new j incremented in step S 45 . The above processing is repeated, and when the index j is higher than N (YES in step S 46 ), the processing ends. Meanwhile, as described above, the N-stage basis numbers k w   (j) =k w   (1) , k w   (2) , . . . , k w   (N)  are prepared in advance. They may be equal to or different from each other. Also, the basis number k w  may be 8 or so, for example. 
     According to the present embodiment, as the basis number k w  for decomposition is increased further, the accuracy can be closer to the original accuracy. 
       FIG.  5    illustrates a modification example of processing of decomposing the weight matrix W into the basis matrix M w  whose basis number is k w  and the coefficient matrix C w . In this modification example, as illustrated in  FIG.  5   , the jth column vector in the weight matrix W is separately decomposed and is collected. Decomposition per vector in this manner can cause calculation cost for decomposition to be reduced. Each vector may be decomposed in the above first to fourth decomposition methods. 
     Here, the jth column vector in the weight matrix W is expressed as w (j) , and the jth column vector in the coefficient matrix C w  is expressed as c w   (j) . In the present embodiment, the weight matrix W in which the plurality of real number vectors w (j)  are arranged can be regarded as one decomposed into the sum of products between the plurality of vectors in the basis matrix M w   (i)  and the plurality of coefficient vectors c w   (j)  in the matrix arranged obliquely as illustrated in  FIG.  5   . Meanwhile, the hatched part in the matrix in  FIG.  5    contains 0. 
     (Decomposition of Input Vector) 
     Next, decomposition of the input vector x will be described.  FIG.  6    illustrates a modification example of processing of decomposing the input vector x into the product of the basis matrix M x  whose basis number is k x  and the coefficient vector c x  and the bias b x . The input vector x is decomposed as illustrated in  FIG.  6    and Formula (12) shown below.
 
[Equation 13]
 
x≈(M x c x +b x 1)   (12)
 
     The reason for considering the bias term b x 1 is that, due to the influence of ReLU, the input vector (map) is not negative, and the bias is high. This bias term may be dispensed with, and whether or not the bias term is required depends on output of the previous layer. 
     The input vector x is input information or a vector acquired in each layer, and normally, the input vector x cannot be decomposed beforehand and is supposed to be decomposed at the time of execution in the neural network apparatus  20  to be described below. However, as described below, since c x  and b x  can be determined by learning beforehand, the before-input decomposition unit  13  determines c x  and b x  by learning beforehand. Accordingly, when the input vector x is acquired in each layer, optimizing only M x  in response to the input vector x enables the input vector to be decomposed, and processing can be performed at high speed. In the present embodiment, the optimization of M x  in response to the input vector x is also performed at high speed with use of the below-mentioned lookup table. The before-input decomposition unit  13  also performs processing of determining the lookup table by learning beforehand. The processing will be described in turn. 
     First, a method of decomposing the input vector x when the input vector x is acquired will be described. In this method, decomposition is conducted by solving a cost function J x  expressing a decomposition error in the below formula.
 
[Equation 14]
 
J x (M x , c x , b x ; X)=∥x−(M x c x +b x 1)∥ 2   2    (13)
 
     Specifically, the above cost function J x  can be solved in the following procedure. 
     (1) Randomly initialize the basis matrix M x . 
     (2) Fix the basis matrix M x , and optimize the elements of the coefficient vector c x  and the bias b x  by means of the least-square method. Update the elements of the coefficient vector c x  and the coefficient b x  so that the cost function J x  may be minimum. 
     (3) Fix the elements of the coefficient vector c x  and the bias b x , and update the elements of the basis matrix M x  by means of full search so that the cost function J x  may be minimum. 
     (4) Repeat steps (2) and (3) until the results converge. For example, the convergence is determined when the cost function J x  satisfies a predetermined convergence condition (for example, the reduction amount reaches a predetermined value or lower). 
     Hereinbelow, an example of a case in which the basis matrix M x  is a ternary matrix will be described. In the full search in step (3), in a case in which the jth row of M x  is expressed as m x   (j) , each row can independently be updated by means of full search in a manner of Formula (14) shown below and  FIG.  7   . 
     
       
         
           
             
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     15 
                   
                   ] 
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       m 
                       x 
                       
                         ( 
                         j 
                         ) 
                       
                     
                     = 
                     
                       
                         
                           arg 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           min 
                         
                         
                           β 
                           ∈ 
                           
                             
                               { 
                               
                                 
                                   - 
                                   1 
                                 
                                 , 
                                 0 
                                 , 
                                 
                                   + 
                                   1 
                                 
                               
                               } 
                             
                             
                               1 
                               × 
                               
                                 k 
                                 x 
                               
                             
                           
                         
                       
                       ⁢ 
                       
                         
                           ( 
                           
                             
                               x 
                               j 
                             
                             - 
                             
                               ( 
                               
                                 
                                   β 
                                   ⁢ 
                                   
                                       
                                   
                                   ⁢ 
                                   
                                     c 
                                     x 
                                   
                                 
                                 + 
                                 
                                   b 
                                   x 
                                 
                               
                               ) 
                             
                           
                           ) 
                         
                         2 
                       
                     
                   
                   , 
                   
                     j 
                     = 
                     1 
                   
                   , 
                   … 
                   ⁢ 
                   
                       
                   
                   , 
                   
                     D 
                     I 
                   
                 
               
               
                 
                   ( 
                   14 
                   ) 
                 
               
             
           
         
       
     
     In each layer, when the input vector x is acquired, the input vector can be decomposed into the basis matrix M x  and the coefficient vector c x  by solving the above cost function J x . However, conducting this decomposition in each layer at the time of execution will require significant processing time, and this technique cannot be applied to detection of pedestrians by means of an in-vehicle camera or the like. Under such circumstances, the present inventor has focused attention on the following point. 
     In Formula (14), first, it can be assumed that c x  and b x  determine a value range of x. It can also be assumed that M x  indicates to which value in the value range determined by c x  and b x  the value x corresponds. Since every element has a similar value range of x, only c x  and b x  can be determined in the decomposition device  10  by learning beforehand, and only M x  can be optimized at the time of execution in the neural network apparatus  20  to be described below. This can speed up decomposition at the time of execution. Although it is preferable to optimize the three values of c x , b x , and M x  at the time of execution, in actual cases, optimizing only M x  as described above is sufficiently practical. 
     Consequently, to optimize only M x , all that needs to be done is to calculate only Formula (14). Formula (14) can be regarded as a one-dimensional nearest neighbor search of selecting the nearest candidate from 3 kx  (2 kx  in a case in which M x  is a binary matrix) (βc x +b x ) candidates. For example, in a case of k x =2, c x =(1.3,0.4) T , and b x =2.4, 3 kx  (βc x +b x ) candidates are as illustrated in  FIG.  8   .  FIG.  9    illustrates the respective (βc x +b x ) candidates in  FIG.  8    arrayed on a number line. As illustrated in  FIG.  9   , in a case in which a certain column x j  of the input vector x is 2.1, it is apparent from  FIG.  9    that the nearest candidate is m x   (j) =(0,−1), which is the optimal value. 
       FIG.  10    illustrates a state in which the number line in  FIG.  9    is divided at equal spaces to set a plurality of bins. The before-input decomposition unit  13  generates the lookup table LUT on which β, serving as the optimal value is specified for each of the plurality of bins set by dividing the number line in  FIG.  9    at equal spaces. In the neural network apparatus  20 , since, when the input vector x is acquired, the lookup table LUT is looked up to search a bin which the input vector x belongs to, m x   (j)  can be derived at extremely high speed. 
     The decomposition result output unit  14  calculates the sum of the second term and the third term of the right-hand side of Formula (6) with use of M w  and C w  acquired by decomposing the weight matrix W in the weight decomposition unit  12  and the coefficient vector c x  and the bias b x  acquired in the before-input decomposition unit 13. As described above, since c x , b x , M w , and C w  are acquired in the weight decomposition unit  12  and the before-input decomposition unit 13, the sum of the second term and the third term of the right-hand side of Formula (6) can be calculated. 
     The decomposition result output unit  14  outputs c x , M w , and C w  for calculating the first term of the right hand side of Formula (6), the sum of the second term and the third term of the right-hand side of Formula (6), and the lookup table LUT( j ) (j=1, . . . , D I ) for deriving each row vector m x   (j)  of M x  to the neural network apparatus  20  for each FC layer. 
     It is to be noted that, hereinbelow, M w  is referred to as “a weight basis matrix,” C w  is referred to as “a weight coefficient matrix,” M x  is referred to as “an input basis matrix,” c x  is referred to as “an input coefficient vector,” and b x  is referred to as “an input bias.” 
       FIG.  11    illustrates a configuration of the neural network apparatus  20 . The neural network apparatus  20  includes an input information acquisition unit  21 , an arithmetic unit  22 , an output information output unit  23 , and a storage unit  24 . The storage unit  24  has stored therein a neural network model. For each FC layer, the storage unit  24  acquires from the decomposition device  10  and stores therein the input coefficient vector c x , the weight basis matrix M w , and the weight coefficient matrix C w  for calculating the first term of the right hand side of Formula (6), the sum (b x C w   T M w   T 1+b) of the second term and the third term of the right-hand side of Formula (6), and the lookup table LUT (j)  (j=1, . . . , D I ) for deriving each row vector m x   (j)  of the input basis matrix M x  generated in and output from the decomposition device  10 . 
     The input information acquisition unit  21  is provided with input information to be processed. The arithmetic unit  22  reads out the neural network model from the storage unit  24 , inputs the input information acquired in the input information acquisition unit  21  into an input layer to execute arithmetic processing, and acquires an output layer. 
       FIG.  12    illustrates processing of the arithmetic unit  22  in the FC layer of the neural network model. In at least one FC layer, the arithmetic unit  22  uses the output vector from the previous layer as the input vector x to decompose the input vector x into the product of the binary input basis matrix M x  and the input coefficient vector c x  of real numbers and the input bias b x  and derives the product of the input vector x and the weight matrix W. Specifically, in the FC layer, when the arithmetic unit  22  acquires an output from the previous layer, the arithmetic unit  22  conducts operation of Formula (6) with the output used as the input vector x to derive the product of the input vector x and the weight matrix W. 
     As illustrated in  FIG.  12   , the arithmetic unit  22  looks up the lookup table LUT read from the storage unit  24  to derive the binary input basis matrix M x  corresponding to the input vector x. Subsequently, the arithmetic unit  22  calculates the first term (C w   T M w   T M x C x ) of the right hand side of Formula (6) with use of the acquired binary input basis matrix M x , and the weight coefficient matrix C w , the weight basis matrix M w , and the input coefficient vector c x  read from the storage unit  24 . 
     The arithmetic unit 22 calculates a sum (C w   T M w   T M x C x +b x C w   T M w   T 1+b) of the value of the first term of the right hand side of Formula (6) acquired by the above calculation (C w   T M w   T M x c x ) and the sum (b x C w   T M w   T 1+b) of the second term and the third term of the right-hand side of Formula (6) read from the storage unit  24 . In addition, the arithmetic unit  22  inputs the calculation result into an activating function (for example, ReLU) to calculate an output of the present layer (input of the subsequent layer). 
     The arithmetic unit  22  conducts operation based on the neural network model while executing the above operation in the FC layer to finally acquire the output layer. The value of the output layer is output to the output information output unit  23 . The output information output unit  23  outputs required output information based on the value of the output layer acquired in the arithmetic unit  22 . For example, in a case in which the neural network model performs classification, the output information output unit  23  outputs, as output information, information in a class having the highest likelihood in the output layer. 
     As described above, in the FC layer of the neural network, memory-saving and high-speed operation is effective due to the decomposed weight matrix W and the lookup table LUT for decomposition of the input vector. However, as for a CONV layer serving as a middle layer, by arranging various filters (three dimensions), a four-dimensional data structure can be achieved, and the above high-speed method can be applied. 
     Each of  FIGS.  13  and  14    illustrates a relationship between an input map and an output map of the CONV layer. In each of  FIGS.  13  and  14   , the left side is an input map IM, the right side is an output map OM, and a rectangular solid applied to the input map is a three-dimensional filter F 1  or F 2 . The filter F 1  and the filter F 2  are different from each other, and C out  filters, which are different from each other, are prepared. The operation amount of a filter of each output map is (f h f w C in ) ×(HW). The total amount of all of the filters is (f h f w C in )×(HW)×C out . In a case in which the present embodiment is not applied, the operation amount will be significantly large. 
     Even in such a case, as illustrated in  FIG.  15   , the respective filters serve as column vectors and are arranged in the row direction to generate the weight matrix W. Consequently, the CONV layer can be regarded as the FC layer, and the aforementioned memory-saving and high-speed operation can be performed. 
     Table 1 is a table illustrating a comparison of the operation amount required in each FC layer between the neural network apparatus  20  according to the present embodiment and a conventional art. 
     
       
         
           
               
               
               
             
               
                   
                 TABLE 1 
               
             
            
               
                   
                   
               
               
                   
                 FLOATING- 
                   
               
               
                   
                 POINT 
                 LOGICAL OPERATION 
               
            
           
           
               
               
               
               
               
            
               
                   
                 PRODUCT-SUM 
                   
                   
                 Bit 
               
               
                   
                 OPERATION 
                 AND 
                 XOR 
                 Count 
               
               
                   
                   
               
            
           
           
               
               
               
               
               
               
            
               
                 CONVENTIONAL 
                 W T x 
                 D I D o   
                 0 
                 0 
                 0 
               
               
                 ART 
               
               
                 PRESENT 
                 C w   T M w   T M x C x   
                 k x k w  + k w D o   
                 D I k x k w /B 
                 D I k x k w /B 
                 D I k x k w /B 
               
               
                 TECHNIQUE 
               
               
                   
               
            
           
         
       
     
     In Table 1, B is a bit wide of a variable (register) subjected to logical operation. While D I  or D O  is about several hundred to several thousand, k x  is about 2 to 4, and k w  is about D O /8 to D O /4, as described above. Hence, in the present embodiment, the operation amount is smaller than that in the conventional art. 
     Table 2 is a table illustrating a comparison of the memory consumption amount in each FC layer between the neural network apparatus  20  according to the present embodiment and the conventional art. 
     
       
         
           
               
               
               
             
               
                   
                 TABLE 2 
               
               
                   
                   
               
               
                   
                 VARIABLE 
                 SIZE 
               
               
                   
                   
               
             
            
               
                   
               
            
           
           
               
               
               
               
            
               
                   
                 CONVENTIONAL ART 
                 W 
                 32 · D I D o   
               
               
                   
                 PRESENT TECHNIQUE 
                 M w   
                  2 · D I k w   
               
               
                   
                   
                 C w   
                 32 · k w D o   
               
               
                   
                   
                 c x , b x   
                 32 · (k w  + 1) 
               
               
                   
                   
               
            
           
         
       
     
     In Table 2, a single-precision real number (32 bits) is used as a real number. As is apparent from Table 2, in the present embodiment, the memory consumption amount is smaller than that in the conventional art. 
     With the division device  10  and the neural network apparatus  20  according to the present embodiment, the memory consumption amount in the FC layer can be reduced, and the operation amount in the FC layer can be reduced. Accordingly, the present embodiment is particularly effective in a case in which the neural network has a large number of layers (deep neural network), and in which the aforementioned memory-saving and high-speed operation can be applied to a plurality of layers. 
     Meanwhile, a computer including a storage device, a memory, an arithmetic processing device, and the like executes a program to cause the function of each of the aforementioned decomposition device  10  and neural network apparatus  20  to be fulfilled. In the above embodiment, although the decomposition device  10  and the neural network apparatus  20  have been described as separate devices, these devices may be configured as one computer. 
     Also, as described above, only c x  and b x  are determined beforehand, and only M x  is optimized at the time of execution in the neural network apparatus  20 . By doing so, decomposition of the input vector at the time of execution can be conducted at high speed. In the above embodiment, the specified matrix M x  is derived, using, as an optimal input basis search method, a method of preparing and storing in the neural network apparatus  20  the lookup table LUT specifying β optimizing m x   (j)  for each of the plurality of bins, and when the input vector x is acquired in the neural network apparatus  20 , looking up the lookup table LUT to search for a bin to which each element x j  belongs to derive optimal β. 
     The optimal input basis search method is not limited to the above method. Hereinbelow, a modification example of the optimal input basis search method will be described. Hereinbelow, an example of a case in which the basis matrix M x  is a binary matrix will be described. First, the before-input decomposition unit  13  calculates (βc x +b x ) for all of the candidates β and m x   (j) . For example, in a case of k x =4, c x =(3.8, 8.6, 1.2, 0.4) T , and b x =15.2, (βc x +b x ) values acquired when β is provided in 2 kx  forms (in this example, since k x =4, (is provided in 2 kx =2 4 =16 forms) are as illustrated in  FIG.  17   . Hereinbelow, a value acquired by calculation of (βC x +b x ) for each β is referred to as a prototype p. 
     Subsequently, the before-input decomposition unit  13  sorts the prototypes p according to the magnitude of the values.  FIG.  18    illustrates a result of sorting the prototypes p according to the magnitude of the values in the example in  FIG.  17   . The prototypes p are provided with subscripts  1 ,  2 , . . . ,  16  in ascending order resulting from such sorting and are denoted as p 1 , p 2 , . . . , p 16 . Also, β corresponding to each prototype p 1  (i=1 to 16) is denoted as β 1  (i=1 to 16). 
     Subsequently, the before-input decomposition unit  13  derives a midpoint mp i  (i=1 to 15) between the adjacent prototypes p i  sorted.  FIG.  19    illustrates the respective (βc x +b x ) values in  FIG.  18    arrayed on a number line and the midpoints mp i  (i=1 to 15) thereof. Note that mp i =(p i p i+1 )/2 is established. 
     β to be assigned to the value x j  of each element of the input vector can be defined by the midpoints mp i  serving as boundaries as illustrated in  FIG.  20   . For example, as illustrated in  FIG.  21   , β 4  (−1, −1, 1, 1) can be assigned to x j =5.8. In a case in which this assignment is performed in the arithmetic unit  22  of the neural network apparatus  20 , a binary search method can be used. 
       FIG.  22    illustrates a configuration of the neural network apparatus  20  according to the present modification example. When compared with the neural network apparatus  20  according to the above embodiment, the neural network apparatus  20  according to the present modification example has stored therein information β i  (i=1, . . . , 2 kx ) and mp i  (i=1, . . . , 2 kx −1) for building a below-mentioned binary partition tree ( FIG.  27   ) for the respective elements x j  of the input vector x instead of the lookup table LUT. 
     As illustrated in  FIG.  23   , the arithmetic unit  22  first compares a midpoint at the center (mp 8  in this case) out of the midpoints mp i  between the adjacent prototypes with x j . In this case (x j =5.8), x j &lt;mp 8  is established, and it is thus clear that the solution is one out of β 1  . . . β 8 . As illustrated in  FIG.  24   , the arithmetic unit  22  subsequently compares a midpoint mp i  (mp 4  in this case) dividing the remaining candidates β 1  . . . β 8  into two with x j . In this case (x=5.8), x j &lt;mp 4  is established, and it is thus clear that the solution is one out of β 1  . . . β 4    
     As illustrated in  FIG.  25   , the arithmetic unit  22  subsequently compares a midpoint mp i  (mp 2  in this case) dividing the remaining candidates β 1  . . . β 4  into two with x j . In this case (x j =5.8), x j &gt;mp 2  is established, and it is thus clear that the solution is β 3  or β 4 . As illustrated in  FIG.  26   , the arithmetic unit  22  finally compares a midpoint mp i  (mp 3  in this case) dividing the remaining candidates β 3  and β 4  into two with x j . In this case (x j =5.8), x j &gt;mp 3  is established, and it is thus clear that the solution is β 4 . 
     In the above manner, the arithmetic unit  22  can derive the solution by means of four-time comparison operation.  FIG.  27    illustrates the above binary tree search method. In general, the arithmetic unit  22  can eventually derive the solution after the comparison is done as many times as the number of bits (k x  times). The arithmetic unit  22  may store all of β i  (i=1, . . . , 2 kx ) and midpoints mp i  (i=1, . . . , 2 kx −1) in the memory. In a case in which the input basis matrix M x  is a ternary matrix, the arithmetic unit  22  may store all of β i (i=1, . . . , 3 kx ) and midpoints mp i  (i=1, . . . , 3 kx −1) in the memory. 
     In this manner, according to the present modification example, only k x -time comparison operation can cause optimal β to be derived at high speed, and the memory consumption amount can be reduced. 
     Meanwhile, in the above embodiment and modification example, although a case in which the weight matrix is a real number matrix has been described, decomposition of the weight matrix is not required in a case in which the weight matrix consists of binary or ternary elements. In this case, only the input vector may be decomposed into the sum of the product of the binary or ternary basis matrix and the coefficient vector of real numbers and the bias. Such a neural network in which the weight matrix is originally binary or ternary is introduced in M. Courbariaux, Y. Bengio, and J. P. David. BinaryConnect: Training deep neural networks with binary weights during propagations. In NIPS, pp. 3105-3113, 2015. and F. Li and B. Liu. Ternary weight networks. Technical Report arXiv: 1605.04711, 2016., for example. 
     By decomposing the input vector into the basis matrix and the real number vector, the operation amount can be reduced, and the operation can be performed at high speed. 
     The neural network apparatus  20  according to the above embodiment and modification example can be applied in various fields such as image recognition, audio recognition, and natural language processing and can be used as an apparatus recognizing an object around a vehicle with a detection value of an in-vehicle sensor used as input information.  FIG.  28    is a block diagram illustrating a configuration of a vehicle control system including the neural network apparatus  20 . A vehicle control system  100  includes the neural network apparatus  20 , an in-vehicle sensor  30 , and a vehicle control apparatus  40 . 
     The in-vehicle sensor  30  performs sensing to acquire input information to be input into an input unit of the neural network apparatus. Examples of the in-vehicle sensor  30  are a monocular camera, a microphone, and a millimeter-wave radar. The detection value may be input as it is into the neural network apparatus  20  as input information or may be subject to information processing to generate input information and be input into the neural network apparatus  20 . 
     The neural network apparatus  20  may be one detecting an object of specific kind (for example, a person and a vehicle) and enclosing the object with a rectangular frame, one determining to which class each pixel belongs (semantic segmentation), or one performing other recognition processing. 
     The vehicle control apparatus  40  controls the vehicle based on an output (recognition result) of the neural network apparatus. The vehicle control may be automated driving of the vehicle, drive assist of the vehicle (for example, enforced braking at the time of a collision hazard, and lane keeping), or information provision to a vehicle driver (for example, provision of a recognition result, and notification of a result of hazard determination based on the recognition result).