Object detection of small objects in large images: best practices

1,542 views
Skip to first unread message

Margherita Di Leo

unread,
Dec 18, 2017, 6:10:56 AM12/18/17
to dis...@tensorflow.org
Hi,

I'm using TF object detection API. My aim is to detect sick/dead trees from aerial photos. My aerial photos have very high resolution (30 cm) and I need to run the prediction on tiles sized 3470 x 3470 pixels. In these large images, the trees are very small objects and can range between none and 25 - 30 circa in each image, to give an idea.
For the training, I had to crop those large images because my computer would get stuck otherwise, but no problem for that. I tagged and run the training using a pre-existing model [faster_rcnn_resnet101_coco](http://download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_coco_2017_11_08.tar.gz). 
After 42845 steps, for a first prediction I used the very same images that I used for training, with the only difference that they were not cropped. Just to see what happens. Well, results are poor: only a few trees get detected, but it mostly detects larger objects that have a similar patterns to sick trees only much larger and visible on the image. But they are not trees. They could be large portions of bare soil, etc. 
I have to say that before trying the model over full resolution, I had tried on screenshots (both training and prediction) taken at coarser resolution and the detection over screenshots went much better. Only it's not what i need for doing the job.
So my question is: what are the best practices to deal with detection of very small objects within large images? There is really no way, some parameters, to "force" the algorithm to look for patterns only at certain resolutions? For example, to avoid this effect, I avoided using the images I had tagged at coarser resolution mixed to those at full resolution, but used only images at full resolution. Is this approach correct?

Sorry for the long email, and thank you for any pointers

--
Margherita Di Leo  

natore...@gmail.com

unread,
Dec 18, 2017, 6:50:26 AM12/18/17
to Margherita Di Leo, dis...@tensorflow.org
Hi Margherita,

First off, I’m not sure this is the right forum for discussion of image recognition generally.  That being said, I haven’t found a great place to discuss general approaches online (suggestions would be great... anyone?).

To answer your question there are likely a number of things you could do, in my limited experience I would say that “pooling” and “convolving” in array sizes related to the size of feature you are looking for might help.  That’s pretty vague.   If you haven’t already check:


It may set you in the right direction.  

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/CA%2BV6ZhXLjz%2BTGx%3DWENV-1F8cbY4EL4PDWqZnP7gG-Y_gjV2FBQ%40mail.gmail.com.

Margherita Di Leo

unread,
Dec 18, 2017, 8:45:02 AM12/18/17
to natore...@gmail.com, dis...@tensorflow.org
On Mon, Dec 18, 2017 at 12:50 PM, <natore...@gmail.com> wrote:
Hi Margherita,

First off, I’m not sure this is the right forum for discussion of image recognition generally.

Uops, sorry! 

That being said, I haven’t found a great place to discuss general approaches online (suggestions would be great... anyone?).

Indeed. However, I didn't mean to spam, so please forgive me and, in case, reply to me only in order not to flood the list. 

To answer your question there are likely a number of things you could do, in my limited experience I would say that “pooling” and “convolving” in array sizes related to the size of feature you are looking for might help.  That’s pretty vague.   If you haven’t already check:


It may set you in the right direction.  

Thanks, will check it out.

Regards, 


--
Margherita Di Leo  

Jason Hihn

unread,
Dec 18, 2017, 9:44:34 AM12/18/17
to Margherita Di Leo, dis...@tensorflow.org
So yeah, you'll want convolution as stated. Also, given that most dead trees are brown and most live trees have green foliage, passing in a normal grayscale image might not be the best idea. While in theory it should be able to tell the difference between branches and leaves, it might count dead leaves on the ground if it doesn't have color data. So that's my tip. Made sure you aren't using grayscale. 

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.

Margherita Di Leo

unread,
Dec 18, 2017, 9:51:25 AM12/18/17
to Jason Hihn, dis...@tensorflow.org
Thanks Jason, I'm not using grayscale images, I use a composition of RGB bands, they look like photos. Thanks for the tips
--
Margherita Di Leo  

Giuliano Meini

unread,
Dec 18, 2017, 11:17:16 AM12/18/17
to Margherita Di Leo, Jason Hihn, dis...@tensorflow.org
I work in vegetable environment for discrimination living plants and died plants. We use infrared. I understand that this is not an answer to your question, I put here only for info.
By
Giuliano Meini
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.

To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/CA%2BV6ZhXOnPB8UgOqO1r8TVRnU0F_OoGtrcGFao8fSyueT3E8gg%40mail.gmail.com.


--
Dai valore a ciò che mangi, dai valore all'uomo, dai valore alla terra.
Giuliano Meini - 3463912740
Progetti di educazione cibo ed ambiente: http://ortipisani.it
il Museo RADICO sul Lavoro, l'Intelligenza e la Civiltà Contadina: http://radico.it

AVVISO: Questo messaggio ed i suoi eventuali allegati sono rivolti esclusivamente ai destinatari e contengono informazioni riservate.
Qualsiasi utilizzo, diffusione o riproduzione senza autorizzazione è proibita.
Qualora vi fosse pervenuto questo messaggio per errore, esso va cancellato immediatamente con preghiera di avvisare il mittente.
Grazie.

Mail priva di virus. www.avg.com

Aj

unread,
Feb 19, 2018, 11:53:24 AM2/19/18
to Discuss
Have you tried changing dimensions of the image in the config file, I'm working around similar problem 

Margherita Di Leo

unread,
Feb 19, 2018, 12:00:36 PM2/19/18
to Discuss
Hi,

I have worked around this problem with two actions: first off, I realized I had too small a dataset, so i added images, I used full resolution and slightly coarser resolution of same objects, cropped differently from one image to the other.  Then, I also noticed that strangely enough, I get much different results in prediction according to the size of the images that I feed to the classifier. Just cropping the images smaller gives much better results. I don't know if I can act on any parameters to adjust this, so far I just tiled the images that I feed for prediction. Hope this might help others.

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages