← Back to Deep Learning Mind Map
🧠 Deep LearningID: depthwise-separable

Depthwise Separable Conv

深度可分离卷积
🎯Core Definition
Depthwise separable convolution splits a standard conv into two steps: Depthwise — each channel is convolved independently with one k×kk \times k kernel (no cross-channel mixing); Pointwise — a 1×11 \times 1 conv mixes channels linearly. FLOPs ratio: standard conv =k2CinCoutHW= k^2 C_{in} C_{out} HW vs separable =k2CinHW+CinCoutHW= k^2 C_{in} HW + C_{in} C_{out} HW (HWHW = output spatial size), giving 1Cout+1k2\frac{1}{C_{out}} + \frac{1}{k^2} — the first term from pointwise, the second from depthwise. With k=3k=3, Cout=256C_{out}=256: 1256+19≈0.0039+0.1111≈0.114\frac{1}{256} + \frac{1}{9} \approx 0.0039 + 0.1111 \approx 0.114, i.e. ~11.4% of standard-conv compute, an ~8.8× saving; parameters shrink by the same ratio (identical formula).
💡Use Cases
the core operator of MobileNetV1 (replacing every standard conv); MobileNetV2 adds inverted residuals + linear bottlenecks. Interviews ask for the FLOPs-ratio derivation, what exactly is saved, and why the 1×1 conv is essential.
⚡Key Problems Solved
decoupling spatial convolution from channel mixing changes compute from proportional to Cin×CoutC_{in} \times C_{out} to Cin+CoutC_{in} + C_{out}; at the cost of only ~1–2 top-1 accuracy points (ImageNet ~70.6% vs ~71.7% baseline), compute and parameters shrink ~8.8×, making vision models run in real time on mobile devices.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Depthwise Separable Conv.
Use Cases
In production engineering, what are the primary use cases for Depthwise Separable Conv and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Derive the depthwise-separable vs standard-conv compute ratio 1Cout+1k2\frac{1}{C_{out}} + \frac{1}{k^2}; where does each term come from?
2
Hand-compute: 3×3 depthwise separable conv with C_out=256 — what fraction of standard-conv compute is left, and what is the saving?
3
Why does MobileNet need the 1×1 pointwise conv? What breaks if you keep only depthwise?
4
What is MobileNetV2's inverted residual (linear bottleneck)? Why does ReLU destroy low-dimensional features?
5
How do depthwise separable conv and grouped conv (e.g. ResNeXt's 32 groups) differ in compute and expressiveness?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Depthwise Separable Conv"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardResNet Skip ConnectionsNext Card →ViT & Inductive Bias

🔗 More Deep Learning Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/DL/card/depthwise-separable
中文速览与面试要点

深度可分离卷积 (Depthwise Separable Conv)

定义: 深度可分离卷积把标准卷积拆成两步: Depthwise——每通道独立用一个 k k 核做空间卷积(不跨通道); Pointwise——1 1 卷积跨通道线性混合。算力比推导: 标准卷积 FLOPs = k^2 C_in C_out HW, 深度可分离为 k^2 C_in HW + C_in C_out HW(HW 为输出空间尺寸), 比值 = 1C_out + 1k^2——第一项来自 pointwise、第二项来自 depthwise。代入 k=3、C_out=256: 1256 + 19 0.0039 + 0.1111 0.114, 即计算量约为标准卷积的 11.4%, 节省约 8.8×; 参数量同步缩小(比值公式相同)。 使用场景: MobileNetV1 的核心算子(全网络替换标准卷积), MobileNetV2 再叠加反向残差+线性瓶颈; 面试必考推导算力比、解释省在哪里、以及为什么 1×1 卷积不可省。 解决的问题: 把“空间卷积”与“通道混合”解耦, 使卷积计算量从与 C_in C_out 成正比降为与 C_in + C_out 成正比, 在 top-1 精度仅损失约 1~2 个百分点(ImageNet 上 ~70.6% vs 标准卷积基线 ~71.7%)的代价下将算力与参数量压缩约 8.8×, 让视觉模型能在移动端实时运行。

核心要点

  • 推导深度可分离卷积相对标准卷积的算力比 1C_out + 1k^2, 说明两项各自来源。
  • 手算: 3×3 深度可分离卷积, C_out=256, 计算量约为标准卷积的多少? 省了多少倍?
  • 为什么 MobileNet 需要 1×1 pointwise 卷积? 只用 depthwise 会怎样?
  • MobileNetV2 的反向残差(线性瓶颈)是什么? 为什么 ReLU 会破坏低维特征?
  • 深度可分离卷积与分组卷积(如 ResNeXt 的 32 组)在算力和表达力上有什么区别?