# A Self-Supervised Tree-Structured Framework for Fine-Grained Classification
## 3 Proposed Tree-Structured Framework for Fine-Grained Classification
### Tree-Structured Classifier Building  
In the previous section, an initial classification tree was constructed, which could classify each subclass into the belonging class. This section focuses on building a tree-structured classifier with higher accuracy. As one of the crucial components in the tree-structured classifier, machine-learning matchers are applied to match image features to the belonging cluster in the different levels of the classification tree. Because the final subclass is limited to the cluster returned by the matcher, constructing an effective matcher function is crucial to the accuracy of the image classification. Typically, the dimensionality of the image feature \(F\) is higher than that of the cluster labels, which means that it is essential to construct a general matcher function, denoted as \(g(\cdot)\), that can find associations between image features \(x_{i}^{j}\) and the corresponding clusters \(C_{i}^{j}\) in Level \(j\), as shown in Equation (2). \(C_{i}^{j}\) is the cluster with the highest probability in \(C_{k}^{j}\) as judged by \(g(\cdot)\). \[C_{i}^{j}=\operatorname*{arg\,max}_{x_{i}^{j}\in F}\,c_{i}^{j}\in C_{j}\,g(x_{ i}^{j},C_{k}^{j}) \tag{2}\]  
Figure 5 illustrates an example of matching an image feature to its belonging cluster. The input image feature is passed through the tree, and a machine-learning matcher determines the belonging cluster (denoted as the red node). Now, it is able to predict the belonging cluster for each image. Then, it is necessary to determine subclasses for images with higher accuracy, i.e., the primary objective of this paper is to develop tree classifiers that can achieve higher accuracy. The theory of recall trees [17] shares a similar goal, aiming to ensure that each level of the tree-structured classifier enhances classification accuracy. According to [PERSON] et al. 's findings [17], the accuracy of a tree classifier increases up to a certain threshold as the number of levels increases. However, further increasing the tree's levels beyond this threshold can actually decrease accuracy. As a result, it is crucial to eliminate clusters that have a negative impact on the tree-structured classifier's accuracy. Figure 5: Matching an image feature to its belonging cluster. In this section, we present an algorithm (Algorithm 3) that can create a tree-structured classifier with improved accuracy by eliminating invalid clusters. Prior to that, it briefly introduces a condition for the tree hierarchy to stop growing, i.e., the pruning criterion. **Pruning criterion**: If the accuracy of a cluster is greater than or equal to the total accuracy of all child clusters, as illustrated in Equation (3), then the child clusters are considered invalid and are deleted from the tree-structured classifier. \[\exists\ C_{i}^{j-1},C_{s}^{j}:f(C_{i}^{j-1})\geq\alpha\sum_{s=1}^{k}\frac{n_ {s}^{j}}{n_{i}^{j-1}}f(C_{s}^{j}) \tag{3}\]  
In Equation (3), \(C_{i}^{j-1}\) refers to Cluster \(i\) in Level \(j-1\), \(C_{s}^{j}\) refers to child cluster \(s\) in Level \(j\), \(f(\cdot)\) refers to the function used to calculate the classification accuracy within a cluster, \(k\) refers to the number of child clusters, \(\alpha\) refers to the accuracy on prediction of the cluster to child clusters by the machine-learning matcher, \(n_{s}^{j}\) refers to the number of subclasses in cluster \(C_{s}^{j}\), and \(n_{i}^{j-1}\) refers to the number of subclasses in cluster \(C_{i}^{j-1}\). Figure 6 shows an example of a pruned classification tree, which is a binary tree with four levels. The clusters marked in red in Figure 6 are directly deleted based on the pruning criterion, as the accuracy of Cluster 1 is greater than or equal to the accuracy of its child clusters, i.e., total accuracy of Cluster 3 and Cluster 4. The conditions for stopping the growth of the tree hierarchy have been introduced. Next, Algorithm 3 demonstrates the process of constructing a tree-structured classifier using a hierarchical traversal method to remove unnecessary clusters.