Distinguish between product images and logos

Hello all,
I am looking for a way to distinguish / recognize product images from logos. It does not have to be a logo recognition in the actual sense (recognition of brands, etc.) but only a distinction → Is this a product image or logo.

As a new user I can only attach one image, so I made a screenshot of the sample data.

Background of the whole thing is that logos should not be uploaded to our onlienstore and therefore would have to be filtered. The filter does not have to work 100%, but a hit rate of 80% would be good.

Could I realize this task with OpenCV?
If so, could you give me some suggestions on how to implement it, since I don’t have much experience in opencv?

Thanks for your help

you need deep learning. this is an object detection task, “find known things in the picture”.

OpenCV does inference but it does not do training. you can run a model with it but first you have to train it with pytorch or tensorflow or matlab or whatever.

try to explain, as a human, how you would distinguish them

(i know, what a logo is, but “product image” ? that’s totally vague)

1 Like

that’s funny, that’s exactly what i said as a developer when i was approached with this task.

A “product image” is nothing more than a picture of a product (hammer, drill, washing machine, etc.). The product can be shown as a single object or as a sample image “in use” as shown above.

I assume, this is also the definition of the task that

  • Logo is always shown as a single element occupies 90% of the image.
  • There is always only one logo (manufacturer) in the image.

I thought, before I approach the topic “deep learning” of possibly following workflow:

  • Corner or Canny Edge Detection of the image.
  • Extraction of the detected object
  • Using a color histogram or the pixel count / gradient to estimate if it is a logo or product image.

I think that a large part of product images are more abstract in structure (exposure, color gradient, color application, etc.) than logos.

Would such a workflow possibly be conceivable or should I really switch to deep learning here, which of course makes the whole thing more complex?

DL makes it simpler actually.

all you’d have to do is collect a bunch of company logos. then train the network to detect those things on various backgrounds, in various scales and rotations and such.

“product image” isn’t a class you actually have, nor is it a detectable item (not locatable). it’s just “anything that does not contain a company logo”. sure, your “backgrounds”, and you do need some of those, should include a bunch of scenes that might have a company logo slapped on them, or not, but do not for your purposes. the network needs to learn that a bunch of products on their own doesn’t necessarily mean there’s a company logo too. it might be. or not. but that depends on the logo, not on the rest of the picture.

How about OCR? You could first try a net, that detects characters. If the character is a major part of the image, it will most probably be a logo. There was also some work done on recognizing logos ([1803.11417] Scalable Deep Learning Logo Detection) before.

1 Like

OCR would also be a possible approach good idea. Will do some tests on this.

If I would realize this project via DL (which would be a good start for me since I am interested in DL for a long time)

Could you give me a few tips on how I should best start on this project.
I would try it in the first step with pytorch.

  • How do I generate my own data model?
  • How do I learn the data model with logos?
  • Do the logos need to be specifically decomposed?

How would you go about this?
You don’t have to write me any code now, I’m happy to read up on this myself.
I would only be very grateful for a few tips and procedures as well as information about the appropriate readings.

Thanks in advance

“data model” isn’t a thing. there is data and there’s the model. you have to come up with the data because that determines what the network will learn. the model you can just pick from whatever’s out there. “yolo” networks are popular currently but there are others.

standard training, explained in all the introductions to deep learning.

depends. if you have logos on some non-trivial background, “annotate” the logos. if you have free-standing logos, you can use that to create synthetic data (“data augmentation”), by overlaying those logos on logo-free backgrounds.

an introduction to DL is beyond the scope of a forum post. pick a framework (pytorch, tensorflow, matlab, …), find their documentation, work with it. and perhaps find a college-level course on the “theory”.

1 Like