6.15 Machine Learning development process | Fairness, bias, and ethics -[Machine Learning|Andrew Ng]
 Machine learning algorithms today are affecting billions of people. You've heard me mention ethics in other videos before, and I hope that if you're building a machine learning system that affects people, that you give some thought to making sure that your system is reasonably fair, reasonably free from bias, and that you're taking an ethical approach to your application. Let's take a look at some issues related to fairness, bias, and ethics. Unfortunately, in the history of machine learning, there have been a few systems, some widely publicized, that turned out to exhibit a completely unacceptable level of bias. For example, there was a hiring tool that was once shown to discriminate against women. The company that built the system stopped using it, but one wishes that this system had never been rolled out in the first place. Or there was also a well-documented example of face recognition systems that matched dark-skinned individuals to criminal mugshots much more often than lighter-skinned individuals. And clearly, this is not acceptable, and we should get better at the community at just not building and deploying systems with a problem like this in the first place. There have been systems that gave bank loan approvals in a way that was biased and discriminated against subgroups, and we also really like learning algorithms to not have the toxic effect of reinforcing negative stereotypes. For example, I have a daughter, and if she searches online for certain professions and doesn't see anyone that looks like her, I would hate for that to discourage her from taking on certain professions. In addition to the issues of bias and fair treatment of individuals, there have also been adverse use cases or negative use cases of machine learning algorithms. For example, there was this widely cited and widely viewed video released with full disclosure and full transparency by the company BuzzFeed of a deep fake of former US President Barack Obama. And you can actually find and watch the whole video online if you want. But the company that created this video did so with full transparency and full disclosure. But clearly using this technology to generate fake videos without consent and without disclosure would be unethical. We've also seen, unfortunately, social media sometimes spreading toxic or incendiary speech because optimizing for user engagements has led to algorithms doing so. There have been bots that were used to generate fake content for either commercial purposes, such as posting fake comments on products, or for political purposes. And there are users of machine learning to build harmful products, commit fraud, and so on. And in parts of the machine learning world, just as in email, there has been a battle between the spammers and the anti-spam community. I am seeing today in, for example, the financial industry, a battle between people trying to commit fraud and the people fighting fraud. And unfortunately, machine learning is used by some of the fraudsters and some of the spammers. So for goodness sakes, please don't build a machine learning system that has a negative impact on society. And if you are asked to work on an application that you consider unethical, I urge you to walk away. For what it's worth, there have been multiple times that I have looked at a project that seemed to be financially sound, you know, make money for some company, but I have killed the project just on ethical grounds. Because I think that even though the financial case was sound, I felt that it makes the world worse off. And I just don't ever want to be involved in a project like that. Ethics is a very complicated and very rich subject that humanity has studied for at least a few thousand years. When AI became more widespread, I actually went and read up multiple books on philosophy and multiple books on ethics, because I was hoping, naively it turned out, to come up with if only there's a checklist of five things we could do. And so once we do these five things, then we can be ethical. But I failed, and I don't think anyone has ever managed to come up with a simple checklist of things to do to give that level of concrete guidance about how to be ethical. So what I hope to share with you instead is not a checklist, because I wasn't able to come up with one, but just some general guidance and some suggestions for how to make sure that work is less biased, more fair, and more ethical. And I hope that some of these guidance, which would be relatively general, will help you with your work as well. So here are some suggestions for making your work more fair, less biased, and more ethical. Before deploying a system that could create harm, I will usually try to assemble a diverse team to brainstorm possible things that might go wrong with an emphasis on possible harm to vulnerable groups. I found many times in my life that having a more diverse team, and by diverse I mean diversity on multiple dimensions, ranging from gender to ethnicity to culture to many other traits. I found that having more diverse teams actually causes a team collectively to be better at coming up with ideas about things that might go wrong. And it increases the odds that we'll recognize a problem and fix it before rolling out the system and having that cause harm to some particular group. In addition to having a diverse team carry out brainstorming, I've also found it useful to carry out a literature search on any standards or guidelines for your industry or particular application area. For example, in the financial industry, there are starting to be established standards for what it means to be a system, say one that decides who to approve loans to. And it means for a system like that to be reasonably fair and free from bias and those standards that are still emerging in different sectors could inform your work, depending on what you're working on. After identifying possible problems, I found it useful to then audit the system against these identified dimensions of possible harm prior to deployment. You saw in the last video, the full cycle of machine learning project. And one key step that's often a crucial line of defense against deploying something problematic is after you've trained a model, but before you deploy it in production, if the team has brainstormed that it may be biased against certain subgroups, such as certain genders or certain ethnicities, you can then audit the system to measure the performance to see if it really is biased against certain genders or ethnicities or other subgroups and to make sure that any problems are identified and fixed prior to deployment. Finally, I found it useful to develop a mitigation plan if applicable. And one simple mitigation plan would be a rollback to the earlier system that we knew was reasonably fair. And then even after deployment, to continue to monitor harm so that you can then trigger a mitigation plan and act quickly in case there is a problem that needs to be addressed. For example, all of the self-driving car teams prior to rolling out self-driving cars on the road had developed mitigation plans for what to do in case the car ever gets involved in an accident so that if the car was ever in an accident, there was already a mitigation plan that they could execute immediately rather than have a car get into an accident and then only scramble after the fact to figure out what to do. I've worked on many machine learning systems and let me tell you the issues of ethics, fairness and bias are issues we should take seriously. It's not something to brush off. It's not something to take lightly. Now of course, there are some projects with more serious ethical implications than others. For example, if I'm building a neural network to decide how long to roast my coffee beans, clearly the ethical implications of that seem significantly less than if say you are building a system to decide what bank loans to approve, which if it's biased can cause significant harm. But I hope that all of us collectively working in machine learning can keep on getting better, debate these issues, spot problems, fix them before they cause harm so that we collectively can avoid some of the mistakes that the machine learning world had made before because this stuff matters and the systems we build can affect a lot of people. And so that's it on the process of developing a machine learning system and congratulations on getting to the end of this week's required videos. I have just two more optional videos this week for you on addressing skewed data sets. And that means data sets where the ratio of positive to negative examples is very far from 50-50. And it turns out that some special techniques are needed to address machine learning applications like that. So I hope to see you in the next video, optional video, on how to handle skewed data sets.
