# Closed-Loop Current Stimulation Feedback Control of a Neural Mass Model Using Reservoir Computing
## 3 Results
### Feedback Results  
For the remainder of the results, only the output from PC column 1 is shown, as the outputs from PC column 2 are similar, but with an overall smaller magnitude. The mean-squared error for ESN training and testing is shown in Figure 7 for different log fractions of the training data used while keeping the amount of testing data fixed. Interestingly, even though the MSE became more stable as the amount of training data increased, it did not reduce testing MSE (in Figure 7, the blue training data MSE fluctuates when the amount of training data is small, even though the test set MSE is similar, regardless of the amount of training data used). This point is considered in more detail below. We explored the extent to which the ESN feedback controller could suppress the model output (the PC column values). Figure 8 shows the mean-squared membrane potential of PC column 1 with feedback using the input current predicted to inhibit the output, no feedback, or mismatched feedback control taken from a different random run of the model, each taken over 100 trials. For each of the random trials, appropriate feedback led to the smallest PC output and random feedback produced the largest. This observation was supported by statistical analysis using a repeated measures ANOVA test, which found a significant effect on the type of feedback stimulation (F(2, 198) = 313.97, \(p<0.001\)). To explore the effect of the hyperparameter \(k\) on the energy suppression of the model, we ran the simulation for various values of \(k\) and different log fractions of the training data. Figure 9 shows the average percent change in energy of PC column 1 compared to the no-feedback condition for the different values of \(k\) and log fractions of the training data over all trials. The choice of \(k\) greatly impacted the degree to  
Figure 6: A single trial of the simulation without feedback control. **(A)** The time series output of the PCs for two seconds of the simulation. The blue trace indicates column 1, while the red trace indicates column 2. **(B)** PSD of the membrane potentials for both of the column’s PCs calculated using a multitaper FFT. Figure 7: Mean-squared training and testing error (with units mA up to a constant of proportionality related to membrane potential) calculated from the last data point predicted from the ESN output averaged over both PC columns, plotted against different log fractions of the training data. suppressed, but the output energy was less strongly affected by the amount of training data provided to the model. Specifically, as seen in Figure 9, values of k less than about 0.9 led to increases in output energy. The output energy decreased as \(k\) increased within each row. However, output energy was relatively similar within a given column. That said, even though different amounts of training data led to similar suppression of the PC output, it greatly affected the feedback current used to suppress the output, both in the total energy and the power spectra of the control signal, as shown in Figure 10. Increasing the amount of training data caused the ESN to learn more efficient, lower energy current inputs to achieve the same overall suppression. A single trial of the ESN feedback control results can be seen in Figure 11 and the PSD of the PC column 1 averaged over all trials is shown in Figure 12.  
Figure 8: Mean squared membrane potential (mV\({}^{2}\)) of PC column 1 for 100 trials. FB = Feedback from ESN, Rand FB = Feedback from a different random seed, No FB = no ESN feedback. The results above are shown for the ESN network trained on all of the data (log fraction of the data = 1) and with a value of \(k=1\). Figure 9: Percentchange in PC output energy relative to the no-feedback condition: 100\(\times\) (energy with feedback \(-\) energy without feedback) / energy without feedback. Data are shown for different values of \(k\) and log fractions of the training data.