eeg-source-localization-regularization

EEG Source Localization: Inverse Problem Solving via Regularization & Truncated SVD

MATLAB Field License

Academic computational project developed for the Numerical Methods for Data Mining course (Dipartimento di Matematica e Applicazioni “Renato Caccioppoli”, Università degli Studi di Napoli Federico II).

This project models the electroencephalography (EEG) forward problem within a 3D spherical volume conductor ($R = 20\text{ cm}$) and compares numerical regularization techniques to solve the underdetermined inverse problem of neural source localization.


📌 Executive Summary

Electroencephalography (EEG) source localization aims to estimate intracranial neural current dipole activity from non-invasive scalp electric potentials.

The overall framework consists of two complementary stages:

In this setup, the head volume conductor is discretized as a homogenous sphere of radius $R = 20\text{ cm}$ containing $N = 32$ distributed neural sources and $M = 5$ surface electrodes over $T = 100$ discrete sampling instances.

The linear mapping relating internal dipole activities to scalp recordings is governed by:

\[V = G x + \epsilon, \quad M \ll N\]

where:

Because the number of active dipole sources significantly exceeds the number of recording sensors ($M \ll N$), the inverse system is severely underdetermined and ill-conditioned, possessing an infinite number of admissible solutions.

This repository demonstrates:

  1. Geometric Forward Modeling: Construction of a spherical conductor ($R = 20\text{ cm}$), interior dipole coordinates ($N = 32$), and surface electrode placement ($M = 5$).
  2. Dynamic Signal Simulation: Multichannel coupled autoregressive (AR) dynamics over 100 time points with additive Gaussian noise.
  3. Analytic Minimum-Norm Solution: Minimum $L^2$-norm regularized reconstruction using the right Moore-Penrose pseudo-inverse $x = G^T (G G^T)^{-1} V$.
  4. Truncated SVD Thresholding: Moore-Penrose pseudo-inversion across singular value cutoff tolerances $\tau \in {10^{-1}, 10^{-2}, 10^{-3}, 10^{-4}}$ to evaluate reconstruction fidelity and numerical stability.

🧠 Mathematical Formulation

1. Forward Model & Lead Field Matrix ($G$)

Derived from electrostatic point-source field decay:

\[E(r, t) = \frac{1}{4\pi\epsilon_0} \sum_{i=1}^N \frac{q_i(t) \mathbf{a}_i(t)}{R^2}\]

where $R = \Vert r - r_i \Vert$, $q_i(t)$ is the signal from source $i$, and $\mathbf{a}_i(t)$ is a unit vector pointing in the direction of the line between the charge and the field point $r$.

The lead field matrix $G$ is constructed using the following approximation equation, where the coupling coefficient between electrode channel $i$ and source dipole $j$ is modeled as:

\[G_{ij} = \frac{c}{R^2}, \quad c = 1\]

2. Inverse Problem & Regularization Framework

The inverse problem consists of estimating the source activity values that generated the measured electric potential field vector at the electrodes. The general strategy formulates this estimation as a regularized linear optimization problem:

\[\hat{x} = \min_x \left( \Vert V - Gx \Vert_2^2 + \sum_{i=1}^k \alpha_i \Vert W_i x\Vert_p \right)\]

where:

3. Inverse Methods Comparison

4. Key Findings

📊 Visualizations & Diagnostic Outputs


🚀 Getting Started

Prerequisites

Running the Code

  1. Clone this repository: ```bash git clone https://github.com/chiaragiavalisco/eeg-source-localization-regularization.git cd eeg-source-localization-regularization

  2. Open MATLAB, navigate to the cloned folder, and run:

    run('eeg_source_localization.m')
    

🛠 Skills & Competencies Demonstrated


👤 Author

Chiara Giavalisco


📚 References

  1. Jatoi, M. A., Kamel, N., Malik, A. S., Faye, I., & Begum, T. (2014). A survey of methods used for source localization using EEG signals. Biomedical Signal Processing and Control, 11, 42–52.
  2. Galaris, E., Gallos, I., Myatchin, I., Lagae, L., & Siettos, C. (2020). Electroencephalography source localization analysis in epileptic children during a visual working-memory task. International Journal for Numerical Methods in Biomedical Engineering, 36(5), e3404.
  3. Mégevand, P., & Seeck, M. (2018). Electroencephalography, magnetoencephalography and source localization: their value in epilepsy. Current Opinion in Neurology, 31(2), 176–183.

📄 License

This project is open-source and available under the MIT License.