[{"start": 0.0, "end": 6.640000000000001, "text": " Machine learning algorithms today are affecting billions of people."}, {"start": 6.640000000000001, "end": 11.94, "text": " You've heard me mention ethics in other videos before, and I hope that if you're building"}, {"start": 11.94, "end": 17.240000000000002, "text": " a machine learning system that affects people, that you give some thought to making sure"}, {"start": 17.240000000000002, "end": 23.76, "text": " that your system is reasonably fair, reasonably free from bias, and that you're taking an"}, {"start": 23.76, "end": 27.240000000000002, "text": " ethical approach to your application."}, {"start": 27.24, "end": 32.32, "text": " Let's take a look at some issues related to fairness, bias, and ethics."}, {"start": 32.32, "end": 37.48, "text": " Unfortunately, in the history of machine learning, there have been a few systems, some widely"}, {"start": 37.48, "end": 44.2, "text": " publicized, that turned out to exhibit a completely unacceptable level of bias."}, {"start": 44.2, "end": 49.36, "text": " For example, there was a hiring tool that was once shown to discriminate against women."}, {"start": 49.36, "end": 54.92, "text": " The company that built the system stopped using it, but one wishes that this system"}, {"start": 54.92, "end": 57.64, "text": " had never been rolled out in the first place."}, {"start": 57.64, "end": 63.96, "text": " Or there was also a well-documented example of face recognition systems that matched dark-skinned"}, {"start": 63.96, "end": 69.52, "text": " individuals to criminal mugshots much more often than lighter-skinned individuals."}, {"start": 69.52, "end": 74.88, "text": " And clearly, this is not acceptable, and we should get better at the community at just"}, {"start": 74.88, "end": 78.8, "text": " not building and deploying systems with a problem like this in the first place."}, {"start": 78.8, "end": 84.88, "text": " There have been systems that gave bank loan approvals in a way that was biased and discriminated"}, {"start": 84.88, "end": 91.39999999999999, "text": " against subgroups, and we also really like learning algorithms to not have the toxic effect"}, {"start": 91.39999999999999, "end": 94.28, "text": " of reinforcing negative stereotypes."}, {"start": 94.28, "end": 99.56, "text": " For example, I have a daughter, and if she searches online for certain professions and"}, {"start": 99.56, "end": 104.24, "text": " doesn't see anyone that looks like her, I would hate for that to discourage her from"}, {"start": 104.24, "end": 106.3, "text": " taking on certain professions."}, {"start": 106.3, "end": 113.19999999999999, "text": " In addition to the issues of bias and fair treatment of individuals, there have also"}, {"start": 113.2, "end": 118.96000000000001, "text": " been adverse use cases or negative use cases of machine learning algorithms."}, {"start": 118.96000000000001, "end": 125.8, "text": " For example, there was this widely cited and widely viewed video released with full disclosure"}, {"start": 125.8, "end": 133.68, "text": " and full transparency by the company BuzzFeed of a deep fake of former US President Barack"}, {"start": 133.68, "end": 134.68, "text": " Obama."}, {"start": 134.68, "end": 138.92000000000002, "text": " And you can actually find and watch the whole video online if you want."}, {"start": 138.92, "end": 145.04, "text": " But the company that created this video did so with full transparency and full disclosure."}, {"start": 145.04, "end": 152.35999999999999, "text": " But clearly using this technology to generate fake videos without consent and without disclosure"}, {"start": 152.35999999999999, "end": 153.95999999999998, "text": " would be unethical."}, {"start": 153.95999999999998, "end": 162.67999999999998, "text": " We've also seen, unfortunately, social media sometimes spreading toxic or incendiary speech"}, {"start": 162.67999999999998, "end": 167.39999999999998, "text": " because optimizing for user engagements has led to algorithms doing so."}, {"start": 167.4, "end": 174.96, "text": " There have been bots that were used to generate fake content for either commercial purposes,"}, {"start": 174.96, "end": 181.48000000000002, "text": " such as posting fake comments on products, or for political purposes."}, {"start": 181.48000000000002, "end": 186.56, "text": " And there are users of machine learning to build harmful products, commit fraud, and"}, {"start": 186.56, "end": 188.04000000000002, "text": " so on."}, {"start": 188.04000000000002, "end": 193.6, "text": " And in parts of the machine learning world, just as in email, there has been a battle"}, {"start": 193.6, "end": 197.6, "text": " between the spammers and the anti-spam community."}, {"start": 197.6, "end": 205.04, "text": " I am seeing today in, for example, the financial industry, a battle between people trying to"}, {"start": 205.04, "end": 209.32, "text": " commit fraud and the people fighting fraud."}, {"start": 209.32, "end": 215.07999999999998, "text": " And unfortunately, machine learning is used by some of the fraudsters and some of the"}, {"start": 215.07999999999998, "end": 216.07999999999998, "text": " spammers."}, {"start": 216.07999999999998, "end": 220.76, "text": " So for goodness sakes, please don't build a machine learning system that has a negative"}, {"start": 220.76, "end": 222.95999999999998, "text": " impact on society."}, {"start": 222.96, "end": 230.20000000000002, "text": " And if you are asked to work on an application that you consider unethical, I urge you to"}, {"start": 230.20000000000002, "end": 231.44, "text": " walk away."}, {"start": 231.44, "end": 235.36, "text": " For what it's worth, there have been multiple times that I have looked at a project that"}, {"start": 235.36, "end": 240.0, "text": " seemed to be financially sound, you know, make money for some company, but I have killed"}, {"start": 240.0, "end": 242.36, "text": " the project just on ethical grounds."}, {"start": 242.36, "end": 247.0, "text": " Because I think that even though the financial case was sound, I felt that it makes the world"}, {"start": 247.0, "end": 248.0, "text": " worse off."}, {"start": 248.0, "end": 252.44, "text": " And I just don't ever want to be involved in a project like that."}, {"start": 252.44, "end": 257.28, "text": " Ethics is a very complicated and very rich subject that humanity has studied for at least"}, {"start": 257.28, "end": 259.36, "text": " a few thousand years."}, {"start": 259.36, "end": 265.92, "text": " When AI became more widespread, I actually went and read up multiple books on philosophy"}, {"start": 265.92, "end": 271.04, "text": " and multiple books on ethics, because I was hoping, naively it turned out, to come up"}, {"start": 271.04, "end": 274.24, "text": " with if only there's a checklist of five things we could do."}, {"start": 274.24, "end": 277.84, "text": " And so once we do these five things, then we can be ethical."}, {"start": 277.84, "end": 282.59999999999997, "text": " But I failed, and I don't think anyone has ever managed to come up with a simple checklist"}, {"start": 282.59999999999997, "end": 288.0, "text": " of things to do to give that level of concrete guidance about how to be ethical."}, {"start": 288.0, "end": 293.0, "text": " So what I hope to share with you instead is not a checklist, because I wasn't able to"}, {"start": 293.0, "end": 298.28, "text": " come up with one, but just some general guidance and some suggestions for how to make sure"}, {"start": 298.28, "end": 301.84, "text": " that work is less biased, more fair, and more ethical."}, {"start": 301.84, "end": 307.52, "text": " And I hope that some of these guidance, which would be relatively general, will help you"}, {"start": 307.52, "end": 309.0, "text": " with your work as well."}, {"start": 309.0, "end": 317.47999999999996, "text": " So here are some suggestions for making your work more fair, less biased, and more ethical."}, {"start": 317.47999999999996, "end": 324.56, "text": " Before deploying a system that could create harm, I will usually try to assemble a diverse"}, {"start": 324.56, "end": 331.34, "text": " team to brainstorm possible things that might go wrong with an emphasis on possible harm"}, {"start": 331.34, "end": 333.79999999999995, "text": " to vulnerable groups."}, {"start": 333.8, "end": 339.08, "text": " I found many times in my life that having a more diverse team, and by diverse I mean"}, {"start": 339.08, "end": 344.62, "text": " diversity on multiple dimensions, ranging from gender to ethnicity to culture to many"}, {"start": 344.62, "end": 346.64, "text": " other traits."}, {"start": 346.64, "end": 352.28000000000003, "text": " I found that having more diverse teams actually causes a team collectively to be better at"}, {"start": 352.28000000000003, "end": 355.84000000000003, "text": " coming up with ideas about things that might go wrong."}, {"start": 355.84000000000003, "end": 361.72, "text": " And it increases the odds that we'll recognize a problem and fix it before rolling out the"}, {"start": 361.72, "end": 366.64000000000004, "text": " system and having that cause harm to some particular group."}, {"start": 366.64000000000004, "end": 371.68, "text": " In addition to having a diverse team carry out brainstorming, I've also found it useful"}, {"start": 371.68, "end": 377.52000000000004, "text": " to carry out a literature search on any standards or guidelines for your industry or particular"}, {"start": 377.52000000000004, "end": 379.64000000000004, "text": " application area."}, {"start": 379.64000000000004, "end": 385.48, "text": " For example, in the financial industry, there are starting to be established standards for"}, {"start": 385.48, "end": 390.40000000000003, "text": " what it means to be a system, say one that decides who to approve loans to."}, {"start": 390.4, "end": 394.76, "text": " And it means for a system like that to be reasonably fair and free from bias and those"}, {"start": 394.76, "end": 399.59999999999997, "text": " standards that are still emerging in different sectors could inform your work, depending"}, {"start": 399.59999999999997, "end": 401.71999999999997, "text": " on what you're working on."}, {"start": 401.71999999999997, "end": 410.15999999999997, "text": " After identifying possible problems, I found it useful to then audit the system against"}, {"start": 410.15999999999997, "end": 415.88, "text": " these identified dimensions of possible harm prior to deployment."}, {"start": 415.88, "end": 421.2, "text": " You saw in the last video, the full cycle of machine learning project."}, {"start": 421.2, "end": 426.04, "text": " And one key step that's often a crucial line of defense against deploying something problematic"}, {"start": 426.04, "end": 431.6, "text": " is after you've trained a model, but before you deploy it in production, if the team has"}, {"start": 431.6, "end": 435.96, "text": " brainstormed that it may be biased against certain subgroups, such as certain genders"}, {"start": 435.96, "end": 441.8, "text": " or certain ethnicities, you can then audit the system to measure the performance to see"}, {"start": 441.8, "end": 447.68, "text": " if it really is biased against certain genders or ethnicities or other subgroups and to make"}, {"start": 447.68, "end": 453.6, "text": " sure that any problems are identified and fixed prior to deployment."}, {"start": 453.6, "end": 459.92, "text": " Finally, I found it useful to develop a mitigation plan if applicable."}, {"start": 459.92, "end": 464.64, "text": " And one simple mitigation plan would be a rollback to the earlier system that we knew"}, {"start": 464.64, "end": 466.62, "text": " was reasonably fair."}, {"start": 466.62, "end": 471.46000000000004, "text": " And then even after deployment, to continue to monitor harm so that you can then trigger"}, {"start": 471.46, "end": 477.32, "text": " a mitigation plan and act quickly in case there is a problem that needs to be addressed."}, {"start": 477.32, "end": 483.56, "text": " For example, all of the self-driving car teams prior to rolling out self-driving cars on"}, {"start": 483.56, "end": 488.91999999999996, "text": " the road had developed mitigation plans for what to do in case the car ever gets involved"}, {"start": 488.91999999999996, "end": 494.47999999999996, "text": " in an accident so that if the car was ever in an accident, there was already a mitigation"}, {"start": 494.47999999999996, "end": 499.32, "text": " plan that they could execute immediately rather than have a car get into an accident and then"}, {"start": 499.32, "end": 502.12, "text": " only scramble after the fact to figure out what to do."}, {"start": 502.12, "end": 507.88, "text": " I've worked on many machine learning systems and let me tell you the issues of ethics,"}, {"start": 507.88, "end": 510.92, "text": " fairness and bias are issues we should take seriously."}, {"start": 510.92, "end": 512.4, "text": " It's not something to brush off."}, {"start": 512.4, "end": 515.04, "text": " It's not something to take lightly."}, {"start": 515.04, "end": 520.76, "text": " Now of course, there are some projects with more serious ethical implications than others."}, {"start": 520.76, "end": 525.64, "text": " For example, if I'm building a neural network to decide how long to roast my coffee beans,"}, {"start": 525.64, "end": 530.92, "text": " clearly the ethical implications of that seem significantly less than if say you are building"}, {"start": 530.92, "end": 536.96, "text": " a system to decide what bank loans to approve, which if it's biased can cause significant"}, {"start": 536.96, "end": 537.96, "text": " harm."}, {"start": 537.96, "end": 544.1999999999999, "text": " But I hope that all of us collectively working in machine learning can keep on getting better,"}, {"start": 544.1999999999999, "end": 549.6, "text": " debate these issues, spot problems, fix them before they cause harm so that we collectively"}, {"start": 549.6, "end": 554.36, "text": " can avoid some of the mistakes that the machine learning world had made before because this"}, {"start": 554.36, "end": 559.16, "text": " stuff matters and the systems we build can affect a lot of people."}, {"start": 559.16, "end": 566.12, "text": " And so that's it on the process of developing a machine learning system and congratulations"}, {"start": 566.12, "end": 570.0600000000001, "text": " on getting to the end of this week's required videos."}, {"start": 570.0600000000001, "end": 576.48, "text": " I have just two more optional videos this week for you on addressing skewed data sets."}, {"start": 576.48, "end": 581.72, "text": " And that means data sets where the ratio of positive to negative examples is very far"}, {"start": 581.72, "end": 582.72, "text": " from 50-50."}, {"start": 582.72, "end": 588.08, "text": " And it turns out that some special techniques are needed to address machine learning applications"}, {"start": 588.08, "end": 589.08, "text": " like that."}, {"start": 589.08, "end": 616.08, "text": " So I hope to see you in the next video, optional video, on how to handle skewed data sets."}]