Adaptive closed-loop neuromodulation method and system based on large language model
By employing an adaptive closed-loop neuromodulation method based on a large language model, EEG signals are acquired and encoded in real time. Combined with a case database and medical safety constraints, hierarchical adaptive modulation is achieved, solving the instability and cold start problems of existing neuromodulation technologies and improving the accuracy and safety of modulation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF AUTOMATION CHINESE ACAD OF SCI
- Filing Date
- 2026-04-16
- Publication Date
- 2026-07-14
AI Technical Summary
Existing non-invasive neuromodulation systems cannot dynamically adjust according to the user's real-time EEG state, resulting in unstable stimulation effects, poor individual adaptability, lack of physiological signal and high-level semantic mapping mechanism, difficulty in achieving precise neuromodulation, lack of historical successful case reuse mechanism, cold start problem, and low level of adaptability and intelligence.
An adaptive closed-loop neuromodulation method based on a large language model is adopted. By acquiring EEG signals in real time, extracting multidimensional features and encoding them into structured state semantic descriptions, and combining case databases and medical safety constraints, a guided generative artificial intelligence model is constructed to achieve hierarchical adaptive modulation. The inner loop tracks the target EEG features in real time, while the outer loop updates the case knowledge base and optimizes stimulation parameters.
It improves the accuracy and individual adaptability of neural modulation, solves the cold start problem for new users, balances real-time stability and long-term optimization capabilities, and enhances the reliability and security of modulation.
Smart Images

