Skip to content

Segmentic: Semantic Segmentation and Model Pruning

Completed

PyTorch · MobileNetV3 · DeepLabV3+ · Model Pruning · ONNX

View code on GitHub

Overview

Segmentic is an experimental semantic segmentation pipeline I developed to explore the trade-off between model pruning, segmentation accuracy, and inference speed.

The objective was to evaluate how much computation could be reduced while maintaining acceptable segmentation quality.

Implementation

I used a MobileNetV3 backbone with a DeepLabV3+ segmentation architecture, fine-tuned on Pascal VOC 2012.

I applied different pruning levels, ranging from 0.1 to 0.4, and evaluated each configuration using three metrics:

  • Pixel Accuracy, to measure the proportion of correctly classified pixels.
  • Mean Intersection over Union (mIoU), to evaluate segmentation quality across classes.
  • Frames per second (FPS), to measure inference throughput.

The experiments were implemented using PyTorch and PyTorch Lightning.

I also experimented with ONNX export and post-training quantization, although the quantized model was not benchmarked separately.

Results

Model Pixel Accuracy mIoU FPS
Baseline FP32 91.59% 0.6609 32.57
Pruned 0.1 91.42% 0.5931 38.09
Pruned 0.2 90.83% 0.5794 37.96
Pruned 0.3 88.39% 0.5363 37.28
Pruned 0.4 (v1) 79.14% 0.4252 36.67
Pruned 0.4 (v2) 91.20% 0.5833 37.65

The 0.1 configuration increased throughput by approximately 17% compared with the baseline, while pixel accuracy decreased by only 0.17 percentage points.

However, mIoU decreased from 0.6609 to 0.5931, showing a more substantial reduction in segmentation quality.

Increasing the pruning level did not consistently improve throughput. In particular, the 0.3 configuration was slower and less accurate than the 0.1 configuration.

The two experiments at pruning level 0.4 also produced substantially different results, suggesting that the pruning configuration or experimental conditions affected the outcome.

These measurements illustrate the trade-offs observed in this experiment; they do not establish performance on edge hardware.