4. Experiments and Results
In this section, we conduct a systematic evaluation of the proposed Deep Prototype-Based Network (DPBN), complemented by a series of targeted architectural variants. This analysis aims to demonstrate the model’s capabilities while also addressing a key challenge: the tension between visually interpretable prototype reasoning and the internal mechanisms of class assignment within the network.
The first is a baseline experiment to assess performance on the MNIST dataset ( [
3]) and to examine the prototype representations obtained from the proposed DPBN architecture (see
Figure 1). The second experiment is a model distillation study in which we investigate whether the prototypes learned by the deepest layer of a four-layer Deep Prototype-Based Network (DPBN) can be effectively transferred to a significantly shallower model, without compromising either predictive performance or interpretability. The third experiment addresses a binary classification task designed to demonstrate that the network can produce accurate predictions and visualizations consistent with the class "0", while its internal explanatory mechanisms align more closely with class "1".
For each experimental configuration, we report both classification accuracy and a novel validation metric introduced in this study—the Normalized Negative Entropy (NNE) score. Quantitative findings are further supported by qualitative analyses, comprising visualizations of reconstructed prototypes and learned weight matrices. Collectively, the results elucidate the impact of each architectural choice on the reliability, interpretability, and overall performance of DPBNs.
All the experiments are conducted using the MNIST( [
3]) benchmark dataset. The original training set, comprising 60,000 images, is randonmly partitioned into
for training and
for validation. The official test set of
images is held out for evaluation. All images are resized to
pixels and normalized to the
range using min-max scaling.
4.1. NNE Score
Prototype-based networks typically conclude with a linear classifier, where the weight matrix maps prototype–sample distances to class logits. To assess the interpretability of this final classification layer, we introduce the Normalized Negative Entropy (NNE) score. This metric interprets the prototype-to-class weight matrix W as an information-theoretic channel. After negating W, a row-wise softmax is applied to obtain a class probability distribution for each prototype. The Shannon entropy of each distribution is then computed, inverted, normalized by , and averaged across all prototypes. The resulting NNE score lies within the interval , attaining a maximum value of 1 only when each prototype exhibits a one-hot (i.e., perfectly class-specific) voting pattern.
In contrast to geometric alignment measures—such as the B-Cos transform [
19], which enhances the fidelity of saliency maps by maximizing cosine similarity between inputs and classifier weights, or the support-vector-based alignment strategy employed by WASUP [
20]—the NNE metric exclusively captures the distributional sharpness of the classification head, providing a complementary perspective on model interpretability.
Because large
negative distances should yield a high vote, we first negate the weight matrix and apply a row–wise softmax:
Each row
can now be read as a categorical distribution over classes for prototype
i. As such, for a row
we can compute its Shannon entropy
and normalise it by the maximum possible entropy
to obtain a confidence score
when is a one–hot vector (prototype decisively represents one class) and when is uniform (prototype conveys no class information).
Finally, we average over all
P prototypes:
is therefore higher for more interpretable weight matrices.
We validated the metric with two extreme cases:
| Matrix |
NNE |
| Identity (perfectly sharp) |
|
| Uniform (fully diffuse) |
|
It complements structural sparsity metrics such as global/local size and Hoyer–Square norms in ProtoS-ViT [
21] and the “transparent-head complexity’’ of Shallow-ProtoPNet [
22] by quantifying decisiveness even when the head is dense. Where neuron-level Class-Selectivity Indices normalize entropy over
activations [
23], NNE is the first to apply an entropy normalization directly to prototype voting weights, making it agnostic to input distribution and layer depth. Recent analyses of classifier weight spectra, enabled by bilinear multilayer perceptrons (MLPs) [
24], underscore the value of interpreting the classification head as an information-theoretic channel. In this context, the NNE score provides a concise, task-size-invariant metric that aligns with and supports this perspective.
The proposed metric will be employed throughout this work to evaluate the quality of the classification weight matrix across all experiments, serving as a means to assess and compare the reliability and class specificity of the learned prototypes.
4.2. Experiment 1: Baseline Architecture
The objective of this experiment is twofold: to evaluate the performance of the proposed architecture on the MNIST dataset and to analyze the structure of the resulting prototype representations. As an initial step, we consider the canonical Deep Prototype-Based Network (DPBN), which closely follows the configuration introduced by [
4], with minor modifications to facilitate subsequent ablation studies. The input pipeline preserves the original
luminance pixel values of the MNIST digits, thereby avoiding information loss during preprocessing.
Within the network, layer 1 comprises compact convolutional encoder–decoder module that projects each input image into a 40-dimensional latent vector and reconstructs it back into pixel space. The encoder employs a fixed stride pattern of and a sequence of convolutional filters , progressively reducing the spatial resolution from to over four downsampling stages. This architectural design ensures that each spatial location in the final feature map corresponds to a roughly square receptive field in the input image, a property leveraged in later experiments to interpret prototype activations in a spatially meaningful manner.
The flattened feature map is subsequently projected into a latent representation of dimension via a fully connected layer. The choice of is deliberate, as it constrains the image autoencoder to learn a non-trivial, low-dimensional manifold rather than approximating the identity mapping. This serves as an implicit regularization mechanism for the initial prototype search space. Within this space, prototypes are allocated, resulting in a prototype-to-latent ratio of . Empirical observations from preliminary experiments indicated that this ratio is sufficient to support a near one-to-one correspondence between digit classes and prototypes, while avoiding the introduction of redundant representations.
The subsequent layers (layers 2 through 4) share an identical structural design, differing from the initial layer primarily in that their encoders are implemented as multilayer perceptrons (MLPs) operating on similarity vectors rather than raw image data. Specifically, each distance vector produced by layer l is projected into a latent space of dimension , , then decoded back to its original dimensionality , and subsequently passed to the next prototype layer of equal size. In each layer, the prototypes are initialized from a uniform distribution and jointly optimized alongside the corresponding autoencoder weights. Importantly, we enforce the condition at every depth to ensure that the resulting distance matrices are overcomplete -a necessary property for the hypersphere-intersection solver used to reconstruct prototype representations across layers.
The coefficients we set to based on a coarse log-grid search aimed at balancing classification accuracy with reconstruction fidelity. Model training was performed using the Adam optimizer with a fixed learning rate of 1e-4. An early stopping criterion with a patience of 100 epochs was employed, terminating training when validation accuracy failed to improve over 100 consecutive epochs. On the MNIST dataset, the model converged to a test accuracy of 98.05% after approximately 850 epochs, thereby establishing a strong performance upper bound for the ablation studies that follow.
Interpretability, however, diminishes with increasing network depth. As illustrated in
Figure 2, reconstructed prototypes from all four layers are visually compared. Prototypes in the first layer exhibit clearly defined glyphs, each distinctly associated with a specific digit class. This observation confirms that the autoencoder, in conjunction with the
terms regularization terms, effectively aligns prototypes with the underlying data manifold. By the layer 2, the prototypes lose fine-grained details and become more abstract, although they still retain rough class-specific contours. In layers 3 and 4, interpretability degrades substantially: the reconstructed shapes converge into nearly indistinguishable forms, differentiated only by subtle intensity variations and with weakly class-informative interpretable patterns. Despite this loss in human interpretability, the softmax-normalized weight matrix yields a Normalized Negative Entropy (NNE) score of 0.26, indicating that the classifier maintains a coherent and class-specific internal representation, even as the prototypes themselves become less visually discernible. This observation is particularly significant, as it indicates that the final-layer prototypes retain sufficient information to support accurate classification while simultaneously integrating multiple visual patterns. This behavior is a consequence of the decreasing dimensionality across successive layers, which compels the network to fuse lower-level features. Accordingly, the process can be interpreted as a hierarchical compositional mechanism that preserves discriminative attributes across layers.
4.3. Experiment 2: Model Distillation
In this experiment we investigate whether the prototypes learned by the deepest layer of a four-layer DPBN could be effectively transferred to a significantly shallower model without compromising either predictive accuracy or interpretability. Specifically, the prototype layer extracted from the fourth layer of the reference DBPN was copied into a single-layer DPBN, where it remained fixed during training. Only the autoencoder and the classification head were subsequently trained. Qualitative comparisons between the original layer-4 prototypes and those reconstructed by the distilled model, along with the associated weight matrices
and
, are shown in
Figure 3 and
Figure 4.
Despite the substantial reduction in network depth, the distilled model achieved an accuracy statistically indistinguishable from that of the baseline. Moreover, its weight matrix maintained coherence, with a NNE of 0.18. To assess whether this performance could be attributed to the information encoded in the transferred prototypes, we repeated the experiment using randomly initialized prototype vectors, which were likewise frozen during training. Contrary to our initial hypothesis, the network again attained comparable accuracy and produced sharply defined reconstructed prototypes. This suggests that the raw numerical values of the prototypes, in isolation, contribute little semantic content. Rather, interpretability appears to arise from the dynamics of the autoencoder and the spatial configuration of the prototypes within the latent space. Notably, the geometry of this space retains semantic structure: prototypes corresponding to visually similar digits, such as 8 and 9, are positioned closely, whereas those representing semantically distant digits, such as 2 and 9, are more widely separated. We postulate that this latent space organization underlies the richer structure observed in the weight matrix when training begins with learned or trainable prototypes as opposed to random ones. These findings motivated the follow-up experiment described in the subsequent section, in which the network was trained end-to-end using randomly initialized, frozen prototypes. This design aimed to isolate the contribution of latent space geometry from the influence of prototype initialization.
4.4. Experiment 3: Can
a 1 Look Like a 0?
In this experiment we investigate whether the conclusions drawn in the previous multiclass setting generalize to the simpler binary task of distinguishing the digit “0” from all other handwritten digits. To construct the training corpus, all images corresponding to class “0” from the MNIST training split were retained, while samples from the remaining classes were randomly downsampled to ensure that the alternative class (denoted other) contained an equal number of instances. The resulting dataset was thus balanced, with 80% allocated for training, 10% for validation, and the remaining 10% for testing. All target labels were transformed into binary form using the indicator function .
We retained the deep prototype architecture of the previous experiments, but specified a four-layer prototype hierarchy
where each pair denotes the latent dimensionality, and the number of prototypes. The network was trained for 370 epochs with Adam (learning rate =
) and early stopping after 100 epochs without validation improvement. The highest validation accuracy achieved was 99.49%, with a final test accuracy of 99.48%. Despite this strong predictive performance, the interpretability metrics were less encouraging. Specifically, the softmax-normalized weight matrix of the final classification layer exhibited a normalized negative entropy (NNE) of
, indicating a relatively flat association between prototypes and class labels. Furthermore, two of the four prototypes reconstructed from the deepest layer resembled noisy, amorphous “clouds” (see
Figure 5) rather than well-defined digit patterns, and the weight matrix (see
Figure 6) deviated substantially from a one-hot configuration.
To examine whether the latent geometry captured by the deep model could be more explicit, we distilled the last-layer prototypes into a shallow DPBN comprising a single layer, following the same procedure as in Experiment 2. The prototypes were held fixed during training, while only the autoencoder and classification weights were updated. Training converged after 210 epochs, achieving an accuracy of 99.83%, marginally surpassing that of the original deep model. These results support the hypothesis that a well-structured set of prototypes can facilitate more efficient representation learning, even when the prototypes themselves lack of clear visual interpretability.
A detailed examination of the distilled model revealed an noteworthy behavior. Prototype #4, whose reconstruction clearly depicts a digit “0“ (see
Figure 7), is associated by the weight matrix with the
”others” class with a probability of 66 %. An analysis of the twelve test images with latent encodings closest to this prototype (
Figure 8) confirms that all correspond to well-formed instances of the digit “0”, each correctly classified as class “0“. Consequently, the prototype provides clear visual evidence of the digit “0” while functionally contributing to the decision for the opposing class. Because the mapping between prototypes and classes is learned independently of the visual characteristics of the prototypes, users lacking access to the weight matrix may be misled into believing that the model’s predictions for the “others” class are based on archetypal non-zero digits, when in fact the decisive signal is anchored in a visually canonical zero.
The binary classification setting thus amplifies a concern previously suggested by the multiclass experiments: prototype visualizations alone are insufficient to establish model trustworthiness. A prototype may function as a decoy, simultaneously presenting a compelling, human-interpretable exemplar while driving predictions for an unexpected class. Given that the distance vectors input to the linear classification head are high-dimensional, manual verification of class–prototype associations is impractical, and summary metrics such as normalized negative entropy (NNE) reflect only global sharpness rather than individual inconsistencies.