ArticleslgStudy

engineering

Batch normalization

Batch normalization is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Batch normalization rather than just read about it. In short: In artificial neural networks, batch normalization (also known as batch norm) is a normalization technique used to make training faster and more stable by adjusting the inputs to each layer—re-centering them around zero and re-scaling them to a standard size. It was introduced by Sergey Ioffe and Christian Szegedy in 2015.

Key takeaways

  • Batch normalization belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Batch normalization to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Batch normalization from memory before moving on to harder problems.

Reference excerpt

In artificial neural networks, batch normalization (also known as batch norm) is a normalization technique used to make training faster and more stable by adjusting the inputs to each layer—re-centering them around zero and re-scaling them to a standard size. It was introduced by Sergey Ioffe and Christian Szegedy in 2015. Experts still debate why batch normalization works so well. It was initially thought to tackle internal covariate shift, a problem where parameter initialization and changes in the distribution of the inputs of each layer affect the learning rate of the network. However, newer research suggests it does not fix this shift but instead smooths the objective function—a mathematical guide the network follows to improve—enhancing performance. In very deep networks, batch normalization can initially cause a severe gradient explosion—where updates to the network grow uncontrollably large—but this is managed with shortcuts called skip connections in residual networks. Another theory is that batch normalization adjusts data by handling its size and path separately, speeding up training.

Internal covariate shift Each layer in a neural network has inputs that follow a specific distribution, which shifts during training due to two main factors: the random starting values of the network’s settings (parameter initialization) and the natural variation in the input data. This shifting pattern affecting the inputs to the network’s inner layers is called internal covariate shift. While a strict definition is not fully agreed upon, experiments show that it involves changes in the means and variances of these inputs during training. Batch normalization was first developed to address internal covariate shift. During training, as the parameters of preceding layers adjust, the distribution of inputs to the current layer changes accordingly, such that the current layer needs to constantly readjust to new distributions. This issue is particularly severe in deep networks, because small changes in shallower hidden layers will be amplified as they propagate within the network, resulting in significant shift in deeper hidden layers. Batch normalization was proposed to reduce these unwanted shifts to speed up training and produce more reliable models. Beyond possibly tackling internal covariate shift, batch normalization offers several additional advantages. It allows the network to use a higher learning rate—a setting that controls how quickly the network learns—without causing problems like vanishing or exploding gradients, where updates become too small or too large. It also appears to have a regularizing effect, improving the network’s ability to generalize to new data, reducing the need for dropout, a technique used to prevent overfitting (when a model learns the training data too well and fails on new data). Additionally, networks using batch normalization are less sensitive to the choice of starting settings or learning rates, making them more robust and adaptable.

Procedures

Transformation In a neural network, batch normalization is achieved through a normalization step that fixes the means and variances of each layer's inputs. Ideally, the normalization would be conducted over the entire training set, but to use this step jointly with stochastic optimization methods, it is impractical to use the global information. Thus, normalization is restrained to each mini-batch in the training process. Let us use B to denote a mini-batch of size m of the entire training set. The empirical mean and variance of B could thus be denoted as μB=1m∑i=1mxi and σB2=1m∑i=1m(xi−μB)2. For a layer of the network with d-dimensional input, x=(x(1),...,x(d)), each dimension of its input is then normalized (i.e. re-centered and re-scaled) separately, x̂i(k)=xi(k)−μB(k)(σB(k))2+ϵ, where k∈[1,d] and i∈[1,m]; μB(k) and σB(k) are the per-dimension mean and standard deviation, respectively. ϵ is added in the denominator for numerical stability and is an arbitrarily small positive constant. The resulting normalized activation x̂(k) have zero mean and unit variance, if ϵ is not taken into account. To restore the representation power of the network, a transformation step then follows as yi(k)=γ(k)x̂i(k)+β(k), where the parameters γ(k) and β(k) are subsequently learned in the optimization process. Formally, the operation that implements batch normalization is a transform BNγ(k),β(k):x1...m(k)→y1...m(k) called the Batch Normalizing transform. The output of the BN transform y(k)=BNγ(k),β(k)(x(k)) is then passed to other network layers, while the normalized output x̂i(k) remains internal to the current layer.

Backpropagation The described BN transform is a differentiable operation, and the gradient of the loss l with respect to the different parameters can be computed directly with the chain rule. Specifically, ∂l∂yi(k) depends on the choice of activation function, and the gradient against other parameters could be expressed as a function of ∂l∂yi(k): ∂l∂x̂i(k)=∂l∂yi(k)γ(k), ∂l∂γ(k)=∑i=1m∂l∂yi(k)x̂i(k), ∂l∂β(k)=∑i=1m∂l∂yi(k),∂l∂σB(k)2=∑i=1m∂l∂yi(k)(xi(k)−μB(k))(−γ(k)2(σB(k)2+ϵ)−3/2), ∂l∂μB(k)=∑i=1m∂l∂yi(k)−γ(k)σB(k)2+ϵ+∂l∂σB(k)21m∑i=1m(−2)⋅(xi(k)−μB(k)), and ∂l∂xi(k)=∂l∂x̂i(k)1σB(k)2+ϵ+∂l∂σB(k)22(xi(k)−μB(k))m+∂l∂μB(k)1m.

Inference During the training stage, the normalization steps depend on the mini-batches to ensure efficient and reliable training. However, in the inference stage, this dependence is not useful any more. Instead, the normalization step in this stage is computed with the population statistics such that the output could depend on the input in a deterministic manner. The population mean, E[x(k)], and variance, Var⁡[x(k)], are computed as: E[x(k)]=EB[μB(k)], and Var⁡[x(k)]=mm−1EB[(σB(k))2]. The population statistics thus is a complete representation of the mini-batches. The BN transform in the inference step thus becomes y(k)=BNγ(k),β(k)inf(x(k))=γ(k)x(k)−E[x(k)]Var⁡[x(k)]+ϵ+β(k), where y(k) is passed on to next layers instead of x(k). Since the parameters are fixed in this transformation, the batch normalization procedure is essentially applying a linear transform to the activation function.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Batch normalization

Start with the simplest possible case. Write down what Batch normalization claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Batch normalization before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Batch normalization ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Batch normalization

In research
Batch normalization appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Batch normalization in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Batch normalization is common in secondary-school and first-year university syllabi. It links to neighbouring topics Artificial intelligence engineering, so understanding it makes those chapters shorter.
In everyday life
Look for Batch normalization outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Batch normalization” →

How to study Batch normalization in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Batch normalization means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Batch normalization out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Batch normalization in simple terms?

In artificial neural networks, batch normalization (also known as batch norm) is a normalization technique used to make training faster and more stable by adjusting the inputs to each layer—re-centering them around zero and re-scaling them to a standard size. It was introduced by Sergey Ioffe and C…

Why does Batch normalization matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Batch normalization?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Batch normalization.

Tags

  • Artificial intelligence engineering

Keep exploring