identifying all objects in an image using CNN-based object detection

5 views (last 30 days)
EricT on 2 Nov 2021
Answered: David Willingham on 2 Nov 2021
I've been following the object-detection tutorial ( and trying to apply it to some of my own image data. Specifically, what I'd like to do is to train a detector to identify tassels in aerial crop images. I've followed the code in the tutorial very closely. The only major change I've made is the image dataset used to train the detector (at the call to trainRCNNObjectDetector), since I'm trying to identify tassels, not stop signs.
I've conducted a lot of different tests using this detector and have tried different image datasets for training. The problem I consistently have is that the detector misses many of the tassels in the image (I need the identification rate to be as close to 100% of the visible tassels as possible). Most recently, I used a published dataset (specifically the one available here: I trained the detector on 186 of these images using the annotations provided, but I am still seeing the same quality of results as before. The attached image is typical, with only 22 bounding boxes drawn but 55 tassels visible in the image.
I've established that the problem is not in the quality or quantity of the training images I'm using, which means the problem is either in the training parameters (do I need to include substantially more layers in the detector, for instance?) or the detection algorithm itself. Can anyone offer some insight into this? Is the basic code provided in the linked tutorial even meant to identify all objects of a given type in an image, or is it just intended to identify some of the highest-scoring matches? Is there a detection threshold that can be lowered to draw more bounding boxes?

Answers (1)

David Willingham
David Willingham on 2 Nov 2021
HI Eric,
The example uses a simple deep learning network. Try using Yolo-V4 or EfficientDet instead. Another thing you might need to try is adding some preprocessing to the images. For example, the tassels are a different colour to the leaves. If you performed colour segmentation first, it may increase the prediction accuracy.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by