I've been assigned with the task of creating a model to detect whether and advertisement exists in an image and optionally to draw a bounding box around it.

My first thought was that this is an object detection problem, since I also have to draw bounding boxes. However, after some consideration I believe that an image classification model could perform better in this task for these reasons.

  • An ad never has a standard format some time it contains text some times only objects.
  • Very often an ad contains more than a single object.
  • If I was to create an object detection model I would have to train it for pairs of objects, since I would want it to be able to distinguish a parked car in a image from a car in an banner advertisement in the same image.
  • I would need to gather at least a pair of collection of annotated images for every object that I would need from my model to be able to detect. In other words it would have been extremely difficult to generalize for many different ad, since for every ad I would need at least one pair if we suppose that one ad contains one or more objects.

For those reasons I think that I should create an image classification model, although this way I loose the optional feature of bounding boxes.

Any thoughts on that?

  • $\begingroup$ Wouldn’t you be expected to have to sacrifice some object classification firepower to find where it is? If all you have to do is decide that something is in there or not, I would think you’d lose your ability to do so if you also require your model to do the unnecessary work of having to find exactly where it is. $\endgroup$
    – Dave
    Commented Jan 31, 2020 at 4:56
  • $\begingroup$ @Dave So, if I understand it correctly you suggest to better give it a shot with image-classification? $\endgroup$
    – user177157
    Commented Jan 31, 2020 at 5:06

1 Answer 1


I believe your best approach would be to use image classification. Within a site with text, native images and ads, the image classification would pick up both the native and ad related images. From here you would want to build up some sort of classification method that distinguished between the two. This is probably too much for a human to pick out, but something like a CNN could be used on a large enough set of labeled data to begin learning underlying features of ads vs non-ads (or KNN classification for a less "high-end" approach). This would probably be best on pixelated data of a fixed size.

From what I understand, none of these types of approaches work great (ad detection software normally works on HTMl and JavaScript coding for a site), but with enough training they can perform decent. Therefore, I wouldn't shrug at a moderate (~50%) success rate.

UPDATE: I found an article about researchers using a CNN to build ad detection classifiers and their methodology here.

  • $\begingroup$ Thank you for your thoughts and for mentioning this specific paper! $\endgroup$
    – user177157
    Commented Jan 31, 2020 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.