A newly developed deep learning pipeline based on a three-dimensional U-Net architecture can automatically extract transcranial direct current stimulation electrode coordinates directly from PETRA structural magnetic resonance imaging scans. Developed by researchers Filip Niemann, Steffen Riemann, and colleagues, the automated approach addresses a long-standing methodological challenge in tDCS-fMRI studies. Accurately determining actual scalp electrode positions from structural scans acquired alongside functional imaging is essential for focal montages, where even minor positioning errors can substantially reduce the electrical current dose that reaches targeted brain regions. Prior to this work, researchers lacked a fully automated method to extract electrode positions from structural MRI data.
The research team evaluated their automated pipeline in two distinct validation stages. In the first validation part, the investigators benchmarked five different U-Net variants that varied in their channel width and the inclusion of attention gating mechanisms. The benchmark utilized participant-wise five-fold cross-validation across 54 expert-segmented images. To assess broader performance and robustness, the evaluation also encompassed all 4,234 images collected across a multi-project, multi-site tDCS-fMRI study.
Standard segmentation overlap metrics failed to differentiate between the five network variants during testing. Instead, the performance differences emerged clearly when evaluating the yield of four valid coordinates. Contrary to initial expectations, the incorporation of attention gating mechanisms hindered extraction accuracy. The ungated network architectures successfully recovered all four target electrodes in 97.7 percent and 96.3 percent of the evaluated images. In contrast, the attention-gated models achieved complete recovery in only 89.0 percent to 91.2 percent of images.
The authors determined that this performance gap was driven almost entirely by adjacent electrodes merging into a single identified region within the gated networks. Because the simpler, ungated network structures demonstrated superior accuracy by preventing these false electrode mergers, the researchers selected the stronger ungated variant—a standard U-Net—for distribution. The team has released this standard U-Net pipeline as an open-source tool for the neuroimaging and neuromodulation research community.
In the second validation part, the researchers compared fully automated, semi-automatic, and manual extraction approaches against expert voxel-level ground truth using a 3×1 electrode montage. The automated extraction pipeline tracked the expert ground truth most closely among all tested approaches. Furthermore, the two automated workflows demonstrated remarkably tight consistency, recording an intraclass correlation coefficient of 0.984 and a mean bias of just 1.3 millimeters.
In contrast to the automated techniques, manual extraction alone introduced a systematic offset of 6.3 millimeters when compared to ground truth. These findings demonstrate that full automation successfully removes a measurable source of human error and bias in electrode position extraction. Furthermore, by eliminating the need for labor-intensive manual processing, the open-source pipeline scales effectively to large imaging datasets that manual workflows cannot feasibly analyze.
Subject of Research: Automated extraction of tDCS electrode positions from structural MRI
Article Title: Deep learning to overcome human error and bias in electrode position extraction in tDCS-fMRI studies
Article References: Niemann, F., Riemann, S., Dabelstein, S., Hering, K., Kocataş, H., Abdelmotaleb, M., Caisachana Guevara, L. M., Fischer, R., Thielscher, A., Antonenko, D., Flöel, A., & Meinzer, M. (2026). Deep learning to overcome human error and bias in electrode position extraction in tDCS-fMRI studies. Brain Informatics. https://doi.org/10.1186/s40708-026-00335-9
Image Credits: AI Generated
DOI: 10.1186/s40708-026-00335-9
Keywords: tDCS, fMRI, tDCS-fMRI, electrode position extraction, 3D U-Net, PETRA scans, structural MRI, focal montages, attention gating, deep learning, image segmentation, 3×1 montage, intraclass correlation coefficient, human error, systematic bias, neuroimaging, open-source software
News Source: Colin Clarke. (November 25, 2026). Automated 3D U-Net Pipeline Extracts tDCS Electrode Positions From Structural MRI. Scienmag.



