Next Article in Journal
Design of a Twin-Disc Rig for the Investigation of the Thermo-Mechanical Behaviour of Wheels, Rails and Brake Shoes of Railway Freight Waggons
Previous Article in Journal
A Utility-Driven Assessment of LoRaWAN Application for Secure Remote Monitoring in Smart Grid Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Real-Time Modulation of Prefrontal Activity via Automated EEG-tDCS Closed-Loop Interventions: A Feasibility Study †

by
Ariana Apopii
1,
Mihai-Emanuel Spiță
2,
Miralena I. Tomescu
1,* and
Ovidiu Andrei Schipor
2
1
NeuroLab, Faculty of Psychology and Educational Sciences, Stefan cel Mare University of Suceava, 13 Universitatii Street, 720229 Suceava, Romania
2
Faculty of Electrical Engineering and Computer Science, Stefan cel Mare University of Suceava, 13 Universitatii Street, 720229 Suceava, Romania
*
Author to whom correspondence should be addressed.
Presented at the International Conference on Electromagnetic Fields, Signals and BioMedical Engineering (ICEMS-BIOMED), Suceava, Romania, 7–9 May 2026.
Eng. Proc. 2026, 148(1), 26; https://doi.org/10.3390/engproc2026148026
Published: 10 July 2026

Abstract

This research presents the development and feasibility testing of a novel closed-loop neuromodulation system targeting the prefrontal cortex based on real-time EEG analysis. Performance in executive-demanding tasks, such as mental arithmetic and emotion regulation, is monitored via electroencephalography (EEG), while transcranial direct current stimulation (tDCS) parameters are dynamically adapted based on the participant’s neural responses. To overcome the accessibility barriers posed by proprietary software development kits, we implemented a custom Robotic Process Automation (RPA) framework in Python 3.10 and Computer Vision to autonomously control the Neuroelectrics Starstim 32 hardware. The system isolates alpha (8–13 Hz) frequency band, extracted primarily from prefrontal channels (e.g., F3, F4, Fp1, Fp2), to establish individualized stimulation thresholds. Results from a pilot session confirm the system’s ability to maintain stable real-time acquisition and automate stimulation triggers without manual intervention. This architecture demonstrates a cost-effective and reliable approach for state-dependent interventions, providing a personalized framework for enhancing cognitive control and supporting clinical neuromodulation.

1. Introduction

Executive functions (EF) rely on the prefrontal cortex, with impairments marking conditions like ADHD, depression, and substance use disorders. These cognitive states are effectively monitored via EEG, in which the Alpha (8–13 Hz) band reflects attention allocation and inhibitory control. While transcranial direct current stimulation (tDCS) is widely used to modulate these networks, traditional open-loop tDCS delivers fixed currents regardless of endogenous brain state, leading to high clinical variability. Consequently, the field is rapidly shifting towards closed-loop neuromodulation, which synchronizes interventions with real-time EEG biomarkers for significantly higher therapeutic efficacy [1,2].
However, implementing closed-loop systems is heavily hindered by the restrictive and expensive Software Development Kits (SDKs) required by commercial medical devices. To overcome this barrier, we propose a novel and cost-effective architecture that integrates real-time EEG processing via the Lab Streaming Layer (LSL) with Robotic Process Automation (RPA) powered by Computer Vision. Bypassing native SDKs, our system automates the low-latency control of Neuroelectrics Starstim 32 hardware through a custom Python backend and a Flutter mobile interface. Ultimately, this study evaluates the technical feasibility of this adaptive framework for delivering accessible, personalized neuromodulatory interventions.

2. State of the Art

2.1. EEG Biomarkers of Executive Function: Frequency Bands and Microstates

