# DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition

Frozen CNN features from ImageNet transfer to generic visual recognition tasks

Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng and 1 more · arXiv · 2013-10-6

- **Problem** Deep networks overfit when a new visual task has only a few labeled examples, and training a deep model for each new task is costly. Such tasks are common, so reuse is needed.
- **Method** DeCAF takes activations from a convolutional network trained on ILSVRC-2012 and keeps its weights frozen. It then trains only a simple linear classifier on those features for each new task.
- **Results** On Caltech-101 with 30 training samples per class, a linear SVM on DeCAF6 with dropout reaches 86.9% mean accuracy per category.

## Why fixed features for scarce labels

Deep convolutional networks trained fully supervised on large labeled sets tend to overfit when a new task offers only a handful of examples. Such tasks are common: a user may define a category on the fly from a few images, and fine-grained, attribute and domain adaptation benchmarks also have few labels per class. The study asks whether a network trained once on a fixed set of object recognition tasks can supply a feature that is reused for generic tasks, without training a deep model separately for each new one.

Two questions organize the work: whether features taken from the network generalize to other datasets, and how their quality changes with depth in the network. The target datasets were chosen because they differ from ImageNet in ways that can make a feature latch onto domain-specific appearance, so a feature that holds up on them has to carry real semantic information.

## Building DeCAF from a supervised network

The feature comes from the convolutional network of Krizhevsky et al., trained on ILSVRC-2012. The authors chose it for its performance on a 1000-way task, expecting, as a hypothesis, that its late hidden layers would be strong features for many object recognition tasks. Mean-centered RGB values of a 224×224 image pass through five convolutional layers, with pooling and ReLU along the way, and then three fully connected layers that end in a distribution over the 1000 categories.

The authors' own instance reaches 42.9% error on the ILSVRC-2012 validation set, which is 2.2% above the 40.7% reported by Krizhevsky et al. for their model. Images are warped to 256×256 without keeping the aspect ratio, and the colour augmentation based on RGB principal components used in the original training is left out.

Each feature is named after the hidden layer whose activations it uses: DeCAF7 is the last hidden layer before the final classification layer, DeCAF6 is the one before it, and DeCAF5 is the one before DeCAF6. DeCAF5 is the first set of activations that has passed fully through the convolutional layers. Earlier layers were not evaluated, because the authors judged them unlikely to hold richer semantics than the later layers.

The network weights stay frozen at their ILSVRC-2012 values, so producing a feature is one forward pass on the central 224×224 crop of the 256×256 resized image. Only the classifier placed on top is trained for each target task. Randomly initialised weights were also tried as features, and the authors report performance comparable to traditional hand-designed features.

The decaf implementation runs without a GPU, using numpy and scipy with computation-heavy parts in C, and the authors report about 40 images per second on an 8-core commodity machine in minibatch mode. The implementation and the network parameters are released, so features can be extracted without retraining the large network.

## What the t-SNE embeddings show

To inspect semantic structure, the features of ILSVRC-2012 validation images are embedded in two dimensions with t-SNE and coloured by category in a WordNet hierarchy. The validation set is used so that overfitting effects do not enter, since the network was trained only on the training set.

The first pooling layer does not show a clear semantic grouping, while DeCAF6, the second-to-last hidden layer, does. The authors read this as early layers encoding low-level structure and later layers encoding higher-level semantics. GIST and LLC, shown beside them, do not capture the same semantic difference, although they show some clustering structure of their own.

On SUN-397, the DeCAF6 features also cluster semantic groups such as indoor and outdoor scenes, which the authors take as a sign that the features suit general object recognition. Because the clusters span several intermediate WordNet nodes, the authors expect the features to help with categories that were absent from ILSVRC-2012. LLC has 16K dimensions, so it was randomly projected to 512 dimensions before embedding, since random projections roughly preserve the distances t-SNE relies on.

## Object recognition on Caltech-101

Each run trains on 30 samples per class, including the background class, and tests on the rest of the data. Logistic regression and a support vector machine are both tried, with parameters chosen on a 25 train and 5 validation subsplit, and results are mean accuracy per category over five splits. Dropout randomly sets half of the activations to zero during training and multiplies activations by 0.5 at test time.

Krizhevsky et al. used it in layers 6 and 7, and the authors follow that choice for DeCAF6 and DeCAF7.

The top configuration by validation accuracy is a linear SVM on DeCAF6 with dropout, which reaches 86.9% on the test data. DeCAF7 scores about 1 to 2% below DeCAF6, dropout improves each classifier and feature pair by 0 to 2%, and DeCAF5 is substantially worse, so it is not evaluated further. In the one-shot setting with a single positive example, the SVM reaches 33.0%.

Yang et al. (2009) combine five hand-engineered image features with a multi-kernel classifier and score 84.3. The linear SVM on a single DeCAF feature is 2.6% higher than this method. The two-layer convolutional network of Jarrett et al. (2009) scores 65.5, and the best DeCAF configuration is over 20% higher, which the authors link to the depth of the network used for the feature.

