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: - data : ImageTable, 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_width : int, optional
Specifies the width of the mask which cover the region of the image.
- mask_height : int, optional
Specifies the height of the mask which cover the region of the image.
- step_size : int, optional
Specifies the step size of the movement of the the mask.
- display : bool, optional
Specifies whether to display the results.
- img_type : string, optional
Can be ‘A’ for all images, ‘C’ for only correctly classified images, or ‘M’ for misclassified images.
- image_id : list or int, optional
A unique image id to get the heatmap. A standard column of ImageTable
- filename : list of strings or string, optional
The name of a file in ‘_filename_0’ if not unique returns multiple
- inputs : string, optional
Name of image column for the input into the model.predict function
- target : string, optional
Name of column for the correct label
- max_display : int, optional
Maximum number of images to display. Heatmap takes a significant amount of time to run so a max of 5 is default.
- **kwargs : keyword 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.