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.

5 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 5 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § 2. Method ↔ evaluate_matched_filter.py, lines 42 to 119 · score 0.71 · Detected peaks, matched filter, classical, distance, height, metric · block oscr:b:PMANJZWZP9XYN-3 · Report a mismatch
  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 · block oscr:b:57YV3G2NWB3H5-Q · Report a mismatch
  3. [3] § 2. Method ↔ trainERPDetector.py, lines 50 to 101 · score 0.59 · pretrained models, ERP detectors, position, events · block oscr:b:THZH56Q8R5CT3-Q · Report a mismatch
  4. [4] § 2. Method ↔ leaveOneOutValidiation.py, lines 111 to 148 · score 0.57 · Detected peaks, distance, height, metric, tolerance, FN · block oscr:b:9RDF3TPNZ89AN-L · Report a mismatch
  5. [5] § 2. Method ↔ trainEncoderDecoder.py, lines 37 to 60 · score 0.53 · encoder decoder, Adam, loss, optimizer, PyTorch, trained · block oscr:b:2SKGAXTQM3ZDY-1 · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: 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 (how the code is found and 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.1038/s41597-021-01094-4 [code]
Mobile BCI dataset of scalp- and ear-EEGs with ERP and SSVEP paradigms while standing, walking, and running.
Journal: Scientific data
In common: EEGLAB, h5py, PyTorch, 4 other tools, methods / tools, EEG, 1 reference
[2] doi:10.3390/brainsci14090860 [code]
Classification of Known and Unknown Study Items in a Memory Task Using Single-Trial Event-Related Potentials and Convolutional Neural Networks.
Journal: Brain sciences
In common: EEGLAB, h5py, Matplotlib, 1 other tool, EEG, 1 reference
[3] doi:10.1038/s41597-025-05900-1 [code]
A comprehensive EEG dataset of laser-evoked potentials for pain research.
Journal: Scientific data
In common: EEGLAB, methods / tools, EEG, 2 references
[4] doi:10.1016/j.nicl.2025.103760 [code]
Event-related potential markers of subjective cognitive decline and mild cognitive impairment during a sustained visuo-attentive task.
Journal: NeuroImage. Clinical
In common: EEGLAB, SciPy, Matplotlib, 1 other tool, EEG, 1 reference
[5] doi:10.1016/j.nicl.2021.102914 [code]
The impact of premature extrauterine exposure on infants' stimulus-evoked brain activity across multiple sensory systems.
Journal: NeuroImage. Clinical
In common: EEGLAB, Statistics and Machine Learning Toolbox, SciPy, 1 other tool, EEG, 1 reference
[6] 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
[7] doi:10.1038/s41598-025-25576-2
A direct comparison of simultaneously recorded scalp, around-ear and in-ear EEG for neural selective auditory attention decoding to speech.
Journal: Scientific reports
In common: EEG, 3 references
[8] doi:10.3390/life13020391 [code]
On the Influence of Aging on Classification Performance in the Visual EEG Oddball Paradigm Using Statistical and Temporal Features.
Journal: Life (Basel, Switzerland)
In common: EEGLAB, SciPy, Matplotlib, 1 other tool, EEG, 1 reference
[9] doi:10.3389/fneur.2024.1358167 [code]
EEG biomarkers analysis in different cognitive impairment after stroke: an exploration study.
Journal: Frontiers in neurology
In common: h5py, SciPy, Matplotlib, 1 other tool, EEG, 1 reference
[10] doi:10.1016/j.xcrm.2022.100846 [code]
Selective and replicable neuroimaging-based indicators of pain discriminability.
Journal: Cell reports. Medicine
In common: h5py, SciPy, Matplotlib, 1 other tool, EEG, 1 reference

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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.3390/s26175444.svg)](https://openscicode.org/badge/doi/10.3390/s26175444)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.3390/s26175444.svg
   :target: https://openscicode.org/badge/doi/10.3390/s26175444
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3390/s26175444"><img src="https://openscicode.org/badge/doi/10.3390/s26175444.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

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