Rethinking Binary Hyperparameters for Deep Transfer Learning

Jo Plested, Xuyang Shen, Tom Gedeon · DOI

TL;DR

This paper challenges the "all-or-nothing" approach to transfer learning hyperparameters, demonstrating that a more nuanced, dataset-specific approach significantly improves performance. By exploring non-binary settings for layer transfer, learning rates, and regularization, the authors achieve state-of-the-art or near state-of-the-art results on challenging datasets.

What Problem Does This Paper Address?

Deep learning models, particularly Convolutional Neural Networks (CNNs), excel at image classification but often require vast amounts of labeled data. Transfer learning, which leverages pre-trained models, is a common solution for tasks with limited data. However, the standard transfer learning paradigm often treats hyperparameters in a binary fashion: either a layer is transferred or it's not, regularization is applied or it's not, and a single learning rate is used for all layers. This paper argues that this rigid approach is counter-intuitive and that a more flexible, "non-binary" tuning of hyperparameters is crucial for optimal performance, especially when the target dataset differs significantly from the source dataset (e.g., ImageNet).

Methods

The core of this research lies in exploring a more granular approach to transfer learning hyperparameters. Instead of binary choices, the authors investigate:

  • Layer Transfer: Examining the optimal number of layers to transfer from the pre-trained model, rather than simply transferring all layers except the final one.
  • Layer-wise Learning Rates: Investigating the use of different learning rates for different layers, particularly applying lower learning rates to lower layers that are more general.
  • Regularization Strategies: Moving beyond a simple L2SP (decaying weights towards pre-trained values) or L2 (decaying weights towards zero) choice. They explore combinations of L2SP and L2 regularization, and selectively applying L2SP to specific layers.
  • Non-Traditional Hyperparameter Searches: Conducting extensive empirical evaluations to find optimal combinations of these hyperparameters for each dataset.

Datasets

The study utilizes the following datasets:

  • Source Dataset: ImageNet 1K (a standard large-scale dataset for pre-training).
  • Target Datasets:
    • Caltech 256-30 (Caltech): Chosen as the most similar to ImageNet.
  • Stanford Cars (Cars): A fine-grained dataset.
  • FGVC Aircraft (Aircraft): Another fine-grained dataset.
  • Describable Textures (DTD): Intuitively very different from ImageNet, consisting of texture images depicting adjectives.

The target datasets are all small, with less than 10,000 training images.

Key Insights and Ideas

  • "Binary is Bad": The fundamental insight is that rigid, binary choices for transfer learning hyperparameters (e.g., transfer all layers or none) often lead to suboptimal results. A dataset-dependent, nuanced approach is superior.
  • Layer-wise Specialization: The optimal number of layers to reinitialize and the learning rates for those layers are not uniform. For some datasets, reinitializing more layers with lower learning rates is beneficial, while for others, a simpler approach works best.
  • Regularization Nuance: Combining L2SP and L2 regularization, and selectively applying L2SP to specific layers, can yield better results than using either alone or applying L2SP uniformly.
  • Dataset Similarity Matters: The degree of similarity between the source and target datasets strongly dictates the optimal transfer learning strategy. Datasets that are less similar to ImageNet benefit more from non-binary approaches.
  • Predictive Heuristics: The paper proposes heuristics, like comparing performance with fixed features versus random initialization, to predict which transfer learning settings will be optimal for a given dataset.

Key Results

  • The proposed non-binary transfer learning methods achieved state-of-the-art or near state-of-the-art performance on three out of the four target datasets.
  • For datasets that are less similar to ImageNet, reinitializing more layers and using L2SP regularization (often selectively) led to significant accuracy improvements.
  • For datasets more similar to ImageNet, a lower learning rate and fewer reinitialized layers were often optimal, with L2SP regularization proving beneficial.
  • The study found that the normalized Fisher Ratio can be a useful, though not always pronounced, indicator of pre-trained weight suitability, while EMD domain similarity was a poor predictor.

Limitations and Future Work

  • Dataset Dependency: The proposed heuristics for determining optimal settings are based on experiments conducted on the four specific datasets used in the paper. Their generalizability to new datasets, especially outside of image classification, requires further validation.
  • Computational Cost: Evaluating the suitability of fixed features versus random initialization, as suggested for predicting optimal settings, is computationally intensive. Further research is needed to explore more efficient heuristics.
  • Broader Applications: While the research focuses on image classification, future work could explore the application of these non-binary transfer learning principles to other domains.
  • Pre-training Strategies: The paper assumes the use of publicly available pre-trained weights and does not explore novel pre-training strategies.

Summary updated

BibTeX
@inproceedings{plested2021rethinking,
  author = {Jo Plested and Xuyang Shen and Tom Gedeon},
  title = {{Rethinking Binary Hyperparameters for Deep Transfer Learning}},
  booktitle = {ICONIP},
  year = {2021},
  doi = {10.1007/978-3-030-92270-2\_40},
}
Figure