Paper commentary
CNN Features off-the-shelf: an Astounding Baseline for Recognition
Off-the-shelf OverFeat features beat tuned systems on many recognition tasks
- Problem Recognition pipelines have usually been tuned separately for each task, so it was unclear whether a network trained for ILSVRC classification gives features that work on other tasks.
- Method The authors freeze the OverFeat network without retraining it and feed its 4096-dimensional first fully connected layer, L2-normalized, to a linear SVM.
- Results CNNaug-SVM reaches 77.2 mAP on Pascal VOC 2007, above the best compared method at 71.1.
A network trained for one task, reused for many
OverFeat is a convolutional network trained on the ILSVRC13 image classification task, using about 1.2 million hand-labelled images spread over 1000 categories. The network itself is never retrained here. Only a classifier is fitted for each target dataset, while the features come from the ImageNet-trained network. The question is whether the activations of this network can serve as a general image description for tasks that differ from ILSVRC classification.
The tasks are ordered by distance from the training objective, starting with object classification and scene recognition and moving to fine-grained recognition, attribute detection and instance retrieval. Each task is compared against a tuned system built for it, so a frozen feature paired with a simple classifier has to match methods that use dedicated engineering.
From a photo to a linear decision
Each input, whether the whole image or a cropped sub-window, is resized to 221×221 before it enters the network. The feature is the response of the first fully connected layer, layer 22, which is a 4096-dimensional vector. Max-pooling and rectification are counted as separate layers in this numbering, which differs from Krizhevsky's ConvNet.
The vector is L2 normalized to unit length before classification.
The classifier is a linear SVM trained by minimizing one half of the squared norm of the weight vector plus C times the sum of hinge terms, each one being the maximum of 1 minus y_i times the inner product of w and x_i, and zero. \[ \min_{w}\ \tfrac{1}{2}\lVert w\rVert^{2} + C\sum_{i}\max\bigl(1-y_i\,w^{T}x_i,\;0\bigr) \] The parameter C sets the trade-off between margin and training error, and it was cross-validated separately for each dataset, with values such as 0.2 for VOC2007 and 2 for MIT67.
Tasks with labels that are not mutually exclusive use one-against-all classifiers, while the remaining tasks use one-against-one linear SVMs combined by voting.
For CNNaug-SVM, each training sample becomes 16 representations: the original image, five crops, two rotations and their mirror images. The crops are sub-windows that cover 4/9 of the image area, taken from the four corners and the centre. Each feature is then passed through a signed component-wise power transform that raises every dimension to the power of 2.
At test time, the responses for multiple representations of one image are summed, which the authors found to work better than taking the maximum. For the bird and H3D datasets, the bounding box is enlarged by 150% to include context.
Object and scene classification results
On Pascal VOC 2007, measured by mAP, CNNaug-SVM reaches 77.2 and CNN-SVM reaches 73.9. The best of the compared methods in Table 1 is AGS at 71.1, and the comparison includes only methods that used training data outside the standard VOC 2007 set. CNNaug-SVM has higher average precision on 10 of the 20 classes, and the authors note that the compared baselines use sophisticated matching systems.
On the MIT-67 indoor scenes, mean Accuracy is 58.4 for CNN-SVM and 69.0 for CNNaug-SVM. The augmented variant is above MLrep at 64.0 and the plain variant is below IFV at 60.8 in the same table. Mean Accuracy is taken from the diagonal of the confusion matrix, so each class counts equally, and the authors point out that indoor scenes share many objects, which makes them harder than outdoor scenes.
Fine-grained and attribute results
On CUB 200-2011, CNN-SVM reaches 53.3 and CNNaug-SVM reaches 61.8, and only the bounding box annotation is used during training and testing. Among the rows that use no part information, CNNaug-SVM gives the highest value, while the pose-normalized DPD-based row at 65.0 uses part information.
On Oxford 102 Flowers, CNN-SVM without segmentation reaches 74.7 and CNNaug-SVM without segmentation reaches 86.8. The best segmentation-based entry in Table 4 is 80.7, and the other methods in that table subtract the flower from the background.
On H3D, CNNaug-SVM reaches a mAP of 73.0 and CNN-SVM reaches 70.8, compared with 69.9 for DPD and 65.2 for Poselets. DPD and Poselets use part-level annotations during training, whereas the CNN feature is taken from the bounding box around each person.
On the UIUC 64 object attributes dataset, CNNaug-SVM reaches a mAUC of 91.5 and CNN-SVM reaches 89.0, compared with 73.0 for Farhadi et al. Within-category and across-category protocols both appear in that table, and the CNN rows are within the same evaluation setup as the other entries.
Spatial search and feature processing for retrieval
Retrieval is evaluated on Oxford5k with 5063 reference photos and 55 queries, Paris6k with 55 queries and 6412 reference photos, and Sculptures6k with 70 queries and 6340 reference images. Holidays has 1491 images of which 500 are queries, and UKbench has 2250 items from four viewpoints, scored by recall at the top four. The low-memory methods used as comparison, such as VLAD, BoW, IFV, Hamming Embedding and BoB, use dictionaries learned on similar or the same data as their test sets.
Spatial search extracts sub-patches at several levels. At level i, there are i squared overlapping sub-patches of the same size, and together they cover the whole image. The distance from a query sub-patch to a reference image is the minimum L2 distance to that reference's sub-patches. The image-level distance is the average of these per-sub-patch distances over the query sub-patches.
Unlike classification, the features are taken from the smallest square that contains the region of interest rather than from a resized image.
After extraction, the 4096-dimensional features are L2 normalized, reduced by PCA to 500 dimensions, whitened and renormalized with L2. A signed component-wise power transform with power 2 is applied last, and for the other two datasets the same jittering as in classification is used in place of spatial search.
Retrieval results and their scope
CNNaug-ss reaches 68.0 mAP on Oxford5k, 79.5 on Paris6k, 42.3 on Sculptures6k, 84.3 mAP on Holidays and 91.1 recall at the top four on UKbench. The plain CNN representation, without spatial search, scores 32.2, 49.5, 24.1, 64.2 and 76.0 on the same five datasets.
Among the low-memory footprint methods in Table 7, the CNN features score higher on every benchmark reported in the table except Sculptures6k. The comparison leaves out systems that impose 3D geometric constraints and excludes post-processing such as spatial re-ranking and query expansion. Methods such as ASMK+MA and the fine vocabulary approach use codebooks of around a million entries with binarization to reach a 64k memory footprint, and they score higher on Oxford5k and Paris6k.
Effect of the network depth on classification
Performance rises over the last two layers, while the mid-layer dips, for example at layers 4 and 8, are attributed to the ReLU layer, which half-rectifies the signal. The authors say this nonlinearity helps the trained network but does not help when a representation is used directly for classification.
Limitations
In its simplest form, CNN-SVM did not beat the latest best methods on the bird and flower datasets, and augmentation was needed to surpass them. The fine-grained result for CUB depends on the augmentation, since plain CNN-SVM reaches 53.3 against the 65.0 of the part-aware DPD-based row.
Methods that adapt the network to the task score higher: a detector fine-tuned on Pascal VOC 2007 reaches 53.1, where the off-the-shelf features reached 46.2 mAP. A task-adapted attribute architecture reaches 78.98 mAP, against 73.0 for CNNaug-SVM on H3D.
No object detection experiment was run, and the detection result quoted comes from the work of Girshick et al. Only the large version of OverFeat was used, and other publicly available implementations were not benchmarked. The retrieval comparison excludes methods that use 3D constraints and post-processing, and it compares only against low-memory footprint methods.
What the authors conclude
The authors conclude that features from a CNN trained on ILSVRC should be the primary candidate for most visual recognition tasks. They qualify this: optimizing the CNN features for a specific task would probably push results further, given enough computational resources. They also suggest that any new recognition algorithm should be compared against a baseline of generic deep features with a simple classifier.
Paper info
- Authors
- Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, Stefan Carlsson
- Venue
- arXiv · Preprint
- First published
- 2014-3-23
- Added
- 2026-11-12
- Updated
- 2014-5-12
- Version
- v3
- arXiv
- 1403.6382
- Category
- cs.CV
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
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
Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, Stefan Carlsson (2014). CNN Features off-the-shelf: an Astounding Baseline for Recognition. arXiv:1403.6382v3. https://arxiv.org/abs/1403.6382v3
BibTeX
@misc{razavian2014features,
title = {{CNN Features off-the-shelf: an Astounding Baseline for Recognition}},
author = {Ali Sharif Razavian and Hossein Azizpour and Josephine Sullivan and Stefan Carlsson},
year = {2014},
eprint = {1403.6382},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1403.6382v3}
}