Patent Description:
<NPL> described the use of normalization at the output layer of a neural network to encourage sparse activations.

Embodiments of the invention are defined by the appended dependent claims.

There is described an image classification neural network system implemented by one or more computers, the neural network system comprising: a batch normalization layer between a first neural network layer and a second neural network layer in a sequence of neural network layers of the neural network system, wherein the neural network system generates neural network outputs from neural network inputs by processing the neural network inputs through each of the layers in the sequence, wherein after the neural network system has been trained, the neural network system is configured to receive a neural network input and to process the neural network input through the neural network layers to generate a neural network output for the input in accordance with the trained values of the parameters of the neural network system wherein the neural network input comprises an image, and wherein the neural network output comprises scores for each of a set of object categories with each score representing an estimated likelihood that the image contains an image of an object belonging to the category, and wherein the batch normalization layer is configured to: receive an output generated for the neural network input by first neural network layer; and generate a normalized output for the neural network input; and provide the normalized output, or a transformed version of the normalized output, as input to the second neural network layer; and wherein either i) the outputs generated by the first neural network layer are indexed by dimension, and the batch normalization layer is configured to normalize each component of the first neural network layer output using pre-computed means and standard deviations for each of the dimensions to generate the normalized output; or ii) the outputs generated by the first neural network layer are indexed by feature index and spatial location index, and the batch normalization layer is configured to normalize each component of the first neural network layer output using pre-computed average means and average variances for each of the feature indices, to generate the normalized output.

A neural network system that includes one or more batch normalization layers can be trained more quickly than an otherwise identical neural network that does not include any batch normalization layers. For example, by including one or more batch normalization layers in the neural network system, problems caused by the distribution of a given layer's inputs changing during training can be mitigated. This may allow higher learning rates to be effectively used during training and may reduce the impact of how parameters are initialized on the training process. Additionally, during training, the batch normalization layers can act as a regularizer and may reduce the need for other regularization techniques, e.g., dropout, to be employed during training. Once trained, the neural network system that includes one normalization layers can generate neural network outputs that are as accurate, if not more accurate, than the neural network outputs generated by the otherwise identical neural network system.

The details of one or more examples of the subject matter of this specification are set forth in the accompanying drawings and the description below.

This specification describes a neural network system implemented as computer programs on one or more computers in one or more locations that includes a batch normalization layer.

<FIG> shows an example neural network system <NUM>. The neural network system <NUM> is an example of a system implemented as computer programs on one or more computers in one or more locations, in which the systems, components, and techniques described below can be implemented.

The neural network system <NUM> includes multiple neural network layers that are arranged in a sequence from a lowest layer in the sequence to a highest layer in the sequence. The neural network system generates neural network outputs from neural network inputs by processing the neural network inputs through each of the layers in the sequence.

The neural network system <NUM> is configured to receive image data input and to generate a classification output based on the input.

The inputs to the neural network system <NUM> are images , and the output generated by the neural network system <NUM> for a given image comprises scores for each of a set of object categories, with each score representing an estimated likelihood that the image contains an image of an object belonging to the category.

In particular, each of the layers of the neural network is configured to receive an input and generate an output from the input and the neural network layers collectively process neural network inputs received by the neural network system <NUM> to generate a respective neural network output for each received neural network input. Some or all of the neural network layers in the sequence generate outputs from inputs in accordance with current values of a set of parameters for the neural network layer. For example, some layers may multiply the received input by a matrix of current parameter values as part of generating an output from the received input.

The neural network system <NUM> also includes a batch normalization layer <NUM> between a neural network layer A <NUM> and a neural network layer B <NUM> in the sequence of neural network layers. The batch normalization layer <NUM> is configured to perform one set of operations on inputs received from the neural network layer A <NUM> during training of the neural network system <NUM> and another set of operations on inputs received from the neural network layer A <NUM> after the neural network system <NUM> has been trained.

In particular, the neural network system <NUM> can be trained on multiple batches of training examples in order to determine trained values of the parameters of the neural network layers. A batch of training examples is a set of multiple training examples. For example, during training, the neural network system <NUM> can process a batch of training examples <NUM> and generate a respective neural network output for each training example in the batch <NUM>. The neural network outputs can then be used to adjust the values of the parameters of the neural network layers in the sequence, e.g., through conventional gradient descent and backpropagation neural network training techniques.

During training of the neural network system <NUM> on a given batch of training examples, the batch normalization layer <NUM> is configured to receive layer A outputs <NUM> generated by the neural network layer A <NUM> for the training examples in the batch, process the layer A outputs <NUM> to generate a respective batch normalization layer output <NUM> for each training example in the batch, and then provide the batch normalization layer outputs <NUM> as an input to the neural network layer B <NUM>. The layer A outputs <NUM> include a respective output generated by the neural network layer A <NUM> for each training example in the batch. Similarly, the batch normalization layer outputs <NUM> include a respective output generated by the batch normalization layer <NUM> for each training example in the batch.

Generally, the batch normalization layer <NUM> computes a set of normalization statistics for the batch from the layer A outputs <NUM>, normalizes the layer A outputs <NUM> to generate a respective normalized output for each training example in the batch, and, optionally, transforms each of the normalized outputs before providing the outputs as input to the neural network layer B <NUM>.

The normalization statistics computed by the batch normalization layer <NUM> and the manner in which the batch normalization layer <NUM> normalizes the layer A outputs <NUM> during training depend on the nature of the neural network layer A <NUM> that generates the layer A outputs <NUM>.

The neural network layer A <NUM> is either a layer that generates an output that includes multiple components indexed by dimension. For example, the neural network layer A <NUM> may be a fully-connected neural network layer. Or the neural network layer A <NUM> is a convolutional layer or other kind of neural network layer that generates an output that includes multiple components that are each indexed by both a feature index and a spatial location index. Generating the batch normalization layer output during training of the neural network system <NUM> in each of these two cases is described in more detail below with reference to <FIG>.

Once the neural network system <NUM> has been trained, the neural network system <NUM> may receive a new neural network input for processing and process the neural network input through the neural network layers to generate a new neural network output for the input in accordance with the trained values of the parameters of the components of the neural network system <NUM>. The operations performed by the batch normalization layer <NUM> during the processing of the new neural network input also depend on the nature of the neural network layer A <NUM>. Processing a new neural network input after the neural network system <NUM> has been trained is described in more detail below with reference to <FIG>.

The batch normalization layer <NUM> may be included at various locations in the sequence of neural network layers and, in some implementations, multiple batch normalization layers may be included in the sequence.

In the example of <FIG>, in some implementations, the neural network layer A <NUM> generates outputs by modifying inputs to the layer in accordance with current values of a set of parameters for the first neural network layer, e.g., by multiplying the input to the layer by a matrix of the current parameter values. In these implementations, the neural network layer B <NUM> may receive an output from the batch normalization layer <NUM> and generate an output by applying a non-linear operation, i.e., a non-linear activation function, to the batch normalization layer output. Thus, in these implementations, the batch normalization layer <NUM> is inserted within a conventional neural network layer, and the operations of the conventional neural network layer are divided between the neural network layer A <NUM> and the neural network layer B <NUM>.

In some other implementations, the neural network layer A <NUM> generates the outputs by modifying layer inputs in accordance with current values of a set of parameters to generate a modified first layer inputs and then applying a non-linear operation to the modified first layer inputs before providing the output to the batch normalization layer <NUM>. Thus, in these implementations, the batch normalization layer <NUM> is inserted after a conventional neural network layer in the sequence.

<FIG> is a flow diagram of an example process <NUM> for generating a batch normalization layer output during training of a neural network on a batch of training examples. For convenience, the process <NUM> will be described as being performed by a system of one or more computers located in one or more locations. For example, a batch normalization layer included in a neural network system, e.g., the batch normalization layer <NUM> included in the neural network system <NUM> of <FIG>, appropriately programmed, can perform the process <NUM>.

The batch normalization layer receives lower layer outputs for the batch of training examples (step <NUM>). The lower layer outputs include a respective output generated for each training example in the batch by the layer below the batch normalization layer in the sequence of neural network layers.

The batch normalization layer generates a respective normalized output for each training example in the batch (step <NUM>). That is, the batch normalization layer generates a respective normalized output from each received lower layer output.

Either, , the layer below the batch normalization layer is a layer that generates an output that includes multiple components indexed by dimension.

