# OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks

Shared ConvNet features let one network classify, locate and detect objects

Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, Yann LeCun · arXiv · 2013-12-21

- **Problem** Convolutional networks had mostly been shown for whole-image labels, so a window covering only part of an object gives a plausible class with a poor box. Localization and detection had no shared network that could do all three tasks.
- **Method** OverFeat runs one multi-scale sliding-window ConvNet over the whole image in a single pass. A regression network then predicts a box at each location, and boxes are merged rather than suppressed.
- **Results** It won the ILSVRC13 localization task with 29.9% top-5 localization error. After the competition, detection reached 24.3% mAP, against 19.4% during it.

## Why one network for three tasks

ConvNets trained end to end had become strong classifiers on ImageNet, but the objects in that dataset do not always fill the frame or sit at the center. A window that catches only the head of an animal can yield a correct class with a poor box, so classification success does not carry over to location.

The paper asks whether a single ConvNet can classify, locate and detect objects at once, and whether the three tasks can share one feature extractor. A second question is whether detection can be obtained by adding up many box predictions, so that no background class has to be trained and no bootstrapping passes are needed.

Earlier sliding-window ConvNet work covered digits, faces, hands and pedestrians, and related approaches predicted pose parameters or used segmentation. The authors note that the ImageNet 2012 winners had described their localization only briefly, so no public account existed of how a ConvNet could localize on this data.

## Task definitions and evaluation rules

The three tasks are ordered by difficulty, and each one is a sub-task of the next, so the same framework serves all of them. Classification gives five guesses per image, each a single label for the main object. Localization keeps the five guesses but attaches a bounding box to each guess, and a guess counts as correct only when its box matches the ground truth by at least 50% overlap and its label is right.

Detection allows any number of objects per image, including none, and penalizes false positives through mean average precision. Localization serves as a middle step: it tests the localization method without the background-class issues that come with detection. Classification and localization use the same images, while detection adds images in which small objects appear and some objects are absent.

## Training the classification network

The network is based on the ILSVRC12 architecture of Krizhevsky et al., and it is trained on the 1.2 million ImageNet 2012 training images across 1000 classes. Each image is rescaled so that its smallest side is 256 pixels, and five random 221x221 crops are taken with their horizontal flips, presented in mini-batches of 128.

Dropout with rate 0.5 is applied to the two fully connected classifier layers, the 6th and 7th. During training the network is treated as non-spatial, so its last maps are 1x1; spatial outputs appear only at inference time.

The stride change helps accuracy at some cost in speed, and the paper's Table 1 gives the layer sizes of the fast model.

## Dense multi-scale classification

The baseline multi-view scheme averages a fixed set of ten views, which can skip image regions and repeats work when views overlap. Here the convolutional layers run over the whole image at several scales, so a feature map is produced in one pass and the classifier is applied across it. Six input scales are used, and at each scale the layer 5 maps are pooled and then classified by a 5x5 window moved across them.

With the usual subsampling, the total ratio is 36 pixels, so the classifier could emit a vector only every 36 pixels and would often miss the object's alignment. The offsets are 0, 1 and 2 along each axis, so each pooled map is replicated 3 by 3 times and the outputs for all offsets are interleaved into one spatial class map.

The classifier output is then taken as a spatial maximum for each class, at each scale and flip, averaged over scales and flips, and the top-1 or top-5 classes are read from the mean vector. The feature layers are therefore run once per image while the classifier runs in a window, the reverse of how the two halves are used in a sliding-window pipeline.

Because the last layers are fully connected but act as 1x1 convolutions at test time, the whole network is a sequence of convolutions, pooling and thresholding.

## Classification results

On the validation set, the fast model with one scale and coarse stride reached 17.12 top-5 error, and the fine stride lowered it to 16.97 at the same scale. Four scales with fine stride gave 16.39, and six scales gave 16.27, so more scales lower the error. The accurate model with four scales and fine stride gave 14.18, against 16.39 for the fast model.

Averaging over seven fast models gave 13.86 top-5 error on validation, and seven accurate models gave 13.24. The paper contrasts the single-network results with Krizhevsky et al. at 18.2 top-5, and the accurate model needs nearly twice as many connections as the fast one. The authors report that the speedup from the fast model comes with that accuracy trade-off.

On the 2013 test set, the competition entry averaged seven ConvNets and reached 14.2% top-5 error, ranking fifth out of 18 teams. Post-competition models with more features and layers reached 13.6% error, although the authors say these bigger models were not fully trained. The paper cites 11.7% as the best figure using only ILSVRC13 data, and 11.2% when pre-training used the Fall11 ImageNet data.

