Comprehensive Analysis of Network Depth and Numerical Precision on MNIST Classification:Training Dynamics and Deployment Efficiency
Abstract
Today’s deep learning field is developing rapidly, and its focus is no longer limited to pursuing the ultimate accuracy of models on large servers, but paying more and more attention to how to improve model efficiency in order to deploy it to edge devices. In this study, we focus on how adjusting the two key knobs of network depth and numerical precision affects the performance of neural networks. We used the classic MNIST dataset as a test benchmark to examine fully connected neural networks with depths ranging from 2 to 10 layers.In the experimental part, we compared traditional FP32 training with FP16 mixed-precision training, and further studied the impact of introducing INT8 dynamic quantization after training. The results show that FP16 mixed-precision training is very effective: compared with the FP32 model, its accuracy loss is minimal (usually less than 0.2%) and can benefit from hardware acceleration. At the same time, in the simulated deployment experiment, we found that INT8 dynamic quantization can greatly reduce the model size by about 70–75%, while the decrease in accuracy is very limited (only about 0.5–1.2%). This result confirms our conjecture: in resource-constrained environments such as Internet of Things devices or mobile processors, reducing numerical precision is not only practical, but also an efficient means for large-scale applications.
References
- Han, S., Pool, J., Tran, J., and Dally, W. Learning both Weights and Connections for Efficient Neural Network. In Advances in Neural Information Processing Systems (NIPS), 2015.
- Gholami, A., Kim, S., Dong, Z., Yao, Z., Gholami, M. W., and Keutzer, K. A Survey of Quantization Methods for Efficient Neural Network Inference. Low-Power Computer Vision, 2021.
- LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Pro-ceedings of the IEEE, 86(11):2278–2324, 1998.
- Micikevicius, P., Narang, S., Alben, J., Diamos, G., Elsen, E., Garcia, D., et al. Mixed Precision Training. arXiv preprint arXiv:1710.03740, 2017.
- Nagel, M., Amjad, R. A., van Baalen, M., Louizos, C., and Blankevoort, T. A White Paper on Neural Network Quantization. arXiv preprint arXiv:2106.08295, 2021.