Hosaka v3.10 beta (15th May 2026)
=================================

Hosaka command-line software can be used to manipulate brainwaves using
audiovisual stimulus (pictures) and machine learning.

Software uses only CPU. You MUST have *FAST* CPU for the optimization step
which takes hours. You need to 1) measure EEG database or responses to pictures,
sounds and keywords (1 hour measurements, multiple times a day), 2) optimize
machine learning models so you can: 3) execute stimulus to try to increase
PLV (default) or other targets.

To test stimulation/measurements, use commands:

hosaka3.exe --random --device=random

hosaka3.exe --measure --device=mindmonitor
hosaka3.exe --measure --device=lsl
hosaka3.exe --measure --device=random

Software can either read Mind Monitor App EEG readings using OSC (UDP) protocol
to port 4545 to IP of your computer (Interaxon Muse) or read LSL protocol
(the default is to use the first found LSL stream) EEG readings.

You can also set other targets for optimization than phase lag index (PLI)
using --target command. (21 comma separated values between 0 and 1,
use -1 for values that are not used).

In the commands below you must change some -1 values to values between 0 and 1 (typically 0 or 1). The used
target below sets target to be PLI and PLV of ICA signals. It is recommended to use ICA signals
because their metrics are of higher quality than raw EEG signals (only when you have many EEG measurement points).

To optimize with given target use commands:

hosaka3.exe --optimize --device=lsl --concentration
hosaka3.exe --optimize --device=mindmonitor --target=-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1
hosaka3.exe --optimize --device=lsl --target=-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1

You can save measurements/models to a directory. To store measurements use "--model-dir=".
This also enables using the previous measurements and models instead of starting from scratch.

Use "--help" for command-line parameters. Pressing ESC or ENTER stops the program.

To execute stimulus (tries to move to target EEG state) use commands:

hosaka3.exe --execute --device=mindmonitor --concentration --program-len=1200
hosaka3.exe --execute --device=lsl --concentration --program-len=1200

IMPORTANT: Software is currently experimental and sometimes software fails to have
any wanted effect on the EEG. Effects are sometimes small and about 5% change in
EEG-metrics would mean really significant effect to EEG.

IMPORTANT: in optimize and exection modes you need to use same target as model is
optimized for each EEG target separately.

To see how EEG changes, use ./get_error.sh command in bash shell (MSYS2).
The command lists average error (distance) to target in 60 seconds steps (less is better).
Quite often values decrease after the start a bit.

NOTE: Currently stimulation period is 3 seconds long. This means you should measure stimulations
for 2-4 hours or so ("--measure") and then calculate ("--optimize --concentration") stimulation model and
finally use it ("--execute --concentration").

NOTE: --save-video option is currently buggy and does not properly save whole video stimulation.

Ýou can reset models and measurements by deleting files in "model/*".
(del model/*).

In linux you may need to use "chrt -f 30 <command>" to use real-time priorities.

You currently need to run the software in the installation directory in order
for it to find all required files (FIXME).

Errors (distances to target) are saved every one minute to "errors.csv" file.
At the end in "--optimize" software reports increase of target value in percentages since the start
of the program. Values reported are percentage changes to the optimized measure (positive/larger is better).
Values bigger than 5% means software may cause some changes to EEG/brain.
(But stimulation effect still probably quickly disappears after stimulation).


Tomas Ukkonen, M.Sc. <tomas.ukkonen@iki.fi>


LICENSE:

Software is freeware but closed source. Links with non-GPL libraries.

