Skip to content

Commit 21e5b06

Browse files
authored
Merge pull request #263 from NGO-Algorithm-Audit/feature/structural_edits
Feature/structural edits
2 parents 52da2a1 + ac997c5 commit 21e5b06

File tree

3 files changed

+43
-31
lines changed

3 files changed

+43
-31
lines changed

content/english/technical-tools/BDT.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Unsupervised bias detection tool
33
subtitle: >
4-
A statistical tool that identifies groups where an AI system or algorithm shows deviating performance, potentially indicating unfair treatment or bias. The tool informs the qualitative doctrine of law and ethics which disparities need to be scrutinised manually by domain experts.
4+
A statistical tool that identifies groups where an AI system or algorithm shows deviating performance, potentially indicating unfair treatment. The tool informs which disparities need to be examimed manually by domain experts.
55
image: /images/svg-illustrations/illustration_cases.svg
66
quick_navigation:
77
title: Content overview
@@ -14,8 +14,8 @@ quick_navigation:
1414
url: '#source-code'
1515
- title: Scientific paper and audit report
1616
url: '#scientific-paper'
17-
- title: Local-first architecture
18-
url: '#local-first'
17+
- title: local-only architecture
18+
url: '#local-only'
1919
- title: Supported by
2020
url: '#supported-by'
2121
- title: Awards and acknowledgements
@@ -78,17 +78,38 @@ team:
7878
type: bias-detection-tool
7979
---
8080

81+
<!-- Promobar -->
82+
83+
<div id={{.Get "id" }} class="container-fluid mt-0 p-0">
84+
<div class="shadow bg-lightblue">
85+
<div class="row promobar-mobile-desktop-layout">
86+
<div class="col-12 flex justify-center items-center px-5">
87+
<!-- Content -->
88+
<span class="mr-3" style="font-size:16px; color:#005aa7;">
89+
<b>👋 Do you also want to start using the tool locally? It's easier than you think! Get in <u><a href="/nl/about/contact/" >contact</a></u> to learn more.</b> </span>
90+
</div>
91+
</div>
92+
</div>
93+
</div>
94+
8195
<!-- Introduction -->
8296

8397
{{< container_open title="Introduction – Unsupervised bias detection tool" icon="fas fa-search " id="info" isAccordion="" >}}
8498

8599
<br>
86100

87101
#### What does the tool do?
88-
The tool helps find groups where an AI system or algorithm performs differently, which could indicate unfair treatment or bias. It does this using a technique called <a href="https://en.wikipedia.org/wiki/Cluster_analysis" target="_blank">clustering</a>, which groups similar data points together (in a cluster). The tool doesn’t need information like gender, nationality, or ethnicity to find these patterns. Instead, it uses a `bias metric` to measure deviations in the performace of the algorithmic system, which you can choose based on your data.
102+
The tool helps find groups where an AI system or algorithm performs differently, which could indicate unfair treatment. It does this using a technique called <a href="https://en.wikipedia.org/wiki/Cluster_analysis" target="_blank">clustering</a>, which groups similar data points together (in a cluster). The tool doesn’t need information like gender, nationality, or ethnicity to find these patterns. Instead, it uses a `bias score` to measure deviations in the performace of the system, which you can choose based on your data.
103+
104+
#### What results does it give?
105+
The tool finds groups (clusters) where performance of the algorithmic system is significantly deviating. It highlights the group with the worst `bias score` and creates a report called a bias analysis report, which you can download as a PDF. You can also download all the identified groups (clusters) in a .json file. Additionally, the tool provides visual summaries of the results, helping experts dive deeper into the identified deviations. Example below ⬇️.
106+
107+
<div style="margin-bottom:50px; display: flex; justify-content: center;">
108+
<img src="/images/BDT/example_COMPAS.png" alt="drawing" width="600px"/>
109+
</div>
89110

