SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Abhra Chaudhuri $^{1,5,6}$  Massimiliano Mancini $^{2}$  Zeynep Akata $^{3,4}$  Anjan Dutta $^{5,6}$  *
<sup>1</sup> University of Exeter
4 MPI for Informatics
$^{2}$  University of Trento
5 The Alan Turing Institute
<sup>3</sup> University of Tübingen
<sup>6</sup> University of Surrey
Recent advances in fine-grained representation learning leverage local-to-global (emergent) relationships for achieving state-of-the-art results. The relational representations relied upon by such methods, however, are abstract. We aim to deconstruct this abstraction by expressing them as interpretable graphs over image views. We begin by theoretically showing that abstract relational representations are nothing but a way of recovering transitive relationships among local views. Based on this, we design Transitivity Recovering Decompositions (TRD), a graph-space search algorithm that identifies interpretable equivalents of abstract emergent relationships at both instance and class levels, and with no post-hoc computations. We additionally show that TRD is provably robust to noisy views, with empirical evidence also supporting this finding. The latter allows TRD to perform at par or even better than the state-of-the-art, while being fully interpretable. Implementation is available at https://github.com/abhrac/trd.
Identifying discriminative object parts (local views) has traditionally served as a powerful approach for learning fine-grained representations [95, 85, 43]. Isolated local views, however, miss out on the larger, general structure of the object, and hence, need to be considered in conjunction with the global view for tasks like fine-grained visual categorization (FGVC) [94]. Additionally, the way in which local views combine to form the global view (local-to-global / emergent relationships [59]) has been identified as being crucial for distinguishing between classes that share the same set of parts, but differ only in the way the parts relate to each other [32, 97, 10, 9, 61, 12]. However, representations produced by state-of-the-art approaches that leverage the emergent relationships are encoded in an abstract fashion – for instance, through the summary embeddings of transformers [9, 10], or via aggregations on outputs from a GNN [97, 27]. This makes room for the following question that we aim to answer through this work: how can we make such abstract relational representations more human-understandable? Although there are several existing works that generate explanations for localized, fine-grained visual features [11, 78, 36, 63], providing interpretations for abstract representations obtained for discriminative, emergent relationships still remains unaddressed.
Illustrated in Figure 1, we propose to make existing relational representations interpretable through bypassing their abstractions, and expressing all computations in terms of a graph over image views, both at the level of the image as well as that of the class (termed class proxy, a generalized representation of a class). At the class level, this takes the form of what we call a Concept Graph: a generalized relational representation of the salient concepts across all instances of that class. We use graphs, as they are a naturally interpretable model of relational interactions for a variety of tasks [86, 18, 1, 46], allowing us to visualize entities (e.g., object parts, salient features), and their relationships.
*Abhra Chaudhuri (ac1151@exeter.ac.uk) is the corresponding author.
Initial Image Graph (Input)
Noisy Subgraph
Informative Subgraph
Graph of Fine-Grained Cross-View Relationships (Latent)
Global View
Class-Proxy (Concept) Graph (Output)
Figure 1: Instead of learning representations of emergent relationships that are abstract aggregations of views, our method deconstructs the input, latent, and the class representation (proxy) spaces into graphs, thereby ensuring that all stages along the inference path are interpretable.
We theoretically answer the posed question by introducing the notion of transitivity (Definition 3) for identifying subsets of local views that strongly influence the global view. We then show that the relational abstractions are nothing but a way of encoding transitivity, and design Transitivity Recovering Decompositions (TRD), an algorithm that decomposes both input images and output classes into graphs over views by recovering transitive cross-view relationships. Through the process of transitivity recovery (Section 3.2), TRD identifies maximally informative subgraphs that co-occur in the instance and the concept (class) graphs, providing end-to-end relational transparency. In practice, we implement TRD by optimizing a GNN to match a graph-based representation of the input image to the concept graph of its corresponding class (through minimizing the Hausdorff Edit Distance between the two). The input image graph is obtained by decomposing the image into its constituent views [10, 84, 94], and connecting complementary sets of views. The concept graph is obtained by performing an online clustering on the node and edge embeddings of the training instances of the corresponding class. The process is detailed in Section 3.3.
We also show that TRD is provably robust to noisy views in the input image (local views that do not / negatively contribute to the downstream task [13]). We perform careful empirical validations under various noise injection models to confirm that this is indeed the case in practice. The robustness allows TRD to always retain, and occasionally, even boost performance across small, medium, and large scale FGVC benchmarks, circumventing a known trade-off in the explainability literature [31, 73, 23, 37]. Finally, the TRD interpretations are ante-hoc – graphs encoding the learned relationships are produced as part of the inference process, requiring no post-hoc GNN explainers [88, 92, 34, 68, 90].
In summary, with the purpose of bringing interpretability to abstract relational representations, we make the following contributions - (1) show the existence of graphs that are equivalent to abstract local-to-global relational representations, and derive their information theoretic and topological properties; (2) design TRD, a provably robust algorithm that generates such graphs in an ante-hoc manner, incorporating transparency into the relationship computation pipeline at both instance and class levels; (3) extensive experiments demonstrating not only the achieved interpretability and robustness, but also state-of-the-art performance on benchmark FGVC datasets.
Fine-grained visual categorization: Learning localized image features [2, 96, 47], with extensions exploiting the relationship between multiple images and between network layers [52] were shown to be foundational for FGVC. Strong inductive biases like normalized object poses [6, 87] and data-driven methods like deep metric learning [14] were used to tackle the high intra-class and low inter-class variations. Unsupervised part-based models leveraged CNN feature map activations [35, 94] or identified discriminative sequences of parts [4]. Novel ways of training CNNs for FGVC included boosting [55], kernel pooling [15], and channel masking [19]. Vision transformers, with their ability to learn localized features, had also shown great promise in FGVC [81, 29, 50]. FGVC interpretability has so far focused on the contribution of individual parts [11, 20]. However, the usefulness of emergent relationships for learning fine-grained visual features was demonstrated by
[83, 97, 9, 10]. Our method gets beyond the abstractions inherent in such approaches, and presents a fully transparent pipeline by expressing all computations in terms of graphs representing relationships, at both the instance and the class-level.
Relation modeling in deep learning: Relationships between entities serve as an important source of semantic information as has been demonstrated in graph representation learning [72, 18], deep reinforcement learning [93], question answering [67], object detection [33], knowledge distillation [60], and few-shot learning [70]. While the importance of learning relationships between different views of an image was demonstrated in the self-supervised context [61, 9], [10] showed how relational representations themselves can be leveraged for tasks like FGVC. However, existing works that leverage relational information for representation learning typically (1) model all possible ways the local views can combine to form the global view through a transformer, and distill out the information about the most optimal combination in the summary embedding [9, 10], or (2) model the underlying relations through a GNN, but performing an aggregation on its outputs [27, 97]. Both (1) and (2) produce vector-valued outputs, and such, cannot be decoded in a straightforward way to get an understanding of what the underlying emergent relationships between views are. This lack of transparency is what we refer to as "abstract". The above set of methods exhibit this abstraction not only at the instance, but at the class-level as well, which also appear as vector-valued embeddings. On the contrary, an interpretable relationship encoder should be able to produce graphs encoding relationships in the input, intermediate, and output spaces, while also representing a class as relationships among concepts, instead of single vectors that summarize information about emergence. This interpretability is precisely what we aim to achieve through this work.
Explainability for Graph Neural Networks: GNNExplainer [88] was the first framework that proposed explaining GNN predictions by identifying maximally informative subgraphs and subset of features that influence its predictions. This idea was extended in [92] through exploring subgraphs via Monte-Carlo tree search and identifying the most informative ones based on their Shapley values [69]. However, all such methods inherently provided either local [88, 34, 68] or global explanations [90], but not both. To address this issue, PGExplainer [51] presented a parameterized approach to provide generalized, class-level explanations for GNNs, while [82] obtained multi-grained explanations based on the pre-training (global) and fine-tuning (local) paradigm. [48] proposed a GNN explanation approach from a causal perspective, which led to better generalization and faster inference. On the other hand, [3] improved explanation robustness by modeling decision regions induced by similar graphs, while ensuring counterfactuality. Although ViG [27] presents an algorithm for representing images as a graph of its views, it exhibits an abstract computation pipeline lacking explainability. A further discussion on this is presented in Appendix A.10. Also, generating explanations for graph metric-spaces [99, 45] remains unexplored, which we aim to address through this work.
3 Transitivity Recovering Decompositions
Our methodology is designed around three central theorems - (i) Theorem 1 shows the existence of semantically equivalent graphs for every abstract representation of emergent relationships, (ii) Theorem 2 establishes an information theoretic criterion for identifying such a graph, and (iii) Theorem 3 shows how transitivity recovering functions can guide the search for candidate solutions that satisfy the above criterion. Additionally, Theorem 4 formalizes the robustness of transitivity recovering functions to noisy views. Due to space constraints, we defer all proofs to the Appendix A.9.
Preliminaries: Consider an image  $\mathbf{x} \in \mathbb{X}$  with a categorical label  $\mathbf{y} \in \mathbb{Y}$  from an FGVC task. Let  $\mathbf{g} = c_{g}(\mathbf{x})$  and  $\mathbb{L} = \{\mathbf{l}_{1},\mathbf{l}_{2},\ldots \mathbf{l}_{k}\} = c_{l}(\mathbf{x})$  be the global and set of local views of an image  $\mathbf{x}$  respectively, jointly denoted as  $\mathbb{V} = \{\mathbf{g}\} \cup \mathbb{L}$ , where  $c_{g}$  and  $c_{l}$  are cropping functions applied on  $\mathbf{x}$  to obtain such views. Let  $f$  be a semantically consistent, relation-agnostic encoder (Appendices A.4 and A.7) that takes as input  $\mathbf{v} \in \mathbb{V}$  and maps it to a latent space representation  $\mathbf{z} \in \mathbb{R}^{n}$ , where  $n$  is the representation dimensionality. Specifically, the representations of the global view  $\mathbf{g}$  and local views  $\mathbb{L}$  obtained from  $f$  are then denoted by  $\mathbf{z}_{g} = f(\mathbf{g})$  and  $\mathbb{Z}_{\mathbb{L}} = \{f(\mathbf{l}): \mathbf{l} \in \mathbb{L}\} = \{\mathbf{z}_{l_1},\mathbf{z}_{l_2},\dots \mathbf{z}_{l_k}\}$  respectively, together denoted as  $\mathbb{Z}_{\mathbb{V}} = \{\mathbf{z}_{g},\mathbf{z}_{l_1},\mathbf{z}_{l_2},\dots \mathbf{z}_{l_k}\}$ . Let  $\xi$  be a function that encodes the relationships  $\mathbf{r} \in \mathbb{R}^n$  between the global ( $\mathbf{g}$ ) and the set of local ( $\mathbb{L}$ ) views. DiNo [9] and Relational Proxies [10] can be considered as candidate implementations for  $\xi$ . Let  $\mathbb{G}$  be a set of graphs  $\{(\mathbb{V},\mathbb{E}_1,\mathbb{F}_{\mathbb{V}_1},\mathbb{F}_{\mathbb{E}_1}), (\mathbb{V},\mathbb{E}_2,\mathbb{F}_{\mathbb{V}_2},\mathbb{F}_{\mathbb{E}_2}),\ldots\}$ , where the nodes in each graph constitute of the view set  $\mathbb{V}$ , and the edge set  $\mathbb{E}_i \in \mathcal{P}(\mathbb{V} \times \mathbb{V})$ , where  $\mathcal{P}$  denotes the power set.  $|\mathbb{G}| = |\mathcal{P}(\mathbb{V} \times \mathbb{V})|$ , meaning
that  $\mathbb{G}$  is the set of all possible graph topologies with  $\mathbb{V}$  as the set of nodes. The node features  $\mathbb{F}_{\mathbb{V}_i}$ , and the edge features  $\mathbb{F}_{\mathbb{E}_i} \in \mathbb{R}^n$ .
3.1 Decomposing Relational Representations
Definition 1 (Semantic Relevance Graph). A graph  $\mathcal{G}_s \in \mathbb{G}$  of image views where each view-pair is connected by an edge with strength proportional to their joint relevance in forming the semantic label  $\mathbf{y}$  of the image. Formally, the weight of an edge  $E_{S_{ij}}$  connecting  $\mathbf{v}_i$  and  $\mathbf{v}_j$  is proportional to  $I(\mathbf{v}_i\mathbf{v}_j;\mathbf{y})$ .
Intuitively,  $E_{S_{ij}}$  is a measure of how well the two views pair together as compatible puzzle pieces in depicting the central concept in the image.
Theorem 1. For a relational representation  $\mathbf{r}$  that minimizes the information gap  $I(\mathbf{x};\mathbf{y}|\mathbb{Z}_{\mathbb{V}})$ , there exists a metric space  $(\mathcal{M},d)$  that defines a Semantic Relevance Graph such that:
$$
\begin{array}{l} d \left(\mathbf {z} _ {i}, \mathbf {y}\right) > \delta \wedge d \left(\mathbf {z} _ {j}, \mathbf {y}\right) > \delta \Rightarrow \\ \exists \xi : \mathbb {R} ^ {n} \xrightarrow {\text {s e m}} \mathbb {R} ^ {n} \mid \mathbf {r} = \xi (\varphi (\mathbf {z} _ {i}), \varphi (\mathbf {z} _ {j})), d (\mathbf {r}, \mathbf {y}) \leq \delta \\ \end{array}
$$
where  $\mathcal{M} \in \mathbb{R}^n$ ,  $\stackrel{\text{sem}}{\longrightarrow}$  and  $d$  denote semantically consistent transformations and distance metrics respectively,  $\varphi: \mathbb{Z}_{\mathbb{V}} \stackrel{\text{sem}}{\longrightarrow} \mathcal{M}$ , and  $\delta$  is some finite, empirical bound on semantic distance.
Intuition: The theorem says that, even if  $\mathbf{z}_i$  and  $\mathbf{z}_j$  individually cannot encode anymore semantic information, the metric space  $(\mathcal{M},d)$  encodes their relational semantics via its distance function  $d$ . Assuming the theorem to be false would mean that the outputs of the aggregation do not allow for a distance computation that is semantically meaningful, and hence, there is no source from which  $\mathbf{r}$  (the relational embedding) can be learned. This would imply that either (i) the information gap (Appendix A.2) does not exist, which is false, because  $f$  is a relation-agnostic encoder, or (ii) all available metric spaces are relation-agnostic and hence, the information gap would always persist. The latter is again in contrary to what is shown in Appendix A.6, which derives the necessary and sufficient conditions for a model to bridge the information gap. Thus,  $(\mathcal{M},d)$  defines  $\mathcal{G}_s$  with weights  $1 / d(\varphi (\mathbf{v}_i),\varphi (\mathbf{v}_j))\propto I(\mathbf{v}_i\mathbf{v}_j;\mathbf{y})$ , where  $\varphi :\mathbb{V}\to \mathcal{M}$ .
Corollary 1.1 (Proxy / Concept Graph). Proxies can also be represented by graphs.
Intuition: Since  $(\mathcal{M},d)$  is equipped with a semantically relevant distance function, the hypersphere enclosing a locality/cluster of local/global view node embeddings can be identified as a semantic relevance neighborhood. The centers of such hyperspheres can be considered as a proxy representation for each such view, generalizing some salient concept of a class. The centers of each such view cluster can then act as the nodes of a proxy/concept graph, connected by edges, that are also obtained in a similar manner by clustering the instance edge embeddings.
Theorem 2. The graph  $\mathcal{G}^*$  underlying  $\mathbf{r}$  is a member of  $\mathbb{G}$  with maximal label information. Formally,
$$
\mathcal{G}^{*} = \operatorname *{arg  \max}_{\mathcal{G}\in \mathbb{G}}I(\mathcal{G},\mathbf{y})
$$
Intuition: The label information  $I(\mathbf{x},\mathbf{y})$  can be factorized into relation-agnostic and relation-aware components (Appendix A.2). The node embeddings in  $\mathcal{G}^*$  already capture the relation-agnostic component (being derived from  $f$ ). From the implication in Theorem 1, we know that given the node embeddings,  $\xi$  is able to reduce further uncertainty about the label by joint observation of view pairs (or in other words, edges in  $\mathcal{G}^*$ ). Hence  $\xi$  must be relation-aware, as the relation-agnostic component is already captured by  $f$ . Thus,  $G^*$ , which is obtained as a composition of  $f$  and  $\xi$ , must be a sufficient representation of  $\mathbf{x}$  (Appendices A.2 and A.3). Since sufficiency is the upper-bound on the amount of label information that a representation can encode (Appendix A.3),  $\mathcal{G}^*$  is the graph that satisfies the condition in the theorem. In the section below, we show that the way to obtain  $\mathcal{G}^*$  from  $\mathbb{G}$  is by recovering transitive relationships among local views.
3.2 Transitivity Recovery
Definition 2 (Emergence). The degree to which a set of local views  $(\mathbf{v}_1,\mathbf{v}_2,\dots \mathbf{v}_k)$  contributes towards forming the global view. It can be quantified as  $I(\mathbf{v}_1\mathbf{v}_2\dots \mathbf{v}_k;\mathbf{g})$
Figure 2: The TRD pipeline: We begin by computing a Complementarity Graph  $(\mathcal{G}_c)$  on the view embeddings obtained from  $f$ . The Graph Encoder derives the Semantic Relevance Graph  $(\mathcal{G}_s)$  through transitivity recovery on  $\mathcal{G}_c$ . We perform a class-level clustering of the instance node and edge embeddings, producing a proxy graph, representing the salient concepts of a class and their interrelationships. The sufficiency of  $\mathcal{G}_s$  is guaranteed by minimizing its Hausdorff distance with its proxy graph.
Definition 3 (Transitivity). Local views  $\mathbf{v}_1, \mathbf{v}_2$ , and  $\mathbf{v}_3$  are transitively related iff, when any two view pairs have a high contribution towards emergence, the third pair also has a high contribution. Formally,
$$
I (\mathbf {v} _ {i} \mathbf {v} _ {j}; \mathbf {g}) > \gamma \wedge I (\mathbf {v} _ {j} \mathbf {v} _ {k}; \mathbf {g}) > \gamma \Rightarrow I (\mathbf {v} _ {i} \mathbf {v} _ {k}; \mathbf {g}) > \gamma ,
$$
where  $(i,j,k) \in \{1,2,3\}$  and  $\gamma$  is some threshold for emergence. A function  $\varphi(\mathbf{v})$  is said to be transitivity recovering if the transitivity between  $\mathbf{v}_1, \mathbf{v}_2$ , and  $\mathbf{v}_3$  can, in some way, be inferred from the output space of  $\varphi$ . This helps us quantify the transitivity of emergent relationships across partially overlapping sets of views.
Theorem 3. A function  $\varphi (\mathbf{z})$  that reduces the uncertainty  $I(\mathbf{v}_i\mathbf{v}_j;\mathbf{g}|\varphi (\mathbf{z}_i)\varphi (\mathbf{z}_j))$  about the emergent relationships among the set of views can define a  $\mathcal{G}_s$  by being transitivity recovering.
Intuition: Reducing the uncertainty about transitivity among the set of views is equivalent to reducing the uncertainty about the emergent relationships, and hence, bridging the information gap. If  $\mathbf{v}_1$ ,  $\mathbf{v}_2$ , and  $\mathbf{v}_3$  are not transitively related, then it would imply that, at most, only one of the three views  $(\mathbf{v}_j)$  is semantically relevant, and the other two  $(\mathbf{v}_i, \mathbf{v}_k)$  are not. This leads to a degenerate form of emergence. Thus, transitivity is the key property in the graph space that filters out such degenerate subsets in  $\mathbb{L}$ , helping identify view triplets where all the elements contribute towards emergence. A further discussion can be found in Appendix A.11. Now, we know that relational information must be leveraged to learn a sufficient representation. So, for sufficiency, a classifier operating in the graph space must leverage transitivity to match instances and proxies. In the proof, we hence show that transitivity in  $\mathbb{G}$  is equivalent to the relational information  $\mathbf{r} \in \mathbb{R}^n$ . Thus, the explanation graph  $\mathcal{G}^*$  is a maximal MI member of  $\mathbb{G}$  obtained by applying a transitivity recovering transformation on the Complementarity Graph.
3.3 Generating Interpretable Relational Representations
Depicted in Figure 2, the core idea behind TRD is to ensure relational transparency by expressing all computations leading to classification on a graph of image views (Theorem 1), all the way up to the class-proxy, by decomposing the latter into a concept graph (Corollary 1.1). We ensure the sufficiency (Theorem 2) of the instance and proxy graphs through transitivity recovery (Theorem 3) by Hausdorff Edit Distance minimization.
Complementarity Graph: We start by obtaining relational-agnostic representations  $\mathbb{Z}_{\mathbb{V}}$  from the input image  $\mathbf{x}$  by encoding each of its views  $\mathbf{v} \in \mathbb{V}$  as  $f(\mathbf{v})$ . We then obtain a Complementarity Graph  $\mathcal{G}_c \in \mathbb{G}$  with node features  $\mathbb{F}_{\mathbb{V}} = \mathbb{Z}_{\mathbb{V}}$ , and edge strengths inversely proportional to the value of the mutual information between the local view embeddings  $I(\mathbf{z}_i, \mathbf{z}_j)$  that the edge connects. Specifically, we instantiate the edge features  $\mathbb{F}_{\mathbb{E}}$  as learnable  $n$ -dimensional vectors, all with the same value of
$1 / |\mathbf{z}_i\cdot \mathbf{z}_j|$ . This particular choice of calculating the edge weights is valid under the assumption that  $f$  is a semantically consistent function. Intuitively, local views with low mutual information (MI) are complementary to each other, while ones with high MI have a lot of redundancy. The inductive bias behind the construction of such a graph is that, strengthening the connections among the complementary pairs suppresses the flow of redundant information during message passing, thereby reducing the search space in  $\mathbb{G}$  for finding  $\mathcal{G}^*$ . The global view  $\mathbf{g}$ , however, is connected to all the local-views with a uniform edge weight of  $\mathbb{1}^n$ . This is because the local-to-global emergent information, i.e.,  $I(\mathbf{l}_i\mathbf{l}_j\dots ;\mathbf{g})$ , is what we want the model to discover through the learning process, and hence, should not incorporate it as an inductive bias.
Semantic Relevance Graph: We compute the Semantic Relevance Graph  $\mathcal{G}_s$  by propagating  $\mathcal{G}_c$  through a Graph Attention Network (GAT) [77]. The node embeddings obtained from the GAT correspond to the  $\varphi (\mathbf{z})$  in our theorems. We ensure that  $\varphi$  is transitivity recovering by minimizing the Learnable Hausdorff Edit Distance between the instance and the proxy graphs (Corollary 1.1), which is known to take into account the degree of local-to-global transitivity for dissimilarity computation [64]. Below, we discuss this process in further detail.