Concept logic trees: enabling user interaction for transparent image classification and human-in-the-loop learning
Abstract
HAT.tec GmbH
Full text
Applied Intelligence https://doi.org/10.1007/s10489-024-05321-4 Concept logic trees: enabling user interaction for transparent image classification and human-in-the-loop learning David M. Rodríguez1,2 ·Manuel P. Cuéllar1·Diego P. Morales1 Accepted: 4 February 2024 © The Author(s) 2024, corrected publication 2024 Abstract Interpretable deep learning models are increasingly important in domains where transparent decision-making is required. In this field, the interaction of the user with the model can contribute to the interpretability of the model. In this research work, we present an innovative approach that combines soft decision trees, neural symbolic learning, and concept learning to create an image classification model that enhances interpretability and user interaction, control, and intervention. The key novelty of our method relies on the fusion of an interpretable architecture with neural symbolic learning, allowing the incorporation of expert knowledge and user interaction. Furthermore, our solution facilitates the inspection of the model through queries in the form of first-order logic predicates. Our main contribution is a human-in-the-loop model as a result of the fusion of neural symbolic learning and an interpretable architecture. We validate the effectiveness of our approach through comprehensive experimental results, demonstrating competitive performance on challenging datasets when compared to state-of-the-art solutions. Keywords Soft decision trees ·Concepts ·XAI ·Neural symbolic ·Image classification ·Human-in-the-loop 1 Introduction Interpretable machine learning models are increasingly important in domains where transparent decision-making is required. Miller [26] introduced several considerations for implementing new interpretable AI models. The author emphasized that explanations are a form of knowledge transfer resulting from interaction. Many studies have focused on interpreting models based on black boxes or defining interpretable models. However, we believe that defining interpretable solutions enabling user interaction with the model is an understudied area. This study addresses that research gap by exploring the fusion of soft decision trees, neural symbolic learning, and concept learning. The objective is to develop an interpretable classification model enabling user BDavid M. Rodríguez [email protected].es ; da[email protected] Manuel P. Cuéllar [email protected] Diego P. Morales [email protected] 1University of Granada, 18071 Granada, Spain 2HAT.tec Lilienthalstraße 15, 85579 Neubiberg, Germany intervention and incorporating expert knowledge. Our fusion proposal is based on the following arguments: – Concept learning facilitates human intervention and interpretation [18]. Furthermore, it enables the use of neural symbolic learning and the definition of first-order logic predicates based on human-understandable concepts. – Neural symbolic learning enables the definition of rules to articulate, intervene, and explore the model’s decisionmaking process. – If the user is not able to understand the decision-making process, the interaction with the model is not possible. The use of soft decision trees enables the user to understand the decision-making process. Additionally, the use of soft routing enables the integration with fuzzy logic. This allows users to define first-order logic rules for intervening in the routing process. Our main contribution is a novel solution in the field of image classification, designed to inherently provide interpretability due to its transparent architecture. By integrating neural symbolic learning via Logic Tensor Networks, our model enables users to incorporate expert knowledge through the definition of first-order logic rules and predicates. Moreover, 123
D.M. Rodríguez et al. the proposed fusion of concept learning and neural symbolic learning enables the user to inspect the model by making queries based on different classes or combinations of concepts. A key contribution of our approach is the ability to impose constraints on the soft decision tree’s routing process. These constraints, specified as first-order logic rules and predicates based on concept or class combinations, provide users with greater control over the decision-making process. Additionally, our proposed approach enables users to inspect the decision routes taken by the model through queries. All these features together introduce transparency and interpretability by providing insights into the model’s decision-making process. We evaluate our proposed approach on challenging datasets and compare its performance to state-of-the-art solutions, demonstrating competitive results. Furthermore, we discuss future research directions, including the potential of combining neural symbolic learning and soft decision trees in reinforcement learning domains. The article is organized as follows: first, we provide an overview of related work in Section 2. Next, the proposed approach is presented in Section 3. Then, in Section 4we describe the experiments and discuss the results. Finally, Section 5presentsfutureresearchdirectionsandconclusions. 2 Related work While the initial machine learning algorithms were transparent to the user and easily interpretable, in recent years, opaque decision systems like deep neural networks (DNNs) have become the “de facto” solution for many machine learning problems in different critical context fields such as medicine, defense or system safety [1,6,37]. However, solutions based on DNNs are considered ’black-box’ machine learning models whose behavior can be hard to explain. Consequently, there has been a growing interest in explainable artificial intelligence (XAI). Post-hoc explanations, which involve interpreting methods after training the models are widely adopted approaches for explaining DNNs [1]. Some well-known post-hoc explanation techniques as Local Interpretable Model-Agnostic Explanations (LIME) [31]orClass Activation Mapping (CAM) [39] identify the specific regions of input features that the networks focus on when making predictions. On the flip side, achieving transparent deep learning models is a primary objective of XAI and an actively researched area. Traditional machine learning models and algorithms like decision trees or k-NN offer interpretability and transparency but are outperformed by opaque models such as deep neural networks. Consequently, recent research has been dedicated to resolving this well-known trade-off between performance and explainability [10,27,32], aiming to define models that are inherently transparent and do not require post-hoc explanation techniques. In this search for more explainable model architectures, some authors have aimed to fusion the transparency of decision trees and the power of deep learning methods. Decision trees are considered transparent models as following the decision paths enables humans to understand the rationale behind a prediction or classification [29]. However, as previously mentioned, decision trees do not generalize as well as neural networks. Kontschieder et al. [19] introduced Deep Neural Decision Forests, aiming to combine representation learning from deep learning with the divide- and-conquer principle of decision trees. They introduced a stochasticanddifferentiabledecisiontreecalled“neuraldecision tree”. The proposed solution is an ensemble of these neural decision trees known as a decision forest. Wan et al. [36] presented their approach Neural-Backed Decision Trees (NBDT). They proposed a hierarchy-learning-based model where every node of a decision tree is formed by a neural network that makes low-level decisions. This approach induces hierarchies that can be used to explain the model’s decision-making process. Frosst and Hinton [12] proposed distilling a neural network into a Soft-Decision-Tree (SDT). They described a method that utilizes a pre-trained neural network to train a soft decision tree using stochastic gradient descent and the predictions of the neural network as targets. Their model makes hierarchical decisions based on the learned filters and selects a particular static probability distribution over classes as the output. Another interesting approach that has gained attention in the search for transparent models is concept-based explainability. Researchers exploring this approach aim to develop interpretable models by designing them to rely on concepts as the basis for their decision-making. Concepts, in this context, refer to high-level and semantically meaningful units of information such as color, texture or shape. The resonating process of the models can be interpreted by generating explanations that are based on those concepts [24]. One of the most known research articles in this field was published by [18], who presented concept bottleneck models (CBMs). They proposed to use a CNN as a concept extractor that maps raw inputs (x)to concepts (c). After that, a second model maps these concepts (c)to targets (y)performing the final classification. Other authors have proposed to train object detectors or segmentation models as concept extractors to localize object parts that are used as concepts. The final model solution combines those models with a classifier that bases its decision on the detected object parts [3,6]. While many of these studies have concentrated on interpreting models with black-box characteristics or creating interpretable models, we consider that the exploration of interpretable solutions enabling user interaction remains a relatively underexplored research area. Miller [26] outlined 123
Concept logic trees: enabling user interaction for transparent image... several factors to consider during the implementation of novel interpretable AI models. The authors emphasized the nature of explanations as a form of knowledge transfer resulting from interactions. In this context, [18] proposed a concept-learning model that allows concept intervention. Mispredicted concepts can be corrected using expert knowledge, enabling users to refine and improve the model’s predictions [18,38]. With the aim of merging transparent architectures with concept learning, we investigated the fusion of concept bottleneck models and soft decision trees in our previous article [28]. However, although this fusion enabled the generation of explanations by analyzing the decision paths based on human-understandable concepts, the human interaction or intervention and the use of expert or background knowledge were limited. Conventional neural networks and deep learning methods do not take domain or background knowledge into account [35]. In recent years, the use of symbolic approaches to avoid these limitations has been subject of study [2,34,35]. The inclusion of symbolic knowledge in the form of first-order logic constraints into the loss function during deep networks training is a promising approach, that has been shown to enhance the fairness of the machine learning system while also preserving its performance [34]. In this field, an interesting framework was presented by [2]. Their proposal Logic Tensor Networks (LTN) allows defining variables, and predicates, where the variables are grounded by tensors, and predicatescanbegroundedbyanyneuralnetwork.Thepower of this approach relies on the definition of relations among the predicates that can be established as logical rules. Those rules can be used to define metrics or loss functions. The application of this framework to different tasks such as logic reasoning [2], object detection [22], zero shot learning [25] or image segmentation [9] has been demonstrated. In this article, we investigate the fusion of neural symbolic learning and concept learning with the aim of developing an interpretable deep learning model. Our proposed model combines a soft decision tree and a concept-based model to define an interpretable model that performs image classification basing its decision on human-understandable concepts. The final decision-making process is conducted by a soft decision tree that can be visualized and explored by the user. The use of neural symbolic learning enables human intervention, as an expert can explore the decision tree and improve it by using his knowledge to redefine the decision tree. This results in a learning cycle where the user can control and intervene in the training process. This learning cycle can be observed in the diagram presented in Fig. 1. 3 Methodology In this section we present our proposed solution that corresponds to the learning cycle presented in Fig. 1. We propose the fusion of three approaches that have been shown to improve the transparency of deep learning models: neural symbolic learning, Soft Decision Trees and Concept Bottlenecks.Our study involvesemployingLogic TensorNetworks to train a CNN as a concept extractor, mapping images to concepts. A Soft Decision Tree serves as a predictor for final classification, utilizing the extracted concepts. Figure 2illus- trates the architecture diagram of our proposed model. The utilization of neural symbolic learning during the training phase allows for the inclusion of domain knowledge and provides a tool for interpreting results during testing and inference time. 3.1 Concept bottlenecks In the field of concept learning, the image classification problem is usually formalized as follows [18]: Let us consider an input vector, denoted as x∈Rd, a target output, denoted as y∈Y,andaconceptvector,denotedasc∈[0,1]k.Thetraining dataset consists of samples of the form [(xn,yn,cn);n= 1...N]. We propose a model based on the concept bottlenecks presented in [18]. The proposed model takes the form t(g(x)), Fig. 1 Learning cycle. The use of neural symbolic learning enables human intervention. An expert can control the training process and intervene the model by revising the knowledge through the definition or re-definition of knowledge rules 123
D.M. Rodríguez et al. Fig. 2 Architecture diagram of the proposed solution. The concept extractor g(implemented by a Resnet-50) takes an image as input and outputs the concept vector. The binary soft decision tree tgets the concept vector as input and outputs the final prediction where g:Rd→[0,1]kmaps the image from the input space to the concept space. A classification subnetwork t:[0,1]k→Ymaps c=g(x)from the concept space to the target space. In our case, this classification subnetwork is implemented by a soft decision tree. This model can be trained by combining two loss functions: A classical classification loss function LY:Y×Y→R+, which measures the discrepancy between the model’s output y=t(g(xi)) and the target output yifor a given training sample (xi,ci,yi). A concept loss function Lc:[0,1]k×[0,1]k→R+that measures the discrepancy between the output of the concept extractor g(xi)and the true concept vector ci. This loss function captures the dissimilarity between the predicted and actual concept vectors. By optimizing these two loss functions, the proposed model learns to associate the input features with the relevant concepts and make predictions based on the learned concept-target relationships. The authors proposed three ways of training the concept bottlenecks: – Independent bottleneck: the two models tand gare trained independently. That is, gis trained on the training set [(xn,yn,cn);n=1...N]minimizing N n=1 Lc(g(xn);cn)while tis trained on the corresponding concepts subset by minimizing N n=1LY(t(cn);yn) – Sequential bottleneck: tis trained on the output of g. That is, tminimizes N n=1LY(t(g(xn));yn). The concept extractor gis trained as before. – Joint bottleneck: gand tare trained jointly by minimizingthecombinedlossfunctionN n=1LY(t(g(xn));yn)+ δN n=1Lc(g(xn);cn). The hyperparameter δ>0 controls the trade-off between the two losses. 3.2 Soft decision trees Traditional decision trees employ deterministic routing, where each sample is directed to exactly one path at each node. However, this deterministic routing introduces discontinuities in the loss function, making classical decision trees unsuitable for gradient descent-based optimization algorithms [15]. Consequently, classical decision trees cannot be trained using such algorithms. To overcome this limitation, we propose a model based on the binary soft decision tree presented in [12]. Unlike classical decision trees, soft decision trees employ probabilistic routing (or soft routing) instead of deterministic routing. This soft routing technique ensures that the loss function remains continuous, enabling the use of gradient descent-based optimization methods [12, 15]. Like classical trees, soft decision trees are formed by nodes and leaves. Given an input feature x, the probability of taking the right branch at node iis calculated as: pi(x)=θ(xwi+bi)(1) where θrepresents the logistic sigmoid function, and wiand biare the learned parameters. The probability of routing to the left branch is 1 −pi(x). Each leaf node lgenerates a probability distribution over the output classes. This is done by applying the softmax function on the learned parameters φlassociated with the corresponding node l: Ql=softmax(φl)(2) 123
Concept logic trees: enabling user interaction for transparent image... To train the tree, the following loss function is defined: LT(x)=−log( l∈L Pl(x) k∈Y yklog Ql k)(3) where Yrepresents the set of possible labels, kis the index of the label, and ykdenotes the target probability of xbelonging to class k(either 0 or 1). Pl(x)corresponds to the probability of arriving at leaf node lgiven the input x, that is Pl(x)= N pi(x)1[li](1−pi(x))1[il](4) Here, the indicator function 1evaluates to 1 if the condition holds, and 0 otherwise. The notation [li](and [il]) indicates that leaf lbelongs to the left (or right) subtree of node i. The output of the model is the distribution associated with the leaf having the maximum path probability. Additionally, a penalty term is incorporated to ensure balanced utilization of both the left and right subtrees, as mentioned in [12]. 3.3 Logic tensor networks Logic Tensor Networks is a neural-symbolic framework that enables the use of first-order fuzzy logic in combination with deep learning neural networks. By defining variables, constants,predicates andrules ina so-called knowledge base, the learning problem can be seen as an optimization problem, consisting on maximizing the satisfiability of the formulas defined in the knowledge base. As an example, consider a basic binary classification problem where we have samples x∈Xthat can belong to class Aor to B. Furthermore, we know that for any sample, if a given feature fiis greater than 0, that sample belongs to class B. We can then define the knowledge base as follows K={∀xaP(xa), ∀xb¬P(xb), ∀x:fi>0⇒ ¬ P(x)} wherethenotation xarepresentssamplesbelongingtoclass A and Pis a predicate that outputs the probability of belonging to class A. To benefit from deep learning techniques, the predicate Pcan be grounded with a neural network with weights φ. To train a neural network in this environment, a loss function can be defined in the following way: LSym =1−SatK(x,φ) (5) where Sat is the satisfiability of the formulas defined in the knowledge base K, for a model with trainable weights φ. In our proposed solution the predicates involved in the rules defined by the user in the knowledge base are grounded on the model described before (see Fig. 2).Thiswayweareable to train the model using the knowledge rules. The rules and axioms defined can also be used to inspect the model and to interpret its decisions and behaviour [2,9] on inference time. In this research work, we explore both approaches. 3.4 Proposed training approach In this section, we describe the proposed training approach. This solution we describe allows us to train the model proposed above (shown in Fig. 2) according to the learning cycle introduced in Fig. 1. For this purpose, we combine the loss functions presented before in the Sections 3.1,3.2 and 3.3. The equation for the proposed approach is presented in (6): N n=1 (αLY(t(g(xn));yn)+βLSym(xn,φ)+δLc(g(xn);cn)) (6) where the hyperparameters α, β, δ > 0 control the trade-off between the losses. In Fig. 3a diagram of the training process is presented. The proposed model is fed with the images and outputs the concept and class predictions as inference results. The loss calculator gets those outputs and the rules defined in the knowledge base as inputs and calculates the training loss according to (6). The user can observe and control the model. Based on this observation, he can add knowledge in the form of first-order logic rules to the knowledge base or modify the already existing knowledge. This training process implements the learning cycle previously discussed in Fig. 1. Furthermore, we explore the combination of neural symbolic learning with each of the three possible conceptbottleneck models described in Section 3.1. The proposed solution explained above follows the Joint approach. For the independent and sequential approaches the training of the concept extractor would remain the same as explained in Section 3.1. The classifier training would be done by minimizing the (7): N n=1 (αLY(t(cn);yn)+βLSym(xn,φ)) (7) Please note that for the sequential approaches cn=g(xn) while for the independent approaches, cnwould be the corresponding concept label, according to the original ideas presented in Section 3.1. 4 Experimental setup, evaluation and results This section provides an overview of the two datasets utilized for evaluating the proposed method. Subsequently, we outline the implementation details and describe the experiments 123
D.M. Rodríguez et al. Fig. 3 Diagram of the proposed training process. The user can redefine the knowledge base by adding or modifying rules. These rules are used to compute the symbolic loss LSym as explained in Section 3.3. The final loss function is calculated aggregating all losses LY,Lcand LSym as explained in (6) conducted, along with the evaluation metrics employed. Lastly, we present and analyze the results obtained. 4.1 Datasets We evaluated the proposed methods on two datasets: the Semantic PASCAL-Part dataset [8] and the MonuMAI dataset [21]. The MonuMAI dataset [21] consists of over 1500 images of monuments belonging to four architectural styles: Gothic, Hispanic-Muslim, Renaissance and Baroque. The dataset has been expertly annotated, with human experts providing labels for monument style classification and key architectural element detection. Additionally, labels for fifteen key architectural element types (i.e. flat arch, pointed arch, porthole...) were also generated. The classification and analysis of those key elements can be used to explain the decision of a classifier as done in [3,21]. The PASCAL VOC 2010 dataset [11]isawell-known image dataset comprising 20 object classes. Supplementary part-based annotations were provided in the PASCAL-Part dataset [5]. We evaluate the proposed approach on a curated version of the PASCAL-Part dataset presented in [6]. The authors aggrouped some similar categories in order to reduce thenumberofobjectpartcategories.Additionally,theimages were selected so that only one main object class per image is present (classical image classification problem). The result is an image dataset containing over 1400 images belonging to 20 categories (i.e Person, TV, Train, etc.). Furthermore, the images are part-annotated on more than 40 different elements (i.e Leg, Body, Wheel,...). This dataset has already been explored on concept-based or part-based research articles [3,6]. 4.2 Implementation details The proposed method was implemented on Pytorch, and the code is available for download.1The LTN-pytorch framework was used for the neural-symbolic setup. As the backbone for the concept extractor we use a Resnet-50 [16]. Thesoft decision treeis based onthe model describedin [12]. The code is based on the implementation provided in [7] and adapted to be integrated with the LTN framework. The depth parameter is set to 4 after a preliminary analysis. We used the Adam optimization algorithm [17] for all networks. The training scripts for the concept bottlenecks are based on the scripts provided by the authors of the original article [18]. 4.3 Predicates and rules We defined three different types of rules and their associated predicates: – Basic class rules and predicates: one rule per class, they are of the form ∀xgothic Pgothic(xgothic) . In this case, the rule specifies that for all samples of the class “gothic” (xgothic) the predicate “is gothic” 1https://github.com/DavidMrd/LogicConceptSoftTrees 123
Concept logic trees: enabling user interaction for transparent image... (Pgothic) should be true. We implemented the predicate as described in [2] for multi-class single-label problems. One of the advantages of this implementation is that the use of a softmax function ensures that no rules of the form ∀xgothic¬Pbaroque(xgothic) are needed. – Knowledge rules and predicates: They are of the form ∀x:xpointed_arch ⇒Pgothic(x). In this case, the rule specifies that all samples containing the concept “pointed arch” should be classified with the class label “gothic”. These rules formed the knowledge bases presented in Figs. 4and 5. This knowledge is extracted from the descriptions provided by the authors of the datasets [8, 21] and also from our own previous inspections of the datasets. In order to propagate gradients only over the corresponding subsets (in the example the subset of samples which verify the condition of “containing a pointed arch”) we used guarded quantifiers [2] for the implementation. The predicates can be implemented the same way as above, with the only difference of using the concept labels instead of the class labels. – Path rules and predicates: We can define two types of rules depending on the type of labels that they are based on: – based on class labels: ∀xgothic Ppath1(xgothic).Inthis example, the rule specifies that all samples belonging to the class “gothic” should follow the path path1 – based on concept labels: ∀x:xpointed_arch ⇒ Ppath2(xgothic). In this example, the rule specifies that all samples containing a “pointed arch” should follow the decision path path2. In these rules, pathiis a vector of size nbrach the number of branches. The predicates Ppathioutput the probability of going through the selected branches. Every path can Fig. 4 Knowledgebaseforthe MonuMAIdataset. Thisknowledgebase contains all knowledge rules for the MonuMAI dataset. See Section 4.3 be a hole path from the top to one leaf or just a partial path (i.e. probability of visiting one specific node). To use these rules we had to adapt the soft decision tree so that we can get the probability of following a specific path as output. These rules allow the user to specify decision paths based on the classes (based on class labels) or based on the presence or absence of certain elements (based on concept labels). 4.4 Experiments and results In this section, we introduce the experiments carried out to validate the proposed methods (see Section 3) on the datasets presented in Section 4.1. We kept the splits in training and test sets that were proposed in [3,6]. 4.5 Preliminary experiments In this section we present some preliminary experiments that we carried out during the construction of the final solution. They have the character of an ablation study, as we tested the addition of some components to the final model. 4.5.1 Soft decision tree In order to justify the use of a soft decision tree in the proposed solution, we performed the following experiment. We compared a soft-decision-tree-based concept bottleneck with a concept bottleneck based on a neural network classifier. The first model corresponds to the model of the proposed solution (without including the neural symbolic learning). For the second model, we used a multilayer perceptron (3- layers) as a classification subnet. We kept the Resnet-50 as concept extractor for all models. To make a fair comparison, we used the same extracted concepts for the independent and the sequential approaches (where the classifier is trained offline). We present the results in Table 1. That is the reason why the C-Acc for those two approaches is the same for all models. The Joint-Tree model gets the best results, achieving almost 2 points accuracy more than the second-best model on the main task. The independent and the sequential tree models perform slightly better than the corresponding baseline models. 4.5.2 Class rules and multi-class cross-entropy In this subsection, we analyze the use of class rules and the optimization of their satisfiability to train the model compared to the classical approach based on a multi-class cross-entropy loss function. The use of class rules would allow us to go for a “pure” satisfiability optimization solution (pure LTN-Solution), while the use of a multi-class crossentropy (CCE) approach would mean a fusion of training 123
D.M. Rodríguez et al. Fig. 5 Knowledge base for the PASCAL dataset. This knowledge base contains all knowledge rules for the PASCAL dataset. See Section 4.3 approaches (satisfiability for the knowledge rules and classical approach for the classes). The results are presented in Table 2. Please note that these results correspond to models where no knowledge in form of attribute rules is present. For the Independent and Sequential models the results are pretty similar. However, we found that the training of the sequentialmodel basedonapuresymbolic learning approach was difficult and even if we trained the model during much more epoches than the Joint-N model, the model did have many travels to converge and the finally Y-Acc got was much lower than the one got by the model using multi-class crossentropy. After these results, we decided to use the classical approach based on multi-class cross-entropy, as the pure LTN approach does not bring any advantages and it needs more epochs to converge. Please note that these models do not incorporate attribute logics. The results for the proposed models are presented in the next section. 4.6 Results In this section, we report and analyze the results obtained for the proposed approach on the two datasets. In Table 3we present the results obtained for the different methods on the proposed datasets. We evaluate how each proposed approach performs for two different tasks: concept Table 1 Results of the proposed previous experiments comparing the useofsoft-decision-treebasedmodelstomultilayer-perceptronbaseline models on the MonuMAI dataset for the already presented metrics MonuMAI Ind-Tree Seq-Tree Joint-Tree Y-Acc 92.74 92.85 97.69 C-Acc 97.62 97.62 97.64 Ind-Baseline Seq-Baseline Joint-Baseline Y-Acc 92.34 92.41 95.93 C-Acc 97.62 97.62 92.79 Best results for each evaluation measurement are in bold extraction and final classification. Using the annotation presented in Section 3, given a trained concept extractor gand a trained tree t, we evaluate the classification task by computing the accuracy (Y-ACC) of the proposed bottleneck t◦g, that is Y−Acc =Acc(y,y)(8) where yis the target, this is the given annotation label for the sample xand y=t(g(x)) is the final prediction of the proposed model. To evaluate how the concept extractor g performs, we compute the concept accuracy C−Acc, that is C−Acc =Acc(c,c)(9) where cis the vector representing the annotated concepts for agivensamplexand c=g(x)is the prediction of gfor the sample x. Furthermore for the neural symbolic approaches we compute the mean satisfiability Sat for the corresponding rules defined in the knowledge base K, given the model with trainable weights φ. Sat =SatK(x,φ) (10) We repeated every experiment three times and present the mean results in Table 3. As baseline methods, we use the approaches presented in [28]. Note that the baseline methods have the same architecture as the proposed solutions, as described in Sections 3.4 and 4. The difference relays on the integration with neural symbolic learning via Logic Tensor Network and the incorporation of first-order logic into the training. We use the letter “N” to notate the proposed models that were trained using neural symbolic learning. “Ind,” “Seq”and“Joint”representthethreedifferentconceptbottlenecks: Independent, Sequential, and Joint (see Section 3.1). It can be observed that the Independent model and the Sequential model performed very similarly on both datasets. Please note that the C-Acc for those two approaches is the 123
Concept logic trees: enabling user interaction for transparent image... Table 2 Results of the proposed experiments to analyze the use of class rules (LTN models) compared to a classical approach (CCE models) on the MonuMAI dataset for the already presented metrics MonuMAI Ind-LTN Ind-CCE Seq-LTN Seq-CCE Joint-LTN Joint-CCE Y-Acc 92.1 92.74 92.21 92.85 78.22 97.69 C-Acc 97.62 97.62 97.62 97.62 96.92 97.64 Best results for each evaluation measurement are in bold same since the same concept extractor gis used for both models, and only tis different. Please refer to Section 3for more details. The neural symbolic approaches achieve competitive performance compared to the baselines, despite the imposed constraints. This enhances the explainability of the models without creating a significant trade-off in their accuracy. The neural symbolic approaches offer the user the possibility of understanding the model decision process through the defined rules. In the table, we present the mean satisfiability forthe rules, butfor the userwoulditbe also possibleto know the satisfiability of each rule. This is translated into a good trade-off between explainability and performance. For example, the satisfiability per rule for the Seq-N on the PASCAL dataset is [88.91, 88.18, 80.24, 98.70, 99.64, 95.69, 90.04, 76.99, 89.28, 97.12, 85.56, 98.50, 90.61, 92.47, 95.19, 82.48, 81.85], where the rules are in the same order as presented in Table 5. In this way, we can see that the rule with the lowest satisfiability is rule number 8. This is not surprising as it is the only rule that involves more than 5 attributes. Inspecting the rule for the labels, we see that the satisfiability of the rule in the training set is of 99.99. So we can be sure that the rule is well-defined, so we should work on improving the behaviour of the model for these attributes and for the corresponding class, maybe giving it more importance (i.e. using balance weights during training). In the case of the Joint approaches, which performed best for the baseline, we would like to note that we encountered particularly challenging training those models, as it required optimizing three loss functions simultaneously: the concept loss, the classification loss, and the symbolic loss. (see Section 3). For the MonuMAI dataset, in order to attain comparable accuracy to the baseline, the results for rule satisfiability decline compared to other approaches. By optimizing the parameters in the corresponding loss equation (see Section 3.1) the Joint model could be forced to pay more attention to the concepts, to the final prediction, or to the knowledge base. For the Pascal dataset, the results are really promising, although the concept accuracy is a bit lower than for other models. For the PASCAL dataset, our the Joint-N approach outperforms the corresponding baseline. We can see that not only the final Y-Acc is higher, but also that the performance of the concept extractor is higher than in the baseline. The model benefits from the knowledge base and the joint training approach, getting also the highest satisfiability, 91.55 (2 points higher than for the sequential approach). 4.7 Use case: user intervention In this section, we present two use cases for the two studied datasets, in which the user modifies the behavior of the decision tree using logical rules. We first present a use case for the Pascal dataset, where our goal is to group the classes into three categories (animal, transportation, and indoor object) and force the tree to distinguish between these three categories at the initial nodes. To achieve this, we define the logical variables Animal, IndoorObj, and Transport, which represent the classes belonging to these categories. We define these variables based on attributes. For example, we define the Animal variable based on the presence of the following attributes: Torso, Tail, Neck, Eye, Leg, Beak, AnimalWing, Table 3 Results of the proposed experiments on both datasets for the already presented metrics MonuMAI Baseline-Ind Ind-N Baseline-Seq Seq-N Baseline-Joint Joint-N Y-Acc 92.74 91.00 92.85 92.03 97.69 95.71 C-Acc 97.62 97.62 97.62 97.62 97.64 95.35 Sat −92.29 −94.01 −90.67 PASCAL Baseline-Ind Ind-N Baseline-Seq Seq-N Baseline-Joint Joint-N Y-Acc 82.56 81.20 82.8 81.00 85.57 89.25 C-Acc 97.21 97.21 97.21 97.21 94.64 96.84 Sat −83.15 −89.42 −91.65 Best results for each evaluation measurement are in bold. 123