Neural Network Pruning for Real-time Polyp Segmentation

Suman Sapkota, Pranav Poudel, Sudarshan Regmi, Bibek Panthi, Binod BhattaraiarXiv 2023

TL;DR

This paper applies neuron-level network pruning to the UNet architecture to enable real-time polyp segmentation during colonoscopies. By introducing a squared, gradient-normalized Taylor First Order approximation to score filter importance, the authors cut computational complexity (FLOPs) in half and reduce inference latency by up to 30% with virtually no loss in segmentation accuracy—all without requiring any post-pruning fine-tuning.

What Problem Does This Paper Address?

Colorectal cancer prevention relies heavily on identifying and removing polyps during colonoscopies. However, clinical studies show that between 17% and 28% of polyps are missed during standard screenings. While deep learning models (like UNet) offer excellent accuracy for automated polyp segmentation, their massive size and high computational latency create a major bottleneck for real-time clinical deployment.

Medical practitioners face a tough trade-off: use large, accurate models that are too slow for real-time video feeds, or use lightweight, custom architectures that sacrifice segmentation quality. This paper tackles this challenge by using neural network pruning to eliminate structural redundancies in large, pre-trained models, making them fast enough for real-time assistance without compromising clinical efficacy.

Methods

The authors focus on neuron-level (channel) pruning within convolutional layers. Unlike unstructured weight pruning, which requires specialized hardware to see speed gains, channel pruning removes entire filters. This directly reduces matrix dimensions, translating to immediate speedups on standard GPUs.

To determine which filters to eliminate, the authors calculate a global importance score using a modified Taylor First Order (TaylorFO) approximation. Their approach combines two signals:

  1. Forward Signal: The pre-activation value ($x_i$), which captures how the input data affects a specific neuron.
  2. Backward Signal: The gradient ($\delta x_i$), which indicates how the network's output changes if that neuron is removed.

The authors introduce two key innovations to fix flaws in standard TaylorFO pruning:

  • The Squared Importance Metric: Standard TaylorFO can assign a deceptively low importance score if the gradient is highly negative, even though a large negative gradient means the neuron drastically impacts the network. Squaring the metric ($I^s_i$) ensures that any neuron causing a large output deviation—positive or negative—is preserved.
  • Gradient Normalization: Different input images produce gradients of vastly different magnitudes. To prevent a handful of outlier images from dominating the pruning decisions, the authors normalize the gradients to a unit magnitude ($\parallel\Delta y_n\parallel = 1$) before backpropagation. This ensures every calibration image contributes equally to the final importance score.
Fig. 1. Left: Unpruned UNet Model. Right: Model After Purning convolution filters with low importance score. The exact number of pruned filters is 956, extracted from experiment shown in Fig 2 (top).

Datasets

The method was evaluated using the Kvasir Segmentation Dataset (Kvasir-SEG), a standard open-source benchmark containing gastrointestinal polyp images and their corresponding ground-truth segmentation masks.

Key Insights and Ideas

  • Massive Latent Redundancy: Pre-trained medical segmentation networks are heavily over-parameterized. The authors discovered that roughly 50% of the network's neurons (~1,500 out of 2,944) can be completely stripped away before the Intersection over Union (IoU) metric experiences a severe drop.
  • Data-Efficient Calibration: Finding which filters to prune does not require a massive dataset. The authors demonstrated that calibrating the importance scores with as few as 39 or 235 data samples yields highly effective, stable pruned architectures.
  • Skipping the Fine-Tuning: Traditionally, pruning requires computationally expensive "fine-tuning" cycles to recover lost accuracy. This method achieves significant compression directly out of the box, proving the high fidelity of their gradient-normalized scoring metric.

Key Results

The authors evaluated their approach by measuring the trade-offs between the number of neurons pruned, Mean IoU, parameters, FLOPs, and actual wall-clock inference time.

Fig. 2. (Top) row is the Number of Neurons Pruned vs IoU and Parameters plot. (Bot) row is the Number of Neurons Pruned vs Time-taken and Giga-FLOPs plot. Here, Time-taken is measured in seconds for the inference of 100 samples with 10 batch size. (Left) column shows pruning performance using 39 data samples for importance estimation. A sample pruning of 956 neurons reduces the FLOPs to 0.477× and pa- rameters to 0.864× while retaining performance to 0.99× the original performance (≈0.5795 IoU). The time taken is reduced by ≈30%. (Right) column shows pruning performance using 235 data samples for importance estimation. A sample pruning of 736 neurons reduces the FLOPs to 0.54× and parameters to 0.922× while retaining the same performance (≈0.5879 IoU). Here, we manage to reduce time taken by ≈26%.
  • 30% Faster Inference: Using just 39 samples for calibration, pruning 956 neurons reduced FLOPs to 0.477× and parameters to 0.864× of the original model. This cut wall-clock inference time by ~30% while retaining 99% of the original performance (dropping negligibly from 0.59 to 0.5795 IoU).
  • Zero-Loss Compression: Using 235 calibration samples, pruning 736 neurons cut FLOPs to 0.54× and reduced inference time by 26% with absolutely zero loss in original performance (maintaining ~0.5879 IoU).

Qualitative visual assessments confirm that the pruned models maintain clean, accurate boundary definitions around polyps compared to the unpruned baseline.

Fig. 3. Qualitative comparison of Polyp Segmentation before and after pruning of the UNet model. The pruned model samples are generated from experiment in Fig (2 left with 956 neurons pruned).

Limitations and Future Work

While the results are promising for real-time deployment, the paper notes a few limitations:

  • No Post-Pruning Fine-Tuning: Although skipping fine-tuning highlights the strength of the importance metric, incorporating a brief retraining phase would likely allow for even more aggressive pruning ratios or fully recover the minor IoU drops.
  • Architecture Scope: The experimental validation was restricted solely to the hierarchical structure of UNet. While the mathematical framework is architecture-agnostic, its performance on alternative backbones (like ResNet or Vision Transformers) remains to be verified.

Summary updated

BibTeX
@misc{sapkota2023neural,
  author = {Suman Sapkota and Pranav Poudel and Sudarshan Regmi and Bibek Panthi and Binod Bhattarai},
  title = {{Neural Network Pruning for Real-time Polyp Segmentation}},
  year = {2023},
  eprint = {2306.13203},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.13203},
}
Figure