Skip to content

How to use Heatmap for My model? #308

@Tengxf

Description

@Tengxf

Hello, thank you very much for sharing your code. I’ve encountered an issue while trying to visualize the attention scores from my model.

The attention scores are stored in a variable attn, which is a np.ndarray with a shape of (4643,). The values range from [0.019, 1.0], with an average of around 0.192. I want to visualize them on the lowest-level WSI. My data consists of two WSIs—one at 20X magnification and the other at 40X. After averaging the attention scores from my model for these two magnifications, I use them as the scores for the heatmap, while the coords I pass are the patch coordinates from the 20X WSI. However, after running the code, the visualization doesn’t show the regions of attention—instead, I only see either the original image background or a completely blank image.

Could you please advise on what might be causing this issue? I’ve been debugging for a while but haven’t been able to successfully visualize the attention. I’d really appreciate your help. Looking forward to your reply—thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions