Batch normalization layer

By introducing a batch normalization layer into the neural network, the problem of neural network processing input distribution changes during training is solved, faster training and more efficient parameter initialization are achieved, and dependence on other regularization technologies is reduced.

CN120068933APending Publication Date: 2025-05-30GOOGLE LLC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510128762.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2015-01-28
Filing Date
2016-01-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Existing neural networks are difficult to effectively handle changes in input distribution during training, resulting in limited learning rate, parameter initialization has a great impact on the training process, and additional regularization techniques are required.

Method used

A batch normalization layer is introduced, and the layer is inserted between neural network layers, and each first layer output is normalized by calculating the normalization statistics in the batch, thereby generating a normalized layer output and providing it to the next layer as input.

Benefits of technology

Through the batch normalization layer, neural networks can adapt to changes in input distribution more quickly during training, allowing higher learning rates to be used, reducing the impact of parameter initialization on the training process, and reducing the need for other regularization techniques.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120068933A_ABST
    Figure CN120068933A_ABST
Patent Text Reader

Abstract

The invention relates to a batch normalization layer. Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, are provided for processing inputs using a neural network system that includes a batch normalization layer. One of the methods includes: receiving a respective first layer output for each training example in the batch; calculating a plurality of normalized statistics for the batch according to the first layer output; normalizing each component of each first layer output using the normalization statistics to generate a corresponding normalized layer output for each training example in the batch; generating a respective batch normalized layer output for each of the training examples from the normalized layer output; and providing the batch normalization layer output as an input to the second neural network layer.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Division Explanation

[0002] This application is a divisional application of Chinese Patent Application No. 201680012517.X with a filing date of January 28, 2016. Technical Field

[0003] This specification relates to processing an input through a neural network layer to generate an output. Background Art

[0004] A neural network is a machine learning model that uses one or more layers of non - linear units to predict an output for a received input. In addition to the output layer, some neural networks also include one or more hidden layers. The output of each hidden layer is used as the input to the next layer in the network, i.e., the next hidden layer or the output layer. Each layer in the network generates an output from the received input based on the current values of a corresponding set of parameters. Summary of the Invention

[0005] In general, an innovative aspect of the subject matter described in this specification can be embodied as a neural network system implemented by one or more computers. The neural network system includes: a batch normalization layer between a first neural network layer and a second neural network layer. The first neural network layer generates a first - layer output having a plurality of components. The batch normalization layer is configured to, during training of the neural network system based on a batch of training examples: receive the corresponding first - layer output of each training example in the batch; calculate a plurality of normalization statistics for the batch based on the first - layer output; normalize each component of each first - layer output using the normalization statistics to generate a corresponding normalized layer output for each training example in the batch; generate a corresponding batch normalization layer output for each training example from the normalized layer output; and provide the batch normalization layer output as an input to the second neural network layer.

[0006] For a system of one or more computers to be configured to perform a particular operation or action means that the system has software, firmware, hardware, or a combination thereof installed thereon that, when operating, causes the system to perform the operation or action. For one or more computer programs to be configured to perform a particular operation or action means that the one or more programs include instructions that, when executed by a data - processing device, cause the device to perform the operation or action.

[0007] Specific embodiments of the subject matter described in this specification can be implemented to achieve one or more of the following advantages. Compared with the same neural network that does not include any batch normalization layers, a neural network system that includes one or more batch normalization layers can be trained more quickly. For example, by including one or more batch normalization layers in the neural network system, problems caused by the distribution of the input of a given layer that changes during training can be alleviated. This can allow for the effective use of higher learning rates during training and can reduce the impact of how the parameters are initialized on the training process. Additionally, during training, the batch normalization layer can act as a regularization matrix and can reduce the need for other regularization techniques (e.g., dropout) to be employed during training. Once trained, a neural network system that includes a normalization layer can generate a neural network output that is as accurate as, if not more accurate than, the neural network output generated by the same neural network system.

[0008] Details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the following description. Other features, aspects, and advantages of the subject matter will become apparent from the specification, the drawings, and the claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 An example neural network system is shown.

[0010] Figure 2 is a flow diagram of an example process for using a batch normalization layer to process an input during training of a neural network system.

[0011] Figure 3 is a flow diagram of an example process for using batch normalization to process an input after a neural network system has been trained.

[0012] In the various drawings, the same reference numbers and signs indicate the same elements. DETAILED DESCRIPTION

[0013] This specification describes a neural network system that includes batch normalization layers, which is implemented as a computer program on one or more computers at one or more locations.

