Managing erroneous measurements of dynamic brain electrical impedance tomography after reconnection of faulty electrodes

Objective: Electrode detachment may occur during dynamic brain electrical impedance tomography (EIT) measurements. After the faulty electrodes have been reset, EIT can restore to steady monitoring but the corrupted data, which will challenge interpretation of the results, are notoriously difficult to recover. Approach: Here, a piecewise processing method (PPM) is introduced to manage the erroneous EIT data after reattachment of faulty electrodes. In the PPM, we define the three phases before, during and after reconnection of the faulty electrode as PI, PII and PIII, respectively. Using this definition, an empirical mode decomposition-based interpolation method is introduced to compensate the corrupted data in PII, using the valid measurements in PI and PIII. Then, the compensated data in PII are spliced at the end of PI. Thus, there will be a surge at the junction of PII and PIII due to the changes in contact state of the repositioned electrodes. Finally, to ensure all the EIT data are obtained under constant electrode settings, we calculate the above changes and eliminate them from the data after PII. To verify the performance of the PPM, experiments based on head models, with anatomical structures and with human subjects were conducted. Metrics including permutation entropy (PE) and image correlation (IC) were proposed to measure the stability of the signal and the quality of the reconstructed EIT images, respectively. Main results: The results demonstrated that the PE of the processed data was reduced to 0.25 and the IC improved to 0.78. Significance: Without iterative calculations the PPM could efficiently manage the erroneous EIT data after reattachment of the faulty electrodes.


