머신러닝 워크플로에는 모델의 공정성 평가가 포함될 수 있습니다. 불공정한 모델은 특히 기존의 과소 대표 그룹에 불리할 수 있는 체계적 편향을 표시합니다. 불공정한 모델은 데이터 세트의 특정 하위 집합 또는 슬라이스에 불리하게 작동할 수 있습니다.
데이터 수집 또는 학습 후 평가 프로세스 중에 편향을 감지할 수 있습니다. Vertex AI는 모델의 편향을 평가하는 데 도움이 되는 다음 모델 평가 측정항목을 제공합니다.
데이터 편향 측정항목: 이 측정항목은 모델을 학습시키고 빌드하기 전에 원시 데이터에 편향이 포함되어 있는지 여부를 감지합니다. 예를 들어 미소 감지 데이터 세트에는 청년층보다 고령층이 훨씬 더 적게 포함될 수 있습니다. 이러한 측정항목 중 일부는 여러 데이터 그룹의 라벨 분포 간 거리 양자화를 기반으로 합니다.
집단 크기 차이
True 라벨의 양성 비율 차이
모델 편향 측정항목: 이 측정항목은 모델 학습 후 모델의 예측에 편향이 포함되었는지 여부를 감지합니다. 예를 들어 모델이 한 데이터의 하위 집합에서 나머지 데이터보다 정확할 수 있습니다.
정확성 차이
예측 라벨의 양성 비율 차이
재현율 차이
관련성 차이
오류 유형 비율의 차이
파이프라인 실행에 모델 평가 편향 파이프라인 구성요소를 포함하는 방법은 모델 평가 구성요소를 참조하세요.
예시 데이터 세트 개요
공정성 측정항목과 관련된 모든 예시에서는 지원자의 고등학교 성적, 주, 성 정체성과 같은 특성이 포함된 가상의 대학 입시 데이터 세트를 사용합니다. 대학이 캘리포니아 또는 플로리다 지원자에게 편향되었는지 여부를 측정하려고 합니다.
타겟 라벨 또는 모든 가능한 결과는 다음과 같습니다.
장학금을 받는 지원자(p)를 승인합니다.
장학금을 받지 않는 지원자(q)를 승인합니다.
지원자를 거부합니다(r).
입학 전문가들이 이러한 라벨을 정답으로 제공했다고 가정할 수 있습니다.
이러한 전문가 라벨도 인간이 할당하는 것이기 때문에 편향될 수 있습니다.
이진 분류 예시를 만들기 위해 라벨을 그룹화하여 가능한 두 가지 결과를 만들 수 있습니다.
긍정적인 결과(1로 표기). p 및 q를 '승인되는 {p,q}'의 긍정적 결과로 그룹화할 수 있습니다.
부정적인 결과(0으로 표기). 긍정적인 결과를 제외한 다른 모든 결과의 컬렉션일 수 있습니다. 대학 지원 예시에서 부정적인 결과는 'rejected {r}'입니다.
캘리포니아와 플로리다 지원자의 편향을 측정하기 위해 나머지 데이터 세트에서 2개의 슬라이스를 분리합니다.
편향을 측정할 데이터 세트의 슬라이스 1. 대학 지원자 예시에서 캘리포니아 지원자에 대한 편향을 측정합니다.
편향을 측정할 데이터 세트의 슬라이스 2. 슬라이스 2에는 기본적으로 '슬라이스 1에 없는 모든 항목'이 포함될 수 있지만 대학 지원 예시에서는 슬라이스 2에 플로리다 지원자를 할당합니다.
이 대학 지원 데이터 세트 예시에는 슬라이스 1에 캘리포니아 지원자 200명, 슬라이스 2에 플로리다 지원자 100명이 있습니다. 모델 학습 후에는 다음과 같은 혼동 행렬이 있습니다.
캘리포니아 지원자
승인(예측)
거부(예측)
승인(정답)
50(참양성)
10(거짓음성)
거부(정답)
20(거짓양성)
120(참음성)
플로리다 지원자
승인(예측)
거부(예측)
승인(정답)
20(참양성)
0(거짓음성)
거부(정답)
30(거짓양성)
50(참음성)
2개의 혼동 행렬 간 측정항목을 비교하여 '특정 슬라이스에서 모델의 재현율이 다른 슬라이스보다 높은가?'와 같은 질문에 답변함으로써 편향을 측정할 수 있습니다.
또한 다음 축약형 데이터를 사용하여 라벨이 지정된 정답 데이터를 나타냅니다. 여기서 i는 슬라이스 번호(1 또는 2)를 나타냅니다.
\(
l^0_i = tn_i + fp_i
\)
슬라이스 i에서 라벨이 지정된 부정적 결과 수 = 참음성 + 거짓양성
\(
l^1_i = fn_i + tp_i
\)
슬라이스 i의 경우 라벨이 지정된 긍정적 결과 수 = 거짓음성 + 참양성
대학 지원 데이터 세트 예시에 대해서는 다음을 참조하세요.
일부 공정성 측정항목은 여러 결과를 위해 일반화할 수도 있지만 단순성을 위해 이진 분류를 사용합니다.
이 예시에서는 분류 태스크에 중점을 두고 있지만 일부 공정성 측정항목은 회귀와 같은 다른 문제로 일반화됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Introduction to model evaluation for fairness\n\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nA machine learning workflow can include evaluating your model for fairness. An\nunfair model displays systemic bias that can cause harm, especially to\ntraditionally underrepresented groups. An unfair model may perform\nworse for certain subsets, or *slices*, of the dataset.\n\nYou can detect bias during the data collection or post-training evaluation\nprocess. Vertex AI provides the following model evaluation metrics to\nhelp you evaluate your model for bias:\n\n- [**Data bias metrics**](/vertex-ai/docs/evaluation/data-bias-metrics): Before you train and build your model,\n these metrics detect whether your raw data includes biases. For example, a\n smile-detection dataset may contain far fewer elderly people than younger\n ones. Several of these metrics are based on quantifying the distance between\n label distribution for different groups of data:\n\n - Difference in Population Size.\n\n - Difference in Positive Proportions in True Labels.\n\n- [**Model bias metrics**](/vertex-ai/docs/evaluation/model-bias-metrics): After you train your model, these metrics\n detect whether your model's predictions include biases. For example, a model\n may be more accurate for one subset of the data than the rest of the data:\n\n - Accuracy Difference.\n\n - Difference in Positive Proportions in Predicted Labels.\n\n - Recall Difference.\n\n - Specificity Difference.\n\n - Difference in Ratio of Error Types.\n\nTo learn how to include the model evaluation bias pipeline components in your\npipeline run, see [Model evaluation component](/vertex-ai/docs/pipelines/model-evaluation-component#fairness).\n\nExample dataset overview\n------------------------\n\nFor all examples related to fairness metrics, we use a hypothetical college\nadmission dataset with features such as an applicant's high school grades,\nstate, and gender identity. We want to measure whether the college is biased\ntowards California or Florida applicants.\n\nThe target labels, or all possible outcomes, are:\n\n- Accept the applicant with scholarship (`p`).\n\n- Accept the applicant without a scholarship (`q`)\n\n- Reject the applicant (`r`).\n\nWe can assume that admission experts provided these labels as the ground truth.\nNote that it's possible for even these expert labels to be biased, since they\nwere assigned by humans.\n\nTo create a binary classification example, we can group labels together to\ncreate two possible outcomes:\n\n- Positive outcome, notated as `1`. We can group `p` and `q` into the positive\n outcome of \"accepted `{p,q}`.\"\n\n- Negative outcome, notated as `0`. This can be a collection\n of every other outcome aside from the positive outcome. In our college\n application example, the negative outcome is \"rejected `{r}`.\"\n\nTo measure bias between California and Florida applicants, we separate out two\nslices from the rest of the dataset:\n\n- Slice 1 of the dataset for which the bias is being measured. In the\n college application example, we're measuring bias for applicants from\n California.\n\n- Slice 2 of the dataset against which the bias is being measured. Slice 2\n can include \"everything not in slice 1\" by default, but for the college\n application example, we are assigning slice 2 as Florida applicants.\n\nIn our example college application dataset, we have 200 applicants from\nCalifornia in slice 1, and 100 Florida applicants in slice 2. After training the\nmodel, we have the following confusion matrices:\n\nBy comparing metrics between the two confusion matrices, we can measure biases\nby answering questions such as \"does the model have better recall for one slice\nthan the other?\"\n\nWe also use the following shorthand to represent labeled ground truth data,\nwhere `i` represents the slice number (1 or 2):\n\n\u003cbr /\u003e\n\n\\\\( l\\^0_i = tn_i + fp_i \\\\)\nFor slice i, number of labeled negative outcomes = true negatives + false positives.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\\\\( l\\^1_i = fn_i + tp_i \\\\)\nFor slice `i`, number of labeled positive outcomes = false negatives + true positives.\n\n\u003cbr /\u003e\n\nNote the following about the college application dataset example:\n\n- Some fairness metrics can be generalized for multiple outcomes as well, but we\n use binary classification for simplicity.\n\n- The example focuses on the classification task, but some fairness metrics\n generalize to other problems like regression.\n\n- For this example, we assume that the training data and test data are the same.\n\nWhat's next\n-----------\n\n- Learn about the [data bias metrics](/vertex-ai/docs/evaluation/data-bias-metrics) supported by Vertex AI.\n\n- Learn about the [model bias metrics](/vertex-ai/docs/evaluation/model-bias-metrics) supported by Vertex AI.\n\n- Read the [model evaluation pipeline component reference](/vertex-ai/docs/pipelines/model-evaluation-component#fairness)."]]