Those baselines do not draw on an outside large image database such as ImageNet, so the authors credit the margin to multi-task learning on sparse data.

## Domain adaptation on Office

The Office dataset has three domains, Amazon, Webcam and Dslr, and the experiments use the supervised setting, in which a small amount of labeled target data is available. SURF is the baseline feature shipped with the dataset. DeCAF6 and DeCAF7 replace it while the classifiers stay the same. Logistic regression and an SVM are each trained on source data only (S), target data only (T) or source plus target data (ST).

The authors describe the Dslr to Webcam domain shift as largely absent with DeCAF features.

The table also places adaptive methods of Daume III, Hoffman et al., Gong et al. and the deep method of Chopra et al. next to the non-adaptive classifiers. The authors state that DeCAF outperforms both the SURF baseline and the Chopra et al. method. A t-SNE plot of Webcam and Dslr images shows scissors images clustering across both domains with DeCAF6, while SURF clusters only a subset and places the rest near unrelated categories.

## Fine-grained birds with part pooling

The ImageNet-like pipeline crops each image to 1.5 times the provided bounding box, resizes it to 256×256, computes DeCAF6 and trains a multi-class logistic regression on top. The pose-normalized pipeline keeps the deformable part descriptors method, with its DPM part predictions and learned pooling weights, and replaces the KDES image features with DeCAF6 computed on each predicted part box.

The ImageNet-like pipeline with DeCAF6 and logistic regression reaches 58.75. Adding DeCAF6 to the part-based pipeline reaches 64.96, against 50.98 for DPD as reported by Zhang et al. (2013) and 56.78 for POOF. The authors state that a simple logistic regression on DeCAF already improves on earlier approaches, and that explicit part structure gives a further gain.

No CNN layer is fine-tuned in these experiments. The authors read the gains as a sign that DeCAF works as an off-the-shelf representation, and they state that 64.96 is the best accuracy they know of for this dataset.

## Scene recognition on SUN-397

SUN-397 has 397 scene categories. Each run trains on 50 images per class and tests on 50, over five splits. Within each split, the top configuration is chosen by cross-validation on 42 training and 8 held-out images, with parameters fixed across methods.

Against the multi-kernel method of Xiao et al. (2010), which scores 38.0 in Table 3, the authors report a 2.9% improvement using only DeCAF.

The Xiao et al. baseline combines many traditional vision features with multi-kernel learning. The authors take the win of a simple linear classifier on one DeCAF feature as evidence of its representational power.

## Where the computation goes

Across layer types, convolution accounts for 32.6% of computation time and fully connected layers for 57.1%, while neuron layers take 6.3% and pooling 4.1%.

The authors note that in a large network like the ImageNet CNN, the last few fully connected layers need the most time because of their large transform matrices. They expect this to matter with more categories or larger hidden layers, and suggest that sparse approaches such as Bayesian output coding may be needed for classification into still larger numbers of categories.

The 40 images per second figure is a separate throughput measurement in minibatch mode on an 8-core commodity machine, and it is not part of the single-image layer breakdown.

## Limitations

Every reported experiment keeps the CNN frozen. The authors note that full back-propagation may give better results, but their focus is on the features as they are. The network was trained once, with a single model reaching 42.9% validation error, while the original ensemble of seven models reached 36.7%. The scene task uses a feature learned on an object database, which the authors expected to be very challenging unless the features are highly generic.

The birds results depend on the part annotations and the DPM part predictions of the DPD pipeline. The cluster analysis is qualitative and shown only in figures, so the strength of the clustering is judged by eye. Depth is examined only through DeCAF5, DeCAF6 and DeCAF7, since earlier layers were not evaluated.

## Paper info

