In a trained machine learning model (ML) having a neural network (NN) for classifying an input sample into a class of a plurality of classes, a method for analyzing a similarly between classes of the plurality of classes, the method comprising:
- collecting weights of connections from each node of a first predetermined layer of the NN to each node of a second predetermined layer of the NN to which the nodes of the first predetermined layer are connected;
- using the collected weights, calculating distances from each node of the first predetermined layer to nodes of the second predetermined layer to which the first predetermined layer nodes are connected;
- comparing the distances to determine which classes the NN determines are similar;
- and
- enabling an analysis of the two or more similar classes to determine why the two or more classes of the NN were determined to be similar.