90111
#### What kind of data does it work with?
91-
The tool works with data in a table format, consisting solely of numbers or categories. You just need to pick one column in the data to use as the `bias metric`. This column should have numbers only, and you’ll specify whether a higher or lower number is better. For example, if you’re looking at error rates, lower numbers are better. For accuracy, higher numbers are better. The tool also comes with a demo dataset you can use by clicking "Try it out."
112+
The tool works with data in a table format, consisting solely of numbers or categories. You just need to pick one column in the data to use as the `bias score`. This column should have numbers only, and you’ll specify whether a higher or lower number is better. For example, if you’re looking at error rates, lower numbers are better. For accuracy, higher numbers are better. The tool also comes with a demo dataset you can use by clicking "Try it out."
92113

93114
<div>
94115
<p><u>Example of numerical data set</u>:</p>
@@ -109,11 +130,8 @@ The tool works with data in a table format, consisting solely of numbers or cate
109130
</div>
110131
<br>
111132

112-
#### What results does it give?
113-
The tool finds groups (clusters) where performance of the algorithmic system is significantly different. It highlights the group with the worst performance and creates a report called a bias analysis report, which you can download as a PDF. You can also download all the identified groups in a .json file. Additionally, the tool provides visual summaries of the results, helping experts dive deeper into the identified deviations.
114-
115133
#### Is my data safe?
116-
Yes! Your data stays on your computer and never leaves your organization’s environment. The tool runs directly in your browser, using your computer’s power to analyze the data. This setup, called 'local-first', ensures no data is sent to cloud providers or third parties. Instructions for hosting the tool securely within your organization are available on <a href="https://github.com/NGO-Algorithm-Audit/local-first-web-tool" target="_blank">Github</a>.
134+
Yes! Your data stays on your computer and never leaves your organization’s environment. The tool runs directly in your browser, using your computer’s power to analyze the data. This setup, called 'local-only', ensures no data is sent to cloud providers or third parties. Instructions for hosting the tool securely within your organization are available on <a href="https://github.com/NGO-Algorithm-Audit/local-only-web-tool" target="_blank">Github</a>.
117135

118136
Try the tool below ⬇️
119137

@@ -129,14 +147,14 @@ Try the tool below ⬇️
129147
The unsupervised bias detection tool operates a series of steps:
130148

131149
##### Prepared by the user:
132-
<span style="color:#005AA7">1. Dataset:</span> The data must be provided in a tabular format. All columns, except the bias metric column, should have uniform data types, e.g., either all numerical or all categorical. The bias metric column must be numerical. Any missing values should be removed or replaced. The dataset should then be divided into training and testing subset, following a 80-20 ratio.
150+
<span style="color:#005AA7">1. Dataset:</span> The data must be provided in a tabular format. All columns, except the bias score column, should have uniform data types, e.g., either all numerical or all categorical. The bias score column must be numerical. Any missing values should be removed or replaced. The dataset should then be divided into training and testing subset, following a 80-20 ratio.
133151

134-
<span style="color:#005AA7">2. Bias metric:</span> The user selects one column from the dataset to serve as the `bias metric`. In step 3, clustering will be performed based on this chosen `bias metric`. The chosen bias metric must be numerical. Examples include metrics such as "being classified as high risk", "error rate" or "selected for an investigation".
152+
<span style="color:#005AA7">2. bias score:</span> The user selects one column from the dataset to serve as the `bias score`. In step 3, clustering will be performed based on this chosen `bias score`. The chosen bias score must be numerical. Examples include metrics such as "being classified as high risk", "error rate" or "selected for an investigation".
135153

136154
##### Performed by the tool:
137155
<span style="color:#005AA7">3. Hierarchical Bias-Aware Clustering (HBAC):</span> The HBAC algorithm (detailed below) is applied to the training dataset. The centroids of the resulting clusters are saved and later used to assign cluster labels to data points in the test dataset.
138156

