Skip to main content
ARS Home » Southeast Area » Athens, Georgia » U.S. National Poultry Research Center » Quality and Safety Assessment Research Unit » Research » Publications at this Location » Publication #433645

Research Project: Smart Optical Sensing of Food Hazards and Elimination of Non-Nitrofurazone Semicarbazide in Poultry

Location: Quality and Safety Assessment Research Unit

Title: Fully Quantized Training vs. Post-Training Quantization for a Small Hyperspectral Transformer Model for Pixel-Level Foreign Plastic Object Classification

Author
item KHAN, ZIRAK - University Of Georgia
item Yoon, Seung
item BHANDARKARE, SUCHENDRA - University Of Georgia

Submitted to: Sensors
Publication Type: Peer Reviewed Journal
Publication Acceptance Date: 8/29/2026
Publication Date: 8/31/2026
Citation: Khan, Z., Yoon, S.-C., & Bhandarkar, S. M. (2026). Fully Quantized Training vs. Post-Training Quantization for a Small Hyperspectral Transformer Model for Pixel-Level Foreign Plastic Object Classification. Sensors, 26(17), 5531. https://doi.org/10.3390/s26175531
DOI: https://doi.org/10.3390/s26175531

Interpretive Summary: Lightweight artificial intelligence (AI) models are increasingly important for improving the efficiency of industrial applications using AI models. This study compares two effective AI training and inference methods for classifying foreign plastic objects in hyperspectral data from poultry meat. Using a state-of-the-art transformer model, the research evaluates different floating-point (FP) precision levels for quantized computation, specifically standard 32-bit FP (FP32), as well as lower precision options like 16-bit FP (FP16), Google's 16-bit FP (BF16), 8-bit FP (FP8), and NVIDIA's 4-bit FP (NVFP4). Experiments were conducted to assess the impact of these various quantization types on accuracy, model size, training speed, and inference efficiency. The findings indicate that mixed-precision training using fully quantized training (FQT) is robust. Notably, all tested lower precision settings (excluding FP8) performed within just 0.63 percentage points of the highest accuracy achieved with standard precision (FP32). Among the options assessed, BF16 closely matched the accuracy of FP32, while FP8 offered a favorable balance between accuracy and efficiency. An in-depth analysis revealed the necessity of maintaining certain sensitive parts of the model in higher precision (FP32) to ensure stability when utilizing very low precision. The results provide valuable insights for selecting quantization methods when deploying the model for foreign material detection in poultry and other applications.

Technical Abstract: Low-precision floating-point computation has become central to efficient artificial intelligence, yet its behavior for small-scale transformer-based hyperspectral imaging (HSI) models remains underexplored. In this work, we present a controlled comparative study of fully quantized training (FQT) and post-training quantization (PTQ) for pixel-wise foreign plastic object classification in poultry hyperspectral data. Using a fixed state-of-the-art spatial--spectral transformer backbone, a common mixed-precision strategy, and identical training and inference protocols, we evaluate FP32, FP16, BF16, FP8, and NVFP4 across predictive performance, model compression, training efficiency, and inference efficiency. The results show that mixed-precision FQT remains highly robust across the tested precision spectrum, with all reduced-precision FQT configurations staying within 0.63 percentage points of the FP32 baseline in overall accuracy, while consistently outperforming PTQ at matched precisions. BF16 provides the closest accuracy to FP32, whereas FP8 offers a particularly favorable accuracy--efficiency trade-off. Model size decreases monotonically with precision, reaching 3.69x compression under NVFP4. However, native FP8/FP4 hardware support does not automatically improve training throughput for this tiny model at moderate workloads; its advantage emerges mainly at sufficiently large batch sizes but larger batch sizes during training degrades predictive performance. In contrast, large-batch inference can exploit FP8 and NVFP4 effectively without affecting predictive accuracy. An ablation study further shows that selective retention of numerically sensitive modules in FP32 is essential for stable ultra-low-precision operation. Overall, the findings show that low precision is a viable but workload-dependent design choice for compact HSI transformers and provide practical guidance for choosing between FQT and PTQ under different deployment goals.