Filter Grafting for Deep Neural Networks: Reason, Method, and Cultivation

Hao Cheng, Fan‐Xu Meng, Ke Li, Yuting Gao, Guangming Lu, Xing Sun, Rongrong Ji · DOI

Abstract

Filter is the key component in modern convolutional neural networks (CNNs). However, since CNNs are usually over-parameterized, a pre-trained network always contain some invalid (unimportant) filters. These filters have relatively small $l_{1}$ norm and contribute little to the output (Reason). While filter pruning removes these invalid filters for efficiency consideration, we tend to reactivate them to improve the representation capability of CNNs. In this paper, we introduce filter grafting (Method) to achieve this goal. The activation is processed by grafting external information (weights) into invalid filters. To better perform the grafting, we develop a novel criterion to measure the information of filters and an adaptive weighting strategy to balance the grafted information among networks. After the grafting operation, the network has fewer invalid filters compared with its initial state, enpowering the model with more representation capacity. Meanwhile, since grafting is operated reciprocally on all networks involved, we find that grafting may lose the information of valid filters when improving invalid filters. To gain a universal improvement on both valid and invalid filters, we compensate grafting with distillation (Cultivation) to overcome the drawback of grafting. Extensive experiments are performed on the classification and recognition tasks to show the superiority of our method.

What Problem Does This Paper Address?

Modern Convolutional Neural Networks (CNNs) are notoriously over-parameterized. Research has long shown that many filters in a trained network are "invalid"—they have very small weights (low $l_1$ norm) and contribute almost nothing to the final output. These filters represent "dead zones" in the network's architecture that fail to capture meaningful features.

Visualization of filter diversity within a network layer, where gray blocks represent invalid filters.

The standard industry response to this redundancy is filter pruning: identifying these unimportant filters and cutting them out to create a leaner, faster model. However, the authors of this paper ask a different question: What if we don't want a smaller model, but a better one? Instead of abandoning these filters, can we "reactivate" them to increase the network's representation capacity?

Methods: The Filter Grafting Framework

The authors propose a three-pillar approach: Reason, Method, and Cultivation.

The Method (Grafting)

Borrowing a concept from botany, the authors treat invalid filters as "rootstocks" and useful information from other networks as "scions." They train multiple networks in parallel. At the end of each epoch, weights from a more "informative" network are grafted into the less informative filters of another. Unlike pruning, which reduces the model size, grafting maintains the architecture while filling it with more useful parameters.

Comparison of Filter Pruning (removing filters) and Filter Grafting (reactivating filters with external weights).

The Criterion (Entropy)

While many use the $l_1$ norm (the sum of absolute values) to measure filter importance, this paper argues that Entropy is a better metric. Entropy measures the variation of weights; a filter with high entropy contains more information and diversity, making it a better candidate for grafting. This ensures that the "scions" being grafted are actually high-quality features.

Adaptive Weighting

To ensure the grafting is balanced, the researchers use an arctan-based adaptive weighting strategy. This prevents a "strong" network from being overwhelmed by a "weak" one, ensuring that each network retains its own learned features while absorbing external knowledge. This reciprocal process allows multiple models to improve each other simultaneously.

Cultivation: Grafting+ and Distillation

The authors observed a potential drawback: while grafting helps invalid filters, it can sometimes slightly degrade the performance of already "valid" (strong) filters due to the weight averaging or replacement process. To fix this, they introduce Grafting+, which combines grafting with Knowledge Distillation (KD).

In this "Cultivation" phase, grafting reactivates the weak filters while distillation reinforces the strong ones. This creates a synergy where the network's overall density of useful filters increases without sacrificing the quality of existing features.

Experimental Results

The researchers validated their approach across several diverse benchmarks, including CIFAR-10, CIFAR-100, ImageNet, and Person Re-identification (ReID) tasks.

Key Insights

  • External vs. Internal: The authors proved that grafting filters from within the same network doesn't add new information. To truly boost capacity, you must bring in "scions" from an external source (a parallel network).
  • One-Stage Efficiency: Unlike traditional Knowledge Distillation, which often requires a pre-trained "Teacher" model, filter grafting is a one-stage process where multiple "Student" models help each other grow.
  • Visual Proof: Heatmaps showed that after grafting, the number of "black" (near-zero weight) filters drops significantly. Under a threshold of $1e-3$, the baseline network had nearly 50% invalid filters; after grafting, that ratio dropped to nearly 0%.

Performance Gains

The improvements were consistent across different architectures (ResNet, MobileNetV2, WRN):

  • CIFAR-100: On MobileNetV2, accuracy jumped from 71.44% to 75.55%.
  • ImageNet: For ResNet-50, Top-1 accuracy improved from 75.92% to 76.76%.
  • Person ReID: On the Market1501 dataset, the Mean Average Precision (mAP) for a ResNet50 increased from 67.6% to 73.33%.

Conclusion

Filter Grafting offers a novel perspective on model optimization. While pruning focuses on efficiency, grafting focuses on capacity. By reactivating "dead" filters through external weight transfer and reinforcing them with distillation, the authors demonstrate that we can significantly improve the performance of standard CNN architectures without any additional inference cost. Future work may explore grafting between heterogeneous architectures, potentially allowing small models to learn directly from the filter structures of much larger ones.

Summary updated

Abstract

Filter is the key component in modern convolutional neural networks (CNNs). However, since CNNs are usually over-parameterized, a pre-trained network always contain some invalid (unimportant) filters. These filters have relatively small $l_{1}$ norm and contribute little to the output (\textbf{Reason}). While filter pruning removes these invalid filters for efficiency consideration, we tend to reactivate them to improve the representation capability of CNNs. In this paper, we introduce filter grafting (\textbf{Method}) to achieve this goal. The activation is processed by grafting external information (weights) into invalid filters. To better perform the grafting, we develop a novel criterion to measure the information of filters and an adaptive weighting strategy to balance the grafted information among networks. After the grafting operation, the network has fewer invalid filters compared with its initial state, enpowering the model with more representation capacity. Meanwhile, since grafting is operated reciprocally on all networks involved, we find that grafting may lose the information of valid filters when improving invalid filters. To gain a universal improvement on both valid and invalid filters, we compensate grafting with distillation (\textbf{Cultivation}) to overcome the drawback of grafting . Extensive experiments are performed on the classification and recognition tasks to show the superiority of our method. Code is available at \textcolor{black}{\emph{https://github.com/fxmeng/filter-grafting}}.
BibTeX
@misc{cheng2020filter,
  author = {Hao Cheng and Fan‐Xu Meng and Ke Li and Yuting Gao and Guangming Lu and Xing Sun and Rongrong Ji},
  title = {{Filter Grafting for Deep Neural Networks: Reason, Method, and Cultivation}},
  year = {2020},
  eprint = {2004.12311},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.12311},
}
Figure