[0014] Figure 1 An example neural network system 100 is shown. The neural network system 100 is an example of a system that is implemented as a computer program on one or more computers at one or more locations, where the systems, components, and techniques described below can be implemented.

[0015] The neural network system 100 includes a plurality of neural network layers arranged in a sequence: arranged in order from the lowest layer in the sequence to the highest layer in the sequence. The neural network system generates a neural network output from the neural network input by processing the neural network input through each layer in the sequence.

[0016] The neural network system 100 can be configured to receive any kind of digital data input and generate any kind of score or classification output based on that input.

[0017] For example, if the input to the neural network system 100 is an image or features that have been extracted from an image, the output generated by the neural network system 100 for a given image can be scores for each category in an object category set, where each score represents the estimated likelihood that the image contains an object belonging to that category.

[0018] As another example, if the input to the neural network system 100 is an Internet resource (e.g., a web page), a document, or a part of a document, or features extracted from an Internet resource, a document, or a part of a document, the output generated by the neural network system 100 for a given Internet resource, document, or part of a document can be scores for each topic in a topic set, where each score represents the estimated likelihood that the Internet resource, document, or part of a document is related to that topic.

[0019] As another example, if the input to the neural network system 100 is features of a flash scenario of a specific advertisement, the output generated by the neural network system 100 can be a score representing the estimated likelihood of clicking on that specific advertisement.

[0020] As another example, if the input to the neural network system 100 is features of a personalized recommendation for a user, e.g., features characterizing the scenario of the recommendation, e.g., features characterizing actions previously taken by the user, the output generated by the neural network system 100 can be scores for each content item in a content item set, where each score represents the estimated likelihood that the user will positively respond to the recommended content item.

[0021] As another example, if the input to the neural network system 100 is text in one language, the output generated by the neural network system 100 can be scores for each text segment in a set of text segments in another language, where each score represents the estimated likelihood that the text segment in the other language is a suitable translation of the input text into the other language.

[0022] As another example, if the input to neural network system 100 is a spoken utterance, a sequence of spoken utterances, or features derived from one of the former two, the output generated by neural network system 100 can be a score for each text segment in a set of text segments, where each score represents an estimated likelihood that the text segment is a correct transcription of the utterance or sequence of utterances.

[0023] As another example, neural network system 100 can be part of an autocomplete system or part of a text processing system.

[0024] As another example, neural network system 100 can be part of a reinforcement learning system and can generate an output for selecting an action to be performed by an agent interacting with an environment.

[0025] Specifically, each layer in the neural network is configured to receive an input and generate an output from the input, and the neural network layers together process the neural network input received by neural network system 100 to generate a corresponding neural network output for each received neural network input. Some or all of the neural network layers in the sequence generate an output from the input based on the current values of a set of parameters of the neural network layer. For example, some layers can multiply the received input by a matrix of current parameter values as part of generating an output from the received input.

[0026] Neural network system 100 also includes a batch normalization layer 108 that is between neural network layer A 104 and neural network layer B 112 in a sequence of neural network layers. Batch normalization layer 108 is configured to: during training of neural network system 100, perform a set of operations on the input received from neural network layer A 104, and, after neural network system 100 has been trained, perform another set of operations on the input received from neural network layer A 104.

[0027] Specifically, neural network system 100 can be trained based on multiple batches of training examples to determine training values for the parameters of the neural network layers. A batch of training examples is a set of multiple training examples. For example, during training, neural network system 100 can process batch 102 of training examples and generate a corresponding neural network output for each training example in batch 102. Then, the neural network outputs are used to adjust the values of the parameters of the neural network layers in the sequence, e.g., by traditional gradient descent and backpropagation neural network training techniques.

[0028] During training of the neural network system 100 based on a given batch of training examples, the batch normalization layer 108 is configured to receive the layer A output 106 generated by the neural network layer A 104 for the training examples in the batch, process the layer A output 106 to generate a corresponding batch normalization layer output 110 for each training example in the batch, and then provide the batch normalization layer output 110 as an input to the neural network layer B 112. The layer A output 106 includes corresponding outputs generated by the neural network layer A 104 for each training example in the batch. Similarly, the batch normalization layer output 110 includes corresponding outputs generated by the batch normalization layer 108 for each training example in the batch.

[0029] Typically, the batch normalization layer 108 calculates a set of normalization statistics for the batch based on the layer A output 106, normalizes the layer A output 106 to generate a corresponding normalized output for each training example in the batch, and, optionally, transforms each of the normalized outputs before providing the output as an input to the neural network layer B 112.

