FI-CBL: A Probabilistic Method for Concept-Based Learning with Expert Rules
Abstract
A method for solving concept-based learning (CBL) problem is proposed. The main idea behind the method is to divide each concept-annotated image into patches, to transform the patches into embeddings by using an autoencoder, and to cluster the embeddings assuming that each cluster will mainly contain embeddings of patches with certain concepts. To find concepts of a new image, the method implements the frequentist inference by computing prior and posterior probabilities of concepts based on rates of patches from images with certain values of the concepts. Therefore, the proposed method is called the Frequentist Inference CBL (FI-CBL). FI-CBL allows us to incorporate the expert rules in the form of logic functions into the inference procedure. An idea behind the incorporation is to update prior and conditional probabilities of concepts to satisfy the rules. The method is transparent because it has an explicit sequence of probabilistic calculations and a clear frequency interpretation. Numerical experiments show that FI-CBL outperforms the concept bottleneck model in cases when the number of training data is small. The code of proposed algorithms is publicly available.
Keywords: concept-based learning, expert rules, Bayes rule, classification, logical function, inductive and deductive learning.
1 Introduction
Concept-based machine learning (CBL) is an innovative and promising approach that focuses on utilizing high-level concepts derived from raw features to express predictions in machine learning models, rather than using the raw features themselves [1]. This approach aims to integrate expert knowledge or human-like reasoning into machine learning models, leading to more efficient and accurate predictions. By incorporating high-level concepts, CBL can significantly improve explainability of the machine learning model outputs, making them more accessible to users [2, 3, 4, 5].
One of the key types of CBL is the concept-based bottleneck model (CBM) which can be regarded as a technique used for learning high-level representations of data by forcing the model to learn a compressed and low-dimensional representation of input features [6]. This low-dimensional representation is referred to as the bottleneck. In the context of CBL, the CBM learns high-level concepts by transforming the raw features into a low-dimensional space, which allows the model to capture the essential features while discarding irrelevant information. At that, the classifier deriving final labels has access only to the concept representation, and the decision is strongly tied to the concepts [4]. CBMs have been widely used in various machine learning tasks, such as image recognition, natural language processing, and speech recognition [7]. The CBM effectiveness lies in their ability to learn meaningful high-level concepts, which can be easily interpreted and understood by humans. This capability makes CBMs a powerful tool for develo** explainable and interpretable machine learning models.
It is important to points out that most models implementing CBL are based on applying a deep neural network which transform raw features or images into a specific low-dimensional representation, for example, the bottleneck, which contains information about the concept values. As a result, the neural network may be complex and require a huge amount of labeled instances for training, which are not available in some cases. Therefore, we propose an extremely simple and transparent model for CBL which is motivated by the work [8], devoted to annotating the histopathology images, and by an interesting observation of the relationship between multiple instance models (MIL) [9, 10, 11, 12]. MIL is a type of weakly supervised learning, which deals with two concepts: bags and instances. Each bag is labeled, and it consists of many instances or some its elements. For example, a histology digital image obtained from the glass microscope slides with a label indicating a disease, for example, cancer or non-cancer, can be viewed as a “bag” consisting of patches extracted from the image, which are referred to as “instances”.
It turns out that the MIL can be regarded as a special case of the concept-based learning where labels (concepts) of instances are unknown, but there is a label description of the whole image (the bag). Yamamoto et al. [8] proposed a simple algorithm for annotating instances (patches) by having annotated the whole images. The algorithm is based on clustering of the patch embeddings and computing probabilities that patches in each cluster are malignant or benign in a simplest way by calculating rates of patches from the malignant and benign images corresponding to the patches.
We extend the algorithm proposed by Yamamoto et al. [8] to CBL and develop a simple method for determining concepts of new images. The method is based on the frequentist inference and on computing prior and posterior probabilities of concepts using rates of patches from images with certain values of concepts. In other words, we calculate the relative frequencies of patches from images with the concepts. Therefore, the proposed method is called the Frequentist Inference CBL (FI-CBL). In addition, we propose approaches to incorporate the knowledge-based expert rules of the form “IF …, THEN …”, which are elicited from experts and constructed by means of concepts. For example, the rule from the lung cancer diagnostics of a nodule can look like “IF Contour is spicules, Inclusion is necrosis, THEN a Diagnosis is malignant. Here concepts are shown in Bold, their values are in angle brackets. It is important to note that the approach to incorporate the knowledge-based expert rules into neural networks in the framework of CBL has been proposed in [13]. Its idea is to add a special layer to a classification neural network, which computes a probability distribution of concepts in accordance with the available expert rules. According to [13], the probability distributions of concepts are approximately generated by the neural network and are corrected by the incorporated expert rules. We propose another approach for taking into account the expert rules. It is based on the combination of the Bayes rule and the multinomial distribution. The expert rules in the form of logic functions update prior probabilities of concepts as well as conditional probabilities in the Bayes rule. This is a simple way for using the expert rules as a specific type of constraints on probabilities of concepts. We have to note that the term “expert rules” is used in the proposed model in a broader sense as an arbitrary logical function of concepts.
The code of proposed algorithms is available in:
https://github.com/NTAILab/simple_concepts.
2 Related work
Concept-based learning models. Starting from the works [3, 5], many CBL models have been proposed to implement ideas behind the concept-based learning under various conditions. One of the goals to develop the CBL approaches is to interpret and explain predictions of machine learning models. In order to achieve this goal and to overcome some difficulties of the interpretation, a CBL model was proposed in [1]. Concepts in this model are fully transparent, thus enabling users to validate whether mental and machine models are aligned. A concept-based explanation framework was presented in [14]. An algorithm for learning visual concepts from images by applying a Bayesian generalization model was developed in [15]. It should be noted that not only images (visual data) are used in the CBL models, but also tabular data. For example, the concept attribution approach to tabular learning and a definition of concepts over tabular data were proposed in [16]. Applications of CBL goes beyond the explanation and extends to a wide variety of problems. Approaches for analysis time-series data using the CBL models were presented in [17, 18]. The well-known anomaly detection task in the framework of CBL was considered in [19, 20]. One of the important areas of the CBL application is medicine where doctors prefer explanations that are user-friendly and represented via natural language [21]. Several authors have contributed into development of the medicine CBL models [22, 23, 24, 25, 26]. Survey papers [2, 27, 28] comprehensively discuss many aspects of the CBL models and their applications.
Concept bottleneck models. Most CBL models are implemented in the form of the CBMs [6]. Due to the efficient and transparent two-module architecture of CBMs, where the first module (a neural network) implements the dependence of concepts on input instances, and the second module implements the dependence of the target variable on the concepts, many modifications and extensions of these models have been proposed [3, 29, 30].
An extension of CBMs is the concept embedding model [31] which learns two embeddings per concept, one for when it is active, and another when it is inactive. The model aims to overcome the current accuracy-vs-interpretability trade-off. Ideas behind the concept embedding model have been used in the concept bottleneck generative models [32].
Similarly to CBL, extensions and modifications of CBMs were motivated by their applications or different conditions of their applications. For example, to model the ambiguity in the concept predictions, a probabilistic CBM was introduced in [33]. Conditions of independence across concepts were studied in [34]. Different aspects of the concept-based interventions were considered in [35]. An application of CBMs to the images segmentation and tracking was presented in [36]. Two causes of performance disparity between soft (inputs to a label predictor are the concept probabilities) and hard (the label predictor only accepts binary concepts) CBMs were proposed in [37]. The CLIP-based CBMs using the well-known CLIP model [38] was proposed in [39].
The above modifications and extensions of CBMs can be regarded as a small part of all available modifications [40, 41, 42, 43, 44], which are caused by the great interest in CBL.
Incorporating expert rules into machine learning models. The idea of combining the prior expert knowledge with machine learning models has already attracted some interest, and a number of interesting approaches have been proposed for its implementation. A comprehensive and exhaustive review of various available approaches to integrate prior knowledge into the training process was presented in [45]. Authors in [45] also propose a concept of informed machine learning, which can be viewed as a uniting term for different approaches.
Depending on the knowledge representation, there are different approaches for the knowledge integration into the machine learning pipeline. We do not touch upon a large class of methods related to the representation of knowledge in forms of algebraic equations, differential equations, probabilistic relations, etc. An analysis and review of these methods can again be found in [45]. Our goal is to study the knowledge representation in the form of expert rules or logic rules. A common approach to incorporate the logic rules into a machine learning model is to add the rules as constraints to loss functions [46, 47, 48, 49]. However, this approach does not guarantee that the rules will be satisfied for all training and testing instances because violation of the constraints is only penalized, but not eliminated. Another way to integrate the rules into neural networks is to map components of the rules to neurons [50, 51]. In this approach, a neural network implements logic functions corresponding to the expert rules. An interesting approach has been proposed in [52] where authors present an effective safe abductive learning method and show that induction and abduction are mutually beneficial. An extensive review of methods for updating models based on expert feedback is presented in [53].
A quite different approach to incorporate expert rules into machine learning in the framework of CBL was presented in [13]. Following this approach, we present a computationally simple algorithm for predicting the concept probabilities and provide a way to incorporate the expert rules in the form of logic functions.
3 Background
A common statement of the CBL problem is based on considering a classifier which predicts a set of concepts as well as the target variable [54].
Suppose that a training set is represented as a set of triples , , where is the input feature vector; is the corresponding target defining -class classification task; is a set of concepts which are given with targets. In most works, concepts are represented as a vector with binary elements such that denotes that the -th concept is present in a description of the input , and denotes that the -th concept is not present.
One of the CBL goals is to predict targets and concepts that is to find the dependence on concepts and inputs. Another goal is to explain what concepts of the input are responsible for the corresponding prediction. In other words, the CBL model aims to interpret how predictions depend on concepts of the corresponding inputs. The above goals can be achieved by applying CBM proposed by Koh et al. [6] as an important type of the CBL models. The function in the CBM is represented as two functions: the first one maps the input vector to concepts; the second function maps the concepts to the outputs. The prediction for a new instance can be obtained as . Here concepts act as a bottleneck in the interpretation of predictions.
4 The model and its training
It is assumed that each concept can take a value from the set called the -th concept outcome set, . The concept is a special concept corresponding to the target variable .
We also suppose that there are images , , in the training set such that the -th image is characterized by a set of concept values . The whole dataset consists of pairs of vectors. For example, the lung cancer nodule description can be based on two concepts: Contour and Inclusion . The concept Contour takes values smooth grainy, spicules, the concept Inclusion takes values homogeneous and necrosis. The target value or the concept Diagnosis takes values: malignant and benign. Then we have the formal concept description , , .
Let us divide each image into patches of the same dimension denoted as . By using an autoencoder, we can obtain the corresponding embeddings of a smaller dimension.
In fact, we have a weakly supervised learning task where labels of the whole images are known, including values of all concepts or a part of concepts, but labels of patches are unknown. However, we can compute probabilities of labels for patches by separating embeddings corresponding to patches into groups (clusters) with different contents and by counting up how many whole images having a certain concept value contain patches from each group (cluster).
All embeddings are clustered into clusters , i.e., we obtain subsets of embeddings, which fall into -th cluster, of the form:
(1) |
where and are index sets such that the -th cluster contains embeddings of patches with indices from belonging to indices of images from .
Clusters contain embeddings such that , where is the total number of patches obtained from all images. If all images are divided into the same number of patches, then . Let us write all concepts in the form of one vector consisting of concatenated vectors of indices:
(2) |
A general scheme of the above representation of the images in the form embeddings of patches divided into clusters is depicted in Fig. 1.
![Refer to caption](extracted/5698210/General_scheme.png)
If we assume that each concept is a random variable taking values from , then we aim to find the conditional probability that the concept takes the value under condition that the embedding of a patch taken from a considered image falls into the cluster . Let us define the following additional probabilities and their short notations:
-
•
is the conditional probability that an embedding in the cluster is from the image having the value of the -th concept;
-
•
is the prior probability that an embedding is from the image having the value of the -th concept;
-
•
is the unconditional probability that an embedding falls into the cluster .
By using the Bayes rule, we write
(3) |
It is important to point out that we do not need probabilities for the inference when a new instance is classified. We need to know only and for the inference. On the other hand, the probability can be regarded as a measure for determining what values of concepts embeddings in the -th cluster have. The large probability implies that the embeddings in have mainly the concept value . If we assume that clusters are homogeneous to some extent, then embeddings contained in the cluster correspond to patches from images with the concept . This is an important information because it allows us to highlight areas in the image with given concepts.
Let us introduce the following additional notations:
-
•
is the number of embeddings in the -th cluster obtained from images with ;
-
•
is the total number of embeddings in all clusters obtained from images with .
The conditional probability is determined as the proportion of embeddings from images with that fall into the cluster to the entire set of embeddings from the images with , i.e., there holds .
The prior probability is determined as the proportion of images with to all images in the dataset, i.e., there holds . The unconditional probability can be computed from the condition:
(4) |
It can be also determined as the proportion of embeddings in the cluster to all embeddings from all images, i.e., there holds . Hence, the posterior probability is computed as .
5 The model inference
Suppose we have a new instance consisting of patches which are fed to the trained autoencoder in order to obtain embeddings . These embeddings are distributed among clusters according to their distances to the cluster centers. Let be numbers of embeddings which fall into clusters , respectively, such that . Let us denote the set of embeddings, produced by a new instance, which fall into , as . We do not have any information about concepts and their values which describe the instance. However, we can compute the probability that is equal to for all , , under condition that embeddings fall into clusters , respectively, i.e., find the conditional probability
(5) |
Here is a short notation of . This probability depends on the probabilities that embeddings with the concept fall into , . This probability can be estimated by means of the probability which has been considered above and defined as the proportion of embeddings from images with that fall into the cluster to the entire set of embeddings from the images with .
Then we can write the following Bayes rule:
(6) |
where is the conditional probability that embeddings fall into clusters , respectively, under condition that the image has the value of the -th concept; is unconditional probability that embeddings fall into clusters .
We propose to apply the multinomial distribution with probabilities of events in order to represent :
(7) |
The probability has been also defined in (3). The unconditional probability can be computed by using the condition:
(8) |
The main difficulty of using (7) is that some probabilities may be . In this case, the product (7) is also . In order to overcome this problem, we propose to replace the zero-valued probabilities with some small value . In this case, the probability can be computed only by means of (8).
In sum, for a new instance, we compute probabilities considering all and .
Let us introduce the thresholds for all values of the -th concept. If , then the value of the concept is assigned to the instance. After considering all the threshold conditions, we get the concept-based description of the image.
6 Incorporating expert rules
Let us introduce the logical literal denoted as , which takes the value , if the concept has the value . A set of expert rules can be represented as a logical expression over literals such that means that the rule is FALSE, means that it is TRUE. One of the forms of rules provided by experts is represented as “IF , THEN ”, where is the antecedent, is the consequent. This rule is expressed through the logical function as , where symbols and denote operations of implication and negation, respectively.
Expert rules change prior probabilities of concepts as well as conditional probabilities of concepts . Therefore, the next question we need to answer is how to update these probabilities in order to implement the model inference taking into account the rules.
6.1 Expert rules and prior probabilities of concepts
First, we consider how prior probabilities of concepts are changed by using the expert rules. Let us return to the conditional probability in (6). One of the ways to take into account the expert rules is to assume that the expert rules change prior probabilities of concepts , i.e., we have to find the conditional probabilities . Here is the random vector taking values from combinations of the concept values. There exist different combinations of the concept values which are formed from the Cartesian product defined above. Let be one of the combinations. Each expert rule takes values TRUE or FALSE ( or ) after substituting into the logical function . Let us use again the Bayes rule for determining the posterior probability :
(9) |
In order to determine the probability , we consider all cases when the random vector takes values from the set . However, when the conditional probability is determined, the the set of all vectors is restricted by the condition . A new restricted set denoted as is formed by replacing in with the single value , i.e., and
(10) |
By using the rule of total probability, we write:
(11) |
Since the function takes values and , then the conditional probability is determined as follows:
(12) |
The probability can be found by considering all images which have the combination of concept values, i.e., the probability is equal to the proportion of the number of images with concepts to the number of all images in the dataset.
In sum, for every combination of concepts , we check whether the concepts satisfy the expert rule and then compute for this combination. It is important to point out that a combination is not considered if there are no images with the corresponding set of concept values in the dataset because in this case.
The unconditional probability can be obtained from the condition
(13) |
and is equal to
(14) |
The prior probability of the concept is updated in accordance with the rule by means of its multiplying by the updating coefficient .
Finally, we have obtained the updated probabilities which are used in (6) for computing posterior marginal probabilities of concepts .
6.2 Expert rules and conditional probabilities
In addition to changes of prior probabilities, it is necessary to consider how conditional probabilities are updated due to expert rules. Let us denote the conditional event as . Then we have to find the probability
(17) |
Note that the probability is nothing else, but the conditional probability which has been defined above in Sec. 4, i.e., . Let be a subset of , which contains the concept combinations of embeddings from the cluster . Then the conditional probability is determined as
(18) |
It can be seen from (18) that differs from in (11) in that the set is limited to considering only the cluster . Hence, there holds
(19) |
We rewrite the expression (17) for computing as follows:
(20) |
where
(21) |
Note that there holds
because the event means that the embedding falls into one of the clusters. Hence, we can write
The conditional probability is updated in accordance with the rule by means of its multiplying by the updating coefficient .
6.3 Expert rules with uncertainty
So far, we have considered the hard expert-convinced rules, i.e., the rules taking the value TRUE with the unit probability. Let us study the case when rules are of the form “IF , THEN with probability ”. There are different interpretations of the implication operation probabilities [55]. We apply an interpretation which considers the probability of that either is true or is false.
A simple way to adapt the uncertain rules to the proposed scheme is to replace the value in (16) with probabilities and . Let us rewrite (12) taking into account the probability that the rule is TRUE for , i.e., is satisfied for the combination of concepts, as follows:
(22) |
It can be seen from the above that only the updating coefficient in (16) is changed when the probability of the rule is added.
In the same way, the conditional probabilities in (20) can be updated. In the case, we change only the updating coefficient as follows:
(23) |
It should be noted that the uncertainty representation of expert rules is a special important question which requires a detailed separate investigation. Therefore, it is not considered in this work and will be study in future.
7 Illustrative example
7.1 Concepts
7.1.1 Training
To illustrate calculation in FI-CBL, we consider an illustrative example with concepts Contour and Inclusion of the lung cancer nodule description given in Section 4. The vector of all concept values is
(24) |
Diagnosis | Contour | Inclusion | # images |
---|---|---|---|
benign | smooth | homogeneous | |
benign | grainy | homogeneous | |
malignant | spicules | homogeneous | |
malignant | grainy | necrosis |
Suppose we have images whose description is shown in Table 1, where the first three columns contain values of the concepts and the fourth column indicates the number of images having the corresponding concept values. The images are divided into patches. Numbers of images with values malignant and benign are and , respectively. Suppose that embeddings corresponding to patches are clustered to clusters such that:
-
•
the first cluster contains embeddings of the background patches;
-
•
the second cluster contains embeddings of nodules with spicules or with the grainy contour and with necrosis;
-
•
the third cluster contains embeddings of nodules which are smooth or grainy and homogeneous.
An example of the corresponding images and patches are schematically depicted in Fig. 2. Prior probabilities for all concepts are shown in Table 2
Unconditional probabilities are
(25) |
Table 3 shows conditional probabilities . Table 4 contains posterior probabilities computed by using (3). It follows from Table 4 that the second cluster contains patches which show that the corresponding images are malignant with the probability . Moreover, the third cluster contains only patches with homogeneous nodules.
![Refer to caption](extracted/5698210/Concept_1_simple.png)
7.1.2 Inference
Suppose that two embeddings of a new instance fall into the first cluster, and two embedding falls into the third cluster. This implies that . Probabilities are taken from Table 3. Hence, there holds for :
(26) |
Probabilities are computed from (8) for every . They are , , . Final results are shown in Table 5. It can be seen from Table 5 that the tested image is benign ( with the probability ) with homogeneous nodules ( with the probability ). The decision about the concept Contour depends on the threshold . If , then we can say that nodules are smooth. If , then this concept is not available or too uncertain to be included into the image description. At the same time, the small probability of spicules implies that the Contour is smooth or grainy with probability .
7.2 Expert rules
7.2.1 Prior probabilities
Let us consider the illustrative example under condition of using the expert rule “IF Contour is grainy, THEN Diagnosis is malignant” which can also be written as “IF , THEN ”. The logical function corresponding to the rule is of the form:
(27) |
The above rule is TRUE if at least one of the logical literals is TRUE.
Let us return to the above example. We have the following combinations of the concept labels (see Table 1): benign-smooth-homogeneous, benign-grainy-homogeneous, malignant-spicules-homogeneous, malignant-grainy-necrosis. Let us find how the prior probability will be changed when the expert rule from the above example is available. The rule “IF Contour is grainy, THEN Diagnosis is malignant” is FALSE when , i.e., when the concept values are grainy and benign. There are two images simultaneously having the concepts grainy and benign. This implies that for images with concepts benign-grainy-homogeneous (see Fig. 2). Hence, we can write , . Here combinations with are not provided for short. Probabilities are shown in Table 6. Finally, we can write
(28) |
where
(29) |
and
(30) |
Let us find the prior probability . In this case, there holds . Hence, we obtain
(31) |
and
(32) |
It is interesting to point out that the expert rule increases the prior probability of the malignant and decreases the probability of the benign. Indeed, two images with the concept values benign and grainy do not correspond to the expert rule. Therefore, these images can be regarded as inadmissible for analyzing probabilities of the concept . However, it does not mean that they cannot be used for finding probabilities of other concepts.
7.2.2 Updating posterior probabilities
Let us again return to the above example and find the conditional probabilities , , for every cluster.
Cluster 1: The subset consists of combinations , because embeddings corresponding to all concepts are included in . The subset consists of the combination .
Cluster 2: The subset consists of combinations , because embeddings with the corresponding concept values are included in . The subset is empty.
Cluster 3: The subset consists of the combination because one embedding from an image with the concept values falls into . The subset consists of the combination .
Hence, we obtain , . Similarly, we find
(37) |
where
(38) |
Hence, we obtain , . Finally, we find the conditional probabilities from (20), whose values are given in Table 7.
8 Numerical experiments
To study the proposed model, a synthetic dataset is constructed from the well-known MNIST dataset [56] which represents pixel handwritten digit images. The original MNIST dataset has a training set of instances and a test set of instances. The dataset is available at http://yann.lecun.com/exdb/mnist/.
![Refer to caption](extracted/5698210/Large_MNIST.png)
Each instance in the synthetic dataset consists of four different digits randomly taken from MNIST such that the instance has two digits in the first row and two digits in the second row as it is shown in Fig. 3. Each instance has the size . A similar dataset is used in [33]. Concepts are formed as follows:
-
•
The concept (target) is defined as the largest digit among four digits in each instance. This corresponds to the classification task with seven classes (digits from till ) due to the difference of digits in the instance.
-
•
Concepts are binary and defined by the presence of the corresponding number () in the instance.
The proposed model is compared with the original CBM [6]. Preliminary numerical experiments have shown that the original CBM provides outperforming results when the number of instances is large. Therefore, we compare the proposed model with CBM by training models on small numbers of instances (from till ). The number of testing images is .
Details of the proposed model are the following:
-
•
Images are divided into 4 patches such that each patch contains one digit.
-
•
The autoencoder is constructed by using the convolution network, the embedding size is .
-
•
The expectation–maximization (EM) algorithm with clusters is used for clustering.
-
•
The model is trained on numbers of epochs from till depending on the number of instances taken for training.
CBM is also constructed on the convolution network which transforms the image to an embedding. For each concept, a fully connected two-layer network predicts the concept value. The cross-entropy loss function is used. A modification of CBM with the joint training of the bottleneck and targets is used such that the joint bottleneck minimizes the weighted sum of loss functions with coefficients 1. The F1 measure is used as an accuracy measure in experiments because the training set is imbalanced due to the considered structure of concepts and images.
F1 measures as functions of the training set size for all concepts of the modified MNIST dataset obtained by using the proposed method and CBM are shown in Fig. 4. It can be seen from Fig. 4 that FI-CBL outperforms the original CBM when the training set size is small (smaller than instances). This can be explained by the fact that the neural network implementing CBM requires a significantly larger number of instances for training. On the contrary, FI-CBL allows us to obtain acceptable results with a small number of training instances. At the same time, CBM becomes better as the training set increases. In this case, FI-CBL requires finer tuning of the number of clusters and the size of embeddings.
![Refer to caption](extracted/5698210/MNIST_4_F1.png)
To study how an expert rule impacts on the prediction accuracy, we invert some correct labels that satisfy the expert rule. The rule is “IF , THEN ”. This is an obvious rule which means that if there is the digit among four digits in an instance, then the target is . Let be the portion of instances in the training set, whose labels are inverted. Fig. 5 illustrates how F1 measures depend on values of for two cases: before using the rule (the curve with triangle markers) and after using the rule (the curve with circle markers). It can be seen from Fig. 5 that the use of the expert rule allows us to significantly correct the model and to obtain better predictions (the corresponding function slowly decreases with increase). At the same time, if the rule is not used, then the F1 measure quickly decreases with increase of .
![Refer to caption](extracted/5698210/MNIST_4_F1_rule.png)
We also consider a modification of the Large-scale CelebFaces Attributes (CelebA) dataset [57]. The original dataset contains images, each annotated with face attributes and classes. The modification is restricted by classes such that images with labels from till have the label , images with labels from till have the label , etc. The number of concepts is . All concepts are binary. To compare FI-CBL with CBM, we find the F1 measure averaged over all concepts. The number of testing images is approximately , i.e., 40% of the original dataset. The K-means algorithm with clusters is used for clustering. The embedding size is . The number of patches is . To ensure that the whole concepts fall into separate patches, we propose using overlap** patches similar to sliding windows in convolutional neural networks.
F1 measures as functions of the training set size of the modified CelebA dataset obtained by using FI-CBL and CBM are shown in Fig. 6. Similarly to the previous numerical example with the MNIST dataset, FI-CBL outperforms the original CBM when the training set size is small (smaller than instances).
![Refer to caption](extracted/5698210/CelebA_F1.png)
Let us consider another numerical example with the original MNIST dataset. All instances are annotated by the following concepts:
0 - target, , values of the target are given in (39);
1 - the even/odd digit, ;
2 - the digit is not less than 5 / is less than 5, ;
3 - the digit is a remainder of division by 3, .
In sum, digits are represented by the following sets of concepts:
(39) |
The EM algorithm with clusters is used for clustering. The embedding size is . The testing set consists of images.
F1 measures as functions of the training set size for four concepts of the original MNIST dataset obtained by using the proposed method and CBM are shown in Fig. 7. One can see from Fig. 7 that CBM outperforms FI-CBL in most cases even when the training set size is small. This numerical example aims to show that CBM can provide better results even when the number of training instances is small. At the same time, the next numerical experiments aim to study how expert rules can correct incorrect concepts and provide better results in comparison with CBM. We aim to show now that CBM provides worse results in comparison with FI-CBL when labels are noisy. We again invert some correct labels that satisfy the expert rule. The rule is “IF AND , THEN ”. Fig. 8 illustrates the difference between F1 measures as functions of for two cases: before using the rule and after using the rule. It can be seen from Fig. 8 that the use of the rule allows us to significantly correct the model and to obtain better predictions. When values of exceed , then both the models show worse results.
![Refer to caption](extracted/5698210/MNIST_1_F1.png)
![Refer to caption](extracted/5698210/MNIST_1_rule_f1.png)
In the next experiment, we invert half of the target labels, i.e., the target is completely confused. We aim to improve the model prediction by incorporating the increasingly detailed expert rules:
-
•
;
-
•
;
-
•
.
Fig. 9 shows histograms of the binary target prediction probabilities without rules and with different rules. It can be seen from the first histogram that most prediction probabilities are close to . This implies that the inversion of the target labels leads to the total uncertainty, i.e. the model cannot correctly classify instances. The first rule partially improves results. One can see from the second histogram that a small part of instances are classified with probabilities close to . However, so far most prediction probabilities are close to despite the rule. The second rule consists of two rules and corrects many inverted labels. One can see from the third histogram that the uncertainty of the target probabilities significantly decreases in comparison with the previous cases. Finally, the third rule , which is the most strong one due to the logical operation “if and only if” denoted as “”, provides the best results shown in the fourth histogram. We can see that the uncertainty of predictions is minimal. This is a very important observation which illustrates how the incorporated expert rules are able to improve the model.
![Refer to caption](extracted/5698210/density.png)
9 Conclusion
Let us point out advantages and disadvantages of FI-CBL.
Advantages:
-
•
FI-CBL is transparent. In contrast to the neural network implementation of CBL where the network as well as the bottleneck layer are a black box, the proposed model has a clear and explicit sequence of calculations. All probabilities (conditional and unconditional) have a clear frequency interpretation. It allows us to extend the model in order to take into account the possible limitation of instances in datasets and to apply robust statistical methods which can correct the posterior probabilities and improve the classification. Moreover, one can also observe entire processes of training and inference in order to understand results of modeling.
-
•
FI-CBL is flexible. We can simply change the number of patches, the number of clusters, the autoencoder architecture, threshold of decision making.
-
•
FI-CBL provides outperforming results when the number of training instances is small.
-
•
FI-CBL is interpretable.
Disadvantages:
-
•
The main disadvantage is to implement a perfect clusterization and to guess a proper number of clusters. We could learn the clusterization procedure jointly with the autoencoder, but this approach may significantly complicate the method and reduce its positive property to deal with small datasets.
-
•
The effectiveness of FI-CBL greatly depends on the size of patches. A large difference in the size of concepts in an image can lead to significant deterioration of the model. One of the ways to overcome this problem is to use sliding windows for producing patches as it has been implemented in the numerical experiment with CelebA dataset. However, this way requires additional studies.
-
•
We need to store the dataset in order to use it every time when a new instance is analyzed. On the other hand, we can store only a matrix of all conditional probabilities if the set of expert rules is not changed. If many clusters and expert rules are implemented, then the matrix can be very large.
-
•
Experiments have illustrated that FI-CBL may be inferior to CBMs when the number of training data is large.
The above disadvantages can be regarded as problems whose solutions are direction for further research. In addition, the probabilistic approach used in FI-CBL allows us to simply extend the method to solve several problems of machine learning, including anomaly detection, unlearning, the attention mechanism, etc. These are also directions for further research.
References
- [1] I. Lage and F. Doshi-Velez. Learning interpretable concept-based models with human feedback. arXiv:2012.02898, Dec 2020.
- [2] A. Gupta and P.J. Narayanan. A survey on concept-based approaches for model improvement. arXiv:2403.14566, Mar 2024.
- [3] Been Kim, M. Wattenberg, J. Gilmer, C. Cai, J. Wexler, F. Viegas, et al. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). In International conference on machine learning, pages 2668–2677. PMLR, 2018.
- [4] Bowen Wang, Liangzhi Li, Y. Nakashima, and H. Nagahara. Learning bottleneck concepts in image classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10962–10971, 2023.
- [5] Chih-Kuan Yeh, Been Kim, S. Arik, Chun-Liang Li, T. Pfister, and P. Ravikumar. On completeness-aware concept-based explanations in deep neural networks. In Advances in neural information processing systems, volume 33, pages 20554–20565, 2020.
- [6] Pang Wei Koh, Thao Nguyen, Yew Siang Tang, S. Mussmann, E. Pierson, Been Kim, and Percy Liang. Concept bottleneck models. In International conference on machine learning, pages 5338–5348. PMLR, 2020.
- [7] E. Poeta, G. Ciravegna, E. Pastor, T. Cerquitelli, and E. Baralis. Concept-based explainable artificial intelligence: A survey. arXiv:2312.12936, May 2023.
- [8] Y. Yamamoto, T. Tsuzuki, and J. Akatsuka. Automated acquisition of explainable knowledge from unannotated histopathology images. Nature Communications, 10(5642):1–9, 2019.
- [9] J. Amores. Multiple instance classification: review, taxonomy and comparative study. Artificial Intelligence, 201:81–105, 2013.
- [10] M.-A. Carbonneau, V. Cheplygina, E. Granger, and G. Gagnon. Multiple instance learning: A survey of problem characteristics and applications. Pattern Recognition, 77:329–353, 2018.
- [11] J. Yao, X. Zhu, J. Jonnagaddala, N. Hawkins, and J. Huang. Whole slide images based cancer survival prediction using attention guided deep multiple instance learning network. Medical Image Analysis, 65(101789):1–14, 2020.
- [12] Z.-H. Zhou. Multi-instance learning: A survey. Technical report, National Laboratory for Novel Software Technology, Nan**g University, 2004.
- [13] A.V. Konstantinov and L.V. Utkin. Incorporating expert rules into neural networks in the framework of concept-based learning. arXiv:2402.14726, Feb 2024.
- [14] M. Dreyer, R. Achtibat, W. Samek, and S. Lapuschkin. Understanding the (extra-) ordinary: Validating deep model decisions with prototypical concept-based explanations. arXiv:2311.16681, Nov 2023.
- [15] Yangqing Jia, J.T. Abbott, J.L Austerweil, T. Griffiths, and T. Darrell. Visual concept learning: Combining machine vision and bayesian generalization on concept hierarchies. In Advances in Neural Information Processing Systems, volume 26, pages 1–9, 2013.
- [16] V. Pendyala and Jihye Choi. Concept-based explanations for tabular data. arXiv:2209.05690, Sep 2022.
- [17] C. Obermair, A. Fuchs, F. Pernkopf, L. Felsberger, A. Apollonio, and D. Wollmann. Example or prototype? learning concept-based explanations in time-series. In Asian Conference on Machine Learning, pages 816–831. PMLR, 2023.
- [18] Wensi Tang, Lu Liu, and Guodong Long. Interpretable time-series classification on few-shot samples. In 2020 International Joint Conference on Neural Networks (IJCNN), pages 1–8. IEEE, 2020.
- [19] Jihye Choi, J. Raghuram, Ryan Feng, Jiefeng Chen, S. Jha, and A. Prakash. Concept-based explanations for out-of-distribution detectors. In International Conference on Machine Learning, pages 5817–5837. PMLR, 2023.
- [20] L.R. Sevyeri, I. Sheth, F. Farahnak, and S.A. Enger. Transparent anomaly detection via concept-based explanations. arXiv:2310.10702, Oct 2023.
- [21] L.A. Hendricks, R. Hu, T. Darrell, and Z. Akata. Grounding visual explanations. In Proceedings of the European Conference on Computer Vision (ECCV), pages 264–279, 2018.
- [22] R. Marcinkevičs, P.R. Wolfertstetter, U. Klimiene, Kieran Chin-Cheong, A. Paschke, J. Zerres, M. Denzinger, D. Niederberger, S. Wellmann, E. Ozkan, et al. Interpretable and intervenable ultrasonography-based machine learning models for pediatric appendicitis. Medical Image Analysis, 91:103042, 2024.
- [23] A.A. Meldo, L.V. Utkin, M.S. Kovalev, and E.M. Kasimov. The natural language explanation algorithms for the lung cancer computer-aided diagnosis system. Artificial Intelligence in Medicine, 108(Article 101952):1–10, 2020.
- [24] C. Patrício, J.C. Neves, and L.F. Teixeira. Coherent concept-based explanations in medical image and its application to skin lesion diagnosis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3798–3807, 2023.
- [25] A. Vats, M. Pedersen, and A. Mohammed. Concept-based reasoning in medical imaging. International Journal of Computer Assisted Radiology and Surgery, 18(7):1335–1339, 2023.
- [26] An Yan, Yu Wang, Yiwu Zhong, Zexue He, Petros Karypis, Zihan Wang, Chengyu Dong, Amilcare Gentili, Chun-Nan Hsu, **gbo Shang, et al. Robust and interpretable medical image classifiers via concept bottleneck models. arXiv:2310.03182, Oct 2023.
- [27] Jae Hee Lee, S. Lanza, and S. Wermter. From neural activations to concepts: A survey on explaining concepts in neural networks. arXiv:2310.11884, Oct 2023.
- [28] A. Mahinpei, J. Clark, I. Lage, F. Doshi-Velez, and Weiwei Pan. Promises and pitfalls of black-box concept learning models. arXiv:2106.13314, Jun 2021.
- [29] I. Sheth and S.E. Kahou. Auxiliary losses for learning generalizable concept-based models. arXiv:2311.11108, Nov 2023.
- [30] Mert Yuksekgonul, Maggie Wang, and James Zou. Post-hoc concept bottleneck models. arXiv:2205.15480, May 2022.
- [31] Z.M. Espinosa, P. Barbiero, G. Ciravegna, G. Marra, F. Giannini, M. Diligenti, Z. Shams, F. Precioso, S. Melacci, A. Weller, et al. Concept embedding models: Beyond the accuracy-explainability trade-off. In Advances in Neural Information Processing Systems, volume 35, pages 21400–21413, 2022.
- [32] A.A. Ismail, J. Adebayo, H.C. Bravo, S. Ra, and Kyunghyun Cho. Concept bottleneck generative models. In Proceedings of ICML 2023. Workshop on Deployment Challenges for Generative AI, https://openreview.net/group?id=ICML.cc/2023/Workshop, pages 1–10, 2023.
- [33] Eunji Kim, Dahuin Jung, Sangha Park, Siwon Kim, and Sungroh Yoon. Probabilistic concept bottleneck models. In International Conference on Machine Learning, pages 16521–16540. PMLR, 2023.
- [34] Naveen R., Mateo E. Zarlenga, Juyeon Heo, and Mateja Jamnik. Do concept bottleneck models obey locality? arXiv:2401.01259, Jan 2024.
- [35] R. Marcinkevics, S. Laguna, M. Vandenhirtz, and J.E. Vogt. Beyond concept bottleneck models: How to make black boxes intervenable? arXiv:2401.13544, Jan 2024.
- [36] F. Pittino, V. Dimitrievska, and R. Heer. Hierarchical concept bottleneck models for vision and their application to explainable fine classification and tracking. Engineering Applications of Artificial Intelligence, 118:105674, 2023.
- [37] M. Havasi, S. Parbhoo, and F. Doshi-Velez. Addressing leakage in concept bottleneck models. In Advances in Neural Information Processing Systems, volume 35, pages 23386–23397, 2022.
- [38] A. Radford, Jong Wook Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748–8763. PMLR, 2021.
- [39] R. Kazmierczak, E. Berthier, G. Frehse, and G. Franchi. CLIP-QDA: An explainable concept bottleneck model. arXiv:2312.00110, Dec 2023.
- [40] K. Chauhan, R. Tiwari, J. Freyberg, P. Shenoy, and K. Dvijotham. Interactive concept bottleneck models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 5948–5955, 2023.
- [41] Yan Cui, Shuhong Liu, Liuzhuozheng Li, and Zhiyuan Yuan. Ceir: Concept-based explainable image representation learning. arXiv:2312.10747, Dec 2023.
- [42] E. Marconato, A. Passerini, and S. Teso. Glancenets: Interpretable, leak-proof concept-based models. In Advances in Neural Information Processing Systems, volume 35, pages 21212–21227, 2022.
- [43] A. Margeloiu, M. Ashman, U. Bhatt, Yanzhi Chen, M. Jamnik, and A. Weller. Do concept bottleneck models learn as intended? arXiv:2105.04289, May 2021.
- [44] Ao Sun, Yuanyuan Yuan, **chuan Ma, and Shuai Wang. Eliminating information leakage in hard concept bottleneck models with supervised, hierarchical concept learning. arXiv:2402.05945, Feb 2024.
- [45] L. Von Rueden, S. Mayer, K. Beckh, B. Georgiev, S. Giesselbach, R. Heese, B. Kirsch, J. Pfrommer, A. Pick, R. Ramamurthy, et al. Informed machine learning–a taxonomy and survey of integrating prior knowledge into learning systems. IEEE Transactions on Knowledge and Data Engineering, 35(1):614–633, 2021.
- [46] M. Diligenti, M. Gori, and C. Sacca. Semantic-based regularization for learning and inference. Artificial Intelligence, 244:143–165, 2017.
- [47] M. Diligenti, S. Roychowdhury, and M. Gori. Integrating prior knowledge into deep learning. In 2017 16th IEEE international conference on machine learning and applications (ICMLA), pages 920–923. IEEE, 2017.
- [48] Zhiting Hu, Zichao Yang, R. Salakhutdinov, and Eric Xing. Deep neural networks with massive learned knowledge. In Proceedings of the 2016 conference on empirical methods in natural language processing, pages 1670–1679, 2016.
- [49] **gyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Broeck. A semantic loss function for deep learning with symbolic knowledge. In International conference on machine learning, pages 5502–5511. PMLR, 2018.
- [50] M.V.M. França, G. Zaverucha, and d’Avila G.A.S. Fast relational learning using bottom clause propositionalization with artificial neural networks. Machine learning, 94:81–104, 2014.
- [51] A. Garcez, M. Gori, L.C. Lamb, L. Serafini, M. Spranger, and S.N. Tran. Neural-symbolic computing: An effective methodology for principled integration of machine learning and reasoning. Journal of Applied Logics, 6(4):611–632, 2019.
- [52] Xiao-Wen Yang, Jie-**g Shao, Wei-Wei Tu, Yu-Feng Li, Wang-Zhou Dai, and Zhi-Hua Zhou. Safe abductive learning in the presence of inaccurate rules. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 16361–16369, 2024.
- [53] V. Chen, U. Bhatt, H. Heidari, A. Weller, and A. Talwalkar. Perspectives on incorporating expert feedback into model updates. Patterns, 4(7):1–13, 2023.
- [54] Kaiwen Xu, K. Fukuchi, Y. Akimoto, and J. Sakuma. Statistically significant concept-based explanation of image classifiers via model knockoffs. arXiv:2305.18362, May 2023.
- [55] Hung T. Nguyen, Masao Mukaidono, and V. Kreinovich. Probability of implication, logical version of bayes theorem, and fuzzy logic operations. In IEEE World Congress on Computational Intelligence. IEEE International Conference on Fuzzy Systems. FUZZ-IEEE’02, volume 1, pages 530–535. IEEE, 2002.
- [56] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
- [57] Ziwei Liu, ** Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pages 3730–3738. IEEE, 2015.