# ClipQ: Clipping Optimization for the Post-Training Quantization of Convolutional Neural Network
## 5 Conclusions  
This paper proposes ClipQ, a clipping optimization algorithm for post-training quantization of convolutional neural networks. We introduce how to evaluate spatial attention, channel attention and weight attention. By giving more attention to important parameters, their quantization deviation will be preferentially reduced. The application of the particle swarm optimization algorithm further improves the performance of weight clipping. Under 8-bit, in the more than ten networks quantized in this paper, except for MnasNetV1, ClipQ's accuracy loss is within 0.5%. For semantic segmentation tasks as well as non-lightweight networks, ClipQ performs very well, with an average accuracy drop of less than 0.1%. In ablation experiments, ClipQ achieves an average improvement of 1.3% (weight clipping) and 0.53%(activation clipping) over the best results of other clipping methods. Further, we have completed the deployment of the quantization network in the FPGA, demonstrating the practical application capabilities of ClipQ.  
In the future, we will explore the application of ClipQ in mixed precision quantization methods. By optimizing the bit distribution space of each layer in the network model and assigning different quantization bit widths to each layer, we will further improve the performance of the network model. At the same time, we will combine ClipQ with other post-training quantization techniques, such as weight preprocessing and bias correction to achieve high-precision post-training 4-bit quantization.  
Investigation, Y.C.; Software, Y.C., H.Z. and C.Z.; Data Curation, H.Z.; Validation, H.Z.; Conceptualization, C.Z.; Project administration, C.Z.; Methodology, Y.L.; Formal analysis, Y.L.; Supervision, Y.L.; Writing--review and editing, Y.C.; Writing--original draft, C.Z. All authors have read and agreed to the published version of the manuscript.  
This research was supported by the Startup Foundation for Introducing Talent of NUIST (No. 2023r124) and the Enterprise Cooperation Project (No. 2024h570).  
Not applicable.  
The datasets we used in this study are ImageNet2012, MS COCO 2017, and Cityscapes, and they are openly available at [[https://image-net.org/challenges/LSVRC/2012/2012-downloads.php/](https://image-net.org/challenges/LSVRC/2012/2012-downloads.php/)]([https://image-net.org/challenges/LSVRC/2012/2012-downloads.php/](https://image-net.org/challenges/LSVRC/2012/2012-downloads.php/)) (accessed on 7 August 2022), [[https://paperswithcode.com/dataset/coco/](https://paperswithcode.com/dataset/coco/)]([https://paperswithcode.com/dataset/coco/](https://paperswithcode.com/dataset/coco/)) and [[https://www.cityscapes-dataset.com/](https://www.cityscapes-dataset.com/)]([https://www.cityscapes-dataset.com/](https://www.cityscapes-dataset.com/)) (accessed on 7 August 2022), respectively.  
The authors declare no conflicts of interest.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **Fake-Quantization** & **FPGA** \\ \hline MnasNetV1 & 66.5\% & 66.31\% \\ MobileNetV2 & 71.57\% & 71.52\% \\ FCN & 70.79\% & 70.6\% \\ SSD & 21.1\% & 21\% \\ YoLoV3 & 23.5\% & 23.4\% \\ \hline \hline \end{tabular}
\end{table}
Table 6: FPGA Implementation Results.