- **Authors**: Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, Trevor Darrell
- **Venue**: arXiv · Preprint
- **First published**: 2013-10-6
- **Added**: 2026-11-12
- **Updated**: 2013-10-6
- **Version**: v1
- **arXiv**: 1310.1531
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1310.1531v1) · [PDF ↗](https://arxiv.org/pdf/1310.1531v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, Trevor Darrell (2013). DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition. arXiv:1310.1531v1. https://arxiv.org/abs/1310.1531v1

**BibTeX**

```
@misc{donahue2013decaf,
  title = {{DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition}},
  author = {Jeff Donahue and Yangqing Jia and Oriol Vinyals and Judy Hoffman and Ning Zhang and Eric Tzeng and Trevor Darrell},
  year = {2013},
  eprint = {1310.1531},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1310.1531v1}
}
```

## Related papers

- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://refivu.com/en/papers/f48d9414-bde0-4715-b509-86fcc9cd454d-very-deep-convolutional-networks-for-large-scale-image.md)
- [Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift](https://refivu.com/en/papers/bd3e1105-da91-407a-8b28-4217cd2afedf-batch-normalization-accelerating-deep-network-training-by.md)
- [Multimodal Machine Learning-based Knee Osteoarthritis Progression Prediction from Plain Radiographs and Clinical Data](https://refivu.com/en/papers/2b4e96e0-64f3-4752-8b7e-3e4c0c68dc86-multimodal-machine-learning-based-knee-osteoarthritis.md)
- [Advanced Steel Microstructural Classification by Deep Learning Methods](https://refivu.com/en/papers/40557ea6-2c03-4d59-8884-5b126f8414d1-advanced-steel-microstructural-classification-by-deep.md)
- [Text Classification Algorithms: A Survey](https://refivu.com/en/papers/5134d426-2cd3-4691-aeff-cf1fc4cb8d39-text-classification-algorithms-a-survey.md)
- [Long-term Recurrent Convolutional Networks for Visual Recognition and Description](https://refivu.com/en/papers/746c9a37-e85c-4acd-aec2-5cfa2639a609-long-term-recurrent-convolutional-networks-for-visual.md)

## Other paper commentary

- [Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers](https://refivu.com/en/papers/c0f3cbcf-d34f-4a38-a72f-084577c0ea46-rethinking-semantic-segmentation-from-a-sequence-to-sequence.md)
- [CenterNet: Keypoint Triplets for Object Detection](https://refivu.com/en/papers/f08ac102-1d96-4756-a172-5c1d6ab4ebfb-centernet-keypoint-triplets-for-object-detection.md)
- [SlowFast Networks for Video Recognition](https://refivu.com/en/papers/f84c7c1a-0798-4d78-bcc9-020ba5b4e4b1-slowfast-networks-for-video-recognition.md)
- [Temporal Segment Networks: Towards Good Practices for Deep Action Recognition](https://refivu.com/en/papers/4ab41218-ea1b-4152-8de5-9a1821a733af-temporal-segment-networks-towards-good-practices-for-deep.md)
- [Ward's Hierarchical Clustering Method: Clustering Criterion and Agglomerative Algorithm](https://refivu.com/en/papers/f6ffd1cf-34b4-43fb-8682-2d02bbee1019-ward-s-hierarchical-clustering-method-clustering-criterion.md)
- [DARTS: Differentiable Architecture Search](https://refivu.com/en/papers/e93ed790-8383-46f1-928b-765de23e1c42-darts-differentiable-architecture-search.md)
- [ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R](https://refivu.com/en/papers/b375508f-0b8f-45c6-97cd-0423c04a78e0-ranger-a-fast-implementation-of-random-forests-for.md)
- [Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond](https://refivu.com/en/papers/11ff1363-cafd-421d-bece-bfc246ea3170-qwen-vl-a-versatile-vision-language-model-for.md)
- [Relational inductive biases, deep learning, and graph networks](https://refivu.com/en/papers/0c3b2fdd-4cb0-4de6-974a-86a02b5eb284-relational-inductive-biases-deep-learning-and-graph-networks.md)
- [Variational Quantum Algorithms](https://refivu.com/en/papers/6d58f3e0-2a35-428c-950f-93a8daccb221-variational-quantum-algorithms.md)
- [Improved Regularization of Convolutional Neural Networks with Cutout](https://refivu.com/en/papers/d80e705e-3fc6-493a-8930-a9a747173bb7-improved-regularization-of-convolutional-neural-networks.md)

## Terms in this paper

- [dropout](https://refivu.com/en/terms/db73f75bbdd3-dropout)
- [transfer learning](https://refivu.com/en/terms/9c71d6928a00-transfer-learning)
- [t-SNE](https://refivu.com/en/terms/488ecf7dbbcf-t-sne)
- [Logistic Regression](https://refivu.com/en/terms/3551369d301a-logistic-regression)
- [Multi-Task Learning](https://refivu.com/en/terms/89df753d67c1-multi-task-learning)
- [object recognition](https://refivu.com/en/terms/7189055bcf66-object-recognition)
- [domain adaptation](https://refivu.com/en/terms/dfc6e2afbc1f-domain-adaptation)
- [Support Vector Machine](https://refivu.com/en/terms/34721f065497-support-vector-machine)
- [ILSVRC-2012](https://refivu.com/en/terms/7bb644f8ec73-ilsvrc-2012)
- [Caltech-101](https://refivu.com/en/terms/ad598419a301-caltech-101)
- [DeCAF](https://refivu.com/en/terms/fda9cdae5064-decaf)
- [scene recognition](https://refivu.com/en/terms/2491a7f9a499-scene-recognition)
- [dataset bias](https://refivu.com/en/terms/4cc1457d58b3-dataset-bias)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/b018056b-58d2-42cc-9184-ed3588d7abd4-decaf-a-deep-convolutional-activation-feature-for-generic)