## Regression network for bounding boxes

The classifier layers are replaced by a regression network, while the feature layers are shared, so only the final regression layers are recomputed once the classification pass is done. The softmax output for a class at a location gives the confidence that an object of that class lies in that window, so each predicted box inherits a confidence.

The regressor has two fully connected hidden layers of 4096 and 1024 units, and its final layer has four outputs for the box edges, with the same 3 by 3 shift copies as the classifier.

The final regression layer is class-specific with 1000 versions, and each training box is compared with the regressor output after shifting it into the window's frame. A box with less than 50% overlap with the input window is excluded from training, because it is better handled by a window that contains the object.

Training across scales makes predictions agree from one scale to the next and raises confidence when they agree, so a few scales suffice. The scale ratio used is about 1.4, well above the 1.05 to 1.1 typical for pedestrian detection, and the exact value varies by scale because dimensions are fitted to the network stride.

## Merging boxes into final detections

For each scale, the top k classes are selected by their maximum detection output over locations, and the regressed boxes of those classes across all locations form the candidate set. The candidates from all scales are pooled, and then the pair with the lowest match score is merged repeatedly. A match score combines the distance between the box centers with the intersection area, and merging replaces the two boxes with their averaged coordinates.

The loop stops when the best match score exceeds a threshold t. Each surviving box keeps the class output summed over the windows that produced it, and the highest class score wins. In the bear example, many boxes with confidence around 0.5 per scale collapse into one high-confidence box, while turtle and whale boxes with confidences of at most 0.11 and 0.12 do not gather enough support and drop out.

The authors argue that rewarding coherent boxes makes the approach more robust to false positives than standard non-maximum suppression, though this is their interpretation of one example.

## Localization results

On the ILSVRC12 validation set, a single centered crop gave a 40% error, and combining regressor predictions from all locations at two scales gave 31.5%. The multi-scale and multi-view combination is therefore the main source of the improvement in these experiments.

The competition entry used four scales and single-class regression, and it reached 29.9% localization error (top 5), the best result in the ILSVRC13 localization competition.

Per-class regression, which gives each of the 1000 classes its own final layer, reached 44.1% error against 31.3% for single-class regression in the validation experiments. The authors attribute this to the much larger number of top-layer parameters, which is hard to train when each class has few annotated boxes, and they suggest sharing layers among similar classes as a possible fix that was not tested.

## Detection without background training

Detection training follows the classification setup but runs over several spatial locations at once, with all weights shared among them. Instead of collecting hard negatives in separate bootstrapping passes, the system chooses a few negative examples per image on the fly, either at random or as the most offending ones. This costs more computation per image, but the procedure is simpler, and because feature extraction was pre-trained on classification the detection fine-tuning is short.

In the ILSVRC13 competition the detector ranked third with 19.4% mAP, and post-competition work reached 24.3% mAP. The UvA entry ranked first with 22.6% mAP during the competition, and the fourth entry reached 11.5% mAP. The two entries ahead of the rest rely on a segmentation step that cuts candidate windows from about 200,000 to 2,000, which the paper contrasts with its dense approach.

The authors did not tune on the detection validation set, unlike the NEC and UvA entries, and they estimate that the validation and test distributions alone account for about one point of difference. The gap between the two OverFeat detection results is attributed to longer training and to using lower-resolution scales as context.

## Limitations

Localization was trained without back-propagating through the whole network, which the authors expect may limit performance. The regressor uses an l2 loss even though performance is measured with the intersection-over-union criterion, and the authors note that IOU remains differentiable where boxes overlap. The bounding box parameterization is also named as a possible source of correlated outputs that could be changed.

The bigger post-competition models were not fully trained because of time constraints, and the classification features were not explored as fully as in the original work. The detection data includes images without some objects that could support bootstrapping, but this was not used. The per-class regression result was tested only with the parameter-sharing alternative left as a suggestion.

## Paper info

- **Authors**: Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, Yann LeCun
- **Venue**: arXiv · Preprint
- **First published**: 2013-12-21
- **Added**: 2026-11-12
- **Updated**: 2014-2-24
- **Version**: v4
- **arXiv**: 1312.6229
- **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/1312.6229v4) · [PDF ↗](https://arxiv.org/pdf/1312.6229v4)

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

Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, Yann LeCun (2013). OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks. arXiv:1312.6229v4. https://arxiv.org/abs/1312.6229v4

**BibTeX**

```
@misc{sermanet2013overfeat,
  title = {{OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks}},
  author = {Pierre Sermanet and David Eigen and Xiang Zhang and Michael Mathieu and Rob Fergus and Yann LeCun},
  year = {2013},
  eprint = {1312.6229},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1312.6229v4}
}
```

## Related papers

- [Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks](https://refivu.com/en/papers/9994e70e-3188-4b2d-942c-0d00ab885d3f-faster-r-cnn-towards-real-time-object-detection.md)
- [Rich feature hierarchies for accurate object detection and semantic segmentation](https://refivu.com/en/papers/0abb1ab7-a65a-475d-b57e-af628d8620f3-rich-feature-hierarchies-for-accurate-object-detection-and.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)
- [Receptive Field Block Net for Accurate and Fast Object Detection](https://refivu.com/en/papers/c379e7ab-56c5-489a-a229-d959705f520a-receptive-field-block-net-for-accurate-and-fast.md)
- [Learning without Forgetting](https://refivu.com/en/papers/3784f887-f12a-406c-9f7c-0b1573555ee3-learning-without-forgetting.md)
- [Multi-view Convolutional Neural Networks for 3D Shape Recognition](https://refivu.com/en/papers/80b8aedd-6f52-4a73-bc81-a80322e5e37c-multi-view-convolutional-neural-networks-for-3d-shape.md)

## Other paper commentary

- [Random Erasing Data Augmentation](https://refivu.com/en/papers/4dd86d04-2086-4796-aa90-74b9d083d0ee-random-erasing-data-augmentation.md)
- [CornerNet: Detecting Objects as Paired Keypoints](https://refivu.com/en/papers/f70d57a2-b48d-4fc2-baa1-2e7e2057bad5-cornernet-detecting-objects-as-paired-keypoints.md)
- [Deep CORAL: Correlation Alignment for Deep Domain Adaptation](https://refivu.com/en/papers/0a5f5341-f013-4a47-b5c4-af4c12f6a0aa-deep-coral-correlation-alignment-for-deep-domain-adaptation.md)
- [Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics](https://refivu.com/en/papers/7546f3a0-585b-406e-b199-f4b06c78a42f-multi-task-learning-using-uncertainty-to-weigh-losses.md)
- [UNETR: Transformers for 3D Medical Image Segmentation](https://refivu.com/en/papers/7d0e871a-75c5-45c6-ae1f-3039c5a8a533-unetr-transformers-for-3d-medical-image-segmentation.md)
- [SAM 2: Segment Anything in Images and Videos](https://refivu.com/en/papers/44b54691-126e-4def-9b6b-d659caa1f50d-sam-2-segment-anything-in-images-and-videos.md)
- [Accelerating the Super-Resolution Convolutional Neural Network](https://refivu.com/en/papers/36219c92-ee60-4179-a5b4-065fdb8a7ff4-accelerating-the-super-resolution-convolutional-neural.md)
- [DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation](https://refivu.com/en/papers/b9c76a95-d60f-4b38-98c6-45cfaa2bcd30-deepsdf-learning-continuous-signed-distance-functions-for.md)
- [A Closer Look at Spatiotemporal Convolutions for Action Recognition](https://refivu.com/en/papers/2986e935-85a4-4ed6-b429-74af2338096c-a-closer-look-at-spatiotemporal-convolutions-for-action.md)
- [Understanding deep learning requires rethinking generalization](https://refivu.com/en/papers/cb138997-32a3-4005-82f2-6597e2492ff8-understanding-deep-learning-requires-rethinking.md)
- [Measuring Mathematical Problem Solving With the MATH Dataset](https://refivu.com/en/papers/11c81528-fe00-480d-b385-0b65503db8a1-measuring-mathematical-problem-solving-with-the-math-dataset.md)
- [SimCSE: Simple Contrastive Learning of Sentence Embeddings](https://refivu.com/en/papers/be6ac7d7-6b80-4ef3-905e-9b7eecc4765c-simcse-simple-contrastive-learning-of-sentence-embeddings.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [dropout](https://refivu.com/en/terms/db73f75bbdd3-dropout)
- [mean Average Precision](https://refivu.com/en/terms/7908941f08d6-mean-average-precision)
- [top-5 error](https://refivu.com/en/terms/beb42c9fbaad-top-5-error)
- [sliding window](https://refivu.com/en/terms/36584a6497c3-sliding-window)
- [ConvNets](https://refivu.com/en/terms/5e63ca0d4637-convnets)
- [detection](https://refivu.com/en/terms/c7b79c4839be-detection)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/a615b23b-cb60-4fff-95a7-0a3b82dc2d4e-overfeat-integrated-recognition-localization-and-detection)
