Visualizing the Confusion Matrix

Made a couple of updates to the visual GUI (originally from this post: Visual GUI particularly focusing on the confusion matrix. Confusion Matrix results can be found under the ‘results’ tab once a model has been loaded.

Currently the confusion matrix looks like this:
CM_a

No option to get any additional information about the images that correspond to the values within the matrix. Updated version includes clickable tabs for each section of the matrix.
CM_four_a

With the option to now chose whether to include heat-maps or not.
CM_b

If the heat-map option is chosen you have the ability to tweak the type of color-map used, the interpolation and the alpha value).

A number of examples of how the images look using various heat-map options

CM_five_a CM_six_a CM_seven_a CM_eight_a

Images are stored within their respective folders and color map pictures can be viewed within these folders:
False Positive:

True Positive:

False Negative:

True Negative:

As well as the option to view images without the color-map option providing the file location, ground truth label, predicted label and loss value:

I am hoping that this is a useful feature for data visualization and currently only works with 2 labels. the code can be found under Visual GUI on my github page: https://github.com/asvcode/Vision_UI

7 Likes

See Class Confusion :slight_smile: https://docs.fast.ai/widgets.class_confusion.html but that’s pretty cool! Perhaps you could add a few of those to it? :slight_smile:

1 Like

Thanks @muellerzr!. Congrats on Class Confusion!, didnt realize it was incorporated into fastai. That is super cool and it works with Colab. The Visual_GUI was built using ipywidgets that doesnt render well with Colab so will have to look at Class Confusion to see the cool stuff it can do and hopefully incorporate some and also re code the GUI for use with Colab.

1 Like

Thank you! It was certainly interesting to figure out. I wanted that (somewhat) cross platform ability. Hence the two seperate repos. If you have any questions or problems feel free to ask. I got extremely familiar with it :slight_smile:

2 Likes

I probably will take you up on that! :+1::grin:

1 Like