Deep Fishing: Gradient Features from Deep Nets

Albert Gordo, Adrien Gaidon, Florent PerronninarXiv 2015

TL;DR

This paper bridges the gap between classical Fisher Vectors and modern Convolutional Neural Networks (ConvNets) by using back-propagated gradients as image features. By leveraging the rank-1 structure of these gradients, the authors enable efficient similarity matching that consistently outperforms standard forward-pass activations on image classification benchmarks.

What Problem Does This Paper Address?

In the era before the deep learning revolution, the Fisher Vector (FV) was the gold standard for image classification. It worked by encoding how local image features deviated from a generative model using gradients. When ConvNets took over, researchers shifted to using "forward-pass" activations (like the output of the FC7 layer) as universal feature extractors.

However, these forward activations only tell half the story. The authors ask: Can we bring the gradient-based power of Fisher Vectors into the ConvNet world? Specifically, can the information contained in the back-propagation pass—which is usually discarded after training—be used to create a richer, more discriminative representation for transfer learning?

Methods

The authors propose a novel way to extract features by looking at the gradient of the loss with respect to the network's parameters at test time.

  1. Gradient Extraction: Since we don't know the true labels of a test image, the authors compute the gradient of a cross-entropy loss against a "non-informative" uniform label distribution (assuming all classes are equally likely).
  2. The Rank-1 Trick: A major challenge is dimensionality. The gradient with respect to a fully connected layer's weights ($W_k$) can involve millions of parameters, making direct comparison impossible. However, the authors observe that this gradient is a rank-1 matrix: it is simply the outer product of the forward activation ($x_{k-1}$) and the back-propagated error signal ($\partial E / \partial y_k$).
  3. Efficient Kernels: Because of this structure, the similarity between two images can be computed using a "trace kernel." Instead of calculating a massive dot product, you simply multiply the similarity of their forward activations by the similarity of their backward error signals.
Figure 1: AlexNet architecture [20]. Ck are the parameters (4D tensors) of the convolutional layers. Wk are the parameters (matrices) of the fully connected layers. Black (resp. red) arrows represent the information flow during the forward (resp. backward) pass. Inspired by the Fisher Kernel [17], we study the use of gradient-related information (the blue matrices) as transferable representations.

Datasets

The authors evaluated their approach using two standard computer vision benchmarks:

  • Pascal VOC 2007: 9,963 annotated images across 20 categories.
  • Pascal VOC 2012: 22,531 annotated images.
  • Pre-training: Both AlexNet and VGG16 models were pre-trained on the ILSVRC2012 (ImageNet) dataset before being used as feature extractors for the VOC tasks.

Key Insights and Ideas

  • Gradients as "Universal" Features: The gradient captures how much each parameter needs to change to accommodate a specific image. This provides a more nuanced "fingerprint" of the image than simple activations.
  • The Power of Back-prop at Test Time: Most applications only use the forward pass at test time. This paper shows that the backward pass contains valuable structural information that can significantly boost classification accuracy.
  • Diminishing Returns with Model Depth: The technique provides a massive boost for shallower, less discriminative networks like AlexNet (+3.8% mAP) but offers more modest gains for powerful models like VGG16 (+0.6% mAP). This suggests that gradient features can help "recover" discriminative power that a smaller network might have missed during its forward pass.
  • Saturation at the Top: The method works best in the middle-to-late layers (FC6, FC7). At the very final layer (FC8/Probability), the signal degrades because the SoftMax function tends to saturate, losing useful gradient information.

Key Results

The authors demonstrated consistent improvements over standard forward-pass baselines:

  • AlexNet on VOC 2007: Using gradient features from the $W_6$ layer achieved 80.2% mAP, a significant jump from the 77.1% mAP obtained using standard FC6 activations.
  • VGG16 on VOC 2007: The gradient approach reached 90.0% mAP, outperforming the best individual forward layer (89.4%).
  • Per-Class Performance: On VOC 2007, the gradient representation outperformed standard activations in 18 out of 20 object categories for AlexNet and 17 out of 20 for VGG.

Limitations and Future Work

  • Computational Overhead: While the kernel computation is efficient, generating the features requires both a forward and a backward pass at test time. This effectively doubles the computational cost compared to standard feature extraction.
  • Layer Selection: The benefits are layer-dependent. The authors found that the very last layer (FC8) is not suitable for this technique due to probability saturation.
  • Future Directions: The authors suggest that this approach could be combined with other deep learning optimizations, such as model compression or product quantization, to make the high-dimensional gradient information even more practical for large-scale systems.

Summary updated

BibTeX
@misc{gordo2015deep,
  author = {Albert Gordo and Adrien Gaidon and Florent Perronnin},
  title = {{Deep Fishing: Gradient Features from Deep Nets}},
  year = {2015},
  eprint = {1507.06429},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1507.06429},
}
Figure