A swin transformer with cross-task attention and gating for cardiac murmur detection and grading
Related Experiment Video
Updated: Nov 2, 2026

A Swin Transformer-Based Model for Thyroid Nodule Detection in Ultrasound Images
Published on: April 21, 2023
Aihui Han1, Hong Tang2,3, Miao Wang4
1School of Information Engineering, Dalian Ocean University, Dalian, 116023, Liaoning, China.
Abstract:
Cardiac murmur detection and severity grading are critical for early cardiovascular screening; however, existing studies often address these tasks separately and lack sufficient post-hoc explainability. This study aimed to develop a deep learning framework with post-hoc explainability for joint murmur detection and severity grading from phonocardiogram recordings. Heart sound recordings from the CirCor DigiScope dataset were preprocessed using Butterworth band-pass filtering, normalization, and sliding-window segmentation, and transformed into CWT-based time-frequency representations. An improved Swin Transformer, termed ST-CAG (Swin Transformer with Cross-Task Attention and Gating), was proposed for simultaneous murmur detection and three-class severity grading. The framework integrates a spatial attention module for enhancing murmur-related features, a Cross-Task Attention module for information exchange between tasks, and a Grade Gate mechanism for improving severity prediction consistency. Post-hoc explainability was investigated using spatial attention heatmap visualization. ST-CAG achieved accuracies of 98.99% and 95.00% with macro-averaged F1-scores of 94.28% and 94.07% for murmur detection and severity grading, respectively, on the independent test set. Ablation studies demonstrated the contribution of the proposed modules, and attention visualization highlighted discriminative time-frequency regions associated with murmur classification. ST-CAG provides an accurate framework with post-hoc explainability for joint cardiac murmur detection and severity grading. The proposed multitask design and visualization strategy enhance model explainability and demonstrate potential for intelligent auscultation and computer-aided cardiovascular screening.
