Hosaka v1.24 beta (15th June 2025)
==================================

Hosaka command-line software can be used to manipulate brainwaves using
audiovisual stimulus and machine learning (recurrent reinforcement learning).
You should concentrate to the stimulus. For audio only, listen sounds with
closed eyes (most of the time) and preferrably with headphones.

The AppImage uses only CPU. You MUST have *FAST* CPU to use the software because
real-time processing of EEG signals at 200 Hz sampling frequency requires fast CPU +
background optimization of machine learning models. I have developed software using
AMD Ryzen 7 7745 HX (16 threads at 7186 BogoMIPS on Linux). In Windows, you need to
use PowerShell if there are spaces in parameters when using command-line.

To test random stimulation, use command:

hosaka.exe --random --device=random

There are initially random stimulus (aprox 10min learning time after which deep
reinforcement learning calculates online first prediction model in 10 minutes).
Better models are created live slowly in the background when the program is used:

hosaka.exe --measure --focus --device=mindmonitor --focus
hosaka.exe --measure --focus --device=lsl --lsl-names='BA HALO 002_HALO_BrainAccess','EEG' --focus

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 (BrainAccess HALO's
BrainAccessBoard) EEG readings.

You can also set other targets for optimization than "--focus" 
using --target command-line switch. (21 comma separated values between 0 and 1,
use -1 for values that are not used).

In the commands below you must change -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 NOT recommended to use ICA signals
because their metrics have errors and are more difficult to predict than raw EEG signals.

hosaka.exe --measure --device=mindmonitor --target=-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1
hosaka.exe --measure --device=lsl --lsl-names=<stream-name>,<stream-type> --target=-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1

As the default LSL protocol uses 4 first channels but it can be increased if LSL stream (EEG) has more channels.

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.
(currently model loading doesn't seem to work very well (a bug)).

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


IMPORTANT: You need to run the software in the background (audio)
for 1-3 hours before some useful (small) results (max effect is typically 1%).

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

Linux: You also need a recent/new GLIBC and fuse installed to your system.

Performance numbers are a bit pessimistic numbers about effects and computed
from recent 1000 measured responses to stimuli.



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