Skip to content
Lambdian

Independent component analysis

Unmix signals: find statistically independent, non-Gaussian sources behind observed mixtures.

Animated explanation

The idea

At a party, two microphones each record a mixture of two speakers. Can we recover each speaker's voice? ICA says yes, if the sources are statistically independent and not Gaussian.

The key insight comes from the central limit theorem: a mixture of independent signals is more Gaussian than the signals themselves. So we search for directions in which the projected data is as non-Gaussian as possible; each such direction recovers one source. PCA finds uncorrelated directions of large variance; ICA goes further and finds independent ones. It is used for separating EEG/MEG signals from eye-blink artefacts, audio, and financial factors.

What ICA cannot know

The order of the sources and their scale (and sign) are not identifiable: As=(AD−1P−1)(PDs)A\mathbf{s} = (AD^{-1}P^{-1})(PD\mathbf{s}) for any permutation PP and scaling DD. At most one source may be Gaussian, since a rotation of Gaussians is still Gaussian and nothing could pin it down.

FastICA

Centre and whiten the data (PCA with unit variances). Then for each component run a fixed-point iteration that maximises an approximation of negentropy (non-Gaussianity) using g(u)=tanh⁡(u)g(u) = \tanh(u), decorrelating each new component from the previous ones (deflation). It converges in a handful of iterations.

The algorithm, step by step

  1. 1
    Centre the data and whiten it: z=Λ−1/2E⊤(x−μ)\mathbf{z} = \Lambda^{-1/2}E^\top(\mathbf{x}-\boldsymbol\mu).
  2. 2
    For each component pp: start with a random unit w\mathbf{w}.
  3. 3
    Repeat: w←E[ztanh⁡(w⊤z)]−E[1−tanh⁡2(w⊤z)]w\mathbf{w} \leftarrow \mathbb{E}[\mathbf{z}\tanh(\mathbf{w}^\top\mathbf{z})] - \mathbb{E}[1-\tanh^2(\mathbf{w}^\top\mathbf{z})]\mathbf{w}; subtract projections on earlier components; normalise.
  4. 4
    Stop when ∣wnew⊤wold∣≈1|\mathbf{w}_{\text{new}}^\top\mathbf{w}_{\text{old}}| \approx 1; the sources are s^=Wz\hat{\mathbf{s}} = W\mathbf{z}.

The maths

Generative model

x=As,  si independent, non-Gaussian\mathbf{x} = A\mathbf{s},\ \ s_i \text{ independent, non-Gaussian}

Whitening

Cov⁡(z)=I\operatorname{Cov}(\mathbf{z}) = I

Negentropy approximation

J(y)∝(E[G(y)]−E[G(ν)])2,  G(u)=log⁡cosh⁡u, ν∼N(0,1)J(y) \propto \big(\mathbb{E}[G(y)] - \mathbb{E}[G(\nu)]\big)^2,\ \ G(u) = \log\cosh u,\ \nu\sim\mathcal{N}(0,1)

Strengths and weaknesses

Strengths

  • Separates mixed signals PCA cannot
  • Fast fixed-point algorithm (FastICA)
  • No training labels

Weaknesses

  • Order, sign and scale of sources are arbitrary
  • Assumes linear mixing and independence; at most one Gaussian source
  • Sensitive to noise and to the number of components

Reach for it when…

You observe linear mixtures of independent signals: EEG/MEG artefact removal, audio separation, finding independent factors.

Check your understanding

Question 1

Q1Why does ICA look for non-Gaussian directions?

Question 2

Q2After whitening, the remaining unmixing transformation is…

Question 3

Q3Which can ICA not determine?

Lambdian Lab

FastICA by deflation

Separate two mixed signals.

  • whiten(X): centre the (n × d) data and return (Z, W_white) with cov(Z) = I (use the eigen-decomposition of the covariance).
  • fast_ica(Z, n_components, iters, seed): deflation FastICA with g = tanh; return W (rows are unit vectors, mutually orthogonal).
  • unmix(X, n_components, seed): sources = Z @ W.T.
Open the labPython + NumPy runs in your browser. Sign-in keeps your code and attempts.