# ClipQ: Clipping Optimization for the Post-Training Quantization of Convolutional Neural Network
## 4 Experiments
### Ablation Study  
In this section, we show the effect of parameter attention on weight and activation clipping and make a comparison with other clip optimization methods. Table 4 compares different weight clipping methods. The weight is quantized to 6 bits, while the activation is kept to floating-point precision. Max makes the maximum and minimum weight as the clip threshold. MSE minimizes the L2 distance of weight quantization deviation by linear search. CS is similar to MSE, with cosine similarity evaluating quantization deviation. ClipQ shows the quantization results of ClipQ without considering attention. Overall, Max's performance is the worst. Due to the small number of weights, the performance of ACIQ based on statistical distribution is unsatisfactory. MSE outperforms the other clip threshold techniques, except for ClipQ in nearly all cases. For SSD and YoloX, the difference between MSE and ClipQ is small. MSE is still inferior to ClipQ from the quantization results of other networks. For PSPNet, ClipQ achieves the precision of the floating-point model, but MSE results in nearly 3% accuracy drop with a final accuracy of \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Max** & **CS** & **MSE** & **ACIQ** & **ClipQ-** & **ClipQ** \\ \hline MobileNetV2 & 66.61\% \(\pm\) 0.1\% & 69.46\% \(\pm\) 0.2\% & 70\% \(\pm\) 0.2\% & 66.59\% \(\pm\) 0.3\% & 69.27\% \(\pm\) 0.3\% & 70.37\% \(\pm\) 0.2\% \\ MnasNetV1 & 36.53\% \(\pm\) 0.2\% & 56.13\% \(\pm\) 0.3\% & 51.78\% \(\pm\) 0.3\% & 35.36\% \(\pm\) 0.4\% & 55.31\% \(\pm\) 0.4\% & 64.33\% \(\pm\) 0.2\% \\ PSPNet & 64.28\% \(\pm\) 0.1\% & 66.9\% \(\pm\) 0.2\% & 67.2\% \(\pm\) 0.2\% & 63.82\% \(\pm\) 0.3\% & 66.63\% \(\pm\) 0.3\% & 69.82\% \(\pm\) 0.3\% \\ DeepLabV3+ & 72.58\% \(\pm\) 0.1\% & 74.46\% \(\pm\) 0.2\% & 74.42\% \(\pm\) 0.2\% & 71.88\% \(\pm\) 0.3\% & 73.83\% \(\pm\) 0.2\% & 74.75\% \(\pm\) 0.2\% \\ YoloX & 30.7\% \(\pm\) 0.2\% & 30.9\% \(\pm\) 0.3\% & 30.9\% \(\pm\) 0.2\% & 28.7\% \(\pm\) 0.4\% & 30.2\% \(\pm\) 0.3\% & 31.1\% \(\pm\) 0.2\% \\ SSD & 20.2\% \(\pm\) 0.2\% & 20.4\% \(\pm\) 0.1\% & 20.5\% \(\pm\) 0.1\% & 19.6\% \(\pm\) 0.4\% & 19.6\% \(\pm\) 0.2\% & 20.7\% \(\pm\) 0.1\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of weight clipping methods. Figure 11: Visualization of the quantization performance of the semantic segmentation network, with the quantization width being 6 bit. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **FCN** & **PSPNet** & **DeepLabV3+** & **PSANet** & **GCNet** \\ \hline Model Size (MB) & 51.4 & 54.7 & 61.2 & 236.9 & 198.8 \\ FP32 & 70.8\% \(\pm\) 0.15\% & 69.82\% \(\pm\) 0.1\% & 75.33\% \(\pm\) 0.13\% & 77.92\% \(\pm\) 0.1\% & 78.12\% \(\pm\) 0.15\% \\ ClipQ-8-bit & 70.79\% \(\pm\) 0.26\% & 70.76\% \(\pm\) 0.25\% & 75.49\% \(\pm\) 0.2\% & 78.2\% \(\pm\) 0.22\% & 77.98\% \(\pm\) 0.25\% \\ Jacob-6 bit & 69.6\% \(\pm\) 0.28\% & 59.07\% \(\pm\) 0.36\% & 67.5\% \(\pm\) 0.34\% & 72.17\% \(\pm\) 0.31\% & 74.17\% \(\pm\) 0.35\% \\ ACIQ-6 bit & 70.4\% \(\pm\) 0.31\% & 61.92\% \(\pm\) 0.35\% & 71.11\% \(\pm\) 0.32\% & 77.03\% \(\pm\) 0.3\% & 76.8\% \(\pm\) 0.3\% \\ ClipQ-6 bit & 70.4\% \(\pm\) 0.2\% & 69.69\% \(\pm\) 0.23\% & 72.97\% \(\pm\) 0.22\% & 77.62\% \(\pm\) 0.23\% & 77.22\% \(\pm\) 0.22\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Quantization Results of Object Detection and Semantic Segmentation Networks (FCN, PSPNet, DeepLabV3+, PSANet, GCNet). 67.2%. ClipQ's performance on MnasetV1 overshadows other methods, with more than an 8% accuracy improvement. When ClipQ does not consider parameter attention, its performance is even inferior to MSE and CS, which illustrates the effect of parameter attention on weight clipping. Thanks to the ability of the particle swarm algorithm to automatically adjust the search step size, ClipQ can easily obtain better quantitative results. But for CS and MSE, we try multiple sets of search intervals and search steps to improve their performance. Next, we quantize the activations to 6 bits and keep the weights in floating-point precision.