A task-state brain-computer interface training system for closed-loop transcranial magnetic stimulation

By using modular analysis and neural network models of the task-oriented brain-computer interface system, the transcranial magnetic stimulation parameters are adjusted in real time, solving the problem of false or missed stimulation in existing systems, and realizing dynamic tracking of neural states and fine control of stimulation in individualized cognitive rehabilitation training.

CN120783950BActive Publication Date: 2026-05-12FUJIAN ZHIYUAN INTELLIGENT INNOVATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN ZHIYUAN INTELLIGENT INNOVATION TECHNOLOGY CO LTD
Filing Date
2025-08-07
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing task-driven transcranial magnetic stimulation brain-computer interface systems struggle to accurately determine the subject's brain state, leading to false or missed stimulation triggers and affecting training effectiveness.

Method used

The system employs a task segmentation module, an energy feature extraction module, a state transition screening module, an activation topology construction module, and a recognizer establishment module. Through EEG signal analysis and graph convolutional neural networks, it adjusts transcranial magnetic stimulation parameters in real time to adapt to individualized cognitive rehabilitation training tasks.

Benefits of technology

It enables dynamic tracking and precise regulation of brain states, improving the accuracy of neural function regulation and training effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120783950B_ABST
    Figure CN120783950B_ABST
Patent Text Reader

Abstract

The application discloses a kind of closed-loop transcranial magnetic stimulation task state brain-computer interface training system, specifically relates to cognitive rehabilitation auxiliary field, including: in the rehabilitation training process, the brain function activation record is synchronously collected with multi-channel electroencephalogram signal, and the frequency energy feature of each channel is extracted by dividing task fragment;State transition candidate section is identified based on frequency band energy distribution change;By constructing cross-channel phase synchronization matrix, input graph convolutional neural network generates activation topological vector reflecting brain region collaborative mode;System constructs activation state recognizer with topological vector and brain function activation label as supervision data, realizes the real-time determination to different functional state.The identification result drives stimulation parameter recommendation module, according to the identification state, queries the preset stimulation strategy mapping table, dynamically generates the recommended stimulation parameter to magnetic stimulation execution interface, realizes personalized closed-loop neural regulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cognitive rehabilitation assistive technology, and more specifically, to a task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation. Background Technology

[0002] Transcranial magnetic stimulation (TMS) is a common adjunct to cognitive rehabilitation. Task-driven TMS brain-computer interface training systems generally rely on external task flow structures and event triggering nodes as the basis for controlling the timing of stimulation. These systems typically assume that the subject is in a corresponding cognitive state within a specific task phase and trigger TMS accordingly at set time intervals. However, in real-world applications, the subject's brain state often exhibits significant individual fluctuations and dynamic changes within the task. Simply relying on fixed triggering strategies for task segments or events makes it difficult to accurately determine whether the subject is within a stress intervention window, leading to false or missed triggers. Consequently, TMS may not achieve the desired therapeutic effects on the trainee's neurofunctional regulation.

[0003] To address the aforementioned problems, a technical solution is provided. Summary of the Invention

[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation to address the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation includes a task segmentation module, an energy feature extraction module, a state transition screening module, an activation topology construction module, a recognizer establishment module, and a stimulation parameter recommendation module.

[0007] During the execution of rehabilitation training tasks, the task segmentation module collects EEG signals and synchronous brain function activation records to construct task segment sequences;

[0008] The energy feature extraction module performs frequency domain conversion on EEG signals from different channels to extract the energy features of the EEG signals;

[0009] The state transition filtering module compares the frequency band energy distribution of consecutive task segments and filters candidate state transition segments;

[0010] The activation topology building module constructs a signal synchronization matrix based on the temporal EEG signals of state transition candidate segments, and uses a graph convolutional neural network to parse the task activation topology vector across brain regions.

[0011] The recognizer building module uses task activation topology vectors and brain function activation labels as training data to build a classifier for recognizing brain function activation states.

[0012] The stimulation parameter recommendation module identifies the current brain function activation state and outputs recommended transcranial magnetic stimulation parameters in real time.

[0013] In a preferred embodiment, the task segmentation module collects electroencephalogram (EEG) signals and synchronized brain function activation records during the execution of rehabilitation training tasks, and constructs task segment sequences specifically including:

[0014] Predefine the brain-computer interface-based rehabilitation training process and corresponding task event triggering conditions, and establish a task event structure table;

[0015] Continuously collect EEG signals from different channels and attach a unified time index to construct a time-aligned EEG signal set for each channel;

[0016] Label the brain function activation tags corresponding to the task event trigger, and preset the stimulus strategy mapping rules for the brain function activation tags;

[0017] Segment boundaries are defined based on the time intervals of adjacent task events. EEG signals and brain function activation tags within the segment boundaries are integrated and divided into a sequence of task segments of equal length.

[0018] In a preferred embodiment, the energy feature extraction module performs frequency domain conversion on EEG signals from different channels, and the extraction of energy features from the EEG signals specifically includes:

[0019] Filter the EEG signal sets corresponding to different channels from the task segment sequence based on channel affiliation;

[0020] Perform wavelet packet decomposition on the EEG signal in each channel and output the set of wavelet packet coefficients according to the preset scale hierarchy;

[0021] Based on the frequency band distribution boundaries related to cognition in EEG research, the components within the wavelet packet coefficient set are merged into a set of components in a set of defined frequency bands, and the energy value in each frequency band is calculated.

[0022] A sliding window is used to reconstruct the local energy value sequence corresponding to each frequency band according to the signal sampling time axis, establish a time series energy curve, and generate a time series energy feature expression vector set covering the frequency band distribution boundary related to cognition;

[0023] A two-dimensional energy matrix is ​​constructed by arranging the temporal energy feature expression vector set according to frequency bands, which serves as a unified output structure for the energy features of EEG signals. The dimensions of the two-dimensional energy matrix correspond to the frequency band index and the sampling time point, respectively.

[0024] In a preferred embodiment, the state transition filtering module compares the frequency band energy distribution of consecutive task segments, and the filtering of candidate state transition segments specifically includes:

[0025] Based on the boundary time of task segments, continuous time windows are divided in the temporal energy feature expression vector set of EEG signals to construct an index list of candidate segments for energy feature comparison.

[0026] Based on the two-dimensional energy matrix within each time window, the frequency band energy distribution at the task segment level is generated;

[0027] In the set of frequency band energy distributions, the task segments corresponding to adjacent candidate segment indices are selected for comparison, and the statistical difference metric between each pair of frequency band energy distributions is calculated.

[0028] By comparing thresholds, task fragment pairs whose energy distribution structure difference measurement index exceeds a predetermined threshold are screened. The corresponding task fragments are marked as energy mutation fragments, and their start and end times are recorded as candidate segment boundaries.

[0029] Integrate the start and end boundaries of the energy mutation segments to form a state transition candidate segment.

[0030] In a preferred embodiment, the activation topology construction module constructs a signal synchronization matrix based on the temporal EEG signals of state transition candidate segments, and uses a graph convolutional neural network to parse the task activation topology vector across brain regions, specifically including:

[0031] Extract the EEG signal sequence within the corresponding time period from the state transition candidate segment, and reconstruct the cross-brain region temporal signal array based on the channel index;

[0032] Calculate the phase lock value between each pair of channel signals within the candidate segment to generate a cross-channel signal correlation strength matrix;

[0033] The signal correlation strength matrix is ​​converted into a weighted undirected graph structure, where the graph nodes correspond to the channel positions and the graph edge weights reflect the intensity of neural collaborative response.

[0034] For each candidate segment, the input graph convolutional neural network model is trained and features are extracted, and the high-order topological vector of the corresponding task segment is output.

[0035] The topological vectors corresponding to all state candidate segments in the brain-computer interface-based rehabilitation training process are organized into a temporal arrangement structure to establish the activation topological vector trajectory between task segments.

[0036] In a preferred embodiment, the classifier building module uses task activation topology vectors and brain function activation labels as training data to build a brain function activation state recognition classifier, specifically including:

[0037] Extract the set of activation topology vector trajectories from the task activation topology vectors in historical training tasks, and obtain the brain function activation labels carried by the task events to which the task segments corresponding to the topology vector trajectories belong.

[0038] Obtain the state transition candidate segment corresponding to the topological vector trajectory, calculate the time difference between the corresponding start time and the trigger time of the task event, and use the time difference as the brain function activation delay time.

[0039] The topological vector trajectory sequence, brain function activation delay time and corresponding brain function activation label are integrated, and a structured training sample set is constructed with the task segment number corresponding to the topological vector trajectory as the main index.

[0040] A recognition classifier is deployed on the training sample set to establish a task-based brain function activation state recognition model.

[0041] In a preferred embodiment, the step of deploying a recognition classifier on the training sample set and establishing a task-specific brain function activation state recognition model specifically includes:

[0042] Set the model structure of the brain function activation state recognizer, and initialize the neural network weight matrix and optimizer configuration parameters;

[0043] A supervised learning process is performed on the training sample set, with topological vector trajectories and brain function activation delay time as input features, and the output is the brain function activation label prediction result.

[0044] The cross-entropy loss function and Adam optimization algorithm are used for gradient iterative updates. The iteration continues until the prediction error converges to the set index requirements, and the current model structure is saved as a brain function activation state recognizer.

[0045] In a preferred embodiment, the stimulation parameter recommendation module identifies the current brain function activation state and outputs transcranial magnetic stimulation recommendation parameters in real time, specifically including:

[0046] Receive real-time EEG signal sequences from various channels, and construct real-time topological vector trajectories for the EEG signal sequences using the task segment length as the sliding time window.

[0047] Obtain the starting point of the time window corresponding to the real-time topological vector trajectory, calculate the time difference between the starting point of the time window and the triggering time of the task event, input it into the brain function activation state recognizer, and perform brain function activation state recognition.

[0048] Based on the brain functional activation state recognition results, the stimulation strategy mapping rules are queried to obtain the corresponding stimulation rhythm, action area and stimulation parameter template, which are used as the recommended input for magnetic stimulation parameters.

[0049] The technical effects and advantages of the task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation of the present invention are as follows:

[0050] The task segmentation module can simultaneously acquire EEG signals and brain functional activation information, ensuring the temporal consistency between task semantics and neural responses. The energy feature extraction and state transition screening modules work together to accurately capture dynamically changing state segments, improving the sensitivity of neural state change detection. The graph convolutional neural network-assisted topology modeling method can effectively extract functional connectivity features across brain regions, representing the neural collaborative structures in complex cognitive states. The recognizer building module trains a state classifier using real brain functional activation data as supervised labels, enhancing the discriminative power and physiological consistency of state recognition. The stimulus parameter recommendation module adjusts stimulus parameters and target point recommendations in real time based on the recognition results, achieving closed-loop intervention on specific brain functional areas. The entire stimulus modulation process has functional closed-loop characteristics, making it suitable for dynamic tracking of neural states and fine-tuning of stimulation in individualized cognitive rehabilitation training tasks. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of a task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation according to the present invention. Detailed Implementation

[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0053] Example 1

[0054] Figure 1 The present invention provides a task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation, comprising a task segmentation module, an energy feature extraction module, a state transition screening module, an activation topology construction module, a recognizer establishment module, and a stimulation parameter recommendation module.

[0055] During the execution of rehabilitation training tasks, the task segmentation module collects EEG signals and synchronous brain function activation records to construct task segment sequences;

[0056] The energy feature extraction module performs frequency domain conversion on EEG signals from different channels to extract the energy features of the EEG signals;

[0057] The state transition filtering module compares the frequency band energy distribution of consecutive task segments and filters candidate state transition segments;

[0058] The activation topology building module constructs a signal synchronization matrix based on the temporal EEG signals of state transition candidate segments, and uses a graph convolutional neural network to parse the task activation topology vector across brain regions.

[0059] The recognizer building module uses task activation topology vectors and brain function activation labels as training data to build a classifier for recognizing brain function activation states.

[0060] The stimulation parameter recommendation module identifies the current brain function activation state and outputs recommended transcranial magnetic stimulation parameters in real time.

[0061] During the execution of rehabilitation training tasks, the task segmentation module collects EEG signals and synchronous brain function activation records to construct a task segment sequence.

[0062] A predefined brain-computer interface-based rehabilitation training task flow structure is established. The training flow consists of several sub-tasks with clearly defined cognitive functions, specifically including image recognition, image-text matching, character recognition, and semantic understanding tasks. Each task corresponds to the activation of a specific cognitive function area (i.e., the task state) during the execution flow. For example, the image recognition task corresponds to the activation of the image recognition function module, the character recognition task corresponds to the activation of the character shape processing function module, and the semantic understanding task corresponds to the activation of the language semantic processing function module. Clear event triggering nodes are set in the task flow, including stimulus presentation events, user operation events, and feedback presentation events. The event number, triggering condition, function activation label, and time index of each task are written into the task event structure table.

[0063] During the rehabilitation training task, a high-density EEG acquisition device was used to collect multi-channel neural signals from the subjects. A 32-channel EEG system was used, with a sampling frequency set to 512Hz, and the signal acquisition range covered the frontal lobe, parietal lobe, and central region. During the acquisition process, a uniformly generated system timestamp was added to the signal data stream of each channel, and it was synchronized with the event system time in the task flow to ensure that all channel data could be processed under the same time reference. A two-dimensional data structure of "channel × time" was constructed for the acquired data to form a time-aligned multi-channel EEG signal set.

[0064] For the task types and event numbers already recorded in the task event structure table, the system automatically extracts the corresponding brain function module activation tags from the functional activation tag library. For example, image recognition tasks are labeled "image recognition function activation," and semantic understanding tasks are labeled "language semantic processing function activation." Simultaneously, based on a pre-defined functional activation tag-stimulus parameter mapping table, recommended stimulation parameter combinations are added to each functional activation type. For example, the stimulation parameters for image recognition function activation are: left middle occipital gyrus target point, 10Hz, 1 second; and the stimulation parameters for language semantic processing function activation are: left superior temporal gyrus target point, 5Hz, 800ms. These stimulation parameter combinations are comprehensively configured by domain experts based on historical clinical data, ultimately constructing a tag-stimulus parameter mapping table as the retrieval basis for stimulation parameter recommendations.

[0065] Using the event trigger time as the dividing point, the time interval between adjacent events is extracted as the boundary of the task segment. EEG signals from all channels within this interval are extracted as task segment neural signal sequences. Within each segment, the EEG data is divided into equal-length task segments according to a preset sliding window length (specifically set based on the task flow length and event switching frequency; the default setting is 1 second per segment or 10% of the segment length). Each task segment automatically inherits the brain function activation label corresponding to its segment, forming an "EEG segment-label" pair structure. Finally, a standard task segment sequence containing time information, channel-dimensional neural signal data, and brain function activation labels is constructed.

[0066] The energy feature extraction module performs frequency domain conversion on EEG signals from different channels to extract the energy features of the EEG signals.

[0067] Based on the constructed task segment sequences, the EEG signal data within each task segment are first processed by channel classification. According to the anatomical affiliation corresponding to the channel number (e.g., frontal lobe, parietal lobe, central region, etc.), the EEG data are divided according to channel affiliation, and the original time-series signal set corresponding to each functional region is extracted. This division process ensures that subsequent frequency domain analysis maintains spatial consistency of neural regions and avoids feature distortion caused by mixing different brain regions.

[0068] For the raw EEG signal sequences extracted from each channel, wavelet packet decomposition is performed. A three-level wavelet packet decomposition structure is adopted, and a Daubechies-type wavelet basis (such as db4) is selected as the decomposition kernel function. After decomposition, each signal outputs a corresponding multi-scale wavelet packet coefficient set, where each coefficient subset corresponds to a predefined frequency sub-band, reflecting the local variation characteristics of the signal at different frequency scales. This process preserves the time-frequency dual information structure of the signal.

[0069] After obtaining the wavelet packet coefficient set, multiple frequency band boundaries are set according to the frequency band division standards related to common cognitive functions in EEG signals, such as theta band (4–8Hz), alpha band (8–13Hz), and beta band (13–30Hz). Based on the frequency range corresponding to the wavelet packet nodes, multiple sub-band components in the wavelet coefficients are merged and integrated according to their respective frequency bands to construct an energy component set under the standard frequency band structure. Energy calculation operations are performed on the component set within each frequency band, calculating the original energy value corresponding to each frequency band in the form of coefficient square sum, forming the energy expression result at the frequency band level.

[0070] A sliding time window is applied to the energy value sequence corresponding to each frequency band. A sliding window scan is performed using a constant window length (e.g., 256ms) and a fixed sliding step size (e.g., 64ms). Frequency band energy extraction is repeatedly performed on local signal segments, and the energy sequence is output. The local energy values ​​of each frequency band are rearranged according to the sampling time index to construct a frequency band-level time series energy curve. Each curve represents the energy fluctuation trajectory on a specific cognitive frequency band.

[0071] The temporal energy curves of all frequency bands are arranged in order of frequency band index to construct a unified two-dimensional energy matrix. The horizontal axis of the matrix represents the sampling time point, and the vertical axis represents the index position of each set frequency band. Each element of the matrix represents the local energy value of a certain frequency band at a certain moment. This two-dimensional energy matrix serves as a joint expression structure of neural activity in the task segment in both frequency and time dimensions.

[0072] The state transition filtering module compares the frequency band energy distribution of consecutive task segments to filter candidate state transition segments.

[0073] Based on the previously constructed task segment sequences and corresponding EEG frequency band energy expression structures, a continuous time window region is first delineated within the temporal energy feature expression vector set covered by each task segment, according to the start and end time boundaries. Each time window corresponds to an energy feature structure of an equal-length segment, with the window length consistent with the task segment length. The time windows slide within the task segments to generate energy comparison candidate segments with high temporal resolution. A continuous segment index number is assigned to all sliding windows, and a one-to-one correspondence is established between the index number and its start and end times in the task segment energy vector sequence, forming a list of energy feature comparison candidate segment indices.

[0074] Within each time window, a corresponding two-dimensional energy matrix structure is extracted. The vertical axis of this matrix represents the defined frequency band index, and the horizontal axis represents the sampling time point within the current window. Each element in the matrix represents the local energy value of a certain frequency band at a certain moment. This two-dimensional matrix is ​​then subjected to mean compression along the time axis, i.e., the average value is calculated for the energy time series of each frequency band, resulting in a fixed-length frequency band energy vector. This vector represents the frequency band energy distribution corresponding to the task segment window. The frequency band energy vectors extracted from all time windows are arranged sequentially according to the segment index number, forming a set of frequency band energy distributions at the task segment level.

[0075] After the energy distribution set is established, the frequency band energy vectors corresponding to each pair of adjacent candidate segment indices are selected, and statistical comparison calculations between energy distributions are performed. In this embodiment, standardized Euclidean distance is used as the frequency band energy structure difference metric. That is, the square root operation is performed on the sum of the squared differences between corresponding elements of two adjacent frequency band energy vectors, and the result is normalized to reduce the impact of the difference in total energy between different task segments on the metric calculation. A set of difference metrics is generated for each pair of adjacent segments, and a mapping relationship between them and the time window index position is established.

[0076] A predefined structural difference threshold is introduced as a screening criterion, and all calculated frequency band energy distribution difference metrics are compared one by one. For any pair of segments whose difference metric exceeds the predefined threshold, their corresponding time intervals are considered to have significant energy structure abrupt changes. The start and end times of these energy abrupt change segments are recorded as potential state transition points and marked as energy abrupt change segments, constructing a set of boundary points for candidate state transition segments. The structural difference threshold is set based on the energy distribution abrupt change level of a specific segment and the required evaluation accuracy; the default setting is the average frequency band energy distribution difference metric of all compared segments.

[0077] The start and end time boundaries of all segments marked as energy mutations were integrated and grouped chronologically into several non-overlapping time segments. Each time segment corresponds to a set of EEG segments that undergo transitions in energy structure. These time segments are defined as state transition candidate segments, representing time regions where brain signals show significant changes in cognitive function performance during the execution of the training task.

[0078] The activation topology construction module constructs a signal synchronization matrix based on the temporal EEG signals of state transition candidate segments, and uses a graph convolutional neural network to parse the task activation topology vector across brain regions.

[0079] For the identified state transition candidate segments, multi-channel EEG signal data within the corresponding time range are extracted from the original task segment sequence. During the extraction process, the time section of the multi-channel signal matrix is ​​located based on the start and end times of the candidate segments to obtain the original neural signal subset covered by the candidate segments, and the channel number index information of each channel is retained. Based on the brain region location corresponding to the channel number, the EEG channels are spatially classified and reconstructed into a cross-brain region temporal signal array structure, ensuring that each signal segment has clear spatial channel location identification while maintaining temporal continuity, for subsequent extraction of EEG signal coordination relationships.

[0080] Phase synchronization calculations are performed on the temporal signals of all channels within a candidate segment. The Phase Locking Value (PLV) is used as a quantitative indicator of the neural signal synchronization relationship between channel pairs. Specifically, the EEG signal of each channel is first processed by bandpass filtering and Hilbert transform to extract the instantaneous phase sequence; then, the magnitude of the complex exponential mean of the phase difference between any two channel phase sequences is calculated to obtain the phase lock value within the candidate segment, which serves as a measure of the coordination strength between the channel pairs. The PLV values ​​of all channel pairs constitute a symmetric correlation strength matrix, where each row and column of the matrix corresponds to a channel number, and the element value represents the synchronization response strength of that channel with other channels within the current candidate segment.

[0081] After the association strength matrix is ​​constructed, it is converted into a weighted undirected graph structure. Each node in this graph structure represents an EEG channel, and its spatial location corresponds to a brain region mapping. The weight of each edge in the graph is the PLV value between channel pairs, representing the synergistic strength of neural activity of that channel pair in the current time period. A corresponding weighted graph structure is constructed for each state candidate segment, and all graph structures are uniformly stored in sparse matrix form to improve the efficiency of subsequent modeling.

[0082] After the graph structure is constructed, the weighted graph corresponding to each state transition candidate segment is input into the Graph Convolutional Network (GCN) for feature extraction. During initialization, the GCN model sets the input node features to basic channel attributes such as the channel's average frequency band energy and location information, and the edge weights to the graph weight matrix composed of the aforementioned PLVs. During training, graph-level supervision objectives (e.g., whether it is a certain type of activation state) are used to optimize the network parameters. After model convergence, a set of fixed-length high-dimensional vectors is output for each input graph structure to represent the neural topological activation features corresponding to the current candidate segment. This vector, called the topological activation vector, reflects the collaborative response patterns and network structure information of different brain regions within the state candidate segment.

[0083] Throughout the rehabilitation training process, the topological activation vectors of all candidate segments for task state transitions are arranged in chronological order to construct a high-order topological trajectory sequence at the task segment level. This trajectory sequence corresponds to the actual execution order of the training task on the time axis and reflects the evolutionary characteristics of brain region connectivity patterns under different states in the spatial dimension.

[0084] The recognizer building module uses task activation topology vectors and brain function activation labels as training data to build a brain function activation state recognition classifier.

[0085] Based on the completed historical rehabilitation training task flow, a set of topological activation vectors corresponding to all task segments is extracted from the state transition candidate segments. Each topological vector is output by a graph convolutional neural network (GCN) after the graph structure of the candidate segment is input, reflecting the collaborative response pattern between different brain regions within a specific time period. Continuous topological activation vector sequences within the same task segment are concatenated in chronological order to construct a set of topological vector trajectories. The trajectory structure reflects the dynamic evolution of the neural network state within that task segment. The starting time point of the trajectory is bound to the task segment structure and serves as the time reference for subsequent activation delay calculations.

[0086] Based on the task segment number corresponding to each topological vector trajectory, the task event information to which it belongs is retrieved. This event information comes from the event trigger structure table preset by the training task, which records the event type of each task segment (such as image recognition, semantic understanding, etc.) and its corresponding brain function activation label (such as image recognition function activation, language semantic processing function activation, etc.), and provides the timestamp of the actual triggering of the event. For each topological trajectory, the difference between its candidate segment start time (i.e., the state transition start point) and the trigger timestamp of the task event to which the trajectory belongs is recorded. This difference is calculated as the brain function activation delay time that occurs in the actual task execution of the task segment. This time difference can be regarded as an individual time delay reflection of brain function response, which is used to improve the model's ability to recognize individualized reaction timelines.

[0087] After acquiring the topological trajectory, activation labels, and activation delays, these three data structures are integrated and organized to construct a unified training sample set. Each training sample is indexed by the task segment number, and its fields include:

[0088] (1) The sequence of topological vector trajectories of this task serves as the core structural feature of the model input;

[0089] (2) The brain function activation labels of this task are used as the supervision targets for training the classifier;

[0090] (3) The brain function activation delay time of this segment serves as a supplementary input to the time dynamic characteristics.

[0091] All samples are uniformly arranged by index, forming a standard structured training sample set. A multi-class recognition and classification model is deployed on this training sample set for supervised training. The model structure can be a deep graph classification network with temporal structure awareness, or a neural network model that combines topological trajectory and delay time to construct a composite vector input. During the training phase, the model takes the topological vector trajectory and delay time as joint inputs and outputs the corresponding brain function activation labels. Cross-entropy loss function is used for error feedback optimization, and the number of training rounds is controlled based on the accuracy of the training and validation sets. After convergence, the model can be used to identify the functional activation state of unknown task segments, serving as the core recognizer for closed-loop stimulation control in brain-computer interfaces.

[0092] In the model structure design, topological information encoding, temporal context modeling, and fusion feature compression are performed sequentially within the model, ultimately outputting a multi-class classification probability vector consistent with the label set. After model construction, the weight matrices of each layer of the neural network are initialized, and optimizer parameters are configured. The Adam algorithm is selected as the optimizer, with a learning rate of 0.001 and a weight decay coefficient of 0.0001 to balance the parameter update rate and the risk of overfitting. At the same time, a gradient pruning strategy is introduced, setting the upper limit of the gradient norm to 2.0 to prevent gradient explosion during training. During training, the cross-entropy loss function is used as a supervision index, and continuous iterative optimization is performed until the accuracy of the validation set reaches 90% or the loss decreases by less than 0.001 for 10 consecutive rounds of validation. The model is then considered to have converged, and training is terminated. The current network structure and weights are saved as the final brain function activation state recognizer.

[0093] The stimulation parameter recommendation module identifies the current brain function activation state and outputs recommended transcranial magnetic stimulation parameters in real time.

[0094] During the training task, multi-channel EEG signal input is continuously received, and the neural signal streams from different channels are constructed into a real-time sequence matrix with timestamps. A sliding time window strategy is used to segment the signal stream in real time. The length of the sliding window is set to be consistent with the length of the task segments in the training task, and the step size can be flexibly set according to the response rate requirements. At the start time point of each sliding window, all channel signals within that time period are extracted and a cross-brain region temporal signal array is generated.

[0095] Consistent with the activation topology construction module method, phase synchronization analysis and graph structure construction are performed on the array, and the phase lock value (PLV) between each channel is calculated to generate the cross-channel co-evolution graph corresponding to the current window. The graph structure is input into the graph convolutional neural network model, which outputs the high-dimensional topological activation vector within the time window. The topological activation vectors in adjacent time windows are concatenated to form a short-time topological trajectory, constructing a representation of the brain functional co-evolutionary features for the current time period.

[0096] After the real-time topological trajectory is constructed, the trigger timestamps of the current sliding window's starting point and its corresponding task event are retrieved from the task event table. The time difference between the two is calculated and used as an input variable for "brain function activation delay time," which is then input along with the topological trajectory into the trained brain function activation state recognizer. This recognizer, based on joint modeling of topological evolution features and time delay information, predicts the brain function activation state of the current time window and outputs a functional label, such as "image recognition function activation" or "semantic processing function activation." Immediately after the recognition result is output, the stimulation strategy mapping process begins. Based on the recognition result, a preset brain function label-stimulation parameter mapping table is consulted to retrieve the magnetic stimulation modulation parameter combination corresponding to the current functional state.

[0097] Each mapping rule contains three core dimensions: stimulus rhythm (e.g., frequency, pulse pattern), region of action (e.g., left middle occipital gyrus, right superior temporal gyrus), and parameter template (e.g., stimulus intensity, duration, intermittent pattern). Using the current recognition state as the query keyword, the corresponding strategy is retrieved, and structured stimulus parameter recommendations are generated.

[0098] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.

[0099] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0100] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0101] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0102] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0103] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0104] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0105] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0107] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation, characterized in that, It includes a task segmentation module, an energy feature extraction module, a state transition screening module, an activation topology construction module, a recognizer establishment module, and a stimulus parameter recommendation module; During the execution of rehabilitation training tasks, the task segmentation module collects EEG signals and synchronous brain function activation records to construct task segment sequences; The energy feature extraction module performs frequency domain conversion on EEG signals from different channels to extract the energy features of the EEG signals; The state transition filtering module compares the frequency band energy distribution of consecutive task segments and filters candidate state transition segments; The activation topology building module constructs a signal synchronization matrix based on the temporal EEG signals of state transition candidate segments, and uses a graph convolutional neural network to parse the task activation topology vector across brain regions. The recognizer building module uses task activation topology vectors and brain function activation labels as training data to build a classifier for recognizing brain function activation states. The stimulation parameter recommendation module identifies the current brain function activation state and outputs recommended transcranial magnetic stimulation parameters in real time. The state transition filtering module compares the frequency band energy distribution of consecutive task segments, and the filtering of candidate state transition segments specifically includes: Based on the boundary time of task segments, continuous time windows are divided in the temporal energy feature expression vector set of EEG signals to construct an index list of candidate segments for energy feature comparison. Based on the two-dimensional energy matrix within each time window, a frequency band energy distribution at the task segment level is generated; In the set of frequency band energy distributions, the task segments corresponding to adjacent candidate segment indices are selected for comparison, and the statistical difference metric between each pair of frequency band energy distributions is calculated. By comparing thresholds, task fragment pairs whose energy distribution structure difference measurement index exceeds a predetermined threshold are screened. The corresponding task fragments are marked as energy mutation fragments, and their start and end times are recorded as candidate segment boundaries. Integrate the start and end boundaries of the energy mutation segments to form a state transition candidate segment; The activation topology construction module constructs a signal synchronization matrix based on the temporal EEG signals of state transition candidate segments, and uses a graph convolutional neural network to parse the task activation topology vector across brain regions, specifically including: Extract the EEG signal sequence within the corresponding time period from the state transition candidate segment, and reconstruct the cross-brain region temporal signal array based on the channel index; Calculate the phase lock value between each pair of channel signals within the candidate segment to generate a cross-channel signal correlation strength matrix; The signal correlation strength matrix is ​​converted into a weighted undirected graph structure, where the graph nodes correspond to the channel positions and the graph edge weights reflect the intensity of neural collaborative response. For each candidate segment, the input graph convolutional neural network model is trained and features are extracted, and the high-order topological vector of the corresponding task segment is output. The topological vectors corresponding to all state candidate segments in the brain-computer interface-based rehabilitation training process are organized into a temporal arrangement structure to establish the activation topological vector trajectory between task segments.

