Abstract
Moonshine introduces a structural distillation strategy for model compression that preserves a teacher network's macro-architecture while replacing standard convolutions with efficient "cheap" alternatives, such as grouped and bottleneck blocks. By employing attention transfer during training, these student networks achieve significantly better memory-to-accuracy trade-offs than traditional methods that simply reduce depth or width. Our results demonstrate that these structurally transformed models can match or even exceed the performance of their larger teachers with a fraction of the parameters.
Introduction
The deployment of state-of-the-art deep learning models is frequently limited by the massive memory and computational requirements of modern architectures. Standard approaches to model compression typically involve "thinning" (reducing channel counts) or making networks "shallower" (removing layers). However, these methods often require extensive manual redesign and can lead to a disproportionate loss in representational power. Moonshine addresses this by asking: how can we substantially reduce parameter counts without sacrificing the benefits of a deep, complex architecture?
Methods: Structural Model Distillation
The core of the Moonshine approach is Structural Model Distillation. Instead of designing a new, smaller architecture, the student is created as a direct structural transformation of the teacher.
The "Cheap" Blocks
Standard $3 \times 3$ convolutions are replaced with one of three efficient block types:
- $G(g)$ (Grouped + Pointwise): Uses a grouped convolution followed by a $1 \times 1$ pointwise convolution to mix information across groups.
- $B(b)$ (Bottleneck): Shrinks the channel dimension by factor $b$ using a $1 \times 1$ convolution before performing spatial operations, then expands back.
- $BG(b, g)$ (Bottleneck Grouped): A hybrid approach combining both bottlenecking and grouping for maximum efficiency.
Distillation via Attention Transfer
To recover the performance lost by using these cheaper operations, the authors utilize Attention Transfer (AT). Unlike standard Knowledge Distillation (KD) which matches final logits, AT forces the student to mimic the spatial activation maps of the teacher at intermediate layers. This teaches the student not just what to predict, but which spatial features are most relevant for the task.
Key Results and Analysis
The effectiveness of Moonshine was evaluated across CIFAR-10/100, ImageNet, and Cityscapes. A primary finding is that architecture preservation is superior to building smaller standard networks from scratch.
- CIFAR-10: A student using $BG(2, 2)$ blocks achieved a 5.57% error rate, outperforming a standard WideResNet-16-2 (5.66% error) while using less than half the parameters (287K vs 692K).
- ImageNet: A ResNet-34 teacher was distilled into a Res34-G(4) student. The student achieved a top-5 error of 8.43%, actually surpassing the teacher's 8.57% error while saving 13 million parameters.
- Semantic Segmentation: On Cityscapes, the authors reduced an ERFNet's parameters by 75% with only a minor drop in Intersection-over-Union (IoU) from 70.59 to 68.11.
Conclusion
Moonshine demonstrates that structural transformation combined with attention transfer is a powerful paradigm for model compression. By maintaining the macro-architecture of high-performing teachers, engineers can achieve significant efficiency gains without the overhead of manual architecture search. Future work may explore automated search for optimal grouping factors and more complex approximations for the remaining $1 \times 1$ pointwise bottlenecks.
Summary updated