공정성: 편향 식별
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모델 학습 및 평가를 위해 데이터를 준비할 때는 공정성 문제를 염두에 두고 잠재적인 편향의 원인을 감사하여 모델을 프로덕션에 출시하기 전에 그 영향을 사전에 완화할 수 있도록 하는 것이 중요합니다.
편향이 발생할 수 있는 위치는 어디인가요? 다음은 데이터 세트에서 주의해야 할 위험 신호입니다.
누락된 특성 값
데이터 세트의 다수의 예에서 값이 누락된 특성이 하나 이상 있는 경우
데이터 세트의 주요 특성 중 일부가 제대로 표현되지 않았음을 나타내는 지표일 수 있습니다.
연습문제: 이해도 확인
품종, 연령, 체중, 기질, 매일 털이 빠지는 양 등 다양한 특징을 기반으로 구조견의 입양 가능성을 예측하는 모델을 학습하고 있습니다. 목표는 모델이 신체적 또는 행동적 특성과 관계없이 모든 유형의 개에서 동일하게 우수한 성능을 발휘하도록 하는 것입니다.
학습 세트의 5,000개 예시 중 1,500개에 기질 값이 누락된 것으로 확인됩니다. 다음 중 조사해야 할 잠재적 편향의 원인은 무엇인가요?
특정 품종의 경우 기질 데이터가 누락될 가능성이 더 큽니다.
기질 데이터의 가용성이 개 품종과 상관관계가 있는 경우 특정 견종의 입양 가능성 예측의 정확도가 떨어질 수 있습니다.
12개월 미만의 강아지에게는 기질 데이터가 누락될 가능성이 더 큽니다.
기질 데이터의 가용성이 연령과 관련이 있는 경우 강아지와 성견의 입양 가능성 예측이 달라질 수 있습니다.
대도시에서 구조된 모든 개의 기질 데이터가 누락되었습니다.
언뜻 보기에는 누락된 데이터가 품종, 나이, 체중 등과 관계없이 대도시의 모든 개에게 동등하게 영향을 미치기 때문에 이것이 잠재적인 편향의 원인인 것처럼 보이지 않을 수 있습니다. 하지만 강아지의 위치가 이러한 물리적 특성의 대용물로 효과적으로 기능할 수 있다는 점을 고려해야 합니다. 예를 들어 대도시의 개가 농촌 지역의 개보다 훨씬 작을 가능성이 높으면 소형견이나 특정 소형견 품종의 입양 가능성 예측이 덜 정확할 수 있습니다.
데이터 세트에서 기질 데이터가 무작위로 누락되어 있습니다.
기질 데이터가 실제로 무작위로 누락되는 경우 편향의 원인이 될 수 없습니다. 하지만 기질 데이터가 무작위로 누락된 것처럼 보일 수 있지만 추가 조사를 통해 불일치에 대한 설명을 찾을 수 있습니다. 따라서 데이터 공백이 무작위라고 가정하는 대신 다른 가능성을 배제하기 위해 철저히 검토하는 것이 중요합니다.
예기치 않은 특성 값
데이터를 탐색할 때는 특히 비정상적이거나 특이한 특성 값이 포함된 예시도 찾아야 합니다. 이러한 예기치 않은 기능 값은 데이터 수집 중에 발생한 문제 또는 편향을 일으킬 수 있는 기타 부정확성을 나타낼 수 있습니다.
연습문제: 이해도 확인
구조견 입양 가능성 모델을 학습시키기 위한 다음 가설적 예시 집합을 검토하세요.
품종 |
연령 (세) |
체중 (lbs) |
성격 |
shedding_level |
토이 푸들 |
2 |
12 |
흥분성 |
낮음 |
골든 리트리버 |
7 |
65 |
차분함 |
high |
래브라도 리트리버 |
35 |
73 |
차분함 |
high |
프렌치 불도그 |
0.5 |
11 |
차분함 |
중간 |
알 수 없는 혼합 품종 |
4 |
45 |
흥분성 |
high |
바셋하운드 |
9 |
48 |
차분함 |
중간 |
지형지물 데이터에 문제가 있는지 확인할 수 있나요?
답변을 보려면 여기를 클릭하세요.
품종 |
연령 (세) |
체중 (lbs) |
성격 |
shedding_level |
토이 푸들 |
2 |
12 |
흥분성 |
낮음 |
골든 리트리버 |
7 |
65 |
차분함 |
high |
래브라도 리트리버 |
35 |
73 |
차분함 |
high |
프렌치 불도그 |
0.5 |
11 |
차분함 |
중간 |
알 수 없는 혼합 품종 |
4 |
45 |
흥분성 |
high |
바셋하운드 |
9 |
48 |
차분함 |
중간 |
기네스 세계 기록에서 연령 인증을 받은 가장 오래된 개는
호주 캐틀 독인 Bluey로, 29세 5개월까지 살았습니다. 따라서 래브라도 리트리버가 실제로 35살이라는 것은 믿기 어렵고, 개 나이가 부정확하게 계산 또는 기록되었을 가능성이 더 큽니다 (실제로 3.5살일 수 있음). 이 오류는 데이터 세트의 연령 데이터에 추가 조사가 필요한 광범위한 정확도 문제가 있음을 나타낼 수도 있습니다.
데이터 편향
특정 그룹 또는 특성이 실생활에 비해 과소 또는 과대 대표될 수 있는 모든 종류의 데이터 편향은 모델에 편향을 초래할 수 있습니다.
모델 실적을 감사할 때는 집계된 결과를 살펴보는 것뿐만 아니라 하위 그룹별로 결과를 분류하는 것이 중요합니다. 예를 들어 구조견 입양 가능성 모델의 경우 공정성을 보장하려면 전반적인 정확성만 살펴서는 충분하지 않습니다. 또한 각 개의 품종, 연령대, 크기 그룹에서 모델이 동일하게 우수한 성능을 발휘하는지 확인하기 위해 하위 그룹별로 성능을 감사해야 합니다.
이 모듈의 후반부인 편향 평가에서 하위 그룹별로 모델을 평가하는 다양한 방법을 자세히 살펴봅니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-10(UTC)
[null,null,["최종 업데이트: 2024-11-10(UTC)"],[[["\u003cp\u003eTraining data should represent real-world prevalence to avoid bias in machine learning models.\u003c/p\u003e\n"],["\u003cp\u003eMissing or unexpected feature values in the dataset can be indicative of potential sources of bias.\u003c/p\u003e\n"],["\u003cp\u003eData skew, where certain groups are under- or over-represented, can introduce bias and should be addressed.\u003c/p\u003e\n"],["\u003cp\u003eEvaluating model performance by subgroup ensures fairness and equal performance across different characteristics.\u003c/p\u003e\n"],["\u003cp\u003eAuditing for bias requires a thorough review of data and model outcomes to mitigate potential negative impacts.\u003c/p\u003e\n"]]],[],null,["# Fairness: Identifying bias\n\nAs you prepare your data for model training and evaluation, it's important to\nkeep issues of fairness in mind and audit for potential sources of\n[**bias**](/machine-learning/glossary#bias-ethicsfairness), so you can\nproactively mitigate its effects before releasing your model into production.\n\nWhere might bias lurk? Here are some red flags to look out for in your dataset.\n\nMissing feature values\n----------------------\n\nIf your dataset has one or more features that have missing values for a large\nnumber of examples, that could be an indicator that certain key characteristics\nof your dataset are under-represented.\n\n### Exercise: Check your understanding\n\nYou're training a model to predict adoptability of rescue dogs based on a variety of features, including breed, age, weight, temperament, and quantity of fur shed each day. Your goal is to ensure the model performs equally well on all types of dogs, irrespective of their physical or behavioral characteristics \n\n\u003cbr /\u003e\n\nYou discover that 1,500 of the 5,000 examples in the training set are\nmissing temperament values. Which of the following are potential sources\nof bias you should investigate? \nTemperament data is more likely to be missing for certain breeds of dogs. \nIf the availability of temperament data correlates with dog breed, then this might result in less accurate adoptability predictions for certain dog breeds. \nTemperament data is more likely to be missing for dogs under 12 months in age \nIf the availability of temperament data correlates with age, then this might result in less accurate adoptability predictions for puppies versus adult dogs. \nTemperament data is missing for all dogs rescued from big cities. \nAt first glance, it might not appear that this is a potential source of bias, since the missing data would affect all dogs from big cities equally, irrespective of their breed, age, weight, etc. However, we still need to consider that the location a dog is from might effectively serve as a proxy for these physical characteristics. For example, if dogs from big cities are significantly more likely to be smaller than dogs from more rural areas, that could result in less accurate adoptability predictions for lower-weight dogs or certain small-dog breeds. \nTemperament data is missing from the dataset at random. \nIf temperament data is truly missing at random, then that would not be a potential source of bias. However, it's possible temperament data might appear to be missing at random, but further investigation might reveal an explanation for the discrepancy. So it's important to do a thorough review to rule out other possibilities, rather than assume data gaps are random.\n\nUnexpected feature values\n-------------------------\n\nWhen exploring data, you should also look for examples that contain feature values\nthat stand out as especially uncharacteristic or unusual. These unexpected feature\nvalues could indicate problems that occurred during data collection or other\ninaccuracies that could introduce bias.\n\n### Exercise: Check your understanding\n\nReview the following hypothetical set of examples for training a rescue-dog\nadoptability model.\n\n| breed | age (yrs) | weight (lbs) | temperament | shedding_level |\n|---------------------|-----------|--------------|-------------|----------------|\n| toy poodle | 2 | 12 | excitable | low |\n| golden retriever | 7 | 65 | calm | high |\n| labrador retriever | 35 | 73 | calm | high |\n| french bulldog | 0.5 | 11 | calm | medium |\n| unknown mixed breed | 4 | 45 | excitable | high |\n| basset hound | 9 | 48 | calm | medium |\n\nCan you identify any problems with the feature data? \nClick here to see the answer \n\n| breed | age (yrs) | weight (lbs) | temperament | shedding_level |\n|---------------------|-----------|--------------|-------------|----------------|\n| toy poodle | 2 | 12 | excitable | low |\n| golden retriever | 7 | 65 | calm | high |\n| labrador retriever | 35 | 73 | calm | high |\n| french bulldog | 0.5 | 11 | calm | medium |\n| unknown mixed breed | 4 | 45 | excitable | high |\n| basset hound | 9 | 48 | calm | medium |\n\nThe oldest dog to have their age verified by *Guinness World Records*\nwas [Bluey](https://wikipedia.org/wiki/Bluey_(long-lived_dog)),\nan Australian Cattle Dog who lived to be 29 years and 5 months. Given that, it\nseems quite implausible that the labrador retriever is actually 35 years old,\nand more likely that the dog's age was either calculated or recorded\ninaccurately (maybe the dog is actually 3.5 years old). This error could\nalso be indicative of broader accuracy issues with age data in the dataset\nthat merit further investigation.\n\nData skew\n---------\n\nAny sort of skew in your data, where certain groups or characteristics may be\nunder- or over-represented relative to their real-world prevalence, can\nintroduce bias into your model.\n\nWhen auditing model performance, it's important not only to look at results in\naggregate, but to break out results by subgroup. For example, in the case of\nour rescue-dog adoptability model, to ensure fairness, it's not sufficient to\nsimply look at overall accuracy. We should also audit performance by subgroup\nto ensure the model performs equally well for each dog breed, age group, and\nsize group.\n\nLater in this module, in [Evaluating for Bias](/machine-learning/crash-course/fairness/evaluating-for-bias), we'll\ntake a closer look at different methods for evaluating models by subgroup.\n| **Key terms:**\n|\n- [Bias (ethics/fairness)](/machine-learning/glossary#bias-ethicsfairness) \n[Help Center](https://support.google.com/machinelearningeducation)"]]