Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

Causality-in-Trustworthy-Machine-Learning

> 编程语言
Open source

The repository contains lists of papers on causality and how relevant techniques are being used to further enhance deep learning era computer vision solutions.

100 stars0 likes2 views
WebsiteGitHub

About

The repository contains lists of papers on causality and how relevant techniques are being used to further enhance deep learning era computer vision solutions.

Rise of Causality in Computer Vision

We are pleased to announce the launch of our comprehensive survey, titled "Towards Trustworthy and Aligned Machine Learning: A Data-centric Survey with Causality Perspectives," drawing from the papers succinctly outlined in this repository. This survey delves into the multifaceted realm of merging causality with various machine learning methodologies to attain trustworthiness, encompassing domains such as domain adaptation, domain generalization, and more. Furthermore, we explore the attributes and constraints of pre-trained large models, shedding light on their significance and limitations. Ultimately, we address the pivotal question of why causality, particularly in the context of trustworthiness, serves as a viable solution.

The repository contains lists of papers on causality and how relevant techniques are being used to further enhance deep learning era computer vision solutions.

The repository is organized by Maheep Chaudhary, and Haohan Wang as an effort to collect and read relevant papers and to hopefully serve the public as a collection of relevant resources.

Explainability Of ML Models using Causality:

The papers in this section focuses to use the concepts of Causality to increase the interpretability of the Neural Network.

  • Contrastive_Counterfactual_Visual_Explanations_With_Overdetermination

    • Maheep's Notes

      The author slams the above works and contends that Counterfactual Explanation should be contrastive, counterfactual and measurable. It focuses to generate counterfactual explanation for medical image classification.

      The author proposes the following things in the paper:

      • It not only highlights the difference b.w. the counterfactual and factual images as aforementioned works but also signifies each segment importance in image prediction after segmenting it out using ''Clear Image''.
      • It aims to unravel the causal structure of the system, arguing that "AI provide information about the factors on which the model depends but also how it depends".
      • It also proposes the concept of causal overdetermination, which corresponds to the scenario when there are 2 or more than that causes present for an event.

      The author contends that the mask resulted from the subtraction of factual and counterfactual is not a good measure of explainability as it can vary significantly and also other critical segments shoud be absent. Therefore it takes mask, image and classification behaviour to generate counterfactual image.

      The author implements it by

      • Dividing the image into segments using the Clear Image module which by iteratively increasing the size of segments until an individual comes out to be counterfactual in the set.
      • The two types of segments are created, as shown in image (a) and (b):
        • (a) The ones that differentiates the counterfactual and factual image w/ high intensity $S_h$
        • (b) The ones that are not highly differentiable but carries a good weight in the classification of the image $S_l$.
      • The importance of a segment is quantified by replacing segment of image $x$ , i.e. $s = {s_1, s_2, ...., s_n}$ with the segements of the contrast image $x'$ , i.e. $s' = {s_1', s_2', ...., s_n'}$ to quantify the effect of each segment on classification. To limit the overdetermination, the work only replaces at-max 4 segments at a time to create a counterfacutal image.
      • It uses regression equation $w^TX$ to quantify the contribution that individual segement make to $y$ . With regression the classification probability is also considered and the subtraction of both results in pleural effusion. It can be more elaborated using the image below where The report identifies that substituting both segments 4 and 11 with the corresponding segments from its contrast image flips the classification probability to ’healthy’ According to the logistic regression equation these substitutions would change the probability of the X-ray being classified as ’pleural effusion’ to 0.44. However, when these segments are actually substituted and passed through the classifier, the probability changed to 0.43, hence the fidelity error is 0.01. CLEAR Image also identifies that substituting segments 3 and 11 also creates an image-counterfactual. The coefficient value becomes 0 if the segment belongs to the counterfactual image and becomes 1 if belongs to the original image.
  • Born Identity Network: Multi-way Counterfactual Map Generation to Explain a Classifier’s Decision

    • Maheep's Notes

      The paper focuses on interpretability of medical image classification and mainly focuses on 2 main problems, i.e.

      • Focuses to eradicate the negative correlation b.w. the performance and interpretability of the network.
      • Generates multi-way counterfactuals reasoning, where the aforementioned works only generates counterfactual map w.r.t. to only 1 class.

      The author proposes $M_{x,y}$ counterfactual map that transforms an input image $X$ to $\tilde{X} = X + M_{x,y}$

      where $y$ is the counterfactual class, i.e. $F(\tilde{X}) = y$

      It uses a U-net network consisting of Encoder $E$, Generator $G$ and Discriminator $D$. The combination of $E$ and $G$ produces $M_{x}$ as shown in the figure below:

      The above process is guided by Target Attribution Network(TAN), which guides the generator to produce counterfactual maps that transform an input sample to be classified as a target class.

      $M$ generates the image counterfactual image which is compared from the dataset distribution $P_{X}$, aiming to generate image of the same distribution, for which it uses Adversarial loss.

      The Cycle Consistency loss(CCL) is used to regulate the "multi-way" counterfactual maps.

      $$ L_{cyc} = E_{X \sim P_X, Y \sim P_Y}[||(\tilde{X} + M_{\tilde{x},y'}) - X||_1] $$

  • Explaining the Black-box Smoothly-A Counterfactual Approach

    • Maheep's Notes

      The paper focuses on increasing the interpretability of medical imaging classification by generating counterfactual image by perturbing the original image.

      It modifies the image using pre-trained function $f(\cdot) \in [0,1]$ The work aims to learn the explanatory function $I_f(\cdot)$ using the equation:

      $$ x_{\delta} \approx I_f(x,\delta) $$

      where

      $$ f(x_{\delta}) - f(x) = \delta $$

      It optimizes the overall process using 3 loss functions with $\phi(\cdot)$ defining a feature extractor, $\psi$ computes a scalar loss value, $\textbf{c}$ defining the one-hot vector of condition, which is $\textbf{c} = c_f(x, \delta)$ and $V$ is the embedding metrics modulated on $\textbf{c}$ as :

      • Data Consistency: It evaluates the correspondence between the generated image and the conditioner,defining the loss as:

      $$ L_{cGAN} = \psi(\phi(G(z);\theta_{\phi});\theta_{\psi}) + c^T V \phi(x;\theta_{\phi}) $$

      • Classification model consistency: To ensure that the generated image should give desired output, the loss is introduced as:

      $$ L := c^T V \phi(x;\theta_{\phi}) + D_{KL}(f(x')||f (x) + \delta) $$

      • Context-aware self-consistency: The loss is defined so as to preserve the features using the reconstruction loss:

      $$ L = L_{rec}(x,\mathcal{I}f(x,0)) + L{rec}(x,\mathcal{I}_f({I}_f(x,\delta),-\delta)) $$

      where

      $$ L_{rec}(x,x') = \sum_j \frac{S_j(x)\odot||x-x'||1}{\sum S_j(x)} + D{KL}(O(x)||O(x')) $$

      where $S(\cdot)$ is a pretrained semantic segmentation network that produces a label map for different regions in the input domain. $O(x)$ is a pre-trained object detector that, given an input image $x$ , output a binary mask $O(x)$

      The author argues that there is a chance that the GAN may ignore small or uncommon details therfore the images are compared using semantic segmentation $S(\cdot)$ with object detection combined in identity loss.

  • Generative_Counterfactuals_for_Neural_Networks_via_Attribute_Informed_Perturbations

    • Maheep's Notes

      The paper tries to generate counterfactual images using a low-dimensional latent space containing the raw features and attribute informed latent space, which are continously re-iterated for modification to generate a counterfactual image.

      The author highlight some of the challenges in the existing works, generating counterfactual image to increase interpretability:

      • Counterfactuals generation for certain class might not be feasible as it is not possible to perturb the raw data due to various issue of piracy and the hassle to identify the perturbation.
      • Counterfactual for certian class might not exist in the data, which might create problems as the selected prototypes and criticism are not sufficient for the counterfactual analysis.

      The author implements it by:

      • An encoder $E$ and decoder $D$ structure is proposed which encodes the raw features and attribute related data where the raw features includes the robust features of an object, where the attribute related data contains extra encoded information for humans such as "bounding box" and other information. Attribute related-data directly influences the quality of generated counterfactual.

      $$ E(x) = z_o + a_o $$

      • The $z_o$ and $a_o$ are modified iteratively using the gradient-based optimization, specifically by the equaiton:

      $$ z^{(n+1)} = z^n - \mu^n \nabla_z L_d(z^n, a^n, z_o, a_o, \overline{y}) $$

      $$ a^{(n+1)} = a^n - \gamma^n \nabla_a L_d(z^n, a^n, z_o, a_o, \overline{y}) $$

      where $L_d(\cdot)$ is the cross-entropy loss.

      • The overall counterfactual loss can be categorized into prediction loss using cross-entropy $l_d(\cdot)$ and perturbation loss

      $$ l_c = l_d(F(G^{dec}(z,a)),\overline{y}) + ||z - z_o||_2 + ||a - a_o||_2 $$

      • The discriminator loss can be defined as:

      $$ L = \sum_{i}^T \ -a_i \ log(D^i(\overline{x})) - (1 - a_i)\ log(1 - D^i(\overline{x})) + \mathbb{E} \ ||x - \overline{x}||_2 $$

      The overall solution can be summed up using the equation below:

  • EXPLAINABLE IMAGE CLASSIFICATION WITH EVIDENCE COUNTERFACTUAL

    • Maheep's Notes

      The author proposes to generate the counterfactual image b

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoncausal-inferencecausalitycomputer-visioncounterfactual

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言