# Personalized Neurofeedback and Neuromodulation Decision Pipeline

## Purpose

This framework is for **personalizing neurofeedback and neuromodulation** to the individual.

It is **not** a fixed rule set like:
- ADHD -> theta/beta
- anxiety -> FAA
- golf -> SMR

Instead, it answers:

- what problem the client is trying to change
- which **construct axes** matter most
- which **state transition** should be trained
- which **modality** fits best
- whether the protocol is working
- when to continue, adapt, or switch

---

## Core Principle

Use this flow:

**goal + baseline + challenge battery + response profile -> target axes -> target states -> modality -> markers -> prescription -> review**

This sits on top of the **marker -> axis -> state** framework.

---

## 1. Define the Goal

Start with the outcome, not the marker.

Example goal families:

| Goal Family | Examples |
|---|---|
| **Attention / Focus** | distractibility, deep work, sustained attention |
| **Arousal Regulation** | performance anxiety, stress reactivity, over-arousal |
| **Emotional Regulation** | mood regulation, rumination, trauma-related dysregulation |
| **Executive Function** | working memory, planning, inhibitory control |
| **Motor / Performance Readiness** | precision execution, flow, reaction readiness |
| **Sleep / Recovery** | winding down, sleep readiness, recovery |
| **Fatigue Resistance** | maintaining function under prolonged load |

If the client has multiple goals, choose **one primary goal**.

### If the client has no clear goal
Use the battery to infer a **ranked shortlist of candidate axis families**.

Logic:

**battery performance -> bottleneck profile -> candidate axis family -> short probe protocol -> validate**

Examples:
- strong drift / RT variability -> **Task Engagement / Calm Focus**
- collapse under pressure -> **Arousal Regulation**
- poor dual-task / n-back performance -> **Executive Recruitment / Cognitive Control**
- poor downshifting after challenge -> **Affective Regulation / Sleep Readiness**

---

## 2. Check Constraints

Before choosing a protocol, screen for:

- age / developmental stage
- diagnoses
- medication effects
- sleep / fatigue load
- sensory sensitivities
- stimulation tolerance
- EEG / fNIRS / wearable suitability
- whether basic behavioral regulation is needed first

This prevents bad target selection and modality mismatch.

---

## 3. Run a Personalization Battery

The battery is used to see **how the client functions across conditions**, not to diagnose them from signals alone.

### Battery structure
- **Baseline:** rest, simple breathing, low-demand baseline
- **Easy task:** low-demand task relevant to the domain
- **Challenge / load:** harder task, distraction, pressure, fatigue, conflict, emotional load
- **Recovery:** down-regulation or reset block
- **Goal-specific block:** a task close to the real-world target

### Battery design note
This should be a **shared scaffold**, not one identical task set for every client.

Use the same overall structure across domains, but adapt the task content:

- **sport / performance:** pressure, motor execution, fatigue, competition simulation
- **wellbeing / human performance:** sustained attention, working memory, distraction, cognitive fatigue
- **clinical:** symptom-relevant challenge, emotional provocation, recovery capacity, safety-aware tasks

### What the battery should produce
- **Baseline profile**
- **Challenge profile**
- **Recovery profile**
- **Goal-relevant profile**
- **Signal reliability profile**

---

## 4. Select the Target Axes

Do **not** jump straight to a marker.

First choose the construct axes that best explain the client’s bottleneck.

### Recommended canonical axes

| Axis | What It Represents |
|---|---|
| **Arousal / Activation** | under-activated vs optimal vs over-activated |
| **Task Engagement** | on-task vs drifting |
| **Cognitive Control** | top-down effortful control and monitoring |
| **Calm Focus** | stable, low-noise attentional readiness |
| **Affective Regulation** | emotional load and regulation success |
| **Executive Recruitment** | working-memory / prefrontal engagement |
| **Fatigue / Instability** | drift and degradation over time |
| **Sleep Readiness / Recovery** | winding down and sleep-supportive regulation |
| **Motor Automaticity** | reduced overthinking, fluid execution |
| **Perceptual Breadth** | scanning and situational awareness |

### Default rule
Choose:
- **1 primary axis**
- **1 secondary axis**
- **optional 1 constraint axis**

Example:
- primary = **Arousal Regulation**
- secondary = **Calm Focus**
- constraint = **Fatigue**

---

## 5. Translate Axes Into Target States

States are the specific conditions the protocol wants to train.

They should be:
- meaningful
- measurable
- trainable
- linked to outcomes

### Examples

| Client Type | Example Target States | Desired Transition |
|---|---|---|
| **Attention** | distracted, effortful, stable attention, fatigued | **distracted -> stable attention** |
| **Anxiety / stress** | under-activated, optimal, over-aroused, dysregulated | **over-aroused -> optimal** |
| **Executive function** | under-recruited, optimal, overloaded | **under-recruited / overloaded -> optimal** |
| **Sleep / recovery** | alert, winding down, sleep-ready, restless | **restless -> sleep-ready** |
| **Athletic precision** | under-engaged, calm-focused, over-controlled, over-aroused, competition-ready | **over-controlled / over-aroused -> competition-ready** |

---

## 6. Choose the Modality

Only after the axes and states are defined should the system choose the modality.

### Typical fit

| Situation | Likely Better Modality |
|---|---|
| fast oscillatory attention / arousal training | **EEG** |
| executive load / cognitive control | **fNIRS** or **EEG + task coupling** |
| movement-tolerant cognitive training | **fNIRS** |
| simple home use | **wearable EEG** or **wearable stimulation** |
| sleep / recovery | **auditory** or **wearable regulation** |
| precision low-noise training | **EEG** |
| immersive real-world tasks | **EEG / fNIRS + VR or task integration** |

Choose based on:
- target axis
- context
- motion tolerance
- signal quality
- user burden
- commercial feasibility

---

## 7. Select Markers and Direction

Only now should the system choose markers.

Markers are chosen because they are the best handles for the selected axis and state transition.

### Examples

| Target Axis | Possible Marker Families |
|---|---|
| **Calm Focus** | SMR, Upper Alpha, Theta/Beta, tension markers |
| **Affective Regulation** | FAA, Alpha/Theta, decoded emotion-state patterns |
| **Executive Recruitment** | FMT, dlPFC HbO, decoded fNIRS patterns |
| **Motor Automaticity** | T3 Alpha, Temporal-Frontal Coherence |

### Directionality rule
Do not assume “up is always good.”

Possible directions:
- increase
- decrease
- stabilize
- keep within optimal band
- minimize distance to best-state region

---

## 8. Generate the Prescription

The system should output a **prescription object** containing:

- primary goal
- primary axis
- secondary axis
- target state transition
- chosen modality
- chosen markers
- target direction
- session context
- feedback style
- recommended dose
- transfer measure
- responder confidence
- review point
- stop / adapt criteria

### Example
**Goal:** reduce pressure-induced attentional collapse  
**Primary axis:** Arousal Regulation  
**Secondary axis:** Calm Focus  
**Target transition:** over-aroused -> optimal  
**Modality:** EEG neurofeedback during task  
**Markers:** SMR + stress marker  
**Direction:** increase calm-focus composite, reduce hyperarousal  
**Review:** re-check after 3 sessions using pressure-task performance and state stability

---

## 9. Use an Early Response Check

Do not assume the first protocol is correct.

Check early:
- can the client modulate the target?
- does the state move in the right direction?
- is there behavioral transfer?
- is the protocol too effortful?
- is the signal too noisy?
- would a different modality fit better?

### Possible outcomes
- likely responder
- responder but needs adaptation
- unclear
- wrong target
- wrong modality
- non-responder to current protocol

This allows:
- continue
- simplify
- escalate
- switch
- stop

---

## Personalization Decision Table

| Stage | Question | Output |
|---|---|---|
| **Goal** | What is the client trying to improve? | Goal family + primary outcome |
| **Constraints** | What limits or exclusions matter? | Usable modalities and exclusions |
| **Battery** | How does the client perform across baseline, challenge, and recovery? | Functional profile |
| **Axis selection** | Which latent dimensions best explain the bottleneck? | Primary and secondary axes |
| **State selection** | What state transition should training produce? | Target and undesired states |
| **Modality selection** | Which training method best fits? | EEG, fNIRS, hybrid, stimulation, etc. |
| **Marker selection** | Which markers best estimate the selected axes? | Marker set + reliability |
| **Directionality** | What should happen to the target? | increase, decrease, stabilize, optimize |
| **Prescription** | What should the client actually do? | protocol plan |
| **Review** | Is it working? | continue, adapt, switch, stop |

---

## Design Rule

Do **not** build a decision system that says:
- poor focus -> theta/beta
- anxiety -> FAA
- sleep issue -> alpha/theta

Build a system that says:

**this client, with this goal, under these constraints, appears to need these axes targeted, with this state transition, via this modality, using these markers, in this direction, with this review rule**

---

## Summary

A personalized neurofeedback / neuromodulation pipeline should:

1. start with the client’s goal
2. run a structured battery
3. identify the key construct axes
4. define the target state transition
5. choose the best modality
6. choose the marker set and direction
7. generate a prescription
8. check early whether it is working

**Core abstraction:**  
**goal -> battery -> axes -> states -> modality -> markers -> prescription -> review**