Submitted:
05 October 2025
Posted:
06 October 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Research Methods
2.1. Data
2.2. Generalized method
3. Results and Discussion
3.1. Size and Accuracy
3.2. Calibration
3.3. Visualization of Activation Map
4. Conclusions
References
- AMD. GitHub. Retrieved from AMD QUARK. 2025. Available online: https://github.com/amd/Quark.
- Geiger, A. 2025. Available online: https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_label_2.zip.
- Geiger, A. Amazon. Retrieved from Kitti images. 2025. Available online: https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_image_2.zip.
- Geiger, A. Amazon. Retrieved from Kitti labels. 2025. Available online: https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_label_2.zip.
- Dhungana, P. YOLO-Based Pipeline Monitoring in Challenging Visual Environments. *arXiv preprint*. 2025. [Google Scholar]
- Dosovitskiy, A. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. *arXiv preprint*. 2021. [Google Scholar]
- Draper, D. The Practical Scope of the Central Limit Theorem. *arXiv preprint*. 2021. [Google Scholar]
- Google. Interest over time. 2025. Available online: https://trends.google.com/trends/explore?date=2020-01-01%202025-04-07&q=%2Fg%2F11gd3905v1,%2Fg%2F11bwp1s2k3&hl=en.
- He, K. Deep Residual Learning for Image Recognition. arXiv 2015, arXiv:1512.03385. [Google Scholar] [CrossRef]
- IEEE. IEEE Standard for Floating-Point Arithmetic. *IEEE Std 754-2008*. 2008. [Google Scholar]
- Jacob, B.; et al. Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference. arXiv 2017, arXiv:1712.05877. [Google Scholar]
- Micikevicius, P. FP8 Formats for Deep Learning. arXiv 2022, arXiv:2209.05433. [Google Scholar] [CrossRef]
- Redmon, J. You Only Look Once: Unified, Real-Time Object Detection. arXiv 2016, arXiv:1506.02640. [Google Scholar] [CrossRef]
- Ren, S.; et al. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv 2016, arXiv:1506.01497. [Google Scholar] [CrossRef] [PubMed]
- Ren, S. Identity Mappings in Deep Residual Networks. arXiv 2016, arXiv:1603.05027. [Google Scholar] [CrossRef]
- Tamás, M. EchteAI. Retrieved from fasterrcnn.py. 2025. Available online: https://github.com/EgyipTomi425/EchteAI/blob/186048c642cbc8349f858fca41a6326746496ca6/Python/EchteAI/models/vision/fasterrcnn.py#L267.
- Tamás, M. EchteAI. Retrieved from quantized_resnet50.py. 2025. Available online: https://github.com/EgyipTomi425/EchteAI/blob/master/Python/EchteAI/models/quantized/quantized_resnet50.py.
- Tamás, M. EchteAI. Retrieved from create_video_from_images. 2025. Available online: https://github.com/EgyipTomi425/EchteAI/blob/186048c642cbc8349f858fca41a6326746496ca6/Python/EchteAI/data/dataloaders.py#L88.
- Thakur, D. Hardware-algorithm co-design of Energy Efficient Federated Learning in Quantized Neural Network. *arXiv preprint*. 2024. [Google Scholar]
- ResNet50 Faster R-CNN. 2025. Available online: https://docs.pytorch.org/vision/main/models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html.
- Torch. Quantization. 2025. Available online: https://pytorch.org/docs/stable/quantization.html.
- Torch. Quantization. 2025. Available online: https://docs.pytorch.org/docs/stable/quantization.html.
- Torch. torch.utils.hooks. 2025. Available online: https://docs.pytorch.org/docs/stable/utils.html#module-torch.utils.hooks.
- Torchvision. 2025. Available online: https://github.com/pytorch/vision/blob/main/torchvision/models/quantization/resnet.py.
- Yang, X. UAV-deployed deep learning network for real-time multi-class damage detection using model quantization techniques. *ScienceDirect*. 2024. [Google Scholar]













| # | Step | Code / Description |
|---|---|---|
| 1 | Initialize Quantized ResNet Base |
super().__init__(block, layers, **kwargs) |
| 2 | Add QDQ and FloatFunctional support for skip connections |
quantized_resnet.quant QuantStub() quantized_resnet.dequant DeQuantStub() for block in [QuantizedBasicBlock, QuantizedBottleneck] block.skip_add FloatFunctional() Replace skip connection: out skip_add.add(out, identity) end for |
| 3 | Apply QDQ in the forward pass |
x self.quant(x) outputs ForwardImpl(self, x) For each key in outputs do outputs[key] self.dequant(outputs[key]) end for |
| 4 | Forward implementation: feature map extraction |
ForwardImpl(model, x): x conv1 bn1 relu maxpool o0 layer1(x) o1 layer2(o0) o2 layer3(o1) o3 layer4(o2) |
| 5 | Return output as OrderedDict |
return OrderedDict{"0": o0, "1": o1, "2": o2, "3": o3} |
| 6 | Remove avgpool and classifier head |
del quantized_resnet.avgpool del quantized_resnet.fc |
| 7 | Make a new ResNet instance |
quantized_resnet QuantizedResNet( block = QuantizedBottleneck, layers = [3, 4, 6, 3] ) |
| # | Step | Code / Description |
|---|---|---|
| 1 | Initialize quantizable ResNet |
quantized_resnet QuantizableResNet50() weights GetWeights(model_fp32.backbone.body) LoadWeights(quantized_resnet, weights) SetEvalMode(quantized_resnet) |
| 2 | Define quantization observers |
activation_observer HistogramObserver() weight_observer PerChannelWeightObserver() qconfig QConfig(activation_observer, weight_observer) SetQConfig(quantized_resnet, qconfig) |
| 3 | Prepare model for quantization |
PrepareForQuantization(quantized_resnet) |
| 4 | Send calibration data through the transform module |
for each images in data_loader do transformed TransformImages(model_fp32, images) inputs GetTensors(transformed) RunForward(quantized_resnet, inputs) end for |
| 5 | Replace the fp32 model’s backbone |
ConvertToQuantizedModel(quantized_resnet) SetEvalMode(quantized_resnet) model_quantized DeepCopy(model_fp32) model_quantized.backbone.body quantized_resnet |
| 6 | Apply dynamic quantization |
DynamicQuantize(model_quantized) |
| Metric | Original model | INT8 | INT8 |
|---|---|---|---|
| Number of pictures | – | 2x32 | 7500 |
| Accuracy (%) | 87.01 | 74.46 | 74.46 |
| Precision (%) | 78.72 | 77.83 | 77.13 |
| Bounding box area (mIoU %) | 84.46 | 83.00 | 83.19 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).