The relationship between executive functions and specific EEG spatiotemporal patterns is well-documented. The prefrontal cortex (PFC) acts as a central hub for cognitive control, mediating diverse processes from working memory to emotional regulation [3]. Frequency-domain analyses consistently highlight the roles of Alpha (8–13 Hz) oscillations in these processes. For instance, Alpha-band desynchronization across the prefrontal and parietal cortices has been shown to be essential for attention allocation and response selection, as observed in conflict-resolution paradigms such as the Eriksen Flanker Task [4]. Furthermore, complex cognitive tasks, such as optic problem-solving, reveal that varying task demands induce distinct topological shifts in Alpha and Theta band powers [5]. Conversely, Beta oscillations serve as a critical mechanism for the executive control of movement, working memory maintenance, and the “stopping” of actions or unwanted thoughts within the fronto-basal ganglia networks [6].

2.2. Transcranial Direct Current Stimulation (tDCS) in Cognitive Control

Modulation of the dorsolateral prefrontal cortex (DLPFC) and ventromedial prefrontal cortex (vmPFC) via tDCS has shown promising results in altering cognitive and emotional pathways. Studies using multi-electrode tDCS (ME-tDCS) targeting the left and right DLPFC have demonstrated differential impacts on the neural circuitry of verbal working memory, primarily by modulating local Alpha-band responses [7].
In clinical populations, the efficacy of prefrontal tDCS has been extensively investigated across various disorders. Anodal tDCS over the left DLPFC paired with cathodal stimulation of the right vmPFC has significantly improved emotion regulation and pre-potent inhibitory control in children with ADHD [8,9]. Similar bilateral prefrontal tDCS protocols have effectively enhanced cognitive emotion regulation and readiness for treatment in individuals with substance use disorders (SUD) during the abstinence phase [10]. Moreover, the scope of tDCS applications extends to complex motor-cognitive impairments; recent study protocols emphasize its potential to reduce dual-task interference and improve physical and cognitive performance in women suffering from fibromyalgia [11].
Furthermore, single-session tDCS has shown promise in modulating EEG microstates associated with anxiety in depressive populations [12].

3. System Architecture and Technical Implementation

3.1. Rationale for Custom Software Design

Current studies predominantly rely on offline analyses using fragmented software pipelines, like MATLAB and EEGLAB, alongside open-loop proprietary stimulators. To contextualize the need for our proposed application, we systematically extracted data from recent neuromodulation studies. As illustrated in Figure 1A,B, the predominant neurophysiological markers investigated for cognitive domains (Working Memory, Attention, Emotion Regulation) are Alpha and Beta band powers. Furthermore, a review of system integration tools (Figure 1C) reveals a heavy reliance on offline processing and proprietary stimulators, highlighting the lack of unified closed-loop platforms.

3.2. Closed-Loop Architecture

To overcome the limitations of proprietary clinical software, we developed a custom, cost-effective closed-loop neuromodulation framework. The data flow begins with the Starstim 32 cap, which records raw EEG data and transmits it locally via the Neuroelectrics Instrument Controller (NIC2) software using the Lab Streaming Layer (LSL) protocol. A custom Python backend intercepts this LSL stream, processing the signal to extract Alpha power. It a deterministic fini-state machine to the optimal onset based on individualized thresholds of the individual’s EEG.
Once a stimulation decision is made, a Robotic Process Automation (RPA) module takes over the host machine’s cursor to physically manipulate the NIC2 graphical user interface, triggering the tDCS lDFPC protocols (a. F3 anode, F4 cathode, 400 µA; b. F3 anode, AF3, F7, FC1, FC3 return 400 µA). The RPA module leverages OpenCV to perform template matching, scanning the screen for specific graphical elements with an 85% grayscale confidence threshold. Concurrently, a cross-platform Flutter application communicates with the Python backend via a FastAPI REST interface, allowing researchers to monitor the experiment in real-time on a tablet.

4. Experimental Methodology

To evaluate the operational feasibility of the proposed EEG-tDCS closed-loop software framework, we conducted a single-participant pilot session (n = 1). The participant engaged in a mental arithmetic task. During the pre-stimulation phase, continuous EEG data were recorded at a sampling rate of 500 Hz. The incoming Lab Streaming Layer (LSL) data stream was buffered into 4-s sliding windows (2000 samples) within the Python backend. Real-time preprocessing included a 1–40 Hz band-pass filter and a 50 Hz notch filter to eliminate powerline noise. The Power Spectral Density (PSD) was continuously extracted using Welch’s method, implemented via the SciPy signal processing library in Python. Based on real-time deviations from this baseline-defined Alpha threshold, the Python backend automatically commanded the RPA module to select and initiate tDCS protocol.

5. Results and Discussion

The primary outcome of this study is the successful deployment and operation of the custom software application and the closed-loop architecture. The system maintained stable EEG acquisition, processed the signal in real time, and automatically triggered stimulation via the NIC2 interface without manual intervention.

5.1. Application and User Interface

The Flutter-based frontend, NeuroControl Pro, proved highly effective for real-time clinical monitoring (Figure 2). It successfully plotted Alpha power metrics against the dynamic threshold and allowed seamless communication with the RPA backend.

5.2. Closed-Loop Operation and Target Thresholds

During the baseline calibration, the system calculated a personalized Alpha power threshold of 0.297. This threshold was derived mathematically from a baseline mean of 0.427 and a standard deviation of 0.130. These precise values were computed by aggregating the Alpha band power from consecutive 1-s EEG epochs (extracted via Welch’s method on 4-s sliding windows) collected continuously over a 5-min resting baseline period prior to the cognitive task.
During the mental arithmetic task, the system continuously monitored incoming EEG features, plotting real-time Alpha power against a dynamically calculated threshold on the application’s dashboard. As depicted in the NeuroControl Pro interface, the RPA module successfully triggered the tDCS stimulation protocol 2 times during the session, precisely when the signal dropped below the individualized threshold. This demonstrates that the system can function as an accurate, state-dependent intervention mechanism, autonomously applying the mathematical baseline to maintain cognitive stability.

5.3. EEG Spectral Analysis (Pre vs. Post Stimulation)

To evaluate the neurophysiological impact, we compared the Power Spectral Density (PSD) before and after the closed-loop sessions. Pre-stimulation EEG analysis revealed a measurable alpha-band distribution across the scalp, with topographic visualization showing predominantly frontal alpha activity. Following the closed-loop tDCS intervention, a noticeable decrease in this frontal alpha power was observed (Figure 3). This post-stimulation attenuation in the alpha band may be associated with stronger cognitive engagement and an increased allocation of neural resources required to sustain performance during the executive-demanding mental arithmetic task.
While a single-session pilot limits broad neurophysiological interpretations, the data confirm that the software stack successfully captured, logged, and reacted to oscillatory features relevant to the task.

6. Conclusions

This study presented a proof-of-concept implementation of a real-time EEG-tDCS closed-loop software system. By integrating EEG acquisition, real-time Python-based signal processing, and automated stimulation control via RPA, the proposed framework successfully demonstrated end-to-end functionality. While the software architecture is designed to process multiple frequency bands, this pilot session specifically utilized alpha-band EEG activity to guide the automated stimulation decisions targeting prefrontal regions associated with executive control.
By eliminating the need for expensive, proprietary SDKs through the use of Computer Vision and RPA, this architecture significantly lowers the barrier to entry for state-dependent neuromodulation research. Future research will focus on validating the framework in larger cohorts, extending the closed-loop triggers to include frequency-specific EEG microstates, and improving real-time ocular artifact rejection. Overall, this work supports the development of accessible, real-time closed-loop applications for cognitive enhancement.

Author Contributions

Conceptualization, A.A., M.-E.S., M.I.T. and O.A.S.; methodology, A.A. and M.I.T.; software, M.-E.S. and O.A.S.; validation, A.A., M.-E.S., M.I.T. and O.A.S.; formal analysis, A.A. and M.-E.S.; investigation, A.A. and M.-E.S.; resources, M.I.T. and O.A.S.; data curation, A.A.; writing—original draft preparation, A.A. and M.-E.S.; writing—review and editing, M.I.T. and O.A.S.; visualization, M.-E.S.; supervision, M.I.T. and O.A.S.; project administration, A.A.; funding acquisition, O.A.S., M.I.T. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The data presented in this study are available on request from the authors.

Acknowledgments

The authors would like to thank the NeuroLab for providing access to the Neuroelectrics Starstim 32 hardware and the necessary technical environment for the pilot study. During the preparation of this manuscript, the authors used Large Language Models (LLMs) including Claude 3.5 Sonnet and Google Gemini 3.1 Pro for the purposes of language polishing, academic formatting, and the generation of React-based visualization code for system architecture diagrams. The authors have reviewed and edited the output and take full responsibility for the content of this publication.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript: ADHD Attention-Deficit/Hyperactivity Disorder, DLPFC Dorsolateral Prefrontal Cortex, DMPFC Dorsomedial Prefrontal Cortex, EEG Electroencephalography, EF Executive Functions, FSM Finite State Machine, HD-tDCS High-DefinitionTranscranial Direct Current Stimulation, LSL Lab Streaming Layer, NIBS Non-Invasive BrainStimulation, PFC Prefrontal Cortex, PSD Power Spectral Density, REST Representational State Transfer, RPA Robotic Process Automation, SDK Software Development Kit, SUD Substance Use Disorder, tDCS Transcranial Direct Current Stimulation, vmPFC Ventromedial Prefrontal Cortex.

References

  1. Dong, Y.; Wei, J.; Peng, S.; Wu, X.; Xu, Y.; Feng, J.; Zhang, J.; Jirsa, V.; Xiang, J. Effects of tDCS of the DLPFC on brain networks: A hybrid brain modeling study. PLoS Comput. Biol. 2025, 21, e1013486. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Zhou, Y.; Liu, P.; Chen, F.; Chen, L. The changes of EEG microstate maps in response to high-definition transcranial direct current stimulation. Cogn. Affect. Behav. Neurosci. 2025, 25, 1–10. [Google Scholar] [CrossRef] [Scilit]
  3. Friedman, N.P.; Robbins, T.W. The role of prefrontal cortex in cognitive control and executive function. Neuropsychopharmacology 2022, 47, 72–89. [Google Scholar] [PubMed]
  4. Willis, D.A. The Relationship of Executive Function and Alpha Band Activity During the Eriksen Flanker Task: An EEG Study. Master’s Thesis, University of South Carolina, Aiken, SC, USA, 2020. [Google Scholar]
  5. She, H.-C.; Jung, T.-P.; Chou, W.-C.; Huang, L.-Y.; Wang, C.-Y.; Lin, G.-Y. EEG Dynamics Reflect the Distinct Cognitive Process of Optic Problem Solving. PLoS ONE 2012, 7, e40731. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Schmidt, R.; Herrojo Ruiz, M.; Kilavik, B.E.; Lundqvist, M.; Starr, P.A.; Aron, A.R. Beta Oscillations in Working Memory, Executive Control of Movement and Thought, and Sensorimotor Function. J. Neurosci. 2019, 39, 8231–8238. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Koshy, S.M.; Wiesman, A.I.; Spooner, R.K.; Embury, C.; Rezich, M.T.; Heinrichs-Graham, E.; Wilson, T.W. Multielectrode Transcranial Electrical Stimulation of the Left and Right Prefrontal Cortices Differentially Impacts Verbal Working Memory Neural Circuitry. Cereb. Cortex 2020, 30, 2389–2400. [Google Scholar] [PubMed]
  8. Estaji, R.; Hosseinzadeh, M.; Arabgol, F.; Nejati, V. Transcranial direct current stimulation (tDCS) improves emotion regulation in children with attention-deficit hyperactivity disorder (ADHD). Sci. Rep. 2024, 14, 13889. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Férat, V.; Deiber, M.-P.; Hasler, R.; Michela, A.; Michel, C.M.; Perroud, N.; Ros, T. Microstate-based Neurofeedback in Attention Deficit Hyperactivity Disorder Population: A Randomized Controlled Crossover Trial. Brain Topogr. 2026, 39, 6. [Google Scholar]
  10. Salmani, A.; Basharpoor, S.; Vaziri, Z.; Salehinejad, M.A. Repeated prefrontal tDCS improves cognitive emotion regulation and readiness for treatment in substance use disorder: A randomized sham-controlled study. Addict. Behav. Rep. 2025, 21, 100614. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. Gomez-Alvaro, M.C.; Villafaina, S.; Leon-Llamas, J.L.; Murillo-Garcia, A.; Melo-Alonso, M.; Sánchez-Gómez, J.; Molero, P.; Cano-Plasencia, R.; Gusi, N. Effects of Transcranial Direct Current Stimulation on Brain Electrical Activity, Heart Rate Variability, and Dual-Task Performance in Healthy and Fibromyalgia Women: A Study Protocol. Behav. Sci. 2022, 12, 37. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  12. Nishida, K.; Minami, S.; Yamane, T.; Ueda, S.; Tsukuda, B.; Ikeda, S.; Haruna, D.; Yoshimura, M.; Kanazawa, T.; Koenig, T. A Single Session of tDCS Stimulation Can Modulate an EEG Microstate Associated With Anxiety in Patients With Depression. Brain Behav. 2025, 15, e70580. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Figure 1. Bibliometric analysis of recent tDCS studies highlighting: (A) most targeted brain regions, (B) frequently evaluated cognitive domains, and (C) prevalence of analytical and control tools, emphasizing the gap in unified closed-loop software.
