4
$\begingroup$

I'm trying to use ImageIdentify to recognize the object in an image, but I found that the output of ImageIdentify is always in a detail category. What I want is just a general label of the object. Here's the example:

im1 = Import["https://i.sstatic.net/3QvBC.jpg"];

enter image description here

im2 = Import["https://i.sstatic.net/uw8eZ.jpg"];

enter image description here

ImageIdentify[{im1,im2}];

and it returns

 {Entity["Concept", "HoundDog::t3j5c"], 
 Entity["Concept", "GoldenRetriever::t59tg"]}

However, what I need is just the category "dog" instead of "HoundDog" or "GoldenRetriever".

Is there any approach to do this?

There is one more thing I need to mention about, which is I'm working on realistic images including various kinds of objects rather than dogs only, so I actually need an approach for generally increasing the categories level on all categories of ImageIdentify instead of that on a specific category.

I'm really appreciate for your help! Thanks a lot!

$\endgroup$
6
  • 3
    $\begingroup$ I'm not that familiar with ImageIdentify, but it does have a SpecificityGoal option. As I go from 0 to 0.2 with specificity, I get "animal", "domestic dog", "hunting dog" and "hound" for your first image. $\endgroup$
    – Szabolcs
    Commented Feb 5, 2017 at 18:48
  • 3
    $\begingroup$ There is also a "BroaderConcepts" property of the result, which allow walking up on a concept tree. Try Entity["Concept", "HoundDog::t3j5c"]["BroaderConcepts"], then repeat. But I don't know how to use all this in a practical and robust way, so I cannot write an answer to your question. $\endgroup$
    – Szabolcs
    Commented Feb 5, 2017 at 18:54
  • $\begingroup$ @Szabolcs Thank you very much! Is there any way I can get a overall look of the concept tree instead of using the ["BroaderConcepts"] step by step? $\endgroup$
    – Chang Liu
    Commented Feb 6, 2017 at 11:01
  • $\begingroup$ I don't know. Actually I don't even know if it is a tree (maybe there can be more than one broader concept in some cases). It would be nice to have a question on this topic, but it would need to be motivated very well to avoid closure (explain relationship to ImageIdentify). Does ImageIdentify alwats return a "concept"? What is really a "concept"? How are concepts organized? What's the difference between broader/narrower and subset/superset concepts? $\endgroup$
    – Szabolcs
    Commented Feb 6, 2017 at 11:11
  • $\begingroup$ Do all entities of type "Concept" have the broader/narrower properties? What's the relationship between Entity["Species", "Infraspecies:CanisLupusFamiliaris"] and Entity["Concept", "CanisFamiliaris::597qc"]? I don't know the answer to all of these because I don't have a good understanding of entities. However, if the question is not phrased well enough, it may seem too trivial to someone who understands entities and it may get closed ... $\endgroup$
    – Szabolcs
    Commented Feb 6, 2017 at 11:15

1 Answer 1

1
$\begingroup$

Starting from one of the entities returned by OP's ImageIdentify, one can explore the "BroaderConcept" categories as follows :

NestList[
  Flatten@*Map[#["BroaderConcepts"] &], 
  {Entity["Concept", "HoundDog::t3j5c"]},
  6
]

broader concepts

Trial and error shows that in this case one can request up to 15 levels of "broadening", at least for some branches of the tree. The tree top appears to be Entity["Concept", "Entity::9p9v7"] in all cases.

As Szabolcs had hinted at in his comment, the structure is complex: a certain entity can be associated with more than one broader concept, as it happens with "domestic dog", which is both an instance of "canine" and of "domesticated animal".

In my opinion, one can hardly hope to construct a dependable and robust "generalization function" without a priori knowledge of the concept tree. I'd love to be proven wrong though!

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.