bbgmfun/CognitiveDiffusion

An edge-optimized Neuro-AI pipeline translating EEG brain states into visual art using pruned Stable Diffusion models.

Python

1

2 commits

updated Jun 16, 2026

See the code

README

Vision Cortex: Edge-Optimized EEG-to-Image Pipeline

Overview

Vision Cortex is a Proof of Concept (PoC) pipeline designed to bridge the gap between biological signal processing (Neuroscience) and Generative AI. The project focuses on optimizing inference for edge devices by addressing the core challenges of production-ready AI applications: latency reduction and memory efficiency.

Inspired by the model optimization techniques utilized in leading AI laboratories such as HubX, this project demonstrates the ability to process raw sensor data, classify cognitive states, and trigger a Generative AI pipeline using a heavily compressed model architecture.

System Architecture

  1. Data Ingestion & Simulation: Simulates a 14-channel EEG sensor array to represent real-time biological data streams.
  2. High-Speed Data Mapping: Converts raw Pandas DataFrames directly into Hugging Face Dataset objects, enabling optimized, high-speed memory mapping suitable for continuous data streams.
  3. Cognitive State Classification: Utilizes a Random Forest classifier to categorize the user's current cognitive state (e.g., focused, relaxed) based on feature extraction.
  4. Dynamic Prompt Engineering: Programmatically translates the classified biological state into high-fidelity context prompts.
  5. Edge-Optimized Inference: Replaces standard, high-parameter diffusion models with nota-ai/bk-sdm-tiny, a systematically pruned Stable Diffusion model. This architectural choice significantly reduces VRAM consumption and inference latency, drawing a direct parallel to the biological process of synaptic pruning.

Technology Stack

  • Data Processing: Pandas, Hugging Face Datasets
  • Machine Learning: Scikit-Learn
  • Generative AI: Diffusers, Transformers
  • Backend: PyTorch

Installation & Execution

# 1. Clone the repository
git clone [https://github.com/your-username/vision-cortex.git](https://github.com/your-username/vision-cortex.git)
cd vision-cortex

# 2. Initialize Virtual Environment
python3 -m venv venv
source venv/bin/activate

# 3. Install Dependencies
pip install pandas datasets scikit-learn diffusers transformers torch torchvision

# 4. Execute the Pipeline
python app.py

bbgmfun/CognitiveDiffusion

An edge-optimized Neuro-AI pipeline translating EEG brain states into visual art using pruned Stable Diffusion models.

Python

1

2 commits

updated Jun 16, 2026

See the code

README

Vision Cortex: Edge-Optimized EEG-to-Image Pipeline

Overview

Vision Cortex is a Proof of Concept (PoC) pipeline designed to bridge the gap between biological signal processing (Neuroscience) and Generative AI. The project focuses on optimizing inference for edge devices by addressing the core challenges of production-ready AI applications: latency reduction and memory efficiency.

Inspired by the model optimization techniques utilized in leading AI laboratories such as HubX, this project demonstrates the ability to process raw sensor data, classify cognitive states, and trigger a Generative AI pipeline using a heavily compressed model architecture.

System Architecture

  1. Data Ingestion & Simulation: Simulates a 14-channel EEG sensor array to represent real-time biological data streams.
  2. High-Speed Data Mapping: Converts raw Pandas DataFrames directly into Hugging Face Dataset objects, enabling optimized, high-speed memory mapping suitable for continuous data streams.
  3. Cognitive State Classification: Utilizes a Random Forest classifier to categorize the user's current cognitive state (e.g., focused, relaxed) based on feature extraction.
  4. Dynamic Prompt Engineering: Programmatically translates the classified biological state into high-fidelity context prompts.
  5. Edge-Optimized Inference: Replaces standard, high-parameter diffusion models with nota-ai/bk-sdm-tiny, a systematically pruned Stable Diffusion model. This architectural choice significantly reduces VRAM consumption and inference latency, drawing a direct parallel to the biological process of synaptic pruning.

Technology Stack

  • Data Processing: Pandas, Hugging Face Datasets
  • Machine Learning: Scikit-Learn
  • Generative AI: Diffusers, Transformers
  • Backend: PyTorch

Installation & Execution

# 1. Clone the repository
git clone [https://github.com/your-username/vision-cortex.git](https://github.com/your-username/vision-cortex.git)
cd vision-cortex

# 2. Initialize Virtual Environment
python3 -m venv venv
source venv/bin/activate

# 3. Install Dependencies
pip install pandas datasets scikit-learn diffusers transformers torch torchvision

# 4. Execute the Pipeline
python app.py