# Sub-Pixel Displacement Measurement with Swin Transformer: A Three-Level Classification Approach
###### Abstract  
In order to avoid the dependence of traditional sub-pixel displacement methods on interpolation method calculation, image gradient calculation, initial value estimation and iterative calculation, a Swin Transformer-based sub-pixel displacement measurement method (ST-SDM) is proposed, and a square dataset expansion method is also proposed to rapidly expand the training dataset. The ST-SDM computes sub-pixel displacement values of different scales through three-level classification tasks, and solves the problem of positive and negative displacement with the rotation relative tag value method. The accuracy of the ST-SDM is verified by simulation experiments, and its robustness is verified by real rigid body experiments. The experimental results show that the ST-SDM model has higher accuracy and higher efficiency than the comparison algorithm. digital speckle correlation method; digital image correlation method; sub-pixel displacement method; deep learning; square dataset expansion method +
Footnote †: journal: Applied sciences  
0
Footnote 0: _Applied Sciences_  
0
Footnote 0: foot  
displacement search algorithms. This integration helps improve measurement accuracy, efficiency, real-time performance, and method robustness. In 2020, [PERSON] et al. [26] introduced a deep learning model based on a 3D-CNN, and constructed a dataset to train the model with the continuous images obtained from tensile tests on thin films from the stretching test of the film, and verified the effectiveness of the method by comparing the predicted data with real displacement sensor data. However, this method has some limitations due to the low efficiency and limited quantity of the training dataset acquisition. In 2021, [PERSON] et al. [27] proposed a deep learning model combined with the DSCM, which is a Convolutional Neural Network (CNN) designed for measuring displacement and strain fields. The training dataset is generated from speckle images rendered from the Boolean model. The output of the model is an estimation of sub-pixel displacement. However, the results showed relatively large errors, making it unsuitable for generalization. In 2021, [PERSON] et al. [28] presented a CNN model for digital speckle image displacement field recognition, and constructed a training dataset based on the simulated uniform deformation, shear deformation, and combined deformation of simulated speckle images. The proposed algorithm was compared with a non-iterative grayscale gradient algorithm through numerical simulation experiments and stretching experiments on speckle silicone films. The results demonstrated that the proposed algorithm not only had smaller relative errors but also higher efficiency, confirming its effectiveness. Moreover, this algorithm overcame the limitations of traditional DSCMs, such as the dependence on optimization and interpolation methods, high training costs, and low model efficiency. In 2021, [PERSON] et al. [29] proposed a migration learning-based CNN sub-pixel displacement measurement method, where each level of the displacement scale is classified into 11 classes, and a second-level classification model is utilized to determine the sub-pixel displacement values in order to simulate the scattering maps. The training dataset and the corresponding classification labels are obtained, and the performance of the algorithm is verified through simulation and practical experiments, and the results show that the proposed method is simple to operate and easy to train, has high efficiency and good robustness, and shows good adaptability in practice. Migration learning was utilized to fine-tune the model using existing datasets and new datasets to accelerate the convergence speed of the model. Since artificial intelligence-based methods avoid the dependence on interpolation methods, it has higher algorithm efficiency and robustness under the same accuracy conditions; however, there are certain issues in terms of training costs. In 2023, [PERSON] et al.