Select to view content in your preferred language

Understanding how mapping images to labels works within Export training data for deep learning tools

130
1
03-23-2025 08:47 AM
christina_kallimani
New Contributor

I am trying to get my head around how exactly the mapping works in the export training data for deep learning tool. This is quite important as if the mapping is not correct the whole model will not be trained correctly. I see differences depending on the Input Raster (if it is a folder of raster .tif or if it is a mosaic dataset), even if the rest of the parameters are kept exactly the same.

For example, when using a mosaic dataset of rasters (6 different rasters) the map.txt showcases that the numbering of images restarts every now and then. Probably when it iterates on the next raster dataset in the mosaic, it starts again from 0. Is that normal behaviour? Then the mapping is wrong because in the output image folder of .tif, the same number cannot exists twice (gets overwritten?).

For example:

images\000000000000.tif  is supposed to be associated with 6 different levels of labels while it cannot be. When 000000000000.tif is visualized it only correspond to the 1st dataset only, so where does the rest go to.

christina_kallimani_0-1742743484702.png

When the same exact tool and parameters runs with Input Raster = a folder of raster instead of mosaic  as Input raster then:

There is no iteration per imagery, the number continues from images\000000000000.tif to images\000000001108.tif without any sign of restarting numbering or confusion. But it looks like it only takes into account one raster instead of the full folder.

christina_kallimani_1-1742743725447.png

Also the stats.txt is completely different. 

When mosaic is used (way more images are created and features are taken into account but mapping I cannot udnerstand):

christina_kallimani_3-1742744006723.png

When folder of rasters is used (it looks like not all images in the raster folder are taken into account):

christina_kallimani_4-1742744075468.png

Has anyone faced something similar? I am missing something? 

I started exploring the mapping further because while training models one of the model metrics html report was showing a groundtruth image where the labels didn't make any sense, being used vs detections. I tried to figure out how that image/labels came to be used as groundtruth and there got really puzzled with the mapping in that specific dataset. 

Any help, greatly appreciated!

0 Kudos
1 Reply
PavanYadav
Esri Regular Contributor

Hi @christina_kallimani 

Workflow 1: when using a folder
  1. Select a folder

PavanYadav_5-1744064029530.png

2. Use the Image Collection tab, make sure to select the right image to label on

PavanYadav_6-1744064029534.png

 

3. Save the labels and check paths in the ImageURI field

 

PavanYadav_7-1744064029538.png

 

The tool will honor the ImageURI.

 

Workflow 2: when using a mosaic folder
  1. Select a mosaic dataset layer from the content pane

PavanYadav_8-1744064029540.png

2. Use the Image Collection tab, make sure to select the right image to label on (as shown in the folder workflow above

3. Save the labels and check paths in the ImageURI field (as shown in the folder workflow above

4. Use the ‘Export Training Data for Deep Learning’ tool with the ‘Processing Mode option selected’. You likely want to select the “Process all raster items separately”

 

PavanYadav_9-1744064029541.png

 

 

 

 

Pavan Yadav
Product Engineer at Esri
AI for Imagery
Connect with me on LinkedIn!
Contact Esri Support Services
0 Kudos