2. The task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation according to claim 1, characterized in that, The task segmentation module collects EEG signals and synchronous brain function activation records during the execution of rehabilitation training tasks, and constructs task segment sequences, specifically including: Predefine the brain-computer interface-based rehabilitation training process and corresponding task event triggering conditions, and establish a task event structure table; Continuously collect EEG signals from different channels and attach a unified time index to construct a time-aligned EEG signal set for each channel; Label the brain function activation tags corresponding to the task event trigger, and preset the stimulus strategy mapping rules for the brain function activation tags; Segment boundaries are defined based on the time intervals of adjacent task events. EEG signals and brain function activation tags within the segment boundaries are integrated and divided into a sequence of task segments of equal length.

3. The task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation according to claim 1, characterized in that, The energy feature extraction module performs frequency domain conversion on EEG signals from different channels to extract energy features of the EEG signals, specifically including: Filter the EEG signal sets corresponding to different channels from the task segment sequence based on channel affiliation; Perform wavelet packet decomposition on the EEG signal in each channel and output the set of wavelet packet coefficients according to the preset scale hierarchy; Based on the frequency band distribution boundaries related to cognition in EEG research, the components within the wavelet packet coefficient set are merged into a set of components in a set of defined frequency bands, and the energy value in each frequency band is calculated. A sliding window is used to reconstruct the local energy value sequence corresponding to each frequency band according to the signal sampling time axis, establish a time series energy curve, and generate a time series energy feature expression vector set covering the frequency band distribution boundary related to cognition; A two-dimensional energy matrix is ​​constructed by arranging the temporal energy feature expression vector set according to frequency bands, which serves as a unified output structure for the energy features of EEG signals. The dimensions of the two-dimensional energy matrix correspond to the frequency band index and the sampling time point, respectively.

