Skip to main content

Cosine Similarity is Almost All You Need (for Prototypical-Part Models)

Conferences
Moffett, L; Willard, F; Machado, M; Mokel, E; Donnelly, J; Guo, Z; Costarino, A; Yang, J; Kim, G; Barnett, AJ; Rudin, C
Published in: Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026
January 1, 2026

Prototypical-part networks are a popular interpretable alternative to black-box deep learning models for computer vision because of their faithful, prototype-based self-explanations. However, in practice, they have proven difficult to train because they are highly sensitive to hyperparameter tuning and difficult to comprehend because they contain a large number of prototypes. We show that replacing ℓ2 distance with an angular prototype similarity in the original ProtoPNet greatly improves robustness to hyperparameter selection and is sufficient to produce accuracy and sparsity competitive with state-of-the-art on many backbones and datasets. We also show cosine similarity leads to superior accuracy for five different ProtoPNet architectures (ProtoPNet, TesNet, Deformable ProtoPNet, ProtoTree, and ST-ProtoPNet). Finally, we demonstrate ProtoPNet with cosine similarity produces better semantics than ℓ2: prototypes from cosine models score better on prototype quality metrics and are perceived as more similar 3:2 in a user study. Code is available at https://github.com/lmoffett/cosine-is-almost.

Duke Scholars

Altmetric Attention Stats
Dimensions Citation Stats

Published In

Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026

DOI

Publication Date

January 1, 2026

Start / End Page

1586 / 1596
 

Citation

APA
Chicago
ICMJE
MLA
NLM
Moffett, L., Willard, F., Machado, M., Mokel, E., Donnelly, J., Guo, Z., … Rudin, C. (2026). Cosine Similarity is Almost All You Need (for Prototypical-Part Models). In Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026 (pp. 1586–1596). https://doi.org/10.1109/WACV61042.2026.00160
Moffett, L., F. Willard, M. Machado, E. Mokel, J. Donnelly, Z. Guo, A. Costarino, et al. “Cosine Similarity is Almost All You Need (for Prototypical-Part Models).” In Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026, 1586–96, 2026. https://doi.org/10.1109/WACV61042.2026.00160.
Moffett L, Willard F, Machado M, Mokel E, Donnelly J, Guo Z, et al. Cosine Similarity is Almost All You Need (for Prototypical-Part Models). In: Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026. 2026. p. 1586–96.
Moffett, L., et al. “Cosine Similarity is Almost All You Need (for Prototypical-Part Models).” Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026, 2026, pp. 1586–96. Scopus, doi:10.1109/WACV61042.2026.00160.
Moffett L, Willard F, Machado M, Mokel E, Donnelly J, Guo Z, Costarino A, Yang J, Kim G, Barnett AJ, Rudin C. Cosine Similarity is Almost All You Need (for Prototypical-Part Models). Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026. 2026. p. 1586–1596.

Published In

Proceedings 2026 IEEE Cvf Winter Conference on Applications of Computer Vision Wacv 2026

DOI

Publication Date

January 1, 2026

Start / End Page

1586 / 1596