MUR043 平衡影響以訓練公平深度神經網路 (Ver 0.1)

目錄

平衡影響以訓練公平深度神經網路

紫式晦澀每日一篇文章第43天

前言

  1. 今天是2022年第41天, 全年第6週, 二月的第2個週四. 今天來深思學術工作流輸出面向的三法.

  2. 今天的素材主要來自文章:

代碼FBI (Fair Balance Influence)

摘要

FBI001 FAIRIF是一種二階段訓練法,於每個人口統計群中重權重模型表現, 以舒緩三種差距相關的公平性偏誤.

  1. 「公平機器學習方法」倚賴(1)訓練樣本的敏感資訊 (2) 大幅度修改目標模型; 兩者對應用都不是很友善.
  2. 提供解決策略 FAIRIF–二階段算法
  3. 工作原理: 階段一-平衡模型表現在各種「人口統計群(demographic group)」; 階段二-「重權重(reweighted)」資料集.
  4. FAIRIF應用到任何用SGD訓練的模型: 只需額外增加小驗證資料集上的「群標記(group annotations)」
  5. 理論保證: 在分類, 三種「差距(disparity)」可被舒緩.
  6. 實驗上: 「公平-效度權衡(fairness-utility trade-offs)」與各種bias能應對.
  7. 實際資料集:effectess且有scalability.
  8. 使用Pre-trained模型: 可以緩解pre-trained模型的「不公平問題(unfairness issue)」, 也不會影響其表現.

Most fair machine learning methods either highly rely on the sensitive information of the training samples or require a large modification on the target models, which hinders their practical application. To address this issue, we propose a twostage training algorithm named FAIRIF. It minimizes the loss over the reweighted data set (second stage) where the sample weights are computed to balance the model performance across different demographic groups (first stage). FAIRIF can be applied on a wide range of models trained by stochastic gradient descent without changing the model, while only requiring group annotations on a small validation set to compute sample weights. Theoretically, we show that, in the classification setting, three notions of disparity among different groups can be mitigated by training with the weights. Experiments on synthetic data sets demonstrate that FAIRIF yields models with better fairness-utility trade-offs against various types of bias; and on real-world data sets, we show the effectiveness and scalability of FAIRIF. Moreover, as evidenced by the experiments with pretrained models, FAIRIF is able to alleviate the unfairness issue of pretrained models without hurting their performance.


  • 如何不影響其表現?

簡介: Group Fairness, Influence Function.

FBI032 計算影響函數在收斂的模型上, 因為需要Hessian是正定的

  1. 「影響函數(Influence function)」: 度量「模型」與「特定訓練樣本」的關係.
  2. 70年代有influence-based diagnostics in statistics, 最近有在ML.
  3. 解釋黑盒子模型的預測
  4. 機器學習公平性的研究還under-explored在影響函數的做法中.
  5. 計算影響函數: 需假設Hessian是正定.
  6. 之前的工作計算on-the-fly Hessian, 在模型還沒收斂的時候就計算. 但這樣子的Hessian不是很準, 所以影響函數也不是很準
  7. 這個工作只需計算一次影響函數, 而且是在收斂的模型上計算, 所以會準.

Influence Function. Influence function measures a model’s dependency on a particular training example. It originated in influence-based diagnostics in statistics in the $70 \mathrm{~s}$ and is then further developed in the machine learning literature. It has been used to explore explanations for predictions of blackbox models by evaluating the effect of each training sample [Koh and Liang, 2017]. When moving on to groups of training samples, [Koh et al., 2019] studied their effects on the overall accuracy performance of the model. However, the fairness issue in machine learning is still under-explored from this perspective. In the computation of influence functions, one important assumption is that the Hessian matrix of the objective function is positive definite. Previous methods compute it on the fly [Teso et al., 2021], which means that the influence function is computed when the model has not converged. For the non-converged model, the Hessian matrix they get is far from the ideal point. Therefore, the influence function computation is not accurate. In our proposed FAIRIF, we only compute the influence function one time, which is fast. And we compute it when the model is converged, which is more feasible to make the Hessian matrix positive definite.

[Teso et al., 2021] Stefano Teso, Andrea Bontempelli, Fausto Giunchiglia, and Andrea Passerini. Interactive label cleaning with example-based explanations. NeurIPS, 2021.


  • 會on-the-fly計算Hessian , 應該有一些想移除某些參數的考量?

方法

FBI173 重權重一樣本, 最小值變化與相對應損失變化的一階逼近, 倚賴對Hessian的操作

影響函數方法:

  • 核心問題: 如果「重新權重第i個訓練樣本」, 那麼「損失函數最小值」的變化有多大?
  • 核心心法: 對「變化」做一階逼近(first order approximation)
  • 核心技法: 利用「reweight」來看weight小小變化後, 其最小值, 也就是「擾動風險最小者(Perturbed risk minimizer)」的變化 $$\theta_{\epsilon_{i}}^{\star} \triangleq \underset{\theta \in \Theta}{\arg \min } \frac{1}{n} \sum_{i=1}^{n} \ell\left(z_{i}, \theta\right)+\epsilon_{i} \ell\left(z_{i}, \theta\right)$$
  • 結果一: 「最小值變化」被「一階逼近」給刻畫
  • 要求: 需要Hessian是正定的.
  • 他人做法: 看「損失的一階逼近」 $$ \begin{aligned} \ell\left(z, \theta_{\epsilon_{i}}^{\star}\right)-\ell\left(z, \theta^{\star}\right) & \approx \frac{d \ell\left(z, \theta_{\epsilon_{i}}^{\star}\right)}{d \epsilon_{i}} \epsilon_{i} \ &=-\nabla_{\theta} \ell\left(z, \theta^{\star}\right)^{\top} H_{\theta^{\star}}^{-1} \nabla_{\theta} \ell\left(z_{i}, \theta^{\star}\right) \epsilon_{i} \end{aligned} $$


  • 這種技術分析與Robustness相關的技術是否有關?
  • Hessian的正定, 具體要怎麼確定? 目前大家的共識是什麼?
  • 如果Hessian 算不準, random projection這類的Hessian sketch 技術可以帶來好結果嗎? 尤其是關於scalability的問題.

FBI379 FAIRIF算法: 考慮影響函數與擾動幅度的互文, 重新訓練公平的神經網路模型.

IPO思考 Input:

  1. 訓練數據集
  2. 驗證數據集
  3. 模型
  4. 起始參數
  5. 超參數

Process:Balancing Influence:

  1. 跑香草ERM來訓練模型直到收斂
  2. 利用訓練數據集, 計算「梯度」與「Hessian inverse」
  3. 計算「表現度量」與「分類表現相關梯度」
  4. 透過「平衡影響流程」來調整「重權重」
  5. 重權重的損失, 來重新訓練神經網路. Output:
  6. 最終的「公平」深度神經網路.


  • 這樣的方法可以generalizabl嗎? 或者泛化程度不太重要在這個文脈裡?
  • 感覺有點硬做? 這個loss好像就是為了讓performance metric可以被first order approximation給逼近, 所以訓練. 無法接近的部分, 就用perturbation的regularization來均衡.
  • 工程上可行, 但要怎麼解釋出來的結果? 邏輯上好像「perturbed weight」是一個超參數被拿來tune, tune完以後變成reweighted ERM來做事情.
  • 我猜這類的方法, 會接受各種ERM的critism, 因為mean有很多地方可以被攻擊.

FBI347 三種Disparity: 自變量不均衡(Group size), 組分佈遷移(Group Distribution Shift), 應變量不均衡(Class size)

  • 原則: 計算TPR與TNR在各個子群中
  • Disparity 1: 組的大小不同
  • Disparity 2: 組的分類分佈不同
  • Disparity 3: 類的大小不同 (不平衡的資料)

In this section, we provide an analysis to show that by balancing the TPR and TNR across different groups, disparities under different notions of fairness will be mitigated. We first observe that the bias in the learned models largely attributes to the training data having (1) difference in group size, (2) difference in class distribution within each group (group distribution shift), and (3) difference in class size. The observation is aligned with the previous works [Yu, 2021; Reddy et al., 2021] and we visualize the three different types of bias in Figure $1 .$

  • Bias 1: Group Size Discrepancy. We set $15 %$ of images in the two classes as red and the remaining as blue. The distributions over classes of each group are the same, and the amount of images in each class are also the same. In this setting, the group of red background is under-representative.

  • Bias 2: Group Distribution Shift. We keep the amount of data within each class and each group to be the same, but set $85 %$ of images in class 0 with blue background and $15 %$ of images in class 1 with blue background. In this case, the group distributions over the classes are different.

  • Bias 3: Class Size Discrepancy. We set group distributions and total amount of data within each group to be same. And the amount of data in class 1 is $25 %$ of class 0 .


結果

FBI



討論

FBI



後記

這次閱讀寫了五張知識卡片, 對影響函數了解基本思考. 其依賴一階逼近與二階修正, 給了工作流, 以及三種公平性相關的偏誤.

2022.02.10. 紫蕊 於 西拉法葉, 印第安納, 美國.


Version Date Summary
0.1 2022-02-10 對影響函數了解基本思考. 其依賴一階逼近與二階修正, 給了工作流, 以及三種公平性相關的偏誤.

版權

CC BY-NC-ND 4.0

評論