k* Distribution: Evaluating the Latent Space of Deep Neural Networks using Local Neighborhood Analysis
Abstract: Most examinations of neural networks' learned latent spaces typically employ dimensionality reduction techniques such as t-SNE or UMAP. These methods distort the local neighborhood in the visualization, making it hard to distinguish the structure of a subset of samples in the latent space. In response to this challenge, we introduce the {k*~distribution} and its corresponding visualization technique This method uses local neighborhood analysis to guarantee the preservation of the structure of sample distributions for individual classes within the subset of the learned latent space. This facilitates easy comparison of different k*~distributions, enabling analysis of how various classes are processed by the same neural network. Our study reveals three distinct distributions of samples within the learned latent space subset: a) Fractured, b) Overlapped, and c) Clustered, providing a more profound understanding of existing contemporary visualizations. Experiments show that the distribution of samples within the network's learned latent space significantly varies depending on the class. Furthermore, we illustrate that our analysis can be applied to explore the latent space of diverse neural network architectures, various layers within neural networks, transformations applied to input samples, and the distribution of training and testing data for neural networks. Thus, the k* distribution should aid in visualizing the structure inside neural networks and further foster their understanding. Project Website is available online at https://shashankkotyan.github.io/k-Distribution/.
- L. v. d. Maaten and G. Hinton, “Visualizing data using t-sne,” Journal of Machine Learning Research, vol. 9, no. Nov, pp. 2579–2605, 2008.
- L. McInnes, J. Healy, and J. Melville, “UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction,” ArXiv e-prints, Feb. 2018.
- M. Gleicher, D. Albers, R. Walker, I. Jusufi, C. D. Hansen, and J. C. Roberts, “Visual comparison for information visualization,” Information Visualization, vol. 10, no. 4, pp. 289–309, Oct. 2011.
- D. L. Arendt, N. Nur, Z. Huang, G. Fair, and W. Dou, “Parallel embeddings: A visualization technique for contrasting learned representations,” in Proceedings of the 25th International Conference on Intelligent User Interfaces, ser. IUI ’20. New York, NY, USA: Association for Computing Machinery, Mar. 2020, pp. 259–274.
- R. Cutura, M. Aupetit, J.-D. Fekete, and M. Sedlmair, “Comparing and Exploring High-Dimensional Data with Dimensionality Reduction Algorithms and Matrix Visualizations,” in Proceedings of the International Conference on Advanced Visual Interfaces, ser. AVI ’20. New York, NY, USA: Association for Computing Machinery, Oct. 2020, pp. 1–9.
- A. Boggust, B. Carter, and A. Satyanarayan, “Embedding Comparator: Visualizing Differences in Global Structure and Local Neighborhoods via Small Multiples,” in 27th International Conference on Intelligent User Interfaces, ser. IUI ’22. New York, NY, USA: Association for Computing Machinery, Mar. 2022, pp. 746–766.
- V. Sivaraman, Y. Wu, and A. Perer, “Emblaze: Illuminating Machine Learning Representations through Interactive Comparison of Embedding Spaces,” in 27th International Conference on Intelligent User Interfaces, ser. IUI ’22. New York, NY, USA: Association for Computing Machinery, Mar. 2022, pp. 418–432.
- H. Hotelling, “Analysis of a complex of statistical variables into principal components.” Journal of educational psychology, vol. 24, no. 6, p. 417, 1933.
- J. B. Kruskal, “Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis,” Psychometrika, vol. 29, no. 1, pp. 1–27, 1964.
- J. W. Sammon, “A nonlinear mapping for data structure analysis,” IEEE Transactions on computers, vol. 100, no. 5, pp. 401–409, 1969.
- J. B. Tenenbaum, V. De Silva, and J. C. Langford, “A global geometric framework for nonlinear dimensionality reduction,” science, vol. 290, no. 5500, pp. 2319–2323, 2000.
- M. Belkin and P. Niyogi, “Laplacian eigenmaps and spectral techniques for embedding and clustering,” Advances in neural information processing systems, vol. 14, 2001.
- R. R. Coifman and S. Lafon, “Diffusion maps,” Applied and computational harmonic analysis, vol. 21, no. 1, pp. 5–30, 2006.
- J.-F. Im, M. J. McGuffin, and R. Leung, “GPLOM: The Generalized Plot Matrix for Visualizing Multidimensional Multivariate Data,” IEEE Transactions on Visualization and Computer Graphics, vol. 19, no. 12, pp. 2606–2614, Dec. 2013.
- M. Gleicher, “Explainers: Expert Explorations with Crafted Projections,” IEEE Transactions on Visualization and Computer Graphics, vol. 19, no. 12, pp. 2042–2051, Dec. 2013.
- H. Kim, J. Choo, H. Park, and A. Endert, “InterAxis: Steering Scatterplot Axes via Observation-Level Interaction,” IEEE Transactions on Visualization and Computer Graphics, vol. 22, no. 1, pp. 131–140, Jan. 2016.
- D. Smilkov, N. Thorat, C. Nicholson, E. Reif, F. B. Viégas, and M. Wattenberg, “Embedding Projector: Interactive Visualization and Interpretation of Embeddings,” Nov. 2016.
- J. Tang, J. Liu, M. Zhang, and Q. Mei, “Visualizing large-scale and high-dimensional data,” in Proceedings of the 25th international conference on world wide web, 2016, pp. 287–297.
- M. Kahng, P. Y. Andrews, A. Kalro, and D. H. Chau, “ActiVis: Visual Exploration of Industry-Scale Deep Neural Network Models,” IEEE Transactions on Visualization and Computer Graphics, vol. 24, no. 1, pp. 88–97, Jan. 2018.
- Q. Li, K. S. Njotoprawiro, H. Haleem, Q. Chen, C. Yi, and X. Ma, “EmbeddingVis: A Visual Analytics Approach to Comparative Network Embedding Inspection,” in 2018 IEEE Conference on Visual Analytics Science and Technology (VAST), Oct. 2018, pp. 48–59.
- M. Dowling, J. Wenskovitch, J. Fry, S. Leman, L. House, and C. North, “SIRIUS: Dual, Symmetric, Interactive Dimension Reductions,” IEEE Transactions on Visualization and Computer Graphics, vol. 25, no. 1, pp. 172–182, Jan. 2019.
- Y. Liu, E. Jun, Q. Li, and J. Heer, “Latent space cartography: Visual analysis of vector space embeddings,” Computer Graphics Forum (Proc. EuroVis), 2019.
- S. Ovchinnikova and S. Anders, “Exploring dimension-reduced embeddings with Sleepwalk,” Genome Research, vol. 30, no. 5, pp. 749–756, Jan. 2020.
- F. Hohman, H. Park, C. Robinson, and D. H. Polo Chau, “Summit: Scaling Deep Learning Interpretability by Visualizing Activation and Attribution Summarizations,” IEEE Transactions on Visualization and Computer Graphics, vol. 26, no. 1, pp. 1096–1106, Jan. 2020.
- E. Amid and M. K. Warmuth, “TriMap: Large-scale Dimensionality Reduction Using Triplets,” Mar. 2022.
- A. Mahendran and A. Vedaldi, “Understanding deep image representations by inverting them,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 5188–5196.
- C. Olah, A. Satyanarayan, I. Johnson, S. Carter, L. Schubert, K. Ye, and A. Mordvintsev, “The building blocks of interpretability,” Distill, vol. 3, no. 3, p. e10, 2018.
- S. Carter, Z. Armstrong, L. Schubert, I. Johnson, and C. Olah, “Activation atlas,” Distill, 2019, https://distill.pub/2019/activation-atlas.
- L. Itti, C. Koch, and E. Niebur, “A model of saliency-based visual attention for rapid scene analysis,” IEEE Transactions on Pattern Analysis & Machine Intelligence, no. 11, pp. 1254–1259, 1998.
- R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, “Grad-cam: Visual explanations from deep networks via gradient-based localization,” in Proceedings of the IEEE International Conference on Computer Vision, 2017, pp. 618–626.
- M. D. Zeiler and R. Fergus, “Visualizing and understanding convolutional networks,” 2013.
- B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba, “Object detectors emerge in deep scene cnns,” 2015.
- A. Bau, Y. Belinkov, H. Sajjad, N. Durrani, F. Dalvi, and J. Glass, “Identifying and controlling important neurons in neural machine translation,” 2018.
- F. Dalvi, A. R. Khan, F. Alam, N. Durrani, J. Xu, and H. Sajjad, “Discovering Latent Concepts Learned in BERT,” in International Conference on Learning Representations, Oct. 2021.
- N. Durrani, H. Sajjad, F. Dalvi, and F. Alam, “On the Transformation of Latent Space in Fine-Tuned NLP Models,” in Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Y. Goldberg, Z. Kozareva, and Y. Zhang, Eds. Abu Dhabi, United Arab Emirates: Association for Computational Linguistics, Dec. 2022, pp. 1495–1516.
- V. W. Anelli, G. M. Biancofiore, A. De Bellis, T. Di Noia, and E. Di Sciascio, “Interpretability of BERT Latent Space through Knowledge Graphs,” in Proceedings of the 31st ACM International Conference on Information & Knowledge Management, ser. CIKM ’22. New York, NY, USA: Association for Computing Machinery, Oct. 2022, pp. 3806–3810.
- S. Liu, Z. Li, T. Li, V. Srikumar, V. Pascucci, and P.-T. Bremer, “NLIZE: A Perturbation-Driven Visual Interrogation Tool for Analyzing and Interpreting Natural Language Inference Models,” IEEE Transactions on Visualization and Computer Graphics, vol. 25, no. 1, pp. 651–660, Jan. 2019.
- H. Strobelt, S. Gehrmann, M. Behrisch, A. Perer, H. Pfister, and A. M. Rush, “Seq2seq-Vis: A Visual Debugging Tool for Sequence-to-Sequence Models,” IEEE Transactions on Visualization and Computer Graphics, vol. 25, no. 1, pp. 353–363, Jan. 2019.
- J. Vig, “A Multiscale Visualization of Attention in the Transformer Model,” in Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, M. R. Costa-jussà and E. Alfonseca, Eds. Florence, Italy: Association for Computational Linguistics, Jul. 2019, pp. 37–42.
- C. Park, I. Na, Y. Jo, S. Shin, J. Yoo, B. C. Kwon, J. Zhao, H. Noh, Y. Lee, and J. Choo, “SANVis: Visual Analytics for Understanding Self-Attention Networks,” in 2019 IEEE Visualization Conference (VIS), Oct. 2019, pp. 146–150.
- B. Hoover, H. Strobelt, and S. Gehrmann, “exBERT: A Visual Analysis Tool to Explore Learned Representations in Transformer Models,” in Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, A. Celikyilmaz and T.-H. Wen, Eds. Online: Association for Computational Linguistics, Jul. 2020, pp. 187–196.
- J. Chauhan and M. Kaul, “BERTops: Studying BERT Representations under a Topological Lens,” in 2022 International Joint Conference on Neural Networks (IJCNN), Jul. 2022, pp. 1–8.
- R. Sevastjanova, E. Cakmak, S. Ravfogel, R. Cotterell, and M. El-Assady, “Visual Comparison of Language Model Adaptation,” IEEE Transactions on Visualization and Computer Graphics, vol. 29, no. 1, pp. 1178–1188, Jan. 2023.
- R. Geirhos, C. R. M. Temme, J. Rauber, H. H. Schütt, M. Bethge, and F. A. Wichmann, “Generalisation in humans and deep neural networks,” in Advances in Neural Information Processing Systems, vol. 31. Curran Associates, Inc., 2018.
- O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein et al., “Imagenet large scale visual recognition challenge,” International journal of computer vision, vol. 115, no. 3, pp. 211–252, 2015.
- J. FitzGerald, C. Hench, C. Peris, S. Mackie, K. Rottmann, A. Sanchez, A. Nash, L. Urbach, V. Kakarala, R. Singh, S. Ranganath, L. Crist, M. Britan, W. Leeuwis, G. Tur, and P. Natarajan, “Massive: A 1m-example multilingual natural language understanding dataset with 51 typologically-diverse languages,” 2022.
- P. Warden, “Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition,” ArXiv e-prints, Apr. 2018. [Online]. Available: https://arxiv.org/abs/1804.03209
- A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu, “Towards deep learning models resistant to adversarial attacks,” arXiv preprint arXiv:1706.06083, 2017.
- K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 770–778.
- S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He, “Aggregated residual transformations for deep neural networks,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2017, pp. 1492–1500.
- M. Tan and Q. Le, “Efficientnet: Rethinking model scaling for convolutional neural networks,” in International conference on machine learning. PMLR, 2019, pp. 6105–6114.
- A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly et al., “An image is worth 16x16 words: Transformers for image recognition at scale,” arXiv preprint arXiv:2010.11929, 2020.
- R. Geirhos, P. Rubisch, C. Michaelis, M. Bethge, F. A. Wichmann, and W. Brendel, “Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness.” in International Conference on Learning Representations, 2019. [Online]. Available: https://openreview.net/forum?id=Bygh9j09KX
- Y. Dong, Q.-A. Fu, X. Yang, T. Pang, H. Su, Z. Xiao, and J. Zhu, “Benchmarking Adversarial Robustness on Image Classification,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 321–331.
- S. Zagoruyko and N. Komodakis, “Wide Residual Networks,” Jun. 2017.
- D. Tsipras, S. Santurkar, L. Engstrom, A. Turner, and A. Madry, “Robustness May Be at Odds with Accuracy,” in International Conference on Learning Representations, 2019.
- S. Kotyan, M. Matsuki, and D. V. Vargas, “Transferability of features for neural networks links to adversarial attacks and defences,” PLOS ONE, vol. 17, no. 4, p. e0266060, Apr. 2022.
- M. Kubis, P. Skórzewski, M. Sowański, and T. Zietkiewicz, “Back transcription as a method for evaluating robustness of natural language understanding models to speech recognition errors,” arXiv preprint arXiv:2310.16609, 2023.
- “Moonseok/AST_speechcommandsV2_final ⋅⋅\cdot⋅ Hugging Face,” https://huggingface.co/moonseok/AST _speechcommandsV2_final, Jun. 2023.
- “Juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands ⋅⋅\cdot⋅ Hugging Face,” https://huggingface.co/juliensimon/wav2vec2-conformer-rel-pos-large-finetuned-speech-commands, Jun. 2023.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.