Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Permutation Entropy Artifact Robust Eeg

ASecurity

Use on raw EEG; ordinal entropy survives blink artifacts.

3 stars
0 votes
0 copies
0 views
Added 9/28/2026
datapythongoexpress

Security Analysis

A100/100

Scanned 9/28/2026

$npx -y skills add hiyenwong/ai_collection --skill permutation-entropy-artifact-robust-eeg --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Permutation Entropy Artifact Robust Eeg?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Permutation Entropy Artifact Robust Eeg
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hiyenwong-permutation-entropy-artifact-robust-eeg/badge)](https://www.skillsdirectory.com/skills/hiyenwong-permutation-entropy-artifact-robust-eeg)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Files
SKILL.md
---
name: permutation-entropy-artifact-robust-eeg
description: Use on raw EEG; ordinal entropy survives blink artifacts.
category: ai_collection
version: "1.0.0"
trigger_words:
  - permutation entropy
  - ordinal patterns
  - spatial permutation entropy
  - EEG artifact robustness
  - eyes open eyes closed
  - raw EEG without preprocessing
source: arXiv:2609.22265
source_title: Exploring the robustness of permutation entropy analysis to differentiate between closed-eyes and open-eyes resting states
authors: Juan Gancio, Natalia López López, Antonio J. Pons, Giulio Tirabassi, Cristina Masoller
published: 2026-09-22
categories: q-bio.NC, physics.data-an
---

# Permutation Entropy Artifact-Robust EEG State Analysis

## Core Finding

Temporal permutation entropy (PE) and horizontal spatial permutation entropy (SPE_H) distinguish eyes-open (EO) vs eyes-closed (EC) resting states **directly on raw EEG without artifact removal** (paired t-test p < 10⁻³ over 109 subjects). Robustness extends to: (a) recordings as short as **0.12 s** (19 samples → 17 ordinal patterns) for temporal PE; (b) a **single spatial snapshot** across 64 channels for SPE_H; (c) reduced electrode montages (31 or 17 channels) because the undersampling bias cancels in paired within-subject tests.

**Mechanism**: ordinal patterns encode *relative* order of data points, not absolute values. Blink artifacts act as monotonic temporal ramps which PE is provably robust to. Spatially, blink gradients run anterior–posterior across frontal channels, so **vertical** OPs (FP1→FPZ→FP2 chain, pattern 1-2-3 over-expressed) are corrupted while **horizontal** (lateral-medial) OPs stay perpendicular to the gradient and unaffected.

## Method

### 1. Temporal PE (per channel)
- Sliding window over each channel's time series; embed length L=3 (patterns from 3 consecutive samples, 160 Hz data).
- Each window [x_i, x_{i+1}, x_{i+2}] → permutation index π; symbol s_i ∈ {L! = 6 possible ordinal patterns}.
- Ties broken by order of occurrence (introduces fixed bias that cancels in EO−EC differences).
- PE_k = −Σ p_j ln p_j over pattern probabilities; average over channels → ⟨PE⟩_j per subject j.

### 2. Spatial PE (per time snapshot)
- At each time step, OPs defined over L=3 spatially adjacent channels in two orientations:
  - **Horizontal (SPE_H)**: lateral–medial chains (perpendicular to blink gradient → artifact-robust).
  - **Vertical (SPE_V)**: anterior–posterior chains (aligned with blink gradient → corrupted by artifacts; only discriminates on cleaned data).
- One snapshot of all 64 channels suffices for significant EO/EC separation with SPE_H.

### 3. Statistical protocol
- Paired t-test (scipy) on within-subject differences ⟨PE⟩_j,EO − ⟨PE⟩_j,EC; significance threshold p < 10⁻³.
- For time-budget analysis: split into 118 non-overlapping 0.5 s segments, plot median p-value vs analyzed interval; raw data reaches significance at 0.12 s.
- Dataset: PhysioNet EEGMMIDB, 109 subjects, 64 channels, 160 Hz, 59 s per condition.

## Key quantitative results
| Quantity | Result |
|---|---|
| PE raw-data EO vs EC | significant, p < 10⁻³, unaffected by ICA artifact removal |
| SPE_H raw data | significant, p < 10⁻³, artifact removal changes almost nothing |
| SPE_V raw data | NOT discriminative (blink gradient over-expresses pattern 1-2-3); discriminative only after cleaning |
| Minimum time for PE (raw) | 0.12 s (17 ordinal patterns) |
| Minimum data for SPE_H | single 64-channel snapshot |
| Electrode reduction 64→31→17 | differences stay significant; negative bias cancels in paired test |
| Raw vs cleaned pre-frontal OP sequence | only 40% identical, but probability distributions nearly equal → PE unchanged |

## Implementation recipe
```python
# 1. Load raw EEG (NO filtering, NO ICA)
# 2. For each channel: build L=3 ordinal patterns over sliding windows
#    (ties → order of occurrence)
# 3. PE_ch = -sum(p*np.log(p)) over 6 pattern probs
# 4. Spatial: at each sample, horizontal triplets (lateral-medial chains incl. FPZ)
#    vs vertical triplets (anterior-posterior)
# 5. Report ⟨PE⟩, ⟨SPE_H⟩, ⟨SPE_V⟩ per subject/condition
# 6. scipy.stats.ttest_rel(ec_vals, eo_vals) → paired test
```

## When to use
- Real-time or low-power EEG state detection where preprocessing is too costly (portable devices, BCI, medical monitors).
- Deciding whether artifact removal is needed before entropy analysis (often: it is not).
- Any EO/EC, vigilance, or resting-state classification pipeline.
- Choosing spatial OP orientation: prefer orientation perpendicular to known artifact gradient.

## Pitfalls
- **SPE_V on raw data is a trap**: vertical/anterior-posterior OPs align with blink gradients and fail without cleaning — use horizontal OPs or alpha-band filtering instead.
- Tie-breaking bias: order-of-occurrence ties bias pattern probabilities slightly; harmless for *differences* but not for absolute entropy comparisons across pipelines.
- Undersampled pattern distributions (17-31 channels) lower absolute SPE values; only the paired difference remains valid.
- Cleaning was applied to EO recordings only — asymmetry could itself aid discrimination; verify with an alternative removal method before claiming artifact-independence.
- L=3 only; larger L (4+) untested here and needs far more data per estimate.

## Extensions
- Weighted PE / amplitude-aware PE for comparison; OP variability; ordinal transitions.
- 2D spatial patterns or Hilbert-curve orderings of channels (underexplored).
- Combine temporal + spatial OPs; increase L.

## References
- Bandt & Pompe, Phys. Rev. Lett. 88, 174102 (2002) — original PE.
- Boaretto et al., Chaos Solitons Fractals 171, 113453 (2023) — spatial PE.
- Gancio et al., Chaos 34, 043130 (2024) — prior EO/EC PE comparison.

Attribution

hiyenwonghiyenwong
View sourceSee grades on GitHubMore from hiyenwong →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Rank Tracker

This skill helps you track, analyze, and report on keyword ranking positions over time. It monitors both traditional SERP rankings and AI/GEO visibility to provide comprehensive search performance insights.

1821 votes

Youtube Competitor Analyzer

Find and analyze YouTube competitor channels using YouTube Data API v3. Discover competitors through keyword search, category matching, content similarity, and related channel discovery. Compare metrics, content strategies, and market positioning. Use when users want to (1) Find competitors for their YouTube channel, (2) Analyze competitor performance metrics, (3) Compare their channel against competitors, (4) Identify content gaps and opportunities, (5) Benchmark against similar creators, (6...

31 votes

Xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the...

1798860 votes

Weather Fetcher

Instructions for fetching current weather temperature data for Karachi, Pakistan from wttr.in API

672240 votes

Weather

Get current weather and forecasts (no API key required).

486960 votes
View all in data →