dlpy.model.Model.heat_map_analysis

Model.heat_map_analysis(data=None, mask_width=None, mask_height=None, step_size=None, display=True, img_type='A', image_id=None, filename=None, inputs='_image_', target='_label_', max_display=5, **kwargs)

Conduct a heat map analysis on table of images

Parameters
dataImageTable, optional

If data is None then the results from model.predict are used. data specifies the table containing the image data which must contain the columns ‘_image_’, ‘_label_’, ‘_id_’ and ‘_filename_0’.

mask_widthint, optional

Specifies the width of the mask which cover the region of the image.

mask_heightint, optional

Specifies the height of the mask which cover the region of the image.

step_sizeint, optional

Specifies the step size of the movement of the the mask.

displaybool, optional

Specifies whether to display the results.

img_typestring, optional

Can be ‘A’ for all images, ‘C’ for only correctly classified images, or ‘M’ for misclassified images.

image_idlist or int, optional

A unique image id to get the heatmap. A standard column of ImageTable

filenamelist of strings or string, optional

The name of a file in ‘_filename_0’ if not unique returns multiple

inputsstring, optional

Name of image column for the input into the model.predict function

targetstring, optional

Name of column for the correct label

max_displayint, optional

Maximum number of images to display. Heatmap takes a significant amount of time to run so a max of 5 is default.

**kwargskeyword arguments, optional

Specifies the optional arguments for the dlScore action. For more details, see deepLearn.dlScore

Returns
pandas.DataFrame

Contains Columns: [‘I__label_’, ‘P__label_(for each label)’, ‘_filename_0’,

‘_id_’, ‘_image_’, ‘_label_’, ‘heat_map’]

Notes

Heat map indicates the important region related with classification. Details of the process can be found at: https://arxiv.org/pdf/1311.2901.pdf.