Introduction

Numerical analysis methods, such as the boundary element method (BEM) and the finite element method (FEM), have been extensively used for solving electroencephalographic (EEG) forward problems (Haueisen et al. 1995; Haueisen and Ramon 1997; Fuchs et al. 1998; Wolters et al. 2004; Hallez et al. 2007; Akalin Acar and Makeig 2013; Ziegler et al. 2014) because head volume conductor complexity precludes the use of a simplified multi-sphere model (Awada et al. 1997; Akalin Acar and Makeig 2013). In contrast to BEM, which uses only surface boundary elements, both the anisotropic conductivity distribution and local tissue inhomogeneity are considered in FEM (Haueisen et al. 2002; Lee et al. 2009; Vorwerk et al. 2012, 2014). However, a well-constructed finite element (FE) head model for obtaining accurate EEG forward solutions generally requires a large number of elements, which increases the computational cost significantly (Shahid and Wen 2010; Cho et al. 2015).

One method for enhancing solution accuracy with a small increase in the number of elements is to generate a fine mesh around specific areas, e.g. tissue boundaries, and/or meshes with different resolution based on the tissue type (Schimpf et al. 1996, 1998; Wolters et al. 2004; Lee et al. 2006; Liu et al. 2008; Shahid and Wen 2010). These approaches could enhance the overall efficiency of the EEG forward calculation; however, their criteria for generating FE head models were rather empirical. For example, a study by Lee and Kim (2012) refined FE mesh based on the degree of anisotropy in white matter, and other studies by Pursiainen selectively generated small sized elements on the outer cortical surface (Pursiainen et al. 2011; Pursiainen 2012). However, the conventional mesh refinement strategies were empirical or rather arbitrary because they did not consider any quantitative criterion (e.g., numerical error) in determining region-specific element sizes. On the other hand, in other research fields, an adaptive mesh refinement strategy based on numerical solution error estimation has been widely used for more efficient FE analysis (FEA) (Hahn et al. 1988; Ubertini 2004; Grätsch and Bathe 2005), which has not been used for FEA of EEG forward problems.

In this study, an EEG forward problem involving a head model with three different mesh structures (coarse, adaptively refined, and fine meshes) was solved using FEM. To identify regions that require adaptive mesh refinement, the solution error was estimated via a posteriori error estimation. After comparing the solutions obtained using the three different meshes, a new strategy for generating a mesh for more efficient and precise FEA of EEG forward problems was suggested.

Methods

The volume conduction of neuronal current inside the human head can be described using the following governing equation:

$$\nabla \cdot \sigma \nabla V=\nabla \cdot {\mathbf{J}},$$
(1)

where V is the unknown electric potential, J is the primary current source(s), and σ is the electrical conductivity (Hämäläinen et al. 1993; Schimpf et al. 2002; Pursiainen et al. 2016). We handled the primary current source using the partial integration (PI) method (Yan et al. 1991; Pursiainen et al. 2016). J is represented as J = [Qx Qy Qz]Tδ(r − rQ), where [Qx Qy Qz]T is the dipole moment, δ is the Dirac delta function, and rQ is the position of the current dipole at the cortical surface node (Yan et al. 1991; Baillet et al. 2001). To determine the linearly approximated solutions of (1), FEM with first-order tetrahedral elements was used in this study. Each current source was assumed to be a dipole positioned at a node on the cortical surface because placing current sources at nodes on the interfacial boundary could reduce the overall number of unknowns. Because the gradient of the shape functions cannot be defined at the node, elements surrounding the current source partly shared the current source, and then the right-hand side of PI method was calculated for those elements.

