Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to Deep Learning Notes
Topic #370

Inception Network

This note zooms into the Inception module itself — the specific building block introduced in GoogLeNet, and refined across several subsequent "Inception v2/v3/v4" versions — the core mechanism behind multi-scale feature extraction in a single layer.

The Inception Module's Structure

Input 1×1 conv 1×1 → 3×3 1×1 → 5×5 pool → 1×1 Concatenate (channel dim)

Four parallel branches — 1×1, 3×3, 5×5 convolutions and pooling — each process the same input independently; their outputs are concatenated along the channel dimension into one combined output.

Why Concatenation, Not Addition

Unlike a residual connection (see ResNet, which adds two tensors of the same shape), the Inception module concatenates its branches' outputs along the channel dimension — each branch contributes its own distinct set of channels to a wider combined output, preserving each branch's distinct type of feature (fine detail from 3×3, broader context from 5×5, and so on) as its own separate group of channels rather than blending them together numerically.

Numerical Example — Channel Counts

If the four branches (after their internal 1×1 reduction) produce 64, 128, 32, and 32 channels respectively, the concatenated output has \(64+128+32+32=256\) total channels — the module's designer chooses each branch's channel count as a hyperparameter, balancing how much of the total output "budget" goes to each scale.

Code — A Simplified Inception Module

import torch
import torch.nn as nn

class InceptionModule(nn.Module):
    def __init__(self, in_channels):
        super().__init__()
        self.branch1 = nn.Conv2d(in_channels, 64, kernel_size=1)
        self.branch2 = nn.Sequential(
            nn.Conv2d(in_channels, 96, kernel_size=1),
            nn.Conv2d(96, 128, kernel_size=3, padding=1)
        )
        self.branch3 = nn.Sequential(
            nn.Conv2d(in_channels, 16, kernel_size=1),
            nn.Conv2d(16, 32, kernel_size=5, padding=2)
        )
        self.branch4 = nn.Sequential(
            nn.MaxPool2d(kernel_size=3, stride=1, padding=1),
            nn.Conv2d(in_channels, 32, kernel_size=1)
        )

    def forward(self, x):
        return torch.cat([self.branch1(x), self.branch2(x), self.branch3(x), self.branch4(x)], dim=1)

Common Mistakes

  • Confusing Inception's channel-wise concatenation with a residual connection's element-wise addition — they combine information in fundamentally different ways, and require matching channel dimensions (concatenation) versus matching full tensor shapes (addition), respectively.
  • Underestimating the design effort involved in choosing each branch's channel counts — these are meaningful hyperparameters, not arbitrary or automatically balanced.

Interview Relevance

Q: "How does an Inception module combine information from its different branches, and why that specific method?" It concatenates each branch's output along the channel dimension, rather than adding them — preserving each branch's distinct type of feature (different kernel-size scales) as its own separate group of channels in the combined output, rather than blending different-scale information together numerically the way addition would.

Practice Question

If an Inception module's four branches produce 32, 64, 16, and 16 channels respectively, how many total channels does the concatenated output have?

Related DL Notes

Want to go beyond the notes?

Join Coding Hubs School of AI's Deep Learning course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →