GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

1

Object Extent Pooling for
Weakly Supervised Single-Shot Localization
Amogh Gudi121

Vicarious Perception Technologies
Amsterdam, NL

2

Delft University of Technology
Delft, NL

amogh@vicarvision.nl

Nicolai van Rosmalen? 12
nicolai@vicarvision.nl

Marco Loog2m.loog@tudelft.nl

Jan van Gemert2
j.c.vangemert@tudelft.nl

Abstract
In the face of scarcity in detailed training annotations, the ability to perform object
localization tasks in real-time with weak-supervision is very valuable. However, thecomputational cost of generating and evaluating region proposals is heavy. We adapt
the concept of Class Activation Maps (CAM) [28] into the very first weakly-supervised‘single-shot’ detector that does not require the use of region proposals. To facilitate
this, we propose a novel global pooling technique called Spatial Pyramid Averaged Max(SPAM) pooling for training this CAM-based network for object extent localisation with
only weak image-level supervision. We show this global pooling layer possesses a nearideal flow of gradients for extent localization, that offers a good trade-off between theextremes of max and average pooling. Our approach only requires a single network passand uses a fast-backprojection technique, completely omitting any region proposal steps.
To the best of our knowledge, this is the first approach to do so. Due to this, we are able
to perform inference in real-time at 35fps, which is an order of magnitude faster than all
previous weakly supervised object localization frameworks.

1

Introduction

Weakly supervised object localization methods [3, 14] can predict a bounding box without
requiring bounding boxes at train time. Consequently, such methods are less accurate thanfully-supervised methods [16, 17, 22, 23]: it is acceptable to sacrifice accuracy to reduce
expensive human annotation effort at train time. Similarly, blazing fast fully supervised
single-shot object localization methods such as YOLO [22] and SSD [17] make a similar
trade-off of running speed versus accuracy at test time. More accurate methods [16, 23]
are slower and thus exclude real-time embedded applications on a camera, drone or car.
In this paper we optimize for speed at train time and at test time: We propose the firstweakly supervised single-shot object detector that does not need expensive bounding box
annotations during train time and also achieves real-time speed at test time.
? Equal contribution as the first author.

c 2017. The copyright of this document resides with its authors.
It may be distributed unchanged freely in print or electronic forms.

2

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

Figure 1: Accumulationof ground truth bounding boxes of Pascal VOC2007 centered at the object’s maximum activation. Note that the average extent follows along-tailed distribution.

Figure 2: Gradient flowfrom our region poolinglayer centered aroundthe max activation. Notethat our pooling follows
the average extent illustrated in Figure 1.

Exciting recent work has shown that object detectors emerge automatically in a CNN
trained only on global image labels [2, 19, 28]. Such methods convincingly show that astandard global max/average-pooling of convolutional layers retain spatial information thatcan be exploited to locate discriminative object parts. Consequently, they can predict a point
inside the ground truth bounding box with high accuracy. We take inspiration from theseworks and train only for image classification while exploiting the spatial structure of the
convolutional layers. Our work differs in that we do not aim for predicting a single point
inside the bounding box, we aim to predict full extent of the object: the bounding box itself.
For predicting the object’s extent, we have to decide how object parts are grouped together. Different object instances should be separated while different parts of the same object
should be grouped together. Successful state-of-the-art methods on object localization havetherefore incorporated a local grouping step in the form of bounding box proposals [16, 23].
After grouping, it is enough to indicate object presence and the object localization task is
simplified to a bounding box classification task. In our work, we use no bounding boxes
during training nor box proposals during testing. Instead, we let the CNN do the grouping
directly by exploiting the pooling layer.
The pooling in a CNN groups pixels in a high-resolution image to a lower resolution one.
Choices in pooling determine how the gradient is propagated back through the network. In
average-pooling, the gradient is shared over all underlying pixels. In the case of a global
image label, average-pooling will propagate loss gradients to all pixels in the image equally,
which will cover the object but will also cover the background. In contrast, max-pooling
only promotes the best point and will thus enforce only a single discriminative object partand not the object extent. Average-pooling is too wide, and max-pooling is too narrow; aregional pooling is needed for retaining the extent. Consider Fig 1, where we center the
ground truth bounding boxes around its most discriminative part, given by the maximum
filter response [19]. The average object extent is peaked, but has heavy tails. This motivates
the need for regional pooling. In Fig 2, we show the gradient flow of our proposed pooling method centered around the maximum response. Our pooling method not only assigns
gradients to the maximum or to the full image: it pools regionally.
We present the very first weakly-supervised single-shot detector. It has the following
novelties. (i) Speed: we extend the idea of class activation maps (CAM) [28] onto a single
stage CNN-only architecture for weakly supervised object localization, that achieves good
accuracy while being 10-15 times faster than other related methods. (ii) Extent pooling:a ‘regional’ global pooling technique called the Spatial Pyramid Averaged Max (SPAM)
pooling for capturing the object extent from weak image-level labels during training. (iii)
No region proposals: We demonstrate a simple and fast back-projection pipeline that avoids
the need for costly region proposal algorithms [26]. This allows our framework to perform
real-time inference at 35fps on a GPU.

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

2

3

Related Work

Fully Supervised Object Localization. The state of the art is based on the R-CNN [9]pipeline which CNN combines the power of a classification network (e.g. ResNet [10]) withan SVM classifier and unsupervised region proposals [26]. This idea was sped up by [8] and[24] and many different algorithms emerged trying to propose the best regions [1, 7, 20],
including a fully convolutional network [18] based version called R-FCN [23]. Recently
published object detectors [17, 22] achieved orders of magnitude faster inference speedswith good accuracies by leaving region-proposals behind and predict bounding boxes in asingle-shot. The high speed of our method is borrowed from the single-shot philosophy,
albeit without requiring full supervision.

Weak Supervised Object Localization. Most methods [3, 5, 14, 27] follow a strategy
where first, multiple candidate object windows are extracted using unsupervised region proposals [26], from each of which feature vector representations are calculated, based on which
an image-label trained classifier selects the proper window. In contrast, our single-shot
method does away with region proposals all together by directly learning the object’s extent.
Li et al. [14] sets the state-of-the-art in this domain. They achieve this by filtering the
proposed regions in a class specific way, and using MIL [6] to classify the filtered proposals.
Bilen et al. [3] achieves similar performance by using an ensemble of two-streamed deep
network setup: a region classification stream, and a detection steam that rank proposals.
Wang et al. [27] starts with the selective search algorithm to generate region proposals, similar to R-CNN. They then use Probabilistic Latent Semantic Analysis (pLSA) [11] to cluster
CNN-generated feature vectors into latent categories and create a Bag of Words (BoW) representation to classify proposed regions. The work of Cinbis et al. [5] uses MIL with region
proposals. In our work, we also are weakly-supervised, however, we perform localization in
an end-to-end trainable single-pass without using region proposals.
A recent study by [19] follows an alternate approach [15] of using global (max) poolingover convolutional activation maps for weakly supervised object localization. This was oneof the first works to use this approach. Their method gives excellent result for predicting
a single point that lies inside an object, while predicting its bounding boxes, via selective
search region proposals, yields limited success. In our work, we focus on ascertaining thebounding box extent of the object directly. Further efforts by [2] improve upon [19] inbounding box extent localization by using a tree search algorithm over bounding boxes derived from all final layer CNN feature maps. In our work, we perform extent localizationof an object by filtering CNN activations into a single feature map instead of using a searchalgorithm, which makes our approach faster and computationally light, achieving high-speed
inference.
Finally, the concept of class activation mappings in [28] serves as a precursor to ourarchitecture. Like us, they make the observation that different global pooling operations
influence the activation maps differently. We build upon their work and introduce object
extent pooling.

4

3

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

MethodTo allow weak supervision training for localization for a convolutional-only neural network,
we use a training framework ending in a convolutional layer with a single feature map (perobject class). This is followed by a global pooling layer, which pools the activation map of
the previous layer into a single scalar value, which depends on the pooling method. This output is finally connected to a two-class softmax cross-entropy loss layer (per class). This network setup is then trained to perform image classification by predicting the presence/absenceof objects of the target class in the image using standard back-propagation using image-level
labels. A visualization of this setup is shown in Figure 3.
During inference, the global pooling and the softmax loss layers are removed, thereby thesingle activation map of the added final convolutional layer becomes the output of the network, in the form of an N × N grid. Due to the flow of backpropagated gradients through theglobal pooling layer during training, the weights of this convolutional layer get updated suchthat the location and shape of the strongly activated areas in its activation map essentiallyhave a one-to-one relation with the location and shape of the pixels occupied by positiveclass objects in the image. At the same time, the intensity of the activation values in thisactivation map essentially represent the confidence of the network about the presence of theobjects at the specific location. Borrowing notation from [28], we call this single feature-map
output activation a Class Activation Map (CAM).
Consequently, to extract the location of the object in the image, the CAM activations arethresholded and backprojected onto the input image to localize the positive class objects.

3.1

The Class Activation Map (CAM) Layer

The class activation map layer is essentially a simple convolutional layer, albeit with a single
feature map/channel (per object class) and a kernel size of 1 × 1. When connected to thefinal convolutional layer of a CNN, the CAM layer has one separate convolutional weight foreach activation map of the previous layer (see Figure 3). Training the network under weaksupervision through global pooling and softmax loss updates these kernel weight of the CAM
layer through the gradients backpropagated from the global pooling layer. Eventually, thefeature maps (of the previous conv layer) that produce useful activations for the training taskof presence/absence classification are weighted higher, while the feature maps whose outputs
are uncorrelated with the presence/absence of the positive class objects are weighted lower.
Hence, the CAM output can be seen as the weighted sum combination of the activationsof all the feature maps of the previous convolutional layer. Finally after training, the CAM
activation essentially forms a heatmap of location likelihood of positive class objects in the
input image.
The CAM layer used here is based on the concept of class activation mapping introducedin [28]. While being algorithmically similar, it should be noted that our CAM layer setup isdifferent from the one in [28] in the following way: we perform the global pooling operation
after the weight multiplication step (via a 1×1 conv.), while [28] does this before the weightmultiplication step (via a FC layer). The reason for this difference is to allow greater ease of
implementation and lower computational redundancy (requiring pooling on just one feature
map).

5

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING…

OutputPresent
AbsentSoftmax

CAM(s)

Global Pooling

CNN (no FC)
1x1 Conv.

Input

Backprojection

CAM

CAM

Algorithm 1: Fast-backprojection

CAM

Final CNN Layer Activations
Figure 3: Visualization of the training setup for a CAM-augmented CNN. An extra conv. layer witha single feature map, the CAM, extracts the relevant feature information from the CNN’s last conv
layer. For weakly supervised training with present/absent annotation, the CAM is followed by a global
pooling layer and connected to a softmax output/loss layer.

Input: [X], [Y], layerCAM , r // activation pixels in
CAM layer, the CAM layer, resize ratio

Output: bpImage // backprojection on input image/* for each activation pixel in the CAM layer
12*/

foreach {x, y} in {[X], [Y]} do
x0 = x1 ← x; y0 = y1 ← y; l ← layerCAM // init/* loop through all layers from CAM to input

3
4

*/

6

{x, y}0 ← {x, y}0 × s − p{x, y}1 ← {x, y}1 × s − p + k − 1l ← layerCAM−1 // Go to next layer/* If ratio is provided, correct locations

7
8
9

10

3.1.1

if r 6= 0 then{x, y}0 ←{x, y}0 + ({x, y}1 − {x, y}0 ) × r / 2{x, y}1 ←{x, y}1 + ({x, y}1 − {x, y}0 ) × r / 2
bpImage[y0 : y1 , x0 : x1 ] = 1 // fill bpImage*/

Thresholdthe CAM

Floodfill
FastBackprojection

peakthresholdwhile l 6= layerinput do/* s, p, k = stride, padding, kernel size */5

Forward
Pass

Input

BACKGROUNDNOISEFLOODFILL AREA
POSITIVE CLASS OBJECT

Contour Detection+ Bounding Box

NO
FILL

CAM

Figure 4: Visualization of the full inference pipeline.
The central plot explains the thresholding and floodfilling steps. The outputs of the pipeline are positiveclass object bounding boxes.

Inference

The complete pipeline is illustrated in Figure 4. A peak of CAM’s activations would occur
at the location corresponding to the most discriminative part of the object. The height of thepeak is related to network confidence, whereas the extent of the object is captured by thewidth. To get a localization proposal, we can investigate which pixels in the original image
where responsible for the activations that form a peak in the CAM. First, only the CAM
peaks above the CAM threshold (computed based on the ratio of biases/weights of the output
layer, learnt during training) are considered. Next, using a floodfill algorithm, all activatedpixels belonging to the ‘mountain’ of this peak (including those below the threshold) areselected, as illustrated on the central plot in Figure 4. These pixels are then backprojected
onto the input image via a fast-backprojection technique explained in Algorithm 1. We
call it ‘fast’ because it computes the mapping between CAM pixels and the input pixels
without actually performing a backward pass through the network. As can be inferred, thisalgorithm backprojects onto all pixels in the input image that could have contributed to the
CAM activations (its receptive field). Therefore, we use a ratio parameter r to influence thesize of the backprojected area. This parameter can be set by heuristics, or optimised overa separate validation set. Finally, by performing a contour detection on this backprojection,
we can fit simple rectangular bounding boxes on the detected contours to localize the extent
of the object.

6

3.2

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

Global Pooling

During training, the gradients computed from the loss layer reach the CAM layer throughthe global pooling layer. The connecting weights between the CAM and the previous conv
layers are updated based on the distribution/flow of the gradients defined by the type of global
pooling layer used. Hence, the choice of global pooling layer and its distribution of gradients
to bottom layers is an important consideration for this framework for weak supervision.
Equation Legend In the equations hereafter, we consider a CAM activation map of N × N,
where xn is an arbitrary pixel in it. The backpropagated gradients from the top loss layer isdenoted by g.
3.2.1

Max and Average Pooling (GMP & GAP)

Global Max Pooling (GMP) layer is essentially a simple max pooling layer commonlyused in CNNs, albeit whose kernel size is the same as the input image size. During theforward pass, this essentially means it always returns a single scalar pixel whose value isequal to the pixel with the highest value in the input image. During the backward pass,
Equation 1 depicts how the gradients (∇GMP ) are computed for all pixel locations in the
CAM layer.
(
It can be seen from the equation that the1, if xn = max (xn )0<=n<N
gradient is passed only to the location with the ∇GMP = g·
(1)0, otherwise
maximum activation in the CAM. During training with a positive object image, this implies that the detectors that additively contributedin making this pixel value high are encouraged via a positive weight update. Conversely,
for a negative object image, the detectors that contributed in creating the highest value in the
CAM are discouraged. Therefore, the network only learns from the image area that produces
max activation in the CAM, i.e., the most discriminative object parts.
Global Average Pooling (GAP) layer performs a similar global pooling such that the single output pixel is the average of all input pixels during the forward pass. During the backward pass, the gradients are computed as denoted in Equation 2.
It can be seen that every location in the CAM gets the same gra1
dient.
Due to this, over multiple epochs of training, the detectors that
∇GAP = g· 2 (2)Nfire for parts of the positive class object are strongly weighted, while
detectors that fire for everything else are weighted very low. Thus, the network learns fromall input image locations with an equal rate due to GAP’s uniform backpropagated gradient.
The visualization of the gradient flow through these pooling layers is shown in Figure 5.
Due to the single-location max-only gradient distribution of the global max pooling layer, it
can be hypothesised that a GMP trained CAM can be quite ideal at pointing to the discriminative parts of an object. Conversely, due to the equally spread gradient distribution of the
global average pooling layer, a CAM trained with GAP would activate for the full body ofobject plus parts of correlated or closely situated background.
3.2.2

Spatial Pyramid Averaged Max (SPAM) Pooling

Based on the properties of the global max and average pooling layers and from a study ofpooling published in [4], we propose a pooling layer that is more tuned for training a CAM
network for extent localization under weak supervision.

7

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING𝑔

Output

GMP (Max)𝑛∈𝑁𝑝0,otherwise

Local Average

𝑝=1

•••

•••

•

•

•

•

-3

-2

-1

0

1

2

3

•

•

•

Max activation centred Spatial Location

Global Average𝑛∈𝑁𝑝∀ 𝑥𝑛 = mean
(𝑥𝑛 )
avg

0

𝑁2

AVERAGE𝐾𝑝−2 , if 𝑥𝑛 = max(𝑥 𝑛 ) ,max

𝑃

Global Max

1
𝑃

Local Average

𝑔∙1

𝑔∙

Global Max

SPAM

Global Max

Magnitude of Gradient

GAP (Avg)•

Figure 5: Visualization of gradient flow
through global pooling layers. g is the backpropagated gradient from the upper later. The
CAM size considered here is N × N, and centered around its highest activation. SPAM
pooling is considered to have P pyramid step,
each with an average pooling kernel size of
Kp × Kp .

Figure 6: Architecture of the SPAM layer.
First, local average pooling operations are applied in parallel with different kernel sizes,
forming a pyramid of output activations. Next,
global max pooling is applied and finally, its
outputs are averaged. At the ends of the spatial pyramid, we directly show the equivalent
GMP and GAP steps.

The approach consists of multiple local average pooling operations on the CAM activation map in parallel with varying kernel sizes. The kernel size of these average pooling
operations is increased in steps (e.g., 1, 2, 4, ...), thus forming a spatial pyramid of local
average pooling activation maps. Next, these activation maps are passed through global max
pooling operations, which selects the maximum values among these average pooled activation maps. Finally, the output single pixel values of these combined pooling operation are
averaged together to form the single scalar output of this layer. Due to the spatial pyramid
structure and the use of average and max pooling operations, we call this layer global Spatial Pyramid Averaged Max Pooling, or simply SPAM pooling layer. A visualization of thearchitecture of SPAM layer is shown in Figure 6.
During the backward pass, the gradients are computed as depicted in Equation 3. Here,we consider a SPAM layer with P pyramid steps, each having a local average pooling kernel
size of K p × K p ; the backpropagated gradients from the top loss layer is represented g.
−2max(x̂n ), ∀x̂n = mean(xn )1 P K p , if x̂n = n∈N
max
avg
n∈N p
p
(3)
∇SPAM = g · ∑P p=1 0,otherwise
avg/max

where the average/max pool kernel size at pyramid step p is N p

avg/max

× Np.

The detectors responsible for creating maximal activation receives the strongest update,
while the areas surrounding it receive an exponentially lower gradient that is inversely proportional to its distance from the maximal activation. As a result, while it strongly updates
the weights of detectors of discriminative parts responsible for maximal activation, similar
to GMP, it still ensures all locations receive a weak update, like in GAP. Due to this property,
SPAM layer forms a good middle ground between the extremes of GMP and GAP. This canalso be seen in Figure 5, which shows the gradients of SPAM layer, in comparison with thatof global max and average pooling layers.
The gradient distribution of the SPAM layer is also shown in 3D in Figure 2, in comparison with the distribution of ground truth bounding boxes w.r.t the object’s most discriminative part (given by CAM’s maximal activation). As can be seen, SPAM’s gradients are able
to match the distribution of the objects’ actual extent.

8

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING
MethodGMP (Max)GAP (Avg)
SPAM

mean Average Precision
Classification
Pin-pointing
Extent
99.8
98.9
69.5
99.4
82.3
79.1
99.9
95.8
95.8

inside box: 31K
outside box: 6K

inside box: 88K
outside box: 22K

inside box: 417K
outside box: 518K(a) GMP(b) SPAM(c) GAP

Table 1: Results of the pooling experiments on MNIST128. Bold entries are
the ones that perform ‘well’ on the twoclass task (>95 mAP).
Figure 9: Visualization of the sum of normalized CAM activations, such that theobject size present in the image is constant (denoted by the black box). The
numbers denote the quantity of activatedpixels (correctly) inside vs (wrongly)
outside the objects’ bounding box.

4

Experiments and Results

4.1

Evaluation of various Global Pooling strategies on MNIST128

Setup. As a proof of concept, we conduct experiments on a modified MNIST [13] dataset:
MNIST128. this set consists of 28×28 MNIST digits placed randomly on a blank 128×128
image, thus creating a localization task. Further, we convert the 10-class MNIST classification problem to a two-class task where the digit 3 (chosen arbitrarily) is considered thepositive class, and rest are negative. We consider three types of tasks: classification, bounding box localization with at least 0.5 IoU (detection/extent localization), and localization by
pin-pointing. Pin-pointing is identifying any single point that falls within the object bounding box [19]. We use a FC-less version of LeNet-5 [12] with our CAM extension, trainedwith softmax loss via various global pooling techniques. The SPAM pooling layer used here
consists of a spatial pyramid of 4 steps, with local average pool kernel sizes 1 × 1, 2 × 2,
5 × 5, and N × N, where N is the size of the CAM activation map. After training, the layers
succeeding the CAM were removed, and inference was performed as explained in 3.1.1.
The results of this experiment are in Table 1. As hypothesised, GMP is good at locating
the most discriminative part of the object, and thus succeeds at pin-pointing, but fails at
extent. In comparison, GAP performs worse in pin-pointing, and better in extent. The global
SPAM pooling is actually able to perform fairly better overall than both the other forms ofpooling for object localisation.

4.2

Experiments on PASCAL VOC

Setup We adapted an ImageNet pre-trained version of VGG-16 [25]. We replaced thefully connected layers with our CAM layer, followed by our global SPAM pooling layer plus
softmax output layer. Once again, the SPAM pooling used here consisted of 4 pyramid steps
with kernel sizes of 1 × 1, 2 × 2, 5 × 5, and N × N, where N is the size of the CAM activation
map. To train our CAM layer weakly on the PASCAL VOC 2007 training set, we assigned
a CAM-SPAM-softmax setup, see Fig 3, to each of the 20 VOC classes. After the training,
we removed the layers succeeding the CAMs, as was done in the previous experiment. We
also fine-tuned the ratio parameter in Algorithm 1 on a separate validation set.
4.2.1

Analysis of CAM behaviour trained via various Global Pooling techniques

To investigate our method further, we normalize and sum the CAM activations over the wholetest set (only images contained one object), such that the size of the object in all the images

9GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

Table 2: Detection results on PASCAL VOC
2007 & 2012. Entries marked with RP denotetheir use of region proposal sets.

40
30

Speed
20 (fps)
10

0

20

40

60

80

100

0

* Estimation¹² Tested on VOC’12
ᴿᴾ Uses Region Proposals
Solid: Weakly Supervised
Hollow: Fully Supervised

Fast R-CNNᴿᴾ [8] 〔ᴋ₄₀〕
YOLO [22] 〔TɪᴛᴀɴX〕
Oquabᴿᴾ*¹² [19] 〔TɪᴛᴀɴX〕
Liᴿᴾ* [14] 〔ᴋ₄₀〕
SPAM-CAM⁽ᴼᵘʳˢ⁾ 〔TɪᴛᴀɴX〕
R-CNNᴿᴾ [9] 〔TɪᴛᴀɴX〕
SSD [17] 〔TɪᴛᴀɴX〕
Bencyᴿᴾ [2] 〔TɪᴛᴀɴX〕
Cinbisᴿᴾ* [5] 〔TɪᴛᴀɴX〕
SPAM-CAM⁽ᴼᵘʳˢ⁾ 〔ɢᴛx₁₀₈₀〕

MethodmAP
PASCAL VOC 2007 test set
SPAM-CAM[Ours]
27.5
GMP-CAM (Max Pool)[Ours]
25.9
GAP-CAM (Avg Pool)[Ours]
15.6
LiRP+MIL [14]39.5
BilenRP+Ensemble [3]39.3
WangRP+pLSA [27]30.9
CinbisRP+MIL [5]30.2
BencyRP+TreeSearch [2]25.7PASCAL VOC 2012 validation set
SPAM-CAM[Ours]
25.4
GMP-CAM (Max Pool)[Ours]
22.6
GAP-CAM (Avg Pool)[Ours]
19.3
BencyRP+TreeSearch [2]26.5
OquabRP+GMP [19]11.7

Faster R-CNNᴿᴾ [24] 〔ᴋ₄₀〕
YOLOv2 [21] 〔TɪᴛᴀɴX〕
Wangᴿᴾ* [27] 〔TɪᴛᴀɴX〕
Bilenᴿᴾ* [3] 〔ɢᴘᴜ〕SPAM-CAM⁽ᴼᵘʳˢ⁾ 〔ᴄᴘᴜ〕Figure 10: Localization examples: The highlighted areas in the images indicate the backprojectionof CAM activations; green b.boxes match the ground truth, while red do not. Note how wrong b.box
predictions are mostly either due to closely occurring objects, or closely correlated background.

Performance (mAP)

Figure 11: Speed and performance comparison between different localization methods
on PASCAL VOC 2007 test set.

is constant and centered. In Figure 9, we visualize the distribution of CAM’s activated pixels
w.r.t the object bounding box.
Figure 9 illustrate that the GMP trained CAM activations strongly lie within the bounding region of the object, but fail to activate for the full extent of the object. Conversely, GAP
trained CAM activations spread well beyond the bounds of the object. In contrast, the activations of SPAM trained CAM do not spread much beyond the object’s boundaries, whilestill activating for most of the extent of the object. This observations support our hypothesisthat SPAM pooling offers a good trade-off between the adverse properties of GMP and GAP,and hence are better suited for training CAM for weakly supervised localization.
4.2.2

Comparison with the State of the Art

The results obtained with this network can be found in Table 2, in comparison with priorwork. While evaluating these results, it should be noted that all the previous work in thisfield rely on region proposals, which is an extra computationally heavy step. [14] uses a
combination of region proposals, multiple instance learning and fine-tuned deepnets, and [3]uses region proposals and an ensemble of three deep networks to achieve this performance.
In contrast, our method is purely single-shot, i.e., it requires a single forward pass of thewhole image without the need of region proposals, which makes the method computationallyvery light. To the best of our knowledge, this is the first method to perform WSOL without
region proposals.
Here, we see that the best methods [3, 14] using proposals perform significantly better.
However, we are able to match the performance of other methods that also use region proposals [2, 5, 19, 27] and rely on similarly sized CNNs as ours. This observation suggests

10

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

that region proposals themselves are not vital for the task of weakly supervised localization.
Speed Comparison In Figure 11, the performance of several methods is shown against the
speed at which they can achieve this performance (on the PASCAL VOC 2007 test set). The
test speeds for all methods have been obtained on roughly ~500×500 sized images using
their default number of proposals, as reported in their respective papers. Because some studies ([5, 19, 27]) do not provide details on processing time, we make an estimation based on
details of their approach (denoted by *). In the figure, we also include information on somewell known fully-supervised R-CNN approaches [8, 9, 17, 21, 22, 24] for reference. As canbe seen, the VGG-16 based SPAM-CAM performs about 10-15 times faster than all otherweakly supervised approaches. In fact, even a CPU-only implementation of our approachroughly performs in the same speed range as other TitanX/K40 GPU based implementations. Additionally, we are able to match the speeds of existing fully supervised single-shot
methods like [17, 21, 22].

5

Conclusion

In this paper, a convolutional-only single-stage architecture extension based on Class Activation Maps (CAM) is demonstrated for the task of weakly supervised object localisation in
real-time without the use of region proposals. Concurrently, a novel global Spatial Pyramid
Averaged Max (SPAM) pooling technique is introduced that is used for training such a CAM
augmented deep network for localising objects in an image using only weak image-level(presence/absence) supervision. This SPAM pooling layer is shown to posses a suitable flowof backpropagating gradients during weakly supervised training. This forms a good middle
ground between the strong single-point gradient flow of global max pooling and the equal
spread gradient flow of global average pooling for ascertaining the extent of the object in
the image. Due to this, the proposed approach requires only a single forward pass throughthe network, and utilises a fast-backprojection algorithm to provide bounding boxes for an
object without any costly region proposal steps, resulting in real-time inference. The method
is validated on the PASCAL VOC datasets and is shown to produce good accuracy, while
being able to perform inference at 35fps, which is 10–15 times faster than all other related
frameworks.

References[1] Bogdan Alexe, Thomas Deselaers, and Vittorio Ferrari. Measuring the objectness ofimage windows. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(11):2189–2202, 2012. ISSN 01628828.
[2] Archith John Bency, Heesung Kwon, Hyungtae Lee, S Karthikeyan, and BS Manjunath. Weakly supervised localization using deep feature maps. In European Conference
on Computer Vision, pages 714–731. Springer, 2016.
[3] Hakan Bilen and Andrea Vedaldi. Weakly supervised deep detection networks. In
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition,
pages 2846–2854, 2016.

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING

11[4] Y-Lan Boureau, Jean Ponce, and Yann LeCun. A theoretical analysis of feature poolingin visual recognition. In Proceedings of the 27th international conference on machinelearning (ICML-10), pages 111–118, 2010.
[5] Ramazan Gokberk Cinbis, Jakob Verbeek, and Cordelia Schmid. Weakly Supervised
Object Localization with Multi-fold Multiple Instance Learning. IEEE Transactions
on Pattern Analysis and Machine Intelligence, pages 1–15, 2016.
[6] Thomas G. Dietterich, Richard H. Lathrop, and Tomás Lozano-Pérez. Solving themultiple instance problem with axis-parallel rectangles. Artificial Intelligence, 89:31–
71, 1997. ISSN 00043702.
[7] Ian Endres and Derek Hoiem. Category-independent object proposals with diverse
ranking. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(2):222–
234, 2014. ISSN 01628828.
[8] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE International Conference on
Computer Vision, pages 1440–1448, 2015.
[9] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of theIEEE conference on computer vision and pattern recognition, pages 580–587, 2014.
[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learningfor image recognition. In Proceedings of the IEEE conference on computer vision andpattern recognition, pages 770–778, 2016.
[11] Thomas Hofmann. Probabilistic Latent Semantic Analysis. Uncertainity in ArtifitialIntelligence - UAI’99, page 8, 1999. ISSN 15206882.
[12] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2323,
1998. ISSN 00189219.
[13] Yann LeCun et al. Generalization and network design strategies. Connectionism inperspective, pages 143–155, 1989.
[14] Dong Li, Jia-Bin Huang, Yali Li, Shengjin Wang, and Ming-Hsuan Yang. Weakly
supervised object localization with progressive domain adaptation. In Proceedings ofthe IEEE Conference on Computer Vision and Pattern Recognition, pages 3512–3520,
2016.
[15] Min Lin, Qiang Chen, and Shuicheng Yan. Network In Network. ICLR, 2014.
[16] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge
Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE
Conference on Computer Vision and Pattern Recognition, 2017.
[17] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, ChengYang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European
conference on computer vision, pages 21–37. Springer, 2016.

12

GUDI, VAN ROSMALEN, LOOG, VAN GEMERT: OBJECT EXTENT POOLING[18] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks forsemantic segmentation. In Proceedings of the IEEE Conference on Computer Vision
and Pattern Recognition, pages 3431–3440, 2015.
[19] Maxime Oquab, Léon Bottou, Ivan Laptev, and Josef Sivic. Is object localization forfree?-weakly-supervised learning with convolutional neural networks. In Proceedingsof the IEEE Conference on Computer Vision and Pattern Recognition, pages 685–694,
2015.
[20] Pedro O Pinheiro, Ronan Collobert, and Piotr Dollar. Learning to segment object candidates. In Advances in Neural Information Processing Systems, pages 1990–1998,
2015.
[21] Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. In Proceedings ofthe IEEE Conference on Computer Vision and Pattern Recognition, 2017.
[22] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only lookonce: Unified, real-time object detection. In Proceedings of the IEEE Conference on
Computer Vision and Pattern Recognition, pages 779–788, 2016.
[23] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards realtime object detection with region proposal networks. In Advances in neural information
processing systems, pages 91–99, 2015.
[24] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards realtime object detection with region proposal networks. In Advances in neural information
processing systems, pages 91–99, 2015.
[25] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale
image recognition. CoRR, abs/1409.1556, 2014.
[26] J. R R Uijlings, K. E. A. van de Sande, T. Gevers, and a. W M Smeulders. Selective
Search for Object Recognition. International Journal of Computer Vision, 104(2):154–
171, 2013. ISSN 0920-5691.
[27] Chong Wang, Weiqiang Ren, Kaiqi Huang, and Tieniu Tan. Weakly supervised object localization with latent category learning. In European Conference on Computer
Vision, pages 431–445. Springer, 2014.
[28] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba.
Learning deep features for discriminative localization. In Proceedings of the IEEE
Conference on Computer Vision and Pattern Recognition, pages 2921–2929, 2016.