Answers.Body: <p>Your problem might involve a combination of <strong><a href="https://www.mathworks.com/solutions/image-video-processing/object-recognition.html" rel="nofollow noreferrer">object recognition</a></strong> (or object classification), which is the problem of determining which objects are in an image, and <strong><a href="https://www.mathworks.com/solutions/image-video-processing/object-recognition.html" rel="nofollow noreferrer">object detection</a></strong> (which could also be called object localization), which is the task of locating a specific object in the image. </p>
  
  <p>A naive approach to solve your problem would then be to first locate the position of all possible objects in the image (object detection), then, for each these positions, perform object recognition (or classification). Then you would count the number of detected and classified objects for each possible class.</p>
  
  <p>There are several models that can be used to solve your problem. </p>
  
  <p>The <strong>YOLO</strong> (You Only Look Once) model (introduced in the paper <a href="https://arxiv.org/pdf/1506.02640.pdf" rel="nofollow noreferrer">You Only Look Once: Unified, Real-Time Object Detection</a>) (2016) can be used to detect multiple objects in an image. See the <a href="https://pjreddie.com/darknet/yolo/" rel="nofollow noreferrer">official YOLO implementation</a>, which is part of the <a href="https://github.com/pjreddie/darknet" rel="nofollow noreferrer">Darknet</a> framework. Have also a look at <a href="https://towardsdatascience.com/an-introduction-to-implementing-the-yolo-algorithm-for-multi-object-detection-in-images-99cf240539" rel="nofollow noreferrer">this article</a>, which explains how to use the official implementation of YOLO. </p>
  
  <p>You could also use the SSD model (introduced in the paper <a href="https://arxiv.org/pdf/1512.02325.pdf" rel="nofollow noreferrer">Single Shot MultiBox Detector</a>). There is also <a href="https://arxiv.org/abs/1311.2524" rel="nofollow noreferrer">R-CNN (Regions with CNN features)</a>, <a href="https://arxiv.org/pdf/1504.08083.pdf" rel="nofollow noreferrer">Fast R-CNN</a> or <a href="https://arxiv.org/pdf/1506.01497.pdf" rel="nofollow noreferrer">Faster R-CNN</a>, but these should perform worse than both YOLO and SSD.</p>
  
  <p>So, even if you do not care about the locations, YOLO (and other mentioned methods) can give them to you, in addition to the number and type of objects in the image.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-27T20:56:11.590Z
Answers.LastActivityDate: 2019-07-27T21:08:38.207Z
Answers.LastEditDate: 2019-07-27T21:08:38.207Z
Answers.UserDisplayName: nbro
Body: <p>I need to identify the number and type of all objects in a picture, so there can be multiple objects of the same type.</p>
  
  <p>For example, I have a picture with <span class="math-container">$10$</span> animals, and I want my program to tell me that, on the picture, I have <span class="math-container">$3$</span> elephants, <span class="math-container">$2$</span> cats and <span class="math-container">$5$</span> dogs. However, I <strong>do not</strong> need the detection of the location of the objects. All I need is the information on the number of objects of each class, without their possible locations.</p>
  
  <p>I wanted to ask you guys for help in defining the type of problem I am dealing with and maybe some suggestions about where to start looking for a solution. It would be nice if you could point out some directions, algorithms or network architectures to solve the problem described below.</p>
  
Tags: <neural-networks><machine-learning><computer-vision><object-recognition><object-detection>
Title: How do I identify the number and type of objects in the same picture?
UserDisplayName: GKozinski
ThreadText: # How do I identify the number and type of objects in the same picture?
  
  (Asked by: username_0 on 2019-07-27)
  
  I need to identify the number and type of all objects in a picture, so there can be multiple objects of the same type.
  
  For example, I have a picture with $10$ animals, and I want my program to tell me that, on the picture, I have $3$ elephants, $2$ cats and $5$ dogs. However, I **do not** need the detection of the location of the objects. All I need is the information on the number of objects of each class, without their possible locations.
  
  I wanted to ask you guys for help in defining the type of problem I am dealing with and maybe some suggestions about where to start looking for a solution. It would be nice if you could point out some directions, algorithms or network architectures to solve the problem described below.
  
  **Tags:** neural-networks, machine-learning, computer-vision, object-recognition, object-detection
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-27. Score: 0 | Accepted answer
  
  Your problem might involve a combination of **[object recognition](https://www.mathworks.com/solutions/image-video-processing/object-recognition.html)** (or object classification), which is the problem of determining which objects are in an image, and **[object detection](https://www.mathworks.com/solutions/image-video-processing/object-recognition.html)** (which could also be called object localization), which is the task of locating a specific object in the image.
  
  A naive approach to solve your problem would then be to first locate the position of all possible objects in the image (object detection), then, for each these positions, perform object recognition (or classification). Then you would count the number of detected and classified objects for each possible class.
  
  There are several models that can be used to solve your problem.
  
  The **YOLO** (You Only Look Once) model (introduced in the paper [You Only Look Once: Unified, Real-Time Object Detection](https://arxiv.org/pdf/1506.02640.pdf)) (2016) can be used to detect multiple objects in an image. See the [official YOLO implementation](https://pjreddie.com/darknet/yolo/), which is part of the [Darknet](https://github.com/pjreddie/darknet) framework. Have also a look at [this article](https://towardsdatascience.com/an-introduction-to-implementing-the-yolo-algorithm-for-multi-object-detection-in-images-99cf240539), which explains how to use the official implementation of YOLO.
  
  You could also use the SSD model (introduced in the paper [Single Shot MultiBox Detector](https://arxiv.org/pdf/1512.02325.pdf)). There is also [R-CNN (Regions with CNN features)](https://arxiv.org/abs/1311.2524), [Fast R-CNN](https://arxiv.org/pdf/1504.08083.pdf) or [Faster R-CNN](https://arxiv.org/pdf/1506.01497.pdf), but these should perform worse than both YOLO and SSD.
  
  So, even if you do not care about the locations, YOLO (and other mentioned methods) can give them to you, in addition to the number and type of objects in the image.
  
  
  ---
  
  