A lightweight deep convolutional neural network for detecting artifacts in continuous EEG signals.
The 14 matches · 2 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
- [1] § Materials and methods › Data description › Signal standardization ↔ artifact_identification/preprocessing.py, lines 48 to 94 · score 0.90 · bipolar montage, canonical, resampling, filtering, channel, EEG · Report a mismatch
- [2] § Materials and methods › Deep learning method › Model architecture and training ↔ artifact_identification/detectors/eye_movement.py, lines 132 to 190 · score 0.86 · BatchNormalization, MaxPooling1D, Conv1D, Dropout, inferred, kernel · Report a mismatch
- [3] § Materials and methods › Deep learning method › Model architecture and training ↔ artifact_identification/detectors/muscle.py, lines 177 to 238 · score 0.86 · BatchNormalization, MaxPooling1D, Conv1D, Dropout, inferred, kernel · Report a mismatch
- [4] § Materials and methods › Data description › Referencing and normalization ↔ artifact_identification/preprocessing.py, lines 1 to 45 · score 0.79 · DC offsets, RobustScaler, global normalization, deep learning, preprocessing, filtering · Report a mismatch
- [5] § Materials and methods › Performance analysis › Prevalence-adjusted metrics ↔ artifact_identification/detectors/eye_movement.py, lines 232 to 366 · score 0.70 · precision recall curve, target prevalence, PR AUC, metrics · Report a mismatch
- [6] § Materials and methods › Performance analysis › Prevalence-adjusted metrics ↔ artifact_identification/detectors/muscle.py, lines 286 to 423 · score 0.70 · precision recall curve, target prevalence, PR AUC, metrics · Report a mismatch
- [7] § Materials and methods › Performance analysis › Prevalence-adjusted metrics ↔ artifact_identification/detectors/eye_movement.py, lines 232 to 366 · score 0.70 · partial ROC AUC, target prevalence, FPR limit, metrics · Report a mismatch
- [8] § Materials and methods › Performance analysis › Prevalence-adjusted metrics ↔ artifact_identification/detectors/muscle.py, lines 286 to 423 · score 0.70 · partial ROC AUC, target prevalence, FPR limit, metrics · Report a mismatch
- [9] § Materials and methods › Data description › Data preprocessing ↔ artifact_identification/preprocessing.py, lines 1 to 45 · score 0.70 · variable sampling rates, channel configurations, deep learning, artifact detection, 250 Hz, preprocessing · Report a mismatch
- [10] § Materials and methods › Data description › Data preprocessing ↔ artifact_identification/__init__.py, the whole file · a weak match · score 0.69 · focal loss, model training, EEG artifact detection, network, convolution, eye movement · Report a mismatch
- [11] § Materials and methods › Data description › Data preprocessing ↔ artifact_identification/data_preparation.py, lines 1 to 36 · score 0.68 · focal loss parameters, model training, EEG artifact detection, preparation, eye movement, muscle artifact · Report a mismatch
- [12] § CRediT authorship contribution statement ↔ artifact_identification/__init__.py, the whole file · a weak match · score 0.65 · Evans Nyanney, Shyam Visweswaran, Zhaohui Geng, Parthasarathy, Thirumala · Report a mismatch
- [13] § CRediT authorship contribution statement ↔ artifact_identification/data_preparation.py, lines 1 to 36 · score 0.65 · Evans Nyanney, Shyam Visweswaran, Zhaohui Geng, Parthasarathy, Thirumala · Report a mismatch
- [14] § Materials and methods › Data description › Adaptive segmentation and labeling ↔ artifact_identification/preprocessing.py, lines 48 to 94 · score 0.51 · EYEM, MUSC, ELEC, ELPP, SHIV, chewing · 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 · 517 lines · 20 KB · MIT · 4 matches
- #!/usr/bin/env python3
- """
- EEG Preprocessing Pipeline for Deep Lightweight CNN (DLCNN)
- A comprehensive pipeline for preprocessing EEG data for deep learning-based artifact detection.
- Handles variable sampling rates, channel configurations, and implements standardized steps
- for optimal model performance.
- Key Features:
- - Standardizes sampling rates (250, 256, 400, 512, 1000 Hz)
- - Creates bipolar montage and standardizes to 22 canonical channels
- - Applies filtering, referencing, and DC offset removal
- - Extracts non-overlapping 1s time windows with artifact labeling
- - Implements patient-level data splitting to prevent leakage
- - Global normalization using RobustScaler for consistent preprocessing
- Authors: Evans Nyanney, Parthasarathy D Thirumala, Shyam Visweswaran, Zhaohui Geng
- Year: 2025
- License: MIT
- """
- import os
- import glob
- import logging
- from typing import List, Tuple, Dict, Any, Optional
- from collections import defaultdict
- from pathlib import Path
- import numpy as np
- import pandas as pd
- import mne
- from sklearn.preprocessing import RobustScaler
- from joblib import Parallel, delayed
- from sklearn.model_selection import GroupShuffleSplit
- import warnings
- warnings.filterwarnings('ignore')
- logging.basicConfig(
- level=logging.INFO,
- format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
- )
- logger = logging.getLogger(__name__)
- __all__ = ['EEGPreprocessingPipeline']
- class EEGPreprocessingPipeline:
- """
- EEG preprocessing pipeline for artifact detection using DLCNN.
- This class handles end-to-end preprocessing of EEG data:
- - Bipolar montage creation
- - Channel standardization (22 canonical channels)
- - Resampling, filtering, and referencing
- - Windowing and labeling with artifact annotations
- - Patient-level train/val/test splitting
- - Global normalization for deep learning
- Attributes:
- target_sampling_rate: Target sampling rate in Hz.
- target_channels: Target number of channels.
- window_size: Window duration in seconds.
- overlap: Fractional overlap between windows.
- min_artifact_duration: Minimum duration for valid artifacts.
- include_clean_windows: Whether to include clean segments.
- clean_label: Label assigned to clean windows.
- """
- CONFIG = {
- 'canonical_channels': [
- 'FP1-F7', 'F7-T3', 'T3-T5', 'T5-O1',
- 'FP2-F8', 'F8-T4', 'T4-T6', 'T6-O2',
- 'A1-T3', 'T3-C3', 'C3-CZ', 'CZ-C4',
- 'C4-T4', 'T4-A2',
- 'FP1-F3', 'F3-C3', 'C3-P3', 'P3-O1',
- 'FP2-F4', 'F4-C4', 'C4-P4', 'P4-O2'
- ],
- 'bipolar_pairs': [
- ('FP1', 'F7'), ('F7', 'T3'), ('T3', 'T5'), ('T5', 'O1'),
- ('FP2', 'F8'), ('F8', 'T4'), ('T4', 'T6'), ('T6', 'O2'),
- ('A1', 'T3'), ('T3', 'C3'), ('C3', 'CZ'), ('CZ', 'C4'),
- ('C4', 'T4'), ('T4', 'A2'),
- ('FP1', 'F3'), ('F3', 'C3'), ('C3', 'P3'), ('P3', 'O1'),
- ('FP2', 'F4'), ('F4', 'C4'), ('C4', 'P4'), ('P4', 'O2')
- ],
- 'artifact_mapping': {
- 'eyem': 0, 'musc': 1, 'elec': 2, 'chew': 3, 'shiv': 4, 'elpp': 5,
- 'eyem_musc': 0, 'eyem_elec': 0, 'musc_elec': 1,
- 'eyem_chew': 0, 'chew_musc': 3, 'chew_elec': 3,
- 'eyem_shiv': 0, 'shiv_elec': 4,
- 'bckg': -1, 'cpsz': -1, 'fnsz': -1, 'gnsz': -1, 'tcsz': -1,
- }
- }
- def __init__(
- self,
- target_sampling_rate: int = 250,
- target_channels: int = 22,
- window_size: float = 1.0,
- overlap: float = 0.0,
- min_artifact_duration: float = 0.1,
- include_clean_windows: bool = True,
- clean_label: int = 6,
- verbose: bool = True,
- use_logging: bool = True
- ) -> None:
- self.target_sampling_rate = target_sampling_rate
- self.target_channels = target_channels
- self.window_size = window_size
- self.overlap = overlap
- self.min_artifact_duration = min_artifact_duration
- self.include_clean_windows = include_clean_windows
- self.clean_label = clean_label
- self.verbose = verbose
- self.use_logging = use_logging
- self.window_samples = int(window_size * target_sampling_rate)
- self.step_samples = int(self.window_samples * (1 - overlap))
- if use_logging:
- self.logger = logging.getLogger(self.__class__.__name__)
- self.logger.setLevel(logging.INFO if verbose else logging.WARNING)
- else:
- self.logger = None
- seen: set = set()
- self.canonical_channels = [
- ch for ch in self.CONFIG['canonical_channels'] if not (ch in seen or seen.add(ch))
- ]
- self.artifact_mapping = self.CONFIG['artifact_mapping']
- self.scaler: Optional[RobustScaler] = None
- self.missing_channels_count = 0
- self.zero_window_files = 0
- def create_bipolar_montage(self, raw: mne.io.Raw) -> mne.io.Raw:
- """Create bipolar montage from raw EEG channels."""
- clean_ch_names = {}
- for ch in raw.ch_names:
- if ch.startswith('EEG ') and ch.endswith('-REF'):
- clean_ch_names[ch] = ch[4:-4].upper()
- else:
- clean_ch_names[ch] = ch.upper()
- raw.rename_channels(clean_ch_names)
- available = set(raw.ch_names)
- bipolar_channels = []
- for anode, cathode in self.CONFIG['bipolar_pairs']:
- if anode in available and cathode in available:
- bipolar_channels.append((anode, cathode, f'{anode}-{cathode}'))
- if not bipolar_channels:
- if self.logger:
- self.logger.warning("No valid bipolar pairs found; using original channels.")
- return raw
- result = mne.set_bipolar_reference(
- raw,
- anode=[p[0] for p in bipolar_channels],
- cathode=[p[1] for p in bipolar_channels],
- ch_name=[p[2] for p in bipolar_channels],
- verbose=False
- )
- return result[0] if isinstance(result, tuple) else result
- def load_and_validate_file(
- self, edf_path: str, csv_path: str
- ) -> Tuple[Optional[mne.io.Raw], Optional[pd.DataFrame]]:
- """Load and validate EDF and CSV files."""
- if csv_path.endswith('_seiz.csv'):
- if self.logger:
- self.logger.info(f"Skipping seizure file: {csv_path}")
- return None, None
- try:
- raw = mne.io.read_raw_edf(edf_path, preload=True, verbose=False)
- annotations = pd.read_csv(csv_path, comment='#')
- required_cols = {'start_time', 'stop_time', 'label'}
- if not required_cols.issubset(annotations.columns):
- raise ValueError(f"Missing columns in {csv_path}")
- annotations['label'] = annotations['label'].str.lower()
- edf_duration = raw.times[-1]
- if annotations['stop_time'].max() > edf_duration + 1.0:
- if self.logger:
- self.logger.warning(f"Annotations exceed EDF duration in {csv_path}")
- if len(annotations) == 0:
- if self.logger:
- self.logger.warning(f"No annotations in {csv_path}")
- return None, None
- valid_artifacts = annotations[annotations['label'].isin(self.artifact_mapping)]
- if len(valid_artifacts) == 0:
- if self.logger:
- self.logger.warning(f"No valid artifacts in {csv_path}")
- return None, None
- return raw, annotations
- except Exception as e:
- if self.logger:
- self.logger.error(f"Error loading {edf_path}: {e}")
- return None, None
- def resample_eeg(self, raw: mne.io.Raw) -> mne.io.Raw:
- """Resample EEG to target sampling rate."""
- if raw.info['sfreq'] != self.target_sampling_rate:
- if self.logger:
- self.logger.info(
- f"Resampling from {raw.info['sfreq']} Hz to {self.target_sampling_rate} Hz"
- )
- raw.resample(self.target_sampling_rate, verbose=False)
- return raw
- def standardize_channels(self, raw: mne.io.Raw) -> mne.io.Raw:
- """Standardize channels to canonical 22-channel bipolar montage."""
- raw.rename_channels(lambda x: x.replace('EEG ', '').replace('-REF', '').upper())
- has_bipolar = all('-' in ch and not ch.endswith('-REF') for ch in raw.ch_names)
- if not has_bipolar:
- raw = self.create_bipolar_montage(raw)
- current_names = [ch.upper() for ch in raw.ch_names]
- available_channels = []
- for canonical in self.canonical_channels:
- if canonical in current_names:
- idx = current_names.index(canonical)
- available_channels.append(raw.ch_names[idx])
- n_pick = min(len(available_channels), self.target_channels)
- if n_pick > 0:
- selected = available_channels[:n_pick]
- raw.pick_channels(selected, ordered=True, verbose=False)
- data, times = raw[:, :]
- else:
- raw.pick_channels(raw.ch_names[:min(5, len(raw.ch_names))], verbose=False)
- data, times = raw[:, :]
- selected = raw.ch_names[:len(data)]
- if data.shape[0] < self.target_channels:
- n_pad = self.target_channels - data.shape[0]
- padding = np.zeros((n_pad, data.shape[1]))
- combined_data = np.vstack([data, padding])
- new_ch_names = selected + [f'PAD_{i}' for i in range(n_pad)]
- else:
- combined_data = data
- new_ch_names = selected[:self.target_channels]
- assert combined_data.shape[0] == len(new_ch_names) == self.target_channels
- new_info = mne.create_info(new_ch_names, self.target_sampling_rate, ch_types='eeg')
- return mne.io.RawArray(combined_data, new_info, verbose=False)
- def apply_preprocessing(self, raw: mne.io.Raw) -> mne.io.Raw:
- """Apply bandpass (1-40 Hz), notch (50/60 Hz), average reference, and DC removal."""
- if self.logger:
- self.logger.info("Applying bandpass (1-40 Hz) and notch (50/60 Hz) filters...")
- raw.filter(1, 40, verbose=False)
- raw.notch_filter([50, 60], verbose=False)
- if self.logger:
- self.logger.info("Setting average reference and removing DC offset...")
- raw.set_eeg_reference('average', verbose=False)
- data, times = raw[:, :]
- data = data - np.mean(data, axis=1, keepdims=True)
- info = mne.create_info(raw.ch_names, self.target_sampling_rate, ch_types='eeg')
- return mne.io.RawArray(data, info, verbose=False)
- def get_window_label(
- self, annotations: pd.DataFrame, start_time: float, end_time: float
- ) -> Optional[int]:
- """Determine the dominant artifact label in a time window."""
- overlapping = annotations[
- (annotations['start_time'] <= end_time) &
- (annotations['stop_time'] >= start_time)
- ]
- valid_artifacts = []
- for _, row in overlapping.iterrows():
- if row['label'] in self.artifact_mapping:
- duration = row['stop_time'] - row['start_time']
- if duration >= self.min_artifact_duration:
- valid_artifacts.append(row)
- if not valid_artifacts:
- return None
- artifact_counts: Dict[int, int] = defaultdict(int)
- for row in valid_artifacts:
- label = self.artifact_mapping[row['label']]
- if label >= 0:
- artifact_counts[label] += 1
- return max(artifact_counts.items(), key=lambda x: x[1])[0] if artifact_counts else None
- def create_time_windows(
- self, raw: mne.io.Raw, annotations: pd.DataFrame
- ) -> List[Tuple[np.ndarray, int]]:
- """Extract non-overlapping time windows with labels."""
- data, times = raw[:, :]
- data = data.T
- windows = []
- for start_idx in range(0, len(data) - self.window_samples + 1, self.step_samples):
- end_idx = start_idx + self.window_samples
- start_time = times[start_idx]
- end_time = times[end_idx - 1]
- window_data = data[start_idx:end_idx, :]
- label = self.get_window_label(annotations, start_time, end_time)
- if label is not None:
- windows.append((window_data, label))
- elif self.include_clean_windows:
- windows.append((window_data, self.clean_label))
- return windows
- def process_single_file(self, edf_path: str, csv_path: str) -> List[Tuple[np.ndarray, int]]:
- """Process a single EDF+CSV pair."""
- if self.logger:
- self.logger.info(f"Processing {Path(edf_path).name}...")
- raw, annotations = self.load_and_validate_file(edf_path, csv_path)
- if raw is None:
- return []
- raw = self.resample_eeg(raw)
- raw = self.standardize_channels(raw)
- raw = self.apply_preprocessing(raw)
- windows = self.create_time_windows(raw, annotations)
- if len(windows) == 0:
- self.zero_window_files += 1
- if self.logger:
- self.logger.warning(f"No windows extracted from {Path(edf_path).name}")
- if self.logger:
- self.logger.info(f"Extracted {len(windows)} windows")
- return windows
- def process_dataset(
- self,
- edf_dir: str = 'edf/01_tcp_ar',
- max_files: Optional[int] = None,
- n_jobs: int = 1
- ) -> Dict[str, Any]:
- """Process all EDF+CSV file pairs in the directory."""
- if self.logger:
- self.logger.info(f"Processing dataset from {edf_dir}...")
- self.missing_channels_count = 0
- self.zero_window_files = 0
- edf_files = glob.glob(os.path.join(edf_dir, "*.edf"))
- if max_files:
- edf_files = edf_files[:max_files]
- file_pairs = []
- for edf_file in edf_files:
- base = os.path.splitext(edf_file)[0]
- csv_file = base + ".csv"
- if os.path.exists(csv_file) and not csv_file.endswith('_seiz.csv'):
- file_pairs.append((edf_file, csv_file))
- if self.logger:
- self.logger.info(f"Found {len(file_pairs)} valid file pairs")
- if n_jobs > 1:
- if self.logger:
- self.logger.info(f"Processing with {n_jobs} parallel jobs...")
- results = Parallel(n_jobs=n_jobs)(
- delayed(self.process_single_file)(edf, csv) for edf, csv in file_pairs
- )
- else:
- results = []
- for i, (edf, csv) in enumerate(file_pairs):
- if (i + 1) % 20 == 0 and self.logger:
- self.logger.info(f"Processed {i + 1}/{len(file_pairs)} files...")
- results.append(self.process_single_file(edf, csv))
- all_windows: List[Tuple[np.ndarray, int]] = []
- all_sources: List[str] = []
- class_counts: Dict[int, int] = defaultdict(int)
- file_stats = []
- for i, windows in enumerate(results):
- for _, label in windows:
- class_counts[label] += 1
- file_stats.append({
- 'file': Path(file_pairs[i][0]).name,
- 'windows': len(windows),
- 'classes': list(set(w[1] for w in windows))
- })
- all_windows.extend(windows)
- src_id = Path(file_pairs[i][0]).stem
- all_sources.extend([src_id] * len(windows))
- if self.logger:
- self.logger.info(f"Processing Summary:")
- self.logger.info(f" Files with missing canonical channels: {self.missing_channels_count}")
- self.logger.info(f" Files with zero windows: {self.zero_window_files}")
- return {
- 'windows': all_windows,
- 'window_sources': all_sources,
- 'class_counts': dict(class_counts),
- 'file_stats': file_stats,
- 'total_files': len(edf_files),
- 'processed_files': len(file_stats),
- 'total_windows': len(all_windows),
- 'missing_channels_count': self.missing_channels_count,
- 'zero_window_files': self.zero_window_files
- }
- def prepare_training_data(self, results: Dict[str, Any]) -> Dict[str, Any]:
- """Prepare data for DLCNN training with patient-level splitting."""
- if self.logger:
- self.logger.info("Preparing training data for DLCNN...")
- data_list = [w[0] for w in results['windows']]
- labels = [w[1] for w in results['windows']]
- X = np.array(data_list, dtype=np.float32)
- y = np.array(labels, dtype=np.int32)
- if self.logger:
- self.logger.info(f"Data shape: {X.shape}")
- self.logger.info("Applying RobustScaler normalization...")
- flat = X.reshape(-1, X.shape[2])
- self.scaler = RobustScaler().fit(flat)
- X_norm = self.scaler.transform(flat).reshape(X.shape)
- groups = np.array(results['window_sources'])
- indices = np.arange(len(y))
- gss1 = GroupShuffleSplit(n_splits=1, test_size=0.2, random_state=42)
- train_val_idx, test_idx = next(gss1.split(indices, y, groups=groups))
- gss2 = GroupShuffleSplit(n_splits=1, test_size=0.25, random_state=42)
- tv_idx = indices[train_val_idx]
- tv_groups = groups[train_val_idx]
- tv_y = y[train_val_idx]
- train_rel, val_rel = next(gss2.split(tv_idx, tv_y, groups=tv_groups))
- train_idx = tv_idx[train_rel]
- val_idx = tv_idx[val_rel]
- return {
- 'X_train_3d': X_norm[train_idx],
- 'X_val_3d': X_norm[val_idx],
- 'X_test_3d': X_norm[test_idx],
- 'y_train': y[train_idx],
- 'y_val': y[val_idx],
- 'y_test': y[test_idx],
- 'idx_train': train_idx,
- 'idx_val': val_idx,
- 'idx_test': test_idx,
- 'X_all_3d': X_norm,
- 'y_all': y,
- 'original_shape': X.shape,
- 'n_classes': len(np.unique(y))
- }
- def save_data(
- self, data_dict: Dict[str, Any], results: Dict[str, Any], output_path: str = '.'
- ) -> None:
- """Save preprocessed data and metadata."""
- if self.logger:
- self.logger.info(f"Saving data to {output_path}...")
- os.makedirs(output_path, exist_ok=True)
- for key in ['X_train_3d', 'X_val_3d', 'X_test_3d', 'X_all_3d']:
- if key in data_dict:
- np.save(os.path.join(output_path, f"{key}.npy"), data_dict[key])
- if self.logger:
- self.logger.info(f"Saved {key}.npy")
- for key in ['y_train', 'y_val', 'y_test', 'y_all']:
- if key in data_dict:
- df = pd.DataFrame({key: data_dict[key]})
- df.to_csv(os.path.join(output_path, f"{key}.csv"), index=False)
- if self.logger:
- self.logger.info(f"Saved {key}.csv")
- pd.DataFrame(results['file_stats']).to_csv(
- os.path.join(output_path, 'file_statistics.csv'), index=False
- )
- pd.DataFrame(
- list(results['class_counts'].items()), columns=['class', 'count']
- ).to_csv(os.path.join(output_path, 'class_distribution.csv'), index=False)
- summary = {
- k: results[k] for k in [
- 'total_files', 'processed_files', 'total_windows',
- 'missing_channels_count', 'zero_window_files'
- ]
- }
- pd.DataFrame([summary]).to_csv(
- os.path.join(output_path, 'processing_summary.csv'), index=False
- )
- from joblib import dump
- dump(self.scaler, os.path.join(output_path, 'robust_scaler.joblib'))
- np.savez_compressed(
- os.path.join(output_path, 'split_indices.npz'),
- idx_train=data_dict['idx_train'],
- idx_val=data_dict['idx_val'],
- idx_test=data_dict['idx_test']
- )
- if self.logger:
- self.logger.info("Preprocessing completed and data saved.")
preprocessing.py at commit 5d0e234, under MIT · at the source
Overview
- Ohio University, Department of Industrial and Systems Engineering, 1 Ohio University Drive, 276 Stocker Center, Athens, 45701, OH, USA
- University of Pittsburgh, Department of Neurological Surgery, 3550 Terrace Street, Pittsburgh, 15261, PA, USA
- University of Pittsburgh, Department of Biomedical Informatics, 5607 Baum Boulevard, Pittsburgh, 15232, PA, USA
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repositories
Its files are read in the Code ↔ Paper reader above, with 14 matches between paragraphs and lines of code.
evansnyanney/EEG-Artifact-Detection-DLCNN
5d0e234c4fa22be602101f270353e1ca57b962aa, 14 June 2026Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
32 files
- artifact_identification/
__init__.py , Python, 48 lines, 2 matches - artifact_identification/
_version.py , Python, 3 lines - artifact_identification/
data_preparation.py , Python, 201 lines, 2 matches - artifact_identification/
detectors/ , Python, 26 lines__init__.py - artifact_identification/
detectors/ , Python, 455 lines, 3 matcheseye_movement.py - artifact_identification/
detectors/ , Python, 587 lines, 3 matchesmuscle.py - artifact_identification/
detectors/ , Python, 560 linesnon_physiological.py - artifact_identification/
detectors/ , Python, 218 linesrule_based.py - artifact_identification/
evaluation/ , Python, 6 lines__init__.py - artifact_identification/
evaluation/ , Python, 264 linescnn_vs_rules.py - artifact_identification/
evaluation/ , Python, 131 linesrule_based_eval.py - artifact_identification/
exploration.py , Python, 171 lines - artifact_identification/
losses.py , Python, 44 lines - artifact_identification/
preprocessing.py , Python, 517 lines, 4 matches - artifact_identification/
utils/ , Python, 6 lines__init__.py - artifact_identification/
utils/ , Python, 48 linescheck_channels.py - artifact_identification/
utils/ , Python, 54 linescheck_edf.py - scripts/
__init__.py , Python, 1 line - scripts/
evaluate_cnn_vs_rules.py , Python, 28 lines - scripts/
evaluate_rule_based.py , Python, 25 lines - scripts/
explore_data.py , Python, 26 lines - scripts/
prepare_data.py , Python, 30 lines - scripts/
preprocess.py , Python, 44 lines - scripts/
train_eye.py , Python, 47 lines - scripts/
train_muscle.py , Python, 47 lines - scripts/
train_nonphys.py , Python, 47 lines - scripts/
window_optimization.py , Python, 174 lines - tests/
__init__.py , Python, 1 line - tests/
test_losses.py , Python, 58 lines - tests/
test_rule_based.py , Python, 94 lines - LICENSE, License, 8 lines
- README.md, Text, 233 lines
Zenodo 19554507
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
- 30 September 2026: the link answers (HTTP 200)
32 files
- artifact_identification/
__init__.py , Python, 48 lines - artifact_identification/
_version.py , Python, 3 lines - artifact_identification/
data_preparation.py , Python, 201 lines - artifact_identification/
detectors/ , Python, 26 lines__init__.py - artifact_identification/
detectors/ , Python, 455 lineseye_movement.py - artifact_identification/
detectors/ , Python, 587 linesmuscle.py - artifact_identification/
detectors/ , Python, 560 linesnon_physiological.py - artifact_identification/
detectors/ , Python, 218 linesrule_based.py - artifact_identification/
evaluation/ , Python, 6 lines__init__.py - artifact_identification/
evaluation/ , Python, 264 linescnn_vs_rules.py - artifact_identification/
evaluation/ , Python, 131 linesrule_based_eval.py - artifact_identification/
exploration.py , Python, 171 lines - artifact_identification/
losses.py , Python, 44 lines - artifact_identification/
preprocessing.py , Python, 517 lines - artifact_identification/
utils/ , Python, 6 lines__init__.py - artifact_identification/
utils/ , Python, 48 linescheck_channels.py - artifact_identification/
utils/ , Python, 54 linescheck_edf.py - scripts/
__init__.py , Python, 1 line - scripts/
evaluate_cnn_vs_rules.py , Python, 28 lines - scripts/
evaluate_rule_based.py , Python, 25 lines - scripts/
explore_data.py , Python, 26 lines - scripts/
prepare_data.py , Python, 30 lines - scripts/
preprocess.py , Python, 44 lines - scripts/
train_eye.py , Python, 26 lines - scripts/
train_muscle.py , Python, 26 lines - scripts/
train_nonphys.py , Python, 26 lines - scripts/
window_optimization.py , Python, 174 lines - tests/
__init__.py , Python, 1 line - tests/
test_losses.py , Python, 58 lines - tests/
test_rule_based.py , Python, 94 lines - LICENSE, License, 8 lines
- README.md, Text, 200 lines
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:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 60 scripts, each with its path and the digest of its content;
- 14 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
- doi:10.13026/
9njx-6322 , at the source; found in the references
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: evansnyanney/
EEG-Artifact-Detection-D LCNN
Read it in the paper: doi.org/10.1016/j.cnp.2026.03.005.
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, 30 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 4 authors, 6 keywords, 21 references.
Cite
This paper
Nyanney, E., Thirumala, P. D., Visweswaran, S., & Geng, Z. (2026). A lightweight deep convolutional neural network for detecting artifacts in continuous EEG signals. Clinical neurophysiology practice, 11, 208-215. https://
BibTeX
@article{nyanney2026ligh
author = {Nyanney, Evans and Thirumala, Parthasarathy D and Visweswaran, Shyam and Geng, Zhaohui},
title = {{A lightweight deep convolutional neural network for detecting artifacts in continuous EEG signals}},
journal = {Clinical neurophysiology practice},
year = {2026},
month = mar,
volume = {11},
pages = {208--215},
publisher = {Elsevier},
issn = {2467-981X},
doi = {10.1016/
url = {https://
pmid = {41953081},
pmcid = {PMC13054435}
}
RIS
TY - JOUR
AU - Nyanney, Evans
AU - Thirumala, Parthasarathy D
AU - Visweswaran, Shyam
AU - Geng, Zhaohui
TI - A lightweight deep convolutional neural network for detecting artifacts in continuous EEG signals
T2 - Clinical neurophysiology practice
J2 - Clin Neurophysiol Pract
PY - 2026
DA - 2026/
VL - 11
SP - 208
EP - 215
SN - 2467-981X
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "A lightweight deep convolutional neural network for detecting artifacts in continuous EEG signals",
"container-title": "Clinical neurophysiology practice",
"author": [
{
"family": "Nyanney",
"given": "Evans"
},
{
"family": "Thirumala",
"given": "Parthasarathy D"
},
{
"family": "Visweswaran",
"given": "Shyam"
},
{
"family": "Geng",
"given": "Zhaohui"
}
],
"container-title-short":
"volume": "11",
"page": "208-215",
"DOI": "10.1016/
"PMID": "41953081",
"PMCID": "PMC13054435",
"ISSN": "2467-981X",
"publisher": "Elsevier",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
24
]
]
}
}
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.1186/s40708-024-00239-6 [code]
- Advancing EEG prediction with deep learning and uncertainty estimation.Journal: Brain informaticsIn common: MNE-Python, Keras, TensorFlow, 6 other tools, EEG, 2 references
- [2] doi:10.1038/s41598-025-18479-9 [code]
- Epileptic seizure detection from electroencephalogram signals based on 1D CNN-LSTM deep learning model using discrete wavelet transform.Journal: Scientific reportsIn common: MNE-Python, Keras, TensorFlow, 5 other tools, EEG, 2 references
- [3] doi:10.1002/hbm.26417 [code]
- Sex-related patterns in the electroencephalogram and their relevance in machine learning classifiers.Journal: Human brain mappingIn common: MNE-Python, Keras, TensorFlow, 6 other tools, EEG, 1 reference
- [4] doi:10.1097/js9.0000000000003143 [code]
- Multimodal deep learning to predict postoperative major adverse cardiac and cerebrovascular events after noncardiac surgery.Journal: International journal of surgery (London, England)In common: Keras, TensorFlow, seaborn, 5 other tools, clinical / translational, 2 references
- [5] doi:10.1038/s42003-025-08464-3 [code]
- How EEG preprocessing shapes decoding performance.Journal: Communications biologyIn common: MNE-Python, seaborn, scikit-learn, 4 other tools, EEG, 3 references
- [6] doi:10.1523/eneuro.0160-22.2022 [code]
- Improved Manual Annotation of EEG Signals through Convolutional Neural Network Guidance.Journal: eNeuroIn common: MNE-Python, scikit-learn, pandas, 3 other tools, EEG, 3 references
- [7] doi:10.1038/s41597-022-01524-x [code]
- EPIC: Annotated epileptic EEG independent components for artifact reduction.Journal: Scientific dataIn common: Keras, TensorFlow, NumPy, EEG, 4 references
- [8] doi:10.1038/s41597-026-07120-7 [code]
- PhysioMotion Artifact: A task-driven EEG dataset with point-wise motion artifact annotations.Journal: Scientific dataIn common: MNE-Python, scikit-learn, pandas, 2 other tools, EEG, 3 references
- [9] doi:10.3390/s25010231 [code]
- DHCT-GAN: Improving EEG Signal Quality with a Dual-Branch Hybrid CNN-Transformer Network.Journal: Sensors (Basel, Switzerland)In common: Keras, TensorFlow, scikit-learn, 3 other tools, EEG, 2 references
- [10] doi:10.1371/journal.pcbi.1010863 [code]
- maxATAC: Genome-scale transcription-factor binding prediction from ATAC-seq with deep neural networks.Journal: PLoS computational biologyIn common: Keras, TensorFlow, seaborn, 5 other tools, 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 60 scripts, and 14 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:0d19a9c58259a367…
Add the badge to the code's README
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 -->
[](https://openscicode.org/badge/doi/10.1016/j.cnp.2026.03.005)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1016/j.cnp.2026.03.005.svg
:target: https://openscicode.org/badge/doi/10.1016/j.cnp.2026.03.005
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.cnp.2026.03.005"><img src="https://openscicode.org/badge/doi/10.1016/j.cnp.2026.03.005.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.