For the simulation study, a realistic human head model was constructed from structural magnetic resonance image (MRI) data taken from a 27-year-old male subject. We considered four head structures, namely brain, cerebrospinal fluid (CSF), skull, and scalp, and their conductivities were 0.22, 1.79, 0.014, and 0.22 S/m, respectively (Choi 2013). Using CURRY7 for Windows (Compumedics NeuroScan, Charlootte, NC, USA), surface boundaries of four structures were extracted. Then, based on the boundaries, a finite element model was constructed by TETGEN (Si 2015), and ISO2MESH (Fang and Boas 2009). It is sometimes reported that the CURRY7 software could generate intersecting surfaces for the brain and CSF, when TETGEN or ISO2MESH may fail to generate volume elements. Although such problem did not occur in our modelling procedure, those who want to replicate our approach may need to pay a particular attention not to generate intersecting boundary sources (manual intervention might be needed). The original model (also referred to as coarse mesh model) included 129,103 nodes and 804,251 tetrahedral elements, when 29,022 nodes and 58,156 triangles were located on the cortical surface that was defined as an interfacial boundary between the brain and CSF. To evaluate the accuracy of the FE solution, the exact solution is required; however, it is not possible to obtain the exact solution for a realistic head model. As smaller element size should always result in more accurate solutions (Rivière et al. 2001; Logan et al. 2007; Jin 2014), very fine mesh data were generated, and the obtained FE solution was assumed to be the exact solution. The fine model that was constructed using TETGEN and ISO2MESH consisted of 1,082,572 nodes and 6,848,652 elements.

To estimate the error distribution of the FE solution, a posteriori error estimation was employed. According to electromagnetic theory, the normal component of the electric current density is continuous on any interfacial boundary (Cheng 1989). However, in practice, discontinuities of the current density frequently occur in the FEA results especially when traditional continuous Galerkin formulation is used. They are generally large in regions with large errors (Grätsch and Bathe 2005). Hence, for the a posteriori error estimation in this study, the error of a tetrahedral element e is defined as

$$ER{R_e}=\sum\limits_{i} {\left| {{J_i} - {J_{i,e}}} \right|} {S_i},$$
(2)

where \({J_{i,\;e}}\), \({J_i}\), and \({S_i}\) are the normal component of current density at the ith face of an element e, the normal component of current density at the ith face computed in the adjacent element sharing the ith face, and the area of the ith face of the element e, respectively. Based on the error estimation, the original model was extended to an adaptively refined model by adding new nodes at the centres of the elements, the errors of which exceeded 50% of the maximal error. TETGEN was used for the adaptive mesh refinement, and in-house programs coded using FORTRAN90 (compiler: Intel composer XE 2013) were used for FEA and error estimation.

FEA was applied to the original model, adaptively refined model, and fine model, and the results were compared. Dipole sources were assumed at the 29,022 nodes on the cortical surface of the original model. We assumed a situation that cortically distributed source model without orientation constraint is used for EEG source localization and thus electric field distribution for every source location needs to be evaluated. As it was assumed that each dipole source had three directional components (x-, y-, and z-directional components assuming no orientation constraint was applied), 87,066 solutions were obtained for each model. It should be noted that the dipole locations were common for the three models. Subsequently, the solution errors of the original model and the adaptively refined model were calculated using a new index, called Inaccuracy index, which was defined as

$$Inaccuracy=\frac{{\sum\nolimits_{i} {{{\left| {{V_i} - {V_{fine,i}}} \right|}^2}} }}{{\sum\nolimits_{i} {{{\left| {{V_{fine,i}}} \right|}^2}} }},$$
(3)

where Vi is the electric potential at the ith node on the scalp surface of either the original model or the adaptively refined model, and Vfine,i is the corresponding potential in the fine model. Inaccuracy was evaluated for all possible FE solutions, i.e. 87,066 solutions. To verify the efficacy of the adaptive mesh refinement based on error estimation, the original mesh was refined by adding, at the centres of randomly selected tetrahedral elements, the same number of nodes as in the adaptive mesh refinement. The FE solution of the randomly refined model was also compared with those of the original model and the adaptively refined model. We confirmed that the Inaccuracy index of every model had a normal distribution using Kolmogorov–Smirnov test. Hence, the statistical significance of the variation of the Inaccuracy index was tested using the paired t test. We used MATLAB (Mathworks, Natick, MA, USA) for statistical analysis.

Results

Figure 1 shows an example of the analysis when a current dipole is located on the precentral gyrus (see Fig. 1a). Figure 1b shows the distribution of electric potential around the dipole source. Figure 1c shows the error distribution obtained from a posteriori error estimation evaluated by (2). Interestingly, large errors were observed only around the dipole source locations. Twenty nodes were added, based on the estimated error distribution. The resulting adaptively refined mesh is shown in Fig. 1d. By adding only 20 nodes in the original model, the Inaccuracy index was reduced from 0.0237 to 0.00858. Figure 2a shows the scalp potential map generated by the dipole source shown in Fig. 1a when the fine model was used for FEA. Figure 2b, c show the normalized Inaccuracy between the FE solutions of the fine model and those of the original model (Fig. 2b) and the adaptively refined model (Fig. 2c). It can be readily observed that the adaptively refined model could dramatically reduce the numerical errors compared with the original model.

Fig. 1
figure 1

Example of FE analysis. a A current dipole source is located on the precentral gyrus in the original model. The black dot with the arrow represents a current dipole source. b Electric potential distribution around the current dipole shown in a. c The result of error estimation based on the field analysis. The value was converted from element-wise to node-wise for better visualization. d The results of mesh refinement. In this example, the numbers of added nodes and elements were 20 and 120, respectively

Fig. 2
figure 2

Reduced Inaccuracy after adaptive mesh refinement: a Scalp potential map generated by the dipole source in Fig. 1a, when the fine model was used for the finite element (FE) analysis, b Normalized Inaccuracy between FE solutions of the fine model and those of original model, c Normalized Inaccuracy between FE solutions of the fine model and those of the adaptively refined model

The Inaccuracy index was evaluated for all dipole locations and directions. The statistical analysis showed that Inaccuracy of the FE solutions of the adaptively refined model was significantly lower than that of the original model (Bonferroni corrected p = 0.0000) (see Fig. 3). The mean Inaccuracy index was reduced from 0.039 to 0.024 when the average and standard deviation of the numbers of the added nodes in the adaptively refined model were only 23.75 and 4.94, respectively. The average distance of the added nodes from the current dipole source was 2.20 mm (standard deviation = 0.34 mm), which implies that the added nodes were located near the current dipoles on the cortical surface. Moreover, the Inaccuracy indices of the adaptively refined model and the randomly refined model were compared and statistically significant difference was found (Bonferroni corrected p = 0.0000) (see Fig. 3).

Fig. 3
figure 3

Boxplots of the Inaccuracy index for the original, randomly refined, and adaptively refined models. Inaccuracy of the adaptively refined model was smaller than that of the original model. By contrast, there was no significant difference between the Inaccuracy index of the original model and that of the randomly refined model

Subsequently, a new model was generated, called cortically refined model, by adding new nodes only around the cortical surface, based on the observation that large numerical errors occur only around the cortical dipolar sources. This model consisted of 281,415 nodes and 1,803,565 elements, which are almost twice as many compared with those of the original model, but significantly fewer compared with those of the fine model (see Fig. 4 for a cross-sectional view of the model). The average distance between the cortical surface and the added nodes was set to ~ 2.2 mm. This was obtained from the results of the adaptive mesh generation. The average Inaccuracy index of the cortically refined model was 0.012, and statistical tests showed a significant difference between this model and the original model (Bonferroni corrected p = 0.0000) (see Fig. 5). For comparison, another model called uniformly refined model was generated by refining the original model without imposing any specific constraint (see Fig. 4 for a cross-sectional view of the model). This model consisted of 296,892 nodes and 1,815,986 elements, of which the numbers were almost identical to those of the cortically refined model. The uniformly refined model resulted in the average Inaccuracy index of 0.0144, which is smaller than that of the original model but still larger than that of the cortically refined model (see Fig. 5). Statistical analysis also exhibited significant difference between the uniformly refined model and the cortically refined model (Bonferroni corrected p = 0.0000). The time required for a single forward calculation using the original model, the cortically refined model, the uniformly refined model, and the fine model was 1.18 s, 11.77 s, 21.03 s, and 313.39 s, respectively, when the analysis program was executed in an Intel I7-4790 k personal computer with a 32 GB RAM under the Linuxmint 17.1 environment. It is noteworthy that the proposed mesh refinement strategy resulted in a statistically significant increase of the solution accuracy with less increase of computational time compared to the conventional uniform mesh refinement strategy. All the results described above are summarized in Table 1.

Fig. 4
figure 4

Cross-sections of the original model (leftmost panel), the uniformly refined model (middle panel), and the cortically refined model (rightmost panel)

Fig. 5
figure 5

Boxplots of the Inaccuracy index for the original, uniformly refined, and cortically refined models. Inaccuracy of the cortically refined model was smaller than those of the original and uniformly refined models

Table 1 Summary of simulation results

Discussion

