A street-scene segmenter with about 600,000 parameters instead of tens of millions
Driver-assistance software needs to know what is in front of the car: road, pavement, pedestrian, vehicle. The best models for that job are big, and big models need expensive hardware. In this paper we built a much smaller one, SegFast-V2, and tested it against well-known networks on five street-scene datasets.
The problem
The task is called semantic segmentation. The computer looks at a photo and gives every single pixel a label, so the output is a colour-coded map of the scene. Networks that do this well, such as SegNet, UNet and PSPNet, hold tens of millions of numbers (the parameters, the adjustable settings a network learns during training). More parameters mean more memory and more arithmetic for every image.
Our concern was cheaper cars. Autonomous modules are mostly found in expensive vehicles, and we would like such facilities to reach the lower end of the price range too. Traffic in many countries is crowded and varied, so cheap driver assistance could have a large effect there. It has to run on modest hardware without a big drop in reliability.
The idea
SegFast-V2 extends SegFast, our earlier model. It follows the usual encoder-decoder shape: the first half squeezes the image down into compact features, and the second half grows them back into a full-size label map. Copies of early features are passed across to the second half so edges stay sharp. UNet works the same way.
The savings come from three tricks.
- Spark modules. SqueezeNet has a building block called a fire module, which first squeezes the channels and then expands them. Our spark module is a smaller version of it, with depth-wise separable convolutions in place of the 3×3 filters of the expand step.
- Depth-wise separable convolutions. An ordinary filter looks at all channels at once. Here one small spatial filter works on each channel alone, and a cheap 1×1 filter then mixes the channels. The weight count drops from Kh × Kw × C to Kh × Kw + C, so the saving grows in deep layers with many channels. We also apply this trick to the upsampling layers of the decoder.
- Kernel factorization, new in V2. A filter is replaced by a chain of smaller ones. This cuts a 3×3 filter from 9 weights to 6 and a 5×5 filter from 25 to 12, so we could try bigger 5×5 filters without adding many parameters.

We also built SegFast-Mobile, which swaps our encoder for MobileNet, another model designed to be small. It lets us compare our encoder with that alternative. SegFast-Basic is an ablation (a version with one ingredient removed): the same network with ordinary convolutions in place of the separable ones.
What we found
We trained on BDD, CamVid, Cityscapes, Synthia and Mapillary, with images resized to 360 × 480 and no data augmentation. We measured pixel accuracy and mean intersection over union (mean IoU, the overlap between predicted and true regions, averaged over classes). We also timed a single image on a 16-thread Intel Xeon E5-2623 V4 CPU.
The SegFast family has about 600,000 parameters. SegFast has 603,288, SegFast-V2_3 has 599,380 and SegFast-V2_5 has 606,676. SegNet has 29,455,702, UNet 31,033,110, PSPNet 65,606,764 and FCN 134,507,010 (Table 2).
On accuracy, the paper says the SegFast family performs better than the fully convolutional network (FCN) and competes quite closely with SegNet, UNet and PSPNet. Averaged over the five datasets, pixel accuracy is 85.42% for SegFast-V2_3 and 85.56% for SegFast-V2_5. FCN reaches 81.05%, SegNet 86.42%, UNet 87.28% and PSPNet 88.68% (Table 4). On mean IoU, SegFast-V2_5 scores 0.4002, close to SegNet at 0.4003 and below PSPNet at 0.4540 (Table 5). The ablation shows a drop: SegFast-Basic, with ordinary convolutions, reaches 84.64% mean pixel accuracy (Table 4).

