Understanding the class separation process of convolutional neural networks
Abstract
Extensive research shows that deep neural networks (DNNs) capture better feature representations than the previous handcrafted feature engineering, which leads to a significant performance improvement. However, it raises the question of how does the neural network spontaneously learn the intermediate representation, during the training process, to correctly separate the test data set into different categories? In this paper, based on the existing research work, we continue to take a small step towards understanding the dynamics of convolutional neural networks (CNN). Specifically, we model the test data set as a relationship graph, and each intermediate layer representation learned by CNN will transform the relationship graph correspondingly. Through these continuous transformations, we investigate the class separation process of CNN from two perspectives: 1) show the evolution of the degree of correlation between samples through the histogram of similarity between vertices; 2) by visualizing and quantifying the degree of separation (i.e., modularity) of the important relationship subgraph, we can show the contribution of each convolution layer of CNN to class separation. In the preliminary experiment, it can be found that: 1) each convolution layer of CNN gradually reduced the similarity of most edges between the samples to a very low level, that is, the dense relationship graph gradually evolved into a sparse graph; 2) the remaining important relationship subgraph consist of edges with high similarity shows evident modularity; 3) both visualization and quantification results show that the modularity of intra-class subgraph increases when the layers go deeper. Moreover, the degradation and plateau in the modularity curve reveal the existence of redundant layers. In this paper, we reveal some more in-depth dynamics of CNN, and introduced another modularity, which is widely used as the theoretical guidance tool of layer pruning. It can save more model parameters without losing the accuracy of classification.
References
- He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 770-778 (2016).
- Maqueda, A.I., Loquercio, A., Gallego, G., Garc?a, N., Scaramuzza, D.: Eventbased vision meets deep learning on steering prediction for self-driving cars. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5419-5427 (2018).
- Redmon, J., Divvala, S., Girshick, R., Farhadi, A.: You only look once: Unified, realtime object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 779-788 (2016).
- Sutskever, I., Vinyals, O., Le, Q.V.: Sequence to sequence learning with neural networks. In: Advances in Neural Information Processing Systems. pp. 3104-3112 (2014).
- Rumelhart, D.E., Hinton, G.E., Williams, R.J.: Learning internal representations by error propagation. Tech. rep., California Univ San Diego La Jolla Inst for Cognitive Science (1985).
- Goh, G., Cammarata, N., Voss, C., Carter, S., Petrov, M., Schubert, L., Radford, A., Olah, C.: Multimodal neurons in artificial neural networks. Distill 6(3), e30 (2021).
- Kornblith, S., Norouzi, M., Lee, H., Hinton, G.: Similarity of neural network representations revisited. In: International Conference on Machine Learning. pp. 3519-3529 (2019).
- Nguyen, T., Raghu, M., Kornblith, S.: Do wide and deep networks learn the same things? uncovering how neural network representations vary with width and depth. In: International Conference on Learning Representations (2021).
- Raghu, M., Gilmer, J., Yosinski, J., Sohl-Dickstein, J.: SVCCA: singular vector canonical correlation analysis for deep learning dynamics and interpretability. In: Advances in Neural Information Processing Systems. pp. 6076-6085 (2017).
- Morcos, A.S., Raghu, M., Bengio, S.: Insights on representational similarity in neural networks with canonical correlation. In: Advances in Neural Information Processing Systems. pp. 5732-5741 (2018).
- Wang, L., Hu, L., Gu, J., Hu, Z., Wu, Y., He, K., Hopcroft, J.E.: Towards understanding learning representations: To what extent do different neural networks learn the same representation. In: Advances in Neural Information Processing Systems. pp. 9607-9616 (2018).
- Tang, S., Maddox, W.J., Dickens, C., Diethe, T., Damianou, A.: Similarity of neural networks with gradients. arXiv preprint arXiv:2003.11498 (2020).
- Feng, Y., Zhai, R., He, D., Wang, L., Dong, B.: Transferred discrepancy: Quantifying the difference between representations. arXiv preprint arXiv:2007.12446 (2020).
- Das, A., Rad, P.: Opportunities and challenges in explainable artificial intelligence (xai): A survey. arXiv preprint arXiv:2006.11371 (2020).
- Zeiler, M.D., Fergus, R.: Visualizing and understanding convolutional networks. In: European Conference on Computer Vision. pp. 818-833 (2014).
- Selvaraju, R.R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., Batra, D.: Gradcam: Visual explanations from deep networks via gradient-based localization. In: International Conference on Computer Vision. pp. 618-626 (2017).
- Wang, F., Liu, H., Cheng, J.: Visualizing deep neural network by alternately image blurring and deblurring. Neural Networks 97, 162-172 (2018).
- Mahendran, A., Vedaldi, A.: Understanding deep image representations by inverting them. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5188-5196 (2015).
- Yao Lu, Wen Yang, Yunzhe Zhang, Zuohui Chen, Jinyin Chen, Qi Xuan, Zhen Wang, Xiaoniu Yang, Understanding the Dynamics of DNNs Using Graph Modularity, ECCV2022.
- Krizhevsky, A., Hinton, G., et al.: Learning multiple layers of features from tiny images (2009).
- Tang, S., Maddox, W.J., Dickens, C., Diethe, T., Damianou, A.: Similarity of neural networks with gradients. arXiv preprint arXiv:2003.11498 (2020).
- Watanabe, C., Hiramatsu, K., Kashino, K.: Modular representation of layered neural networks. Neural Networks 97, 62-73 (2018).
- Watanabe, C., Hiramatsu, K., Kashino, K.: Understanding community structure in layered neural networks. Neurocomputing 367, 84-102 (2019).
- Watanabe, C.: Interpreting layered neural networks via hierarchical modular representation. In: International Conference on Neural Information Processing. pp. 376-388 (2019).
- Davis, B., Bhatt, U., Bhardwaj, K., Marculescu, R., Moura, J.M.: On network science and mutual information for explaining deep neural networks. In: IEEE International Conference on Acoustics, Speech and Signal Processing. pp. 8399C-8403 (2020).
- Hod, S., Casper, S., Filan, D., Wild, C., Critch, A., Russell, S.: Detecting modularity in deep neural networks. arXiv preprint arXiv:2110.08058 (2021).
- You, J., Leskovec, J., He, K., Xie, S.: Graph structure of neural networks. In: International Conference on Machine Learning. pp. 10881-10891 (2020).
- Csordas, R., van Steenkiste, S., Schmidhuber, J.: Are neural nets modular? inspecting their functionality through differentiable weight masks. In: International Conference on Learning Representations (2021).
- Lake, B.M., Ullman, T.D., Tenenbaum, J.B., Gershman, S.J.: Building machines that learn and think like people. Behavioral and Brain Sciences 40 (2017).
- Alet, F., Lozano-Perez, T., Kaelbling, L.P.: Modular meta-learning. In: Conference on Robot Learning. pp. 856-868 (2018).
- Goyal, A., Lamb, A., Hoffmann, J., Sodhani, S., Levine, S., Bengio, Y., Scholkopf, B.: Recurrent independent mechanisms. In: International Conference on Learning Representations (2021).
- Kirsch, L., Kunze, J., Barber, D.: Modular networks: Learning to decompose neural computation. In: Advances in Neural Information Processing Systems. pp. 2414-2423 (2018).
- Delange, M., Aljundi, R., Masana, M., Parisot, S., Jia, X., Leonardis, A., Slabaugh, G., Tuytelaars, T.: A continual learning survey: Defying forgetting in classification tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence (2021).
- Duncan J. Whatts, Small WorldsThe Dynamics of Networks between Order and Randomness, pp.33, 1999, Princeton University Press.
- Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. In: International Conference on Learning Representations (2015).
- Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen, MobileNetV2: Inverted Residuals and Linear Bottlenecks, The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018, pp. 4510-4520.