# Bolt Loosening Detection Using Key-Point Detection Enhanced by Synthetic Datasets
## Materials and Methods
### Datasets Establishment
#### 2.2.2 Synthetic Datasets  
Synthetic datasets, obtained with the help of data-enhancing techniques and game engines, have been used in important roles for pathological image recognition [38], 3D point \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline Size & 4032 \(\times\) 3024 pixels \\ Vertical resolution & 72 dpi \\ Horizontal resolution & 72 dpi \\ Bit depth & 24 \\ Aperture & f/1.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Smart phone camera specifications. Figure 4: Image processing and labeling. (**a**) Original images; (**b**) Cropped images; (**c**) Labeled image. Figure 5: The labeling order of key-points. Figure 3: The test structure. cloud semantic recognition [39], and other fields because of their capability to effectively solve the problem of the shortage of real image data and the high time cost of manual labeling. In the field of key-point detection, it is time and labor costly for a research team to build a large-scale dataset independently for a specific target. In this paper, we established a method that could automatically generate synthetic datasets through the following 3 steps. (1) Bolt high-fidelity modeling  
We used 3D scanning technology to convert a bolt into a digital model. The model was imported into Blender 3.4, the surface was smoothed, and the materials and mapping were adjusted. The bolt model was made to show the same color and glossiness as the real world under various lighting conditions. The bolt digital model is shown in Figure 6.  
(2) Virtual experiment platform  
Unreal Engine 5.1.0 (UES)'s excellent light and shadow representation capabilities allow computer simulations to obtain the same level of realism as real photos, even without long rendering sessions. This allows UE5 to easily output near-realistic virtual images, which is well-suited for synthetic dataset building. The UI of the virtual experiment platform, built using UE5, is shown in Figure 7.  
In this platform we can achieve the following functions:  
Figure 6: The bolt digital model. (**a**) White model; (**b**) Shading model. Figure 7: The UI of the virtual experiment platform in UE5. Set the height and view angle of the camera, adjust the rotation angle of the bolt, and keep the camera aligned with the bolt to obtain images of the bolt from different angles, as shown in Figure 8.
2. Change the different simulated weather and time in the site to obtain images of the bolts under different lighting conditions, as shown in Figure 8.
3. Six invisible marker objects are fixed on the six corner points of the bolt to label the key points, and the order of the markers is the same as the order of the key points, as shown in Figure 4:0 Additionally, through the coordinate conversion, the coordinates of the markers in the 3D scene are converted to the coordinates in the camera screen (this function is mainly realized by the function \"Convert World Location to Screen Location\", which comes with we5), as shown in Figure 4:1
4. Let the camera rotate around the bolt at different angles and automatically take screenshots of the real-time rendered screen by a set time. While capturing the screenshot, the coordinates of the marked objects in the current screen are automatically saved. 3. Data processing  
Figure 4:2 Bolt images generated in the virtual experiment platform. (**a**) Images from different angles; (**b**) Images from different lighting conditions. According to the coordinate data automatically saved by the virtual experiment platform, the position of the bolt recognition box is calculated. The result of key-point marking and recognition box generation is shown in Figure 4:3  
The data format was converted according to the training requirements. In this paper, a total of 1600 bolt images were generated and divided into the training set (1200 images), validation set (200 images), and test set (200 images) according to the ratio of 6:1:1.