Minimum Spanning Tree Compacntess (MST-C) Implementation - #377
Open
MMMesgari wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the MST-C (Minimum Spanning Tree Compactness) metric to Quantus as a geometry-based complexity metric for attribution maps.
MST-C measures the structural compactness of an explanation by combining two complementary quantities: attribution spread and attribution cohesion. Salient attribution points are selected from the attribution map, their spatial spread is estimated using the convex hull area, and their structural cohesion is measured using the length of the minimum spanning tree over a symmetric k-nearest-neighbour graph.
This metric provides Quantus with an additional way to analyse explanation structure beyond pixel-wise magnitude or entropy-based measures. It is intended to help users quantify whether salient attribution regions form compact and coherent structures or appear scattered and fragmented.
Implemented changes
MSTCmetric implementation for image attribution maps.kto improve graph connectivity.scale_score, using the image diagonal and a factor of100for more interpretable score magnitudes.threshold,k,auto_increase_k, andscale_score.(batch, height, width).Minimum acceptance criteria
a_batch.np.nanand appropriate warnings.