Matching code and law: achieving algorithmic fairness with optimal transport

  • Meike Zehlike
  • Philipp Hacker
  • Emil WiedemannEmail author


Increasingly, discrimination by algorithms is perceived as a societal and legal problem. As a response, a number of criteria for implementing algorithmic fairness in machine learning have been developed in the literature. This paper proposes the continuous fairness algorithm \((\hbox {CFA}\theta )\) which enables a continuous interpolation between different fairness definitions. More specifically, we make three main contributions to the existing literature. First, our approach allows the decision maker to continuously vary between specific concepts of individual and group fairness. As a consequence, the algorithm enables the decision maker to adopt intermediate “worldviews” on the degree of discrimination encoded in algorithmic processes, adding nuance to the extreme cases of “we’re all equal” and “what you see is what you get” proposed so far in the literature. Second, we use optimal transport theory, and specifically the concept of the barycenter, to maximize decision maker utility under the chosen fairness constraints. Third, the algorithm is able to handle cases of intersectionality, i.e., of multi-dimensional discrimination of certain groups on grounds of several criteria. We discuss three main examples (credit applications; college admissions; insurance contracts) and map out the legal and policy implications of our approach. The explicit formalization of the trade-off between individual and group fairness allows this post-processing approach to be tailored to different situational contexts in which one or the other fairness criterion may take precedence. Finally, we evaluate our model experimentally.


Algorithmic fairness Optimal transport Fair distribution Tradeoff between individual and group fairness Statistical parity 



  1. Agueh M, Carlier G (2011) Barycenters in the Wasserstein space. SIAM J Math Anal 43:904–924MathSciNetzbMATHCrossRefGoogle Scholar
  2. Ambrosio L, Gigli N (2013) A user’s guide to optimal transport. Springer, BerlinCrossRefGoogle Scholar
  3. Ayres I, Siegelmann P (1995) Race and gender discrimination in bargaining for a new car. Am Econ Rev 85:304–321Google Scholar
  4. Barocas S, Selbst A (2016) Big data’s disparate impact. Calif Law Rev 104:671–732Google Scholar
  5. Berk R et al (2018) Fairness in criminal justice risk assessments: the state of the art. Sociol Methods Res 1–42 Google Scholar
  6. Bent J (2019) Is algorithmic affirmative action legal? Georget. Law J (forthcoming). Accessed on 19 June 2019
  7. Binns R (2018) Fairness in machine learning: lessons from political philosophy. J Mach Learn Res 81:1–11Google Scholar
  8. Brenier Y (1987) Décomposition polaire et réarrangement monotone des champs de vecteurs. C R Acad Sci Paris 305:805–808MathSciNetzbMATHGoogle Scholar
  9. Brenier Y (1991) Polar factorization and monotone rearrangement of vector-valued functions. Commun Pure Appl Math 44:375–417MathSciNetzbMATHCrossRefGoogle Scholar
  10. Calders T et al (2013) Controlling attribute effect in linear regression. In: 2013 IEEE 13th international conference on data mining, pp 71–80Google Scholar
  11. Calders T, Verwer S (2010) Three naive Bayes approaches for discrimination-free classification. Data Min Knowl Discov 21:277–292 MathSciNetCrossRefGoogle Scholar
  12. Calders T, Žliobaitė I (2013) Why unbiased computational processes can lead to discriminative decision procedures. In: Custers T et al (eds) Discrimination and privacy in the information society. Springer, Berlin, pp 43–57 CrossRefGoogle Scholar
  13. Calmon F et al (2017) Optimized pre-processing for discrimination prevention. Adv Neural Inf Process Syst 30:3995–4004Google Scholar
  14. Chen D et al (2017) Enhancing transparency and control when drawing data-driven inferences about individuals. Big Data 5:197–212CrossRefGoogle Scholar
  15. Chouldechova A (2017) Fair prediction with disparate impact: a study of bias in recidivism prediction instruments. Big Data 5:153–163CrossRefGoogle Scholar
  16. Chouldechova A, Roth A (2018) The frontiers of fairness in machine learning. arXiv:1810.08810
  17. Craig P, de Búrca G (2011) EU law, 5th edn. Oxford University Press, OxfordGoogle Scholar
  18. Datta A et al (2015) Automated experiments on ad privacy settings. Proc Priv Enhan Technol 1:92–112Google Scholar
  19. del Barrio E et al (2019) Obtaining fairness using optimal transport theory. In: Proceedings of the 36th international conference on machine learning, vol PMLR 97, pp 2357–2365Google Scholar
  20. Dwork C et al (2012) Fairness through awareness. In: Proceedings of the 3rd innovations in theoretical computer science conference, pp 214–226Google Scholar
  21. EEOC (2015) Uniform guidelines on employment selection procedures, 29 C.F.R.§1607Google Scholar
  22. Feldman M et al (2015) Certifying and removing disparate impact. In: Proceedings of the 21th ACM SIGKDD international conference on knowledge discovery and data mining, pp 259–268Google Scholar
  23. Fish B et al (2016) A confidence-based approach for balancing fairness and accuracy. In: Proceedings of the 2016 SIAM international conference on data mining, pp 144–152Google Scholar
  24. Flamary, R, Courty, N (2017) POT python optimal transport library. Accessed 1st July 2019
  25. Friedler S et al (2016) On the (im)possibility of fairness. arXiv:1609.07236
  26. Fukuchi K et al (2015) Prediction with model-based neutrality. IEICE Trans Inf Syst E98–D(8):1503–1516CrossRefGoogle Scholar
  27. Fuster A et al (2018) Predictably unequal? The effects of machine learning on credit markets. Accessed 19 June 2019
  28. German Federal Ministry of Justice (2018) Sachverständigenrat für Verbraucherfragen. Verbrauchergerechtes Scoring, ReportGoogle Scholar
  29. Gillen S et al (2018) Online learning with an unknown fairness metric. Adv Neural Inf Process Syst 32:2600–2609Google Scholar
  30. Guan L et al (2016) From physical to cyber: escalating protection for personalized auto insurance. In: Proceedings of the 14th ACM conference on embedded network sensor systems, pp 42–55Google Scholar
  31. Hacker Ph (2017) Personal data, exploitative contracts, and algorithmic fairness: autonomous vehicles meet the internet of things. Int Data Priv Law 7:266–286CrossRefGoogle Scholar
  32. Hacker Ph (2018) Teaching fairness to artificial intelligence: existing and novel strategies against algorithmic discrimination under EU law. Common Mark Law Rev 55:1143–1186Google Scholar
  33. Hardt M et al (2016) Equality of opportunity in supervised learning. Adv Neural Inf Process Syst 29:3315–3323MathSciNetGoogle Scholar
  34. Hurley M, Adebayo J (2016) Credit scoring in the era of big data. Yale JL Tech 18:148–216Google Scholar
  35. Järvelin K, Kekäläinen J (2002) Cumulated gain-based evaluation of IR techniques. ACM Trans Inf Syst 20:422–446CrossRefGoogle Scholar
  36. Johndrow J, Lum K (2019) An algorithm for removing sensitive information: application to race-independent recidivism prediction. Ann Appl Stat 13:189–220MathSciNetzbMATHCrossRefGoogle Scholar
  37. Joseph M et al (2016) Fairness in learning: classic and contextual bandits. Adv Neural Inf Process Syst 29:325–333Google Scholar
  38. Kamishima T et al (2018) Recommendation independence. Proc Mach Learn Res 81:1–15Google Scholar
  39. Kim P (2017) Auditing algorithms for discrimination. Univ PA Law Rev Online 166:189–203Google Scholar
  40. Kleinberg J et al (2016) Inherent trade-offs in the fair determination of risk scores. arXiv:1609.05807
  41. Kleinberg J et al (2018) Algorithmic fairness. In: AEA papers and proceedings, vol 108, pp 22–27CrossRefGoogle Scholar
  42. Kroll JA et al (2017) Accountable algorithms. Univ Pa Law Rev 165:633–705Google Scholar
  43. Lowry S, Macpherson G (1988) A blot on the profession. Br Med J 296:657–658CrossRefGoogle Scholar
  44. Malamud D (2015) The strange persistence of affirmative action under title VII. West Va Law Rev 118:1–22Google Scholar
  45. Moses M (2016) Living with moral disagreement: the enduring controversy about affirmative action. University of Chicago Press, ChicagoCrossRefGoogle Scholar
  46. Naibandian J (2010) The US Supreme Court’s “consensus” on affirmative action. In: Broadnax W (ed) Diversity and affirmative action in public service. Westview Press, Boulder, pp 111–125Google Scholar
  47. Pasquale F (2015) The black box society. The secret algorithms. That control money and information. Harvard University Press, CambridgeCrossRefGoogle Scholar
  48. Pérez-Suay A et al (2017) Fair kernel learning. In: Joint European conference on machine learning and knowledge discovery in databases. Springer, Cham, pp 339–355CrossRefGoogle Scholar
  49. Poueymirou M (2017) Schuette v. coalition to defend affirmative action and the death of the political process doctrine. UC Irvine Law Rev 7:167–194Google Scholar
  50. Qin T (2010) LETOR: a benchmark collection for research on learning to rank for information retrieval. Inf Retr 13:346–374CrossRefGoogle Scholar
  51. Reed Ch et al (2016) Responsibility, autonomy and accountability: legal liability for machine learning. Queen Mary School of Law Legal Studies Research Paper No. 243/2016, Accessed 19 June 2019
  52. Reuters (2018) Amazon ditched AI recruiting tool that favored men for technical jobs, The Guardian (11 October 2018). Accessed 19 June 2019
  53. Robinson K (2016) Fisher’s cautionary tale and the urgent need for equal access to an excellent education. Harv Law Rev 130:185–240Google Scholar
  54. Romei A, Ruggieri S (2014) A multidisciplinary survey on discrimination analysis. Knowl Eng Rev 29:582–638CrossRefGoogle Scholar
  55. Rothmann R et al (2014) Credit Scoring in Oesterreich, Report of the Austrian Academy of SciencesGoogle Scholar
  56. Selbst A (2017) Disparate impact in big data policing. Georg Law Rev 52:109–195Google Scholar
  57. Sullivan C (2005) Disparate impact: looking past the desert palace mirage. William Mary Law Rev 47:911–1002Google Scholar
  58. Tobler C (2005) Indirect discrimination. Intersentia, CambridgeGoogle Scholar
  59. Tobler Ch (2011) Case C-236/09, Association belge des Consommateurs Test-Achats ASBL, Yann van Vugt, Charles Basselier v. Conseil des ministres, Judgment of the Court of Justice (Grand Chamber) of 1 March 2011. Common Mark Law Rev 48:2041–2060Google Scholar
  60. Tutt A (2017) An FDA for algorithms. Adm Law Rev 69:83–125Google Scholar
  61. Veale M, Binns R (2017) Fairer machine learning in the real world: mitigating discrimination without collecting sensitive data. Big Data Soc July–December:1–17 Google Scholar
  62. Wachter S et al (2017) Why a right to explanation of automated decision-making does not exist in the general data protection regulation. Int Data Priv Law 7:76–99CrossRefGoogle Scholar
  63. Waddington L, Bell M (2001) More equal than others: distinguishing European Union equality directives. Common Mark Law Rev 38:587–611CrossRefGoogle Scholar
  64. Wightman L (1998) LSAC national longitudinal bar passage study, LSAC research report seriesGoogle Scholar
  65. Yang K et al (2018) A nutritional label for rankings. In: Proceedings of the 2018 international conference on management of data, vol 18, pp 1773–1776Google Scholar
  66. Zafar M et al (2017) Fairness constraints: mechanisms for fair classification. Artif Intell Stat 20:962–970Google Scholar
  67. Zehlike M et al (2017) FA*IR: a fair top-k ranking algorithm. In: 26th ACM international conference on information and knowledge management, pp 1569–1578Google Scholar
  68. Zemel R et al (2013) Learning fair representations. In: Proceedings of the 30th international conference on machine learning, pp 325–333Google Scholar
  69. Žliobaitė I (2015) On the relation between accuracy and fairness in binary classification. FATML 2015Google Scholar
  70. Žliobaitė I (2017) Measuring discrimination in algorithmic decision making. Data Min Knowl Discov 31:1060–1089MathSciNetCrossRefGoogle Scholar

Copyright information

© The Author(s), under exclusive licence to Springer Science+Business Media LLC, part of Springer Nature 2019

Authors and Affiliations

  • Meike Zehlike
    • 1
  • Philipp Hacker
    • 2
    • 3
    • 4
  • Emil Wiedemann
    • 5
    Email author
  1. 1.Max Planck Institute for Software SystemsSaarbrückenGermany
  2. 2.Law Humboldt University of BerlinBerlinGermany
  3. 3.WZB Berlin Social Science CenterBerlinGermany
  4. 4.Centre for Law, Economics and Society, Centre for Blockchain TechnologiesUCLLondonUK
  5. 5.Institute of Applied AnalysisUlm UniversityUlmGermany

Personalised recommendations