## 3 Methods
### Majority Voting Algorithm for Classification Results  
Then we will discuss the calculation process and results of deep learning and overall learning Yolo-based majority voting. The object detection classifying models included in this research are Yolov3-Tiny, Yolov3, and Yolov4, which divide the input image into 16 categories (including the 4 categories of male dog, female dog, male cat, and female cat, each of which has another 4 featured characteristics). The total of 16 classification features are classified using a majority voting algorithm to classify male dog, female dog, male cat, and female cat. Four of these classification values are calculated based on the sum of the confidence scores of the corresponding categories of the detection performance, and then compared with the threshold of the majority vote. If the classified value is above the threshold value, then the result of correct TNR surgery can be the output without the need for manual judgment. If the classified value is not greater than the threshold value, then manual judgment is required. According to Table 4, the male dog target classification results were as follows. For Yolov3-Tiny, the sum of the voting index by the male dog confidence score of 0.8001 and 0.4046 was 1.2047, while the voting index for female dog was 0.3417. Hypothetically, if the sum of the four confidence scores for the four categories of the male dog in Table 4 is four times 0.85, as a result, the voting threshold value of male dog was 3.4. Equation (7) is calculated based on the voting index \(D_{G}\) in Equation (5) as follows. \[ \begin{array}{c}\sum\limits_{k=1}^{4}d_{K,Dogmale}=(0.8001\times 1+0.4046 \times 1)=1.2047\\ \sum\limits_{k=1}^{4}d_{K,Dogfemale}=0.3417\end{array}  \tag{7}\]  
Since the \(class\)\(Dogmale\) = 1.2047 and \(class\)\(Dogfemale\) = 0.3417, the \(class\)\(Dogmale\)\(>\)\(class\)\(Dogfemale\), and the male dog should be voted as the result. However, if the value of the \(class\)\(Dogmale\) (1.2047) is less than the presetting value of the majority voting threshold (\(D_{G}\) =3.4), then the final majority voting judgment result is \"other\" (not the male dog). If the classifying model is Yolov3, the presetting majority voting threshold value is 3.6. It means that the confidence score of the four characteristics of male dogs has a performance of 0.9 or higher, and then the voting index is calculated as follows. \[\sum\limits_{k=1}^{4}d_{K,Dogmale}=(0.9948\times 1+0.9993\times 1+0.999\times 1+0.98 35\times 1)=3.9766 \tag{8}\]  
Since the voting index for \(class\)\(Dogmale\)(3.9766) is larger than the majority voting threshold of 3.6, then \(class\)\(field\)\(as\)\(male\)\(dog\) will be returned. From Table 4, if the classifying model is Yolov4 with the majority voting threshold value of 3.6, then the voting index is calculated as follows. \[\sum\limits_{k=1}^{4}d_{K,Dogmale}=(0.9996\times 1+0.9979\times 1+0.9974\times 1+0. 8059\times 1+0.9804\times 1)=4.7812 \tag{9}\]  
Again, we have  
\[\sum\limits_{k=1}^{4}d_{K,Dogfemale}=\sum\limits_{k=1}^{4}d_{K,Dogmale}=\sum \limits_{k=1}^{4}d_{K,Catfemale}=0 \tag{10}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Yolov3-Tiny** & **Yolov3** & **Yolov4** \\ \hline Head of male cat & 0.9998 & 1.0000 & 0.9963 \\ Body of male cat & 0.9993 & 0.9995 & 0.9999 \\ Surgical position of male cat & 0.9539 & 1.0000 & 0.9961 \\ Surgical organs of male cat & 0.9487/0.9135 & 1.0000/0.9999 & 0.9964/0.9966 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Detection performance for male cat. Since the voting index for _class Dogmale_ (4.7812) is larger than the majority voting threshold of 3.6, the classfied as _class maleDog_ will be returned. Thus, the classification results of male dog images by the majority voting algorithms of Yolov3 and Yolov4 for male dogs were 3.9766 and 4.7812, respectively, as shown in Table 7. Based on the same threshold value (denoted as x = 3.4), the majority voting in Figure 10 will be the male dog.