Abstract
Nanopore sensing holds transformative potential for revolutionizing protein and glycan sequencing. However, translating this potential into practical, high-fidelity identification is severely bottlenecked by the challenge of processing massive amounts of highly similar nanopore ionic-current data, spurring an urgent need for robust, AI-driven solutions. Prevailing deep learning methods suffer from two limitations: they often fail to capture the fine-grained temporal dynamics essential for distinguishing structurally similar analytes, and their generic training strategies inadequately extract weak discriminative features, thus limiting classification precision. Here, we present SEDA-Former (Signal Enhancement and Dynamic Attention Transformer), a deep temporal learning framework designed for high-resolution nanopore single-molecule identification. SEDA-Former incorporates a multi-window sliding standard-deviation method for feature enhancement, a multi-channel temporal convolutional network to mine weak features in temporal dynamics, and a progressive adaptive attention training strategy that dynamically reweights sample losses based on learning difficulty. Across a diverse set of challenging benchmark datasets, including nanopore signals of 15 glycosides, 24 ginsenosides, 8 DNA molecules, and 17 cholic acid conjugates, spanning varying levels of signal complexity, SEDA-Former consistently achieves substantially higher classification accuracy than state-of-the-art methods and demonstrates robust cross-dataset transferability. SEDA-Former provides a versatile and scalable solution to facilitate single-molecule identification in nanopore sensing.
Subject terms: Nanopores, Single-molecule biophysics, Machine learning, Sensors
Nanopore sensing struggles to resolve structurally similar molecules from noisy temporal signals. Here, authors present SEDA-Former, which integrates multi-scale temporal enhancement and progressive adaptive attention training, to achieve robust and accurate classification across diverse molecular datasets.
Introduction
Nanopore sensing has evolved into a transformative analytical paradigm, offering single-molecule resolution that has already revolutionized nucleic acid sequencing and is poised to reshape proteomics and glycomics1. Its fundamental principle relies on the stochastic translocation of individual molecules through a nanoscale aperture, where the analyte’s unique physical and chemical interactions with the pore interface generates characteristic ionic-current blockade signals (Fig. 1a)2. This principle allows nanopore sensors to distinguish between analytes based on minute structural differences3. This capability is exemplified by nanopore-based glycomic studies, which has allowed the identification of diverse glycans differing in composition4,5, chain lengths6–8, connectivity9–11, isomeric patterns12–14, and modifications15, and has paved the way toward nanopore-based glycan sequencing16. However, achieving the high-fidelity nanopore identification is severely limited by the inherent complexity of the nanopore ionic-current signals17. The field faces three major challenges: (1) structurally similar analytes event isomers (e.g., glycans differing only in linkage or branching) produce nearly identical current signatures; (2) the stochastic nature of molecular translocation results in short-lived, noisy, and overlapping signals; and (3) the requirement to resolve these complex signals with fine-grained features within mixtures of dozens and even hundreds of analytes. As a result, accurate classification is no longer a simple pattern-matching task, but rather a high-risk challenge in which subtle feature extraction errors can lead to the incorrect identification of analytes. To overcome these barriers and unlock the full potential of nanopore sensing, there is an urgent need for advanced artificial intelligence (AI)-driven data processing solutions that can autonomously extract and decode weak, dynamic features from massive nanopore datasets.
Fig. 1. AI-based solutions for facilitating nanopore identification.
a Schematic diagram of the nanopore sensing setup, along with representative ionic-current traces showing characteristic blockade signals produced when analyte molecules translocate through a nanopore sensor. b AI-based analysis of nanopore events for classifying or identifying analytes within pools of structurally similar compounds. c Overview of nanopore data preprocessing methods previously used for machine learning or deep learning analysis. d Schematic illustration of the SEDA-Former workflow developed in this work.
Conventional nanopore data analysis relies on manually extracted parameters including blockade duration (Td), blockade depth (ΔI/Io), and amplitude fluctuation to form the two- (2D) or three-dimensional (3D) fingerprint patterns for molecular profiling18–22. However, this fingerprinting strategy struggles to discriminate between analytes with minor structural variations, as their fingerprints often exhibit significant overlap23. In recent years, AI has emerged as a reliable approach for correlating nanopore signals with specific analytes through the modeling and classification of their characteristic fingerprints (Fig. 1b)4,11,12,24–27. However, conventional machine learning approaches requires tedious and time-consuming feature extraction step (Fig. 1c, Ⅰ)24,28. In contrast, deep learning-based methods can automatically discover and learn relevant features directly from nanopore data and have consequently gained increasing attention in nanopore sensing studies. In deep learning approaches, model performance largely depends on the quality of input data and the scientific rigor of the data preprocessing strategies29–35. Nanopore signals inherently exist as variable-length time-series data with non-stationary characteristics and substantial noise, despite encapsulating rich information. To achieve data alignment and meet the input requirements of deep learning, a common preprocessing step involves padding variable-length signals to a unified length, typically using Gaussian noise or the baseline current level of the ionic signal (Fig. 1c, Ⅱ)13,36. However, these padding strategies also suffer from certain limitations. For example, padding with the original baseline current level may preserve subtle baseline differences across events, which can be inadvertently learned by the model as discriminative cues even though they are unrelated to molecular identity, whereas padding with Gaussian noise may introduce artificial fluctuations into regions where no real translocation event exists. Alternatively, nanopore signals are often processed using dimensionality reduction techniques (e.g., histogram mapping)14,37 or transformed into image-based representations (Fig. 1c, Ⅲ, Ⅳ)38,39, making the primary features more readily learnable40–42. While these methods have achieved strong results in processing nanopore data of DNA and RNA, the required data transformation processes inevitably result in the loss of fine-grained information. This is particularly problematic when dealing with structurally analogous small-molecule analytes, which yield barely distinguishable ionic current amplitudes and global waveforms. True structural differences among such analytes only manifest as subtle, noise-obscured, fine-grained, temporal fluctuations that even advanced deep learning models struggle to capture without specialized temporal feature extraction capabilities43–45. What makes matters worse, existing AI models typically employ an undifferentiated learning strategy during training13,14,36. Although this strategy can enhance overall accuracy, it causes the model to prioritize learning patterns from easy-to-distinguish analytes with prominent features, while paying insufficient attention to hard-to-distinguish cases. Consequently, the model is prone to converging to local optima, exhibits limited fine-grained discriminative capability, and shows significantly reduced classification performance for structurally similar analytes.
To address these limitations, here we introduce SEDA-Former (Signal Enhancement and Dynamic Attention Transformer), a high-resolution nanopore signal analysis framework, which comprises three key components: signal enhancement, deep temporal modeling, and adaptive training (Fig. 1d). First, for nanopore signals, a signal enhancement method based on multi-window sliding standard deviation is introduced. While fully preserving the original temporal information, the time-series signals are decomposed into multiple frequency channels, and local fluctuation features are amplified at different scales, significantly improving the perceptibility and learnability of fine-grained information. We then develop a deep temporal network with a TCN (Temporal Convolutional Network)-Transformer. The multi-channel TCN leverages parallel multi-scale convolutional kernels to capture both short-term and long-term dependencies, as well as coarse-grained and fine-grained patterns embedded in the enhanced multi-frequency signals. These representations are then encoded into compact temporal tokens, which are subsequently passed to a dedicated Transformer module for deep relational modeling. For the proposed deep temporal model, we further develop an adaptive training strategy, termed Progressive Adaptive Attention Training (PAAT), which dynamically adjusts the weight loss of samples from different classes according to their similarity. Training initially focuses on easy-to-distinguish analytes to rapidly capture core discriminative features, then progressively shifts attention to hard-to-distinguish analytes. This enables the model to recognize fine-grained distinctions among highly similar analyte signals, enhancing training stability and sensitivity to subtle signal differences. Through the synergistic integration of signal enhancement, temporal modeling, and adaptive training, SEDA-Former is capable of extracting subtle structural variations from highly similar nanopore signals, enabling robust and high-accuracy molecular identification.
Results demonstrate that SEDA-Former achieves substantial advances in both overall accuracy and fine-grained discrimination of structurally comparable analytes. On nanopore signal datasets comprising varying numbers of glycosides, SEDA-Former achieves classification accuracies of 97.6% (15 Steviol glycosides) and 96.6% (24 Ginsenosides), outperforming previous CNN (Convolutional Neural Network)-based approaches. Notably, for some most challenging-to-identify glycosides, SEDA-Former delivers performance improvements of over 10.2% and 13.9%. Beyond glycosides, SEDA-Former exhibits strong cross-domain generalization. When evaluated on nanopore DNA data with just 9.5% of the training samples used by the baseline model, it still surpasses the baseline substantially, reaching an accuracy of 99.4%. Furthermore, on a nanopore dataset of 17 cholic acid conjugations characterized by exceptionally short durations—where learning and classification are substantially more challenging due to severe information scarcity—SEDA-Former still achieves accuracy exceeding 95%, significantly surpassing baseline methods. Across all four benchmark datasets, which span distinct molecular categories and levels of structural complexity, SEDA-Former was applied without any structural or parametric modifications. These results indicate that SEDA-Former not only markedly enhances the identifiability of fine-grained dynamic temporal features in nanopore signals, but also exhibits excellent robustness and cross-domain generalization stability, highlighting its strong potential as a universal framework for nanopore-based molecular identification.
Results
Architecture and workflow of the SEDA-former framework
Nanopore sensing technology functions by detecting the ionic current blockades that occur when molecules pass through the pore. As analyte molecules briefly reside in a nanopore, their various chemical groups interact sequentially with the pore interface, thereby causing their structural characteristics to be mapped time-dependently as dynamic changes in ionic current signals. The resulting current-time trajectory essentially constitutes a time-series representation of the molecule’s shape, charge, and related physical and chemical properties, effectively forming a dynamic molecular fingerprint. The time-series features indicate that the nanopore sensing process is a time-evolutionary system of molecular-pore interface interactions. As a result, the three-dimensional structure of a molecule is effectively unfolded into a one-dimensional time-series signal. For structurally similar analytes, subtle molecular differences often do not manifest as pronounced changes in current amplitude but instead emerge as short-lived, localized instabilities in ionic-current dynamics, which are easily obscured by temporal averaging or noise in the raw signal. These subtle time-series changes that are often attenuated or ignored are precisely the core information basis for identifying structurally similar analytes, which should be amplified rather than filtered out during modeling process to enhance the model’s sensitivity to dynamic differences and improve fine-grained discriminative performance.
Motivated by the time-evolutionary nature of nanopore signals, we propose a multi-window sliding standard deviation strategy to enhance discriminative features in nanopore time-series data. Specifically, for each normalized ionic-current trace, a forward sliding window is applied with unit stride, and the standard deviation of the signal values within each window is computed to quantify the local temporal fluctuation intensity. The resulting fluctuation sequence is then padded at both boundaries with zeros to restore the original temporal length. Unlike representations based on absolute signal amplitude, this operation characterizes short-term variability around the local mean, providing an explicit and learnable measure of transient ionic-current dynamics. By employing multiple window sizes (denoted as , , …), the original signal is decomposed into a set of multi-scale fluctuation channels, each capturing temporal dynamics at a distinct resolution and collectively spanning the full spectrum from high-frequency transient perturbations to low-frequency, slowly varying patterns. As illustrated in Fig. 2a, the enhanced representation is constructed by jointly encoding the raw signal together with its multi-scale standard deviation features, yielding a composite input that integrates both amplitude information and dynamic variability across temporal scales (See method for details). Compared to previous sequence histogram mapping and image conversion methods that often compress fine-grained information, our sliding standard deviation-based multi-frequency enhancement strategy provides two key advantages. First, it achieves lossless preservation of raw sequence information, ensuring the integrity of global structural trends and local dynamic details. Second, through adjustment of sliding window sizes, it amplifies weak and transient dynamic features while preserving precise temporal localization: smaller windows emphasize high-frequency, short-lived fluctuations, whereas larger windows capture broader stability patterns over extended time spans. This approach explicitly amplifies the discriminability of fine-grained dynamic signals that are often obscured by global trends.
Fig. 2. Schematic illustration of SEDA-Former framework.
a The multi-window sliding standard deviation method to enhance nanopore data. Here, w1 to wn denote sliding windows with different lengths, and SD denotes sliding standard deviation. b The network consists of a multi-channel TCN module, a time-series Tokenization module, and an attention mechanism module (Transformer). Here, FC denotes a fully connected layer, Conv denotes convolution, ReLU denotes the rectified linear unit activation function, Max-Pool denotes max pooling, and Avg-Pool denotes average pooling. c Analyte species with nanopore signatures that are easy, moderately easy, or hard to distinguish. d Schematic illustrating the PAAT process. e Projected training process under PAAT.
Following signal enhancement, we present the network architecture of SEDA-Former comprising three modules: a multi-channel TCN module, a time-series tokenization module, and an attention mechanism module (Transformer structure), as shown in Fig. 2b. First, multi-frequency-enhanced signals from multi-window sliding standard deviation processing are fed into the multi-channel TCN. This module utilizes parallel multi-scale convolutional kernels to extract feature representations of time-series across different temporal resolutions, enabling the model to capture diverse temporal dependencies. Next, a max-pooling operation is applied to compress the extracted features, which are then reorganized into time-series tokens. This step effectively preserves the principal temporal structures while reducing data dimensionality. Finally, these tokens are passed into the customized Transformer module, where multi-head self-attention mechanisms are used to model global temporal correlations, thereby enabling precise classification of complex dynamic signals (See “Method” for architectural details).
When analyzing different types of analytes, nanopore sensors generate distinct characteristic ionic-current signals, whose patterns inherently reflect variations in molecular structure. For some molecules, the signal features are highly discriminative, enabling deep learning models to readily identify them. However, for molecules with structural similarities and subtle signal differences, the recognition task becomes considerably more challenging (Fig. 2c). Conventional training with static loss objectives tends to bias the model toward optimizing easy-to-distinguish samples, leading to premature convergence to local optima. Meanwhile, to avoid misclassification, the model may exhibit conservative behavior toward hard-to-distinguish samples, often refraining from making definitive decisions. To address this critical limitation, we propose a PAAT mechanism that dynamically adjusts sample weights in the loss function according to the model’s real-time performance during training (Fig. 2d). The model initially focuses on learning from easily distinguishable samples to rapidly acquire the dominant discriminative features. As training progresses, the attention gradually shifts from easy to hard samples, encouraging the model to refine its representation of subtle signal differences. Specifically, after each epoch , we compute the classification accuracy for each class , where denotes the class index and denotes the accuracy of class at epoch . To reduce sensitivity to fluctuations in a single epoch, we further define an exponentially smoothed class-wise accuracy estimate as follows:
| 1 |
where is the smoothing coefficient. Let indicate whether a sample belongs to class , and let denote the predicted probability for class . The re-weighted loss is then defined as:
| 2 |
where , is a small positive constant for numerical stability. This progressive weighting amplifies attention toward hard-to-distinguish or under-represented classes (see Method for details), which effectively mitigates early overfitting and local minima, guides the model toward a targeted optimization trajectory, and significantly enhances its ability to distinguish structurally similar molecules (Fig. 2e). Overall, the SEDA-Former framework establishes an integrated temporal recognition pipeline. It encompasses signal enhancement, feature extraction, global attention-based classification, and adaptive model training, designed to efficiently capture and identify multi-scale temporal features embedded in nanopore ionic-current signals.
Benchmark performance for classifying 15 glycosides
In a previous study13, we developed a model, SteviNet, for identification of diverse glycosides, leveraging characteristic nanopore signals from 15 distinct glycosides (Steviol glycosides) (SG−15 dataset). The model employed a 1D-CNN architecture, in which data were first padded to uniform sequence lengths before being fed into the network for training. Although SteviNet achieved an overall classification accuracy of 93.6%, its performance was notably poor on two pairs of structurally analogous glycosides: Ste‑DuA and RebA‑RebC (Fig. 3a). This limitation stems primarily from their extreme structural similarity, differing only by a glycosyl motif (Fig. 3b). Consequently, these subtle variations result in nearly indistinguishable ionic current waveforms across short-, medium-, and long-duration events, with corresponding event distributions in the ΔI vs. Td scatter plots exhibiting extensive overlap (Fig. 3c). These results demonstrate that the method conventionally considered highly discriminative in nanopore analysis lacks sufficient resolving power for molecules with extreme structural similarity.
Fig. 3. Classification results for SG-15 dataset.
a Confusion matrix of the model SteviNet on the SG-15 dataset. b, c High structural similarity among several glycosides leads to highly analogous nanopore events and overlapping event distributions. For the scatter plots in panel (c), 5000 nanopore events (n = 5000) were analyzed for Ste and DuA, respectively. d Confusion matrix of the SEDA-Former classification model on the SG-15 dataset. e Improved performance for each glycoside achieved by SEDA-Former compared to SteviNet. Values are absolute differences in percentage points. f Feature activation maps for Ste and DuA extracted by the CNN module in SteviNet and the TCN module in SEDA-Former.
Using the SG-15 dataset, we trained a model with SEDA-Former, which achieved an overall classification accuracy of 97.6%, outperforming the baseline model (Supplementary Fig. 1). Its confusion matrix reveals a marked reduction in nonspecific misclassifications (Fig. 3d). The mean per-class accuracy along the main diagonal improved by 4.0 percentage points (PPs), with the most significant absolute improvements observed for structurally similar pairs such as Ste ( + 10.2 PPs), RebC ( + 8.5 PPs), DuA ( + 6.3 PPs), and RebJ ( + 6.2 PPs) (Fig. 3e). Figure 3f presents the feature activation maps extracted by the TCN in SEDA-Former and the CNN in SteviNet, which further illustrate the mechanistic basis for SEDA-Former’s enhanced performance. The TCN shows clear superiority over the CNN in processing nanopore signals. For Ste and DuA samples, the final CNN layer of SteviNet (i.e., the CNN feature map closest to the output head) exhibited highly similar periodic and globally aligned activation patterns, suggesting that temporal diversity is largely suppressed by the convolutional projection inherent to CNN-based feature extraction. In contrast, SEDA-Former’s final TCN feature map reveals pronounced local heterogeneity, with activations concentrated within transient dwell and rebound intervals (highlighted by red boxes). Similarly, a comparison of feature activation maps for RebA and DuA from TCN also reveals notable differences (Supplementary Fig. 2). These localized, high-intensity responses correspond to subtle, structure-specific dynamic variations, demonstrating that temporal modeling effectively preserves and amplifies the critical time-domain cues required for molecular discrimination. The concentration of feature differences in the initial stage mainly results from preprocessing and temporal compression. For the highly similar sample pair shown here, the effective current signals are relatively short, so after right zero-padding to a unified input length, most informative content is located in the front part of the sequence, whereas the later part is largely padding background.
It is worth stressing that the four percentage point improvement in accuracy (from 93.6% of the baseline model to 97.6% of the SEDA-Former model) represents a meaningful breakthrough, especially given the high baseline accuracy and the large sample size of the dataset, which includes nanopore events of 15 glycosides. In high-accuracy classification tasks, marginal increases in accuracy are typically difficult to achieve, as the model has already captured most of the discriminative features of the samples46,47. The accuracy enhancement observed here demonstrates that the optimized data preprocessing method effectively reduced noise interference in nanopore signals, while the adaptive attention mechanism allowed the model to focus on subtle yet critical fine‑grained temporal features that were previously overlooked. Such improvements reflect not merely a numerical increase, but a qualitative leap in the model’s robustness and generalization capability, which can significantly reduce misclassification rates in practical glycoside detection applications.
Cross-dataset generalizability to structurally more complex glycosides
To assess the generalization ability of SEDA-Former across different molecule systems, we expanded our study from a dataset of 15 glycosides to a larger dataset (the GIN-24 dataset, which contains nanopore events of 24 ginsenosides, another category of glycosides) (Fig. 4a)14. GIN-24 represents a substantially more challenging benchmark than SG-15. In addition to the larger number of analyte classes, ginsenosides exhibit higher structural similarity and greater heterogeneity across subclasses, rendering fine-grained discrimination considerably more difficult and placing greater demands on the modeling of subtle temporal dynamics. The previous model (GS‑Net), which employed histogram mapping of nanopore signals and was trained using a 1D‑CNN, attained an overall accuracy of 91.2% (Fig. 4b)14. The most significant misclassifications occur between Rg1 and Rg2, as well as between Rb2 and Rb3, due to the near‑overlap of their nanopore signals resulting from their highly similar chemical structures (Supplementary Figs. 3 and 4). In contrast, the SEDA-Former model gave an overall classification accuracy of 96.6% on the GIN-24 dataset (Supplementary Fig. 5), markedly outperforming the baseline model (91.2%). The confusion matrix revealed a pronounced reduction in off-diagonal misclassifications (Fig. 4c). Notably, the most challenging misclassifications, Rg1 → Rg2 and Rg2 → Rg1, were reduced from 11.8% and 8.7% to 4.0% and 5.0%, respectively. Across all 24 molecular classes, SEDA-Former outperformed GS-Net in per-class accuracy, with an average improvement of 5.3 PPs (Fig. 4d). The largest gains were observed for Rd ( + 13.9 PPs), Rb2 (+8.7 PPs), and F2 ( + 8.4 PPs). Importantly, these improvements were achieved under a zero-adjustment transfer setting (i.e., without any structural modification or hyperparameter re-optimization compared to the model used for SG-15), demonstrating that SEDA-Former autonomously captures time-domain regularities across distinct nanopore signal systems. This capacity to transfer learned temporal patterns across chemical families demonstrates its exceptional robustness and domain generality.
Fig. 4. Classification results for GIN-24 Dataset.
a Chemical structure of the representative ginsenoside and cartoon representations of 24 ginsenosides based on the symbol nomenclature for glycans (SNFG). b, c Confusion matrixes for the GS-Net and the SEDA-Former classification models on the GIN-24 dataset. d Improved performance for each glycoside achieved by the SEDA-Former classification model compared to GS-Net. Values are absolute differences in percentage points. e Feature activation maps for Rg1 and Rg2 extracted by the CNN module in GS-Net and the TCN module in SEDA-Former.
We also visualized the final feature map comparison between GS-Net and SEDA-Former for the most easily confounded Rg1 and Rg2 classes. As shown in Fig. 4e, the CNN activations were nearly indistinguishable, suggesting that the convolutional projection compresses temporal diversity and captures only quasi-stationary signal envelopes, thereby smoothing away crucial transient information. In contrast, the final TCN feature map of SEDA-Former exhibited pronounced local heterogeneity along the temporal axis, selectively responding to transient fluctuations, brief dwell events, and rebound segments in the ionic current. A concentration of discriminative differences in the early stage is also observed here, for the same reason: the effective signal content is mainly located in the front part of the padded sequence. These localized activations correspond to short-lived pauses and conformational transitions during molecular translocation, key dynamic cues for distinguishing closely related glycosides. Consequently, SEDA-Former’s temporal modeling framework effectively preserves and amplifies these fine-scale dynamic discriminants, fundamentally explaining its superior robustness and cross-system generalization in complex analyte classification. In addition, the strong performance of SEDA-Former on an extended dataset (the GIN-24 dataset containing nanopore signals from 24 molecular species) demonstrates its compatibility with larger‑scale data inputs and its effectiveness in classifying samples with higher complexity and diversity. For example, glycans exhibit considerable structural complexity and heterogeneity48. In future glycomics analyses, complex samples will likely contain dozens or even hundreds of glycan types. Consequently, combining nanopore sensing with SEDA‑Former is expected to provide a powerful tool for single‑molecule profiling and identification of numerous glycans within complex biological matrices.
Generalization to a DNA dataset with limited data
The datasets used above were derived from measurements using biological nanopore sensors, whose small pore sizes make them well-suited for analyzing various small-molecule analytes. In contrast, solid-state nanopore sensors, with their larger pore sizes, are appropriate for detecting various macromolecules, such as proteins and DNA. Figure 5a shows the solid-state nanopore measurement of DNA molecules with different nanostructures, adapted from a study by Bell et al.49. The resulting signals, with durations of approximately 2 ms, allow for the identification of distinct DNA nanostructures based on their characteristic patterns (represented as different barcodes in Fig. 5b). Subsequently, Misiunas et al. assembled a training dataset comprising nanopore events from eight DNA nanostructures (5593, 8155, 2319, 15178, 876, 7251, 6473, and 6680 events for barcodes 000, 001, 010, 011, 100, 101, 110, and 111, respectively) (Fig. 5c) and trained a CNN‑based model, QuipuNet, by applying a data‑padding strategy36. QuipuNet can correctly identify most of nanopore events, with the overall accuracy of 94.6%. Figure 5d shows the confusion matrix of QuipuNet.
Fig. 5. Evaluation of SEDA-Former for classifying 8 DNA molecules.
a Schematic of solid-state nanopore detection for DNA molecules with nanostructures. b Representative nanopore events and their corresponding barcode representations for different DNA molecules. c Dataset sizes used for QuipuNet and SEDA-Former. d, e Confusion matrixes for the QuipuNet and the SEDA-Former classification models on the DNA-8 dataset. f Improved accuracy for each DNA molecule achieved by the SEDA-Former classification model compared to QuipuNet. Values are absolute differences in percentage points. Classification performance at different training‑data proportions for overall accuracy (g) and for barcode 000 (h). For each proportion, n = 10 independent Monte Carlo runs (computational replicates). The training size of barcode 100 was kept fixed, while all other classes were proportionally reduced. Box plots show median (center line), 25th/75th percentiles (box bounds), whiskers (most extreme points within 1.5×IQR), and outliers (open circles). Green triangles denote mean values; blue lines connect means across proportions. i Confusion matrix under a stringent small-sample setting, with all classes except barcode 100 reduced to 10% of their original training sizes.
We evaluated SEDA-Former’s ability to identify DNA nanostructures using these solid-state nanopore signals. Notably, the evaluation was conducted under the same configuration setting as that used for SG-15 and GIN-24 datasets, with the network architecture, input pipeline, and core hyperparameter configuration directly retained rather than redesigned for this dataset. In practice, only about 9.5% of the training data (893, 383, 382, 525, 148, 205, 1253, and 1175 events for barcodes 000, 001, 010, 011, 100, 101, 110, and 111, respectively) used for the QuipuNet was acquired from publicly available data sources (Fig. 5c). The SEDA-Former was then directly applied to process the acquired nanopore events and was trained on the small dataset (DNA-8 dataset). The resulting SEDA-Former model surprisingly presents an overall accuracy of up to 99.4% (Supplementary Fig. 6), far surpassing 94.6% of QuipuNet. Its confusion matrix displays an almost fully saturated main diagonal (Fig. 5e). Its confusion matrix displayed an almost fully saturated main diagonal (Fig. 5e). The average per-class accuracy improved by +4.8 PPs, with the most notable gains observed for the 010 and 110 classes, both of which improved by +10 PPs (Fig. 5f).
The confusion matrix shows that barcode 100 was mainly misclassified as 000 (9%) and 110 (5%), resulting in a relatively lower accuracy than that of the other classes. However, structural comparison of barcodes 100, 000, and 110, together with analysis of their representative nanopore translocation signal patterns, indicates that barcode 100 is structurally distinct from the other two and does not produce identical signal patterns (Supplementary Fig. 7). This suggests that the lower accuracy of barcode 100 is unlikely to arise from an intrinsic lack of structural or signal-level separability or difference among these three barcodes. Compared with the SG-15 and GIN-24 datasets (up to ~200 ms), the DNA-8 signals are substantially shorter in effective duration (~2.4 ms) and therefore provide much less temporal information for the model to learn from (Supplementary Table 1). Under such short-signal conditions, the effect of limited training data is expected to become more pronounced.
We further performed additional low-sample experiments in which the training size of class 100 was kept fixed, while the training sizes of all other classes were proportionally reduced. As the amount of training data decreased, the overall classification accuracy gradually declined, and the run-to-run variability increased (Fig. 5g). This trend became more evident under the most stringent 10% setting, where the mean accuracy was lower and the variance across Monte Carlo runs was larger, indicating reduced stability under small-sample conditions. Under the same setting, barcode 000 exhibited a similar pattern, with its mean accuracy decreasing and its variability increasing as the available training data became more limited (Fig. 5h). Under the most stringent condition, where the training sizes of all classes except 100 were reduced to 10% of their original values, the confusion matrix (Fig. 5i) showed an increase in off-diagonal errors across multiple classes, further indicating that insufficient training data led to a broader decline in discriminative stability rather than a difficulty unique to barcode 100. These results indicate that the relatively lower performance of barcode 100 in Fig. 5e is mainly attributable to its quite limited sample size, rather than to a barcode-specific lack of distinguishability. More broadly, this difficulty is not unique to barcode 100, but reflects a more general limitation associated with insufficient training data under very short-signal conditions.
These results demonstrate that SEDA-Former possesses exceptional robustness and domain generality: even under substantial data scarcity and without any prior domain-specific knowledge, it consistently learns and captures the intrinsic temporal regularities of nanopore signals, achieving high-precision recognition on a distinct and fully heterogeneous molecular system.
Generalization to cholic acid conjugates with particularly short signals
To further assess the model’s generalizability, we investigated its performance on a dataset of nanopore events with short durations derived from cholic acid conjugates (CA-AAs), a class of small-molecule metabolites. CA-AAs are formed through the covalent coupling of cholic acid and various amino acids (Fig. 6a and Supplementary Fig. 8) and play important roles in metabolic regulation50. Nanopore single-molecule sensing shows promise for analyzing these structurally diverse CA-AAs. However, nanopore events obtained from the aerolysin sensor for a larger set of CA-AAs exhibit signal durations of approximately 1 ms21. Moreover, signal distributions for some molecules show substantial overlap in the ΔI vs. Td scatter plot (Fig. 6b). In contrast to nanopore events from the SG-15, GIN-24, and DNA-8 datasets, which are relatively long and contain rich temporal information, nanopore events of CA-AAs leave only a quite limited temporal footprint (often consisting of only a few tens of sampling points). This provides minimal opportunity for stable temporal patterns to develop, substantially increasing the difficulty of learning discriminative representations.
Fig. 6. Evaluation of SEDA-Former in classifying 17 CA-AAs.
a Representative chemical structure of CA-AAs and the corresponding ionic current traces showing characteristic signals of CA-AAs. b ΔI vs. Td scatter plot for the nanopore signals of 17 CA-AAs. For each CA-AA, n = 5000 events. c, d Confusion matrices for the baseline (CA-Net) and the SEDA-Former classification models on the CA-17 dataset. e Improved classification accuracy of CA-AA molecules achieved by the SEDA-Former model compared to CA-Net. Values are absolute differences in percentage points. f Classification performance of CA‑Net and SEDA‑Former using different fractions of the training data. For each proportion and model, n = 20 independent training/evaluation runs (computational replicates). Box plots: center line = median; box bounds = 25th/75th percentiles; whiskers = most extreme points within 1.5×IQR; outliers not shown. White diamonds = mean accuracy. Purple = CA‑Net; green = SEDA‑Former.
For the dataset consisting of nanopore events from 17 CA-AAs (CA-17 dataset), we first develop a classification model using the histogram mapping method and the network architecture (1D-CNN) of GS-Net. Unsurprisingly, the resulting model (named CA-Net) exhibited pronounced off-diagonal dispersion in its confusion matrix (Fig. 6c). High misclassification rates were observed among CA-AAs with similar amino acid side chains (e.g., CA-N and CA-Q) (Supplementary Fig. 8b) or with closely related physicochemical properties (e.g., CA-E and CA-D containing identical acidic residues) (Supplementary Fig. 8e), resulting in a modest overall accuracy of 73.2%. These results indicate that subtle structure-dependent differences within the short-lived nanopore signals are compressed into fleeting transient fluctuations, which are easily smoothed out by conventional feature extraction and convolutional operations.
On the CA-17 dataset, SEDA-Former produced a confusion matrix with a nearly saturated main diagonal and achieved a significantly higher accuracy of 97.2% (Fig. 6d and Supplementary Fig. 9), demonstrating a clear advantage in identifying small molecule CA-AAs from short-live nanopore events. Importantly, this CA-17 evaluation was also performed under the same configuration used for the other datasets, without task-specific structural redesign or dedicated hyperparameter re-optimization. Per-class analysis revealed consistent improvements across all CA-AAs, with an average accuracy gain of +24.2 PPs (Fig. 6e). To further assess robustness under limited data availability, both models were evaluated using different fractions of the training data (10%, 25%, 50%, 75%, and 100%) (Fig. 6f). Across all data regimes, SEDA-Former consistently outperformed CA-Net. With only 10% of the training data, CA-Net achieved accuracies ranging from 69.0% to 79.5%, whereas SEDA-Former maintained a substantially higher range of 89.54–92.17%. Using the full dataset, SEDA-Former reached 96.27–97.17%, significantly exceeding CA-Net’s 81.99–88.32%. Moreover, SEDA-Former exhibited markedly lower performance variance, indicating more robust and stable learning behavior. These results demonstrate that SEDA-Former remains fully applicable to short-lived nanopore signals and consistently achieves high classification accuracy.
Robust identification under unknown impurity
Nanopore sensing in real-world environments requires robustness against noise and unknown impurities. To simulate the real scenario, we conducted cross‑system interference experiments by mixing 1000 new target events—for example, events from a molecule in the SG‑15 dataset acquired through a new nanopore measurement—with 10,000 background events from the GIN‑24 dataset acting as impurities. However, this setup exposes a critical weakness of closed-set classification: without an explicit impurity class in the training set, the model is compelled to assign all inputs (including impurities) to known target classes. This leads to inevitable false positives and compromised quantitative accuracy. To address this, we implemented a confidence-gating mechanism that implicitly identifies impurities by rejecting predictions with confidence scores below a predefined threshold. While this strategy effectively suppresses false positives caused by unknown interferents, it introduces a trade-off: legitimate target events with low confidence scores are also rejected, leading to a systematic underestimation of molecular abundance due to the varying intrinsic separability of different analytes.
To mitigate this effect, we define a class-specific gate sensitivity, , which is the probability that an authentic event of a given class passes the confidence gate. The parameter is determined from prior information, namely the observed rejection rate of events from that class during training and validation. Using , the predicted counts of target molecules can be corrected to recover the true absolute number of molecules for each class. Building upon this correction, we further derive the gate-calibrated yield (GCY) and introduce it as a quantitative evaluation metric that measures the agreement between the model’s estimated molecule count and the true molecular abundance in the mixture pool. A GCY value approaching 100% indicates that the model achieves high-fidelity quantitative recovery, even in the presence of unknown impurities (See method for details). Through the combined use of confidence-gating, , and GCY, the proposed framework enables simultaneous high-confidence classification and accurate molecular quantification in complex mixtures, without introducing impurity labels, modifying the model architecture, or retraining the network.
Returning to the specific experimental results, under high impurity concentration, the Softmax probability distributions of target versus impurity molecules remained well separated (Fig. 7a–d). High-confidence classes such as RebM and Ro formed sharp peaks in the 0.9–1.0 probability range, while impurity signals were confined to the lower tail, with minimal overlap between the two. We further visualized the model’s performance across varying decision thresholds, revealing a typical trade-off between recall and impurity admission rate (Fig. 7e–h). At lower thresholds, the model retained more signals, increasing recall at the cost of admitting more impurities; conversely, higher thresholds effectively suppressed impurities but lowered recall, shifting the curve toward the lower left. The blue solid markers denote the optimal threshold points determined from the validation set, which balance recall performance and false-positive control. At the selected threshold, the recall rate reached approximately 97.3% for RebM and 84.5% for Ro, with false-positive rates below 70 per 10,000 impurity events.
Fig. 7. Cross-system interference demonstrates the quantitative robustness of SEDA-Former.
a–d Softmax probability distributions of target molecules (RebM, Ste, Ro, Rb2) versus interferents, with the decision threshold indicated. e–h Recall versus false positives per 10,000 impurity molecules under varying decision thresholds. i–l Distribution of GCY versus false positives per 10,000 impurity molecules across 500 Monte Carlo draws, with the mean point indicated. m–p GCY stability as impurity proportion increases from 0× to 30× of the target set.
Across 500 Monte Carlo resamples, GCY values remained stable at approximately 100% for RebM and Ro, 97.3% for Ste, and 91.6% for Rb2, with false-positive rates consistently below 2% (Fig. 7i–l). These results demonstrate that SEDA-Former not only classifies with high confidence but also achieves accurate molecular quantification even in complex mixtures. When the impurity-to-target ratio increased from 0 to 30, GCY curves for all four molecular classes remained nearly flat: RebM and Ro stabilized around 100%, Ste around 98%, and Rb2 around 92%, with fluctuations within ±6% (Fig. 7m–p). This consistency indicates that SEDA-Former effectively captures the intrinsic temporal dependencies of nanopore events and maintains stable quantitative outputs and reliable structural discrimination even as noise and impurity loads escalate.
Overall, the cross-system interference experiments establish a comprehensive robustness evaluation framework, from Softmax separability and recall-precision trade-off to GCY and impurity-load response. Without any retraining or hyperparameter adjustment, SEDA-Former sustained high-confidence identification and accurate concentration recovery in mixed systems containing unseen impurities. The near-invariance of GCY across impurity ratios demonstrates that the model’s learned temporal representations robustly encode the intrinsic dynamics of nanopore signals, conferring structural stability and quantitative consistency even under complex, non-ideal biochemical environments.
Discussion
The architecture of SEDA-Former was designed to combine multi-scale signal enhancement, temporal convolution, and attention-based dependency modeling within a unified framework. In this framework, the multi-window sliding standard deviation first enhances subtle dynamic fluctuations at different temporal scales, while the multi-scale TCN serves as the main extractor of local temporal patterns, capturing short-to-mid-range discriminative features under different receptive fields. Moreover, these features become more discriminative when placed in the global temporal context. Accordingly, the Transformer module is further introduced after the TCN to model global contextual relationships among the extracted local features. The TCN and Transformer play complementary roles: the former emphasizes fine-grained temporal feature extraction, whereas the latter facilitates global integration of these features across the full event. This is also supported by the ablation results, where removing the Transformer consistently reduced classification accuracy across all four datasets (Supplementary Fig. 10).
In SEDA-Former, increasing the number of sliding-standard-deviation channels enlarges the input dimensionality and increases the cost of feature construction, as each additional channel must be computed before model training. However, this increase does not propagate proportionally through the entire network. After entering the TCN, the input is projected to a fixed feature width, and the subsequent convolutional and attention modules keep the same internal dimensionality. Therefore, the main computational consequence of adding enhancement channels lies in preprocessing cost and memory usage, rather than in a large-scale expansion of the whole model. For modeling performance, increasing the number of enhancement channels is beneficial only within an appropriate range. Excessive channel expansion may introduce redundancy and increase the optimization burden. This pattern is supported by a control experiment in Supplementary Fig. 11, where classification performance first improved as the number of enhancement channels increased, with the three-window setting showing strong overall performance, and then showed saturation or slight decline when additional larger-scale channels were further introduced. These results also demonstrate that the three-window setting offers a practical balance between information gain and computational cost, and can serve as a robust default choice.
In this study, we introduced SEDA-Former, a versatile deep learning framework designed for nanopore signal identification. The framework features a three-tiered architecture comprising multi-frequency signal enhancement, deep temporal modeling, and progressive adaptive attention training. By addressing the challenges in nanopore data processing, including loss of temporal fidelity, difficulty in capturing fine-grained dynamic features, and training bias toward easy-to-distinguish samples, SEDA-Former establishes a conceptually distinct paradigm that facilitates single-molecule identification of complex analytes using nanopore sensing signals. Rather than relying on handcrafted features, signal projection, or image conversion, our approach demonstrates that preserving and amplifying intrinsic temporal dependencies is essential for discriminating molecules with subtle structural differences. This finding highlights a broader principle: the nanopore sensing process is fundamentally a time-evolutionary system, whose molecular fingerprints are encoded not only in amplitude patterns but also in transient, dynamic fluctuations that conventional models often overlook. Across four heterogeneous nanopore datasets from pools of structurally similar analytes (15 glycosides and 24 ginsenosides with similar nanopore signals, 8 DNA molecules from solid nanopore sensing, and 17 cholic acid conjugates with exceptionally short nanopore signals), SEDA-Former consistently achieved high classification accuracy, strong fine-grained discriminability, and robust cross-dataset transferability without any architectural modification and without dataset-specific adjustment of the network structure, input configuration, or core hyperparameters. Even under extreme data scarcity and severe interference environments, the models preserved stable identification performance and accurate concentration reconstruction, underscoring the remarkable ability of SEDA-Former to capture essential temporal regularities shared across distinct molecular classes. These results collectively demonstrate that SEDA-Former learns universal temporal representations of nanopore signals, bridging molecular diversity and sensor variability, and providing a foundation for more generalizable nanopore analysis. Several practical considerations should be noted when applying SEDA-Former. For very long nanopore current traces with multiple enhancement channels, the high-dimensional input may lead to substantial memory consumption and computational cost, which can be alleviated by appropriately reducing the number of enhancement channels. For short current events, an overly deep TCN backbone may overly compress temporal features and impair the preservation of fine-grained sequential information; under such conditions, reducing the number of TCN blocks while retaining the overall architecture may be a more suitable choice. Notably, the SEDA-Former framework also provides practical guidance for experimental parameter selection during data generation prior to deployment. Specifically, larger analytes that generate long-duration signals can be measured at relatively low sampling rates, whereas small molecules producing short, fast events require higher sampling rates to preserve fine temporal details. This practical guidance facilitates the effective deployment of SEDA-Former in realistic nanopore analysis applications.
Looking forward, nanopore single-molecule analysis is likely to encounter increasingly complex application scenarios, such as its deployment in proteomics and glycomics profiling. Analyses in these settings will involve large numbers of analytes with both high diversity and substantial structural similarity, making accurate single-molecule identification from nanopore signals both essential and highly challenging. Notably, such precise identification cannot be achieved through manual analysis, thus necessitating sophisticated and accurate AI driven analytical methods. The SEDA-Former framework developed in this study holds considerable promise for addressing these challenges in complex scenarios, thereby facilitating advancements in nanopore single-molecule analysis. An important extension of this work is to move beyond class-level identification toward structural inference from nanopore current signals. Since the signal is fundamentally shaped by the interaction between the analyte and the nanopore during translocation, it may in principle encode richer molecular structural information. However, realizing this potential will require several advances, including larger standardized libraries of reference compounds, high-resolution nanopore measurements with sufficiently large and high-fidelity datasets, effective encoding schemes for target analytes, and modeling frameworks capable of linking fine-grained temporal signal patterns to molecular substructures. Progress along these directions may enable nanopore learning frameworks to evolve from molecular classification toward more detailed structural characterization. This extension is expected to provide robust support for biomolecular structural analysis, including glycan and peptide/protein sequencing1,51,52, and facilitate the broader application of nanopore sensing in deciphering complex biomolecular systems.
Methods
Datasets
Four representative nanopore ionic-current event datasets are used for evaluations: (i) SG-15, consisting of nanopore events from 15 distinct steviol glycosides13; (ii) GIN-24, consisting of nanopore events from 24 distinct ginsenosides14; and (iii) DNA-8, conssisting of nanopore events from 8 DNA molecules49; (iv) CA-17, consisting of nanopore events from 17 cholic acid conjugates21. The DNA-8 dataset was obtained from the University of Cambridge public repository (https://www.repository.cam.ac.uk/items/4e2916cb-614e-42d5-b7e8-d034f56011c6). The other datasets are from our previous works.
Data preprocessing
Each event corresponds to one molecular translocation through the nanopore. The preprocessing pipeline consisted of three main steps. First, abnormal signals such as short noise bursts, incomplete blockade events, and other obvious outliers were removed by filtering events based on translocation duration (Td) and normalized blockade depth (ΔI/Io). Second, for each retained trace, the steady-state open-pore current (Io) measured when no molecule passes through the pore was used as the baseline reference. The ionic-current trace was then baseline-corrected by subtracting Io, such that the open-pore level was shifted to y = 0. To align blockade directions across datasets, the original downward blockade signals were further inverted so that all valid events were represented as upward positive signals. Third, because nanopore events have variable lengths, shorter signals were right-padded with zeros to a unified length before being fed into the model.
It should be noted that zero padding was applied only after baseline correction. Therefore, the padded region corresponds to the physically meaningful background level with no effective translocation event, rather than to an artificial signal segment. This differs from padding with raw baseline values or Gaussian noise. Padding with raw baseline values may preserve sample-specific background differences unrelated to molecular discrimination, whereas Gaussian-noise padding may introduce artificial fluctuations that can be mistaken for informative temporal features. By contrast, zero padding after baseline correction provides a more neutral background and reduces the likelihood that the model will exploit padding artifacts during subsequent feature extraction and classification.
Multi-scale sliding-window standard deviation enhancement
We propose a multi-window sliding standard deviation method to enhance discriminative features in nanopore time-series signals. Given a normalized nanopore signal of length , the local fluctuation magnitude at temporal position under window size is defined as
| 3 |
where denotes the mean value within the corresponding forward sliding window starting at position . In this formulation, the sliding window advances with unit stride, and the -th window spans the signal segment . Thus, each quantifies the local temporal fluctuation intensity within a forward neighborhood of the signal.
By using multiple window sizes, the original trace can be decomposed into a set of fluctuation channels at different temporal scales, where smaller windows emphasize short-lived high-frequency perturbations and larger windows capture broader low-frequency variations. Because the sliding-window operation produces a sequence of length , zero padding is applied at both boundaries of the resulting fluctuation sequence so that each enhanced feature channel has the same temporal length as the input signal. The final model input is constructed by concatenating the raw signal with its multi-scale standard-deviation channels along the channel dimension.
Window sizes of 10, 20, and 40 were empirically selected based on the best validation performance under the sampling conditions of the datasets. Each sliding window corresponds to a local temporal span. When the sampling rate changes, the window size could be adjusted accordingly so that it represents approximately the same physical time scale. In practice, this can be achieved by first converting the window sizes used in this study into their corresponding temporal spans, then rescaling them according to the new sampling rate, and finally performing modest validation-based fine-tuning when necessary.
Architecture of SEDA-Former
The architecture of SEDA-Former integrates the efficiency of temporal convolutional modeling for local patterns with the flexibility of attention mechanisms for long-range dependency learning. Specifically, the architecture combines a dilated TCN with a window-wise multi-head self-attention module, enabling a comprehensive characterization of nanopore ionic-current signals across multiple temporal scales.
The dilated TCN backbone functions as a hierarchical local feature extractor. It consists of five stacked convolutional blocks with exponentially increasing dilation rates, allowing the receptive field to expand systematically without a proportional increase in model complexity. The shallow layers are primarily sensitive to short-lived transients and fine-grained local motifs, whereas deeper layers progressively aggregate broader temporal contexts, capturing the global structure of each event. The incorporation of one-dimensional max-pooling further reduces temporal resolution in a controlled manner, compressing the sequence length while preserving salient discriminative patterns. This design enhances robustness to event-level noise and moderate temporal misalignment (time warping), which are common in nanopore recordings.
SEDA-Former introduces a window-wise self-attention mechanism on top of the TCN features. The TCN output is first partitioned along the temporal axis into a sequence of non-overlapping windows, each representing a condensed summary of a local temporal segment. These window-level representations are then projected into a shared embedding space and processed by a multi-head self-attention module, which enables direct interaction and information exchange across temporally distant segments. In this way, the model learns inter-segment dependencies that are difficult to encode through convolutional operations alone. Finally, the window embeddings are aggregated via mean pooling into a fixed-length global representation, which is passed to a fully connected classification head to produce calibrated class probabilities for high-precision molecular discrimination. Please also refer to Supplementary Note 1 in Supplementary information for further details.
Progressive adaptive attention training (PAAT)
PAAT dynamically reallocates training emphasis toward persistently hard-to-learn classes. During training, the model continuously monitors its learning progress at the class level by computing empirical class-wise training accuracy after each epoch. To ensure stability and reduce sensitivity to short-term fluctuations, PAAT maintains an exponentially smoothed competence estimate for each molecular category.
Based on this smoothed estimate, PAAT assigns class weights as a bounded inverse function of class competence. As a result, classes that remain difficult to learn are automatically upweighted and receive stronger gradient updates in subsequent epochs, whereas well-learned classes contribute less to the optimization objective. Importantly, weight clipping and smoothing prevent excessive amplification and destabilizing oscillations. PAAT is further activated only after an initial warm-up phase with standard cross-entropy training, allowing the model to first learn the dominant discriminative structure before progressively reallocating attention toward harder classes.
We further analyzed the epoch-wise dynamics of a representative hard glycoside (Ste) and a representative easy glycoside (Rub) under PAAT (Supplementary Fig. 12). The results show that the easy class maintains consistently high accuracy, low loss, and stable confidence throughout training, and does not exhibit forgetting or confidence flattening in the later training stage. In contrast, the hard class shows progressive improvement in accuracy, loss, and mean maximum confidence as training proceeds. Meanwhile, the confidence gap between the easy and hard classes gradually narrows, indicating that PAAT mainly strengthens learning on hard samples while preserving stable performance on easy ones.
It should be noted that the hard classes emphasized by PAAT are not simply noisy samples, but mainly classes that remain difficult to separate because of intrinsic overlaps in their temporal patterns. In this sense, PAAT is designed to enhance attention to confusing classes caused by genuine inter-class similarity, rather than to amplify random noise. Robustness to noise is primarily supported by the modeling framework itself, including the multi-window sliding standard deviation enhancement, hierarchical temporal modeling by the TCN-Transformer backbone, and regularized optimization. Within this framework, PAAT functions as a controlled and progressive reweighting mechanism. The exponential smoothing, bounded weighting, AdamW optimization, OneCycleLR scheduling, and dropout regularization also helps improve robustness and training stability. Please also refer to Supplementary Note 2 in the Supplementary Information for further details.
Selective inference and probability calibration for impurity injection
To ensure reliable molecular identification under experimental variability and non-ideal recording conditions with impurity, we introduce a selective inference scheme that explicitly accounts for uncertainty induced by unknown interferents. For each input event, the model outputs a posterior probability distribution over molecular classes, and the maximum posterior probability is used as a confidence score. A prediction is accepted only if this score exceeds a predefined threshold; otherwise, the event is rejected (abstention). This mechanism enables selective prediction, inducing a controllable trade-off between accuracy and coverage by filtering out ambiguous signals that are likely to originate from noise, impurity, or unknown molecular species.
However, rejections in this context introduce a consequence: legitimate target events may also be rejected, particularly for molecular species with intrinsically lower signal separability. As a result, naive counting of accepted predictions leads to a systematic, class-dependent underestimation of molecular abundance. To address this issue, we perform dataset-specific probability calibration with the dual objective of minimizing selective risk while maximizing effective coverage. Within the selectively accepted subset, we further characterize model behavior using class-specific gating statistics, including rejection rates and calibrated accuracies, which provide interpretable measures of how different molecular species respond to confidence gating.
Building on this calibration framework, we introduce Gate-Calibrated Yield (GCY) as a primary metric for robustness and quantitative accuracy under molecular mixing and impurity interference. Unlike conventional recall metrics, which are biased by confidence-based rejection, GCY explicitly corrects for this effect by normalizing selective recall with respect to class-specific gating sensitivity, thereby measuring the effective recovery of genuine molecular events after accounting for gate-induced rejections. We evaluate GCY through extensive Monte Carlo impurity injection experiments, in which authentic signals are mixed with varying proportions of interfering molecules from other classes. Analysis of GCY-impurity profiles yields statistically robust estimates with 95% confidence intervals, providing a principled assessment of the model’s ability to maintain both high-confidence classification and accurate molecular quantification in complex, multi-component molecular systems. Please also refer to Supplementary Note 3 in Supplementary information for further details.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Supplementary information
Source data
Author contributions
H.N. and G.Q. conceived the study and supervised its overall execution. M.L. (Ming Li) and H.N. designed and implemented the deep learning framework, and performed model training. M.L. (Minmin Li), Y.C., and J.W. acquired and curated all nanopore data. M.L. (Minmin Li), H.N., and M.L. (Ming Li) drafted the original manuscript. H.N. and G.Q. edited and reviewed the manuscript. All authors reviewed and approved the final manuscript.
Peer review
Peer review information
Nature Communications thanks Kaikai Chen, and Chenyu Wen for their contribution to the peer review of this work. A peer review file is available.
Funding
G.Q. discloses support for the research of this work from the National Key R&D Program of China (grant numbers 2022YFC3400800 and 2025YFC3409500), the National Natural Science Foundation of China (grant number 22174138), the Strategic Priority Research Program of the Chinese Academy of Sciences (grant number XDB1360000), the DICP Innovation Funding (grant numbers DMU-1&DICP UN202303, DMU-1&DICP UN202307, and DMU-2&DICP UN202504), the Open Project Program of the State Key Laboratory of Medical Proteomics (grant number SKLP-O202509), and the Open Cooperation Foundation of the Department of Chemical Science of Henan University. M.L. (Minmin Li) discloses support for publication of this work from the National Natural Science Foundation of China (grant number 22574152) and the Natural Science Foundation of Liaoning Province (grant number 2025-MS-058).
Data availability
All datasets used for this study have been deposited in the Zenodo database under 10.5281/zenodo.1831807353. The original nanopore current traces of eight DNA nanostructures constituting the DNA-8 dataset are available via the following 10.17863/CAM.6898754. Source data are provided with this paper.
Code availability
The code for SEDA-Former, along with a short guide, is publicly available and has been deposited on GitHub at https://github.com/bushiyanghua/SEDA-Former.git (10.5281/zenodo.20229232)55. The code is released under the MIT License. The code was developed by the authors, and no third-party source code was reused or modified in this repository. These tools are intended for research purposes only.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
These authors contributed equally: Ming Li, Minmin Li.
Contributor Information
Hanwen Ning, Email: ninghanwen@zuel.edu.cn.
Guangyan Qing, Email: qinggy@dicp.ac.cn.
Supplementary information
The online version contains supplementary material available at 10.1038/s41467-026-74507-w.
References
- 1.Ying, Y.-L. et al. Nanopore-based technologies beyond DNA sequencing. Nat. Nanotechnol.17, 1136–1146 (2022). [DOI] [PubMed] [Google Scholar]
- 2.Ratinho, L., Meyer, N., Greive, S., Cressiot, B. & Pelta, J. Nanopore sensing of protein and peptide conformation for point-of-care applications. Nat. Commun.16, 3211 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Chong, G. Nanopore glycan profiling. Nat. Chem. Biol.20, 131 (2024). [DOI] [PubMed]
- 4.Xia, K. et al. Synthetic heparan sulfate standards and machine learning facilitate the development of solid-state nanopore analysis. Proc. Natl. Acad. Sci. USA118, e2022806118 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Im, J., Lindsay, S., Wang, X. & Zhang, P. Single molecule identification and quantification of glycosaminoglycans using solid-state nanopores. ACS Nano13, 6308–6318 (2019). [DOI] [PubMed] [Google Scholar]
- 6.Bayat, P. et al. Comprehensive structural assignment of glycosaminoglycan oligo- and polysaccharides by protein nanopore. Nat. Commun.13, 5113 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Yao, G. et al. Direct identification of complex glycans via a highly sensitive engineered nanopore. J. Am. Chem. Soc.146, 13356–13366 (2024). [DOI] [PubMed] [Google Scholar]
- 8.Li, J. et al. Single-feature identification of α2–8 linked sialoglycans using engineered aerolysin nanopores: A paradigm for glycan linkage analysis. J. Am. Chem. Soc.148, 10649–10662 (2026). [DOI] [PubMed] [Google Scholar]
- 9.Zhang, S. et al. Discrimination of disaccharide isomers of different glycosidic linkages using a modified mspa nanopore. Angew. Chem. Int. Ed.63, e202316766 (2024). [DOI] [PubMed] [Google Scholar]
- 10.Gao, F. et al. Identification of oligosaccharide isomers using electrostatically asymmetric ompf nanopore. Angew. Chem. Int. Ed.64, e202422118 (2025). [DOI] [PubMed] [Google Scholar]
- 11.Lu, W. et al. Precise structural analysis of neutral glycans using aerolysin mutant t240r nanopore. ACS Nano18, 12412–12426 (2024). [DOI] [PubMed] [Google Scholar]
- 12.Li, M. et al. Identification of tagged glycans with a protein nanopore. Nat. Commun.14, 1737 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Li, M. et al. Single-molecule identification and quantification of steviol glycosides with a deep learning-powered nanopore sensor. ACS Nano18, 25155–25169 (2024). [DOI] [PubMed] [Google Scholar]
- 14.Wang, J. et al. Identification of isomerically diverse ginsenosides using engineered aerolysin nanopore via non-translocation blockade sensing. Angew. Chem. Int. Ed.64, e202506741 (2025). [DOI] [PubMed] [Google Scholar]
- 15.Xia, B. et al. Mapping the acetylamino and carboxyl groups on glycans by engineered α-hemolysin nanopores. J. Am. Chem. Soc.145, 18812–18824 (2023). [DOI] [PubMed] [Google Scholar]
- 16.Yao, G., Ke, W., Xia, B. & Gao, Z. Nanopore-based glycan sequencing: State of the art and future prospects. Chem. Sci.15, 6229–6243 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Wang, Y. et al. Structural-profiling of low molecular weight rnas by nanopore trapping/translocation using mycobacterium smegmatis porin a. Nat. Commun.12, 3368 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Forstater, J. H. et al. Mosaic: A modular single-molecule analysis interface for decoding multistate nanopore data. Anal. Chem.88, 11900–11907 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Liu, Y. et al. Machine learning assisted simultaneous structural profiling of differently charged proteins in a mycobacterium smegmatis porin a (mspa) electroosmotic trap. J. Am. Chem. Soc.144, 757–768 (2022). [DOI] [PubMed] [Google Scholar]
- 20.Liu, W. et al. Single-molecule sensing inside stereo- and regio-defined hetero-nanopores. Nat. Nanotechnol.19, 1693–1701 (2024). [DOI] [PubMed] [Google Scholar]
- 21.Cao, Y., Li, M., Wang, J., Li, Z. & Qing, G. Nanopore fingerprinting of structurally diverse amino acid-conjugated bile acids. Nano Lett.25, 17797–17805 (2025). [DOI] [PubMed] [Google Scholar]
- 22.Bandara, Y. M. N. D. Y. et al. A robust parallel computing data extraction framework for nanopore experiments. Small Methods8, 2400045 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Dutt, S. et al. High accuracy protein identification: Fusion of solid-state nanopore sensing and machine learning. Small Methods7, 2300676 (2023). [DOI] [PubMed] [Google Scholar]
- 24.Taniguchi, M. et al. Combining machine learning and nanopore construction creates an artificial intelligence nanopore for coronavirus detection. Nat. Commun.12, 3726 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Wei, J. et al. Diffusive topology preserving manifold distances for single-cell data analysis. Proc. Natl. Acad. Sci. Usa.122, e2404860121 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Yang, S., Chen, S., Wang, P., Chen, A. & Tian, T. Tsplasso: A two-stage prior lasso algorithm for gene selection using omics data. IEEE J. Biomed. Health Inform.28, 526–537 (2024). [DOI] [PubMed] [Google Scholar]
- 27.Dong, H. et al. Comprehensive mapping of rna modification dynamics and crosstalk via deep learning and nanopore direct rna-sequencing. Nat. Commun. 17, 1722 (2026). [DOI] [PMC free article] [PubMed]
- 28.Díaz Carral, Á., Ostertag, M. & Fyta, M. Deep learning for nanopore ionic current blockades. J. Chem. Phys. 154, 044111 (2021). [DOI] [PubMed]
- 29.Whang, S. E., Roh, Y., Song, H. & Lee, J.-G. Data collection and quality challenges in deep learning: A data-centric ai perspective. VLDB J.32, 791–813 (2023). [Google Scholar]
- 30.Li, W. et al. Sigel: A context-aware genomic representation learning framework for spatial genomics analysis. Genome Biol.26, 287 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Shu, J., Yuan, X., Meng, D. & Xu, Z. Cmw-net: Learning a class-aware sample weighting mapping for robust deep learning. IEEE Trans. Pattern Anal. Mach. Intell.45, 11521–11539 (2023). [DOI] [PubMed] [Google Scholar]
- 32.Cui, Y., Jia, M. L., Lin, T. Y., Song, Y. & Belongie, S. Class-balanced loss based on effective number of samples. in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 9260-9269 (2019).
- 33.Lin, Y., Windmeijer, F., Song, X. & Fan, Q. On the instrumental variable estimation with many weak and invalid instruments. J. R. Stat. Soc. Ser. B Stat. Methodol.86, 1068–1088 (2024). [Google Scholar]
- 34.Li, W. et al. Dual advancement of representation learning and clustering for sparse and noisy images. in Proceedings of the 32nd ACM International Conference on Multimedia. 1934–1942 (2024).
- 35.Huang, Y. et al. A machine learning approach to brain epigenetic analysis reveals kinases associated with alzheimer’s disease. Nat. Commun.12, 4472 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Misiunas, K., Ermann, N. & Keyser, U. F. Quipunet: Convolutional neural network for single-molecule nanopore sensing. Nano Lett.18, 4040–4045 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Guan, X. et al. S2snet: Deep learning for low molecular weight rna identification with nanopore. Brief. Bioinf23, bbac098 (2022). [DOI] [PubMed] [Google Scholar]
- 38.Guan, X., Shao, W. & Zhang, D. T-s2inet: Transformer-based sequence-to-image network for accurate nanopore sequence recognition. Bioinformatics40, btae083 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Li, S. et al. Smartimage: A machine learning method for nanopore identifying chemical modifications on rna. Chem. Asian J.18, e202201144 (2023). [DOI] [PubMed] [Google Scholar]
- 40.Foumani, N. M. et al. Deep learning for time series classification and extrinsic regression: A current survey. ACM Comput. Surv.56, 1–45 (2024). [Google Scholar]
- 41.Zhang, Y., Hou, Y., OuYang, K. W. & Zhou, S. L. Multi-scale signed recurrence plot based time series classification using inception architectural networks. Pattern Recogn.123, 108385 (2022). [Google Scholar]
- 42.Bian, Y. X. et al. Multi-patch prediction: Adapting language models for time series representation learning. in Forty-first International Conference on Machine Learning. (2024).
- 43.Wang, H., Ren, L., Li, Y. & Wang, Y. Metaindux-ts: Frequency-aware aigc foundation model for industrial time series. IEEE Trans. Neural Netw. Learn. Syst.36, 18062–18074 (2025). [DOI] [PubMed] [Google Scholar]
- 44.Jin, L. et al. Frequency-aware spatial-temporal attention explainable network for eeg decoding. IEEE J. Biomed. Health Inform.29, 7175–7185 (2025). [DOI] [PubMed] [Google Scholar]
- 45.Xu, K. et al. Detecting anomalous anatomic regions in spatial transcriptomics with stands. Nat. Commun.15, 8223 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Lü, S., Li, Z., Zhang, X. & Li, J. Consistency regularization-based mutual alignment for source-free domain adaptation. Expert Syst. Appl.241, 122577 (2024). [Google Scholar]
- 47.Stanojević, D., Li, Z., Bakić, S., Foo, R. & Šikić, M. Rockfish: A transformer-based model for accurate 5-methylcytosine prediction from nanopore sequencing. Nat. Commun.15, 5580 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Li, M., Xiong, Y. & Qing, G. Innovative chemical tools to address analytical challenges of protein phosphorylation and glycosylation. Acc. Chem. Res.56, 2514–2525 (2023). [DOI] [PubMed] [Google Scholar]
- 49.Bell, N. A. W. & Keyser, U. F. Digitally encoded DNA nanostructures for multiplexed, single-molecule protein sensing with nanopores. Nat. Nanotechnol.11, 645–651 (2016). [DOI] [PubMed] [Google Scholar]
- 50.Perino, A. & Schoonjans, K. Metabolic messengers: Bile acids. Nat. Metab.4, 416–423 (2022). [DOI] [PubMed] [Google Scholar]
- 51.Xia, B. et al. Nanopore-based glycan sequencing via a fragmentation-reassembly strategy. J. Am. Chem. Soc.148, 14005–14015 (2026). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 52.Li, M.-Y. et al. Nanopore approaches for single-molecule temporal omics: Promises and challenges. Nat. Methods22, 241–253 (2025). [DOI] [PubMed] [Google Scholar]
- 53.Li, M. et al. Research data supporting “A universal deep learning framework for empowering nanopore identification by reinforcing temporal signals”. Zenodo10.5281/zenodo.20544846 (2026). [DOI] [PMC free article] [PubMed]
- 54.Bell, N. A. W. & Keyser, U. F. Research data supporting “Digitally encoded DNA nanostructures for multiplexed, single-molecule protein sensing with nanopores”. Apollo-University of Cambridge Repository. 10.17863/CAM.68987 (2016). [DOI] [PubMed]
- 55.Li, M. et al. A universal deep learning framework for empowering nanopore identification by reinforcing temporal signals. Zenodo10.5281/zenodo.20229232 (2026). [DOI] [PMC free article] [PubMed]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
All datasets used for this study have been deposited in the Zenodo database under 10.5281/zenodo.1831807353. The original nanopore current traces of eight DNA nanostructures constituting the DNA-8 dataset are available via the following 10.17863/CAM.6898754. Source data are provided with this paper.
The code for SEDA-Former, along with a short guide, is publicly available and has been deposited on GitHub at https://github.com/bushiyanghua/SEDA-Former.git (10.5281/zenodo.20229232)55. The code is released under the MIT License. The code was developed by the authors, and no third-party source code was reused or modified in this repository. These tools are intended for research purposes only.