[0030] The normalization statistics calculated by the batch normalization layer 108 and the manner in which the batch normalization layer 108 normalizes the layer A output 106 during training depend on the nature of the neural network layer A 104 that generates the layer A output 106.

[0031] In some cases, the neural network layer A 104 is a layer that generates an output that includes a plurality of components indexed by dimension. For example, the neural network layer A 104 can be a fully connected neural network layer. However, in some other cases, the neural network layer A 104 is a convolutional layer or other kind of neural network layer that generates an output that includes a plurality of components indexed by both feature index and spatial position index. Below will be referred to Figure 2 for a more detailed description of generating the batch normalization layer output during training of the neural network system 100 in each of these two cases.

[0032] Once the neural network system 100 has been trained, the neural network system 100 can 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 according to the trained values of the parameters of the components of the neural network system 100. The operations performed by the batch normalization layer 108 during processing of the new neural network input also depend on the nature of the neural network layer A 104. Below will be referred to Figure 3 for a more detailed description of processing the new neural network input after the neural network system 100 has been trained.

[0033] The batch normalization layer 108 can be included at various positions in the sequence of neural network layers, and, in some embodiments, multiple batch normalization layers can be included in the sequence.

[0034] In Figure 1 the example of, in some embodiments, neural network layer A 104 generates an output by modifying the input to the layer according to the current values of the parameter set of the first neural network layer (e.g., by multiplying the input to the layer by a matrix of the current parameter values). In these embodiments, neural network layer B 112 can receive the output from the batch normalization layer 108 and generate an output by applying a non-linear operation (i.e., a non-linear activation function) to the output of the batch normalization layer. Thus, in these embodiments, the batch normalization layer 108 is inserted within the traditional neural network layer, and the operations of the traditional neural network layer are divided between neural network layer A 104 and neural network layer B 112.

[0035] In some other embodiments, neural network layer A 104 generates an output by modifying the layer input according to the current values of the parameter set to generate a modified first layer input and then applying a non-linear operation to the modified first layer input before providing the output to the batch normalization layer 108. Thus, in these embodiments, the batch normalization layer 108 is inserted after the traditional neural network layer in the sequence.

[0036] Figure 2 is a flowchart of an example process 200 for generating the output of the batch normalization layer during the training of a neural network based on a batch of training examples. For convenience, process 200 is described as being executed by a system of one or more computers located at one or more locations. For example, a batch normalization layer included in a neural network system (e.g., the batch normalization layer 108 included in Figure 1 the neural network system 100 of) can be appropriately programmed to execute process 200.

[0037] The batch normalization layer receives the lower layer output of the batch of training examples (step 202). The lower layer output includes the respective outputs generated by the layer below the batch normalization layer in the sequence of neural network layers for each training example in the batch.

[0038] The batch normalization layer generates the respective normalized outputs for each training example in the batch (step 204). That is, the batch normalization layer generates the respective normalized outputs from each received lower layer output.

[0039] In some cases, the layer below the batch normalization layer is a layer that generates an output that includes multiple components indexed by dimension.

[0040] In these cases, the batch normalization layer calculates the mean and standard deviation of the components of the lower layer output corresponding to each dimension for each dimension. The batch normalization layer then normalizes each component of each lower layer output in the lower layer output using the mean and standard deviation to generate the corresponding normalized output for each training example in the batch. Specifically, for a given component of a given output, the batch normalization layer normalizes the component using the mean and standard deviation calculated for the dimension corresponding to the component. For example, in some embodiments, for a component x corresponding to the k-th dimension of the i-th lower layer output from batch β k,i , the normalized output satisfies:

[0041]

[0042] where μ Β is the mean of the components corresponding to the k-th dimension of the lower layer output in batch β, and σ B is the standard deviation of the components corresponding to the k-th dimension of the lower layer output in batch β. In some embodiments, the standard deviation is a numerically stable standard deviation equal to (σ B 2 + ε) 1 / 2 , where ε is a constant value, and σ B 2 is the variance of the components corresponding to the k-th dimension of the lower layer output in batch β.

[0043] However, in some other cases, the neural network layer below the batch normalization layer is a convolutional layer or other types of neural network layers, and the other types of neural network layers generate an output including multiple components indexed by both a feature index and a spatial position index respectively.

[0044] In some of these cases, the batch normalization layer calculates the mean and variance of the components of the lower layer output having the feature index and the spatial position index for each possible combination of the feature index and the spatial position index. The batch normalization layer then calculates the average of the means of the feature index and spatial position index combinations including the feature index for each feature index. The batch normalization layer also calculates the average of the variances of the feature index and spatial position index combinations including the feature index for each feature index. Thus, after calculating the averages, the batch normalization layer has calculated the mean statistic for each feature across all spatial positions and the variance statistic for each feature across all spatial positions.

[0045] The batch normalization layer then normalizes each component of each lower layer output in the lower layer outputs using the mean of the means and the mean of the variances to generate the corresponding normalized output for each training example in the batch. Specifically, for a given component of a given output, the batch normalization layer uses the mean of the means and the mean of the variances corresponding to the feature index of the component (e.g., in the same manner as described above when the layer below the batch normalization layer generates outputs indexed by dimension), to normalize the component.

[0046] In other cases of these cases, the batch normalization layer calculates the mean and variance of the components of the lower layer output corresponding to the feature index for each feature index (i.e., the lower layer output having that feature index).

[0047] The batch normalization layer then normalizes each component of each lower layer output in the lower layer outputs using the mean and variance of the feature indices to generate the corresponding normalized output for each training example in the batch. Specifically, for a given component of a given output, the batch normalization layer then uses the mean and variance of 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), to normalize the component.

[0048] Optionally, the batch normalization layer transforms each component of each normalized output (step 206).

[0049] In the case where the layer below the batch normalization layer is a layer that generates an output including multiple components indexed by dimension, the batch normalization layer transforms each component of each normalized output in that dimension according to the current value of the parameter set for that dimension. That is, the batch normalization layer maintains a corresponding parameter set for each dimension and uses these parameters to apply the transformation to the components of the normalized output in that dimension. The values of the parameter set are adjusted as part of the training of the neural network system. For example, in some embodiments, the transformed normalized output y generated from the normalized output k,i satisfies:

[0050]

[0051] where γ k and A k are parameters for the k-th dimension.

[0052] When the layer below the batch normalization layer is a convolutional layer, the batch normalization layer transforms each component of each normalized output in the normalized output according to the current value of the parameter set corresponding to the feature index of that component. That is, the batch normalization layer maintains a corresponding parameter set for each feature index and uses these parameters to apply the transformation to the components of the normalized output having the feature index, for example, in the same manner as described above when the layer below the batch normalization layer generates an output indexed by dimension. The value of the parameter set is adjusted as part of the training of the neural network system.

[0053] The batch normalization layer provides the normalized output or the transformed normalized output as the input to the layer above the batch normalization layer in the sequence (step 208).

[0054] After the neural network has generated the neural network output for the training examples in the batch, the normalization statistics are backpropagated as part of adjusting the values of the parameters of the neural network, that is, as part of performing the backpropagation training technique.