139-
<span style="color:#005AA7">4. Testing differences in bias metric:</span> Statistical hypothesis testing is performed to evaluate whether the most deviating cluster contains significantly more bias compared to the rest of the dataset. A two-sample t-test is used to compare the bias metrics between clusters. For multiple hypothesis testing, Bonferonni correction should be applied. Further details can are available in our [scientific paper](/technical-tools/bdt/#scientific-paper).
157+
<span style="color:#005AA7">4. Testing differences in bias score:</span> Statistical hypothesis testing is performed to evaluate whether the most deviating cluster contains significantly more bias compared to the rest of the dataset. A two-sample t-test is used to compare the bias scores between clusters. For multiple hypothesis testing, Bonferonni correction should be applied. Further details can are available in our [scientific paper](/technical-tools/bdt/#scientific-paper).
140158

141159
A schematic overview of the above steps is depicted below.
142160

@@ -145,7 +163,7 @@ A schematic overview of the above steps is depicted below.
145163
</div>
146164

147165
#### How does the clustering algorithm work?
148-
The *Hierarchical Bias-Aware Clustering* (HBAC) algorithm identifies clusters in the provided dataset based on a user-defined `bias metric`. The objective is to find clusters with low variation in the bias metric within each cluster and significant variation between clusters. HBAC iteratively finds clusters in the data using k-means (for numerical data) or k-modes clustering (for categorical data). For the initial split, HBAC takes the full dataset and splits it in two clusters. Cluster `C` – with the highest standard deviation of the bias metric – is selected. Then, cluster `C` is divided into two candidate clusters `C'` and `C''`'. If the average bias metric in either candidate cluster exceed the the average bias metric in `C`, the candidate cluster with highest bias metric is selected as a new cluster. This process repeats until the maximum number of iterations (`max_iterations`) is reached or the resulting cluster fails to meet the minimum size requirement (`n_min`). The pseudo-code of the HBAC algorithm is provided below.
166+
The *Hierarchical Bias-Aware Clustering* (HBAC) algorithm identifies clusters in the provided dataset based on a user-defined `bias score`. The objective is to find clusters with low variation in the bias score within each cluster and significant variation between clusters. HBAC iteratively finds clusters in the data using k-means (for numerical data) or k-modes clustering (for categorical data). For the initial split, HBAC takes the full dataset and splits it in two clusters. Cluster `C` – with the highest standard deviation of the bias score – is selected. Then, cluster `C` is divided into two candidate clusters `C'` and `C''`'. If the average bias score in either candidate cluster exceed the the average bias score in `C`, the candidate cluster with highest bias score is selected as a new cluster. This process repeats until the maximum number of iterations (`max_iterations`) is reached or the resulting cluster fails to meet the minimum size requirement (`n_min`). The pseudo-code of the HBAC algorithm is provided below.
149167

150168
<div style="display: flex; justify-content: center;">
151169
<img src="/images/BDT/pseudo_code_HBAC.png" alt="drawing" width="800px"/>
@@ -154,13 +172,13 @@ The *Hierarchical Bias-Aware Clustering* (HBAC) algorithm identifies clusters in
154172
The HBAC-algorithm is introduced by Misztal-Radecka and Indurkya in a [scientific article](https://www.sciencedirect.com/science/article/abs/pii/S0306457321000285) as published in *Information Processing and Management* in 2021. Our implementation of the HBAC-algorithm advances this implementation by proposing additional methodological checks to distinguish real bias from noise, such as sample splitting, statistical hypothesis testing and measuring cluster stability. Algorithm Audit's implementation of the algorithm can be found in the <a href="https://github.com/NGO-Algorithm-Audit/unsupervised-bias-detection/blob/master/README.md" target="_blank">unsupervised-bias-detection</a> pip package.
155173

156174
#### How should the results of the tool be interpreted?
157-
The HBAC algorithm maximizes the difference in the bias metric between clusters. To prevent incorrect conclusions that there is bias in the decision-making process under review when there truly is none, we split the dataset in training and test data, and hypothesis testing prevents us from (wrongly) concluding that there is a difference in the bias metric while there is none. If statistically significant bias is detected, the outcome of the tool serves as a starting point for human experts to assess potential discrimination in the decision-making processes.
175+
The HBAC algorithm maximizes the difference in the bias score between clusters. To prevent incorrect conclusions that there is bias in the decision-making process under review when there truly is none, we split the dataset in training and test data, and hypothesis testing prevents us from (wrongly) concluding that there is a difference in the bias score while there is none. If statistically significant bias is detected, the outcome of the tool serves as a starting point for human experts to assess potential discrimination in the decision-making processes.
158176

159177
{{< container_close >}}
160178

161179
<!-- Web app -->
162180

163-
{{< iframe title="Web app – Unsupervised bias detection tool" icon="fas fa-cloud" id="web-app" src="https://local-first-bias-detection.s3.eu-central-1.amazonaws.com/bias-detection.html?lang=en" height="770px" >}}
181+
{{< iframe title="Web app – Unsupervised bias detection tool" icon="fas fa-cloud" id="web-app" src="https://local-only-bias-detection.s3.eu-central-1.amazonaws.com/bias-detection.html?lang=en" height="770px" >}}
164182

165183
<!-- Promo bar -->
166184

@@ -172,7 +190,7 @@ The HBAC algorithm maximizes the difference in the bias metric between clusters.
172190

173191
* The source code of the anolamy detection-algorithm is available on <a href="https://github.com/NGO-Algorithm-Audit/unsupervised-bias-detection" target="_blank">Github</a> and as a <a href="https://pypi.org/project/unsupervised-bias-detection/" target="_blank">pip package</a>: `pip install unsupervised-bias-detection`.
174192

175-
* The architecture to run web apps local-first is also available on <a href="https://github.com/NGO-Algorithm-Audit/local-first-web-tool" target="_blank">Github</a>.
193+
* The architecture to run web apps local-only is also available on <a href="https://github.com/NGO-Algorithm-Audit/local-only-web-tool" target="_blank">Github</a>.
176194

177195
{{< container_close >}}
178196

@@ -186,19 +204,19 @@ The unsupervised bias detection tool has been applied in practice to audit a Dut
186204

187205
{{< container_close >}}
188206

189-
<!-- Local-first architecture -->
207+
<!-- local-only architecture -->
190208

191-
{{< container_open title="Local-first architecture" icon="fas fa-map-pin" id="local-first" >}}
209+
{{< container_open title="local-only architecture" icon="fas fa-map-pin" id="local-only" >}}
192210

193211
<br>
194212

195-
#### What is local-first?
196-
Local-first computing is the opposite of cloud computing: the data is not uploaded to third-parties, such as a cloud providers, but is processed by your own computer. The data attached to the tool therefore doesn't leave your computer or the environment of your organization. The tool is privacy-friendly because the data can be processed within the mandate of your organisation and doesn't need to be shared with new parties. The unsupervised bias detection tool can also be hosted locally within your organization. Instructions, including the source code or the web app, can be found on <a href="https://github.com/NGO-Algorithm-Audit/local-first-web-tool" target="_blank">Github</a>.
213+
#### What is local-only?
214+
local-only computing is the opposite of cloud computing: the data is not uploaded to third-parties, such as a cloud providers, but is processed by your own computer. The data attached to the tool therefore doesn't leave your computer or the environment of your organization. The tool is privacy-friendly because the data can be processed within the mandate of your organisation and doesn't need to be shared with new parties. The unsupervised bias detection tool can also be hosted locally within your organization. Instructions, including the source code or the web app, can be found on <a href="https://github.com/NGO-Algorithm-Audit/local-only-web-tool" target="_blank">Github</a>.
197215

198-
#### Overview of local-first architecture
216+
#### Overview of local-only architecture
199217

200218
<div style="margin-bottom:50px; display: flex; justify-content: center;">
201-
<img src="/images/BDT/local-first EN.png" alt="drawing" width="100%"/>
219+
<img src="/images/BDT/local-only EN.png" alt="drawing" width="100%"/>
202220
</div>
203221

204222
{{< container_close >}}

0 commit comments

Comments
 (0)