CS-Shapley: Class-wise Shapley Values for Data Valuation in Classification

Stephanie Schoch, Haifeng Xu, Yangfeng Ji

Here is a concise, engaging summary of the paper "CS-Shapley: Class-wise Shapley Values for Data Valuation in Classification".

TL;DR

Standard data valuation methods use overall model accuracy to determine the worth of a data point, failing to distinguish whether a point helps or hurts its specific class. CS-Shapley solves this by introducing a class-wise value function that separates in-class and out-of-class contributions. This approach significantly improves noisy label detection and high-value data selection, while also demonstrating excellent transferability from cheap, simple models to expensive neural networks.

What Problem Does This Paper Address?

In machine learning, not all data points are created equal. Some are highly informative, while others are noisy, mislabeled, or even adversarial. Data valuation methods aim to quantify the contribution of each training instance using cooperative game theory concepts like Shapley values.

Conventionally, the "utility" or value function of a dataset is measured by its overall predictive accuracy on a validation set. However, the authors point out a critical flaw: overall accuracy masks fine-grained class dynamics. For instance, if adding data point $i$ or data point $j$ results in the exact same overall accuracy change, standard methods treat them as identical. But what if point $i$ increases accuracy for its own class, while point $j$ decreases its own class accuracy but happens to boost another? Point $j$ is likely noisy or mislabeled and should be penalized, but standard Shapley valuation misses this distinction.

An example showing how overall accuracy fails to differentiate between a helpful data point ($i$) and a harmful data point ($j$) within the same class.

Methods

The authors propose CS-Shapley (Class-wise Shapley), which introduces a novel class-wise value function:

$$v_{y_i}(S_{y_i} | S_{-y_i}) = a_S(D_{y_i}) \cdot e^{a_S(D_{-y_i})}$$

Where:

  • $a_S(D_{y_i})$ is the in-class accuracy (the primary measure of contribution).
  • $a_S(D_{-y_i})$ is the out-of-class accuracy (acting as a discounting factor).

This formulation ensures that a data point must benefit its own class to receive a high value, while ensuring it does not catastrophically harm performance on other classes.

Mathematically, the authors prove that this specific exponential-discounting form is uniquely qualified. It is the only function that satisfies two essential axioms for classification data valuation: Priority of In-class Accuracy and In-class Value Additivity and Out-of-class Weight Discounting. To make computation practical, they implement a truncated Monte Carlo approximation algorithm that samples out-of-class environments.

Figure 2: Contour plot of vyi(S).

Datasets

The method was evaluated across nine diverse benchmark datasets:

  • Binary Classification: Diabetes, CPU, Click, Covertype, CIFAR10 (binarized), FMNIST (binarized), MNIST-2 (binarized), and Phoneme.
  • Multi-class Classification: MNIST-10.

Unlike prior work that artificially balanced datasets, the authors used stratified sampling to preserve the original, realistic label distributions.

Key Insights and Ideas

  • Implicit Coalitions: Data points in classification tasks naturally form coalitions based on their class labels. Data valuation algorithms must respect this structure rather than treating the dataset as a homogeneous group.
  • The Transferability Breakthrough: Computing Shapley values directly on deep neural networks is computationally prohibitive (e.g., taking an estimated 4 months for a Multi-Layer Perceptron on the Covertype dataset). The authors discovered that data values calculated using a cheap surrogate model (like Logistic Regression) transfer remarkably well to complex models (like MLPs). This unlocks practical data valuation for deep learning.

Key Results

The authors evaluated CS-Shapley on two primary tasks: High-value data removal (where removing top-valued data should cause the steepest drop in accuracy) and Noisy label detection. They introduced a new metric called Weighted Accuracy Drop (WAD) to better capture how quickly accuracy degrades during data removal.

  • Data Removal: CS-Shapley consistently outperformed standard Data Shapley (TMC), Beta Shapley, and Leave-One-Out (LOO) across almost all datasets and classifiers. For example, on the binarized CIFAR10 dataset using Logistic Regression, CS-Shapley achieved a WAD of 0.119, compared to TMC-Shapley's 0.108 and Beta Shapley's 0.062.
  • Noisy Label Detection: CS-Shapley achieved the highest Area Under the Precision-Recall Curve (AUC) in most settings, successfully identifying randomly flipped labels significantly faster than baseline methods.
Performance curves showing the drop in prediction accuracy as high-value instances are removed using Logistic Regression.

Limitations and Future Work

Currently, CS-Shapley is strictly designed for classification problems due to its reliance on class-specific accuracy metrics. The authors note a slight performance dip in multi-class settings (like MNIST-10) compared to binary setups, suggesting that the sampling strategy for out-of-class environments ($S_{-y_i}$) could be further optimized.

For future work, the authors plan to explore how these class-wise valuation principles can be extended to regression tasks.

Summary updated

BibTeX
@inproceedings{schoch2022cs,
  author = {Stephanie Schoch and Haifeng Xu and Yangfeng Ji},
  title = {{CS-Shapley: Class-wise Shapley Values for Data Valuation in Classification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=KTOcrOR5mQ9},
}
Figure