Bias Detection and Measurement
Key points
- Bias is systematic inequity in AI outputs, usually unintentional, arising from data patterns, design choices, or organisational processes
- Three bias sources: data bias (historical discrimination), algorithmic bias (design and optimisation choices), process bias (human and organisational decisions)
- Statistical parity: equal positive outcome rates; simple but ignores base rate differences
- Equalized odds: equal accuracy across groups (same TPR and FPR); stronger but needs ground truth labels
- Calibration: predictions match reality within each group; critical for risk assessment systems
- Individual fairness: similar individuals get similar predictions; challenge is defining 'similar'
- Impossibility results: demographic parity, equalized odds, and calibration cannot all hold simultaneously — governance must choose priorities
- Bias detection at three stages: pre-training data audit, during-development fairness testing, post-deployment ongoing monitoring with disparate impact analysis
Bias Detection and Measurement
Systematic bias detection is essential for fair AI systems. The AIGP exam expects candidates to understand what bias is, where it comes from, how to measure it, and what tools are available to detect it throughout the AI lifecycle.
Understanding Bias
What is Bias?
In the AI governance context, bias refers to systematic errors in an AI system's outputs that treat different groups of people inequitably. Bias is not always intentional; in fact, most AI bias is unintentional, arising from patterns in training data, design choices, or the way algorithms optimise their objectives. Bias is not an abstract concept. It produces real-world consequences: qualified applicants denied jobs, creditworthy individuals denied loans, innocent people flagged as suspects, patients receiving inappropriate treatment recommendations.
Sources of Bias
Bias can enter an AI system at multiple points. Data bias reflects historical discrimination embedded in the data the model learns from. If a model is trained on historical lending data from a period when certain groups were systematically denied credit, it will learn to replicate those discriminatory patterns. Algorithmic bias arises from design choices: the features selected as inputs, the assumptions embedded in the model architecture, the optimisation objective the model is trained to pursue, and the way the model is implemented. For example, optimising purely for accuracy may lead the model to perform well on the majority group at the expense of minority groups. Process bias comes from the human and organisational factors surrounding the AI system: who decides what problems to solve with AI, who labels the training data, who sets the performance thresholds, and whose concerns are heard during development. Bias in any of these decisions can propagate through the system.
Bias Metrics in Detail
Statistical Parity (Demographic Parity)
Statistical parity requires that the positive outcome rate be equal across groups. Formally, the probability of receiving a positive prediction should be the same regardless of group membership. In a hiring context, this means the selection rate for women should equal the selection rate for men. The strength of this metric is its simplicity and intuitive fairness. Its limitation is that it does not account for different base rates between groups. If two groups genuinely differ in the qualification being measured (for legitimate, non-discriminatory reasons), enforcing statistical parity may require selecting less-qualified candidates from one group while rejecting more-qualified candidates from another.
Equalized Odds
Equalized odds requires that the true positive rate and false positive rate be equal across groups. This means the model is equally accurate for all groups: it catches the same proportion of true positives and makes the same proportion of false positive errors regardless of group membership. This metric is stronger than demographic parity because it accounts for the actual qualifications of individuals. However, it requires access to ground truth labels, which are not always available or reliable.
Predictive Parity
Predictive parity requires that the precision (positive predictive value) be equal across groups. Among all individuals given a positive prediction, the proportion who truly deserve that prediction should be the same regardless of group. This metric is relevant in contexts like loan approval, where you want the default rate among approved borrowers to be the same across groups. Its limitation is that achieving predictive parity while also achieving equalized odds is generally impossible (the Choquet impossibility result).
Calibration
Calibration requires that predictions match reality within each group. If the model predicts a 70% probability of loan repayment for individuals in Group A, approximately 70% of those individuals should actually repay. The same should hold for Group B. Calibration is particularly important for risk assessment systems where the predicted probability is used directly in decision-making. A miscalibrated model might be well-calibrated overall but systematically overestimate risk for one group and underestimate it for another.
Individual Fairness
Individual fairness requires that similar individuals receive similar predictions regardless of group membership. Two people with the same qualifications, income, and credit history should receive the same credit decision, even if they belong to different demographic groups. The challenge is defining "similar": similarity in what dimensions, measured how, and with what tolerances? Defining an appropriate similarity metric is itself a governance decision that requires domain expertise and stakeholder input.
Impossibility Results
A critical insight for governance professionals is that these fairness metrics cannot all be satisfied simultaneously. Except in trivial cases, achieving demographic parity, equalized odds, and calibration at the same time is mathematically impossible. This means organisations must make deliberate choices about which fairness definition to prioritise, informed by the context of use, the stakeholders affected, and the potential consequences of different types of errors.
Bias Detection Methods
Pre-training Analysis
Before any model is built, the training data itself should be audited for bias. Data audits examine whether all relevant demographic groups are adequately represented, whether label distributions differ across groups (which might indicate historical bias), whether features correlate with protected attributes (indicating proxy variables), and whether there are systematic patterns of missing data that could disadvantage certain groups. Exploratory data analysis techniques such as comparing feature distributions across groups, visualising outcome patterns, and computing correlation matrices can reveal biases that would otherwise be invisible.
During Development
During model training and evaluation, fairness-aware development practices help detect and address bias before deployment. This includes testing the model's performance on each demographic subgroup separately (not just overall), comparing fairness metrics across groups at each stage of development, using fairness-aware algorithms that explicitly incorporate fairness constraints, and benchmarking against fairness baselines established at the start of the project.
Post-deployment Monitoring
After deployment, bias detection shifts to ongoing monitoring. This involves tracking outcome rates by demographic group over time, monitoring fairness metrics for drift (disparities that emerge or worsen), conducting regular disparate impact analysis (including the four-fifths or 80% rule used in US employment discrimination law, where a selection rate for a protected group that is less than 80% of the highest group's rate creates a presumption of adverse impact), and analysing user complaints and appeals for patterns that may indicate bias.
Tools and Frameworks
Several open-source fairness toolkits support bias detection and measurement. IBM's AI Fairness 360 provides a comprehensive set of fairness metrics, bias detection algorithms, and bias mitigation techniques. Microsoft's Fairlearn focuses on assessing and improving the fairness of AI systems, with tools for both measurement and mitigation. Google's What-If Tool provides an interactive visual interface for exploring model performance across subgroups. Aequitas from the University of Chicago provides an open-source bias audit toolkit designed for decision-making systems in the public sector.
These tools are valuable but insufficient on their own. Bias detection requires human judgment about which metrics matter, what thresholds are acceptable, and how to balance competing fairness definitions. Tools measure; governance professionals decide what the measurements mean and what actions to take.