5D Library › 指—脑皮层放大、远端微针传入与卒中后认知网络重建的计算神经学 · English

第五章 建议的分析:微状态、相位滞后指数与传递熵

注

本章的性质。 卢顺康论文的脑电部分只做了功率谱分析,没有做微状态、相位连接或信息流分析。作者框架提出用这些方法描述「认知网络重建」。本章因此写成一份建议的分析方案:说明每种方法测量什么、在头皮脑电中有哪些已知的陷阱,并用合成数据演示这些陷阱。书中所有连接数值都来自程序生成的信号,不来自任何患者。

容积传导与参考电极

头皮上的每一个电极记录的,都是许多皮层源在颅骨与头皮中经体积导体传播后叠加的电位。这种传播几乎是瞬时的:同一个源会以零时滞同时出现在相邻的多个电极上 (Nunez and Srinivasan 2006)。两个相邻电极即使没有任何独立的神经源之间的相互作用,它们的信号也会高度相关。参考电极的选择进一步改变这种相关:平均参考把所有电极的共同成分减掉,链接乳突参考把乳突附近的活动加进每一个电极。Bastos 与 Schoffelen 2016 年的综述把这些问题称为功能连接分析中的「解释陷阱」,并建议优先使用对零时滞混合不敏感的指标、在源空间而非电极空间分析,并用合适的替代数据检验 (Bastos and Schoffelen 2016)。

相位一致性与相位滞后指数

最常用的相位连接指标是相干与锁相值(PLV),它们衡量两个信号的相位差是否稳定。问题在于,零时滞的混合本身就会产生稳定的相位差(零),所以容积传导会使相干与 PLV 升高。Nolte 等人 2004 年提出只用互谱的虚部,因为纯粹的零时滞混合不产生虚部 (Nolte et al. 2004);Stam、Nolte 与 Daffertshofer 2007 年提出相位滞后指数(PLI):相位差落在零的一侧还是另一侧,取其符号的平均的绝对值,零时滞或 180° 时滞的贡献都是零 (Stam et al. 2007);Vinck 等人 2011 年的加权 PLI(wPLI)用虚部的大小加权,减少了噪声与小样本带来的偏差 (Vinck et al. 2011)。

下面的程序生成两个 10 赫兹的源,分四种情形:两源独立、不混合;两源独立、以 0.6 的比例零时滞混合;源 2 受源 1 驱动、时滞 12 毫秒、不混合;同样的驱动加上混合。

推导

# Chapter 5. Volume conduction and phase connectivity on synthetic data. Two 10-Hz
# AR(2) sources (fs 250 Hz); sensors x1 = s1 + m s2 + noise, x2 = m s1 + s2 + noise
# (m = zero-lag mixing). Phases by complex demodulation (100-ms moving average).
# Coherence, PLV, imaginary coherence, PLI (Stam et al. 2007), wPLI (Vinck et al. 2011).
# Cases: A independent, m = 0; B independent, m = 0.6; C s2 driven by s1 with a 12-ms
# lag, m = 0; D the same drive, m = 0.6.
import math, random, cmath

FS, F0, N, L = 250.0, 10.0, 30000, 25

def ar2(rng, n, drive=None, lag=3, k=0.5):
    a1, a2 = 2 * 0.97 * math.cos(2 * math.pi * F0 / FS), -0.97 ** 2
    x = [0.0, 0.0]
    for t in range(2, n + 2):
        v = a1 * x[-1] + a2 * x[-2] + rng.gauss(0, 1)
        if drive is not None and t - 2 - lag >= 0:
            v += k * drive[t - 2 - lag]
        x.append(v)
    return x[2:]

def demod(x):
    z = [x[t] * cmath.exp(-2j * math.pi * F0 * t / FS) for t in range(len(x))]
    c, out = [0j], []
    for v in z:
        c.append(c[-1] + v)
    return [(c[t + L] - c[t]) / L for t in range(len(z) - L)]

def measures(x1, x2):
    z1, z2 = demod(x1), demod(x2)
    cr = [a * b.conjugate() for a, b in zip(z1, z2)]
    n = len(cr)
    p1 = math.fsum(abs(a) ** 2 for a in z1) / n
    p2 = math.fsum(abs(b) ** 2 for b in z2) / n
    mre = math.fsum(c.real for c in cr) / n; mim = math.fsum(c.imag for c in cr) / n
    coh = abs(complex(mre, mim)) / math.sqrt(p1 * p2)
    icoh = abs(mim) / math.sqrt(p1 * p2)
    u = [c / abs(c) for c in cr if abs(c) > 0]
    plv = abs(complex(math.fsum(c.real for c in u),
                      math.fsum(c.imag for c in u))) / len(u)
    pli = abs(math.fsum(math.copysign(1.0, c.imag) for c in cr if c.imag != 0)) / n
    wpli = abs(mim) / (math.fsum(abs(c.imag) for c in cr) / n)
    return coh, plv, icoh, pli, wpli

if __name__ == "__main__":
    rng = random.Random(2007)
    print("case                          coherence   PLV   imag.coh    PLI   wPLI")
    for lab, coupled, m in (("A independent, m = 0", False, 0.0),
                            ("B independent, m = 0.6", False, 0.6),
                            ("C 12-ms lagged drive, m = 0", True, 0.0),
                            ("D 12-ms lagged drive, m = 0.6", True, 0.6)):
        s1 = ar2(rng, N)
        s2 = ar2(rng, N, drive=s1 if coupled else None)
        sd = math.sqrt(math.fsum(v * v for v in s1) / N)
        x1 = [a + m * b + rng.gauss(0, 0.3 * sd) for a, b in zip(s1, s2)]
        x2 = [m * a + b + rng.gauss(0, 0.3 * sd) for a, b in zip(s1, s2)]
        r = measures(x1, x2)
        print(f"{lab:30s}" + "".join(f"{v:9.3f}" for v in r))
    print(f"12 ms at 10 Hz is a phase lag of {360 * F0 * 0.012:.0f} degrees")
# case                          coherence   PLV   imag.coh    PLI   wPLI
# A independent, m = 0              0.035    0.014    0.034    0.019    0.069
# B independent, m = 0.6            0.868    0.788    0.019    0.031    0.077
# C 12-ms lagged drive, m = 0       0.746    0.644    0.718    0.730    0.949
# D 12-ms lagged drive, m = 0.6     1.000    0.998    0.029    0.713    0.947
# 12 ms at 10 Hz is a phase lag of 43 degrees

情形 B 是关键:两个源完全独立,只因为零时滞混合,相干就达到 0.868,PLV 达到 0.788;而虚部相干(0.019)、PLI(0.031)与 wPLI(0.077)都和独立、不混合的情形 A 相当。情形 C 中真实存在 12 毫秒(约 43°)的耦合时滞(经 AR(2) 共振后,两电极间实测相位差更大),所有指标都升高,wPLI 达到 0.949。情形 D 说明另一面:混合会把虚部相干压低到 0.029,因为混合大大增加了实部与总功率,而 PLI 与 wPLI 仍然保持在 0.71 与 0.95。所以,在头皮脑电中,「相干升高」不能读作「网络连接增强」;PLI 与 wPLI 对零时滞混合稳健,但它们也会漏掉真正零时滞的相互作用。

传递熵

传递熵衡量的是:在已经知道 YY 自己过去的条件下,XX 的过去还能为预测 YY 的下一个值增加多少信息 (Schreiber 2000)。它是模型无关的,因而被用作「有效连接」的指标 (Vicente et al. 2011)。它的陷阱同样来自观测:未观测到的共同驱动、零时滞混合,以及对过去的描述(嵌入)过于粗糙。

推导

# Chapter 5. Transfer entropy (Schreiber 2000) on synthetic series coded into 3 equal
# bins, one step of history; 30 surrogates shift X circularly. Cases (N = 15,000):
# 1 X drives Y with a one-step delay; 2 independent; 3 a hidden Z drives X after 1 step
# and Y after 2 (no X-Y link); 4 independent X, Y seen through zero-lag mixing.
import math, random

N, NSUR = 15000, 30

def code(v):
    s = sorted(v); a, b = s[len(v) // 3], s[2 * len(v) // 3]
    return [0 if u < a else (1 if u < b else 2) for u in v]

def te(x, y):
    c3, c2a, c2b, c1 = {}, {}, {}, {}
    for t in range(len(y) - 1):
        k3 = (y[t + 1], y[t], x[t]); c3[k3] = c3.get(k3, 0) + 1
        ka = (y[t], x[t]); c2a[ka] = c2a.get(ka, 0) + 1
        kb = (y[t + 1], y[t]); c2b[kb] = c2b.get(kb, 0) + 1
        c1[y[t]] = c1.get(y[t], 0) + 1
    n = len(y) - 1
    return math.fsum(
        c / n * math.log2(c * c1[k[1]] / (c2a[(k[1], k[2])] * c2b[(k[0], k[1])]))
        for k, c in c3.items())

def series(rng, case):
    x, y, z = [0.0], [0.0], [0.0, 0.0]
    for t in range(1, N + 50):
        z.append(0.5 * z[-1] + rng.gauss(0, 1))
        if case == 1:
            x.append(0.6 * x[-1] + rng.gauss(0, 1))
            y.append(0.5 * y[-1] + 0.4 * x[-2] + rng.gauss(0, 1))
        elif case == 3:
            x.append(0.5 * x[-1] + 0.8 * z[-2] + rng.gauss(0, 1))
            y.append(0.5 * y[-1] + 0.8 * z[-3] + rng.gauss(0, 1))
        else:
            x.append(0.6 * x[-1] + rng.gauss(0, 1))
            y.append(0.6 * y[-1] + rng.gauss(0, 1))
    x, y = x[50:], y[50:]
    if case == 4:
        x, y = [a + 0.5 * b for a, b in zip(x, y)], [b + 0.5 * a for a, b in zip(x, y)]
    return code(x), code(y)

def test(rng, x, y):
    obs = te(x, y); sur = []
    for _ in range(NSUR):
        k = rng.randrange(200, len(x) - 200)
        sur.append(te(x[k:] + x[:k], y))
    return obs, max(sur)

if __name__ == "__main__":
    rng = random.Random(2000)
    print("case (bits)                       TE X->Y (max surr.)   TE Y->X (max surr.)")
    for case, lab in ((1, "1 X drives Y"), (2, "2 independent"),
                      (3, "3 hidden common driver"), (4, "4 zero-lag mixing")):
        x, y = series(rng, case)
        a, sa = test(rng, x, y); b, sb = test(rng, y, x)
        fa = "*" if a > sa else " "; fb = "*" if b > sb else " "
        print(f"{lab:32s} {a:.4f}{fa} ({sa:.4f})      {b:.4f}{fb} ({sb:.4f})")
    print("* = above every surrogate (p < 1/31)")
# case (bits)                       TE X->Y (max surr.)   TE Y->X (max surr.)
# 1 X drives Y                     0.0933* (0.0013)      0.0022* (0.0016)
# 2 independent                    0.0003  (0.0013)      0.0004  (0.0010)
# 3 hidden common driver           0.0886* (0.0013)      0.0031* (0.0009)
# 4 zero-lag mixing                0.0064* (0.0011)      0.0068* (0.0012)
# * = above every surrogate (p < 1/31)

情形 1 中 XX 驱动 YY,传递熵 0.0933 比特,远高于替代数据的最大值;但反方向 Y→XY \to X 也有 0.0022 比特,略高于替代数据(0.0016)。这是嵌入过于粗糙的结果:每个序列只用三档、只看一步过去,XX 自己的过去没有被完全刻画,于是 YY 中携带的 XX 的旧信息被误读为「反向信息流」。情形 3 中 XX 与 YY 之间没有任何联系,只是一个未被观测的 ZZ 先驱动 XX、后驱动 YY,传递熵 X→YX \to Y 却达到 0.0886 比特,与真实驱动几乎一样大。情形 4 中两个独立序列只经过零时滞混合,两个方向的传递熵都「显著」。

这三点对卒中脑电都有直接意义。丘脑与脑干的弥散性调节系统是典型的共同驱动;头皮电极之间的混合不可避免;而 5 分钟的静息记录要估计高维的条件分布,嵌入维数与分档方式的选择会改变结论。传递熵只适合在源空间、经过替代数据检验、并把嵌入参数事先写定的前提下作为探索性分析。

微状态

脑电微状态分析把多导脑电的头皮电位分布看作一系列短暂稳定的「地形图」,每个持续几十到一百多毫秒,通常在全局场功率的峰值处取样,用改进的 k 均值聚类归为 4 到 7 类(常称 A–D 类),再计算每类的平均持续时间、出现频率、覆盖率与类间转移概率 (Michel and Koenig 2018)。它的优点是利用了全部电极的空间信息、不依赖参考电极的选择(地形图的形状与参考无关);它的局限包括:类别数需要人为选择;聚类通常忽略地形图的极性;不同研究的类别标签未必对应同样的神经源;闭眼与睁眼、困倦程度都会显著改变微状态参数。论文引用过一项比较不同认知障碍患者静息微状态的研究(论文参考文献 57),但没有在自己的数据上做这项分析。

建议的分析方案

如果第八章的试验采集脑电,以下方案应在登记方案时一并公开,并由不知道分组的分析人员执行:

项目 规定
记录时间 基线与第 4 周,各在当天固定时段;不在刺激当下或刺激后几分钟内记录,以免把即时唤醒变化当作治疗效应
状态 闭眼与睁眼各 5 分钟,顺序固定;二者分开分析,不作跨状态比较
预处理 事先写定的滤波、坏导插值、独立成分分析剔除标准与平均参考;处理脚本与版本号公开
主要脑电指标 闭眼前额区(事先指定电极)8–13 赫兹相对功率与个体 α 峰频率,作为第八章的预先指定中介变量
连接指标 α 频段 wPLI,限于事先指定的几对脑区,在源空间计算;报告相干时同时报告虚部相干
探索性分析 微状态(类别数固定为 4)与传递熵(源空间、替代数据检验);结果明确标为探索性
不做的事 不从 64 个电极、多个频段、多种指标中挑选「显著」的结果;不把单个受试者的频谱当作组结果

本章小结

论文没有做连接分析,本章因此只给出建议的方案。合成数据显示,零时滞混合本身就能把两个独立源的相干推到 0.87,而 PLI 与 wPLI 不受影响;真实的 12 毫秒时滞驱动则使 wPLI 达到 0.95。传递熵会被未观测的共同驱动、零时滞混合与过于粗糙的嵌入误导:一个隐藏的驱动源产生的「信息流」与真实驱动几乎一样大。微状态利用全部电极的空间信息,但类别数与状态(睁眼/闭眼、困倦)都会改变结论。任何连接指标都应事先写定,在源空间计算,并配合替代数据检验;它们不能单独证明「认知网络重建」。

参考文献

Bastos, André M., and Jan-Mathijs Schoffelen. 2016. “A Tutorial Review of Functional Connectivity Analysis Methods and Their Interpretational Pitfalls.” Frontiers in Systems Neuroscience 9: 175. https://doi.org/10.3389/fnsys.2015.00175.
Michel, Christoph M., and Thomas Koenig. 2018. “EEG Microstates as a Tool for Studying the Temporal Dynamics of Whole-Brain Neuronal Networks: A Review.” NeuroImage 180: 577–93. https://doi.org/10.1016/j.neuroimage.2017.11.062.
Nolte, Guido, Ou Bai, Lewis Wheaton, Zoltan Mari, Sherry Vorbach, and Mark Hallett. 2004. “Identifying True Brain Interaction from EEG Data Using the Imaginary Part of Coherency.” Clinical Neurophysiology 115 (10): 2292–307. https://doi.org/10.1016/j.clinph.2004.04.029.
Nunez, Paul L., and Ramesh Srinivasan. 2006. Electric Fields of the Brain: The Neurophysics of EEG. 2nd ed. Oxford University Press.
Schreiber, Thomas. 2000. “Measuring Information Transfer.” Physical Review Letters 85 (2): 461–64. https://doi.org/10.1103/PhysRevLett.85.461.
Stam, Cornelis J., Guido Nolte, and Andreas Daffertshofer. 2007. “Phase Lag Index: Assessment of Functional Connectivity from Multi Channel EEG and MEG with Diminished Bias from Common Sources.” Human Brain Mapping 28 (11): 1178–93. https://doi.org/10.1002/hbm.20346.
Vicente, Raul, Michael Wibral, Michael Lindner, and Gordon Pipa. 2011. “Transfer Entropy—a Model-Free Measure of Effective Connectivity for the Neurosciences.” Journal of Computational Neuroscience 30 (1): 45–67. https://doi.org/10.1007/s10827-010-0262-3.
Vinck, Martin, Robert Oostenveld, Marijn van Wingerden, Francesco Battaglia, and Cyriel M. A. Pennartz. 2011. “An Improved Index of Phase-Synchronization for Electrophysiological Data in the Presence of Volume-Conduction, Noise and Sample-Size Bias.” NeuroImage 55 (4): 1548–65. https://doi.org/10.1016/j.neuroimage.2011.01.055.

Fan, Y. (2026). Finger–Brain Cortical Magnification, Distal Microneedle Afference and Computational Neurology of Post-Stroke Cognitive Network Reconstruction: From Complex-Network Pinning Control and Thalamocortical 10 Hz Alpha Restoration to Drift-Diffusion Models, Read Beside the Twelve Jing-Well Points of the Lingshu [指—脑皮层放大、远端微针传入与卒中后认知网络重建的计算神经学] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23839915 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).