Motor imagery (MI) classification using EEG signals is central to brain–computer interfaces but remains challenging due to low signal-to-noise ratio, non-stationarity, and high inter-subject variability. We introduce EEG-TriNet++, a multi-branch deep learning architecture that enhances both classification accuracy and cross-subject generalization. The model integrates three complementary components: convolutional spatial–spectral encoders for channel-wise and frequency-specific patterns, bidirectional LSTMs to model temporal dynamics, and a Transformer head for global relational reasoning. A patchwise tokenization strategy and neural architecture search optimize the trade-off between efficiency and representational capacity. To address individual differences, a model-agnostic meta-learning (MAML) module enables rapid adaptation to new users with limited data. Evaluated on two public MI datasets under within-subject and leave-one-subject-out (LOSO) protocols, EEG-TriNet++ achieves 79.1% and 78.6% accuracy in within-subject tasks, and 72.4% and 71.3% in LOSO settings. Ablation studies validate the contribution of each module, and comparisons with state-of-the-art methods demonstrate consistent performance gains under identical conditions.
Accurate detection of cardiac arrhythmias from electrocardiograms remains challenging for rare rhythm classes due to class imbalance and morphological variability. We present a hybrid deep learning framework combining per-lead convolutional encoders with a cross-lead transformer that models relationships across different lead signals through self-attention, accepting variable lead configurations. To address minority-class scarcity, a generative adversarial network synthesizes physiologically plausible beat segments for underrepresented arrhythmias. Attention-based visualizations localize influential waveform regions aligned with clinically meaningful structures. Post-training pruning and INT8 quantization enable efficient deployment with minimal performance loss. Extensive experiments on the MIT-BIH Arrhythmia Database across sixteen heartbeat classes from two-lead recordings yield exceptional results over ten independent runs: accuracy of 99.67%, F1-score of 99.66%, and AUC of 99.8%. External validation on the ECG5000 single-lead dataset and the St Petersburg INCART twelve-lead dataset confirms robust generalizability with F1-scores of 97.6% and 98% respectively. Our framework delivers accurate, interpretable, stable, and deployable arrhythmia detection across diverse clinical settings.