Specparam/Fitting Oscillations and One-Over-F (FOOOF)

Authors: Luc Wilson, Jason da Silva castanheira, Raymundo Cassani

This tutorial introduces the features developed in Brainstorm to compute and view FOOOF models from a Welch’s Power Spectral Density (PSD) file.

Note: The FOOOF algorithm has recently been renamed by its authors to specparam.

Introduction

The Fitting Oscillations and One-Over-F (FOOOF/specparam) algorithm is designed to identify and model features of the neural power spectrum. It performs a sequential decomposition of the power spectrum into aperiodic and periodic components, optimizing the modelled spectrum using a least-squared-error approach. The present tutorial will demonstrate the algorithm’s functionality within the Brainstorm interface; for a detailed breakdown of the algorithm, please refer to the FOOOF GitHub.

FOOOF_schematic.png

This demonstration uses sample data from the introduction dataset, and can be followed by completing all steps of the Brainstorm tutorial up to and including tutorial 10.

Initializing and running FOOOF

FOOOF is principally performed on Welch’s PSD files. Analysis of Fourier transforms are also possible, but not recommended. We will run FOOOF over the PSD files we previously produced.

Select the following process options:

Select the following output options:

Viewing FOOOF models

Three new files should now be visible, with one below each PSD we just processed.

This is an ideal environment to view FOOOF models to ensure that they are fitting the spectrum correctly. Here, you can also double-click and view the original PSD file at the same time, selecting individual channels to determine goodness-of-fit qualitatively.

Accessing FOOOF model parameters

While viewing the FOOOF models within Brainstorm is helpful for qualitative interpretations, some may wish to extract the parameter values directly from the model for statistical tests.

Convert FOOOF model parameters to regular PSD files

You can convert parameters of a FOOOF model to regular PSD files. This can be useful, as it allows using all the processes for PSD on FOOOF model parameters. For example, to export FOOOF model parameters as SPM surfaces,SPM volumes, group in frequency bands, etc.


Python implementation

Some process options are only available in the MATLAB version. They have been added to allow for greater flexibility in the algorithm’s settings; a few are actually within the Python version, but are inaccessible via MATLAB.

If you would prefer to use the algorithm in its original state, you can instead select FOOOF version: Python. To use the Python version, some configuration of your system is required.

Model-selection (ms-specparam)

The current available tools to neuroscientists for parametrizing brain activity, rely on user expertise. Users are required to tune the hyperparameters of specparam/FOOOF model in order to achieve an optimal fit. In the following section, we introduce model-selection spectral parametrization (ms-specparam) algorithm which adjusts progressively more complex models to the spectrum to achieve the most parsimonious fit. This novel implementation of specparam/FOOOF uses data-driven model selection to minimize the reliance on user expertise and subjective choices, enabling more robust, reproducible, and interpretable research findings.

The hyperparameters of specparam/FOOOF are method parameters that help the algorithm fit the neural power spectrum to the data. An example of such a hyperparameter is the maximum number of Gaussian peaks to fit (see Initializing and running FOOOF).

The choice of hyperparameter can significantly modify the resulting spectral model and its interpretation. Take for example the spectrum presented in the Figure below. The user-dependent choice in the maximum number of number of peaks expected from spectral parameterization was set manually to a value of 6. Under high signal-to-noise conditions (presented on the left), spectral parameterization may yield only two peaks as expected. In noise conditions more closely aligned with real data, however, the spectral parameterization algorithm may overestimate the number of peaks in the spectrum to account for noise-related fluctuations (example on the right). This difference in the number of estimated peaks alters the interpretation of the resulting spectral model.

FOOOF_hyperparameter_spectral_peaks.png

To automatically and adaptively adjust model hyperparameters to account for the noise level in the data, we introduce the model-selection strategy. The ms-specparam method proceeds with adjusting progressively more complex models to the empirical data spectrum or spectrogram, and determines the parameters of the simplest model that adequately accounts for the data. Ms-specparam selects the best model by accounting for both the best fitting model, while also picking the most parsimonious model (i.e., fewest spectral peaks) using the Bayesian information criterion (BIC). See Figure below for algorithm's pipeline.

FOOOF_BIC_method.png

In Wilson and colleagues (2024), we present extensive tests of the approach with ground-truth and empirical magnetoencephalography recordings and demonstrate that ms-specparam shows enhanced specificity and sensitivity of spectral and spectrogram decompositions, even when used as part of Spectral Parameterization Resolved in Times (SPRiNT).

Ms-specparam, like FOOOF, is principally performed on Welch’s PSD files. Analysis of Fourier transforms are also possible, but not recommended. Below we will run ms-specparam over the PSD files we previously produced.

Note that ms-specparam has similar process options and FOOOF structure as described above.

As ms-specparam relied on the Bayesian information criterion (BIC), this also enables the quantification of evidence for periodic activity in spectral data via Bayes factor analysis. The best fitting model as determined by BIC is utilized in a Bayes factor inference against the aperiodic only spectral model (panel i of figure below). This analysis helps users adjudicate whether spectral peaks are likely to be present in the data power spectrum. A Bayes factor less than 1 is evidence in favour of periodic brain activity over the null hypothesis of no periodic brain activty (panel iv). In contrast, a Bayes factor greater than 1, is evidence in favour of no periodic activity (i.e., the null hypothesis).

FOOOF_Bayes_factor_pipeline.png

Summary

FOOOF is an algorithm designed to complement many analytical techniques already in use today. Its purpose is to help researchers characterize the neural power spectrum more quantitatively; it is not necessarily meant to be used for exploratory means. The algorithm can return noticeably different models depending on whether the settings provided are suitable for the spectra being parametrized. Understanding the characteristics of a particular power spectrum is crucial to modelling them appropriately. The best way to determine whether a model is appropriate for a given spectrum is to compare the original and modelled spectra side-by-side.

Acknowledgements

All credit for the conception of the original FOOOF algorithm is due to Thomas Donoghue, Matar Haller, Erik Peterson, Paroma Varma, Priyadarshini Sebastian, Richard Gao, Torben Noto, Antonio H. Lara, Joni D. Wallis, Robert T. Knight, Avgusta Shestyuk, and Bradley Voytek. The appropriate citation for FOOOF is as follows:

Donoghue, T., Haller, M., Peterson, E.J. et al. Parameterizing neural power spectra into periodic and aperiodic components. Nat Neurosci 23, 1655–1665 (2020). https://doi.org/10.1038/s41593-020-00744-x

Luc E. Wilson, Jason da Silva Castanheira, Benjamin Lévesque Kinder, Sylvain Model selection for spectral parameterization. BioRxiv (2024). https://www.biorxiv.org/content/10.1101/2024.08.01.606216v1

Tutorials/Fooof (last edited 2024-08-22 10:21:21 by ?JasonDaSilvaCastanheira)