# Transmission Tower Re-Identification Algorithm Based on Machine Vision
## 2 The Proposed Method
### Transmission Tower matching Network
#### 2.3.7 Matching Accuracy Evaluation  
Given the current absence of established evaluation standards for transmission tower matching, the evaluation criteria for the identity matching results of transmission towers refer to common metrics in the image retrieval domain, namely \(rank\)-1, Mean Average Precision (\(mAP\)). Given that the calculation of \(mAP\) and Average Precision (\(AP\)) in image retrieval differs from that in object detection, in this context, we denote \(mAP\) and \(AP\) in image retrieval as \(mAP_{r}\) and \(AP_{r}\), respectively. The \(rank\)-1 denotes the ratio of the number of times all query images successfully match the total number of queries. Typically, a higher rank-1 metric indicates a better model matching performance. To compute \(mAP_{r}\), one first needs to determine \(AP_{r}\). The \(AP_{r}\) value in image retrieval serves as a measure of the re-identification performance, and is computed as delineated in Equation (18).  
\[\Delta\ recall=\frac{1}{N_{t}} \tag{17}\]  
\[AP_{r}=\sum_{i}\frac{TP_{r}(i)}{TP_{r}(i)+FP_{r}(i)}\cdot\Delta\ recall,\ i\in\Omega \tag{18}\]  
where \(N_{t}\) represents the number of images in the gallery that share the same ID with the query image; \(\Omega\) represents the set of samples with the same identity as the query sample and ranking in the \(k\)th position in the query results (for example, the notation \(\Omega\) = {1, 3, 4} signifies that the identity at the first, third, and fourth ranks within the retrieval outcomes correspond to the identity of the target image under query); \(TP_{r}(i)\) represents the number of positive samples in the top \(i\) retrieval results; \(FP_{r}(i)\) represents the number of negative samples in the top \(i\) retrieval results.  
\(mAP_{r}\) is a more comprehensive metric that not only considers the most similar image but also reflects the similarity situation of all other images in the template library with the image to be retrieved. Hence, it is more indicative of the merits of the algorithm. The computation for \(mAP_{r}\) is shown in Equation (19)  
\[mAP_{r}=\frac{1}{N}\sum_{m=1}^{N}AP_{r}(m) \tag{19}\]  
where \(mAP_{r}\) represents the Mean Average Precision for matching network; \(N\) represents the number of query images; \(AP_{r}(m)\) represents the average precision for the \(m\)th query images presented in Equation (19).  
This study posits that the accuracy of the top few images in the retrieval results is crucial for evaluating the model. Consequently, we introduce a tailored evaluation metric, termed Mean Average Precision, based on the top three most similar retrieved images (\(mAP\_rank\)-3). Within this metric, the \(AP_{r}\) for each query image is restricted to the top three retrieval results in the gallery, denoted as the \(AP\_rank\)-3. The calculation methods for \(AP\_rank\)-3 and \(mAP\_rank\)-3 refer to Equations (18) and (19), with the specific computational approaches illustrated in Equations (20) and (21)  
\[AP\_rank\text{-}3=\frac{1}{3}\sum_{i}\frac{TP_{r}(i)}{TP_{r}(i)+FP_{r}(i)},\ i\in\Omega_{1} \tag{20}\]  
\[mAP\_rank\text{-}3=\frac{1}{N}\sum_{m=1}^{N}AP\_rank\text{-}3(m) \tag{21}\]where \(\Omega_{1}\) denotes the set of samples that have the same identity as the query sample and rank at the \(j\)th position in the query results, under the condition that \(j\) is less than or equal to 3; \(N\) represents the number of query images.