<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Safety | Ayan Majumdar</title><link>https://ayanmaj.netlify.app/tag/safety/</link><atom:link href="https://ayanmaj.netlify.app/tag/safety/index.xml" rel="self" type="application/rss+xml"/><description>Safety</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© 2022 Ayan Majumdar</copyright><lastBuildDate>Tue, 01 Sep 2026 00:00:00 +0100</lastBuildDate><image><url>https://ayanmaj.netlify.app/media/icon_hu12c95ef1ab2e6591d6104a45ebf5265c_3265_512x512_fill_lanczos_center_3.png</url><title>Safety</title><link>https://ayanmaj.netlify.app/tag/safety/</link></image><item><title>ModerationBench: Can Foundation Models Moderate Online Content?</title><link>https://ayanmaj.netlify.app/project/moderation-bench/</link><pubDate>Tue, 01 Sep 2026 00:00:00 +0100</pubDate><guid>https://ayanmaj.netlify.app/project/moderation-bench/</guid><description/></item><item><title>Evaluating LLMs for Demographic-Targeted Social Bias Detection: A Comprehensive Benchmark Study</title><link>https://ayanmaj.netlify.app/project/data-bias-llm/</link><pubDate>Mon, 10 Feb 2025 10:44:48 +0100</pubDate><guid>https://ayanmaj.netlify.app/project/data-bias-llm/</guid><description>&lt;p>This project was conducted during my internship at &lt;a href="https://huaweiresearchcentergermanyaustria.teamtailor.com/departments/trustworthy-technology-and-engineering-laboratory-heisenberg-research-center" target="_blank" rel="noopener">Trustworthy Technology and Engineering Lab (TTE-DE), Huawei Munich Research Center&lt;/a>.
Detecting and reporting social biases prevalent in large-scale text corpora used for the development of general-purpose AI systems (GPAI) has become a core necessity for trustworthy system development and recent regulatory developments (the EU AI Act).
Purely manual annotation at such scale remains infeasible, highlighting a pressing need to develop automated tools for the purpose.
However, we lack a clear, fine-grained picture of the capabilities of current language models in detecting different social biases in textual data.
In this work, we conduct a comprehensive empirical survey to evaluate large language models (LLMs) in demographic-targeted social bias detection in text data.
We develop a new taxonomy that aligns with anti-discrimination principles and accounts for biases targeting multiple demographic axes simultaneously.
We adapt twelve large English-language datasets, frame bias detection as a multi-label task, and build a framework to evaluate models using prompting, in-context learning, and fine-tuning.&lt;/p>
&lt;h2 id="a-demographic-targeted-taxonomy">A. Demographic-targeted Taxonomy&lt;/h2>
&lt;p>
&lt;figure id="figure-taxonomy-and-data-coverage">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Taxonomy and data coverage" srcset="
/project/data-bias-llm/taxonomy_hu6decfefabca730bf54c66a05977ecea9_614155_f52a51db20a6616b135898b014ffe9c9.png 400w,
/project/data-bias-llm/taxonomy_hu6decfefabca730bf54c66a05977ecea9_614155_fb935130a3fa7c20b507a444e6d4d1d2.png 760w,
/project/data-bias-llm/taxonomy_hu6decfefabca730bf54c66a05977ecea9_614155_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/data-bias-llm/taxonomy_hu6decfefabca730bf54c66a05977ecea9_614155_f52a51db20a6616b135898b014ffe9c9.png"
width="760"
height="316"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Taxonomy and data coverage
&lt;/figcaption>&lt;/figure>
We focus on demographic-targeted social biases and design a taxonomy that identifies the demographic axes targeted by biased texts. This approach aligns directly with anti-discrimination regulations and governance measures (EU Charter of Fundamental Rights), while also enabling the study of multi-axis biases: cases where texts simultaneously target multiple groups, an aspect often overlooked. Specifically, we focus on biases that can target gender identity, sexual orientation, disability, race/ethnicity, nationality, religion, socio-economic status, and/or physical appearance.&lt;/p>
&lt;p>Moreover, we create a comprehensive benchmark dataset by combining and adapting instances from twelve well-studied English-language datasets. Importantly, we standardize bias-targeting labels across datasets to align with our taxonomy and ensure consistency. For instance, while bias against “Arabs” or “Middle Eastern” identities is labeled as racial targeting by some datasets and religious targeting by others, we consistently label them as racial bias, reserving REL for explicit religious references in biased texts.&lt;/p>
&lt;h2 id="b-methodological-bias-detection-testbed">B. Methodological Bias Detection Testbed&lt;/h2>
&lt;p>We primarily frame the bias detection problem as a &lt;em>multi-label detection&lt;/em> task, moving away from traditional approaches that simply perform binary detection, e.g., toxic vs non-toxic or hate vs non-hate.
We consider zero-shot prompting and in-context-learning-based prompting of large-scale LLMs and fine-tuning encoder and decoder-based smaller language models (SLM). For a comprehensive analysis, for the prompting cases, we analyze Llama Guard, Llama 3.1 (8B, 70B), Qwen 2.5 (72B), GLM 4 (9B) &amp;mdash; models spanning several developers and scales. For the fine-tuning cases, we consider encoder models like RoBERTa (base, large), DeBERTa (v2-XL, v3-large) and decoder models GPT 2 (large, XL).&lt;/p>
&lt;p>For prompting, we also design a detailed detection policy that we use.
&lt;figure id="figure-data-bias-detection-policy">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Data bias detection policy" srcset="
/project/data-bias-llm/policy_hu9c47414976986a97e5d093eba9b99b77_590014_22ccc71cd01263ea011ee5235d3b2d9d.png 400w,
/project/data-bias-llm/policy_hu9c47414976986a97e5d093eba9b99b77_590014_12075b69100ec1c20c404a51cbe6f3bc.png 760w,
/project/data-bias-llm/policy_hu9c47414976986a97e5d093eba9b99b77_590014_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/data-bias-llm/policy_hu9c47414976986a97e5d093eba9b99b77_590014_22ccc71cd01263ea011ee5235d3b2d9d.png"
width="577"
height="760"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Data bias detection policy
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;p>For fine-tuning, we also analyze the impact of leveraging a balanced loss to tackle class imbalances. We perform training using HuggingFace transformers package.&lt;/p>
&lt;h2 id="c-evaluation-metrics">C. Evaluation Metrics&lt;/h2>
&lt;p>For detection performance, we analyze binary (biased vs unbiased) detection using $F_1$, FPR, and FNR. For multi-label performance (how well models detect exact bias types), we use Exact match ratio, Hamming loss, macro and micro $F_1$ scores. Finally, we also measure disparities in detection performance for biases targeting the different demographics. We wish to analyze if models disproportionately perform worse for biases that target specific demographics or for multi-targeted biases. If $\mathcal{P}$ denotes either FPR or FNR, and $m, m'$ two demographic axes, we design the &lt;strong>per-demographic disparity measure&lt;/strong>:&lt;/p>
&lt;p>$$
\Delta_{\mathcal{P}} = \max _{m,m'} \left| \mathcal{P}_m - \mathcal{P}_{m'} \right|
$$&lt;/p>
&lt;p>We also measure if the models make systematically more errors in detecting biases that specifically target multiple axes simultaneously (e.g., gender+race) relative to biases that target each constituent axis (e.g., only gender or race). Check out our paper for more details.&lt;/p>
&lt;h2 id="d-key-takeaways">D. Key Takeaways&lt;/h2>
&lt;p>
&lt;figure id="figure-overall-results">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Overall results" srcset="
/project/data-bias-llm/table_overall_hu1f28065021e0ec091337d0222e9e9820_798256_aeae04c4ee397d58829b6e9e2c0b205a.png 400w,
/project/data-bias-llm/table_overall_hu1f28065021e0ec091337d0222e9e9820_798256_3e379265fb94cf0653f9ab9f35ef0530.png 760w,
/project/data-bias-llm/table_overall_hu1f28065021e0ec091337d0222e9e9820_798256_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/data-bias-llm/table_overall_hu1f28065021e0ec091337d0222e9e9820_798256_aeae04c4ee397d58829b6e9e2c0b205a.png"
width="760"
height="474"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Overall Results
&lt;/figcaption>&lt;/figure>
&lt;strong>Success of Smaller Models&lt;/strong>: Our results indicate that fine-tuned SLMs show significant potential for scalable and effective bias detection compared to zero-shot prompting of larger models.&lt;/p>
&lt;p>&lt;strong>Performance Gaps&lt;/strong>: Significant disparities remain in how well models detect biases across different demographic axes. Models particularly struggle with multi-demographic (intersectional) targeted biases and subtle social biases.&lt;/p>
&lt;p>&lt;strong>Inadequacy of Existing Tools&lt;/strong>: Common safety-focused models and moderation APIs (like LlamaGuard) were found to be less effective at identifying the nuanced social biases present in raw text datasets.&lt;/p></description></item><item><title>CARMA: Causal Algorithmic Recourse with (Neural) Model-based Amortization</title><link>https://ayanmaj.netlify.app/project/carma/</link><pubDate>Mon, 10 Jun 2024 10:44:48 +0100</pubDate><guid>https://ayanmaj.netlify.app/project/carma/</guid><description>&lt;p>The project represents our recent &lt;a href="https://facctconference.org/2024/index.html" target="_blank" rel="noopener">ACM FAccT 2024&lt;/a> paper.
Algorithmic recourse aims to provide explanations to automated algorithmic decision-making systems to enable end-users to understand what needs to be done to change the algorithm&amp;rsquo;s prediction.
To this end, causal recourse showed that using the causal knowledge of the features is vital to ensuring the recommendations are actionable by people while being optimal in terms of cost of feature changes.
However, causal recourse has two major practical limitations: i) it requires perfect causal knowledge to compute counterfactual outcomes of its causal recommendations, ii) it needs to solve separate combinatorially complex optimization problems for each person seeking recourse.
Hence, for large-scale automated systems, e.g., online applications that provide instantaneous automated lending decisions or instantly filter out CVs in hiring, causal recourse cannot be directly applied.
In this work, we introduce CARMA, a practical framework that i) incorporates the power of the latest causal generative models with ii) neural networks that solve a novel amortized predictive formulation of the separate combinatorial problems.
Using this practical approach, we show that CARMA can help scale up causal recourse to enable instantaneous, actionable, and optimal recourse recommendation generation.&lt;/p>
&lt;h2 id="a-limitations-of-existing-causal-recourse-techniques">A. Limitations of existing causal recourse techniques&lt;/h2>
&lt;p>Consider large-scale predictive settings, e.g., online automated lending systems, that instantaneously filter out and reject loan applicants.
Causal recourse can help provide helpful and actionable recommendations that users can use to overturn negative decisions.
For each individual with features $\mathbf{x}^{\mathrm{F}}$ requesting recourse, causal algorithmic recourse finds the optimal action $\boldsymbol{a}^{*}$ that generates the counterfactual features $\mathbf{x}^{\mathrm{CF}}$ and obtains the positive prediction from the downstream classifier $h$. Causal recourse finds the optimal solution by solving the following optimization problem
$$
\begin{align}
\boldsymbol{a}^* \in \underset{\boldsymbol{a} \in \mathcal{A}\left(\mathbf{x}^{\mathrm{F}}\right)}{\arg \min } \operatorname{cost}\left(\boldsymbol{a} ; \mathbf{x}^{\mathrm{F}}\right) \text { subj.to } h\left(\mathbf{x}^{\mathrm{CF}}\left(\boldsymbol{a}, \mathbf{x}^{\mathrm{F}}\right)\right)=1
\end{align}
$$
Unfortunately, there are two major limitations that limit the practicality of causal recourse.&lt;/p>
&lt;ol>
&lt;li>We need to know the exact causal relations between the features $X$ (the exact structural causal model or SCM). Unfortunately, this is infeasible for most practical settings.&lt;/li>
&lt;li>The optimization problem needs a combinatorial search over the set of all actions $\mathcal{A}$ that involves all feature and value combinations. Unfortunately, this becomes exponentially more complex for large-scale settings, increasing compute times.
Owing to these limitations, we cannot deploy causal recourse for practical large-scale settings so that we can provide causal recommendations for recourse instantaneously.&lt;/li>
&lt;/ol>
&lt;h2 id="b-amortizing-causal-recourse-optimization-with-carma">B. Amortizing causal recourse optimization with CARMA&lt;/h2>
&lt;p>First, to enable providing causal recommendations even when we do not know the exact SCM for a practical scenario, we leverage existing causal generative models like the Causal Normalizing Flows.
With data of observed features and knowledge of only the causal graph, these powerful generative models allow CARMA to accurately estimate causal relations, causal exogenous factors $\mathbf{Z}^{\mathrm{F}}$ and compute counterfactual features.
CARMA incorporates pre-trained causal generative models and is flexible to use any recent and future models that allow gradient access.&lt;/p>
&lt;p>Secondly, note that the causal relations between the features and the downstream classifier are, in fact, common and shared across the entire population.
This enables us to convert the separate combinatorial optimization problems into a single predictive task to generate optimal recourse actions. Moreover, we can easily use observed data of features of individuals and train a neural network based framework to learn to generate these recommendations.
CARMA trains two NN models end-to-end: the mask network predicts which features $\mathcal{I}$ to intervene on and the action network predicts the optimal intervention values.
&lt;figure id="figure-carma-amortized-causal-recourse-framework">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="CARMA framework" srcset="
/project/carma/pipeline_hu9ef7a3895f6b3cebe3336d8c597dda65_240464_93a19595710d97256a083e595acf41fb.png 400w,
/project/carma/pipeline_hu9ef7a3895f6b3cebe3336d8c597dda65_240464_b096cc43cac5508bb399ee9ed72e7c56.png 760w,
/project/carma/pipeline_hu9ef7a3895f6b3cebe3336d8c597dda65_240464_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/carma/pipeline_hu9ef7a3895f6b3cebe3336d8c597dda65_240464_93a19595710d97256a083e595acf41fb.png"
width="760"
height="201"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
CARMA amortized causal recourse framework
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="c-carma-provides-recourse-that-is-optimal-and-instant">C. CARMA provides recourse that is optimal and instant&lt;/h2>
&lt;p>We apply CARMA as the deployed causal recourse recommendation provider for various causal datasets and the semi-synthetic Loan dataset.
We compare CARMA to the Oracle that has access to the exact SCM for each dataset and solves the separate combinatorial problems to find causal recommendations.
In our results, we show that CARMA, despite amortization, can provide recourse recommendations that are optimal regarding the oracle in terms of the cost and the causal validity of the recommendations.
Moreover, amortization allows CARMA to significantly reduce the time required to generate the causal recommendations, leading to the possibility of instantaneous recourse suggestions.
&lt;figure id="figure-carma-provides-optimal-amortized-recourse-compared-to-the-oracle">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Table showing optimal amortization of CARMA" srcset="
/project/carma/table-1_hu53b5bb0cd0365bf1a7bd71b7ef88a8a3_543597_ff65b5d2a9dad1a8caab2a44b83acab0.png 400w,
/project/carma/table-1_hu53b5bb0cd0365bf1a7bd71b7ef88a8a3_543597_c31bfa6e9c3281234a04efcc458cda00.png 760w,
/project/carma/table-1_hu53b5bb0cd0365bf1a7bd71b7ef88a8a3_543597_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/carma/table-1_hu53b5bb0cd0365bf1a7bd71b7ef88a8a3_543597_ff65b5d2a9dad1a8caab2a44b83acab0.png"
width="760"
height="543"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
CARMA provides optimal amortized recourse compared to the Oracle
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="d-carma-is-flexible-in-using-different-generative-models">D. CARMA is flexible in using different generative models&lt;/h2>
&lt;p>In our evaluations, we train and deploy CARMA using not only the causal normalizing flows generative model, but also VACA that uses graph neural networks.
We show in our results that we can train and deploy CARMA using these two different architectures of generative models. Naturally, the Flows model performs better since it was shown to be the state-of-the-art.
Nonetheless, our results confirm that CARMA is flexible and can be incorporated with off-the-shelf causal generative models as long as we can compute gradients through these models (note that this is mostly possible since the models are based on deep neural networks).
&lt;figure id="figure-carma-can-use-different-causal-generative-models">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plots showing flexibility of CARMA to causal generative models" srcset="
/project/carma/plot-1_hu83fabbc538171a491502d3e43763c186_88244_a953e905de5dc4d924655c3a4bd97465.png 400w,
/project/carma/plot-1_hu83fabbc538171a491502d3e43763c186_88244_647b863fbf0c87ce9d992a87476a8a20.png 760w,
/project/carma/plot-1_hu83fabbc538171a491502d3e43763c186_88244_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/carma/plot-1_hu83fabbc538171a491502d3e43763c186_88244_a953e905de5dc4d924655c3a4bd97465.png"
width="760"
height="125"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
CARMA can use different causal generative models
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="d-carma-can-incorporate-population-level-feature-preferences">D. CARMA can incorporate population-level feature preferences&lt;/h2>
&lt;p>CARMA&amp;rsquo;s formulation also allows us to easily incorporate knowledge of feature preferences that a population might have.
For instance, a population may find changing Education level very difficult but increasing Savings to be relatively simpler.
It is easy to incorporate this knowledge in the optimization of the mask and action networks of CARMA.
In our analysis on the Loan dataset where higher numbers for a feature represents more difficult features, we see that CARMA updates its recourse recommendations by leveraging the population preferences.
For instance, note that with the weights (wgt.), CARMA intervenes on fewer features and changes the more preferred features like Savings a lot more.
&lt;figure id="figure-carma-can-adapt-recourse-solutions-to-cater-to-feature-preferences-of-a-population">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plots showing CARMA&amp;amp;rsquo;s ability to incorporate population preferences for features" srcset="
/project/carma/plot-2_hudc26c5490e9b2ae12c4e95f3401bc446_142697_ccbb3d4426737fb28f9f36f9f54de607.png 400w,
/project/carma/plot-2_hudc26c5490e9b2ae12c4e95f3401bc446_142697_fb4507aadf2af71083185fe10aed3538.png 760w,
/project/carma/plot-2_hudc26c5490e9b2ae12c4e95f3401bc446_142697_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/carma/plot-2_hudc26c5490e9b2ae12c4e95f3401bc446_142697_ccbb3d4426737fb28f9f36f9f54de607.png"
width="760"
height="168"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
CARMA can adapt recourse solutions to cater to feature preferences of a population
&lt;/figcaption>&lt;/figure>
&lt;/p></description></item><item><title>FairAll: Fair Decisions With Unlabeled Data</title><link>https://ayanmaj.netlify.app/project/fairall/</link><pubDate>Tue, 01 Mar 2022 10:44:48 +0100</pubDate><guid>https://ayanmaj.netlify.app/project/fairall/</guid><description>&lt;p>The project is part of our &lt;a href="https://facctconference.org/2022/index.html" target="_blank" rel="noopener">ACM FAccT 2022&lt;/a> paper.
In this work, we explore the helpfulness of integrating unlabeled data into the fair decision-making pipeline to tackle label and selection bias.
Although many works exist on trying to learn decision policies that are fair, they often suffer from high variance and instability in these scenarios.
So, when i) the labels we work with are biased (and often biased proxies) and ii) the labeled data is sampled non-i.i.d. with selection bias,
the prior work often is quite unstable.
By this, we mean that the different policies output by the existing frameworks at different times can give very different
measures of utility and fairness for the same population.
What is more, these policies often forcefully trade-off the utility for gaining fairness.
In this project, we show how we can actually approximate hidden ground-truth information (e.g., talent) from observed biased proxy labels (e.g., biased grades) that can help make optimal and fair decisions (e.g., accept or reject students).
Further, we highlight the role that unlabeled data can play in learning decision policies that are optimal, fair and stable.&lt;/p>
&lt;h2 id="a-learning-fair-representations-from-all-data-with-vaes">A. Learning fair representations from all data with VAEs&lt;/h2>
&lt;p>We first aim to use both labeled and unlabeled data in the learning process.
Our goal is to approximate the hidden ground-truth label (e.g., the hidden, intrinsic talent of students) from biased features and proxy labels (e.g., biased grades).
We do so by modeling the data distribution using both labeled and unlabeled data (which is often discarded).
We use a VAE model, conditional on sensitive features (e.g., gender).
Our loss function is shown here. Note, we also have an additional classifier model to predict the true utility of each data-point.
One important point to note: while prior work required IPS weighting to reduce selection bias on the entire loss function,
we need the IPS only for the classifier and not the VAE.
$$
\begin{align}
J(\theta, \phi, \omega) = &amp;amp;\underbrace{\alpha \mathbb{E}_{(x,\tilde{u}, s)\sim \mathbf{A}^L} [\mathcal{R}(\omega; x, s, \tilde{u}, \pi)]}_{\text{IPS-weighted Classifier}} \\&lt;br>
&amp;amp;-\underbrace{\mathbb{E}_{(x,\tilde{u},s)\sim \mathbf{A}^L, d=1}[\mathcal{L}(\theta, \phi; x, s, \tilde{u})]}_{\text{Labeled VAE-ELBO}} \\&lt;br>
&amp;amp;-\underbrace{\mathbb{E}_{x,s\sim \mathbf{A}^{UL}, d=0}[\mathcal{U}(\theta, \phi; x, s)]}_{\text{Unlabeled VAE-ELBO}}
\end{align}
$$&lt;/p>
&lt;h2 id="b-fairall-two-phase-decision-learning-pipeline">B. FairAll: Two-phase decision learning pipeline&lt;/h2>
&lt;p>We introduce a two-phase decision learning approach that can significantly reduce the instability, while being highly optimal and fair.
In fact, in certain scenarios where an unbiased ground-truth actually might exist, we completely do away with the trade-off that is usually assumed.
Before we actually perform the decision learning phase (Phase II), we introduce a pre-learning Phase I.
In this Phase I, we train a Conditional VAE only on the features. We show that this improves the representation learning and the corresponding stability, optimality, and fairness.
&lt;figure id="figure-fairall-two-phase-policy-pipeline">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="FairAll policy pipeline" srcset="
/project/fairall/pipeline_hua6d981776fd96c322dd867df72020be9_313711_d1b8708412f8ca21b77c172c77273b34.png 400w,
/project/fairall/pipeline_hua6d981776fd96c322dd867df72020be9_313711_2caf6f2a6c97aab6bc61065984197ce0.png 760w,
/project/fairall/pipeline_hua6d981776fd96c322dd867df72020be9_313711_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/fairall/pipeline_hua6d981776fd96c322dd867df72020be9_313711_d1b8708412f8ca21b77c172c77273b34.png"
width="760"
height="225"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
FairAll two-phase policy pipeline
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="c-fairall-approximates-the-hidden-ground-truth">C. FairAll approximates the hidden ground-truth&lt;/h2>
&lt;p>Here, we show our result where we use synthetic data (with access to ground-truth information) to show that FairAll can
approximate the optimal policy based on the ground-truth.
This is shown by the blue line where we trained FairAll with Phases I and II, i.e., FairAll (I+II).
FairAll (I+II) achieves optimality not only in terms of utility, but also fairness &lt;strong>both&lt;/strong> in terms of
demographic parity (DP) and counterfactual (CF) fairness notions.
The prior work (FairLog) fails to achieve optimal fairness.
We further show the benefit of unlabeled data, as we compare to our method without Phase I unlabeled data (FairAll (II)),
and our method with Phase I but without Phase II unlabeled data (FairLog).
&lt;figure id="figure-synthetic-experiment-validating-approximation-of-ground-truth">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plot showing approximation of ground-truth" srcset="
/project/fairall/plot-1_hue56571ca13dd81193287a09a8049156d_1821211_5091a39b0b4842103a24212f7a84378a.png 400w,
/project/fairall/plot-1_hue56571ca13dd81193287a09a8049156d_1821211_7d61c435f7cfb4b6b7b4535fa5518694.png 760w,
/project/fairall/plot-1_hue56571ca13dd81193287a09a8049156d_1821211_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/fairall/plot-1_hue56571ca13dd81193287a09a8049156d_1821211_5091a39b0b4842103a24212f7a84378a.png"
width="760"
height="229"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Synthetic experiment validating approximation of ground-truth
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="d-fairall-provides-an-effective-and-fair-learning-process">D. FairAll provides an effective and fair learning process&lt;/h2>
&lt;p>Using real-world data, we show that over the entire training process across time, FairAll can accumulate
higher amount of utility, &lt;strong>while also&lt;/strong> incurring lower amount of unfairness.
This is in stark contrast to prior approach FairLog, where we clearly see a trade-off.
Note again, the benefits of using unlabeled data in both phases as FairAll (I+II) has the best performance overall.&lt;/p>
&lt;p>
&lt;figure id="figure-real-world-experiment-showing-effectiveness-of-fairall-in-terms-of-accumulated-utility-and-fairness">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Table showing policy effectiveness" srcset="
/project/fairall/table-effect_hua5037851f5e93463ab87ae2a10945691_303222_ef6a80246d06e8964b616cdfb0b8cb33.png 400w,
/project/fairall/table-effect_hua5037851f5e93463ab87ae2a10945691_303222_b90e2d41233efca422f2958a4829015d.png 760w,
/project/fairall/table-effect_hua5037851f5e93463ab87ae2a10945691_303222_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/fairall/table-effect_hua5037851f5e93463ab87ae2a10945691_303222_ef6a80246d06e8964b616cdfb0b8cb33.png"
width="760"
height="219"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Real-world experiment showing effectiveness of FairAll in terms of accumulated utility and fairness.
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="e-fairall-provides-high-utility-and-fairness-for-real-data">E. FairAll provides high utility and fairness for real data&lt;/h2>
&lt;p>We show that FairAll, on deployment to unseen real-world data, can provide high utility as well as low unfairness.
So, we do not see a trade-off in performance for the policy system, compared to prior method FairLog.
In fact, for COMPAS data as shown here, FairAll can provide utility higher than the unfair standard policy learning method (UnfairLog)!
Using unlabeled data (compared to FairAll (II) and FairLab) also provides higher utility and fairness.
&lt;figure id="figure-real-world-experiment-showing-test-time-performance-of-fairall">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plot showing real world test performance" srcset="
/project/fairall/plot-2_hu5ed04169038695b5d1f033e706449d0c_591295_535f6a185261c0aa8508b8d3f44a0b5a.png 400w,
/project/fairall/plot-2_hu5ed04169038695b5d1f033e706449d0c_591295_c5c3075d1a560c9fc956b7e37dbfb63a.png 760w,
/project/fairall/plot-2_hu5ed04169038695b5d1f033e706449d0c_591295_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/fairall/plot-2_hu5ed04169038695b5d1f033e706449d0c_591295_535f6a185261c0aa8508b8d3f44a0b5a.png"
width="760"
height="203"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Real-world experiment showing test-time performance of FairAll
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="f-fairall-provides-a-more-stable-policy">F. FairAll provides a more stable policy&lt;/h2>
&lt;p>With real-world data, we show that FairAll (I+II), using unlabeled data in both phases, can indeed provide a more stable policy.
This means that once the learning process has been given some time-steps to learn, FairAll (I+II) can give more stable utility
and fairness responses with respect to the same unseen test data across different time-steps.
In contrast, prior work like FairLog can give very different estimates.
We measure this variance using Temporal Variance (TV) for utility and fairness.
So, we measure the variance of a metric $M$ across time $t$ with respect to the mean value $\mu_M$.
$$
\operatorname{TV}_{M}\left(\Pi_{t_{1}}^{t_{2}}\right)=\sqrt{\frac{1}{t_{2}-t_{1}} \sum_{t=t_{1}}^{t_{2}}\left[\left(M\left(\pi_{t}\right)-\mu_{M}\right)^{2}\right]}
$$
where $\mu_M = \frac{1}{t_2 - t_1} \sum_{t=t_1}^{t_2} M(\pi_t)$.
So, lower the TV, more stable the policy process, whereas higher the $\mu$ for utility (lower for unfairness), better the policy.
&lt;figure id="figure-real-world-experiment-showing-stability-of-fairall-in-terms-of-utility-and-fairness">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Table showing policy stability" srcset="
/project/fairall/table-stable_hueb537f6f4e429b753b457202d26e5315_309016_3e6cdf37886ae5441c78a55147ef967f.png 400w,
/project/fairall/table-stable_hueb537f6f4e429b753b457202d26e5315_309016_d87e10fdc1a4b5504f99b378f0573f67.png 760w,
/project/fairall/table-stable_hueb537f6f4e429b753b457202d26e5315_309016_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/fairall/table-stable_hueb537f6f4e429b753b457202d26e5315_309016_3e6cdf37886ae5441c78a55147ef967f.png"
width="760"
height="227"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Real-world experiment showing stability of FairAll in terms of utility and fairness.
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;p>
&lt;b>This project was jointly first-authored with Miriam Rateike. Also done in collaboration with Olga Mineeva, Isabel Valera, Krishna Gummadi.&lt;/b>
&lt;/p></description></item><item><title>Generating Counterfactuals for Causal Fairness</title><link>https://ayanmaj.netlify.app/project/generate-counterfactuals-fairness/</link><pubDate>Mon, 02 Nov 2020 09:54:04 +0100</pubDate><guid>https://ayanmaj.netlify.app/project/generate-counterfactuals-fairness/</guid><description>&lt;p>Notions of causal fairness for algorithmic decision making systems crucially rely on estimating whether an individual (or a group of individuals) and their counterfactual individual (or groups of individuals) would receive the same decision(s). Central to this estimation is the ability to compute the features of the counterfactual individual, given the features of any individual. Recent works have proposed to apply deep generative models like GANs and VAEs over real-world datasets to compute counterfactual datasets at the level of both individuals and groups. In this paper, we explore the challenges with computing accurate counterfactuals, particularly over heterogenous tabular data that is often used in algorithmic decision making systems. We also investigate the implicit assumptions when applying deep generative models to compute counterfactual datasets.&lt;/p>
&lt;h2 id="simplifying-causal-assumptions">Simplifying causal assumptions&lt;/h2>
&lt;p>Looking at the fairness and causality literature, we can actually simplify the causal graphs often assumed in the literature.
&lt;figure id="figure-example-causal-graphs-from-fairness-literature">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Example causal graphs of Law and COMPAS" srcset="
/project/generate-counterfactuals-fairness/causal-graphs_huc705120d06bdb83d22f832cb3bb41612_260668_44cc44e1e894fe3c295dcd13a0bd02ac.png 400w,
/project/generate-counterfactuals-fairness/causal-graphs_huc705120d06bdb83d22f832cb3bb41612_260668_ba2ffb386dd0a4aa0db5904069ac3ec6.png 760w,
/project/generate-counterfactuals-fairness/causal-graphs_huc705120d06bdb83d22f832cb3bb41612_260668_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/generate-counterfactuals-fairness/causal-graphs_huc705120d06bdb83d22f832cb3bb41612_260668_44cc44e1e894fe3c295dcd13a0bd02ac.png"
width="760"
height="311"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Example causal graphs from fairness literature
&lt;/figcaption>&lt;/figure>
These graphs considered in fairness literature have implicit structures, that we can leverage to simplify them.&lt;/p>
&lt;figure>
&lt;img alt="Simpler graph" src="causal-simple.png" width="300"/>
&lt;figcaption>Simpler causal graph that we can assume for fairness. Sensitive A is root node along with exogenous U. Some observed features X are affected by A.&lt;/figcaption>
&lt;/figure>
&lt;p>So, we can almost always assume a simpler causal graph to work with. The main considerations are:&lt;/p>
&lt;ul>
&lt;li>Sensitive features are root nodes.&lt;/li>
&lt;li>Sensitive features do not influence exogenous variables.&lt;/li>
&lt;li>Some observed features can be affected by sensitive features.&lt;/li>
&lt;/ul>
&lt;h2 id="using-a-conditional-vae-to-generate-counterfactuals">Using a Conditional VAE to generate counterfactuals&lt;/h2>
&lt;p>We first model the data likelihood using a Conditional VAE, conditioned on the sensitive features. We minimize the loss:
$$
\mathcal{L}=\frac{1}{N} \sum_{i=1}^{N} \mathbb{E}_{q_{\phi}\left(Z \mid X_{i}, A\right)}\left(\frac{\left|X_{i}-\hat{X}_{i}\right|^{2}}{\sigma^{2}}\right)+\mathbb{D}_{K L}\left[q_{\phi}\left(Z \mid X_{i}, A\right) | p(Z)\right]
$$
where $\sigma$ is a hyperparameter, $q_\phi$ is the encoder.
Then, we generate counterfactuals as follows:
$$
P\left(X_{A \leftarrow a^{\prime}}^{c} \mid F\right)=\int p_{\theta}\left(X^{c} \mid A=a^{\prime}, Z\right) q_{\phi}(Z \mid F) d Z
$$
So, we perform 3 steps, paralleling Pearl&amp;rsquo;s steps:&lt;/p>
&lt;ol>
&lt;li>Infer latent Z from observed features using encoder $q_\phi$&lt;/li>
&lt;li>Perform intervention, changing sensitive conditional variable&lt;/li>
&lt;li>Perform deduction using the Z and changed conditional with decoder $p_\theta$&lt;/li>
&lt;/ol>
&lt;h2 id="we-can-use-cvae-to-audit-for-counterfactual-fairness">We can use CVAE to audit for counterfactual fairness&lt;/h2>
&lt;p>We show that we can use the CVAE model to audit prediction models for counterfactual fairness.
Note, how the CVAE generated counterfactuals provide auditing results very close to the oracle model $\mathcal{M}_*$, that is assumed to have the exact causal graph.
The prior work FlipTest that uses GANs do not give as optimal results as the CVAE.
&lt;figure id="figure-auditing-prediction-models-using-cvae-counterfactuals">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plot for auditing" srcset="
/project/generate-counterfactuals-fairness/plot-1_hu3fa8ddf8cc8c09a9b0e6e0d81168f5a4_292189_badf9208cffacd282854cd9bab512bae.png 400w,
/project/generate-counterfactuals-fairness/plot-1_hu3fa8ddf8cc8c09a9b0e6e0d81168f5a4_292189_3759497d477bb558604b857303d689f3.png 760w,
/project/generate-counterfactuals-fairness/plot-1_hu3fa8ddf8cc8c09a9b0e6e0d81168f5a4_292189_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/generate-counterfactuals-fairness/plot-1_hu3fa8ddf8cc8c09a9b0e6e0d81168f5a4_292189_badf9208cffacd282854cd9bab512bae.png"
width="751"
height="760"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Auditing prediction models using CVAE counterfactuals.
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="we-can-use-cvae-to-train-counterfactually-fair-predictors">We can use CVAE to train counterfactually fair predictors&lt;/h2>
&lt;p>We next show how we can actually use the latent Z of the CVAE to train prediction models that are &lt;em>counterfactually fair&lt;/em>.
Note, FlipTest has no immediate way to estimate latent Z from input data, so cannot be directly used here.
CVAE-based Fair-Z is able to give very similar prediction results compared to the actual $U$ values from the true causal graphs.
&lt;figure id="figure-counterfactually-fair-predictors-with-cvae">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Plot for fair predictions" srcset="
/project/generate-counterfactuals-fairness/plot-2_hu64e3a18b62874213d1968d0e4df221e6_219268_b5dfd50d2bd766e8e056149ef9b39551.png 400w,
/project/generate-counterfactuals-fairness/plot-2_hu64e3a18b62874213d1968d0e4df221e6_219268_ba6ef336f7b7b98693cb799abbc84e14.png 760w,
/project/generate-counterfactuals-fairness/plot-2_hu64e3a18b62874213d1968d0e4df221e6_219268_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/generate-counterfactuals-fairness/plot-2_hu64e3a18b62874213d1968d0e4df221e6_219268_b5dfd50d2bd766e8e056149ef9b39551.png"
width="760"
height="441"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Counterfactually fair predictors with CVAE
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;p>
&lt;b>This project was done in collaboration with Preethi Lahoti, Junaid Ali, Till Speicher, Isabel Valera and Krishna Gummadi.&lt;/b>
&lt;/p></description></item><item><title>Bias in Generative Models</title><link>https://ayanmaj.netlify.app/project/bias-generative-models/</link><pubDate>Sun, 01 Nov 2020 10:44:48 +0100</pubDate><guid>https://ayanmaj.netlify.app/project/bias-generative-models/</guid><description>&lt;p>The project was carried out while I was a research assistant at the Max Planck Institute for Software Systems. The project explored the new direction of looking for potential bias in generative models. Models like variational autoencoders and GANs are becoming quite popular and also seeing deployment. The project aims to see if such models can exhibit any notion of bias. In particular, we explore variational autoenccoders and how the data that is generated or reconstructed by such models can be biased to certain demographics.
The bias is attempted to be formally defined. The project also involves initial exploration for methods to de-bias such systems, e.g. using additional labels to supervise the training process of the generative models.&lt;/p>
&lt;h2 id="a-exploring-generated-images-of-vae">A. Exploring generated images of VAE&lt;/h2>
&lt;p>We train a standard VAE model on the CelebA dataset and use the model to generate new facial images.
We explore the generated images for any potential bias, and perform this experiment by varying the population&amp;rsquo;s gender ratio.
Note the original data has a female-male ratio of 52-48.
We predict gender using the &lt;a href="https://www.clarifai.com/" target="_blank" rel="noopener">Clarifai&lt;/a> API.&lt;/p>
&lt;p>&lt;em>We use these only for research purposes. The CelebA dataset has several issues that have been discussed in the broader literature. Moreover, the moral implications of performing gender prediction from facial images should be looked into in more detail. We also do not assume perfect performance of the Clarifai API.&lt;/em>&lt;/p>
&lt;ul>
&lt;li>Note how with original data, there is a clear bias of the model towards generating feminine faces.&lt;/li>
&lt;li>Even when Male to Female ratio in training data is equalized, there is a bias towards feminine faces.&lt;/li>
&lt;li>The most equality for gender in the generated sample distribution is when we give more Male training photos (60%)!&lt;/li>
&lt;/ul>
&lt;p>So clearly, even with equalized data, a standard VAE can generate &lt;em>biased&lt;/em> data.
&lt;figure id="figure-gender-prediction-of-generated-data">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="bar plot of gender prediction" srcset="
/project/bias-generative-models/Rand_Gen_Gender_Dist_hu75577a685a3f564857a198871c314a98_37595_f5829867087cf03e96e1630bc49a48f2.png 400w,
/project/bias-generative-models/Rand_Gen_Gender_Dist_hu75577a685a3f564857a198871c314a98_37595_89a84b003665ab37aba9ca9fa5dd357d.png 760w,
/project/bias-generative-models/Rand_Gen_Gender_Dist_hu75577a685a3f564857a198871c314a98_37595_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/bias-generative-models/Rand_Gen_Gender_Dist_hu75577a685a3f564857a198871c314a98_37595_f5829867087cf03e96e1630bc49a48f2.png"
width="760"
height="475"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Gender prediction of generated data
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="b-auditing-reconstructed-data-of-vae">B. Auditing reconstructed data of VAE&lt;/h2>
&lt;p>Using the trained VAE again, we now use a curated auditing set created from the CelebA test data.
The audit set is the intersection of gender (male-female) and race (black/african american-white/caucasian).
For each face, we use the VAE to reconstruct the face again (feed it as input and analyze the output).
We then use the Clarifai API to predict the demographics of the reconstructed faces.&lt;/p>
&lt;p>&lt;em>The use of machine learning to predict demographics from facial data, and its implications need further study. We only use this here for an initial research insight.&lt;/em>&lt;/p>
&lt;ul>
&lt;li>Surprisingly here, male faces (white and black) are more likely to have the demography correctly predicted.&lt;/li>
&lt;li>Black females suffer the most, where almost all the faces are predicted as Hispanic instead.&lt;/li>
&lt;li>White females also suffer, but nowhere as poorly as black females.&lt;/li>
&lt;/ul>
&lt;p>So, the VAE clearly suffers from some bias in reconstructing data. The way that it reconstructs demographic information in the faces is very different for different groups.
&lt;figure id="figure-demography-prediction-of-reconstructed-data">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="bar plot of demography prediction" srcset="
/project/bias-generative-models/Dem_Pred_Recon_Audit_Set_hu1b39ae61091ea783484b295fa187ddaf_39745_50d438a5f6317b64fbbe49cf70ccee90.png 400w,
/project/bias-generative-models/Dem_Pred_Recon_Audit_Set_hu1b39ae61091ea783484b295fa187ddaf_39745_684909a15eb7d3a9dcbc0c8ed75de91f.png 760w,
/project/bias-generative-models/Dem_Pred_Recon_Audit_Set_hu1b39ae61091ea783484b295fa187ddaf_39745_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/bias-generative-models/Dem_Pred_Recon_Audit_Set_hu1b39ae61091ea783484b295fa187ddaf_39745_50d438a5f6317b64fbbe49cf70ccee90.png"
width="760"
height="475"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Demography prediction of reconstructed data
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="c-generating-counterfactual-images-with-conditional-vae">C. Generating counterfactual images with Conditional VAE&lt;/h2>
&lt;p>We now start exploring some potential fixes. First, we assume that the facial data has gender labels available (it is the case for CelebA).
Then, we train a Conditional VAE model, conditioned on gender.
This actually allows us to generate counterfactual facial images!&lt;/p>
&lt;ol>
&lt;li>Take an input image (say of a male) and feed it to the Encoder of the VAE.&lt;/li>
&lt;li>Extract latent z.&lt;/li>
&lt;li>Flip the conditional attribute from male to female at the Decoder of VAE.&lt;/li>
&lt;li>Reconstruct the face image using the z and conditional Female.&lt;/li>
&lt;/ol>
&lt;p>We show some examples here, where we generate counterfactual female faces for some male face images.
It is interesting to note what the VAE learns to transform in this counterfactual generation.&lt;/p>
&lt;p>E.g., the VAE smoothens the skin, applies makeup to the faces whenever we make counterfactual females.
&lt;figure id="figure-counterfactual-male-to-female-images-from-vae">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="some images of male and counterfactual female" srcset="
/project/bias-generative-models/male_cond_f_counterfactual_hu978951aa1788cc9015a666a4d7a89033_1105862_d10e33491785b575a2020bacf276d691.png 400w,
/project/bias-generative-models/male_cond_f_counterfactual_hu978951aa1788cc9015a666a4d7a89033_1105862_02b6af18b083fa836c8de91f94e891db.png 760w,
/project/bias-generative-models/male_cond_f_counterfactual_hu978951aa1788cc9015a666a4d7a89033_1105862_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/bias-generative-models/male_cond_f_counterfactual_hu978951aa1788cc9015a666a4d7a89033_1105862_d10e33491785b575a2020bacf276d691.png"
width="760"
height="521"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Counterfactual Male-to-Female images from VAE
&lt;/figcaption>&lt;/figure>
&lt;/p>
&lt;h2 id="d-effect-of-conditioning-vae-on-gender-prediction-of-reconstructed-images">D. Effect of conditioning VAE on gender prediction of reconstructed images&lt;/h2>
&lt;p>We test how a standard VAE and conditional VAE generate images, specifically with respect to the gender.
So, we reconstruct input images using different VAE training procedures and use the Clarifai API to see how the gender errors look like.
We also play around with the conditional gender values in the models to see how the image reconstructions are perceived by the API.&lt;/p>
&lt;ul>
&lt;li>For the original CelebA images, the API makes more mistakes on Female faces than Male faces.&lt;/li>
&lt;li>If we use a standard VAE, the error is significantly higher for Males than Females. So masculine faces are reconstructed to be less masculine.&lt;/li>
&lt;li>Using a conditional VAE &lt;strong>significantly&lt;/strong> reduces this bias. The error rates are much more equalized across genders.&lt;/li>
&lt;li>If we multiply the conditional values during reconstruction (so instead of conditional Female=1 we say Female=2), the error rates become even lower.&lt;/li>
&lt;li>So, multiplying the conditional can make the VAE generate more masculine/feminine faces (at least perceived by the API).&lt;/li>
&lt;li>Flipping the gender value at the encoder has no effect, so it does not generate counterfactuals. &lt;em>This is as expected&lt;/em>.&lt;/li>
&lt;li>Flipping the gender value at the decoder however indeed seems to create proper counterfactuals. These images are almost always predicted to have the &lt;strong>opposite&lt;/strong> gender of the input.&lt;/li>
&lt;li>So, male input with flipped gender at decoder will always make the API think the reconstructed image is female.
&lt;figure id="figure-gender-prediction-and-conditioning-of-vae">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="bar plot of gender prediction and conditional VAE" srcset="
/project/bias-generative-models/gender_api_pred_flip_male_lrg_hu7aa7ea5a161a7db5863e7e2299094e79_51582_c3cb4e102439811c6109bc9400121bd5.png 400w,
/project/bias-generative-models/gender_api_pred_flip_male_lrg_hu7aa7ea5a161a7db5863e7e2299094e79_51582_d3815e3ed8131b8f567c3713d582f242.png 760w,
/project/bias-generative-models/gender_api_pred_flip_male_lrg_hu7aa7ea5a161a7db5863e7e2299094e79_51582_1200x1200_fit_lanczos_3.png 1200w"
src="https://ayanmaj.netlify.app/project/bias-generative-models/gender_api_pred_flip_male_lrg_hu7aa7ea5a161a7db5863e7e2299094e79_51582_c3cb4e102439811c6109bc9400121bd5.png"
width="760"
height="464"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption>
Gender prediction and conditioning of VAE
&lt;/figcaption>&lt;/figure>
&lt;/li>
&lt;/ul>
&lt;p>
&lt;b>This project was done in collaboration with Preethi Lahoti, Junaid Ali, Till Speicher and Krishna Gummadi.&lt;/b>
&lt;/p></description></item></channel></rss>