[0055] Figure 3 is a flowchart of an example process 300 for generating the output of the batch normalization layer for a new neural network input after the neural network has been trained. For convenience, process 300 is described as being executed by a system of one or more computers located in one or more locations. For example, the batch normalization layer included in the neural network system (e.g., the batch normalization layer 108 in the neural network system 100 included in Figure 1 can be programmed appropriately to execute process 300.

[0056] The batch normalization layer receives the output of the lower layer of the new neural network input (step 302). The lower layer output is the output generated by the layer below the batch normalization layer in the sequence of neural network layers for the new neural network input.

[0057] The batch normalization layer generates a normalized output of the new neural network input (step 304).

[0058] If the output generated by the layer below the batch normalization layer is indexed by dimension, the batch normalization layer normalizes each component in the lower layer output using the pre-computed mean and standard deviation for each dimension in the dimension to generate the normalized output. In some cases, the mean and standard deviation for a given dimension are calculated from the components in the dimension of all the outputs generated by the layer below the batch normalization layer during the training of the neural network system.

[0059] However, in some other cases, the mean and standard deviation of a given dimension are calculated based on components in the dimensions of the lower layer output generated by the layer below the batch normalization layer after training (e.g., based on the lower layer output generated during a most recent time window of a specified duration or from a specified number of lower layer outputs most recently generated by the layer below the batch normalization layer).

[0060] Specifically, in some cases, the distribution of the network input can change between the training examples used during training and the new neural network inputs used after the neural network system has been trained. Thus, the distribution of the lower layer outputs can change between them. For example, if the new neural network inputs are of a different kind than the training examples. For instance, the neural network system has been trained based on user images and can now be used to process video frames. The user images and video frames may have different distributions in terms of the classes pictured, image attributes, composition, etc. Thus, using the statistics from training to normalize the lower layer inputs may not accurately capture the statistics of the lower layer outputs generated for the new inputs. Thus, in these cases, the batch normalization layer can use the normalization statistics calculated based on the lower layer outputs generated by the layer below the batch normalization layer after training.

[0061] If the output generated by the layer below the batch normalization layer is indexed by a feature index and a spatial location index, the batch normalization layer normalizes each component of the lower layer output using the pre-computed mean of the means and the mean of the variances for each feature index in the feature index to generate a normalized output. In some cases, as described above, the mean of the means and the mean of the variances for a given feature index are calculated based on the output generated by the layer below the batch normalization layer for all training examples used during training. In some other cases, as described above, the mean and standard deviation for a given feature index are calculated based on the lower layer outputs generated by the layer below the batch normalization layer after training.

[0062] Optionally, the batch normalization layer transforms each component of the normalized output (step 306).

[0063] If the output generated by the layer below the batch normalization layer is indexed by dimension, the batch normalization layer transforms the components of the normalized output in each dimension according to the training values of the parameter set for that dimension. If the output generated by the layer below the batch normalization layer is indexed by feature index and spatial location index, the batch normalization layer transforms each component of the normalized output according to the training values of the parameter set corresponding to the feature index of the component. The batch normalization layer provides the normalized output or the transformed normalized output as the input to the layer above the batch normalization layer in the sequence (step 308).

[0064] Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly embodied computer software or firmware, in computer hardware including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. 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. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagated signal (e.g., a machine-generated electrical, optical, or electromagnetic signal) that is generated to encode information for transmission to a suitable receiver apparatus for execution by the data processing apparatus. A computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0065] The term “data processing apparatus” encompasses all kinds of apparatus, devices, and machines for processing data, including, by way of example, a programmable processor, a computer, or multiple processors or computers. The apparatus may include special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). In addition to hardware, the apparatus may also include code that creates an execution environment for the computer programs being discussed, such as code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.

[0066] A computer program (which may also be referred to as or described as a program, software, software application, module, software module, script, or code) can be written in any form of programming language (including compiled or interpreted languages, declarative or procedural languages), and the computer program 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). A computer program may, but need not, correspond to a file in a file system. The program can be stored in a part of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple co-operating files (e.g., files that store one or more modules, subroutines, or portions of code). The computer program can be deployed to execute on one computer or multiple computers located at one site or distributed across multiple sites and interconnected by a communication network.

[0067] The processes and logical flows described in this specification can be performed by one or more programmable computers that execute one or more computer programs to perform functions by operating on input data and generating output. The processes and logical flows can also be performed by special-purpose logic circuitry, such as an FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit), and the apparatus can also be implemented as special-purpose logic circuitry.

[0068] A computer suitable for executing a computer program can be, for example, based on a general or special-purpose microprocessor or both, or any other kind of central processing unit. Generally speaking, the central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The basic elements of a computer are a central processing unit for carrying out or executing instructions and one or more memory devices for storing the instructions and data. Generally speaking, a computer also includes one or more mass storage devices (e.g., magnetic disks, magneto-optical disks, or optical disks) for storing data, or can be operatively coupled to receive data from or transfer data to or do both with such mass storage devices. However, a computer need not have such devices. In addition, a computer can be embedded in another device, such as, for example, a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device (e.g., a universal serial bus (USB) flash drive), to name just a few. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including: for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, CD-ROM disks, and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special-purpose logic circuitry.

