# Stimulation Montage Achieves Balanced Focality and Intensity
## 2 Materials and Methods
### Evaluation Metrics  
Quantitative evaluations are used to measure and compare the performance of the proposed method with other state-of-the-art methods. At first, the stimulation intensity, in volts per meter, is quantified by the maximum electric field of the target region. In general, higher intensity is preferred. An intensity of 0.1-0.3 V/m is reported to be efficient [20; 40; 41].  
\[E=e_{max}=max(e_{tar}) \tag{7}\]  
Second, the target error (TE) is defined as the Euclidean distance between the mass centers of the target and the solution regions [18; 22].  
\[TE=\parallel\mathbf{MC}_{0}-\mathbf{MC}\parallel_{2},\ \ (\mathbf{MC}_{0})_{j}=\frac{\sum_{i}( \mathbf{e}_{0})_{ij}\cdot\mathbf{p}_{ij}}{\sum_{i}(\mathbf{e}_{0})_{ij}},\ \ (\mathbf{MC})_{j}=\frac{\sum_{i}(\mathbf{e})_{ij}\cdot\mathbf{p}_{ij}}{\sum_{i}(\mathbf{e})_{ij}} \tag{8}\]  
where \(j\in\{x,\,y,\,z\}\), \(\mathbf{p}_{i}\) represents the coordinates of the \(i\)th voxel. The mass center of the target region and the activation region are \(\mathbf{MC}_{0}\) and \(\mathbf{MC}\), respectively. With units of millimeters, TE is a way of evaluating the stimulation accuracy: the smaller the TE, the higher the accuracy.  
Third is the locality [18; 22] measured in millimeters, which is represented by the radius in which the cumulative energy is half of the total energy. If we use \(\Gamma(\mathbf{r})\) to represent the voxel set within a distance \(\mathbf{r}\) from the center of the target region, and \(E(\mathbf{r})\) is the portion of the energy of \(\Gamma(\mathbf{r})\).  
\[\mathbf{r}_{0.5}=\mathbf{r}|_{E(\mathbf{r})=0.5},\ \ E(\mathbf{r})=\frac{\sum_{i\in\Gamma(\mathbf{r} )}\parallel\mathbf{e}(\mathbf{r}_{i})\parallel_{2}^{2}}{\sum_{i}\mathbf{e}(\mathbf{r}_{i})_{2 }^{2}} \tag{9}\]  
Focality indicates stimulation precision. Smaller values of \(\mathbf{r}_{0.5}\) indicate that most of the energy is concentrated in a smaller region, and thus off-target brain regions are less likely to be activated.  
In addition, although all optimization algorithms are applied to the aforementioned 342-electrode system, any electrode whose absolute current is less than 1 uA is considered inactivated, and the number of activating electrodes in the montage is provided. To avoid any confusion, the \"electrode number\" for different optimization methods in the rest of paper refers to the number of electrodes with absolute current larger than 1 uA.  
When measuring model robustness, the mean squared error (MSE), the common image measurement, is adopted to evaluate the dissimilarity between \(\mathbf{e}^{\prime}_{3n\times 1}\) and \(\mathbf{e}_{3n\times 1}\). A higher MSE indicates that the electric field distribution is more sensitive to changes in conductivity, and that the computational model is therefore less robust with respect to conductivity uncertainty.  
\[\text{MSE}=\frac{1}{n}\sum\bigl{(}\mathbf{e}^{\prime}_{3n\times 1}-\mathbf{e}_{3n \times 1}\bigr{)}^{2} \tag{10}\]  
Then the intensity (\(E^{\prime}\)), target error (\(TE^{\prime}\)) and locality (\(focality^{\prime}\)) of \(\mathbf{e}^{\prime}_{3n\times 1}\) are compared with those of \(\mathbf{e}_{3n\times 1}\). \(\Delta E,\ \Delta TE,\ \text{and}\ \Delta focality\) are therefore obtained by \(|E^{\prime}-E|,|TE^{\prime}-TE|,\) and \(|focality^{\prime}-focality|\), respectively. Finally, the maximum rate of change will be given, defined by the maximum \(\Delta E/\Delta\sigma,\Delta TE/\Delta\sigma,\ \text{or}\Delta focality/\Delta\sigma\) for the different metrics.