Accurate EEG source imaging is important in applications such as epileptogenic source localization (Pellegrino et al. 2016; Nemtsas et al. 2017). Precise solution of EEG forward problems is one of the most important factors that may influence the overall accuracy of EEG source imaging. FEM has been widely used for EEG forward calculations because both the anisotropic and the inhomogeneous conductivity distribution in the human head can be considered (Aydin et al. 2014, 2017; Rahmouni et al. 2016; Vorwerk et al. 2017). It is well known that generating a fine FE mesh structure or a large number of elements can enhance the accuracy of FEA solutions. However, despite the rapid advancement of computer technology, solving EEG forward problems with highly complicated FE models still requires considerable computational resources; thus, it could be an obstacle to apply FEM-based forward calculations in practice. In this study, an adaptive mesh generation strategy was used to increase solution accuracy with a slight increase in computational cost. To the best of the authors’ knowledge, there was a research about empirical mesh refinement (Lew et al. 2009), but no prior study has applied an adaptive mesh generation strategy based on error estimation to the FEA of EEG forward problems.

According to the simulation study, the error distribution obtained using the original model exhibited large errors in the small area around the current dipole source on the cortical surface. It is plausible that these errors were caused by the large spatial variation of the electric potential distribution around the dipole source. Among several a posteriori error estimation methods (Bugeda 2002; Ubertini 2004; Grätsch and Bathe 2005), the discontinuity of the current density was adopted because it has proved to be an effective error estimator in many traditional electromagnetic problems (Hahn et al. 1988; Raizer et al. 1989; Kim et al. 1991). FEM solutions obtained using four different mesh structures, namely coarse, highly refined, randomly refined, and adaptively refined meshes, were compared by an error index called Inaccuracy. After applying adaptive mesh refinement, the mean Inaccuracy index was reduced to 60%, by adding less than 30 nodes around the large-error region, primarily around the current dipole source.

In this study, we adopted continuous Galerkin FEM to solve the EEG forward problem, for which the electric potential is linearly approximated. Because the electric field intensity is defined as the negative gradient of the electric potential and the current density is proportional to the electric field intensity (Cheng 1989), the current density is calculated as a constant vector in each element, when there exists discontinuity of the current density on the face between two elements. However, this error estimator is not adequate for discontinuous Galerkin FEM, unfitted discontinuous Galerkin FEM, and mixed FEM (Nusing et al. 2016; Vorwerk et al. 2017; Engwer et al. 2017; Piastra et al. 2018), because current density is continuous on the face between two elements when these methods are adopted. Therefore, other types of error estimators should be considered for these formulations.

In this study, the PI method (Yan et al. 1991) was used for modeling the dipole sources. This method is classical and easy to implement, but the resolution of the solution is relatively low because the information of the dipole position in an element disappears by applying weak formulation of Galerkin method (Awada et al. 1997). There are other source models such as H(div), Venant approach, and subtraction methods (Buchner et al. 1997; Schimpf et al. 2002; Wolters et al. 2007; Lew et al. 2009; Pursiainen et al. 2016). In a previous study (Lew et al. 2009), accuracies of EEG forward solutions were compared with respect to different source models, demonstrating some differences in the accuracy measure. Unlike the subtraction method, mesh refinement around the current sources would be always helpful in the PI method because the overall field distribution is not greatly affected by the dipole models and the electric potential and electric field intensity should vary abruptly in the region near the source. It is also possible that the volume of the refined elements near the current source could become under a physiological level. Because the current source represented by a mathematical dipole in this paper is actually a bundle of neural cells (Hallez et al. 2007), refinement under a certain level might be unnecessary. Therefore, determination of an adequate lower bound for the mesh refinement needs to be further studied in future works.

It was demonstrated from the simulation study that the adaptively refined regions were always around the current dipole source regardless of the location of the dipole sources. In general, solving EEG inverse problems using distributed source models requires forward solutions for all possible locations and directions of the current dipole sources to construct the leadfield matrix relating the cortical sources and the scalp EEG electrodes. It is obviously time consuming to use the adaptively refined model for this purpose because FEA should be repeatedly applied to a large number of FE models generated for different dipole locations and directions. In practice, cortically refined models, which have relatively denser mesh only around the cortical surface, can be used instead of adaptively refined models. Our additional simulations showed that the cortically refined model led to considerably improved accuracy compared with the original model and the uniformly refined model. However, the overall computational time was not significantly increased compared to that of the fine model. This study suggests that generating additional nodes and elements near the cortical surface would be a promising strategy for enhancing the computational efficiency and accuracy of EEG forward solutions based on FEM.