Explainable Deep Learning-Based Characterization and Classification of Metallographic Microstructures Using a Multi-Scale Swin Transformer
Abstract Automated classification of metallographic microstructures is challenged by subtle inter-class differences, substantial intra-class variations, and sparse discriminative regions. Conventional convolutional neural networks have limited ability to model long-range dependencies and cross-scale microstructural patterns, whereas vision Transformers may inadequately capture local textures and grain-boundary details. To address these limitations, an explainable multi-scale enhanced Swin Transformer is proposed for complex metallographic microstructure classification. A convolutional information enhancement module and an efficient multi-scale attention module are integrated into the backbone to strengthen the representation of local textures, grain boundaries, and multi-scale morphological features. Generalized mean pooling is adopted in the classification head, while multi-view crop augmentation, focal loss, and five-crop inference are used to improve robustness. Channel-contribution analysis is subsequently performed to identify discriminative channels associated with five microstructure classes. Channel-response maps demonstrate correspondence between the regions emphasized by the network and characteristic microstructural morphologies. The identified channels are preserved during structured pruning, while low-contribution channels are removed. The proposed model achieves an accuracy of 98.00%, a precision of 98.01%, and a Cohen’s kappa coefficient of 0.9750. After pruning, the parameter count decreases from 28.096 M to 14.043 M, representing a reduction of approximately 50.0%, while retaining competitive classification performance. These results demonstrate that the proposed framework provides an accurate, interpretable, and lightweight approach for automated recognition of complex metallographic microstructures.
Authors
- Yongzhi ZHANG (ORCID: https://orcid.org/0009-0003-2872-5433)
- Huan Liu (ORCID: https://orcid.org/0000-0003-4526-4723)
- Xiangming Kong
- Shankun Yu
- Bingshuai Qi
- Chenwei Shao
Institutions
- Inner Mongolia Agricultural University (CN)
- Inner Mongolia Electric Power (China) (CN)
Publication Details
- Journal
- Materials Research Express
- Published
- 2026-11-17
- DOI
- https://doi.org/10.1088/2053-1591/aec362
- Primary Topic
- Advanced Neural Network Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China