In these cases, the batch normalization layer computes, for each dimension, the mean and the standard deviation of the components of the lower layer outputs that correspond to the dimension. The batch normalization layer then normalizes each component of each of the lower level outputs using the means and standard deviations to generate a respective normalized output for each of the training examples in the batch. For a given component of a given output, the batch normalization layer normalizes the component using the mean and the standard deviation computed for the dimension corresponding to the component. For example, in some implementations, for a component xk,i corresponding to the k-th dimension of the i-th lower layer output from a batch β, the normalized output x̂k,i satisfies: <MAT> where µB is the mean of the components corresponding to the k-th dimension of the lower layer outputs in the batch β and σB is the standard deviation of the components corresponding to the k-th dimension of the lower layer outputs in the batch β. In some implementations, the standard deviation is a numerically stable standard deviation that is equal to (σB<NUM> + ε)<NUM>/<NUM> , where ε is a constant value and σB<NUM> is the variance of the components corresponding to the k-th dimension of the lower layer outputs in the batch β.

Or, In the neural network layer below the batch normalization layer is a convolutional layer or other kind of neural network layer that generates an output that includes multiple components that are each indexed by both a feature index and a spatial location index.

In these cases, the batch normalization layer computes, for each possible feature index and spatial location index combination, the mean and the variance of the components of the lower layer outputs that have that feature index and spatial location index. The batch normalization layer then computes, for each feature index, the average of the means for the feature index and spatial location index combinations that include the feature index. The batch normalization layer also computes, for each feature index, the average of the variances for the feature index and spatial location index combinations that include the feature index. Thus, after computing the averages, the batch normalization layer has computed a mean statistic for each feature across all of the spatial locations and a variance statistic for each feature across all of the spatial locations.

The batch normalization layer then normalizes each component of each of the lower level outputs using the average means and the average variances to generate a respective normalized output for each of the training examples in the batch. In particular, for a given component of a given output, the batch normalization layer normalizes the component using the average mean and the average variance for the feature index corresponding to the component, e.g., in the same manner as described above when the layer below the batch normalization layer generates outputs indexed by dimension.

In others of these cases, the batch normalization layer computes, for each feature index the mean and the variance of the components of the lower layer outputs that correspond to the feature index, i.e., that have the feature index.

The batch normalization layer then normalizes each component of each of the lower level outputs using the means and the variances for the feature indices to generate a respective normalized output for each of the training examples in the batch. In particular, for a given component of a given output, the batch normalization layer normalizes the component using the mean and the variance for the feature index corresponding to the component, e.g., in the same manner as described above when the layer below the batch normalization layer generates outputs indexed by dimension.

The batch normalization layer transforms each component of each normalized output (step <NUM>).

In cases where the layer below the batch normalization layer is a layer that generates an output that includes multiple components indexed by dimension, the batch normalization layer transforms, for each dimension, the component of each normalized output in the dimension in accordance with current values of a set of parameters for the dimension. That is, the batch normalization layer maintains a respective set of parameters for each dimension and uses those parameters to apply a transformation to the components of the normalized outputs in the dimension. The values of the sets of parameters are adjusted as part of the training of the neural network system. For example, in some implementations, the transformed normalized output yk,i generated from the normalized output x̂k,i satisfies: <MAT> where γk and Ak are the parameters for the k-th dimension.

In cases where the layer below the batch normalization layer is a convolutional layer, the batch normalization layer transforms, for each component of each of the normalized outputs, the component in accordance with current values of a set of parameters for the feature index corresponding to the component. That is, the batch normalization layer maintains a respective set of parameters for each feature index and uses those parameters to apply a transformation to the components of the normalized outputs that have the feature index, e.g., in the same manner as described above when the layer below the batch normalization layer generates outputs indexed by dimension. The values of the sets of parameters are adjusted as part of the training of the neural network system.

The batch normalization layer provides the normalized outputs or the transformed normalized outputs as input to a layer above the batch normalization layer in the sequence (step <NUM>).

After the neural network has generated the neural network outputs for the training examples in the batch, the normalization statistics are backpropagated through as part of adjusting the values of the parameters of the neural network, i.e., as part of performing the backpropagation training technique.

<FIG> is a flow diagram of an example process <NUM> for generating a batch normalization layer output for a new neural network input after the neural network has been trained. For convenience, the process <NUM> will be described as being performed by a system of one or more computers located in one or more locations. For example, a batch normalization layer included in a neural network system, e.g., the batch normalization layer <NUM> included in the neural network system <NUM> of <FIG>, appropriately programmed, can perform the process <NUM>.

