RespCCT and FreqCCT: Compact, Explainable and Cost-Aware Convolutional Transformers for Multi-Class Respiratory Disease Classification
Organizations: ELITE Research Lab, New York, NY, USA · Department of Computer Science and Engineering, East Delta University, Abdullah Al Noman Road, Noman Society, East Nasirabad, Khulshi, Chattogram, 4209, Bangladesh · Department of Computer Science and Engineering, United International University, United City, Madani Avenue, Badda, Dhaka, 1212, Bangladesh
Abstract
Chest auscultation depends on the listener, and software that classifies lung sounds could give a second reading where trained listeners are scarce. The most accurate published classifiers fine-tune large pretrained networks, and their accuracy is rarely reported with running cost or paired statistics. This study makes three contributions. (i) It proposes RespCCT and FreqCCT, two compact convolutional transformers of 173,187 and 124,999 parameters that learn from random initialization on mel, constant-Q and cepstral images of 5 s frames from three public databases, ICBHI, KAUH and RD@TR, with 1,665 audio files in seven classes. (ii) It compares both models with five ImageNet-pretrained networks and larger distilled variants on one test set, using paired bootstrap intervals. (iii) It measures the cost of every pipeline stage on one CPU thread, tests whether attribution maps depend on the trained weights, and probes whether the learned features reveal the recording source. On the test fold, RespCCT reaches an accuracy of 98.13% and a macro F1 of 0.970, and FreqCCT reaches 97.58% and 0.951. Over five folds, RespCCT with three seeds reaches 97.65% and 0.959, and FreqCCT with one seed reaches 96.95% and 0.941. The two strongest pretrained networks reach a macro F1 of 0.984, whereas RespCCT needs 2.0 to 64.6 times less weight storage. Computing the three input images takes longer than running either model, and a linear probe identifies the source database with 0.958 accuracy. A team can weigh accuracy against storage and time before device testing.
Figures & tables
| Year | Study | Method | Reported result | Limitation | Addressed here |
|---|---|---|---|---|---|
| 2020 | Acharya and Basu Acharya and Basu [2020] | CNN–RNN, patient-specific tuning, weight quantization | ICBHI Score 66.31%, memory cut fourfold | No comparison with pretrained networks | Same data and metrics for all models |
| 2021 | Gairola et al. Gairola et al. [2021] | RespireNet, ResNet34 with ImageNet weights, device-specific fine-tuning | ICBHI Score 56.20% | Needs ImageNet weights | Training from random initialization |
| 2022 | Nguyen and Pernkopf Nguyen and Pernkopf [2022] | Fine-tuned ResNets, co-tuning, device correction | ICBHI Score 58.29% | Needs ImageNet weights, source information not measured | Source probe on learned features |
| 2023 | Bae et al. Bae et al. [2023] | Pretrained AST, patch-mix contrastive learning | ICBHI Score 62.37% | Large pretrained model | Training from random initialization |
| 2024 | He et al. He et al. [2024] | Multi-view patches of one mel spectrogram, gated fusion | ICBHI Score 66.55% | One transform, cost not reported | Three transforms, removed one at a time |
| 2024 | Zhang et al. Zhang et al. [2024a] | Dual-channel CNN–LSTM on MFCC | Accuracy 99.01% (ICBHI, random split) | One input representation | Paired comparison on one test set |
| Class | Audio files | Patients | Frames | Test frames | Frames by source |
| COPD | 1,324 | 115 | 9,837 | 1,967 | ICBHI 6,055, RD@TR 3,629, KAUH 153 |
| Healthy | 140 | 61 | 828 | 139 | KAUH 588, ICBHI 240 |
| Asthma | 97 | 33 | 520 | 101 | KAUH 513, ICBHI 7 |
| Pneumonia | 52 | 11 | 355 | 70 | ICBHI 259, KAUH 96 |
| URTI | 23 | 14 | 159 | 35 | ICBHI 159 |
| Bronchiectasis | 16 | 7 | 112 | 29 | ICBHI 112 |
| Stage | Item | Value | Reason |
|---|---|---|---|
| Signal | Sampling rate, channels | 4 kHz, mono | keeps the 0 to 2 kHz band analyzed here and gives 20,000 samples per 5 s frame |
| Frame length, hop | 5 s (20,000 samples), 2.5 s (10,000 samples) | a 5 s frame holds on average 1.9 breathing cycles of ICBHI with a mean cycle of 2.7 s Nguyen and Pernkopf [2022] , and 50% overlap doubles the number of frames without new recordings | |
| Drift removal | DFT bins 0 to 1 Hz set to zero | removes offset and slow drift below the band of respiratory sounds | |
| Scaling | Division by the maximum absolute value | removes loudness differences between devices, so that loudness cannot decide the class | |
| Augmentation | Stretch, pitch, noise | 0.85 to 1.15, 3 semitones, factor 0.001 to 0.01 | each copy changes tempo, pitch or background noise within these ranges and keeps the label of the frame it was made from |
| Mel view | Bands, FFT, hop, window | 64 (Slaney), 1024 (256 ms), 524 (131 ms), Hamming, 0 to 2000 Hz | 64 rows match the 64 CQT bins, 1024 points give a resolution of 3.9 Hz, the hop gives 39 columns close to the 40 of the other views, and the band is the full range available at 4 kHz |
| Stage | Operation and output | Parameters |
|---|---|---|
| View gate | Linear(3,8), ReLU, Linear(8,3), | 59 |
| Tokenizer | 2 [Conv 3 3 (64), ReLU, MaxPool 3/2/1], 160 64 | 38,720 |
| Encoder | 4 blocks of LN, MHA (4 heads), LN, MLP 64, 128, 64 | 4 33,472 |
| Sequence pooling | Linear(64,1), softmax over tokens | 65 |
| Classifier | Linear(64,7) | 455 |
| Total | 173,187 |
| Model | Group | Initialization | Parameters | MFLOPs | Width / blocks / heads |
|---|---|---|---|---|---|
| RespCCT | Proposed | Random | 173,187 | 124.2 | 64 / 4 / 4 |
| FreqCCT | Proposed | Random | 124,999 | 72.5 | 64 / 4 / 4 |
| CCT-M | Larger variant | Random | 967,619 | 536.8 | 128 / 6 / 4 |
| CCT-M + KD | Distilled student | Random | 967,619 | 536.8 | 128 / 6 / 4 |
| CCT-L | Larger variant | Random | 2,151,811 | 1,135.5 | 192 / 6 / 6 |
| CCT-L + KD | Distilled student | Random | 2,151,811 | 1,135.5 | 192 / 6 / 6 |
| Model group | Learning rate | Weight decay | Batch | Label smoothing | Mixup |
|---|---|---|---|---|---|
| RespCCT, FreqCCT | 0.002946 | 0 | 128 | 0.15 | 0 |
| Pretrained baselines | (grid for two) | 0 | 128 | 0.15 | 0 |
| CCT-M plain | 0.001414 | 0.03 | 256 | 0.15 | 0 |
| CCT-M with distillation | 0.001414 | 0.03 | 256 | 0 | 0.3 |
| CCT-L plain | 0.001061 | 0.05 | 256 | 0.15 | 0 |
| CCT-L with distillation | 0.001061 | 0.05 | 256 | 0 | 0.3 |
| Model | Params | MFLOPs | Acc. | F1 | MCC | Bal. acc. | AUC | ECE | Vote | F1 [95% CI] |
|---|---|---|---|---|---|---|---|---|---|---|
| RespCCT | 173,187 | 124.2 | .9813 | .9695 | .9410 | .9907 | .9994 | .117 | .985 | |
| FreqCCT | 124,999 | 72.5 | .9758 | .9514 | .9244 | .9867 | .9992 | .125 | .983 | .018 [ .036, .005] |
| ShuffleNetV2 0.5 | 348,967 | 17.2 | .9784 | .9659 | .9310 | .9842 | .9994 | .121 | .983 | .004 [ .014, +.006] |
| MobileNetV3 Small | 931,047 | 24.5 | .9881 | .9777 | .9611 | .9892 | .9983 | .122 | .989 | +.008 [ .003, +.020] |
| MobileViT XXS | 953,271 | 109.6 | .9911 | .9843 | .9707 | .9920 | .9999 | .123 | .994 | +.015 [+.006, +.026] |
| EfficientNet-B0 | 4,016,515 | 168.2 | .9915 | .9841 | .9718 | .9901 | .9997 | .123 | .992 | +.015 [+.005, +.025] |
| RespCCT | FreqCCT | |||||||
| Test fold | Acc. | F1 | MCC | Best epoch | Acc. | F1 | MCC | Best epoch |
| 0 | .9813 | .9695 | .9410 | 68 of 80 | .9758 | .9514 | .9244 | 47 of 59 |
| 1 | .9766 | .9625 | .9283 | 61 of 73 | .9675 | .9415 | .8994 | 61 of 73 |
| 2 | .9674 | .9411 | .8981 | 64 of 76 | .9586 | .9191 | .8757 | 49 of 61 |
| 3 | .9780 | .9612 | .9299 | 46 of 58 | .9709 | .9358 | .9077 | 56 of 68 |
| 4 | .9769 | .9584 | .9297 | 84 of 96 | .9749 | .9562 | .9213 | 74 of 86 |
| RespCCT | FreqCCT | ||||||
|---|---|---|---|---|---|---|---|
| Class | Frames | P | R | F1 | P | R | F1 |
| COPD | 1,967 | .999 | .981 | .990 | .997 | .975 | .986 |
| Healthy | 139 | .865 | .964 | .912 | .882 | .971 | .925 |
| Asthma | 101 | .847 | .990 | .913 | .851 | .960 | .902 |
| Pneumonia | 70 | .972 | 1.000 | .986 | .854 | 1.000 | .921 |
| URTI | 35 | .972 | 1.000 | .986 | .921 | 1.000 | .959 |
| Variant | Params | Acc. | F1 | MCC | F1 [95% CI] |
|---|---|---|---|---|---|
| Full model (sequence pooling, three views, gate) | 173,187 | .9813 | .9695 | .941 | |
| Views, mel only | 172,001 | .9780 | .9601 | .929 | .009 [ .025, +.004] |
| Views, mel and CQT | 172,594 | .9775 | .9597 | .929 | .010 [ .022, +.001] |
| Views, mel and MFCC | 172,594 | .9780 | .9650 | .931 | .005 [ .016, +.007] |
| Views, CQT and MFCC (no mel) | 172,594 | .9665 | .9355 | .896 | .034 [ .059, .015] |
| Encoder, no transformer blocks | 39,299 | .8533 | .6779 | .581 | .292 [ .343, .250] |
| Model | Params | MFLOPs | Acc. | F1 | MCC | Errors | Vote |
|---|---|---|---|---|---|---|---|
| RespCCT | 173,187 | 124.2 | .9813 | .9695 | .941 | 44 | .985 |
| CCT-M | 967,619 | 536.8 | .9843 | .9681 | .950 | 37 | .987 |
| CCT-M + KD | 967,619 | 536.8 | .9864 | .9748 | .956 | 32 | .988 |
| CCT-L | 2,151,811 | 1,135.5 | .9792 | .9637 | .933 | 49 | .982 |
| CCT-L + KD | 2,151,811 | 1,135.5 | .9852 | .9680 | .952 | 35 | .987 |
| Ensemble of four CCTs | 6.2 M | 3,345 | .9903 | .9813 | .968 | 23 | .991 |
| Model | Params | MFLOPs | Weights (kB) | Peak act. (kB) | Model latency (ms) | Total (ms) |
|---|---|---|---|---|---|---|
| RespCCT (without gate) | 173,128 | 124.2 | 692.5 | 655.4 | 6.43 / 7.21 | 36.0 |
| FreqCCT | 124,999 | 72.5 | 500.0 | 655.4 | 5.81 / 6.57 | 35.4 |
| ShuffleNetV2 0.5 | 348,967 | 17.2 | 1,395.9 | 245.8 | 9.11 / 11.57 | 38.7 |
| MobileNetV3 Small | 931,047 | 24.5 | 3,724.2 | 184.3 | 6.84 / 7.71 | 36.4 |
| MobileViT XXS | 953,271 | 109.6 | 3,813.1 | 327.7 | 13.96 / 16.14 | 43.6 |
| EfficientNet-B0 | 4,016,515 | 168.2 | 16,066.1 | 983.0 | 16.06 / 17.95 | 45.7 |
| Model | File (MB) | Median (ms) | Ratio |
|---|---|---|---|
| FreqCCT | 0.559 | 3.11 | 1.00 |
| RespCCT (without gate) | 0.742 | 3.73 | 1.20 |
| RespCCT (with gate) | 0.743 | 6.46 | 2.08 |
| EfficientNet-B0 | 15.314 | 6.85 | 2.20 |
| MobileViT XXS | 3.840 | 7.77 | 2.50 |
| CCT-M | 3.813 | 12.60 | 4.05 |
| Study | Data and classes | Evaluation | Reported result | Parameters | Timing |
|---|---|---|---|---|---|
| Pham et al. Pham et al. [2021] | ICBHI, 3 disease classes | official split and five-fold cross-validation | ICBHI Score 84.0 (official split), 90.5 (five folds) | n/a | n/a |
| Zhang et al. Zhang et al. [2024a] | ICBHI, 5,054 augmented samples | random split | accuracy 99.01% | n/a | n/a |
| Hassan et al. Hassan et al. [2024] | ICBHI and KAUH, 3 s frames | as reported | accuracy 0.997 (ICBHI), 1.0 (KAUH), 0.998 (combined) | two convolution layers | n/a |
| Roy et al. Roy et al. [2024] | ICBHI, KAUH and RD@TR, 7 classes | five-fold cross-validation | accuracy 98.88%, sensitivity 98.27% | 0.414 M | 3.48 s per segment on a Raspberry Pi 4 |
| Park et al. Park et al. [2025] | ICBHI and KAUH | 80/20 split | accuracy 79.68% (GPU), 89.46% (Hailo-8 NPU) | 264 K | 245.9 ms on the NPU |
| Dong et al. Dong et al. [2026] | ICBHI, and KAUH with RD@TR, COPD against other | as reported | accuracy 99.23% (ICBHI), 98.48% (KAUH with RD@TR) | n/a | n/a |
Respiratory Sound Classification
Respiratory sound classification uses audio and machine learning to identify breathing events and support respiratory disease assessment.
See all 30 papers