The paper suggests a different variant for each need. SegFast uses the least memory, 703 MB (Table 2). SegFast-V2_3 is the network of choice where speed matters most. When accuracy matters most, SegFast-Mobile seems the strongest: it reaches 87.63% mean pixel accuracy with 4,637,526 parameters (Table 2 and Table 4), still far fewer than the large networks.
Results in more detail
The five datasets differ a lot in size. CamVid is the smallest, with 12 classes and 367 training and 101 test images. Mapillary is the largest, with 66 classes and 18,000 training and 2000 test images. BDD has 20 classes (7000 training and 1000 test images), Cityscapes has 30 (2975 and 500) and Synthia has 13 (10,786 and 2621) (Table 1). Every network was trained and tested on each dataset, so the tables below have one column per dataset.
Table 2 puts the size of each network next to its memory use, measured for a single input image. SegFast-Basic is the ablation, the same network with ordinary convolutions. It has 2,965,976 parameters and needs 1232 MB, while SegFast needs 703 MB (Table 2).
| Architecture | Parameters | Memory (MB) |
|---|---|---|
| FCN | 134,507,010 | 3447 |
| SegNet | 29,455,702 | 1515 |
| UNet | 31,033,110 | 1471 |
| PSPNet | 65,606,764 | 2357 |
| SegFast-Mobile | 4,637,526 | 829 |
| SegFast-Basic | 2,965,976 | 1232 |
| SegFast | 603,288 | 703 |
| SegFast-V2_3 | 599,380 | 1101 |
| SegFast-V2_5 | 606,676 | 1199 |
Speed tells a similar story. The paper reports the time for one forward pass (labelling one image) and one backward pass (one learning step) on the CPU. SegFast-Mobile needs 0.66 s for the forward pass, SegFast-Basic 0.419 s, SegFast 0.389 s and SegFast-V2_5 0.409 s. For the backward pass SegFast-V2_3 needs 0.858 s, against 3.25 s for SegNet and 5.23 s for FCN (Table 3). The total training time is the backward-pass time multiplied by the number of samples and epochs. The fastest times came from the versions with kernel factorization, which the paper puts down to fewer floating-point operations. On strong GPUs the differences in time are much smaller, because a GPU runs so much in parallel, but that defeats the purpose of a network meant for low-end hardware.
Table 4 gives pixel accuracy on each dataset. The last column is the mean over the five datasets, with its standard deviation. Every network scores highest on Synthia.
| Architecture | BDD | CamVid | CityScape | Synthia | Mapillary | Mean (± SD) |
|---|---|---|---|---|---|---|
| FCN | 75.31 | 74.22 | 84.28 | 91.81 | 79.62 | 81.05 (± 7.21) |
| SegNet | 82.79 | 88.70 | 86.08 | 92.05 | 82.46 | 86.42 (± 4.06) |
| UNet | 81.77 | 87.70 | 87.39 | 95.43 | 84.11 | 87.28 (± 5.17) |
| PSPNet | 85.17 | 90.79 | 87.84 | 93.64 | 85.98 | 88.68 (± 3.51) |
| SegFast-Mobile | 85.12 | 89.24 | 86.51 | 93.48 | 83.81 | 87.63 (± 3.84) |
| SegFast-Basic | 80.45 | 86.31 | 82.69 | 91.65 | 82.10 | 84.64 (± 4.46) |
| SegFast | 83.48 | 85.08 | 83.71 | 93.58 | 81.63 | 85.50 (± 4.68) |
| SegFast-V2_3 | 81.46 | 85.95 | 84.13 | 93.48 | 82.10 | 85.42 (± 4.84) |
| SegFast-V2_5 | 80.92 | 86.70 | 83.86 | 93.63 | 82.70 | 85.56 (± 4.97) |
The SegFast models are not behind everywhere. On BDD, SegFast-Mobile reaches 85.12% and PSPNet 85.17%. On Synthia, SegFast-V2_5 reaches 93.63% and SegNet 92.05%. On Mapillary, the dataset with the most classes, the five SegFast models score between 81.63% and 83.81%, while the four large networks range from 79.62% to 85.98% (Table 4).
Table 5 repeats the comparison with mean intersection over union, which averages over the classes so that small classes count as much as large ones. Mapillary gives the lowest value for every network and Synthia the highest.
| Architecture | BDD | CamVid | CityScape | Synthia | Mapillary | Mean (± SD) |
|---|---|---|---|---|---|---|
| FCN | 0.3076 | 0.3342 | 0.3503 | 0.5346 | 0.1910 | 0.3435 (± 0.1237) |
| SegNet | 0.3475 | 0.5174 | 0.3702 | 0.5430 | 0.2234 | 0.4003 (± 0.1314) |
| UNet | 0.3473 | 0.5003 | 0.3970 | 0.6767 | 0.2527 | 0.4348 (± 0.1621) |
| PSPNet | 0.4099 | 0.5632 | 0.4190 | 0.6040 | 0.2739 | 0.4540 (± 0.1323) |
| SegFast-Mobile | 0.3773 | 0.5030 | 0.3810 | 0.5810 | 0.2420 | 0.4169 (± 0.1302) |
| SegFast-Basic | 0.3434 | 0.4431 | 0.3210 | 0.5317 | 0.2206 | 0.3720 (± 0.1193) |
| SegFast | 0.3576 | 0.5000 | 0.3400 | 0.5910 | 0.2108 | 0.3999 (± 0.1481) |
| SegFast-V2_3 | 0.3360 | 0.4236 | 0.3500 | 0.5730 | 0.2160 | 0.3797 (± 0.1312) |
| SegFast-V2_5 | 0.3390 | 0.5012 | 0.3471 | 0.5919 | 0.2218 | 0.4002 (± 0.1461) |
Averaged over the datasets, SegFast scores 0.3999 and SegFast-V2_3 scores 0.3797, SegFast-Mobile 0.4169, UNet 0.4348 and FCN 0.3435 (Table 5).
Discussion
Our conclusion is that a compact network can come close to the big ones. In the paper's words, the SegFast family performs better than FCN and competes quite closely with SegNet, UNet and PSPNet, while using far fewer parameters, less memory and less time per image. We also say plainly that the proposed network may not beat most of the larger networks on accuracy, and we argue that the trade-off may be acceptable in certain low-risk scenarios.
Each variant answers a different need. SegFast suits cases where memory matters most, SegFast-V2_3 cases where speed matters most, and SegFast-Mobile cases where performance cannot be compromised, since it seems the strongest while still being much smaller than the large networks. Kernel factorization cuts the parameter count but raises the memory footprint, because more activation maps have to be stored. The larger factorized 5 × 5 kernels did not improve the results significantly. We read this as a sign that the smallest kernels already work well enough for their size.
The comparison has limits. We left DeepLab out because its large field of view and conditional random fields add heavy overhead. Images were resized to 360 × 480 and no augmentation was used. The paper reports timings on a CPU only. We expect that even low-end GPUs could reach real-time performance, since the smallest model has a footprint of only about 700 MB. As a next step we suggest applying the same compression idea to SegNet, UNet and PSPNet.
Sources
The figures and tables listed here are taken from the paper cited at the top of this page; the numbers quoted in the text come from it too.
- Figures: Fig. 1, Fig. 4
- Tables: Table 1: classes and number of training and test images in each dataset; Table 2: parameters and memory use of each network; Table 3: forward-pass and backward-pass time of each network on a CPU; Table 4: pixel accuracy of each network on the five datasets; Table 5: mean intersection over union of each network on the five datasets
Acknowledgements
This work is sponsored by SERB (Government of India, order no. SB/S3/EECE/054/2016, dated 25/11/2016), and was carried out at the Centre for Microprocessor Application for Training Education and Research, CSE Department, Jadavpur University.
Cite the paper
Swarnendu Ghosh, A Pal, S Jaiswal, KC Santosh, N Das, M Nasipuri (2019). SegFast-V2: Semantic image segmentation with less parameters in deep learning for autonomous driving. International Journal of Machine Learning and Cybernetics, Vol. 10, No. 11, pp. 3145–3154 · Springer.
@article{ghosh2019segfast,
author = {Ghosh, Swarnendu and Pal, A and Jaiswal, S and Santosh, KC and Das, N and Nasipuri, M},
title = {{SegFast-V2:} Semantic image segmentation with less parameters in deep learning for autonomous driving},
journal = {International Journal of Machine Learning and Cybernetics},
volume = {10},
pages = {3145--3154},
publisher = {Springer},
year = {2019},
doi = {10.1007/s13042-019-01005-5}
}