[0069] To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user, a keyboard, and a pointing device (such as, a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback, such as, for example, visual feedback, auditory feedback, or tactile feedback; and the input received from the user can be received in any form, including sound, voice, or tactile input. Additionally, a computer can interact with the user by sending documents to and receiving documents from the devices used by the user (e.g., by sending a web page to a web browser on a client device of the user in response to a request received from the web browser).

[0070] Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a backend component (e.g., as a data server), or includes a middleware component (e.g., an application server), or includes a frontend component (e.g., a client computer having a graphical user interface or a web browser through which a user can interact with an implementation of the subject matter described in this specification), or the computing system includes any combination of one or more such backend, middleware, or frontend components. The components of the system can be interconnected by any form of digital data communication medium, such as a communication network. Examples of communication networks include local area networks (“LANs”) and wide area networks (“WANs”), such as the Internet.

[0071] A computing system can include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship between a client and a server arises from computer programs that run on respective computers and have a client-server relationship with each other.

[0072] Although this specification contains many specific implementation details, these details should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of a particular invention. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, in some cases one or more features from a claimed combination can be excluded from the combination, and the claimed combination can be directed to a sub-combination or a variant of a sub-combination.

[0073] Likewise, although operations are depicted in the drawings in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order, or that all illustrated operations be performed to achieve a desired result. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the above embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.

[0074] Specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the acts recited in the claims may be performed in a different order and still achieve the desired result. As one example, the processes illustrated in the figures need not be in the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing may be beneficial.

Claims

1. A neural network system implemented by one or more computers, the neural network system comprising: instructions for implementing a batch normalization layer between a first neural network layer and a second neural network layer in the neural network, wherein the first neural network layer generates a first layer output having a plurality of components, and wherein the instructions cause the one or more computers to perform operations that include the following: During training of the neural network on a plurality of training data batches, each batch comprising a respective plurality of training examples, and for each batch in the plurality of batches: Receiving the respective first layer output of each training example in the plurality of training examples in the batch; Calculating a plurality of normalization statistics for the batch based on the first layer output, including: For each of a plurality of subsets of the plurality of components of the first layer output, determining the mean of the components of the first layer output of each training example in the plurality of training examples in the batch that are located in the respective subset, and For each of the plurality of subsets of the plurality of components of the first layer output, determining the standard deviation of the components of the first layer output of each training example in the plurality of training examples in the batch that are located in the respective subset; Normalizing each component of the plurality of components of each first layer output using the normalization statistics to generate a respective normalized layer output for each training example in the batch, including: For each first layer output and for each of the plurality of subsets, normalizing the components of the first layer output that are located in the respective subset using the mean of the respective subset and the standard deviation of the respective subset; Generating a respective batch normalization layer output for each training example in the training examples based on the normalized layer output; and Providing the batch normalization layer output as an input to the second neural network layer.

2. The neural network system according to claim 1, wherein, The plurality of components of the first layer output are indexed by dimension, and wherein calculating a plurality of normalization statistics for the first layer output includes: For each dimension in the dimensions, calculating the mean of the components of the first layer output in the dimension; and For each dimension in the dimensions, calculating the standard deviation of the components of the first layer output in the dimension.

3. The neural network system according to claim 2, wherein, Normalizing each component of the plurality of components of each first layer output includes: Normalizing the component using the calculated mean and the calculated standard deviation for the dimension corresponding to the component.

4. The neural network system according to claim 2, wherein, Generating the respective batch normalization layer output for each training example in the training examples based on the normalized layer output includes: For each dimension, transform the component of the output of the normalization layer of the training examples in the dimension according to the current value of the parameter set for the dimension.

5. The neural network system according to claim 4, wherein, the operation further includes, after the neural network system has been trained to determine the training values of the parameters for each dimension in the dimension: receiving a new first layer output generated by the first neural network layer for a new neural network input; normalizing each component of the new first layer output using pre-computed mean and standard deviation statistics for the dimension to generate a new normalized layer output; generating a new batch normalization layer output by transforming the component of the new normalized layer output of the training examples in the dimension according to the training value of the parameter set for the dimension for each dimension; and providing the batch normalization layer output as a new layer input to the second neural network layer.

6. The neural network system according to claim 5, wherein, the pre-computed mean and standard deviation statistics for the dimension are calculated based on the first layer output generated by the first neural network layer during the training of the neural network.

7. The neural network system according to claim 5, wherein, the pre-computed mean and standard deviation statistics for the dimension are calculated based on a new first layer output generated by the first neural network layer after the neural network has been trained.

8. The neural network system according to claim 7, wherein, the new neural network input processed by the neural network system after the neural network has been trained is an input of a type different from the type of the training examples used to train the neural network.

9. The neural network system according to claim 1, wherein, the first neural network layer is a convolutional layer, wherein the multiple components of the first layer output are indexed by a feature index and a spatial position index, and wherein calculating multiple normalization statistics for the first layer output includes: calculating the mean of the components of the first layer output having the feature index and the spatial position index for each combination of the feature index and the spatial position index; calculating the average of the means of the combinations including the feature index for each feature index; calculating the variance of the components of the first layer output having the feature index and the spatial position index for each combination of the feature index and the spatial position index; and calculating the average of the variances of the combinations including the feature index for each feature index.

10. The neural network system according to claim 9, wherein, normalizing each component of the multiple components of each layer output includes: normalizing the component using the average of the means and the average of the variances of the feature index corresponding to the component.

11. The neural network system according to claim 9, wherein, Outputting from the normalization layer to generate the respective batch normalization layer outputs for each training example in the training examples includes: Transforming each component according to the current value of the parameter set of the feature index corresponding to each component of the plurality of components of the normalization layer output.

12. The neural network system according to claim 11, wherein, the operation further includes, after the neural network has been trained to determine the trained values of the parameters for each of the dimensions: receiving new first layer inputs generated from new neural network inputs; normalizing each component of the new first layer output using the pre-computed mean and standard deviation statistics of the feature index to generate a new normalization layer output; generating a new batch normalization layer output by transforming each component according to the trained values of the parameter set of the feature index corresponding to each component of the plurality of components of the normalization layer output; and providing the new batch normalization layer output as a new layer input to the second neural network layer.

13. The neural network system according to claim 1, wherein, the first neural network layer is a convolutional layer, wherein the plurality of components of the first layer output are indexed by a feature index and a spatial position index, and wherein calculating a plurality of normalization statistics for the first layer output includes, for each feature index among the feature indexes: calculating the mean of the components of the first layer output corresponding to the feature index; and calculating the variance of the components of the first layer output corresponding to the feature index.

14. The neural network system according to claim 13, wherein, normalizing each component of the plurality of components of each layer output includes: normalizing the component using the mean and the variance for the feature index corresponding to the component.

15. The neural network system according to claim 13, wherein, generating the respective batch normalization layer outputs for each training example in the training examples according to the normalization layer output includes: transforming each component according to the current value of the parameter set of the feature index corresponding to each component of the plurality of components of the normalization layer output.

16. The neural network system according to claim 15, wherein, the operation further includes, after the neural network has been trained to determine the trained values of the parameters for each of the dimensions: receiving new first layer inputs generated from new neural network inputs; normalizing each component of the new first layer output using the pre-computed mean and standard deviation statistics of the feature index to generate a new normalization layer output; generating a new batch normalization layer output by transforming each component according to the trained values of the parameter set of the feature index corresponding to each component of the plurality of components of the normalization layer output; and Provide the output of the new batch normalization layer as a new layer input to the second neural network layer.

17. The neural network system according to claim 1, wherein, the first neural network layer generates the first layer output by modifying the first layer input according to the current value of the parameter set of the first neural network layer.

18. The neural network system according to claim 17, wherein, the second neural network layer generates the second layer output by applying a non-linear operation to the output of the batch normalization layer.

19. The neural network system according to claim 1, wherein, the first neural network layer generates the first layer output by modifying the first layer input according to the current value of the parameter set to generate a modified first layer input and then applying a non-linear operation to the modified first layer input.

20. The neural network system according to claim 1, wherein, during the training of the neural network, the neural network system is configured to backpropagate the normalization statistics as part of adjusting the parameter values of the neural network.

21. A method performed by one or more computers that implement a batch normalization layer between a first neural network layer and a second neural network layer in a neural network, where the first neural network layer generates a first layer output having a plurality of components, and wherein, the method includes: during the training of the neural network on a plurality of training data batches, each batch including a corresponding plurality of training examples, and for each batch in the batches: receiving the corresponding first layer output of each training example in the plurality of training examples in the batch; calculating a plurality of normalization statistics for the batch based on the first layer output, including: for each of a plurality of subsets of the plurality of components of the first layer output, determining the mean of the components of the first layer output of each training example in the plurality of training examples in the batch that are located in the corresponding subset, and for each of the plurality of subsets of the plurality of components of the first layer output, determining the standard deviation of the components of the first layer output of each training example in the plurality of training examples in the batch that are located in the corresponding subset; normalizing each component of the plurality of components of each first layer output using the normalization statistics to generate a corresponding normalized layer output for each training example in the batch, including: for each first layer output and for each of the plurality of subsets, normalizing the components of the first layer output that are located in the corresponding subset using the mean of the corresponding subset and the standard deviation of the corresponding subset; generating a corresponding batch normalization layer output for each training example based on the normalized layer output; and providing the batch normalization layer output as an input to the second neural network layer.

22. The method according to claim 21, wherein, The multiple components output by the first layer are indexed by dimension, and wherein calculating a plurality of normalization statistics for the output of the first layer includes: For each dimension in the dimension, calculating an average value of the components of the output of the first layer in the dimension; and For each dimension in the dimension, calculating a standard deviation of the components of the output of the first layer in the dimension.

23. The method according to claim 22, wherein, Normalizing each component among the multiple components of each first layer output includes: Normalizing the component using the calculated average value and the calculated standard deviation for the dimension corresponding to the component.

24. The method according to claim 22, wherein, Generating the corresponding batch normalization layer output for each training example in the training examples according to the normalization layer output includes: For each dimension, transforming the components of the normalization layer output of the training examples in the dimension according to the current value of the parameter set for the dimension.

25. The method according to claim 21, wherein, The first neural network layer is a convolutional layer, wherein the multiple components of the first layer output are indexed by feature index and spatial position index, and wherein calculating a plurality of normalization statistics for the first layer output includes, for each feature index in the feature index: Calculating an average value of the components of the first layer output corresponding to the feature index; and Calculating a variance of the components of the first layer output corresponding to the feature index.

26. The method according to claim 25, wherein, Normalizing each component among the multiple components of each layer output includes: Normalizing the component using the average value and the variance for the feature index corresponding to the component.

27. The method according to claim 25, wherein, Generating the corresponding batch normalization layer output for each training example in the training examples from the normalization layer output includes: Transforming the component according to the current value of the parameter set of the feature index corresponding to each component of the multiple components of the normalization layer output.

28. One or more non-transitory computer-readable storage media encoded with a computer program, the computer program including instructions that, when executed by one or more computers, cause the one or more computers to implement a neural network system, the neural network system comprises: Batch normalization instructions for implementing a batch normalization layer between a first neural network layer and a second neural network layer in a neural network, wherein the first neural network layer generates a first layer output having multiple components, and wherein the batch normalization instructions cause the one or more computers to perform operations, the operations including the following: During the training of the neural network on multiple training data batches, each batch includes a corresponding plurality of training examples, and for each batch in the batches: Receive the respective first-layer outputs of each of the plurality of training examples in the batch; Compute a plurality of normalization statistics for the batch based on the first-layer outputs, including: For each subset of a plurality of subsets of the plurality of components of the first-layer outputs, determine the mean of the components of the first-layer outputs of each of the plurality of training examples in the batch that are located in the respective subset, and For each subset of the plurality of subsets of the plurality of components of the first-layer outputs, determine the standard deviation of the components of the first-layer outputs of each of the plurality of training examples in the batch that are located in the respective subset; Normalize each component of the plurality of components of each first-layer output using the normalization statistics to generate a respective normalized-layer output for each training example in the batch, including: For each first-layer output and for each of the plurality of subsets, normalize the components of the first-layer output that are located in the respective subset using the mean of the respective subset and the standard deviation of the respective subset; Generate a respective batch-normalized-layer output for each of the training examples based on the normalized-layer outputs; and Provide the batch-normalized-layer output as an input to the second neural network layer.

29. The non-transitory computer-readable storage medium according to claim 28, wherein, the plurality of components of the first-layer output are indexed by a dimension index, and wherein computing a plurality of normalization statistics for the first-layer output includes: For each dimension, compute the mean of the components of the first-layer output in the dimension; and For each dimension, compute the standard deviation of the components of the first-layer output in the dimension.

30. The non-transitory computer-readable storage medium according to claim 29, wherein, normalizing each component of the plurality of components of each first-layer output includes: Normalize the component using the computed mean and the computed standard deviation for the dimension corresponding to the component.

31. The non-transitory computer-readable storage medium according to claim 29, wherein, generating the respective batch-normalized-layer output for each of the training examples based on the normalized-layer outputs includes: For each dimension, transform the components of the normalized-layer output of the training examples in the dimension according to the current value of a parameter set for the dimension.

32. The non-transitory computer-readable storage medium according to claim 28, wherein, the first neural network layer is a convolutional layer, wherein the plurality of components of the first-layer output are indexed by a feature index and a spatial location index, and wherein computing a plurality of normalization statistics for the first-layer output includes, for each feature index among the feature indexes: Compute the mean of the components of the first-layer output corresponding to the feature index; and Calculate the variance of the components of the first layer output corresponding to the feature index.

33. The non-transitory computer-readable storage medium according to claim 32, wherein, Normalizing each component of the plurality of components of each layer output includes: Normalizing the component using the mean and the variance of the feature index corresponding to the component.

34. The non-transitory computer-readable storage medium according to claim 32, wherein, Generating the corresponding batch normalization layer output of each training example in the training examples from the normalized layer output includes: Transforming the component according to the current value of the parameter set of the feature index corresponding to each component of the plurality of components of the normalized layer output.

Citation Information

Patent Citations

  • Method and device for classifying images on basis of convolutional neural network

    CN103544506A

  • Image classification method capable of effectively preventing convolutional neural network from being overfit

    CN104102919A

  • System and method for applying a convolutional neural network to speech recognition

    US20140288928A1