4. A task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation according to claim 1, characterized in that, The classifier building module uses task activation topology vectors and brain function activation labels as training data to build a classifier for recognizing brain function activation states, specifically including: Extract the set of activation topology vector trajectories from the task activation topology vectors in historical training tasks, and obtain the brain function activation labels carried by the task events to which the task segments corresponding to the topology vector trajectories belong. Obtain the state transition candidate segment corresponding to the topological vector trajectory, calculate the time difference between the corresponding start time and the trigger time of the task event, and use the time difference as the brain function activation delay time. The topological vector trajectory sequence, brain function activation delay time and corresponding brain function activation label are integrated, and a structured training sample set is constructed with the task segment number corresponding to the topological vector trajectory as the main index. A recognition classifier is deployed on the training sample set to establish a task-based brain function activation state recognition model.

5. A task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation according to claim 4, characterized in that, The step of deploying a recognition classifier on the training sample set to establish a task-based brain function activation state recognition model specifically includes: Set the model structure of the brain function activation state recognizer, and initialize the neural network weight matrix and optimizer configuration parameters; A supervised learning process is performed on the training sample set, with topological vector trajectories and brain function activation delay time as input features, and the output is the brain function activation label prediction result. The cross-entropy loss function and Adam optimization algorithm are used for gradient iterative updates. The iteration continues until the prediction error converges to the set index requirements, and the current model structure is saved as a brain function activation state recognizer.

6. A task-oriented brain-computer interface training system for closed-loop transcranial magnetic stimulation according to claim 1, characterized in that, The stimulation parameter recommendation module identifies the current brain function activation state and outputs transcranial magnetic stimulation recommended parameters in real time, including: Receive real-time EEG signal sequences from various channels, and construct real-time topological vector trajectories for the EEG signal sequences using the task segment length as a sliding time window; Obtain the starting point of the time window corresponding to the real-time topological vector trajectory, calculate the time difference between the starting point of the time window and the triggering time of the task event, input it into the brain function activation state recognizer, and perform brain function activation state recognition. Based on the brain functional activation state recognition results, the stimulation strategy mapping rules are queried to obtain the corresponding stimulation rhythm, action area and stimulation parameter template, which are used as the recommended input for magnetic stimulation parameters.