Introduction
Dynamic electrical impedance tomography (EIT) can inject safe currents into an object via a set of electrodes and reconstruct tomographic images of internal conductive perturbations based on the recorded boundary voltage changes (Holder 2004, Adler andBoyle 2017). EIT has the advantages of non-invasiveness, application in real time and low cost, and its use has been widely investigated in biomedical applications such as monitoring lung ventilation and imaging brain function (Frerichs 2000, Bayford andTizzard 2012). Our group has also explored several possible clinical applications for dynamic brain EIT. Fu and colleagues applied dynamic EIT to monitor the treatment of patients with cerebral hypertension for dehydration and found that EIT could non-invasively reflect changes in intracranial pressure and individually evaluate the efficacy of the treatment (Fu et al 2014, Yang et al 2019. Li et al (2018) applied dynamic EIT to monitor changes in cerebral conductivity during total aortic arch replacement surgery and imaged the development of cerebral injury caused by hypoxia.
A common problem with dynamic EIT is bad electrode contact due to the movement of patients or manipulation by clinical staff (Asfaw and Adler 2005). Methods have been developed to detect the number and location of any faulty electrodes (Zhang et al 2017a). After detecting the faulty electrodes they are usually reattached in a timely manner because EIT monitoring of the brain should cover the whole process of treatment or surgery.
images and calculate the variation of intracranial conductivity during monitoring to evaluate the brain injury or the efficacy of dehydration treatment. If one just ignores the erroneous measurements and proceeds to blindly reconstruct a conductivity image one is likely to make inaccurate diagnostic decisions. Therefore, it is necessary to properly manage the erroneous EIT data.
In lung EIT, where signals are periodical, a method for managing the erroneous data after reattachment of faulty electrodes is to simply eliminate the invalid data and select measurements in another respiratory cycle for interpreting the results (Hartinger et al 2009). But this method is not applicable in our focused applications of dynamic brain EIT, because brain EIT data change continuously, without periodicity (Manwaring et al 2013, Boverman et al 2016. Some researchers have proposed imaging approaches including maximum a posteriori (Adler 2004) and random sample consensus (Jeon et al 2017) to recover the imaging with poorly connected electrodes by filtering outlier data. However, these methods could not restore the EIT data and only worked well with small numbers of faulty electrodes. Zhang et al (2017a) compensated the erroneous brain EIT data obtained with faulty electrodes using the valid data before electrode detachment depending on the fact that the change in brain EIT data has continuity. However, for scenarios of reattachment of faulty electrodes this method has limitations in that the information from EIT data after repositioning of faulty electrodes was not used, and the changes in contact state of the faulty electrodes after repositioning were not considered.
To solve the above problem, we propose a piecewise processing method (PPM) to recover the EIT data after reattachment of disconnected electrodes. The PPM method, with its advantages of fast calculation, good accuracy and robustness, could efficiently account for the data corrupted by faulty electrodes and eliminate the contact state changes after their repositioning. To verify the performance of our proposed method, we conduct phantom and human experiments in this study. Metrics including permutation entropy (PE) (Popov et al 2013) and image correlation (IC) (Javaherian et al 2013) are introduced to evaluate the quality of the EIT measurements and images before and after the processing.

EIT measurements and errors in reattachment of faulty electrodes
Before proposing a method for processing the erroneous EIT data, we first illustrate the EIT measurements and the errors with scenarios of repositioning of faulty electrodes. In dynamic brain EIT, scalp electrodes are placed on a patient's head to inject stimulation currents and measure the responding boundary voltage changes. Figure 1 shows a brain EIT with 16 electrodes using the polar driven and adjacent measurement pattern (Tang et al 2010). More specifically, the current was repeatedly injected through electrode pairs (1-9), (2-10), … (8-16). In each excitation, the voltage differences between adjacent electrode pairs were measured. For the measured boundary voltages U ∈ R n×1 , there are n = 16 × 16, or 256 measurements (data channels).
Based on U, we can calculate the total boundary voltage (TBV) metric where u i represents voltages of the ith data channel of U. In the ideal case, the variation of TBV is continuous and smooth, but for restless patients the EIT electrodes might scrape against the pillow and then reconnect to the scalp during a posture change, and thus the TBV would be severely distorted. TBV can give a more explicit description of the errors in the EIT data generated during faulty electrode reconnection. In figure 2(a), we show the TBV of EIT measurements with the expansion of an intracranial hemorrhage (ICH). As blood is more conductive than brain tissue, the TBV will show a gradual decrease under constant current stimulation. In figure 2(b), the EIT electrodes were detached at time t 1 . The detached electrodes would not only disrupt current injection but would also cause a large resistivity to be recorded as well as a high level of random noise (Jeon et al 2016). Therefore, the TBV showed severe distortion and its original decrease due to the expansion of the ICH was masked. With the detection method in Zhang et al (2017a) we could locate and reset the faulty electrodes at time t 2 . After the reattachment, the TBV of the EIT data was restored to steady changes but the data after t 2 would have a constant difference from those recorded before t 1 , because it was hard to connect the faulty electrodes to the exact previous location and state.
Therefore, to recover the EIT data in scenarios including repositioning of faulty electrodes it is necessary to process (1) electrode detachment and (2) changes in electrode contact after reattachment.

PPM for managing the corrupted measurements
This section introduces a PPM, which consists of three steps to manage erroneous data after reattachment of faulty electrodes. An EIT system with 16 electrodes will have several data channels with measurements. The data are compensated by performing the PPM for the data in each channel. Figure 3 shows the steps involved in the PPM.  Figure 3(a) displays the erroneous brain EIT data of the ith channel in monitoring the expansion of an ICH. In figure 3(b) we define the three periods before, during and after electrode detachment as PI, PII and PIII, respectively. Based on the times of detachment (t 1 ) and reattachment (t 2 ) of faulty electrodes, the duration of PII can be determined as T PII = t 2 − t 1 = t. Through PII, the periods before and after PII, which are PI (t 0 -t 1 ) and PIII (t 2 -t 3 ), respectively, can be determined using the scales

Period division
where T PI and T PIII represent the scales of PI and PIII, respectively, t S represents the start time of the monitoring and t E represents the end time of the monitoring.

Data compensation in PII with empirical mode decomposition-based interpolation (EMDBI)
The second step of PPM is to compensate the EIT data corrupted by faulty electrodes in PII. The EIT data of the ith channel in PI and PIII are denoted as u PI i (t) and u PIII i (t). The compensated data of the ith channel in PII are denoted as cu PII i (t). As the faulty electrodes were reconnected in a timely manner, the variation of data in PII should be highly related to u PI i (t) and u PIII i (t). Thus, cu PII i (t) can be obtained through interpolation. Figures 3(c) and (d) demonstrate the steps of EMDBI for compensating cu PII i (t).
(1) As random noise would cause oscillations in measurements and deteriorate the accuracy of interpolation, u PI i (t) and u PIII i (t) were first denoised with the empirical mode decomposition (EMD) method in figure 3(c). EMD(u PI i (t)) and EMD(u PIII i (t)) represent the denoised measurements, while the red and blue curves are their corresponding plots.
(2) Figure 3(d) shows the fitted curve functions of EMD(u PI i (t)) and EMD(u PIII i (t)), which were calculated with a polynomial curve fitting method (Zhang et al 2006). They are denoted as which are shown as red and blue curves, respectively. The voltage changes of Fu I i (t) and Fu III i (t) at the time constant j ∈ PII were calculated as Based on ∆u I i ( j) and ∆u III i ( j), the voltage changes in PII were interpolated with the weighted function: where ∆cu II i ( j) represents the voltage changes of the interpolated data at j in PII. Finally, the compensated data of the ith channel in PII can be calculated with the following iterations: where cu PII i ( j) represents the boundary voltage at time constant j.

Elimination of contact state changes caused by repositioned faulty electrodes
Faulty electrodes are likely to have location shifts as well as changes in contact impedance after reattachment; hence, the third step of the PPM is to eliminate the contact change errors from the data collected after reconnection of faulty electrodes. The compensated data cu PII i (t) were spliced at the termination of u PI i (t), as shown in figure 3(e). Therefore, the measurements before and after t 2 have different electrode settings, causing sharp voltage changes at the junction of PII and PIII: represents the errors caused by the contact changes of the faulty electrodes in EIT data of the ith channel. E CC i was subtracted from the data following PII to obtain the data under the same electrode settings: where u APII i (t) is EIT data of the ith channel after PII and cu APII i (t) represents the compensated data of the ith channel after PII. Figure 3(f) shows the recovered EIT data of the ith channel, and it can be seen that brain EIT measurements can be restored to geometry-specific smoothness after the process.

Experiment
Here, we will describe the materials and instruments used for the phantom and human experiments, the methods for generating erroneous EIT data after reattachment of the faulty electrodes and the metrics for signal and image quality evaluation. Figure 4(a) illustrates the 3D simulation, finite element method (FEM) head model (Li et al 2017) generated by COMSOL. It is composed of 28 000 mesh elements and has a four-layer structure, including the scalp, skull, cerebrospinal fluid (CSF) and brain parenchyma. The conductivities of the different brain tissues are listed in table 1, according to the data provided by Tang et al (2008). There are 16 Ag/AgCl electrodes evenly placed in a ring on the scalp, through which we can inject safe currents and calculate the boundary voltages to simulate EIT measurements to test the performance of the proposed method. Figure 4(b) illustrates the physical head model. Similar to the simulation of the head model, the physical head model is also composed of cerebral anatomical structures, in which the skull and parenchyma are fabricated using a 3D printer (Zhang et al 2017b), the CSF is simulated using saline and the scalp is created using a fruit peel. Sixteen Ag/AgCl scalp electrodes are placed on the surface of the model and conductive cream is used to reduce the contact impedance (Boverman et al 2007). Based on this model, we can generate synthetic EIT measurements. For example, the data for intracranial bleeding can be simulated by injecting conductive agar, with the same conductivity values as blood, into the hole in the parenchyma.

Patients for human experiments
In the human experiments we applied dynamic brain EIT to monitor patients with mannitol dehydration treatments, to noninvasively reflect the changes in intracranial pressure and individually evaluate the efficacy of their treatment. The human data for mannitol dehydration treatments were provided by Yang et al (2019). Forty patients (28 men and 12 women) whose intracranial pressure values were above 20 mm Hg for more than 10 min were recruited for mannitol dehydration treatment. The ages of the patients ranged from 45.5 to 63 years, their average Glasgow Coma Scale score was 6 and their lesion types included stroke and trauma. The EIT monitoring began 20 min before the infusion of mannitol and lasted for over 3 h. The human experiments were approved by the Research Ethics Committee of the Fourth Military Medical University (FMMU-E-III-001(1-7)), registered at Medresman.org (No. ChiCTR-DDD-16008272). Due to length limitations, in the results section we only give representative results for the patients. Figure 5 shows the homemade EIT system that was utilized. The amplitude and frequency of the excitation currents are 1000 µA and 50 kHz, respectively. The accuracy of the EIT system is 0.1%, its common ratio is over 75 dB and its imaging speed is one image per second. For more detailed information about this system see Shi et al (2018). For the EIT reconstruction algorithm we use the GREIT algorithm to reconstruct the EIT images. GREIT is an advanced dynamic EIT algorithm with good resolution and robustness (Adler et al 2009). GREIT determines the best reconstruction matrix R GREIT which minimizes an error using a set of training-conductive targets:

EIT instrument and image reconstruction algorithm
where ∆σ t ∼ N(0, Σ 0 ) are the training-conductive targets, ∆σ * Dt = D∆σ t is the desired reconstruction result for ∆σ t and D is the 'desired image' matrix, which maps the training-conductive targets to the desired reconstruction results. ∆U t is the boundary of the voltage changes of ∆σ t and w is the weighting matrix defined to adjust the contribution of the targets. With the optimal reconstruction matrix, the conductivity can be obtained by from where ∆σ * is the reconstruction results and ∆U is the measured boundary voltages.

Protocol for generating EIT data with errors due to resetting faulty electrodes
As discussed above, EIT measurements in scenarios of the repositioning of faulty electrodes contain errors from (1) detached electrodes and (2) contact state changes after their reattachment.
In the simulation experiments, we set the signal to noise ratio (SNR) of the EIT measurements related to faulty electrodes as 10 dB to simulate electrode detachment. Then, the error of contact state changes is simulated by changing the position of the electrodes, based on the 3D head models. In the physical head model experiments, we simulated the above errors by detaching the electrodes for a while and then reattaching them near to where they were.
In the human experiments, many patients may scrape their EIT electrodes on a pillow and then these are reconnected to the scalp during their posture change. In this study, we selected erroneous measurements from these patients for processing.

Metrics for image and signal quality evaluation
Here, the PE and IC metrics are utilized to evaluate the quality of the EIT signal and image, respectively. PE can measure the complexity of the time-varying signal, with the advantages of easy implementation, fast calculation and good robustness (Popov et al 2013). The PE of the TBV of the EIT data changes regularly and smoothly without noise or disturbances. However, with errors of reattachment of the faulty electrodes, the EIT signal will become chaotic. Therefore, in this study we introduce PE to evaluate the signal quality of the EIT. The calculation of the PE consists of four steps: Step 1: Denote the vector of the TBV curve as {tbv(i), i = 1, 2, · · · N}, in which N is the frame number. We can then construct the time series: where τ and m are the time lag and embedding dimension, respectively.
Step 2: Rearrange each row vector in (10) in ascending order: Step 3: Obtain the symbol sequence for each row vector as In S(g), there are m different numbers. Therefore, there will be m! possible sequence patterns. We count the occurrences of each sequence pattern and calculate its corresponding frequency P g .
Step 4: Therefore, the PE can be defined as Large values of the PE indicate oscillations in the EIT signals.
The IC measures the similarity between the reference and reconstructed EIT images. The IC can be calculated as where σ * R and σ RP are the conductivity distributions of the reconstructed and reference EIT images, respectively.

Results of simulation experiments
In the simulation experiments, a red sphere with the same conductivity as that of the ICH (0.7 S m −1 ) was inserted into the anterior of the 3D head model. We gradually increased its size from 0 ml to 5 ml to simulate expansion of the ICH (see figure 6(a)) and calculated the corresponding boundary voltages changes. Then, the SNR of the data was set as 70 dB and the TBV curve without the electrode problem is displayed in figure 6(b). By selecting the reference frame at t = 1 and the current frames at t = 10, 20 and 30, we demonstrate the reconstructed images in figure 6(c). From the results, it can be seen that the TBV gradually decreases with expansion of the ICH. Without electrode problems, the EIT images could well reflect the location and shape of the targets.   In figure 7(a), we simulated electrode 1 being detached at t 1 = 15 and repositioned at t 2 = 25. Based on the method introduced in section 4, we generated the erroneous EIT data caused by repositioning of faulty electrodes; the corresponding TBV curve is shown in figure 7(b) Figure 7(c) shows the imaging results for the erroneous data and it can be seen that the EIT could not reconstruct the correct targets. To manage the corrupted EIT data, we performed the PPM in figure 8. Figure 8(a) shows the data in PII compensated with the EMD-based interpolation. In figure 8(b), the compensated data in PII were spliced to the termination of PI. The sharp voltage changes at the junction of PII and PIII were caused by changes in the electrode contact state of the repositioned faulty electrodes. Finally, the above error was eliminated from the data following PII, and we display the TBV and the EIT images of the recovered data in figures 8(c) and (d), respectively. Therefore, by using the PPM, the erroneous EIT data and images could be well compensated. Table 2 gives the evaluation results for the correct, corrupted and recovered EIT data based on PE and IC. Using the PPM, the PE of the compensated EIT data was reduced to 0.45, and the IC of the reconstructed EIT images increased to 0.84 ± 0.02, similar to the values with correct data. Regarding the calculation speed of the PPM, it took less than 1 ms to process the corrupted data in the simulation experiments on a desktop computer with a 2.20 GHz CPU and 8 Gb RAM.

Results of physical head model experiments
In the physical head model experiments, as depicted in figure 9(a), 5 ml of saline with a conductivity of 0.7 S m −1 was gradually injected into the hole in the physical head model (see figure 4(b)) to simulate expansion of the ICH. At t 1 = 50, we pressed electrode number 12 for 35 s to simulate a bad electrode connection and then, at t 2 = 85, reconnected it to a location near its original one. In figure 9(b) we plot the corresponding TBV curve and prescribe PI ∈ [15,50],PII ∈ [50,85] and PIII ∈ [85,105]. By selecting the reference frame as t = 15 and the current frames as t = 30, 60, 90, the reconstructed EIT images are displayed in figure 9(c). Figure 10 shows the processing results for erroneous EIT data in physical experiments with PPM. From the results we can see that the recovered EIT data and images using the PPM in the physical head model experiments could correctly reflect the expansion of the ICH.

Results of human experiments
As displayed in figure 11(a), dynamic brain EIT was applied to monitor the mannitol dehydration treatments of patients with brain edema. After infusion of mannitol, the TBV of the EIT data would usually exhibit a continuous increase, indicating that the intracranial conductivity decreased during the treatment. However, the TBV would be severely distorted in scenarios of reconnection of faulty electrodes (see figure 11(b)). In figure 11(c), the EIT images were reconstructed by selecting the reference frame as t = 1000 and the current frames as t = 3000, 5000 and 5500. The red and blue colors were utilized in the EIT images to indicate the increase and decrease, respectively, of intracranial conductivity. As displayed in figure 11(c), there are large red areas in the EIT images reconstructed based on the erroneous EIT data at t = 3000, indicating that the intracranial conductivity increased; this is not consistent with the assumption that the conductivity of brain tissue would decrease due to the effect of mannitol. In figure 11(d), we recovered erroneous EIT data with the proposed PPM, and figure 11(e) shows the reconstructed images which correctly reflect the decrease of the intracranial conductivity due to mannitol. So, similar to the results of phantom experiments, the data quality in human experiments after reconnection of faulty electrodes could also be improved by PPM. In the interpretation of results based on the restored EIT data, we can calculate by what percentage the EIT data changed to evaluate the efficacy of dehydration treatment.

Discussion
There are a number of possible applications of EIT, and problems in specific application scenarios arise simultaneously with its development. Previously, we demonstrated that dynamic brain EIT had promise for monitoring changes in intracranial pressure during mannitol dehydration treatments and could image the development of cerebral injury caused by hypoxia during total aortic arch replacement surgery. However, a problem was observed in clinical experiments that although the EIT was restored to steady measurements after timely reposition of the poorly connected electrodes the measured data were severely corrupted and thus not applicable for interpreting results. For this problem, a novel PPM was proposed to manage the erroneous dynamic brain EIT data. Given that the changes in brain EIT data, in the periods before, during and after repositioning of faulty electrodes, should be highly related in the above applications, the PPM compensated the invalid data with bad electrode-skin connections using an EMD-based interpolation method, and then reduced errors due to the contact state changes after reattachment to ensure that all the EIT data were obtained with the same electrode settings. Without using extra a priori information on the number or location of the faulty electrodes, the proposed method could work even when there are multiple disconnected electrodes.
To test the performance of the PPM, we conducted phantom and human experiments. The results demonstrated that after applying the PPM, the EIT signal and the reconstructed images could be restored. Accordingly, we could calculate by what percentage or how quickly the EIT data/intracranial conductivity changed during the monitoring so as to estimate the efficacy of the treatment or the severity of the lesion. Besides the above applications, when monitoring abdominal bleeding (Tucker et al 2011) and bladder function (Leonhardt et al 2011) with EIT, the EIT measurements would also change gradually so PPM is feasible for recovering erroneous data after reattachment of faulty electrodes.
However, there are several limitations of the study. First, if the time of electrode detachment is too long the interpolation of erroneous data in PII with the valid measurements in PI and PIII will be challenged. And although PPM could compensate the erroneous EIT data and images to help the subsequent interpretation of results, the compensated results still had differences from those without faulty electrodes. Additionally, this paper only considered severe cases of bad connection-the contact impedance changes of electrodes due to sweat or evaporation of conductive cream were not considered. We had previously developed method that could monitor changes in contact impedance (Ma et al 2019), and we are working on empirical thresholds to warn about severe changes in contact impedance. Then, in future work, we will test whether the proposed method is able to improve EIT data quality after readjustment of electrodes with severe contact impedance changes. Finally, in the EMD method the first two IMFs were eliminated from the EIT measurements to reduce random noise. In future, a more adaptive method should be developed to allow researchers to select IMFs for elimination.

Conclusion
In monitoring the evolution of brain injury with dynamic brain EIT we usually need to manage the erroneous data after reattaching disconnected electrodes in order to analyze the results. This paper proposes a novel PPM to address the problem. Our approach can recover the corrupted data with good accuracy, and by fast calculation this PPM directly processes the EIT signal and uses the features of EIT measurements in monitoring the evolution of brain injury and efficacy of treatments, rather than having to make further modifications to the hardware or reconstruction algorithm.