Through Scatter Plots to Probe Layer-wise Classification in CNNs: An Explainable Visualization Scheme
Abstract
Although convolutional neural networks (CNNs) are very good at classifying images, they are still challenging to understand at the intermediate representation level. This paper proposes a pragmatic, layer-wise scatter-plot scheme that turns high-dimensional convolutional features into readable two-dimensional maps, enabling analysts to judge class separability and boundary errors across layers. We train a compact three-block CNN on MNIST and, for each convolutional block, extract flattened activations, reduce their dimensionality by PCA (100D) → t-SNE (2D), and render paired scatter plots that show correctly classified samples and overlay misclassifications as red crosses. To move beyond anecdotal visuals, this study attaches Silhouette coefficients per layer and per-class error rates. The implementation (PyTorch + scikit-learn + Matplotlib) is lightweight and reproducible. Empirically, separability increases monotonically from Conv1 to Conv3 (Silhouette ≈ 0.21→0.33→ 0.42), while residual errors cluster near inter-class borders (e.g., 9 vs. 4/7), matching human intuition. By mitigating overplotting and coupling visuals with a quantitative index, the method provides actionable diagnostics for hyper-parameter and architecture tuning without modifying the network. The scheme complements feature-visualization and loss-landscape methods by revealing how the population of samples arranges across layers rather than what individual filters detect.
References
- Raj, R., Kos, A. (2025) An extensive study of convolutional neural networks: applications in computer vision for improved robotics perceptions. Sensors, 25: 1033.
- Shirane, K., Yamamoto, T., Tomiyama, H. (2021) A design methodology for approximate multipliers in convolutional neural networks: A case of MNIST. Intern. J. Reconfig. Emb. Syst., 10: 1.
- Sun, Y., Han, Y., Fan, J. (2023) Laplacian-based cluster-contractive t-SNE for high-dimensional data visualization. ACM Trans. Knowl. Discov. Data, 18: 1-22.
- Xia, L., Lee, C., Li, J.J. (2024) Statistical method scDEED for detecting dubious 2D single-cell embeddings and optimizing t-SNE and UMAP hyperparameters. Nat. Commun., 15: 1753.
- Bocker, M., Grushko, M.G., Arline, K.E. (2022) toward improved cancer classification using PCA+ tSNE dimensionality reduction on bulk RNA-seq data. Cancer Res., 82: 2708-2708.
- Meyer, B.H., Pozo, A.T.R., Zola, W.M.N. (2022) Global and local structure preserving GPU t-SNE methods for large-scale applications. Expert Syst. Appl., 201: 116918.
- Zhang, Q., Liu, Y., Fang, H. (2024) Manifold learning-based UMAP method for geochemical anomaly identification. Geochemistry, 84: 126157.
- Goldstein, A., Shahar, Y., Weisman Raymond, M., Peleg, H., Ben-Chetrit, E., Ben-Yehuda, A., Shalom, E., Goldstein, C., Shiloh, S.S., Almoznino, G. (2024) Multi-dimensional validation of the integration of syntactic and semantic distance measures for clustering fibromyalgia patients in the rheumatic monitor big data study. Bioengineering, 11: 97.
- Katarya, R., Saini, R. (2022) Enhancing the wine tasting experience using greedy clustering wine recommender system. Multimed. Tools. Appl., 81: 807-840.
- Wataya, T., Nakanishi, K., Suzuki, Y., Kido, S., Tomiyama, N. (2020) Introduction to deep learning: minimum essence required to launch a research. Jpn. J. Radiol., 38: 907-921.
- Zhang, L., Jiang, C., Chai, Z., He, Y. (2024) Adversarial attack and training for deep neural network based power quality disturbance classification. Eng. Appl. Artif. Intell., 127: 107245.
- Bagirov, A.M., Aliguliyev, R.M., Sultanova, N. (2023) Finding compact and well-separated clusters: Clustering using silhouette coefficients. Pattern Recognit., 135: 109144.
- Wu, W., Shi, X., He, L., Jin, H. (2023) Turbognn: Improving the end-to-end performance for sampling-based gnn training on gpus. IEEE Trans. Comput., 72: 2571-2584.
- Maitra, C., Seal, D.B., De, R.K. (2024) NeuroDAVIS: A neural network model for data visualization. Neurocomputing, 573: 127182.
- Zhou, Y., Sharpee, T.O. (2022) Using global t-SNE to preserve intercluster data structure. Neural Comput., 34: 1637-1651.
- Liu, N., Lu, X., Wan, L., Huo, H., Fang, T. (2018) Improving the separability of deep features with discriminative convolution filters for RSI classification. ISPRS Int. J. Geoinf., 7: 95.
- Kalyanathaya, K.P. (2024) A novel method for developing explainable machine learning framework using feature neutralization technique. Scient. Temper, 15: 2225-2230.
- Xie, T., Chen, J., Yang, Y., Geniesse, C., Shi, G., Chaudhari, A., Cava, J.K., Mahoney, M.W., Perciano, T., Weber, G.H. (2024) LossLens: Diagnostics for Machine Learning Through Loss Landscape Visual Analytics. IEEE Comput. Graph. Appl.: 1-14.