Transfer Sparse Coding for Robust Image Representation

Mingsheng Long, Guiguang Ding, Jianmin Wang, Jiaguang Sun, Yuchen Guo, Philip S. Yu

Abstract

In real-world image classification, the assumption that training and test data share the same probability distribution is frequently violated. This distribution divergence often leads to a significant drop in model performance. This paper presents Transfer Sparse Coding (TSC), a framework that integrates a distribution-matching constraint—Maximum Mean Discrepancy (MMD)—directly into the sparse coding objective function. By learning a shared dictionary and minimizing the distance between source and target distributions in the feature space, TSC creates a robust representation that enables classifiers trained on labeled data to generalize effectively to unlabeled datasets from different domains.

Introduction

Traditional machine learning models typically rely on the assumption that training (source) and test (target) data are independent and identically distributed (i.i.d.). However, in practical applications, factors such as changes in lighting, camera sensors, or artistic style create a "distribution divergence." For instance, a digit recognizer trained on high-resolution scans may fail when applied to low-quality handwritten samples.

While Sparse Coding—representing images as linear combinations of basis functions—is effective at capturing high-level semantic features, it is inherently sensitive to these distribution shifts. If the training and test sets differ, a dictionary learned solely from the training data will not accurately represent the test data. Consequently, test images reside far from training images in the resulting feature space, causing standard classifiers like Support Vector Machines (SVMs) to fail.

Methodology: Transfer Sparse Coding (TSC)

To address this, the authors propose Transfer Sparse Coding (TSC). The framework builds upon standard sparse coding and Graph Regularized Sparse Coding (GraphSC) by introducing a third, critical component: Maximum Mean Discrepancy (MMD).

1. The Objective Function

The TSC objective function balances three primary goals:

  • Reconstruction Accuracy: Minimizing the error when reconstructing images from the learned dictionary.
  • Sparsity: Utilizing an $\ell_1$-norm to ensure the representation is concise and captures essential features.
  • Graph Regularization: Preserving the local geometric structure (manifold) of the data, ensuring that similar original images have similar sparse representations.

2. The Transfer Mechanism (MMD)

MMD is a non-parametric metric used to measure the distance between two different distributions. By incorporating MMD into the optimization process, TSC forces the learned representations of the labeled source data and unlabeled target data to be as close as possible. This "bridges" the gap between domains, allowing a classifier to treat them as a single, coherent distribution.

3. Optimization

The model is optimized through an iterative two-step process. First, it learns the Transfer Sparse Codes using an adapted "feature-sign search" algorithm. Second, it updates the Dictionary by solving an $\ell_2$-constrained least squares problem to refine the basis functions.

Experimental Evaluation

The authors evaluated TSC against several state-of-the-art baselines across three challenging cross-distribution scenarios:

  • USPS vs. MNIST: Two handwritten digit datasets with distinct styles and distributions.
  • CMU PIE: Subsets of the PIE face database featuring different lighting and illumination conditions.
  • MSRC vs. VOC2007: A cross-dataset object recognition task involving standard evaluation photos (MSRC) and consumer-grade Flickr images (VOC2007).
Figure 1: Examples of the cross-domain datasets used for evaluation, including faces under varying illumination, handwritten digits, and diverse object categories.

Key Insights and Results

TSC consistently outperformed standard Sparse Coding and GraphSC, demonstrating that distribution matching is often more critical for transfer learning than simply preserving data geometry.

  • Performance Gains: On the USPS vs. MNIST task, TSC achieved 57.77% accuracy, compared to 41.18% for GraphSC. On the PIE face dataset, performance nearly doubled from 19.72% to 37.30%.
  • The Shared Dictionary: TSC succeeds by learning a dictionary that captures the underlying commonalities between domains rather than overfitting to the source data.
  • Visualizing the Bridge: The impact of MMD is most visible in the similarity matrices of the sparse codes. Without MMD, the similarity between the source and target domains is negligible. With MMD, the cross-domain similarity is greatly enriched, indicating that the two distributions have been successfully aligned.
Figure 4: Comparison of similarity matrices for sparse codes. The 'With MMD' matrix shows significantly higher cross-domain similarity compared to the 'Without MMD' version, illustrating how TSC bridges the distribution gap.

Conclusion and Future Work

Transfer Sparse Coding provides a robust framework for image representation in the presence of domain shift. It is particularly effective when the "style" of the data (e.g., lighting or handwriting style) changes drastically.

Future research may focus on automating the tuning of hyperparameters ($\mu$, $\gamma$, and $\lambda$) in unsupervised settings and improving the computational efficiency of the iterative optimization process to handle massive, "in-the-wild" datasets.

Summary updated

BibTeX
@inproceedings{long2013transfer,
  author = {Mingsheng Long and Guiguang Ding and Jianmin Wang and Jiaguang Sun and Yuchen Guo and Philip S. Yu},
  title = {{Transfer Sparse Coding for Robust Image Representation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2013},
  doi = {10.1109/cvpr.2013.59},
}
Figure