arXiv ScienceSearch

arXiv subjects

Ahmed Sameh

Publications and source records attributed to Ahmed Sameh.

5 recordsLinked to original sources

Beat-Synchronous Tokenization for ECG Transformers

Transformer-based electrocardiogram (ECG) models commonly tokenize waveforms into fixed temporal patches. Though convenient, fixed patching can split heartbeat structures across token boundaries. We study beat-synchronous tokenization as a physiologically grounded alternative, comparing fixed patches with three beat-aligned strategies: resampled beats, adaptive pooled beats, and resampled beats augmented with R--R interval information. Experiments span two settings: 10-second 12-lead diagnostic classification on PTB-XL after MIMIC-IV-ECG masked pretraining, and 60-second single-lead rhythm classification on Icentia11k after patient-level contrastive pretraining. On PTB-XL, resampled beat tokens achieve the highest mean macro Area Under the ROC Curve (AUROC; 0.8945) and nearly match the best fixed-patch macro Area Under the Precision-Recall Curve (AUPRC; 0.7414), reducing average sequence length from 100 to 11.2 tokens. On Icentia11k, beat-synchronous tokenizers obtain comparable AUPRC to fixed patching with better stability across runs. These results suggest morphology-preserving beat tokenization is a compact, competitive alternative to fixed temporal patching.

cs.LG

The Impact of Temporal Context Length and Encoding Strategies on Self-Supervised ECG Representation Learning

Self-supervised electrocardiogram (ECG) models are often trained on a few seconds of ECG signal and, increasingly, on discretized token sequences. It remains unclear whether these choices sacrifice information needed for rhythm inference and longitudinal consistency in real-world ambulatory recordings. We present a controlled study on the Icentia11k single-lead dataset that varies (i) the input horizon (16 seconds, 1 minute, 5 minutes, and 10 minutes) and (ii) the front-end representation (continuous convolutional patch embeddings vs. fixed vector-quantized tokens), while holding the Transformer backbone and training protocol constant. Representations are assessed by downstream abnormal rhythm detection and by patient-level retrieval that probes cross-session stability. Our results show that increasing temporal context beyond 16-second snapshots yields stronger transfer and higher retrieval accuracy, with the strongest performance achieved by the 5- and 10-minute models, indicating improved capture of slow-varying rhythm dynamics and individual-specific structure. Across all evaluated horizons, continuous patch embeddings outperform discretized tokens, suggesting that quantization can discard clinically relevant waveform detail. These findings motivate ECG foundation models that emphasize extended context and continuous encoders for clinical prediction and similarity-based applications. Our code and pretrained models are publicly available at https://github.com/muha-0/ecg-ssl-representation-learning.

cs.LG

Fault Oblivious Eigenvalue Solver

Eigenvalue problems serve as fundamental substrates for applications in large-scale scientific simulations and machine learning, often requiring computation on massively parallel platforms. As these platforms scale to hundreds of thousands of cores, hardware failures become a significant challenge to reliability and efficiency. In this paper, we propose and analyze a novel fault-tolerant eigenvalue solver based on erasure-coded computations -- a technique that enhances resilience by augmenting the system with redundant data a priori. This transformation reformulates the original eigenvalue problem as a generalized eigenvalue problem, enabling fault-oblivious computation while preserving numerical stability and convergence properties. We formulate the augmentation scheme, establish the necessary conditions for the encoded blocks, and prove the relationship between the original and transformed problems. We implement an erasure-coded TraceMin eigensolver and demonstrate its effectiveness in extracting eigenvalues in the presence of faults. Our experimental results show that the proposed solver incurs minimal computational overhead, maintains robust convergence, and scales efficiently with the number of faults, making it a practical solution for resilient eigenvalue computations in large-scale systems.

math.NA

Adaptive Dual-Layer Web Application Firewall (ADL-WAF) Leveraging Machine Learning for Enhanced Anomaly and Threat Detection

Web Application Firewalls are crucial for protecting web applications against a wide range of cyber threats. Traditional Web Application Firewalls often struggle to effectively distinguish between malicious and legitimate traffic, leading to limited efficacy in threat detection. To overcome these limitations, this paper proposes an Adaptive Dual-Layer WAF employing a two-layered Machine Learning model designed to enhance the accuracy of anomaly and threat detection. The first layer employs a Decision Tree (DT) algorithm to detect anomalies by identifying traffic deviations from established normal patterns. The second layer employs Support Vector Machine to classify these anomalies as either threat anomalies or benign anomalies. Our Adaptive Dual Layer WAF incorporates comprehensive data pre-processing and feature engineering techniques and has been thoroughly evaluated using five large benchmark datasets. Evaluation using these datasets shows that ADL WAF achieves a detection accuracy of 99.88% and a precision of 100%, significantly enhancing anomaly detection and reducing false positives. These findings suggest that integrating machine learning techniques into WAFs can substantially improve web application security by providing more accurate and efficient threat detection.

cs.CR

Exact Calculation of Entanglement in a 19-site 2D Spin System

Using the Trace Minimization Algorithm, we carried out an exact calculation of entanglement in a 19-site two-dimensional transverse Ising model. This model consists of a set of localized spin-1/2 particles in a two dimensional triangular lattice coupled through exchange interaction J and subject to an external magnetic field of strength h. We demonstrate, for such a class of two-dimensional magnetic systems, that entanglement can be controlled and tuned by varying the parameter $\lambda$ = h/J in the Hamiltonian and by introducing impurities into the systems. Examining the derivative of the concurrence as a function of $\lambda$ shows that the system exhibits a quantum phase transition at about $\lambda_c$ = 3.01, a transition induced by quantum fluctuations at the absolute zero of temperature.

quant-ph