<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Almira Pillay on Medium]]></title>
        <description><![CDATA[Stories by Almira Pillay on Medium]]></description>
        <link>https://medium.com/@almira.pillay?source=rss-d813dcdf85a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kFa4tWVbS4Jy1JcIKRcfgg.jpeg</url>
            <title>Stories by Almira Pillay on Medium</title>
            <link>https://medium.com/@almira.pillay?source=rss-d813dcdf85a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:20:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@almira.pillay/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Build a Trustworthy AI System]]></title>
            <link>https://medium.com/sogetiblogsnl/how-to-build-a-trustworthy-ai-system-cdb66b72f8d3?source=rss-d813dcdf85a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdb66b72f8d3</guid>
            <category><![CDATA[bias-in-ai]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[trustworthy-ai]]></category>
            <category><![CDATA[ethics-in-tech]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <dc:creator><![CDATA[Almira Pillay]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 06:56:02 GMT</pubDate>
            <atom:updated>2022-06-30T06:56:02.121Z</atom:updated>
            <content:encoded><![CDATA[<h4>From business specifications to model deployment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*LOkpPk21hR7rpLFUT_rpjw.jpeg" /></figure><blockquote><em>To accelerate the rate of AI adoption amongst the public, corporations must learn to identify and mitigate potential ethical risks effectively. This means it is essential to have a set of best practices in place to guide the development of machine learning solutions to instill trust and integrity among relevant stakeholders and end-users.</em></blockquote><p><em>The original text was published as part of Sogeti’s State of AI Applied to Quality Engineering 2021–22 Report and authored by </em><a href="https://www.linkedin.com/in/almirapillay/"><em>Almira Pillay</em></a><em> &amp; </em><a href="https://www.linkedin.com/in/tijana-nikoli%C4%87-99b059110/"><em>Tijana Nikolic</em></a><em>.</em></p><p>Artificial intelligence (AI) continues to advance and become an industry standard for performing and automating everyday tasks. The barrier to widespread AI development and adoption is no longer the technology itself and the skillset required — it’s the ‘human’ aspect of it all: ethics, morality, transparency, and governance. Corporations must now learn to identify and mitigate potential risks (such as a discriminatory model) effectively to avoid biased, unfair machine learning (ML) models being put into production. Thus, it is crucial to have a quality framework in place to guide the development of ML solutions to instill trust and integrity among relevant stakeholders.</p><p>In the <a href="https://www.sogeti.com/ai-for-qe/section-9-trust-ai/chapter-1/"><em>State of AI applied to Quality Engineering Report</em></a>, Sogeti introduces a Quality AI Framework (QAIF) to test ML and AI algorithms in all phases of the AI development cycle. The framework provides a practical and standardized way of working that outputs trustworthy AI.</p><h3>Testing AI is non-traditional</h3><p>When we look at the combination of AI and quality assurance (QA), there are generally two categories:</p><ul><li>AI applied to QA — leveraging ML and analytical solutions to accelerate the testing &amp; development pipeline.</li><li>QA applied to AI — validating the data, algorithm, outcome, and ethical considerations.</li></ul><p>The latter is what we will focus on in this text.</p><p>In 2019, the EU released a set of <a href="https://digital-strategy.ec.europa.eu/en/library/ethics-guidelines-trustworthy-ai">guidelines</a> to building trustworthy AI that include ethical pillars such as <strong>fairness, transparency, and robustness</strong>, in addition to <strong>accountability, privacy, traceability and lawfulness</strong>. However, a practical implementation of these principles was not included with the guideline. To understand how to create practical ethics tests and quality control checks to test AI, we must first understand how AI is developed and implemented.</p><h3>From idea to operations: understanding the AI lifecycle</h3><p>The process of developing and implementing an AI solution always starts with the business case. A business problem is defined and scoped and then turned into design requirements for data scientists — this is called the <strong>Business Understanding</strong> phase. Next, training and test data are collected in the <strong>Data Understanding phase</strong>. In the <strong>Data Preparation</strong> phase, the data is analyzed, sampled, and pre-processed for the chosen AI model. Then the <strong>Model Development</strong> phase can begin. In this phase, the AI model is trained, tuned, and evaluated. Once the <strong>Model Evaluation</strong> is optimized and meets the business requirements, the model can be tested and <strong>Deployed</strong>. This is when the AI system goes into production and performance is monitored. These are the iterative phases under the Cross-Industry Standard Process for Data Mining (CRISP-DM).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*d2eE9WeHzymxXsvj4njIZA.gif" /><figcaption>CRISP-DM method</figcaption></figure><h3>Testing at each phase of the AI lifecycle</h3><p>Inspired by the CRISP-DM method, designed with <a href="https://medium.com/sogetiblogsnl/mlops-for-those-who-are-serious-about-ai-a415d257cf4e">MLOps principles</a> in mind <em>and</em> governed by EU ethics guidelines; the QAIF is a cohesive, generic framework that can be tailored to any AI solution. It is designed to help product managers and business owners identify and mitigate potential risks at each stage of the AI lifecycle, and to guide data scientists by providing a practical checklist. We add a gate to each phase — just like in traditional software testing — to ensure certain quality control checks are completed. The following paragraphs describe the quality control tests that should be conducted at each phase of the AI lifecycle to ensure quality and ethical adherence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lfeb_xsBfDW3gVyfGPcSuA.png" /><figcaption>QAIF gates overview</figcaption></figure><p>The following gates describe some techniques and best practices for building trustworthy models.</p><p><strong>Business understanding (Gate 1)</strong></p><p>In this phase, the tasks of identifying stakeholders, product requirement specifications, technical design specifications, performance metrics and ethical/legal compliance will be completed and understood for the development process to be initiated. To comply with ethics standards:</p><ul><li>Under the <strong>traceability</strong> principle, lay the foundation for an MLOps based AI project, ensuring model and data version control in subsequent phases. <a href="https://mlflow.org/">MLFlow</a> is a useful package to consider for this principle as it provides support for “packaging data science code in a reusable and reproducible way”.</li><li>Under the <strong>fairness</strong> principle, define fairness metrics and detection methods if the business problem applies to sensitive groups. The <a href="https://github.com/fairlearn/fairlearn">fairlearn</a> package provides support for bias mitigation methods and metrics for a model fairness assessment which can be used in the Model Development phase.</li><li>Under the <strong>privacy</strong> principle, consider the possible ethical breaches before starting the project. Focus on data sources and privacy concerns and enable mitigation methods in the Data Preparation phase.</li></ul><p>After these quality control checks are agreed upon, review best practices and next steps with all the relevant stakeholders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*hsn66oLsv54Fa9QySbng_A.png" /><figcaption>Gate 1 overview &amp; outcome</figcaption></figure><p><strong>Data Understanding (Gate 2)</strong></p><p>This phase brings specifications from the first gate together with domain knowledge and experience, to understand inherent biases, assumptions, and privacy concerns in the collected data.</p><ul><li>Under the <strong>traceability</strong> principle, data version control is considered to set a documented specification, with information on where the data is located, what kind of source it comes from, who are the responsible people, and if there are any privacy or quality concerns. To accomplish this, consider using the <a href="https://dvc.org/doc/api-reference">DVC</a> python package that is built on git version control.</li><li>Under the <strong>fairness</strong> principle, data collection methods are reviewed and checked for data adequacy (e.g. missing data for certain groups) and bias to prepare for deploying specific mitigation techniques in the Data Preparation phase.</li><li>Under the <strong>privacy</strong> principle, focus on assessing the data sources for personally identifiable information (PII) and consider using synthetic data to mitigate GDPR risk. For this, <a href="https://www.sogeti.com/services/artificial-intelligence/artificial-data-amplifier/">the Sogeti Artificial Data Amplifier</a> (ADA) can be used.</li></ul><p>End this phase by completing a data audit on available data sources and corresponding responsibilities of the team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*NkhzXp3_a-ZJSS1OdW96_g.png" /><figcaption>Gate 2 overview &amp; outcome</figcaption></figure><p><strong>Data Preparation (Gate 3)</strong></p><p>The data engineering team, domain experts and model developers play crucial roles in the Data Preparation phase. Tasks like data mining, a data quality assessment with exploratory data analysis (EDA) and training data construction — define this phase’s process.</p><ul><li>under the <strong>traceability</strong> principle, data version control is once again executed, together with setting up a data pipeline to ensure complete transparency into the data preparation steps. As an example, the <a href="https://www.tensorflow.org/guide/data">TensorFlow</a> input pipeline API can be used to “build complex input pipelines from simple, reusable pieces; handle large amounts of data, read from different data formats, and perform complex transformations”.</li><li>Under the <strong>fairness</strong> principle, we deploy bias mitigation methods to ensure our training data is “judgement free” so our model will be as well. We can mitigate this by re-weighting the features of the minority group, oversampling the minority group or under-sampling the majority group. Imputation methods can also be used to reconstruct missing data to ensure the dataset is representative.</li><li>Under the <strong>privacy</strong> principle, we generate synthetic data to mitigate privacy risks or to boost our training data or if insufficient data is flagged as a limitation in the previous phase.</li></ul><p>Provide an EDA report on the training data to a technical auditor for approval before moving to the next phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*GZP1HTpLVa7gbH8QFS72ow.png" /><figcaption>Gate 3 overview &amp; outcome</figcaption></figure><p><strong>Model Development (Gate 4)</strong></p><p>The AI Model Development phase starts with high quality training data. Model developers have the main responsibility in this phase — ensuring that the AI model they are developing is suited for the application and works with the data prepared in phases 2 and 3. To be sure of this, performance metrics are drawn from the model and presented to the stakeholders. Furthermore, we test the model performance and functionality on the most granular level.</p><ul><li>Under the <strong>traceability</strong> and <strong>auditability</strong> principle, use MLFlow for model versioning and log output. Split repositories and pipelines into development, acceptance, and production. Use a git version control system to push a new version of the code to different environments. Add required reviewers in each step to ensure traceability.</li><li>Under the <strong>fairness</strong> principle, assess model adequacy and model bias through adversarial debiasing with generative adversarial networks (GANs), ensuring equal outcomes from all groups. IBM’s <a href="https://github.com/Trusted-AI/AIF360">Trusted AI</a> is a python package that can be used here.</li><li>Under the <strong>robustness</strong> principle, test the model performance on the most granular level and provide the accuracy scores, area under curve, F1 score, confusion matrix, mean square and absolute errors. Extend code coverage by unit testing your code using the python <a href="https://docs.python.org/3/library/unittest.html">unittest</a> framework.</li><li>For the business owners and regulators, interpretability is especially important in understanding what is behind the ‘black-box’ model and prediction. Implementing explainable AI (XAI) techniques like <a href="https://github.com/marcotcr/lime">Lime</a> and <a href="https://github.com/slundberg/shap">SHAP</a> can help to understand model predictions. This adds <strong>transparency</strong> and <strong>interpretability</strong> to the model. XAI aims to mimic model behavior at a global and/or local level to help explain how the model came to its decision. Global explainability means how the model makes predictions over <strong>all</strong> the data, while local explainability gives insight into <strong>one</strong> specific prediction. SHAP (SHapley Additive exPlanations) is a method based on a game theory approach to explain individual predictions. LIME is model-agnostic and provides local model interpretability which means that it modifies a single data sample by tweaking the feature values and observes the resulting impact on the output. The output of both packages is a list of explanations, reflecting the contribution of each feature to the prediction of a data sample. This provides local interpretability, and it also allows to determine which feature changes will have most impact on the prediction.</li></ul><p>Complete this gate by providing a model quality report to a technical reviewer for approval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*qTEVQ4gOApX7COv3XJgPMg.png" /><figcaption>Gate 4 overview &amp; outcome</figcaption></figure><p><strong>Model Evaluation (Gate 5)</strong></p><p>As the model’s already been validated on the most granular level in the previous phase, this gate’s tasks focus on ensuring that the model is transparent and works according to the business ethical considerations set in the Business Understanding phase. Being the most important phase in the QAIF, it ensures that the AI model is fair and understandable. Stakeholders include testers, developers, and the legal team.</p><p>Under the <strong>fairness</strong> principle, assess if the model is biased through metrics like:</p><ul><li><em>Statistical Parity Difference: </em>The difference in the rate of favorable outcomes received by the minority group compared to the majority group.</li><li><em>Equal Opportunity Difference: </em>The difference of true positive rates between minority and majority groups.</li><li><em>Average Odd Difference: </em>The average difference of the false positive rate and true positive rate between minority and majority groups.</li><li><em>Disparate impact: </em>The ratio of the rate of favorable outcomes for minority groups compared to majority groups.</li></ul><p>Under the <strong>robustness</strong> principle, execute user acceptance tests using the XAI outputs that were implemented in the previous phase. Furthermore, execute metamorphic and adversarial tests to ensure the model is robust enough to be deployed. Metamorphic tests aim to assess model impact by transforming the inputs of the model and then testing the model with the augmented inputs. Adversarial testing aims to generate adversarial attacks to stress test the model.</p><p>Provide a test report to a technical reviewer and an auditor for approval before moving to the last gate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*yjiJR-AW7IlO-uvi4LJtuA.png" /><figcaption>Gate 5 overview &amp; outcome</figcaption></figure><p><strong>Model Deployment (Gate 6)</strong></p><p>Once we have a transparent and understandable model, we can enter the final phase with a focus on monitoring, real-world model performance and maintenance.</p><p>To ensure <strong>robustness, fairness and transparency</strong>, a monitoring dashboard should be set up to track model performance in production. The production performance metrics include:</p><ul><li>Model performance metrics stated in the Model Development section.</li><li>Bias metrics stated in the Model Evaluation section.</li><li>Drift detection metrics like concept drift and data drift detection. According to IBM, “Model drift refers to the degradation of model performance due to changes in data and relationships between input and output variables”. This can potentially be a big issue for the model’s performance in production. So, it is crucial to use these metrics as indicators of when the model requires attention like re-training or when the training data should be re-weighted.</li></ul><p>In this final phase, we can confidently check all the quality control boxes and pass through all the gates of development, but that doesn’t necessarily mean we are done with the AI lifecycle. When the model needs to be retrained or adjusted, we can always turn back and revisit any of the phases, as the <strong>AI project life cycle is an iterative process</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*2HasUM3_Nw5kZpUiEl25aw.png" /><figcaption>Gate 6 overview &amp; outcome</figcaption></figure><h3>Putting the QAIF into practice</h3><p>The QAIF does not serve only as a theoretical guide to ensuring a trustworthy and high performing AI solution. Sogeti, together with their partners from the <a href="https://itea4.org/project/ivves.html">ITEA IVVES</a> (Industrial Grade Verification &amp; Validation of Evolving Systems) consortium, have developed practical tools to be used by data scientists along the QAIF gates.</p><p>The ITEA IVVES project focuses specifically on the development of AI approaches for robust and comprehensive, industrial-grade validation of embedded AI — complex, evolving (self-adapting and self-learning) systems in the major industrial domains of Europe. The objective of the IVVES project is to develop cross-domain, quality assurance solutions and methodologies that are dedicated to <em>and </em>based on AI. The expected output are methods, techniques, and tools for validating and verifying evolving systems, as well as a <a href="https://learn.ivves.eu/">platform</a> for experimentation, training, and knowledge transfer.</p><p>The state-of-the-art tools developed within the project allow quality control checks to be automated at every stage of the QAIF and ML development cycle. The tools enable efficient testing and operationalizing of ML, and many of these tools can be deployed as micro-services within the CI pipeline. The consortium partners have provided business cases and data to test the developed tools.</p><p>One of these tools includes the Sogeti built <a href="https://medium.com/sogetiblogsnl/sogetis-data-quality-wrapper-4854c165f44d">Data Quality Wrapper</a> (DQW). The DQW serves as a data quality control check, to be used during the Data Understanding phase. The tool automates the EDA process by assessing tabular, image, audio and text data. The tool uses various statistical methods and NLP techniques to assess quality. Sogeti has also developed CodeAssist, a code assessment tool that predicts the quality of python code, helping to speed up peer reviews and focus unit testing. This can be used during the Model Quality phase.</p><p>Another practical tool includes RISE’s (Research Institute of Sweden) RoCoNas adversarial generator. This tool evaluates the robustness of a neural network by attacking it with generated adversarial examples. This can be used during the Model Evaluation phase to find test scenarios where the model fails. Helsinki University, Techila Technologies and F-secure collaborated on an Inference Scalability tool that can simulate deployment configurations for ML models by evaluating and optimizing inference setup parameters. This can be used in the Model Deployment phase.</p><p>These tools among many others developed as part of the ITEA IVVES project, aid a data scientist in automatically embedding quality, fairness, and transparency into any AI model. The tools also aid a product owner in operationalizing the development of AI. For corporations adopting AI solutions, this should be a <strong>requirement and not a luxury</strong>.</p><p>The QAIF offers a structured and comprehensive way of working to develop and implement high-performing, ethical and quality-assured solutions; helping AI teams to design, develop and operate AI systems that the public can trust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdb66b72f8d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sogetiblogsnl/how-to-build-a-trustworthy-ai-system-cdb66b72f8d3">How to Build a Trustworthy AI System</a> was originally published in <a href="https://medium.com/sogetiblogsnl">Sogeti Data &amp; AI | Netherlands</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Programming ‘Fairness’ into Your Machine Learning Model]]></title>
            <link>https://medium.com/sogetiblogsnl/programming-fairness-into-your-machine-learning-model-a3a5479bfe41?source=rss-d813dcdf85a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3a5479bfe41</guid>
            <category><![CDATA[ethics]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[fairness]]></category>
            <category><![CDATA[bias]]></category>
            <dc:creator><![CDATA[Almira Pillay]]></dc:creator>
            <pubDate>Fri, 30 Jul 2021 09:57:24 GMT</pubDate>
            <atom:updated>2021-07-30T09:57:24.683Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*W8SRUfOGIBR_CmONrywk1g.png" /><figcaption><em>“The amount of work we can automate with AI is vastly larger than before. As leaders, it is incumbent on all of us to make sure we are building a world in which every individual has an opportunity to thrive.” — </em>Andrew Ng, Co-founder and lead of Google Brain</figcaption></figure><p>We’ve all seen the famous <em>What NOT to do </em>example,<em> </em>with <a href="https://www.reuters.com/article/us-amazon-com-jobs-automation-insight/amazon-scraps-secret-ai-recruiting-tool-that-showed-bias-against-women-idUSKCN1MK08G">Amazon’s bias recruiting tool</a>. A project started in 2014 that aimed to automate the hiring process by reviewing resumes with artificial intelligence (AI) algorithms — but resulted in unfair ratings and bias toward women. The problem was that Amazon had used 10 years of historical data that contained a clear bias against women, as the tech industry was largely dominated by men when the data was recorded. That meant that the system learnt that male applicants were preferable. The result? Beside the backlash and reputational damage — Amazon pulled the plug on the tool and dismantled the product team responsible for creating it.</p><p>This is not the only infamous example of AI gone wrong — let’s not forget the <a href="https://www.wired.com/story/are-facebook-ads-discriminatory-its-complicated/">discriminatory Facebook algorithm</a>, the racist <a href="https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism-algorithm">criminal prediction software</a>, and the very <em>non</em> inclusive social networking app, <a href="https://medium.com/the-recode/why-gender-detection-software-is-as-morally-dubious-as-it-is-dangerous-48f7bbbc3c0c">Giggle</a>.</p><p>In the pre-AI world, us humans made those types of decisions in recruiting, advertising, prison sentencing, and profiling. Often these decisions are regulated by laws or organizational values. Today, we are asking machines to make those decisions for us — and that’s all good and well since machine learning (ML) has proven to outperform us in many tasks — but what happens when we use a dataset that contains biases, or when we identify correlations that reinforce existing societal standards that we are trying to change and rectify? Who do we hold responsible for the biased decisions that a computer made but<em> we</em> programmed?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*SuyWHjQqwrs8iEjaXhJ6Kw.png" /></figure><p>Enter the moral and legal grey zone of AI…</p><h3><strong>50 Shades of Grey Areas</strong></h3><p>Let’s talk about the ill-defined space of bias and ethics in AI and how bias enters the algorithm in the first place.</p><p>Bias can stem from unrepresentative and/or incomplete data. This means that the data used to train the AI model is more representative of some groups as opposed to others — consequently the model’s predictions may be worse for the under-represented groups. Implicit human bias can also play a role. Often these biases are deeply embedded in us and can be reinforced and reproduced in computer programs and ML models without the programmer or data scientist’s knowledge.</p><blockquote><em>But what about the rules and regulations?</em></blockquote><p>In 2019 the European Union released their own “<a href="https://digital-strategy.ec.europa.eu/en/library/ethics-guidelines-trustworthy-ai">Ethics Guidelines for Trustworthy AI</a>” which states that AI should be Transparent, Technically Robust, Accountable, Non-discriminatory, Protective of Privacy, Improve Societal Wellbeing and be subject to Human Oversight.<em> </em>As these principles are just a guide and there’s no legal standard or definition of ‘fairness’, these abstract and high-level guidelines don’t really mean much to a data scientist when he/she/they are trying to implement a high performing model that just meets business requirements. The difficult, yet most important task comes in trying to put <em>ethical requirements</em> into practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*GY_WEKt1MLCP0W4o1EZo2A.png" /></figure><p>Well, It’s both — a practical introduction to detecting and mitigating bias.</p><h3><strong>Practice makes perfect</strong></h3><p>To combat ethical risk proactively without sacrificing model performance, we must first define ‘fairness’.</p><blockquote><em>A model is considered ‘fair’ if it gives similar predictions to similar groups or individuals.</em></blockquote><p>In more detail, a model is ‘fair’ if for both groups of the positive outcome, the predictor has equal true positive rates and equal false positive rates for the negative outcomes.</p><p>Next, we can break up our bias detection and mitigation techniques into phases — the same phases that govern the development of an AI model: Data understanding &amp; preparation; model development &amp; post-processing; and model evaluation &amp; auditing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*MlHdDV8yBttt-PQWu_QLEA.png" /><figcaption><em>The AI development lifecycle</em></figcaption></figure><p><strong>1. Data understanding &amp; preparation</strong></p><p>As the famous data science saying goes ‘Garbage in, garbage out’. Effective bias detection starts at the data collection and pre-processing phase. If the data does not reflect the actual distribution of data in real life, a trained ML model will enforce the bias. We can mitigate this by <strong>re-weighting</strong> the features of the minority group, <strong>oversampling</strong> the minority group or <strong>under-sampling</strong> the majority group. Imputation methods can also be used to reconstruct missing data to ensure the dataset is representative.</p><p><strong>2. Model development</strong></p><p>To combat bias during the training phase, a popular technique is to use <strong>adversarial debiasing</strong> with generative adversarial networks (GANs). In this approach, one network tries to predict a specified outcome from a set of features, while the second network tries to predict the protected attribute based on the outcome of the trained model. This technique maximizes accuracy while ensuring a one-way relationship between the protected attribute and prediction — meaning that the protected attribute cannot be deduced based on the prediction. This ensures equal outcomes for both groups.</p><p><strong>3. Post-processing</strong></p><p>We can use a deterministic algorithm like <strong>reject option classification</strong> in the post-processing phase. This can be used to swap outcomes between the favorable and unfavorable group near the decision boundary. A threshold can be specified to swap results so that if a favorable outcome was predicted and the individual is part of the favored group and within the threshold above the decision boundary; they are swapped with an individual from the underrepresented group. This technique aims to provide an equal set of predictions by boosting those of the minority group.</p><p><strong>4. Model evaluation &amp; auditing</strong></p><p>Lastly, we need to evaluate the performance of the above techniques to understand if the model and outcomes are truly ‘fair.’ We can use specific metrics such as:</p><p><em>Statistical Parity Difference: </em>The difference in the rate of favorable outcomes received by the minority group compared to the majority group.</p><p><em>Equal Opportunity Difference: </em>The difference of true positive rates between minority and majority groups.</p><p><em>Average Odd Difference: </em>The average difference of the false positive rate and true positive rate between minority and majority groups.</p><p><em>Disparate impact: </em>The ratio of the rate of favorable outcomes for minority groups compared to majority groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*kO2XRp1BZZSgjPcJXsS_tQ.png" /><figcaption><em>A visual representation of statistical parity difference: Using historic training data, a banking model predicts whether a person’s loan will be approved (a positive outcome) or denied (a negative outcome). Statistically, the model delivers a positive outcome for group B 60% of the time, and a positive outcome for group A 50% of the time . In this case, the statistical parity difference = -10% (50%-60%), suggesting that the model is unfairly biased against group A.</em></figcaption></figure><p>These metrics should be evaluated by the model stakeholders to determine if its results are fair and appropriate for production usage.</p><p>IBM Research has thankfully come up with a solution to combat our ethical AI dilemmas with their open-source <a href="https://github.com/Trusted-AI/AIF360">AI Fairness 360 Toolkit (AIF360</a>) — a very handy python package that includes functions with the aforementioned techniques, as well as many more based on the model use case.</p><h3><strong>Let’s wrap this up</strong></h3><p>The first step in implementing any bias mitigation technique is to understand the <em>causes </em>of bias in AI models, as well as having a full understanding of the context and the applications of the use case. With this understanding we can choose the best approach for rectifying the misrepresentations in our data and/or predictions. With the above methods in mind, we are on track for creating ethical, trustworthy, and inclusive AI.</p><p>At Sogeti we’re all about staying woke and keeping up with the latest ethics mitigation techniques so we can deliver trustworthy and quality solutions to our clients. That is why we have developed the <a href="https://www.sogeti.nl/nieuws/artificial-intelligence/blogs/artificial-intelligence-quality-framework">Quality AI Framework</a> (QAIF).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*MAFqDd9kUIhuM6W8hFZZhg.png" /><figcaption>Sogeti Quality AI Framework (QAIF)</figcaption></figure><p>The QAIF is a practical framework with advanced tools and techniques based on statistics and ML that guides the AI product lifecycle, ensuring quality control and a high-performing solution. The QAIF not only evaluates and addresses data quality &amp; bias, but model quality and validation too, It addresses several use cases for structured &amp; unstructured data. The framework is based on the principles of Accountability, Fairness and Transparency — the trifecta of Trust. After all, if we don’t trust our AI, why would we implement it?</p><p><em>Get in touch with Sogeti for more information on our QAIF or other quality AI solutions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3a5479bfe41" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sogetiblogsnl/programming-fairness-into-your-machine-learning-model-a3a5479bfe41">Programming ‘Fairness’ into Your Machine Learning Model</a> was originally published in <a href="https://medium.com/sogetiblogsnl">Sogeti Data &amp; AI | Netherlands</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>