Hosaka v1.18 beta (29th April 2025)
===================================

Hosaka command-line software can be used to manipulate brainwaves using
audiovisual stimulus and machine learning (recurrent reinforcement learning).
You must concentrate on the stimulus. For audio only, keep your eyes closed most
of the time and use 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-x86_64.AppImage --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-x86_64.AppImage --measure --focus --device=mindmonitor --focus
hosaka-x86_64.AppImage --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. However, it is NOT recommended to use ICA signals
because their metrics have errors are more difficult to reliably predict.

whiteice-x86_64.AppImage --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
whiteice-x86_64.AppImage --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=<model-dir>". This also enables using
the previous measurements instead of starting from scratch.
(NOTE: because of a mysterious bug, loading of neural network models don't work very well)

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
use the recent 1000 measurements of model and random activity responses.


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