# Transmission Tower Re-Identification Algorithm Based on Machine Vision
## 3 Experiment and Analysis
### Experiment on Transmission Tower Object Detection  
#### 3.2.1 Model Training  
Experiments were conducted on Dell Server T7920 (Server 1) and Lenovo Server (Server 2). Server 1 is equipped with two Intel Xeon Gold 6248R CPUs and two NVIDIA A4000 16G GPUs. Server 2 is configured with a 12 th Gen Intel(R) Core(TM) i7-12700H CPU and a GeForce RTX 3060 6G GPU. Ubuntu 18.04 LTS was installed on Server 1. Both Server 1 and Server 2 were set up with Python 3.8 and configured with environments including PyTorch 1.13.1 and Ultralytes 8.0.81. YOLOv5n, YOLOv5s, YOLOv8n and YOLOv8s adopted the official COCO dataset weights for weight transfer, while the YOLOv5n-c2f head and YOLOv5n-conv head utilized the pre-trained weights of the YOLOv5n model, specifically trained for transmission tower detection, for the purpose of transfer learning. The input image resolution was set to 640 \(\times\) 640, with the Adam optimizer utilized for model optimization, and betas set to (0.937, 0.999). YOLOv5 models necessitate predefined anchor boxes. Through K-means clustering and genetic algorithms, the priors for the first prediction head were determined as [9; 19; 15; 43], [25; 69]; the priors for the second prediction head were [36; 10; 57; 158; 77; 265], while those for the third prediction head were [98; 355], [130; 418], [195; 461]; The binary cross-entropy loss weight for confidence was set to 1, the mean squared error loss weight for positional offset was set to 0.05, and the cross-entropy loss weight for class probability was set to 0.5. Since YOLOv8 employs an anchor-free head, it was appropriate to assign a relatively larger weight to the bounding box loss to expedite convergence. The weight distribution was as follows: bounding box loss at 7.5, classification loss at 0.5, and DFL loss at 1.5. The initial learning rate was set to  
Figure 13: Sample images of a transmission tower from the matching dataset.  
0.01, with a final learning rate of 0.0001. The training was configured for 200 epochs with a linear decay based on the number of epochs. Model training was conducted on Server 1. It was observed that YOLOv8n converged around the 190 th epoch. A comparison was made between YOLOv5n, YOLOv5s, YOLOv8s, YOLOv5n-c2f head, and YOLOv5n-conv head for convergence patterns from epochs 0 to 190. The experimental results are illustrated in Figure 14.  
Figure 14: Object detection experimental results (**a**) metrics/\(mAP\)@0.5 curve; (**b**) metrics/\(mAP\)@0.5 : 0.95 curve; (**c**) training loss curve of the YOLOv5; (**d**) validation loss curve of the YOLOv5; (**e**) training loss curve of the YOLOv8; (**f**) validation loss curve of the YOLOv8.  
Figure 14 indicates that the convergence speed and accuracy of the YOLOv5n-YOLOv8n models are superior to those of YOLOv5s and YOLOv5n. The YOLOv5n-c2f head adopted parameters from YOLOv5n (transmission tower detection), showing a faster decline in training loss compared to YOLOv5s and YOLOv5n. However, possibly due to the model not being trained on the COCO dataset and a limited collection of dataset images being available, no accuracy improvement was observed on the validation dataset. The YOLOv5n-conv head also utilized transfer learning with YOLOv5n parameters (transmission tower detection). The results suggest a minor decline in model convergence accuracy.