Abstract
The black-box characteristics of deep learning models make it imperative to explain decision-making mechanisms of these models in a way that humans can understand or interpret. This requirement has become more important as artificial intelligence-based applications take increasingly more critical roles in our lives. To this end, we, in this study, develop a model-agnostic post-hoc explanation method that brings explanations such as underfitting, overfitting, or outlier particularly about the possible root cause of inaccurate decisions produced by convolutional neural network (CNN) based image classification models. Our approach relies on analysis of the model’s response to the k-nearest neighbors in training dataset of the mispredicted test instance. To find visually and semantically similar images in the process of extracting k-nearest neighbors, we measure the distance between the features extracted from internal layers of the model. For the experimental analysis, we first build several underfitted, overfitted and well-fitted CNN models for MNIST and CIFAR-10 datasets. Then, for each different model, we identify the mispredicted test samples in these datasets, and extract their 3-nearest neighbors from the related training sets. We feed the extracted 3-nearest neighbors into the associated model and perform both sample-based and statistical post-hoc explanation for the inaccurately predicted test samples based on the models’ responses to the 3-nearest neighbors.








Similar content being viewed by others
Explore related subjects
Discover the latest articles and news from researchers in related subjects, suggested using machine learning.References
Arrieta AB, Díaz-Rodríguez N, Del Ser J, Bennetot A, Tabik S, Barbado A, García S, Gil-López S, Molina D, Benjamins R, et al. Explainable artificial intelligence (xai): concepts, taxonomies, opportunities and challenges toward responsible ai. Inf Fusion. 2020;58:82–115.
Barbado A, Corcho Ó. Rule extraction in unsupervised anomaly detection for model explainability: application to oneclass svm. arXiv preprintarXiv:1911.09315; 2019.
Bien J, Tibshirani R. Prototype selection for interpretable classification. Ann Appl Stat. 2011;2011:2403–24.
Bilgin Z. Code2image: intelligent code analysis by computer vision techniques and application to vulnerability prediction. arXiv preprint arXiv:2105.03131; 2021.
Bilgin Z, Gunestas M. Explaining inaccurate predictions of models through k-nearest neighbors. ICAART. 2021;2:228–36.
Bologna G. A simple convolutional neural network with rule extraction. Appl Sci. 2019;9(12):2411.
Bologna G, Fossati S. A two-step rule-extraction technique for a CNN. Electronics. 2020;9(6):990.
Bologna G, Hayashi Y. Characterization of symbolic rules embedded in deep dimlp networks: a challenge to transparency of deep learning. J Artif Intell Soft Comput Res. 2017;7(4):265–86.
Caruana R, Kangarloo H, Dionisio J, Sinha U, Johnson D. Case-based explanation of non-case-based learning methods. In: Proceedings of the AMIA symposium. 1999. 212. American Medical Informatics Association.
Castelvecchi D. Can we open the black box of ai? Nat News. 2016;538(7623):20.
Chakraborti T, Sreedharan S, Kambhampati S. The emerging landscape of explainable ai planning and decision making. arXiv preprint arXiv:2002.11697; 2020.
Cui X, Lee JM, Hsieh J. An integrative 3c evaluation framework for explainable artificial intelligence. 2019.
Das A, Rad P. Opportunities and challenges in explainable artificial intelligence (xai): a survey. arXiv preprint arXiv:2006.11371; 2020.
Goodman B, Flaxman S. European union regulations on algorithmic decision-making and a“right to explanation’’. AI Mag. 2017;38(3):50–7.
Gryz J, Rojszczak M. Black box algorithms and the rights of individuals: no easy solution to the “explainability’’ problem. Internet Policy Rev. 2021;10(2):1–24.
Gunning D, Aha DW. Darpa’s explainable artificial intelligence program. AI Mag. 2019;40(2):44–58.
Hall P. On the art and science of machine learning explanations. arXiv preprint arXiv:1810.02909; 2018.
Hendricks LA, Akata Z, Rohrbach M, Donahue J, Schiele B, Darrell T. Generating visual explanations. In: European conference on computer vision, p. 3–19. Springer; 2016.
Holzinger A, Langs G, Denk H, Zatloukal K, Müller H. Causability and explainability of artificial intelligence in medicine. Wiley Interdiscipl Rev Data Min Knowl Discov. 2019;9(4):e1312.
Kenny EM, Ford C, Quinn M, Keane MT. Explaining black-box classifiers using post-hoc explanations-by-example: the effect of explanations and error-rates in xai user studies. Artif Intell. 2021;294:103459.
Krizhevsky A, Hinton G, et al. Learning multiple layers of features from tiny images. 2009.
Kundu S. Ai in medicine must be explainable. Nat Med. 2021; 1–1.
LeCun Y, Cortes C, Burges C. Mnist handwritten digit database. ATT Labs (online). http://yann.lecun.com/exdb/mnist. 2010;2.
Li O, Liu H, Chen C, Rudin C. Deep learning for case-based reasoning through prototypes: a neural network that explains its predictions. In: Thirty-second AAAI conference on artificial intelligence. 2018.
Lipton ZC. The mythos of model interpretability. Queue. 2018;16(3):31–57.
Papernot N, McDaniel P. Deep k-nearest neighbors: towards confident, interpretable and robust deep learning. arXiv preprint arXiv:1803.04765; 2018.
Paredes JN, Teze JCL, Simari GI, Martinez MV. On the importance of domain-specific explanations in ai-based cybersecurity systems (technical report). arXiv preprint arXiv:2108.02006; 2021.
Petkovic D, Altman RB, Wong M, Vigil A. Improving the explainability of random forest classifier-user centered approach. In: PSB. 2018. p. 204–215. World Scientific.
Rai A. Explainable AI: from black box to glass box. J Acad Market Sci. 2020;48(1):137–41.
Ribeiro MT, Singh S, Guestrin C. Why should I trust you?” Explaining the predictions of any classifier. In: Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016. p. 1135–1144.
Roscher R, Bohn B, Duarte MF, Garcke J. Explainable machine learning for scientific insights and discoveries. IEEE Access. 2020;8:42200–16.
Tjoa E, Guan C. A survey on explainable artificial intelligence (XAI): towards medical XAI. arXiv preprint arXiv:1907.07374. 2019.
Turk G, Ozdemir M, Zeydan R, Turk Y, Bilgin Z, Zeydan E. On the identification of thyroid nodules using semi-supervised deep learning. Int J Numer Methods Biomed Eng. 2021;37(3):e3433.
Vilone G, Rizzo L, Longo L. A comparative analysis of rule-based, model-agnostic methods for explainable artificial intelligence. 2020.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This article is part of the topical collection “Agents and Artificial Intelligence” guest edited by Jaap van den Herik, Ana Paula Rocha and Luc Steels.
Rights and permissions
Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Bilgin, Z., Gunestas, M. Exploring Root Causes of CNN-Based Image Classifier Failures Using 3-Nearest Neighbors. SN COMPUT. SCI. 3, 452 (2022). https://doi.org/10.1007/s42979-022-01360-1
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s42979-022-01360-1