Proceedings

Run Like a Neural Network, Explain Like k-Nearest Neighbor

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 6857-6865.

https://doi.org/10.24963/ijcai.2025/763

Abstract

Deep neural networks have achieved remarkable performance across a variety of applications. However, their decision-making processes are opaque. In contrast, k-nearest neighbor (k-NN) provides interpretable predictions by relying on similar cases, but it lacks important capabilities of neural networks.

The neural network k-nearest neighbor (NN-kNN) model is designed to bridge this gap, combining the benefits of neural networks with the instance-based interpretability of k-NN. However, the initial formulation of NN-kNN had limitations including scalability issues, reliance on surface-level features, and an excessive number of parameters. This paper improves NN-kNN by enhancing its scalability, parameter efficiency, ease of integration with feature extractors, and training simplicity.

An evaluation of the revised architecture for image and language classification tasks illustrates its promise as a flexible and interpretable method.

  1. [Adadi and Berrada, 2018] Amina Adadi and Mohammed Berrada. Peeking inside the black-box: A survey on explainable artificial intelligence (xai). IEEE Access, 6:52138-52160, 2018.
  2. [An et al., 2018] Shuai An, Jun Wang, and Jinmao Wei. Local-nearest-neighbors-based feature weighting for gene selection. IEEE/ACM Transactions on Computational Bi- ology and Bioinformatics, 15(5):1538-1548, 2018.
  3. [Bellet et al., 2015] A. Bellet, A. Habrard, and M. Sebban. Metric Learning. Synthesis Lectures on Artificial Intel- ligence and Machine Learning. Morgan & Claypool Pub- lishers, 2015.
  4. [Bicego and Loog, 2016] M. Bicego and M. Loog. Weighted k-nearest neighbor revisited. In Twenty-Third Interna- tional Conference on Pattern Recognition (ICPR), pages 1642-1647. IEEE, 2016.
  5. [Cover and Hart, 1967] T. Cover and P. Hart. Nearest neigh- bor pattern classification. IEEE Transactions on Informa- tion Theory, 13:21-27, 1967.
  6. [Dua and Graff, 2017] D. Dua and C. Graff. UCI machine learning repository, 2017.
  7. [Goldberger et al., 2004] Jacob Goldberger, Geoffrey E Hin- ton, Sam Roweis, and Russ R Salakhutdinov. Neighbour- hood components analysis. In Advances in Neural Infor- mation Processing Systems, volume 17. MIT Press, 2004.
  8. [Guidotti et al., 2018] Riccardo Guidotti, Anna Monreale, Salvatore Ruggieri, Franco Turini, Fosca Giannotti, and Dino Pedreschi. A survey of methods for explaining black box models. ACM Comput. Surv., 51(5), August 2018.
  9. [He et al., 2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016.
  10. [Jalali and Leake, 2018] V. Jalali and D. Leake. Harnessing hundreds of millions of cases: Case-based prediction at industrial scale. In Case-Based Reasoning Research and Development, ICCBR 2018, Berlin, 2018. Springer.
  11. [Johnson et al., 2019] Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535-547, 2019.
  12. [Keane and Kenny, 2019] Mark T. Keane and Eoin M. Kenny. How case-based reasoning explains neural net- works: A theoretical analysis of XAI using post-hoc explanation-by-example from a survey of ANN-CBR twin-systems. In Case-Based Reasoning Research and De- velopment, pages 155-171, Cham, 2019. Springer.
  13. [Krizhevsky, 2009] Alex Krizhevsky. Learning multiple lay- ers of features from tiny images. Technical report, Univer- sity of Toronto, 2009.
  14. [Kulis, 2013] Brian Kulis. Metric learning: A survey. Found. Trends Mach. Learn., 5:287-364, 2013.
  15. [Le and Mikolov, 2014] Quoc Le and Tomas Mikolov. Dis- tributed representations of sentences and documents. In Proceedings of the 31st International Conference on Ma- chine Learning, volume 32, pages 1188-1196, Bejing, China, 22-24 Jun 2014. PMLR.
  16. [Leake and Ye, 2021] David Leake and Xiaomeng Ye. Har- monizing case retrieval and adaptation with alternating op- timization. In Case-Based Reasoning Research and Devel- opment, ICCBR 2019, pages 125-139. Springer, 2021.
  17. [Li et al., 2018] Oscar Li, Hao Liu, Chaofan Chen, and Cynthia Rudin. Deep learning for case-based reasoning through prototypes: A neural network that explains its pre- dictions. In Proceedings of the Thirty-Second AAAI Con- ference on Artificial Intelligence, pages 3530-3537. AAAI Press, 2018.
  18. [Netzer et al., 2011] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learn- ing. In NIPS Workshop on Deep Learning and Unsuper- vised Feature Learning 2011, 2011.
  19. [Park et al., 2004] Jae Park, Kwang Hyuk Im, Chung-Kwan Shin, and Sang Park. Mbnr: Case-based reasoning with local feature weighting by neural network. Applied Intel- ligence, 21, 11 2004.
  20. [Ricci and Avesani, 1995] F. Ricci and P. Avesani. Learning a local similarity metric for case-based reasoning. In Pro- ceedings of the First International Conference on Case- Based Reasoning, pages 301-312, Berlin, 1995. Springer Verlag.
  21. [Rudin et al., 2022] Cynthia Rudin, Chaofan Chen, Zhi Chen, Haiyang Huang, Lesia Semenova, and Chudi Zhong. Interpretable machine learning: Fundamental prin- ciples and 10 grand challenges. Statistic Surveys, 16:1-85, 2022.
  22. [Rudin, 2019] Cynthia Rudin. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1:206-215, 05 2019.
  23. [Weinberger and Saul, 2009] Kilian Q. Weinberger and Lawrence K. Saul. Distance metric learning for large margin nearest neighbor classification. J. Mach. Learn. Res., 10:207-244, jun 2009.
  24. [Wettschereck et al., 1997] D. Wettschereck, D. Aha, and T. Mohri. A review and empirical evaluation of feature- weighting methods for a class of lazy learning algorithms. Artificial Intelligence Review, 11(1-5):273-314, February 1997.
  25. [Ye et al., 2024] Xiaomeng Ye, David Leake, Yu Wang, Zi- wei Zhao, and David Crandall. Towards network imple- mentation of CBR: Case study of a neural network K- NN algorithm. In Case-Based Reasoning Research and Development, ICCBR 2024, pages 354-370, Cham, 2024. Springer.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards