The ICA BookICA 学习书 Yuda Bi

A gentle starting point先懂直觉,再读推导

Start here: a beginner guide to ICA从这里开始:ICA 新手指南

One small calculation, one visual experiment, and a route into the full textbook.

从一次小计算、一个可视化实验,走进完整教材。

What are we trying to recover?我们究竟想找回什么?

Imagine two microphones, each hearing a different blend of two voices. The recordings are visible; the original voices and their mixing weights are hidden. ICA tries to separate sources by exploiting a statistical assumption: the sources vary independently. It does not recognize voices by understanding speech.

想象两只麦克风,各自录到两个人声音的不同比例混合。录音是已知的,原始声音和混合比例却未知。ICA 利用一个统计假设——各个来源独立变化——尝试把它们分开;它不是先听懂语音,再辨认说话人。

For a first pass, keep three questions in view: What is observed? What assumption makes separation possible? How would we check the result? Real-room echoes and other departures from the simple model are separate issues, introduced in the chapters.

第一遍只抓住三个问题:看到了什么?凭什么能分开?怎样检查分离结果?真实房间的回声等不满足简单模型的情况,会在后续章节单独说明。

A small example you can calculate by hand先手算一个小例子

1. Mix. Suppose the source values at one instant are s1=2s_1=2 and s2=1s_2=1. One sensor adds them; another subtracts them.

1.混合。设某一时刻的两个源值为 s1=2s_1=2、s2=1s_2=1。第一个传感器把它们相加,第二个传感器把它们相减。

x1=s1+s2=3,x2=s1−s2=1.x_1=s_1+s_2=3,\qquad x_2=s_1-s_2=1.

2. Undo a known mix. Add the recordings and divide by two to recover the first source. Subtract them and divide by two to recover the second.

2.撤销已知混合。把两路录音相加再除以 2,得到第一个源;相减再除以 2,得到第二个源。

s1=x1+x22=2,s2=x1−x22=1.s_1=\frac{x_1+x_2}{2}=2,\qquad s_2=\frac{x_1-x_2}{2}=1.

3. See the blind part. These two arithmetic steps work because we were told the mixing rule. In ICA, that rule is unknown. We observe many pairs of measurements and use assumptions about the sources to estimate a separating rule. One pair of numbers cannot establish independence or solve a general blind separation problem.

3.看清“盲”在哪里。上面能直接算回来,是因为题目告诉了混合规则。ICA 中这个规则未知;我们要观察许多组测量值,再利用源的假设估计分离规则。仅有一对数字,不能检验独立性,也不能解决一般的盲分离问题。

Your turn. Under the same known mixing rule, the recordings are x1=1x_1=1 and x2=5x_2=5. What are the two source values?

换你试试。沿用同一个已知混合规则,若 x1=1x_1=1、x2=5x_2=5,两个源分别是多少?

Check the answer查看答案

s1=(1+5)/2=3s_1=(1+5)/2=3, s2=(1−5)/2=−2s_2=(1-5)/2=-2. Substitution gives 3+(−2)=13+(-2)=1 and 3−(−2)=53-(-2)=5. The negative sign is a valid signal value.

s1=(1+5)/2=3s_1=(1+5)/2=3,s2=(1−5)/2=−2s_2=(1-5)/2=-2。代回可得 3+(−2)=13+(-2)=1、3−(−2)=53-(-2)=5。信号出现负数完全正常。

A route through the book三遍阅读,不必一次攻完

Treat the appendix as a reference shelf. Open it when a symbol blocks the next step; you do not need to finish it before Chapter 1. Each chapter now starts with an unnumbered first-pass guide, a worked mini-example and two short checks.

把附录当工具架:某个符号挡住下一步时再去查,不必先读完附录才能进入第 1 章。每章开头都有不参与原有编号的导读、微型例子与两道短自测。

Pass 1 — understand the task. Read 1: the mixing model and ambiguities, 2: independence versus correlation, and 3: what whitening does. Stop when you can explain why whitening is useful but is not separation.

第一遍:知道问题是什么。读第 1 章的混合模型与不确定性、第 2 章的独立与不相关、第 3 章的白化。能说清“白化有用,但白化不等于分离”,就可以继续。

Pass 2 — run and interpret an algorithm. Continue with 5: a non-Gaussianity measure, 8: FastICA, and 11: noise, dimension and reliability. Run the examples and explain what a stopping message does and does not prove.

第二遍:会运行,也会解释。接着读第 5 章的非高斯性度量、第 8 章的 FastICA、第 11 章的噪声、维数与可靠性。运行示例,并解释“迭代停止”证明了什么、没有证明什么。

Pass 3 — choose a question. For why the model is identifiable, read 4. For algorithm derivations, read 6, 7, and 9. For uncertainty, read 10. For new model classes, read 12 and 13. For brain imaging, go from 11 to 14 and 15.

第三遍:按问题深入。想知道为什么模型可辨识,读第 4 章;想推导算法,读第 6 章、第 7 章与第 9 章;关心不确定性,读第 10 章;关心新模型,读第 12 章与第 13 章;做脑影像,从第 11 章进入第 14 章和第 15 章。

A useful reading loop: read the question → predict the answer → follow one calculation → try the check → read the formal claim. A first-pass route postpones proofs; it does not remove the assumptions needed to use a result.

建议每次这样读:先看问题 → 猜答案 → 跟算一步 → 做自测 → 再读正式结论。入门路线可以暂缓证明,但不能跳过使用结论所需的假设。

Read the symbols as a data flow把符号读成数据流

Lowercase bold letters are vectors: one observation across channels. Uppercase bold letters are matrices: many observations collected into a table, or a linear rule that transforms them. An index tells you which source, sensor or sample is being discussed.

粗体小写字母通常是向量:同一次观测在各通道上的值。粗体大写字母通常是矩阵:许多次观测拼成的数据表,或变换数据的线性规则。下标告诉你正在说哪个源、传感器或样本。

Core notation — keep this beside Chapter 1核心符号:读第 1 章时可随时回查
Symbol符号Read it as怎么读
m,n,Tm,n,Tnumber of sensors, sources, observations传感器数、源数、观测次数
X∈Rm×T\bX\in\R^{m\times T}observed data: m rows, T columns观测数据:m 行、T 列
S∈Rn×T\bS\in\R^{n\times T}unknown sources: one source per row未知源:每行一个源
A∈Rm×n\bA\in\R^{m\times n}mixing weights: source values → sensor values混合权重:源值 → 传感器值
W∈Rn×m\bW\in\R^{n\times m}estimated separating rule; y = Wx估计的分离规则;y = Wx
Z\bZcentered, whitened data used by many algorithms许多算法使用的中心化、白化后数据
Cx\bC_{\bx}covariance matrix: variances on its diagonal协方差矩阵:对角线是各变量方差
A⊤\bA^\toptranspose: exchange rows and columns, not inversion转置:交换行和列,不是求逆
I\bIidentity matrix: leaves a vector unchanged单位矩阵:乘上它后向量不变
E[f(s)]\E[f(s)]population average of f(s), when it existsf(s) 的总体平均,前提是该期望存在
1T∑t=1Tf(s(t))\frac1T\sum_{t=1}^T f(s(t))average computed from T observations用 T 次观测计算出来的样本平均
θ^\hat\thetaan estimate of an unknown quantity theta未知量 theta 的估计值

Dimension check. With 3 sensors, 2 sources and 100 observations, X is 3×100, A is 3×2 and S is 2×100. In AS, the inner dimensions (2) agree; the result is 3×100. A separating matrix W has shape 2×3, so WX has two output rows.

先检查尺寸。若有 3 个传感器、2 个源、100 次观测,则 X 为 3×100,A 为 3×2,S 为 2×100。计算 AS 时,中间两个维度都是 2,结果为 3×100。分离矩阵 W 为 2×3,因此 WX 有两行输出。

In the first chapters, columns are observations. In spatial fMRI ICA, columns can be voxels and rows can be time points: the word “sample” follows the model, not automatically the clock. Chapter 14 states that convention explicitly.

前几章把每列当一次观测。在 fMRI 空间 ICA 中,列可以是体素、行可以是时间点:“样本”跟随模型的定义,并不总指一个时间点。第 14 章会明确该约定。

Try it: zero correlation is not independence动手实验:不相关,仍可能没有分离

Each source independently takes −1 or +1 with equal probability. The four source pairs therefore each have probability 1/4. We rotate the pair by a fixed 30° to form the observed mixture. Move the proposed undo angle and watch the outputs. Point labels A–D follow the same source pair across all three plots.

两个源各自独立、等概率取 −1 或 +1,因此四种源组合的概率都为 1/4。我们把源向量固定旋转 30°,得到观测混合。调整你提出的“撤销角度”,观察输出;A–D 标记在三幅图中始终对应同一个源组合。

0°

Hidden sources (shown for teaching)隐藏源(教学时显示)

s₁s₂ A B C D

Observed mix: rotate 30°观测混合:旋转 30°

x₁x₂ A B C D

Output after your undo step按你的角度撤销后的输出

y₁y₂ A B C D
Output covariance输出之间的协方差
0.000
Excess kurtosis, each output每路输出的超额峭度
−1.250

Still a mixture. Covariance alone does not reveal that.仍然是混合;仅看协方差看不出来。

What to notice. Covariance stays zero at every angle. At 30°, the output matches the sources; at −60° or 120°, it matches after a swap and sign changes, which ICA allows. At 75°, one output is nonzero only when the other is zero: that is dependence even though their covariance is zero.

重点观察。所有角度的协方差都保持零。撤销 30° 时输出就是源;撤销 −60° 或 120° 时,输出只是交换了顺序并翻转符号,ICA 同样认可。在 75° 时,一路输出非零,另一路就一定为零:这显然有依赖,尽管协方差为零。

The fourth-order statistic changes even when covariance does not. This is a preview of Chapter 5, not a rule that every non-Gaussian source has nonzero kurtosis. The plots enumerate an exact four-point probability model; they do not claim that four observations suffice for general ICA. The true mixing angle and sources are revealed here only for teaching. JavaScript enables the slider; the static plots and explanation still work without it.

协方差不变时,四阶统计量仍会变化。这是在预览第 5 章,不是在说所有非高斯源的峭度都非零。这里穷举的是一个精确的四点概率模型,不表示只要四次观测就能完成一般 ICA。真实混合角度与源只为教学而展示。启用 JavaScript 后可拖动滑块;未启用时仍可阅读静态图和解释。

A small glossary, with somewhere to go next术语速查:知道意思,再决定是否深挖

Source / component源/成分
A hidden variable or process we want to separate. An estimated component is an output of a method, not automatically a true physical source. Read more →
希望分离的隐藏变量或过程。“估计成分”只是方法的输出,并不自动等于真实物理来源。 进一步阅读 →
Mixing / unmixing混合/解混
Mixing maps sources to measurements; unmixing maps measurements to estimated sources. “Blind” means the source values and mixing weights are not given. Read more →
混合把源变成测量值;解混把测量值变成源估计。“盲”指源值与混合权重事先未知。 进一步阅读 →
Independence独立
Knowing one variable does not change the probability distribution of the other. It concerns all statistical relationships, not only a straight-line trend. For several sources, the requirement is mutual independence, not merely independence of each pair. Read more →
知道一个变量的值,不会改变另一个变量的概率分布。它约束全部统计关系,而不只是一条直线趋势。源多于两个时,要求相互独立,不能只检查两两独立。 进一步阅读 →
Covariance / correlation协方差/相关系数
Covariance measures average co-movement around the means. Correlation divides it by the two standard deviations; it needs nonzero variances. Zero correlation is weaker than independence. Read more →
协方差衡量两个变量偏离各自均值时的共同变化。相关系数再除以双方标准差,需要方差非零。不相关比独立弱。 进一步阅读 →
Centering / whitening中心化/白化
Centering subtracts the mean. Whitening additionally changes scale and orientation so the chosen covariance convention becomes the identity; it does not finish ICA. Read more →
中心化减去均值;白化再改变尺度与方向,使选定约定下的协方差成为单位阵。白化不等于完成 ICA。 进一步阅读 →
Gaussian / non-Gaussian高斯/非高斯
Gaussian names a probability distribution, often drawn as a bell. Non-Gaussian means a different distribution; it does not mean “noise-free” or “useful signal.” Read more →
高斯是一类常画成钟形的概率分布;非高斯表示不是该分布,不代表“没有噪声”或“有用信号”。 进一步阅读 →
Excess kurtosis / cumulant超额峭度/累积量
For a zero-mean unit-variance variable, excess kurtosis is its fourth moment minus three. Cumulants organize higher-order dependence; zero kurtosis alone does not prove Gaussianity. Read more →
对零均值、单位方差变量,超额峭度是四阶矩减 3。累积量用来组织高阶依赖;峭度为零本身不能证明高斯性。 进一步阅读 →
Contrast / objective对比函数/目标函数
A score an algorithm optimizes to seek separation. A larger or smaller objective is meaningful only for that specified criterion and its assumptions. Read more →
算法为寻找分离而优化的评分。分数变大或变小,必须结合具体目标与假设解释。 进一步阅读 →
Likelihood / score function似然/得分函数
Likelihood rates observed data under a candidate density model. A score involves derivatives of log density; check the chapter’s sign convention. Read more →
似然评价某个候选密度模型对已观测数据的解释。得分函数涉及对数密度的导数;正负号请以该章约定为准。 进一步阅读 →
Identifiability可辨识性
Whether different model parameters can produce the same population distribution. It is a statement about the model, not a promise that an algorithm converges. Read more →
不同模型参数能否产生同一个总体分布。这是模型层面的性质,不是算法必然收敛的承诺。 进一步阅读 →
Scale / sign / permutation ambiguity尺度/符号/置换不确定性
Changing a source’s scale and compensating in its mixing weights leaves the data unchanged. Source order can also change. These are allowed ambiguities, not automatic failure. Read more →
改变源的尺度,再反向补偿混合权重,观测不变;源的排列也可以改变。这些允许的不确定性不应直接判为失败。 进一步阅读 →
Rank / model order秩/模型阶数
Rank counts independent linear directions. Model order is the chosen number of components. Numerical rank and scientifically appropriate model order need not coincide. Read more →
秩计算线性上独立的方向数。模型阶数是选取的成分数。数值秩不一定等于科学问题中合适的模型阶数。 进一步阅读 →
Convergence / stability收敛/稳定性
A stopping rule checks changes within a run. Stability compares repeated analyses. Neither alone proves that a recovered component is a true source. Read more →
停止准则检查单次运行的变化;稳定性比较重复分析。二者单独都不能证明恢复了真实源。 进一步阅读 →
Standard deviation / standard error标准差/标准误
Standard deviation describes variation of values. Standard error describes variation of an estimator across repeated data collection. Correlated observations require special care. Read more →
标准差描述数值本身的波动;标准误描述重复采集数据时估计量的波动。观测相关时尤其不能直接套独立样本公式。 进一步阅读 →
Spatial ICA / time course空间 ICA/时间过程
Spatial ICA seeks independent spatial maps while their time courses serve as mixing weights. Spatial overlap is not itself statistical dependence. Read more →
空间 ICA 寻找独立的空间图,而它们的时间过程充当混合权重。空间重叠本身不等于统计依赖。 进一步阅读 →

Three checks before the formulas正式公式前的三个小检查

Mean. The observations are 1 and 3. What is their mean, and what remains after centering?

均值。观测为 1 和 3。均值是多少?减去均值后剩下什么?

Check the answer查看答案

The mean is 2; centered observations are −1 and +1. Their mean is zero. Using the book’s /T convention, their variance is 1.

均值是 2;中心化后为 −1 和 +1,其均值为零。按本书的 /T 约定,方差为 1。

Dimensions. X has 4 rows and 200 columns. W has 3 rows and 4 columns. What is the shape of WX?

尺寸。X 有 4 行、200 列,W 有 3 行、4 列。WX 的尺寸是什么?

Check the answer查看答案

3×200. Each of 200 observation columns becomes a three-component output. This only checks the multiplication; it does not establish source recovery.

3×200。200 列观测各自被变成三成分输出。这只检查了矩阵乘法是否合法,不表示已经成功恢复源。

Independence. Two fair coins are tossed independently. What is the probability that both show heads? How does the answer change if the second always copies the first?

独立。两枚公平硬币独立抛掷,同时正面的概率是多少?如果第二枚总是复制第一枚的结果呢?

Check the answer查看答案

For independent coins it is (1/2)×(1/2)=1/4. For a perfect copy it is 1/2. Both individual coins are still fair, so checking marginal distributions alone misses the dependence.

独立时为 (1/2)×(1/2)=1/4;完全复制时为 1/2。两枚硬币各自仍然公平,因此只看各自的边缘分布会漏掉依赖关系。

Run your first example, then read its output运行第一个例子,并看懂输出

The browser experiment requires no installation. For the Python examples, use Python 3.12 and install the tested numerical dependencies. Download the Chapter 1 script and requirements.txt into the same new folder. Open a terminal in that folder. The commands below create an isolated environment; they do not require changing the system Python packages.

浏览器实验无需安装。运行 Python 示例则需要 Python 3.12 和已验证的数值依赖。把第 1 章脚本与requirements.txt下载到同一个新文件夹,并在该文件夹打开终端。下面的命令创建独立环境,无须修改系统 Python 包。

Windows PowerShell (Python launcher installed)Windows PowerShell(已安装 Python 启动器)

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe ica-problem.py

macOS / Linux (python3 is Python 3.12)macOS / Linux(python3 指向 Python 3.12)

python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python ica-problem.py

Run the complete downloaded file, not only its final lines: later blocks can use variables defined earlier in the same chapter. A chapter’s printed-output block is something to compare against, not code to paste into Python.

运行完整下载文件,不要只复制最后几行:同章后面的代码可能使用前面定义的变量。正文中的“示例输出”用于对照,不是要粘贴运行的 Python 代码。

The first example prints a normalized gain matrix. A result near [[0.03, 1.00], [−1.00, 0.02]] means that the first output mostly matches the second source and the second output mostly matches the negative first source. The order and sign changes are allowed; the small unwanted entries measure residual mixing. The true sources and mixing matrix are known here because the data are synthetic. On real data you cannot normally compute this truth-based check.

第一个例子会打印归一化增益矩阵。若结果接近 [[0.03, 1.00], [−1.00, 0.02]],表示第一路输出主要对应第二个源,第二路输出主要对应第一个源的负值。顺序交换和符号翻转是允许的,小的非目标项反映残余混合。这里之所以能对照真实源与混合矩阵,是因为数据由我们合成;真实数据通常不能直接计算这种依赖真值的检查。

Change one thing at a time: sample count, mixing weights or random seed. First predict what might change, then compare the output. Keep the original script so that an error is easy to reproduce.

一次只改一个量:样本数、混合权重或随机种子。先预测结果可能怎样变,再运行比较,并保留原脚本以便复现问题。

When you get stuck卡住时,从这里排查

A symbol stops me符号看不懂
Check the notation table, read its dimensions and say what the operation does in words before deriving anything.
先查符号表,读出尺寸,再用一句话说明运算在做什么。
The proof feels too steep证明跨度太大
Read the claim, its assumptions and the chapter’s mini-example first. Use the first-pass route to return to the proof after the idea is familiar.
先读结论、适用条件和该章微型例子,再按导读路线回到证明。
Python cannot find NumPy or SciPy提示找不到 NumPy 或 SciPy
Install requirements with the same environment executable used to run the script. If installation fails, read the first error line; a network or Python-version problem is not an ICA failure.
使用运行脚本的同一个环境解释器安装 requirements。安装失败先看第一条错误;网络或 Python 版本问题并不是 ICA 算法失败。
The file is not found提示找不到文件
Check the terminal’s working folder and the actual filename. The script and requirements.txt should be in the folder where you ran the commands.
检查终端当前文件夹及实际文件名。脚本和 requirements.txt 应放在执行上述命令的文件夹里。
I get a rank or convergence error提示秩不足或没有收敛
Read the error instead of replacing it with zero. Check data orientation, duplicate channels, retained dimension and sample count. Then consult the chapter’s diagnostics; changing seeds does not repair an invalid model.
不要把报错替换成零。先检查数据方向、重复通道、保留维数和样本数,再读该章诊断部分;换随机种子不能修复不成立的模型。
The components have different signs or order成分符号或顺序不同
Use a one-to-one match and account for sign/scale ambiguities. Do not compare output row numbers as if their identities were fixed.
进行一一匹配,并考虑符号与尺度不确定性;不要默认输出行号就是固定的成分身份。

You are ready to continue when you can name the observed and hidden quantities, explain why zero correlation is not enough, and interpret a sign/permutation change. Continue to Chapter 1 →.

能做到这些就可以继续:说出哪些量已知、哪些量隐藏,解释为什么不相关还不够,并正确理解符号/顺序变化。接着读第 1 章 →。