Quantized neural networks (QNNs) are widely used to achieve computationally efficient solutions to recognition problems. Overall, eight-bit QNNs have almost the same accuracy as full-precision networks, but working several times faster. However, the networks with lower quantization levels demonstrate inferior accuracy in comparison to their classical analogs. To solve this issue, a number of quantization-aware training (QAT) approaches were proposed. In this paper, we study QAT approaches for two- to eight-bit linear quantization schemes and propose a new combined QAT approach: neuron-by-neuron quantization with straight-through estimator (STE) gradient forwarding. It is suitable for quantizations with two- to eight-bit widths and eliminates significant accuracy drops during training, which results in better accuracy of the final QNN. We experimentally evaluate our approach on CIFAR-10 and ImageNet classification and show that it is comparable to other approaches for four to eight bits and outperforms some of them for two to three bits while being easier to implement. For example, the proposed approach to three-bit quantization of the CIFAR-10 dataset results in 73.2% accuracy, while baseline direct and layer-by-layer result in 71.4% and 67.2% accuracy, respectively. The results for two-bit quantization for ResNet18 on the ImageNet dataset are 63.69% for our approach and 61.55% for the direct baseline.
Local image descriptors are widely used for identifying image features and performing various computer vision tasks, such as object recognition, image matching, and scene reconstruction. However, comparing these descriptors can be time-consuming, especially for large image collections, which can cause real-time or mobile processing challenges. One solution to this problem is using binary descriptors, which can be compared with the help of Hamming distance. Examples of binary descriptors that offer high matching accuracy are RFD and RFDoc, but they can be computationally demanding on edge devices. In this paper, we extend our conference paper on Fast and Accurate RFD-like descriptor Approximation (FARA), which provides CPU-friendly integer-only gradient map computation and sequential memory accesses. We adapt it to use Single Instruction Multiple Data extensions of CPUs at all stages of the descriptor computation pipeline. This approach achieves a twofold acceleration in gradient map computation and reduces the overall descriptor computation time by half compared to the fast RFDoc implementation on x86 and ARM architectures. We also perform descriptor fine-tuning and show that FARA is as accurate as RFDoc in document localization and classification problems on the MIDV-500, MIDV-2019, and MIDV-2020 datasets. FARA also demonstrates comparable accuracy with standard RFD on Brown and Oxford datasets.