Distribution Shift入門: Covariate・Label・Concept Shift

2026年10月の再サーベイ: 研究史・重要文献・最近の進展を整理した新版を追加しました(2026年10月3日基準)。以下は従来のメモです。定義・適用条件の訂正は新版を参照してください。

定義

sourceとtargetの同時分布をそれぞれ $P_s(X,Y)$、$P_t(X,Y)$ とします。distribution shiftは $P_s(X,Y)\ne P_t(X,Y)$ の総称です。同時分布は

\[p(x,y)=p(y\mid x)p(x)=p(x\mid y)p(y)\]

と2通りに分解できるため、「どの因子が不変か」という仮定で代表的なshiftを分けます。

名称 不変と仮定する因子 変化する因子 典型的な補正
covariate shift $p_s(y\mid x)=p_t(y\mid x)$ $p_s(x)\ne p_t(x)$ $p_t(x)/p_s(x)$ によるimportance weighting
label shift $p_s(x\mid y)=p_t(x\mid y)$ $p_s(y)\ne p_t(y)$ class prior $p_t(y)/p_s(y)$ の推定
concept shift/drift 上記conditionalが変化 $p_t(y\mid x)\ne p_s(y\mid x)$ target label、時系列監視、再学習等が必要

実データでは複数因子が同時に変わり得ます。unlabeled target dataだけから一般の $P_t(Y\mid X)$ を同定することはできないため、補正法は仮定とsupport conditionを明示します。

Covariate shiftのrisk補正

covariate-shift仮定と $p_t(x)>0\Rightarrow p_s(x)>0$ のsupport条件の下では

\[R_t(f)=\mathbb E_{(x,y)\sim P_t}[\ell(f(x),y)] =\mathbb E_{(x,y)\sim P_s} \left[\frac{p_t(x)}{p_s(x)}\ell(f(x),y)\right].\]

重みはlabel比ではなく input density ratio $p_t(x)/p_s(x)$ です。重みが大きいと分散が 増えるため、clipやregularizationにはbias–variance trade-offがあります。

Label shiftの条件

label shiftでは $w_y=p_t(y)/p_s(y)$ を推定します。 Lipton et al. (ICML 2018) のBBSEは、 black-box classifierのsource confusion matrixがinvertibleであること、target classのsupportが sourceに含まれること等を仮定します。classifierが「ある」だけではlabel shiftを識別できません。

評価と診断

  1. splitを作る軸(time、location、domain、class prior)を明記する。
  2. target labelをmodel selectionやshift診断に使ったか分ける。
  3. density-ratioやconfusion matrixのconditioning、有効sample sizeを確認する。
  4. shift仮定を満たす合成実験と、仮定が破れる実データ評価を分ける。
  5. shift検出、原因同定、性能補正を同じ問題として扱わない。

標準的な入口はMIT Pressの Dataset Shift in Machine Learning です。以下は過去に集めた図・dataset・論文メモとして残します。

全体概観

Shift の種類

Screen Shot 2022-05-01 at 16 34 38

ref: MIT Press公式

Screen Shot 2022-05-01 at 16 36 17

Screen Shot 2022-05-01 at 16 43 03

Nature ref pdf

Screenshot 2022-05-02 at 8 36 25 PM

Vector PDF

Covariate Shift

Screenshot 2022-04-28 at 5 33 56 PM

Label Shift (Prior Probability Shift / Target Shift)

Screenshot 2022-04-28 at 5 53 25 PM

Shift への対応

Covariate Shift
Label Shift

Other Reference

Screenshot 2022-04-28 at 11 16 50 AM Screenshot 2022-04-28 at 11 16 31 AM

Screenshot 2022-04-28 at 4 56 56 PM Screenshot 2022-04-28 at 4 59 13 PM

Paper Reference

彼らは以下の Shift の分類をしてる

Screenshot 2022-05-03 at 1 30 53 PMScreenshot 2022-05-03 at 1 30 58 PM

Screenshot 2022-05-03 at 10 45 17 PM

Dataset

See also OOD Datasets まとめ

Name Shift Type Reference
     
MNIST-C Corruption Shift Google Github
MNIST-R (RotatedMNIST) Rotation? Shift DomainBed
CMNIST (ColoredMNIST) Correlation Shift DomainBed
MNIST Background Random Background Shift LISA (Prev name of Mila) ‘s description Dataset
MNIST -> SVHN Style Shift Torchvision
Morpho-MNIST Perturbation Shift Github
     
ImageNet-Real ID: Annotation Shift? (relabels the validation set of the original ImageNet in orderto correct labeling errors) Github
ImageNet-V2 ID: Sample Selection Bias? Github
ImageNet-C Corruption Shift Github
ImageNet-P Perturbation Shift Github
ImageNet-A (places the ImageNet objects in unusual contexts or orientations) Github
ImageNet-O OOD (contains image concepts from outside ImageNet-1K) Github
ImageNet-R Style Shift (contains abstract or rendered versions of the object) Github
ImageNet-Sketch Style Shift Github
Stylized-ImageNet Texture Shift Github