Figure 1. Bibliometric analysis of recent tDCS studies highlighting: (A) most targeted brain regions, (B) frequently evaluated cognitive domains, and (C) prevalence of analytical and control tools, emphasizing the gap in unified closed-loop software.
Engproc 148 00026 g001
Figure 2. (Left) The NeuroControl Pro application interface displays real-time EEG metrics and automated tDCS triggers. (Right) Participant during the pilot session wearing the Starstim 32 EEG cap.
Figure 2. (Left) The NeuroControl Pro application interface displays real-time EEG metrics and automated tDCS triggers. (Right) Participant during the pilot session wearing the Starstim 32 EEG cap.
Engproc 148 00026 g002
Figure 3. Power Spectral Density (PSD) plot comparing pre-stimulation and post-stimulation EEG activity, averaged across the targeted left fronto-central electrodes (Fp1, F3, F7, Fz, C3). The graph illustrates a visible decrease in overall alpha power (8–13 Hz) during the post-stimulation phase, reflecting heightened task engagement following repeated targeted stimulation.
Figure 3. Power Spectral Density (PSD) plot comparing pre-stimulation and post-stimulation EEG activity, averaged across the targeted left fronto-central electrodes (Fp1, F3, F7, Fz, C3). The graph illustrates a visible decrease in overall alpha power (8–13 Hz) during the post-stimulation phase, reflecting heightened task engagement following repeated targeted stimulation.
Engproc 148 00026 g003
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Apopii, A.; Spiță, M.-E.; Tomescu, M.I.; Schipor, O.A. Real-Time Modulation of Prefrontal Activity via Automated EEG-tDCS Closed-Loop Interventions: A Feasibility Study. Eng. Proc. 2026, 148, 26. https://doi.org/10.3390/engproc2026148026

AMA Style

Apopii A, Spiță M-E, Tomescu MI, Schipor OA. Real-Time Modulation of Prefrontal Activity via Automated EEG-tDCS Closed-Loop Interventions: A Feasibility Study. Engineering Proceedings. 2026; 148(1):26. https://doi.org/10.3390/engproc2026148026

Chicago/Turabian Style

Apopii, Ariana, Mihai-Emanuel Spiță, Miralena I. Tomescu, and Ovidiu Andrei Schipor. 2026. "Real-Time Modulation of Prefrontal Activity via Automated EEG-tDCS Closed-Loop Interventions: A Feasibility Study" Engineering Proceedings 148, no. 1: 26. https://doi.org/10.3390/engproc2026148026

APA Style

Apopii, A., Spiță, M.-E., Tomescu, M. I., & Schipor, O. A. (2026). Real-Time Modulation of Prefrontal Activity via Automated EEG-tDCS Closed-Loop Interventions: A Feasibility Study. Engineering Proceedings, 148(1), 26. https://doi.org/10.3390/engproc2026148026

Article Metrics

Back to TopTop