Figure CN122392801A_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of brain-computer interface and neuromodulation technology, specifically involving an adaptive closed-loop neuromodulation method and system based on a large language model. Background Technology
[0002] Non-invasive neuromodulation (tES) often uses fixed stimulation parameters, which cannot be dynamically adjusted according to the user's real-time EEG state, easily leading to problems such as unstable stimulation effects and poor individual adaptability. Most tES systems rely on a single EEG feature for state assessment, making it difficult to comprehensively characterize real physiological states such as anxiety, fatigue, and cognitive arousal from multiple dimensions such as neural arousal, brain region coordination, and signal complexity. This results in one-sided modulation criteria and low precision of neural modulation.
[0003] Furthermore, existing solutions lack a mapping mechanism between physiological signals and high-level semantics, making it impossible to convert multidimensional EEG features into interpretable physiological state descriptions. This makes it difficult to interact effectively with intelligent models, and the decision-making path during neural modulation is opaque, prone to hallucinations, and the basis for parameter settings is untraceable.
[0004] Furthermore, existing solutions generally lack mechanisms for reusing historically successful cases, resulting in significant cold start issues in new user scenarios and making it difficult to quickly optimize the control effects.
[0005] Existing closed-loop control solutions are mostly single-level real-time feedback, lacking long-term iteration and knowledge base evolution capabilities. They cannot continuously optimize control strategies by combining physiological improvement effects and subjective experience, making it difficult to balance safety and effectiveness. Overall, their intelligence and adaptability are low, limiting their application in scenarios such as emotion regulation and cognitive enhancement. Summary of the Invention
[0006] One of the purposes of this disclosure is to provide an adaptive closed-loop neuromodulation method that can improve the accuracy of neuromodulation.
[0007] According to a first aspect of this disclosure, an adaptive closed-loop neural modulation method based on a large language model includes: real-time acquisition of the current user's electroencephalogram (EEG) signal and extraction of multidimensional features representing the neurophysiological state; encoding the multidimensional features into a structured state semantic description based on a preset mapping rule; constructing prompt words to guide the reasoning of a generative artificial intelligence model using the structured state semantic description; inputting the prompt words into the generative artificial intelligence model and obtaining neural modulation instructions containing stimulation parameters and target EEG features through reasoning; and performing closed-loop control with stimulation parameters as initial operating parameters, target EEG features as reference values, and real-time feedback multidimensional features as feedback values to drive the neural stimulation device to output physical stimulation signals.
[0008] The multidimensional features are encoded into structured state semantic descriptions based on preset mapping rules, including: converting multidimensional features into structured state semantic descriptions using preset expert rule templates, wherein the expert rule templates define preset logical mapping relationships, which are used to parse the numerical range or statistical characteristics of multidimensional features into corresponding physiological state semantic labels.
[0009] The multidimensional features are converted into a structured state semantic description using a preset expert rule template, including: comparing at least one of the multidimensional features with a preset threshold range; and mapping at least one of the features into a structured state semantic description based on the comparison results.
[0010] The multidimensional features include at least one of physiological index features, nonlinear dynamic features, and brain network connectivity features. The physiological index features include at least one of anxiety index features and mental fatigue index features calculated using the frequency domain features of EEG signals. The nonlinear dynamic features include differential entropy. The brain network connectivity features include phase lock value.
[0011] Using structured state semantic descriptions, the prompts for guiding generative AI model reasoning are constructed by: using structured state semantic descriptions, a pre-built case database, and medical safety constraints to construct a compound prompt context for guiding generative AI model reasoning.
[0012] By utilizing structured state semantic descriptions, a pre-built case database, and medical safety constraints, a composite prompt context is constructed to guide the reasoning of generative artificial intelligence models. This involves: converting the structured state semantic descriptions into query vectors; using the query vectors to query historical successful cases in a pre-built vector database that serves as the case database; and combining the structured state semantic descriptions, historical successful cases, and medical safety constraints to construct a composite prompt context.
[0013] The query vector is used to search for historical successful cases in a pre-established vector database that serves as a case database. This includes: calculating the similarity between the query vector and the feature vectors of each historical case in the vector database; and filtering out historical successful cases with a similarity greater than a preset threshold and matching the corresponding user physiological indicator dimensions.
[0014] The adaptive closed-loop neural modulation method also includes: updating the case database based on the improvement rate of physiological indicators corresponding to multidimensional features in a second preset period that is longer than the first preset period, and re-inferring and optimizing the stimulation parameters through a generative artificial intelligence model in the next modulation period to achieve hierarchical adaptive modulation. The first preset period is the inner loop control period, the second preset period is the outer loop control period, and the outer loop control period is greater than or equal to five times the inner loop control period.
[0015] The case database is updated based on the improvement rate of physiological indicators corresponding to the multidimensional features, including: obtaining the real-time multidimensional features fed back within the second preset period, calculating the improvement rate of physiological indicators based on the real-time multidimensional features; obtaining the subjective rating of the current user; constructing new cases using the improvement rate of physiological indicators and subjective ratings, and storing the new cases in the case database.
[0016] According to a second aspect of this disclosure, an adaptive closed-loop neural modulation system based on a large language model includes: an EEG acquisition and feature extraction module for real-time acquisition of the current user's EEG signals and extraction of multidimensional features representing the neurophysiological state; a semantic encoding module for encoding the multidimensional features extracted by the EEG acquisition and feature extraction module into a structured state semantic description based on a preset mapping rule; a cue word construction module for constructing cue words to guide the reasoning of a generative artificial intelligence model using the structured state semantic description output by the semantic encoding module; a strategy generation module, integrating a generative artificial intelligence model, for receiving the cue words output by the cue word construction module and obtaining neural modulation instructions containing stimulation parameters and target EEG features through reasoning; an inner-loop control module for performing closed-loop control to output a driving signal using the stimulation parameters output by the strategy generation module as initial operating parameters, the target EEG features as reference values, and the multidimensional features fed back in real-time by the EEG acquisition and feature extraction module as feedback values; and a neural stimulation device for receiving the driving signal output by the inner-loop control module and outputting a corresponding physical stimulation signal to the current user.
[0017] The adaptive closed-loop neural modulation method according to at least one embodiment of the present disclosure can solve the technical problems of opaque decision paths and high hallucination rates during neural modulation. Attached Figure Description
[0018] The above and other objects and features of exemplary embodiments of this disclosure will become clearer from the following description taken in conjunction with the accompanying drawings, which exemplarily illustrate the embodiments, wherein: Figure 1 This is a flowchart of an adaptive closed-loop neural modulation method according to at least one embodiment of the present disclosure; Figure 2 A diagram illustrating a multidimensional spatiotemporal feature extraction and semantic mapping architecture according to at least one embodiment of the present disclosure is shown. Figure 3 A schematic diagram illustrating agent reasoning and policy generation based on retrieval-enhanced generation (RAG) according to at least one embodiment of the present disclosure is shown. Figure 4 This is an overall architecture diagram of an adaptive closed-loop neural modulation method according to at least one embodiment of the present disclosure; Figure 5 A dual closed-loop mechanism for "fast-slow" coordination according to at least one embodiment of the present disclosure is illustrated; Figure 6 A block diagram of an adaptive closed-loop neural modulation system according to at least one embodiment of the present disclosure is shown. Detailed Implementation
[0019] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings, examples of which are illustrated in the drawings, wherein the same reference numerals always refer to the same parts. The embodiments will now be described with reference to the accompanying drawings in order to explain this disclosure.
[0020] The following detailed description is provided to aid in obtaining a full understanding of the methods, apparatus, and / or systems described herein. However, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein; equivalent substitutions or changes may be made, except for operations that must occur or be performed in a specific order. Furthermore, for clarity and conciseness, descriptions of content well-known in the art will be omitted or simplified.
[0021] Unless otherwise specified, the same reference numerals generally refer to the same elements (e.g., components, steps, and methods). Reference numerals described in previous embodiments that reappear in later embodiments may be omitted. Furthermore, technical features described in different or the same embodiments can be combined in any way, as long as the combined embodiment or technical solution is complete and can solve the technical problems of this application or achieve the technical effects described or not described in this disclosure but which can be determined based on the complete technical solution described above.
[0022] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains upon understanding this disclosure. Unless expressly defined herein, terms (such as those defined in a general dictionary) shall be interpreted as having a meaning consistent with their meaning in the context of the relevant field and in this disclosure, and shall not be interpreted in an idealized or overly formalistic manner.
[0023] Non-invasive neuromodulation (tES) is an external intervention technique that modulates the neural activity of the cerebral cortex by applying weak electrical signals to the scalp. It requires no implanted electrodes and is characterized by safety, non-invasiveness, ease of operation, and minimal side effects. Typical tES techniques include transcranial alternating current stimulation (tACS), transcranial direct current stimulation (tDCS), and transcranial random noise stimulation (tRNS). By using specific waveforms, frequencies, intensities, and electrode arrangements, it can directionally modulate the excitability of neurons and the synchronicity of brain networks in target brain regions, altering the energy distribution and oscillation characteristics of brain electrical frequencies. Non-invasive neuromodulation is widely used in cognitive enhancement, mood regulation, fatigue relief, and neurorehabilitation, enabling external regulation of neuropsychological states such as anxiety, attention, and alertness without damaging brain tissue. The adaptive closed-loop neuromodulation method disclosed herein can be applied to non-invasive neuromodulation (tES) systems, but this disclosure is not limited thereto.
[0024] This disclosure can construct a multi-dimensional EEG feature representation and semantic mapping system. By extracting physiological indicator features, nonlinear dynamic features and brain network connectivity features, it can achieve comprehensive quantification of neural states such as anxiety, fatigue, and brain region synergy, and transform numerical features into structured semantic descriptions according to expert rules.
[0025] This disclosure combines user state semantic descriptions, historical success cases, and medical safety constraints to construct composite prompt words. Personalized stimulus parameters are output through chain-like reasoning using a Large Language Model (LLM), solving the cold start problem for new users. Furthermore, by incorporating medical safety constraints, the reliability of regulation is improved, enhancing individual adaptability and the scientific basis of decision-making compared to fixed-parameter models.
[0026] This disclosure employs an adaptive closed-loop control architecture with internal and external dual-layer coordination. The inner loop uses short-cycle real-time PID to track the target EEG characteristics, offsetting physiological fluctuations to achieve precise stimulation. The outer loop uses long-cycle updates to the case knowledge base based on physiological improvement rates and subjective scores, driving model iteration to optimize parameters. This balances real-time stability and long-term evolutionary capability, forming a closed-loop system capable of lifelong learning. This overcomes the technical shortcomings of traditional closed-loop systems, such as insufficient adaptation and inability to continuously iterate and optimize. The adaptive closed-loop neuromodulation method of this disclosure may include at least one of the above three improvements. Embodiments of this disclosure are described in detail below with reference to the accompanying drawings.
[0027] Figure 1 This is a flowchart of an adaptive closed-loop neural modulation method according to at least one embodiment of the present disclosure; Figure 2 A diagram illustrating a multidimensional spatiotemporal feature extraction and semantic mapping architecture according to at least one embodiment of the present disclosure is shown. Figure 3 A schematic diagram illustrating agent reasoning and policy generation based on retrieval-enhanced generation (RAG) according to at least one embodiment of the present disclosure is shown. Figure 4This is an overall architecture diagram of an adaptive closed-loop neural modulation method according to at least one embodiment of the present disclosure; Figure 5 A dual closed-loop mechanism for "fast-slow" coordination according to at least one embodiment of the present disclosure is illustrated; Figure 6 A block diagram of an adaptive closed-loop neural modulation system according to at least one embodiment of the present disclosure is shown.
[0028] Reference Figure 1 The adaptive closed-loop neural modulation method according to at least one embodiment of the present disclosure may include steps S100, S200, S300, S400 and S500.
[0029] In step S100, EEG signals are acquired and multidimensional features are extracted.
[0030] As an example, the EEG signals of the current user can be collected in real time, and multidimensional features representing the neurophysiological state can be extracted.
[0031] It can acquire multi-channel EEG signals from the current user. During acquisition, conductive gel can be used to reduce the contact impedance between the scalp and electrodes to below a preset impedance. As an example, the raw multi-channel EEG signals can be captured by a high-sampling-rate EEG amplifier, converting weak cortical potentials into digital sequences. The acquired signals can also be preprocessed; for example, a 50Hz notch filter can be applied first to eliminate power frequency interference, and then a bandpass filter from 0.5 to 50Hz can be used to retain the effective physiological frequency band.
[0032] Reference Figure 2 Furthermore, artifacts such as eye movement, electrocardiogram, and electromyography can be identified and removed using independent component analysis (ICA). After rereference processing, multi-channel time-series signals are obtained. These signals can be divided into fixed-length time windows, which is beneficial for subsequent feature calculations.
[0033] It should be noted that the "real-time acquisition of the current user's EEG signal" described above may include the acquisition of raw EEG signals, or it may include the acquisition of EEG signals and subsequent preprocessing steps.
[0034] Multidimensional features (i.e., multidimensional EEG features) may include at least one of physiological index features, nonlinear dynamic features, and brain network connectivity features. As an example, multidimensional features may include at least two of physiological index features, nonlinear dynamic features, and brain network connectivity features; for example, multidimensional features may include all of physiological index features, nonlinear dynamic features, and brain network connectivity features.
[0035] The analysis of physiological indicators is mainly based on the power spectral density analysis of electroencephalogram (EEG) signals, which quantifies the energy distribution within a specific frequency range by converting time-domain waveforms to the frequency domain. The energy proportions of frequency bands such as Delta, Theta, Alpha, and Beta reflect the brain's arousal level and cognitive load. For example, the anxiety index assesses cortical hyperexcitability by calculating the ratio of high-frequency Beta waves to low-frequency Alpha waves; the mental fatigue index measures the degree of decline in an individual's alertness during prolonged tasks by calculating the energy relationship between low-frequency and high-frequency bands.
[0036] Analysis of nonlinear dynamic characteristics can reveal the nonlinear evolutionary patterns inherent in electroencephalogram (EEG) signals. In practical extraction, common methods include calculating indicators such as sample entropy, permutation entropy, and differential entropy to quantify the nonlinear dynamic changes of EEG signals. EEG signals are not simple linear superpositions but rather products of a highly irregular and dynamically changing nonlinear system. Differential entropy quantifies the logarithmic expectation of the signal's probability density function. For example, by performing logarithmic operations on the variance and combining this with constant term processing, it is possible to capture minute nonlinear fluctuations that are difficult to detect in time-domain analysis, thus characterizing the brain's nonlinear processing capabilities and state stability when processing complex information.
[0037] Analyzing brain network connectivity features can assess the spatial interactions and functional coupling between different brain regions. A core computational indicator of brain network connectivity features may include the phase-lock value. This feature extracts the instantaneous phase of multi-channel EEG signals using Hilbert transform and calculates the stability of the phase difference between two signals within a specific time window. The magnitude of the phase-lock value reflects the degree of synchronization of neuronal clusters in long-distance communication; for example, the synchronicity of the left and right hemispheres of the frontal lobe is closely related to emotion regulation and logical thinking. Through this analysis, the topological structure of brain functional networks can be constructed, revealing how brain regions integrate information through phase coupling.
[0038] Reference Figure 2 Physiological indicators can include anxiety index (AI) and mental fatigue index (MFI). Specifically, the power spectral density (PSD) can be calculated using the Welch periodogram method, and key frequency band energy integrals can be defined: Delta (1-4Hz), Theta (4-8Hz), Alpha (8-13Hz), and Beta (13-30Hz), and physiological indicators can be constructed based on this.
[0039] The Anxiety Index (AI) can be calculated using the following formula (1): (1) in, This refers to Beta wave energy. It refers to Alpha wave energy.
[0040] The Mental Fatigue Index (MFI) can be calculated using the following formula (2): (2) in, It refers to Beta wave energy.
[0041] In addition to anxiety index and mental fatigue index, physiological indicators may also include focus / attention index, etc.
[0042] Nonlinear dynamic characteristics may include differential entropy (DE). Specifically, it is assumed that the signal segment of a particular sampling channel i follows a Gaussian distribution. Differential quotient It can be calculated using the following formula (3): (3) in, Let be the signal variance within the time window, and e be the natural constant.
[0043] As mentioned above, in addition to differential entropy, nonlinear dynamic characteristics may also include sample entropy, etc.
[0044] Brain network connectivity features may include phase lock value (PLV). Specifically, the phase lock value can be calculated by measuring the phase lock value between the left and right hemisphere channels of the frontal lobe (e.g., F3-F4) to assess the degree of brain region coordination, which can be calculated by the following equation (4).
[0045] (4) Where N is the number of sampling points, The instantaneous phase after the Hilbert transform is given. The PLV value range is [0,1]. The lower the PLV value, the worse the coordination.
[0046] In addition to phase-locked value (PLV), brain network connectivity features may also include effective connectivity features, etc.
[0047] Reference Figure 2 After extracting multidimensional features, these features can be fused. For example, feature concatenation can be used to fuse multidimensional features, or feature cascading (e.g., weighted concatenation) and spatial transformations (e.g., dimensionality reduction projection) can be used to eliminate dimensional differences and suppress data redundancy. However, this disclosure is not limited thereto.
[0048] In step S200, multidimensional feature semantic encoding is performed. Multidimensional features can be encoded into a structured state semantic description based on preset mapping rules.
[0049] For example, a pre-defined expert rule template can be used to convert multidimensional features into a structured state semantic description. The expert rule template can define a pre-defined logical mapping relationship to parse the numerical range or statistical characteristics of multidimensional features into corresponding physiological state semantic labels.
[0050] As an example, by setting a fine threshold, continuously fluctuating physical values can be mapped to discrete state labels such as "normal", "mildly abnormal" or "significantly deviated", thus completing the transformation from electrical signal measurement to qualitative description of physiological state.
[0051] Specifically, refer to Figure 2 It can use pre-set expert rule templates to transform the numerical matrix corresponding to multi-dimensional features (corresponding to multi-channel features) into structured prompts that can be understood by the Large Language Model (LLM).
[0052] The specific steps for converting multidimensional features into structured state semantic descriptions using a preset expert rule template may include: comparing the multidimensional features (e.g., at least one of physiological indicator features, linear non-dynamic features, and brain network connectivity features) with a preset threshold range; and then mapping at least one of them to a semantic description of the neurophysiological state based on the comparison results.
[0053] Specifically, the discretized state labels are automatically populated into a pre-defined structured text framework. For each feature dimension in the multidimensional features, a specialized descriptive lexicon can be invoked to generate specialized text. For example, for physiological indicator features, it can be transformed into a semantic description such as "abnormally elevated Beta wave energy ratio"; for nonlinear dynamic features, it can be mapped to semantics such as "high level of complexity" reflecting cognitive load; for brain network connectivity features, it can be mapped to semantic descriptions such as "channel-to-channel phase synchronization mismatch". The text from each dimension can be integrated into a complete structured Prompt text. In addition, when multidimensional features are fused, the fused features can be mapped or transformed.
[0054] In step S300, a cue word is constructed, which can be constructed using a structured semantic description. This cue word can be a contextual cue word, but this disclosure is not limited to this. When a cue word has context, the context can be derived from a pre-built case database and / or medical safety constraints. It should be noted that even without historical cases, reasoning can still be performed solely based on general medical knowledge within the LLM or the LLM smart body (e.g., "Alpha wave enhancement helps relaxation"). As an example, the context can also be derived from the user's real-time subjective feedback (e.g., the user reports feeling a tingling sensation).
[0055] Preferably, a complex cue word context can be constructed to guide the reasoning of generative artificial intelligence models by utilizing structured state semantic descriptions, pre-built case databases, and medical safety constraints.
[0056] As an example, based on a structured state semantic description, qualitative labels of the current user's multidimensional features (e.g., "high cortical arousal" or "reduced coherence in the left frontal lobe") can be used as real-time contextual information input to ensure that the artificial intelligence model can accurately identify the current individual's electrophysiological "pathological state".
[0057] Additionally, similarity retrieval (e.g., vector similarity retrieval) can be used to retrieve successful closed-loop solutions that highly match the current state from a case database as a reference context.
[0058] Specifically, refer to Figure 3 The steps for constructing a compound cue word context to guide generative artificial intelligence model reasoning, using structured state semantic descriptions and a pre-built case database and medical safety constraints, may include: converting the structured state semantic descriptions into query vectors. V q ; Use query vectors to query historical successful cases (e.g., Top-K similar cases) in a pre-established vector database that serves as a case database; combine structured state semantic descriptions, historical successful cases, and medical safety constraints to construct a compound prompt word context.
[0059] Specifically, refer to Figure 3 After vectorizing the current user's structured semantic tags and features, and then transforming them (e.g., through Transformer's Embedding encoding) into query vectors in a high-dimensional space, algorithms such as cosine similarity can be used to search the case database (e.g., global search) to filter out successful historical records that are closest in Euclidean distance and most similar in physiological and pathological features.
[0060] Specific steps may include: calculating the similarity between the query vector and the feature vectors of each historical case in the vector database; filtering out historical successful cases with similarity scores greater than a preset threshold and corresponding user physiological indicator dimensions that match. In addition to retaining a candidate set (Top-K candidate cases or similar cases) with similarity scores higher than the preset threshold to ensure statistical relevance, consistency verification can also be performed on specific user physiological indicator dimensions (e.g., specific frequency ranges or specific brain connectivity pathways). Only when the pathological dimension of a historical case highly overlaps with the abnormality points of the current subject, and the case is marked as "successful treatment" or "good outcome," will the record be finally extracted. In other words, the search results can include not only previous closed-loop control strategies (e.g., combinations of stimulation waveforms, frequencies, and amplitudes) but also corresponding effect evaluations.
[0061] The structured state semantic description, historical stimulus parameters and regulatory effect evaluations from selected historical success cases, and preset medical safety rules from medical safety constraints can be assembled according to preset prompt word templates to form a compound prompt word context.
[0062] Specifically, medical safety constraints can be embedded as a hard-limit context. These constraints may include stimulation current intensity thresholds, frequency limits, and contraindication protection logic (e.g., "maximum current not exceeding 2mA," "stimulation >10Hz is prohibited for those with a history of epilepsy"). The various preset medical safety rules within these constraints can originate primarily from external regulatory guidelines, user-specific profiles, and real-time physiological boundaries. Specifically, each medical safety rule within the constraints can stem from the user's current personalized medical background, including past medical history in electronic medical records, intracranial implant records, and contraindication screening, ensuring that the control plan avoids individual risk points; or from real-time monitoring risk feedback protocols, dynamically determining safety limits during the control process by setting abrupt triggers for physiological indicators (e.g., abnormal discharge interception).
[0063] In step S400, neural modulation instructions and target features (i.e., target EEG features) are generated. Prompt words can be input into a generative artificial intelligence model, and neural modulation instructions and target EEG features containing stimulus parameters are obtained through reasoning (e.g., chain-of-thought logical reasoning).
[0064] Reference Figure 3 and Figure 4 The constructed compound cue word context can be input into the generative AI model, which can then perform in-depth analysis using thought chain logic. Specifically, the generative AI model (or LLM agent) can analyze the structured physiological state of the current user (i.e., the subject), identify characteristic anomalies, such as Beta wave energy overload and low phase lock value (PLV), and then compare it with successful solutions in the case library, combining medical logic for analogy and correction. If historical cases show that stimulation at a certain frequency is effective, but the current user has insufficient synchronization, the model can deduce that it is necessary to increase the antiphase stimulation with a specific phase difference to enhance the coordination of bilateral brain regions. Generative AI models can invoke medical safety constraints to verify current intensity and duration, ensuring that all control recommendations are within preset safety limits, thus forming a rigorous intermediate thought process. The specific thought process can be as follows: "Analysis shows that the user's Beta wave is too high and PLV is low. Referring to Case A, 10Hz tACS is effective, but considering the user's low PLV, F3-F4 anti-phase stimulation should be added to enhance synchronicity. For safety, the initial current is set to 1.0mA."
[0065] During the decision-making phase, the above logical reasoning can be transformed into precise, standardized control instructions. These instructions are output in structured text form and may include the stimulus waveform (e.g., a sine wave or a DC wave), the target frequency, the electrode channel layout and phase difference, and strictly limited current intensity.
[0066] For example, it can output standard JSON format control commands, which may include: Waveform: stimulation waveform (e.g., tACS sine wave, tDCS DC wave, tRNS random noise); Frequency: target frequency; Montage: electrode channel combination and phase difference (e.g., F3 0°, F4 180°); Intensity: target current intensity. Simultaneously, the model can also provide target EEG characteristics, i.e., the expected regulatory feedback indicators (e.g., PLV needs to be increased above a specific threshold).
[0067] In step S500, an inner loop control circuit is constructed and a corresponding stimulation control signal is output.
[0068] Specifically, closed-loop control can be implemented using stimulation parameters as initial operating parameters, target EEG characteristics as reference values, and real-time feedback multidimensional characteristics as feedback values to drive the neurostimulation device to output physical stimulation signals.
[0069] Reference Figure 4 and Figure 5 During the stimulation control process, the system continuously collects the user's raw EEG signals and calculates multidimensional physiological characteristics in real time, which are then fed back as feedback values to the closed-loop control module (e.g., a PID control module). The control module can dynamically fine-tune the output stimulation physical signal by comparing the deviation between the feedback value and the reference target value, using proportional-integral-derivative (PID) control or similar methods.
[0070] For example, if real-time monitoring shows that the suppression level of Beta waves does not meet the expected target, the current intensity can be automatically compensated or the phase difference corrected according to a preset step size. This allows the stimulation device to output physical signals that precisely adapt to the user's physiological dynamic fluctuations, ensuring that the brain state always changes in the direction of the preset target characteristics.
[0071] Reference Figure 4 and Figure 5The system can update the case database based on the improvement rate of physiological indicators corresponding to multidimensional features in a second preset period, which is longer than the first preset period. In the next regulation period, the stimulation parameters are re-inferred and optimized using a generative artificial intelligence model to achieve hierarchical adaptive regulation. The first preset period is the inner loop control period, and the second preset period is the outer loop control period. The outer loop control period can be greater than or equal to five times the inner loop control period; for example, it can be five to ten times the inner loop control period. The inner loop control period is at the millimeter level; for example, it can be 1 to 10 milliseconds.
[0072] Reference Figure 5 The case database can be updated based on the improvement rate of physiological indicators corresponding to multidimensional features. Specifically, real-time multidimensional features fed back within a second preset period can be obtained, and the improvement rate of physiological indicators can be calculated based on these features. The subjective score of the current user can be obtained; new cases can be constructed using the improvement rate of physiological indicators and the subjective score, and these new cases can be stored in the case database. This case database can be a vector database with three dimensions: the first dimension is the physiological and pathological feature dimension, storing the user's multidimensional electrophysiological indicators in the baseline state (e.g., power spectrum of each frequency band, brain network connectivity, and dynamic evolution trend), serving as an index for retrieval; the second dimension is the regulation strategy dimension, precisely recording successful intervention programs corresponding to specific pathological features, including physical parameters such as stimulation waveform, frequency, electrode arrangement, and current intensity; the third dimension is the outcome assessment dimension, quantitatively recording the physiological feedback and clinical benefits after regulation (e.g., symptom improvement rate, target feature offset). These three dimensions are interconnected, enabling retrieval not only to find similar states but also to filter out programs that have been validated as effective in that state.
[0073] Reference Figure 6 An adaptive closed-loop neuromodulation system 1000 according to at least one embodiment of the present disclosure may include: an EEG acquisition and feature extraction module 1100, a semantic encoding module 1200, a prompt word construction module 1300, a strategy generation module 1400, an inner loop control module 1500, and a neurostimulation device 1600.
[0074] The EEG acquisition and feature extraction module 1100 can acquire the current user's EEG signal in real time and extract multidimensional features that characterize the neurophysiological state. As mentioned above, the multidimensional features may include at least one of physiological index features, nonlinear dynamic features, and brain network connectivity features.
[0075] The semantic encoding module 1200 can encode the multidimensional features extracted by the EEG acquisition and feature extraction module into a structured state semantic description based on preset mapping rules.
[0076] As an example, the semantic encoding module 1200 can utilize a predefined expert rule module to map multidimensional features (e.g., fused features) to a corresponding semantic space to determine the logical attributes of each physiological dimension. Then, the logical attributes of each dimension can be aggregated to generate a structured state semantic description, which serves as the input context for subsequent generative reasoning. However, this is merely an example; the semantic encoding module 1200 can execute each step of the semantic encoding process described above.
[0077] The prompt word construction module 1300 can be used to construct prompt words to guide generative artificial intelligence model reasoning by utilizing the structured state semantic description output by the semantic encoding module. As mentioned above, the prompt word construction module 1300 can utilize the structured state semantic description and a pre-built case database and medical safety constraints to construct a composite prompt word context to guide generative artificial intelligence model reasoning. The prompt word construction module 1300 can perform the above-described context assembly process.
[0078] The strategy generation module 1400 can integrate a generative artificial intelligence model to receive the context of compound cue words output by the cue word construction module 1300, and can obtain neural modulation instructions containing stimulus parameters and target EEG features through reasoning (e.g., thought chain reasoning (COT)). Thought chain reasoning (COT) can transform black-box decision-making into a transparent evidence-based process, facilitating the tracing of the logical basis for stimulus parameter generation and reducing erroneous instructions caused by "hallucinations". The strategy generation module 1400 can execute each step of the above-mentioned neural modulation instruction and target feature generation.
[0079] The inner-loop control module 1500 can be used to perform closed-loop control using the stimulation parameters output by the strategy generation module as initial operating parameters, the target EEG features as reference values, and the multi-dimensional features fed back in real time by the EEG acquisition and feature extraction module as feedback values, in order to output a control signal that drives the physical stimulation signal output by the neurostimulation device. The inner-loop control module 1500 can be a closed-loop control module (e.g., a PID control module).
[0080] The neurostimulation device 1600 can receive drive signals from the inner loop control module and output corresponding physical stimulation signals to the current user. As an example, during the output process, the neurostimulation device 1600 can simultaneously activate a millisecond-level safety monitoring mechanism to instantaneously calibrate the electrode impedance and real-time output current, ensuring that the physical stimulation signal is highly consistent with the inner loop command in the time domain. As an example, the neurostimulation device 1600 can be a tDCS device, a tACS device, or a tRNS device; however, this disclosure is not limited thereto.
[0081] Furthermore, although not shown, the adaptive closed-loop neuromodulation system 1000 according to at least one embodiment of the present disclosure may also include an outer loop optimization and update module. The outer loop optimization and update module can be used to update the case database according to the improvement rate of physiological indicators corresponding to the multidimensional features extracted by the EEG acquisition and feature extraction module at a second preset period greater than the first preset period, and control the strategy generation module to re-infer and optimize the stimulation parameters through a generative artificial intelligence model in the next regulation period to achieve hierarchical adaptive regulation.
[0082] The aforementioned adaptive closed-loop neural modulation system 1000 may be a tES system; however, this disclosure is not limited thereto.
[0083] The above has been referred to Figures 1 to 6 An adaptive closed-loop neural modulation method and system (or apparatus) according to exemplary embodiments of the present disclosure are described. However, it should be understood that the devices, units, apparatuses, etc., shown in the figures can be configured as software, hardware, firmware, or any combination thereof to perform specific functions. For example, these units and devices may correspond to dedicated integrated circuits, pure software code, or modules combining software and hardware. Furthermore, one or more functions implemented by these systems or apparatuses may also be uniformly executed by components in a physical entity device (e.g., a processor, client, or server).
[0084] The instructions stored in the aforementioned computer-readable storage medium can be executed in environments deployed in computer devices such as clients, hosts, agent devices, and servers. It should be noted that the instructions can also be used to perform additional steps beyond those described above, or to perform more specific processing while executing the aforementioned steps. The details of these additional steps and further processing are already provided in the reference... Figures 1 to 6 As mentioned in the description of the relevant systems and methods, they will not be repeated here to avoid repetition.
[0085] It should be noted that the process generation method according to the exemplary embodiments of this disclosure can rely entirely on the operation of computer programs or instructions to achieve the corresponding functions. That is, each device corresponds to each step in the functional architecture of the computer program, so that the entire system is called through a special software package (e.g., a lib library) to achieve the corresponding functions.
[0086] This disclosed adaptive closed-loop neural modulation method and system bridges the gap between the "feature space" and the "LLM semantic space." It not only utilizes frequency domain features but also introduces nonlinear differential entropy (DE) and phase-locked value (PLV) to transform complex neurodynamic indices into prompts that are understandable by the large language model. This enables the system to perform logical reasoning using the general medical knowledge contained in LLM, addressing the pain point that traditional deep learning models are "black boxes" and uninterpretable.
[0087] The adaptive closed-loop neural modulation method and system disclosed herein utilize retrieval-enhanced generation technology to search for successful cases of other "physiological twin" users in the database through vector similarity. In the absence of historical data of the current user, it rapidly generates high-confidence personalized parameters through analogical reasoning, achieving a leap from "general modulation" to "precise modulation".
[0088] The adaptive closed-loop neural modulation method and system disclosed herein employ a hierarchical control architecture: the inner loop utilizes a PID algorithm to handle millisecond-level instantaneous physiological fluctuations, ensuring real-time stability of stimulus intensity; the outer loop utilizes user subjective feedback and LLM-updated vector knowledge base to handle long-term strategy optimization. This combination of "machine intuition (PID)" and "cognitive reasoning (LLM)" perfectly balances the robustness of real-time control with the adaptability of long-term experience.
[0089] While specific terminology has been used to describe various embodiments of this disclosure, the specification and drawings are to be regarded as illustrative rather than restrictive in order to aid in understanding this disclosure. Various modifications and changes can be made by those skilled in the art (e.g., different features in different embodiments may be combined) without departing from the broader spirit and scope of this disclosure. Therefore, the scope of this disclosure is not limited by the specific embodiments and examples, but by the claims and their equivalents.
Claims
1. An adaptive closed-loop neural modulation method based on a large language model, characterized in that, include: It collects the current user's EEG signals in real time and extracts multidimensional features that characterize the neurophysiological state; The multidimensional features are encoded into a structured state semantic description based on a preset mapping rule; Using the structured state semantic description, prompt words are constructed to guide the reasoning of generative artificial intelligence models; The prompt words are input into the generative artificial intelligence model, and neural modulation instructions containing stimulation parameters and target EEG features are obtained through reasoning. The stimulation parameters are used as initial operating parameters, the target EEG characteristics are used as reference values, and the multidimensional characteristics of real-time feedback are used as feedback values to perform closed-loop control, thereby driving the neurostimulation device to output physical stimulation signals.
2. The adaptive closed-loop neural modulation method based on a large language model according to claim 1, characterized in that, Encoding the multidimensional features into a structured state semantic description based on preset mapping rules includes: converting the multidimensional features into a structured state semantic description using a preset expert rule template, wherein the expert rule template defines a preset logical mapping relationship, used to parse the numerical range or statistical characteristics of the multidimensional features into corresponding physiological state semantic labels.
3. The adaptive closed-loop neural modulation method based on a large language model according to claim 2, characterized in that, The multidimensional features are converted into a structured state semantic description using a preset expert rule template, including: Compare at least one of the multidimensional features with a preset threshold range; Based on the comparison results, at least one of them is mapped to the structured state semantic description.
4. The adaptive closed-loop neural modulation method based on a large language model according to claim 3, characterized in that, The multidimensional features include at least one of physiological index features, nonlinear dynamic features, and brain network connectivity features. The physiological index features include at least one of anxiety index features and mental fatigue index features calculated using the frequency domain features of the EEG signals. The nonlinear dynamic features include differential entropy. The brain network connectivity features include phase lock value.
5. The adaptive closed-loop neural modulation method based on a large language model according to claim 1, characterized in that, The construction of prompt words to guide generative artificial intelligence model reasoning using the structured state semantic description includes: constructing a compound prompt word context to guide generative artificial intelligence model reasoning using the structured state semantic description, a pre-built case database, and medical safety constraints.
6. The adaptive closed-loop neural modulation method based on a large language model according to claim 5, characterized in that, Utilizing the structured state semantic description, a pre-built case database, and medical safety constraints, a complex cue word context is constructed to guide the reasoning of the generative artificial intelligence model, including: The structured state semantic description is converted into a query vector; Use the query vector to query historical successful cases in a pre-established vector database that serves as the case database; The context of the compound prompt word is constructed by combining the structured state semantic description, the historical success cases, and the medical safety constraints.
7. The adaptive closed-loop neural modulation method based on a large language model according to claim 6, characterized in that, Using the query vector, historical successful cases are queried in a pre-established vector database that serves as the case database, including: Calculate the similarity between the query vector and the feature vectors of each historical case in the vector database; Select historical successful cases with a similarity greater than a preset threshold and matching corresponding user physiological indicators.
8. The adaptive closed-loop neural modulation method based on a large language model according to claim 5, characterized in that, The adaptive closed-loop neural modulation method further includes: updating the case database based on the improvement rate of physiological indicators corresponding to the multidimensional features at a second preset period longer than the first preset period, and re-inferring and optimizing the stimulation parameters through the generative artificial intelligence model in the next modulation period to achieve hierarchical adaptive modulation. Wherein, the first preset period is the inner loop control period, the second preset period is the outer loop control period, and the outer loop control period is greater than or equal to five times the inner loop control period.
9. The adaptive closed-loop neural modulation method based on a large language model according to claim 8, characterized in that, The case database is updated based on the improvement rate of physiological indicators corresponding to the multidimensional features, including: Obtain real-time multidimensional features fed back within the second preset period, and calculate the improvement rate of physiological indicators based on the real-time multidimensional features; Get the current user's subjective rating; New cases are constructed using the improvement rate of the physiological indicators and the subjective scores, and the new cases are stored in the case database.
10. An adaptive closed-loop neural modulation system based on a large language model, characterized in that, include: The EEG acquisition and feature extraction module is used to acquire the current user's EEG signals in real time and extract multidimensional features that characterize the neurophysiological state. The semantic encoding module is used to encode the multidimensional features extracted by the EEG acquisition and feature extraction module into a structured state semantic description based on a preset mapping rule; The prompt word construction module is used to construct prompt words to guide the reasoning of the generative artificial intelligence model by utilizing the structured state semantic description output by the semantic encoding module; The strategy generation module integrates a generative artificial intelligence model, which is used to receive prompts output by the prompt word construction module and obtain neural modulation instructions and target EEG features containing stimulation parameters through reasoning. The inner loop control module uses the stimulation parameters output by the strategy generation module as initial working parameters, the target EEG features as reference values, and the multidimensional features fed back in real time by the EEG acquisition and feature extraction module as feedback values to perform closed-loop control and output driving signals. The nerve stimulation device is used to receive the drive signal output by the inner loop control module and output the corresponding physical stimulation signal to the current user.