The batch normalization layer receives a lower layer output for the new neural network input (step <NUM>). The lower layer output is an output generated for the new neural network input by the layer below the batch normalization layer in the sequence of neural network layers.

The batch normalization layer generates a normalized output for the new neural network input (step <NUM>).

If the outputs generated by the layer below the batch normalization layer are indexed by dimension, the batch normalization layer normalizes each component of the lower layer output using pre-computed means and standard deviations for each of the dimensions to generate a normalized output. The means and standard deviations for a given dimension are computed from the components in the dimension of all of outputs generated by the layer below the batch normalization layer during the training of the neural network system.

In some other cases, however, the means and standard deviations for a given dimension are computed from the components in the dimension of the lower layer outputs generated by the layer below the batch normalization layer after training, e.g., from lower layer outputs generated during in a most recent time window of specified duration or from a specified number of lower layer outputs most recently generated by the layer below the batch normalization layer.

In particular, in some cases the distribution of network inputs and, accordingly, the distribution of lower layer outputs may change between the training examples used during training and the new neural network inputs used after the neural network system is trained, e.g., if the new neural network inputs are different kinds of inputs from the training examples. For example, the neural network system may have been trained on user images and may now be used to process video frames. The user images and the video frames likely have different distributions in terms of the classes pictured, image properties, composition, and so on. Therefore, normalizing the lower layer inputs using statistics from the training may not accurately capture the statistics of the lower layer outputs being generated for the new inputs. Thus, in these cases, the batch normalization layer can use normalization statistics computed from lower layer outputs generated by the layer below the batch normalization layer after training.

If the outputs generated by the layer below the batch normalization layer are indexed by feature index and spatial location index, the batch normalization layer normalizes each component of the lower layer output using pre-computed average means and average variances for each of the feature indices, to generate a normalized output. In some cases, as described above, the average means and average variances for a given feature index, are computed from the outputs generated by the layer below the batch normalization layer for all of the training examples used during training. The means and standard deviations for a given feature index are computed from the lower layer outputs generated by the layer below the batch normalization layer after training.

The batch normalization layer transforms each component of the normalized output (step <NUM>).

If the outputs generated by the layer below the batch normalization layer are indexed by dimension, the batch normalization layer transforms, for each dimension, the component of the normalized output in the dimension in accordance with trained values of the set of parameters for the dimension. If the outputs generated by the layer below the batch normalization layer are indexed by feature index and spatial location index, the batch normalization layer transforms each component of the normalized output in accordance with trained values of the set of parameters for the feature index corresponding to the component.

The batch normalization layer provides the normalized output or the transformed normalized output as input to the layer above the batch normalization layer in the sequence (step <NUM>).

Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non transitory program carrier for execution by, or to control the operation of, data processing apparatus.

A computer program (which may also be referred to or described as a program, software, a software application, a module, a software module, a script, or code) can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

Claim 1:
An image classification neural network system (<NUM>) implemented by one or more computers, the neural network system comprising:
a batch normalization layer (<NUM>) between a first neural network layer (<NUM>) and a second neural network layer (<NUM>) in a sequence of neural network layers of the neural network system, wherein the neural network system generates neural network outputs from neural network inputs by processing the neural network inputs through each of the layers in the sequence,
wherein after the neural network system has been trained, the neural network system is configured to receive a neural network input and to process the neural network input through the neural network layers to generate a neural network output for the input in accordance with the trained values of the parameters of the neural network system
wherein the neural network input comprises an image, and wherein the neural network output comprises scores for each of a set of object categories with each score representing an estimated likelihood that the image contains an image of an object belonging to the category, and
wherein the batch normalization layer is configured to:
receive (<NUM>) an output generated for the neural network input by first neural network layer; and
generate (<NUM>) a normalized output for the neural network input; and
provide (<NUM>) the normalized output, or a transformed version of the normalized output, as input to the second neural network layer; and wherein either
i) the outputs generated by the first neural network layer are indexed by dimension, and the batch normalization layer is configured to normalize each component of the first neural network layer output using pre-computed means and standard deviations for each of the dimensions to generate the normalized output; or
ii) the outputs generated by the first neural network layer are indexed by feature index and spatial location index, and the batch normalization layer is configured to normalize each component of the first neural network layer output using pre-computed average means and average variances for each of the feature indices, to generate the normalized output.