Vision Transformers (ViTs), inspired by their success in natural language processing, have recently gained attention for heart sound classification (HSC). However, most of the existing studies on HSC rely on single-stream architectures, overlooking the advantages of multi-resolution features. While multi-stream architectures employing early or late fusion strategies have been proposed, they often fall short of effectively capturing cross-modal feature interactions. Additionally, conventional fusion methods, such as concatenation, averaging, or max pooling, frequently result in information loss. To address these limitations, this paper presents a novel attention fusion-based two-stream Vision Transformer (AFTViT) architecture for HSC that leverages two-dimensional mel-cepstral domain features. The proposed method employs a ViT-based encoder to capture long-range dependencies and diverse contextual information at multiple scales. A novel attention block is then used to integrate cross-context features at the feature level, enhancing the overall feature representation. Experiments conducted on the PhysioNet2016 and PhysioNet2022 datasets demonstrate that the AFTViT outperforms state-of-the-art CNN-based methods in terms of accuracy. These results highlight the potential of the AFTViT framework for early diagnosis of cardiovascular diseases, offering a valuable tool for cardiologists and researchers in developing advanced HSC techniques.
Heart sound classification is crucial in the early detection and diagnosis of cardiovascular diseases, aiming at effectively capturing the complex patterns of heart sound signals. Deep learning models have widespread applications in heart sound classification, but the existing methods solely rely on either early, late or intermediate fusion, which often fail to fully integrate the diverse and multiscale features required for robust classification. To overcome these limitations, this study proposes a novel hierarchical multiscale swin transformer network with attention fusion (HM-Swin), for heart sound classification. The new model incorporates a swin transformer backbone to extract multiscale features spanning from low-level to high-level representations. These features are further refined through a dynamic fusion block, wherein the features extracted by each swin block are enhanced using dedicated channel-wise and spatial attention mechanisms. This approach effectively captures interdependencies, resulting in a robust and comprehensive feature representation. Extensive experiments conducted on publicly available benchmark datasets, namely, PhysioNet2016 and PhysioNet2022, achieve classification accuracies of 98.32% and 90.56%, respectively, demonstrating that HM-Swin achieves higher performance than existing state-of-the-art methods. These results confirm the efficiency and scalability of our model, showing its potential as a solution for automated heart-sound screening and classification.