Skip to content

MindsApplied/Minds_AI_EEG_Filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

149 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minds AI Filter for EEG Documentation

Your Minds AI Signal Filter uses spatial coupling and band-aware weighting to condition the signal based on the physics of true neural activity. “AI” is included in the naming convention due to its utility in artificial intelligence pipelines, but the filter itself does not use deep learning. It also doesn't require pretraining or clean stretches of data. It can work standalone or in combination with other filters (such as for specific noise) and is equipped for alternative or multi-modal time-series data. Specifically the MAI Filter:

  • Suppresses artifacts like transient motion/ocular bursts while preserving underlying rhythms across channels
  • Reduces high-frequency noise (>40 Hz) and sharpens low-frequency activity (~3-7Hz)
  • Smooths variance and reduces baseline-drift
  • Reconstructs flatlined electrodes from neighboring synchrony

Additional References:


1) Filter Package Installation

Package only

pip install "git+https://github.com/MindsApplied/Minds_AI_EEG_Filter@main"

Package and Demo Apps

pip install "mindsai-filter-python[examples] @ git+https://github.com/MindsApplied/Minds_AI_EEG_Filter@main"

1.1 Implementation

After adding the package mindsai_filter_python from package/platform/python_version to your project directory, it can be called using the following:

import mindsai_filter_python as mai
# data: (channels x timepoints) array
data = [
    [5, 6, 5, 4, 3, 2, 3, 4],     # ch0
    [-2, -1, 0, 1, 0, -1, -2, -1] # ch1
]
tailoring_lambda = 1e-25
filtered_data = mai.mindsai_python_filter(data, tailoring_lambda)

It's that easy! It expects data to be a 2-D continuous array of channels x time and relies on one hyperparameter. It should be applied to the data window prior to any other filters or indiviudal electrode analysis. It can be applied to large trials (60 seconds maximum) or looped for real-time usage (1 second minimum).

Public package versions restricted to python 3.10 & 3.11 due to export format. Alternative versions can be made available upon request.

An intialization key is no longer required.

Tailoring Lambda Description Visual

1.2 Tightening Lambda

The hyperparameter integer, tailoring_lambda, controls how much your Minds AI Filter modifies the original signal and should be input on a logarithmic scale between 0 and 0.1. A lower lambda value like the default 1e-25 causes the filter to make bolder adjustments for more complex transformations that highlight the structure across channels, such as for real-time filtering (1 second windows). A higher lambda value like 1e-40 works best with more data (such as 60-second trials) for still helpful, but more conservative adjustments.

2) Real-time and Offline Demo Apps (Not required for filter package usage)

We provide 2 apps that make it easy to test and see signal quality improvement from the Minds AI Filter. One for real-time streaming directly from your headset, and the other for feeding segments of prerecorded data. Both apps visualize the signal and removed noise, as well as provide SNR metrics for signal quality improvement.

Windows only - While we work to add alternative platforms for the demo apps, the filter package alone can be used on Windows and Linux.

2.1 Real-Time Streaming

Real-time app UI Image

The real-time demo app, used in the video above, can be found in the examples folder as Minds_AI_Filter_Real-time_Signal_Analysis.py. Documentation for testing and configuration can be found here in our wiki

2.2 Offline Upload

Offline app UI Image

The offline demo app can be found in the examples folder as Minds_AI_Filter_Offline_Signal_Analysis.py. Documentation for testing and configuration can be found here in our wiki


3) Patent Status

Patent pending. Portions of this work are covered by a US provisional application filed 2025-06-30.
For details, see PATENTS.md. For commercial licensing, contact contact@minds-applied.com.

4) How to Cite

If you use this software, please cite the preprint:

Wesierski, J.M., Rodriguez, N. A lightweight, physics-based, sensor-fusion filter for real-time EEG. bioRxiv (2025).
https://doi.org/10.1101/2025.09.24.675953

A machine-readable citation file is provided: CITATION.cff.

About

MindsApplied EEG Signal Filter for Real-time or Offline Analysis

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages