OSCR

The Deep-Match Framework for Event-Related Potential Detection in EEG.

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 5 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § 2. Method ↔ evaluate_matched_filter.py, lines 42–119 · score 0.71 · Detected peaks, matched filter, classical, distance, height, metric
  2. [2] § 2. Method ↔ exportChannelsTemplates.m, the whole file · a weak match · score 0.60 · 0.2–1 s, baseline correction, resampled, epoched, channels, 0.2 s
  3. [3] § 2. Method ↔ trainERPDetector.py, lines 50–101 · score 0.59 · pretrained models, ERP detectors, position, events
  4. [4] § 2. Method ↔ leaveOneOutValidiation.py, lines 111–148 · score 0.57 · Detected peaks, distance, height, metric, tolerance, FN
  5. [5] § 2. Method ↔ trainEncoderDecoder.py, lines 37–60 · score 0.53 · encoder decoder, Adam, loss, optimizer, PyTorch, trained

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 125 lines · 3.6 KB · MIT · 1 match

  1. import h5py
  2. import numpy as np
  3. import torch
  4. import scipy.io as sio
  5. from scipy.signal import find_peaks
  6. from TraditionalMatchedFilter import TraditionalMatchedFilter
  7. def compute_metrics(detected_peaks, target_peaks, tolerance=20):
  8. detected_peaks = sorted(detected_peaks)
  9. target_peaks = sorted(target_peaks)
  10. tp = 0
  11. used_detected = set()
  12. det_idx = 0
  13. for target in target_peaks:
  14. # Move detection index forward if detections are too early
  15. while det_idx < len(detected_peaks) and detected_peaks[det_idx] < target - tolerance:
  16. det_idx += 1
  17. # Try to match first valid detection in window
  18. match_found = False
  19. check_idx = det_idx
  20. while check_idx < len(detected_peaks) and detected_peaks[check_idx] <= target + tolerance:
  21. if check_idx not in used_detected:
  22. tp += 1
  23. used_detected.add(check_idx)
  24. match_found = True
  25. break
  26. check_idx += 1
  27. # If no match found → FN
  28. # (we'll compute FN after loop)
  29. fp = len(detected_peaks) - len(used_detected)
  30. fn = len(target_peaks) - tp
  31. return tp, fp, fn
  32. templateFile = 'channels_templates_HE.mat'
  33. # Load the file
  34. # Open the v7.3 file using h5py
  35. with h5py.File(templateFile, 'r') as f:
  36. # Option A: Load a specific variable by name
  37. # Note: h5py loads arrays transposed compared to scipy/MATLAB
  38. templates = np.array(f['templates']).T
  39. dataFile = 'ERP_Detector_Dataset.mat'
  40. with h5py.File(dataFile, 'r') as f:
  41. cell_refs = f['eeg_segments'][:] # (26,1)
  42. X_list = []
  43. Y_list = []
  44. for i in range(cell_refs.shape[0]):
  45. struct_ref = cell_refs[i, 0] # get reference
  46. struct = f[struct_ref] # dereference
  47. X = f[struct['X'][()]] if isinstance(struct['X'][()], h5py.Reference) else struct['X'][()]
  48. Y = f[struct['Y'][()]] if isinstance(struct['Y'][()], h5py.Reference) else struct['Y'][()]
  49. X = np.transpose(X, (2, 1, 0))
  50. Y = np.transpose(Y, (2, 1, 0))
  51. X_list.append(np.array(X))
  52. Y_list.append(np.array(Y))
  53. tolerance = 30
  54. #set r peak sensitivity parameter
  55. R_peak_threshold = 0.25
  56. min_peak_distance = 30
  57. result = []
  58. N = len(X_list)
  59. classical_MF = TraditionalMatchedFilter(templates=templates)
  60. classical_MF.eval()
  61. for i in range(N):
  62. print(i)
  63. metrics = {
  64. "tp_MF": 0,
  65. "fp_MF": 0,
  66. "fn_MF": 0,
  67. }
  68. Y = Y_list[i]
  69. X = X_list[i]
  70. for idx in range(X.shape[0]):
  71. target = Y[idx,0,:]
  72. target_peaks, peaks_amplitude = find_peaks(target, height=R_peak_threshold, distance=min_peak_distance)
  73. x = X[idx,:,:]
  74. # Convert to tensor if needed
  75. if not isinstance(x, torch.Tensor):
  76. x = torch.tensor(x, dtype=torch.float32)
  77. else:
  78. x = x.float()
  79. # Change shape from (500, 4) → (1, 4, 500)
  80. x = x.unsqueeze(0)
  81. # Disable gradients for inference
  82. with torch.no_grad():
  83. output_MF = classical_MF(x)
  84. output_MF = output_MF.detach().cpu().numpy().squeeze()
  85. detected_peaks_deep_MF, peaks_amplitude = find_peaks(output_MF, height=R_peak_threshold, distance=min_peak_distance)
  86. tp, fp, fn = compute_metrics(detected_peaks_deep_MF, target_peaks, tolerance=tolerance)
  87. metrics["tp_MF"] += tp
  88. metrics["fp_MF"] += fp
  89. metrics["fn_MF"] += fn
  90. result.append(metrics)
  91. # convert to numpy array (important!)
  92. result_array = np.array(result)
  93. # save to matlab file
  94. sio.savemat('matched_filter_results.mat', {'results': result_array})

evaluate_matched_filter.py at commit 7ee1653, under MIT · at the source

Overview

  1. Institute of Metrology and Biomedical Engineering, Faculty of Mechatronics, Warsaw University of Technology, 02-525 Warsaw, Poland
Institutions: Warsaw University of Technology (Poland)
Journal: Sensors (Basel, Switzerland), volume 26, issue 17, article 5444
Dates: received 19 July 2026; accepted 27 August 2026; published online 28 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3390/s26175444 · PMID 42740064 · PMCID PMC13567992 · OpenAlex W7140198178
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), human (organism), methods / tools (subfield)
Methods: Connectivity, Smoothing, state filtering, decompositions, Preprocessing, Evoked potentials, Machine learning, fMRI & imaging
Keywords: event-related potentials, deep-match framework, EEG
MeSH: Electroencephalography*, Evoked Potentials*, Algorithms, Deep Learning, Humans, Neural Networks, Computer, Signal Processing, Computer-Assisted, Signal-To-Noise Ratio (* major topic)
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Narodowe Centrum Nauki (2026/10/X/ST6/00033)
Citations: not cited yet (Europe PMC); 43 references in the paper

Abstract

Reliable detection of event-related potentials (ERPs) at the single-trial level remains a challenge due to low signal-to-noise ratio and high variability in electroencephalography (EEG) recordings. This work investigates the use of the Deep-Match framework (Deep-MF) for ERP detection. We examine whether incorporating prior knowledge of an ERP template into deep learning models improves detection performance. As a proof-of-concept study, the framework was evaluated on a single dataset with multi-channel EEG recordings during laser stimulation. The model was trained in two stages. First, an encoder–decoder architecture was trained to reconstruct input EEG signals in order to learn compact signal representations. In the second stage, the decoder was replaced with a detection module and the network was fine-tuned for ERP identification. Two model variants were evaluated: a standard model with randomly initialized filters and a Deep-MF model in which input kernels were initialized using ERP templates. Models performance was assessed on a single-trial ERP detection task during leave-one-out validation, and then compared with matched filter detector. The neural network models outperformed the matched filter detector and proposed that the Deep-MF model slightly outperformed the detector with standard kernel initialization for the majority of held-out subjects. Although both approaches exhibited substantial inter-subject variability, Deep-MF achieved a higher average F1-score (0.37) compared to the standard network (0.34), indicating improved robustness to cross-subject differences. Performance varied considerably across participants. The best performance obtained by Deep-MF reached an F1-score of 0.71, exceeding the maximum score achieved by the standard model (0.59). These results showed that ERP-informed kernel initialization provides improvements in single-trial ERP detection under subject-independent evaluation. These findings demonstrate that integrating domain knowledge with deep learning architectures can improve single-trial ERP detection. The proposed approach provides a step towards practical wearable EEG and passive brain–computer interface applications, as well as towards real-time monitoring of cognitive processes.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

Marower/DeepMF_ERP_Detection_in_EEG-main

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 7ee165353de5de02252ac2aac5244c2f7c4292e4, 28 July 2026
Languages: MATLAB (7), Python (6), Jupyter (1)
Size: 194 files, 14 scripts
Software Heritage: not archived
Found in: the text, “2. Method”
Holds: README, license file, 1 notebook
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (7 files), EEGLAB (6 files), h5py (5 files), NumPy (5 files), Statistics and Machine Learning Toolbox (2 files), SciPy (2 files), Matplotlib (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
16 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 14 scripts, each with its path and the digest of its content;
  • 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data Availability Statement

For this study we used the ds005284 public dataset from the OpenNeuro repository (https://openneuro.org/datasets/ds005284/ (accessed on 18 July 2026)). Code is available in the GitHub repository: https://github.com/Marower/DeepMF_ERP_Detection_in_EEG-main (accessed on 18 July 2026).

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 3 keywords, 8 MeSH terms, 1 funder, 35 references.

Cite

This paper

Żyliński, M., Śmigielski, B. T., & Cybulski, G. (2026). The Deep-Match Framework for Event-Related Potential Detection in EEG. Sensors (Basel, Switzerland), 26(17), 5444. https://doi.org/10.3390/s26175444

BibTeX

@article{zylinski2026deep,
author = {Żyliński, Marek and Śmigielski, Bartosz Tomasz and Cybulski, Gerard},
title = {{The Deep-Match Framework for Event-Related Potential Detection in EEG}},
journal = {Sensors (Basel, Switzerland)},
year = {2026},
month = aug,
volume = {26},
number = {17},
pages = {5444},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {1424-8220},
doi = {10.3390/s26175444},
url = {https://doi.org/10.3390/s26175444},
pmid = {42740064},
pmcid = {PMC13567992}
}

RIS

TY - JOUR
AU - Żyliński, Marek
AU - Śmigielski, Bartosz Tomasz
AU - Cybulski, Gerard
TI - The Deep-Match Framework for Event-Related Potential Detection in EEG
T2 - Sensors (Basel, Switzerland)
J2 - Sensors (Basel)
PY - 2026
DA - 2026/08/28
VL - 26
IS - 17
SP - 5444
SN - 1424-8220
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/s26175444
UR - https://doi.org/10.3390/s26175444
LA - en
ER -

CSL-JSON

{
"id": "10.3390/s26175444",
"type": "article-journal",
"title": "The Deep-Match Framework for Event-Related Potential Detection in EEG",
"container-title": "Sensors (Basel, Switzerland)",
"author": [
{
"family": "Żyliński",
"given": "Marek"
},
{
"family": "Śmigielski",
"given": "Bartosz Tomasz"
},
{
"family": "Cybulski",
"given": "Gerard"
}
],
"container-title-short": "Sensors (Basel)",
"volume": "26",
"issue": "17",
"page": "5444",
"DOI": "10.3390/s26175444",
"PMID": "42740064",
"PMCID": "PMC13567992",
"ISSN": "1424-8220",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://doi.org/10.3390/s26175444",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
28
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1016/j.neuron.2026.03.034 [code]
Dentate gyrus interneurons modulate winner-take-all network dynamics in freely behaving mice.
Journal: Neuron
In common: EEGLAB, h5py, PyTorch, 4 other tools
[2] doi:10.1371/journal.pone.0352191 [code]
Bayesian Uncertainty-aware Deep Learning with noisy labels: Tackling annotation ambiguity in EEG seizure detection.
Journal: PloS one
In common: EEGLAB, PyTorch, Statistics and Machine Learning Toolbox, 3 other tools, methods / tools, EEG
[3] doi:10.1016/j.ebiom.2026.106375 [code]
Brainwaves under medication: revealing class-specific neural signatures of psychotropic medication from 24,000 EEGs.
Journal: EBioMedicine
In common: EEGLAB, h5py, Statistics and Machine Learning Toolbox, 3 other tools, EEG
[4] doi:10.1038/s41597-026-07244-w [code]
An Open Non-Invasive EEG Dataset for Spontaneous Auditory Attention Switch Decoding.
Journal: Scientific data
In common: EEGLAB, h5py, PyTorch, 2 other tools, methods / tools, EEG
[5] doi:10.1038/s41467-026-73106-z [code]
Respiratory pauses highlight sleep architecture in mice.
Journal: Nature communications
In common: EEGLAB, h5py, Statistics and Machine Learning Toolbox, 3 other tools, EEG
[6] doi:10.1016/j.crmeth.2026.101473 [code]
AmygdalaGo-BOLT for boundary-aware segmentation of the human amygdala.
Journal: Cell reports methods
In common: EEGLAB, PyTorch, Statistics and Machine Learning Toolbox, 3 other tools, methods / tools
[7] doi:10.1002/hbm.70602 [code]
Neuroimaging Correlates of Post-Stroke Pain After Ischemic Stroke: Secondary Analysis of the INSPiRE-TMS Trial.
Journal: Human brain mapping
In common: h5py, Statistics and Machine Learning Toolbox, SciPy, 2 other tools, 1 reference
[8] doi:10.64898/2026.03.12.710517 [code]
Cortical excitability inversely modulates fMRI connectivity via low-frequency neuronal coupling
Journal: bioRxiv (preprint)
In common: EEGLAB, h5py, Statistics and Machine Learning Toolbox, 3 other tools
[9] doi:10.1038/s41597-026-07807-x [code]
A Multimodal fNIRS-EEG Dataset for Unilateral Limb Motor Imagery.
Journal: Scientific data
In common: EEGLAB, Statistics and Machine Learning Toolbox, SciPy, 2 other tools, methods / tools, EEG
[10] doi:10.2196/80286 [code]
At-Home Sleep Electroencephalography Assessment in Young and Older Adults Using a Novel Wireless Soft Electronics Sleep Monitoring System: Experimental Study.
Journal: JMIR formative research
In common: EEGLAB, Statistics and Machine Learning Toolbox, SciPy, 2 other tools, methods / tools, EEG

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.