A Deep Learning-Based Transcranial Magnetic Stimulation EEG Localization Method and Device
Patent Information
- Application Number
- CN202610829815.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-10
- Publication Date
- 2026-09-01
AI Technical Summary
[0006]针对现有技术的不足,本发明提供了一种基于深度学习的经颅磁刺激脑电定位方法及装置,解决了当前接触阻抗改变引发放电回路的时间常数发生偏移,致使提取的正向原始恢复时间与负向原始恢复时间产生时间测量误差的问题
1、本发明通过在空闲时间窗口内向脑电电极网络注入交流载波测量当前接触阻抗,读取存储器内部记录的基准阻抗,将基准阻抗、当前接触阻抗、正向原始恢复时间以及负向原始恢复时间代入归一化公式执行代数校准运算,产生正向归一化恢复时间以及负向归一化恢复时间,滤除当前接触阻抗改变带来的时间变量干扰,解决提取正向原始恢复时间以及负向原始恢复时间产生时间测量误差的技术问题。
Smart Images

Figure CN122665263A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electroencephalogram (EEG) signal processing technology, specifically to a transcranial magnetic stimulation (TMS) EEG localization method and device based on deep learning. Background Technology
[0002] During transcranial magnetic stimulation (TMS), the TMS coil generates an alternating magnetic field. This alternating magnetic field passes through the EEG electrode network and electrode leads to generate an induced voltage. The induced voltage is transmitted to the pre-clamping circuit and the EEG amplification circuit, driving the EEG amplification circuit into a voltage saturation state.
[0003] The analog-to-digital converter records the entire time series from the establishment of voltage saturation until it decays back to the normal range. The state of the stratum corneum on the subject's scalp causes a change in the current contact impedance between the EEG electrode network and the subject's scalp. The input capacitance inside the EEG amplification circuit establishes a discharge circuit with the EEG electrode network and the subject's scalp. The time constant of the discharge circuit is constrained by the current contact impedance. Changes in the current contact impedance cause a shift in the time constant of the discharge circuit, resulting in time measurement errors in the positive and negative raw recovery times extracted by the system.
[0004] The spatial directionality of alternating magnetic fields leads to differences in the amplitudes of positive and negative induced voltages generated on the electrode leads. The lack of time difference and time summation operations for the original positive and negative recovery times makes it difficult to generate directional and intensity feature matrices, and thus impossible to obtain complete data on the directional projection distribution and intensity distribution of the alternating magnetic field. Furthermore, the lack of spatial mapping analysis for artifact-free EEG signals and electric field micro-state vectors prevents the calculation of the three-dimensional spatial coordinate deviation and three-dimensional spatial attitude angle deviation of the transcranial magnetic stimulation coil relative to the reference target point, thus hindering the output of a six-degree-of-freedom deviation vector for coordinate localization.
[0005] Therefore, this invention proposes a deep learning-based transcranial magnetic stimulation EEG localization method and device to address the shortcomings of existing technologies. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a deep learning-based transcranial magnetic stimulation EEG localization method and device, which solves the problem that changes in contact impedance cause a shift in the time constant of the discharge circuit, resulting in time measurement errors between the extracted positive and negative original recovery times.
[0007] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of this invention provides a deep learning-based transcranial magnetic stimulation (TMS) EEG localization method, comprising the following steps: The current contact impedance of the EEG electrode network is measured by an impedance measurement circuit to generate the original EEG signal flow. A positive saturation threshold voltage and a negative saturation threshold voltage are set. The first time point when the original EEG signal flow crosses the positive saturation threshold voltage and the second time point when it crosses the negative saturation threshold voltage are obtained. The positive original recovery time and the negative original recovery time are extracted. The reference impedance, artifact-free EEG signal, and convolutional neural network model recorded in the memory are read, and the reference impedance, current contact impedance, positive raw recovery time, and negative raw recovery time are converted into positive normalized recovery time and negative normalized recovery time, and the dual-channel feature map matrix is calculated and output. Artifact-free EEG signals are calculated as electric field microstate vectors. The dual-channel feature map matrix and the electric field microstate vectors are merged to generate a fused feature tensor, which is then input into a convolutional neural network model to calculate a six-degree-of-freedom deviation vector to complete coordinate localization.
[0008] The impedance measurement circuit injects an AC carrier wave into the EEG electrode network during the idle time window and calculates the current contact impedance. The transcranial magnetic stimulation coil generates an alternating magnetic field, which passes through the EEG electrode network and electrode leads to induce a voltage. The pre-clamping circuit performs a limiting operation on the induced voltage and outputs a clamping voltage. The EEG amplification circuit receives the clamping voltage, enters voltage saturation, and outputs the highest level signal.
[0009] An analog-to-digital converter (ADC) performs digital quantization on the highest-level signal and the subsequent level drop process to generate a raw EEG signal stream recording the entire process of voltage saturation. The reference impedance, current contact impedance, positive raw recovery time, and negative raw recovery time are substituted into a normalization formula to perform algebraic calibration, filtering out time-variant interference caused by changes in the current contact impedance to generate positive and negative normalized recovery times.
[0010] The positive and negative normalized recovery times are extracted, and algebraic subtraction and addition operations are performed to generate time difference and time sum values. The time difference values corresponding to all EEG channels are then filled into an empty matrix according to the two-dimensional spatial coordinates to generate a direction feature matrix. Similarly, the time sum values corresponding to all EEG channels are filled into an empty matrix according to the two-dimensional spatial coordinates to generate an intensity feature matrix. The direction and intensity feature matrices are then merged and stacked along the channel dimension to output a dual-channel feature map matrix. Global field power analysis is performed on the artifact-free EEG signal to generate an electric field micro-state vector.
[0011] The computing platform connects to the robotic arm calibration system to obtain training sample data. It concatenates the standard 3D spatial coordinate deviation values and the standard 3D spatial attitude angle deviation values to generate standard six-degree-of-freedom deviation vector labels. It inputs the fusion feature tensor from the training sample dataset into the convolutional neural network model to output the predicted 3D spatial coordinate deviation values and the predicted 3D spatial attitude angle deviation values. It calculates the 3D spatial coordinate loss values and the 3D spatial attitude angle loss values and substitutes them into the joint loss function to calculate the joint loss value. It then performs backpropagation to generate gradient data and update the network node weight parameters of the convolutional neural network model.
[0012] A second aspect of the present invention provides a deep learning-based transcranial magnetic stimulation EEG localization device, comprising a data acquisition and front-end processing module, a data calibration and feature construction module, and a spatial localization reasoning module.
[0013] The data acquisition and front-end processing module is used to measure the current contact impedance of the EEG electrode network based on the impedance measurement circuit, generate the original EEG signal flow, set the positive saturation threshold voltage and the negative saturation threshold voltage, obtain the first time point when the original EEG signal flow crosses the positive saturation threshold voltage and the second time point when it crosses the negative saturation threshold voltage, and extract the positive original recovery time and the negative original recovery time. The data calibration and feature construction module is used to read the reference impedance, artifact-free EEG signal and convolutional neural network model recorded in the memory, convert the reference impedance, current contact impedance, positive raw recovery time and negative raw recovery time into positive normalized recovery time and negative normalized recovery time, and calculate and output a dual-channel feature map matrix. The spatial positioning reasoning module is used to calculate the artifact-free EEG signal into an electric field microstate vector, merge the dual-channel feature map matrix and the electric field microstate vector to generate a fused feature tensor, and input it into the convolutional neural network model to calculate the six-degree-of-freedom deviation vector to complete the coordinate positioning.
[0014] This invention provides a deep learning-based transcranial magnetic stimulation (TMS) EEG localization method and device. It has the following beneficial effects: 1. This invention measures the current contact impedance by injecting an AC carrier wave into the EEG electrode network during an idle time window, reads the reference impedance recorded in the memory, and substitutes the reference impedance, current contact impedance, positive original recovery time, and negative original recovery time into a normalization formula to perform algebraic calibration to generate positive and negative normalized recovery times. This process filters out time variable interference caused by changes in the current contact impedance, thus solving the technical problem of time measurement errors caused by extracting positive and negative original recovery times.
[0015] 2. This invention extracts the positive and negative normalized recovery times corresponding to all EEG channels, performs algebraic subtraction and algebraic addition operations to generate time difference values and time sum values. The time difference values are filled into an empty matrix according to the two-dimensional spatial coordinates to generate a direction feature matrix, and the time sum values are filled into an empty matrix according to the two-dimensional spatial coordinates to generate an intensity feature matrix. The direction feature matrix and intensity feature matrix are merged and stacked in the channel dimension to output a dual-channel feature map matrix. The direction feature matrix records the projection distribution data of the alternating magnetic field direction, and the intensity feature matrix records the intensity distribution data of the alternating magnetic field.
[0016] 3. This invention obtains the electric field microstate vector by performing global field power analysis on artifact-free EEG signals. The dual-channel feature map matrix and the electric field microstate vector are merged by tensor splicing to generate a fused feature tensor. The fused feature tensor is input into a convolutional neural network model that has completed parameter iterative training to perform forward inference. The output node of the convolutional neural network model calculates and generates a six-degree-of-freedom deviation vector. The six-degree-of-freedom deviation vector consists of three-dimensional spatial coordinate deviation values and three-dimensional spatial attitude angle deviation values, thus completing the coordinate positioning of the transcranial magnetic stimulation coil relative to the reference target point. Attached Figure Description
[0017] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system framework diagram of the present invention; Figure 3 This is a diagram showing the recovery trajectory of the original electroencephalogram signal stream and the identification of the first time point in a specific application embodiment of the present invention; Figure 4 This is a graph showing the convergence of the joint loss value during the parameter iterative training process in a specific application embodiment of the present invention. Figure 5 This is a comparison diagram showing the impact of current contact impedance changes on three-dimensional spatial coordinate positioning errors in a specific application embodiment of the present invention. Detailed Implementation
[0018] The technical solutions in 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 skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Please see Figure 1-2This invention provides a deep learning-based transcranial magnetic stimulation (TMS) EEG localization method, which is applied to a deep learning-based TMS EEG localization device. The device includes a TMS coil, an EEG electrode network, a pre-clamping circuit, an EEG amplification circuit, an analog-to-digital converter, an impedance measurement circuit, a memory, and a control unit.
[0020] The transcranial magnetic stimulation coil in the device is placed outside the subject's head, and the EEG electrode network is attached to the subject's scalp surface according to the standard EEG electrode spatial arrangement rules. The EEG electrode network collects EEG signals from all EEG channels, and the signal output end of the EEG electrode network is connected to the signal input end of the pre-clamping circuit through electrode leads.
[0021] The signal output terminal of the pre-clamping circuit is connected to the signal input terminal of the EEG amplifier circuit. The pre-clamping circuit performs amplitude limiting on the induced voltage transmitted through the electrode leads. The signal output terminal of the EEG amplifier circuit is connected to the analog input terminal of the analog-to-digital converter (ADC). The EEG amplifier circuit amplifies the input EEG signal and transmits the amplified EEG signal to the ADC. The ADC converts the received analog voltage signal into a raw EEG signal stream in digital signal format. The digital output terminal of the ADC is connected to the data receiving terminal of the control unit. The ADC transmits the raw EEG signal stream to the control unit for signal processing.
[0022] The test output of the impedance measurement circuit is connected to the EEG electrode network. The impedance measurement circuit injects AC carrier waves into all EEG channels and measures the current contact impedance of all EEG channels. The data output of the impedance measurement circuit is connected to the control unit and transmits the current contact impedance to the control unit. The control unit performs a latching operation on the current contact impedance. The memory establishes a data communication connection with the control unit. The memory records the reference impedance of all EEG channels. The control unit reads the reference impedance. The control unit coordinates the pulse triggering timing of the transcranial magnetic stimulation coil and the sampling timing of the analog-to-digital converter.
[0023] See attached document Figure 2 The control unit sends a pulse trigger signal to the transcranial magnetic stimulation coil. The transcranial magnetic stimulation coil receives the pulse trigger signal according to the pulse trigger timing and generates an alternating magnetic field. The alternating magnetic field passes through the EEG electrode network and electrode leads to generate an induced voltage. The induced voltage is transmitted along the electrode leads to the signal input terminal of the pre-clamping circuit.
[0024] The pre-clamping circuit has an internal limiting voltage threshold. The pre-clamping circuit performs amplitude comparison on the received induced voltage. When the pre-clamping circuit determines that the value of the induced voltage exceeds the limiting voltage threshold range, the pre-clamping circuit performs a limiting operation on the induced voltage. The pre-clamping circuit forcibly constrains the induced voltage within the limiting voltage threshold range and outputs a clamping voltage. The clamping voltage is transmitted to the signal input terminal of the EEG amplifier circuit.
[0025] The hardware structure of the EEG amplifier circuit has reserved upper and lower limits for the power supply rail voltage. The limiting voltage threshold is between the upper and lower limits of the power supply rail voltage. The EEG amplifier circuit receives the clamping voltage and performs amplification. The theoretical output voltage value generated by the amplification process exceeds the output range boundary of the EEG amplifier circuit. The signal output terminal of the EEG amplifier circuit maintains the fixed level state corresponding to the output range boundary. The EEG amplifier circuit enters the voltage saturation state and continues to conduct signals in the voltage saturation state.
[0026] The analog-to-digital converter (ADC) continuously performs analog-to-digital conversion according to the sampling timing while the EEG amplifier circuit is in a voltage saturation state. The ADC continuously samples the signal transmitted by the EEG amplifier circuit and records the entire time series from the establishment of the voltage saturation state until the decay returns to the normal range. The control unit does not perform hardware shielding or blocking operations on the EEG amplifier circuit. The ADC generates a raw EEG signal stream with the entire time series and transmits the raw EEG signal stream to the control unit.
[0027] See attached document Figure 1 The control unit combines the original EEG signal flow and pulse triggering timing to divide the system's operating time intervals. The control unit establishes an idle time window before the transcranial magnetic stimulation coil generates an alternating magnetic field.
[0028] During the idle time window, the impedance measurement circuit generates an AC carrier with a frequency of 1000Hz. The impedance measurement circuit continuously injects the AC carrier into the EEG electrode network, which conducts the AC carrier to the subject's scalp surface. The impedance measurement circuit receives feedback voltage signals through electrode leads. Based on the feedback voltage signals, the impedance measurement circuit calculates the current contact impedance between the EEG electrode network and the subject's scalp surface and transmits the current contact impedance to the control unit.
[0029] The control unit receives the current contact impedance and writes it into the internal register to perform a data latching operation. After completing the data latching operation, the control unit sends a pulse trigger signal to the transcranial magnetic stimulation coil. During the period when the EEG amplification circuit enters the voltage saturation state, the control unit cuts off the data transmission connection between the impedance measurement circuit and the EEG electrode network. The control unit extracts the current contact impedance retained by the data latching operation to participate in the subsequent data processing flow.
[0030] See attached document Figure 1 The control unit extracts the current contact impedance retained during the data latching operation and participates in subsequent data processing. At the initial stage of the EEG localization method, the control unit divides the time axis based on the clock signal. The control unit sets a pulse trigger node on the time axis and allocates an idle time window before the pulse trigger node. Within the idle time window, the impedance measurement circuit injects an AC carrier wave into all EEG channels and calculates the current contact impedance corresponding to all EEG channels based on the feedback signal. The control unit receives the current contact impedance and stores it in a register to complete the data latching operation. The control unit then disconnects the data transmission link of the impedance measurement circuit.
[0031] The control unit sends a pulse trigger signal to the transcranial magnetic stimulation coil upon reaching the pulse trigger node, causing the coil to release an alternating magnetic field. This alternating magnetic field couples to the EEG electrode network and electrode leads, generating an induced voltage. This induced voltage travels along the electrode leads into the pre-clamping circuit. The pre-clamping circuit blocks any portion of the induced voltage that exceeds the limiting voltage threshold, outputting a clamping voltage that falls within the threshold range.
[0032] The EEG amplifier circuit receives a clamping voltage, which drives it into voltage saturation. In this saturation state, the EEG amplifier outputs its highest-level signal, and the analog-to-digital converter (ADC) maintains sampling without hardware masking the input. The ADC performs digital quantization on the highest-level signal and the subsequent voltage drop, arranging the quantized values in chronological order to generate a raw EEG signal stream recording the entire voltage saturation process. The ADC then sends this raw EEG signal stream to the control unit.
[0033] See attached document Figure 1 The analog-to-digital converter sends the raw EEG signal stream to the control unit to enter the feature extraction process. The control unit receives the raw EEG signal stream and defines a numerical comparison benchmark in the register. The control unit sets a positive saturation threshold voltage and a negative saturation threshold voltage for a single EEG channel among all EEG channels. The alternating magnetic field has spatial direction properties, which causes the amplitude of the positive induced voltage generated on the electrode leads to be different from that of the negative induced voltage. The discharge time of the positive induced voltage and the negative induced voltage on the capacitor inside the EEG amplifier circuit is asymmetrical.
[0034] The control unit calls internal comparison instructions to continuously compare the voltage values of the original EEG signal stream. The control unit monitors the downward trajectory of the original EEG signal stream as it leaves the voltage saturation state on the time axis. The control unit identifies the first time point when the positive voltage amplitude of the original EEG signal stream drops from its highest level and first crosses the positive saturation threshold voltage. The control unit records the timestamp of the first time point on the time axis. The control unit calculates the time span from the first time point to the pulse trigger node and records the time span as the positive original recovery time.
[0035] The control unit synchronously monitors the recovery trajectory of the original EEG signal flow in the negative polarity. The control unit identifies the second time point when the negative voltage amplitude of the original EEG signal flow rises from the lowest level and crosses the negative saturation threshold voltage for the first time. The control unit records the timestamp of the second time point on the time axis. The control unit calculates the time span from the second time point to the pulse trigger node and records the time span as the negative original recovery time. The control unit completes the extraction operation of time parameters of a single EEG channel in the positive and negative polarities.
[0036] See attached document Figure 1 After the control unit completes the extraction of time parameters for a single EEG channel in both positive and negative polarities, it initiates a dynamic normalization calculation process for the time constant. The EEG amplification circuit contains an input capacitor, which establishes a discharge circuit with the EEG electrode network and the subject's scalp surface. The state of the stratum corneum on the subject's scalp surface causes a change in the current contact impedance between the EEG electrode network and the subject's scalp surface. The time constant of the discharge circuit is constrained by this current contact impedance. Changes in the current contact impedance cause a shift in the time constant of the discharge circuit. This shift in the time constant results in time measurement errors in the positive and negative raw recovery times extracted by the control unit.
[0037] The control unit retrieves the current contact impedance latched in the register and reads the reference impedance set in the memory. The control unit substitutes the reference impedance, current contact impedance, positive original recovery time, and negative original recovery time into the normalization formula to perform algebraic calibration calculation.
[0038] ; In the formula, Represents EEG channels after impedance normalization. Normalized recovery time; Represents brainwave channels Original recovery time; Represents brainwave channels Reference impedance; Represents brainwave channels Current contact impedance; The number representing the brainwave channel.
[0039] The control unit converts the original positive recovery time into a positive normalized recovery time using a normalization formula, and also converts the original negative recovery time into a negative normalized recovery time using the same formula. Both the positive and negative normalized recovery times filter out time-varying interference caused by changes in current contact impedance. The control unit stores both the positive and negative normalized recovery times in a register to perform spatial feature extraction.
[0040] See attached document Figure 1 After storing the positive and negative normalized recovery times into the register, the control unit starts the spatial feature extraction process. The control unit performs time difference and time summation operations on all EEG channels. The control unit extracts the positive and negative normalized recovery times of the EEG channels. The control unit performs algebraic subtraction to calculate the time difference value and algebraic addition to calculate the time sum value.
[0041] ; ; In the formula, Represents brainwave channels Time difference score; Represents brainwave channels Time summation; Represents brainwave channels Positive normalized recovery time; Represents brainwave channels Negative normalized recovery time; This represents the brainwave channel number.
[0042] The memory stores the two-dimensional spatial coordinates of the EEG electrode network. The control unit reads the two-dimensional spatial coordinates to build an empty matrix. The control unit fills the empty matrix with the time difference values corresponding to all EEG channels according to the two-dimensional spatial coordinates to generate a directional feature matrix. The directional feature matrix records the projection distribution data of the alternating magnetic field direction. The control unit fills the empty matrix with the sum of the time values corresponding to all EEG channels according to the two-dimensional spatial coordinates to generate an intensity feature matrix. The intensity feature matrix records the intensity distribution data of the alternating magnetic field. The control unit merges and stacks the directional feature matrix and the intensity feature matrix in the channel dimension. The control unit outputs a dual-channel feature map matrix.
[0043] See attached document Figure 1After the control unit outputs the dual-channel feature map matrix, it starts the spatial mapping process. The control unit reads the artifact-free EEG signal recorded by the memory in the idle time window. The control unit performs global field power analysis on the artifact-free EEG signal. The control unit calculates the electric field micro-state vector based on the analysis results. The control unit performs tensor concatenation operation on the dual-channel feature map matrix and the electric field micro-state vector. The control unit merges them to generate a fused feature tensor.
[0044] The control unit retrieves the convolutional neural network model stored in the memory. The control unit inputs the fused feature tensor into the convolutional neural network model to perform forward inference operations. The output node of the convolutional neural network model calculates and generates a six-degree-of-freedom deviation vector. The six-degree-of-freedom deviation vector indicates the spatial relative offset relationship between the transcranial magnetic stimulation coil and the reference target point. The six-degree-of-freedom deviation vector consists of three-dimensional spatial coordinate deviation values and three-dimensional spatial attitude angle deviation values. The control unit outputs the six-degree-of-freedom deviation vector to complete the coordinate positioning.
[0045] See attached document Figure 1 The control unit outputs a six-degree-of-freedom deviation vector to complete coordinate positioning. This is based on the convolutional neural network model completing parameter iterative training. The computing platform executes the parameter iterative training process of the convolutional neural network model and connects to the robotic arm calibration system to obtain training sample data.
[0046] The robotic arm calibration system holds the transcranial magnetic stimulation coil and moves it to the set spatial position and posture. The internal sensors of the robotic arm calibration system record the standard three-dimensional spatial coordinate deviation value and the standard three-dimensional spatial posture angle deviation value of the transcranial magnetic stimulation coil relative to the reference target point. The calculation platform concatenates the standard three-dimensional spatial coordinate deviation value and the standard three-dimensional spatial posture angle deviation value to generate a standard six-degree-of-freedom deviation vector label.
[0047] The robotic arm calibration system stops moving, the transcranial magnetic stimulation coil releases an alternating magnetic field, the control unit synchronously acquires the raw EEG signal stream and generates a fusion feature tensor according to the control instructions, and the computing platform establishes a data association relationship between the fusion feature tensor and the standard six-degree-of-freedom deviation vector label.
[0048] The robotic arm calibration system continuously changes the spatial position and orientation of the transcranial magnetic stimulation coil based on the motion trajectory planning and repeatedly performs signal acquisition and label generation actions. The computing platform collects the fusion feature tensor and standard six-degree-of-freedom deviation vector labels generated under different spatial positions and orientations. The computing platform builds a training sample dataset based on the collected data and stores the training sample dataset in the memory for the convolutional neural network model to call.
[0049] See attached document Figure 1After the computing platform stores the training sample dataset into the memory for the convolutional neural network model to call, the computing platform reads the training sample dataset from the memory to execute the parameter iterative training process. The computing platform inputs the fused feature tensor in the training sample dataset into the convolutional neural network model. The convolutional neural network model performs forward inference operation and outputs the predicted three-dimensional space coordinate deviation value and the predicted three-dimensional space attitude angle deviation value.
[0050] The computing platform extracts the standard 3D spatial coordinate deviation values and standard 3D spatial attitude angle deviation values corresponding to the training sample dataset. The computing platform calculates the 3D spatial coordinate loss value generated by the predicted 3D spatial coordinate deviation value and the standard 3D spatial coordinate deviation value. The computing platform calculates the 3D spatial attitude angle loss value generated by the predicted 3D spatial attitude angle deviation value and the standard 3D spatial attitude angle deviation value. The computing platform substitutes the 3D spatial coordinate loss value and the 3D spatial attitude angle loss value into the joint loss function to calculate the joint loss value.
[0051] ; In the formula, Represents the combined loss value; Represents the coordinate weighting coefficient; This represents the numerical value of the three-dimensional spatial coordinate loss; Represents the attitude angle weighting coefficient; This represents the numerical value of the attitude angle loss in three-dimensional space.
[0052] The computing platform performs backpropagation based on the joint loss value. The computing platform updates the network node weight parameters of the convolutional neural network model based on the gradient data generated by the backpropagation operation. The computing platform continuously loops the data input and network node weight parameter update steps until the joint loss value reaches the set convergence threshold. When the joint loss value reaches the set convergence threshold, the computing platform stops the parameter iteration training process. The computing platform writes the convolutional neural network model that has completed the parameter iteration training process into the memory for the control unit to call and execute the spatial mapping process.
[0053] See attached document Figure 2 The computing platform writes the convolutional neural network model that has completed the parameter iteration training process into the memory for the control unit to call and execute the spatial mapping process. Then, a data acquisition and front-end processing module is established inside the control unit. The data acquisition and front-end processing module establishes a signal transmission link with the impedance measurement circuit, analog-to-digital converter and transcranial magnetic stimulation coil. The data acquisition and front-end processing module divides the time axis according to the clock signal. The data acquisition and front-end processing module sets the pulse trigger node on the time axis. The data acquisition and front-end processing module allocates an idle time window before the pulse trigger node.
[0054] During the idle time window, the data acquisition and front-end processing module sends a measurement command to the impedance measurement circuit. The impedance measurement circuit measures the current contact impedance corresponding to all EEG channels and feeds back the current contact impedance to the data acquisition and front-end processing module. The data acquisition and front-end processing module receives the current contact impedance, writes the current contact impedance into the register and performs a latching action. When the data acquisition and front-end processing module reaches the pulse trigger node, it outputs a pulse trigger signal to the transcranial magnetic stimulation coil.
[0055] The analog-to-digital converter continuously transmits the quantized raw EEG signal stream to the data acquisition and front-end processing module. The data acquisition and front-end processing module receives the raw EEG signal stream and performs numerical comparison and judgment operations. The data acquisition and front-end processing module identifies the first time point on the time axis based on the positive saturation threshold voltage, and identifies the second time point on the time axis based on the negative saturation threshold voltage. The data acquisition and front-end processing module calculates the positive raw recovery time and the negative raw recovery time, and outputs the positive raw recovery time and the negative raw recovery time to perform subsequent data processing actions.
[0056] See attached document Figure 2 The data acquisition and front-end processing module outputs the positive and negative original recovery times to perform subsequent data processing actions. The data calibration and feature construction module receives the positive and negative original recovery times. The data calibration and feature construction module retrieves the current contact impedance latched in the register and reads the reference impedance set in the memory. The data calibration and feature construction module performs a normalization operation on the reference impedance, the current contact impedance, the positive original recovery time, and the negative original recovery time. The data calibration and feature construction module calculates the positive normalized recovery time and the negative normalized recovery time.
[0057] The data calibration and feature construction module extracts the positive and negative normalized recovery times from all EEG channels. It performs algebraic subtraction and addition operations to generate time difference and time sum values. The module reads the two-dimensional spatial coordinates to establish an empty matrix. It fills the empty matrix with the time difference values according to the two-dimensional spatial coordinates to generate a directional feature matrix. It fills the empty matrix with the time sum values according to the two-dimensional spatial coordinates to generate an intensity feature matrix. Finally, the module merges and stacks the directional and intensity feature matrices along the channel dimension. The module outputs a dual-channel feature map matrix.
[0058] See attached document Figure 2The data calibration and feature construction module outputs a dual-channel feature map matrix, which is then passed to the spatial positioning and inference module for subsequent processing. The spatial positioning and inference module receives the dual-channel feature map matrix and reads the artifact-free EEG signals recorded in the memory within the idle time window. The spatial positioning and inference module performs global field power analysis on the artifact-free EEG signals and calculates the electric field micro-state vector based on the analysis results. The spatial positioning and inference module performs tensor concatenation operation on the dual-channel feature map matrix and the electric field micro-state vector, and merges them to generate a fused feature tensor.
[0059] The spatial positioning inference module retrieves the convolutional neural network model stored in the memory. The spatial positioning inference module inputs the fused feature tensor into the convolutional neural network model to perform forward inference operations. The output node of the convolutional neural network model calculates and generates a six-degree-of-freedom deviation vector. The six-degree-of-freedom deviation vector indicates the spatial relative offset relationship between the transcranial magnetic stimulation coil and the reference target point. The six-degree-of-freedom deviation vector is generated by combining the three-dimensional spatial coordinate deviation value and the three-dimensional spatial attitude angle deviation value. The spatial positioning inference module outputs the six-degree-of-freedom deviation vector to complete the coordinate positioning.
[0060] Specific application examples: In a transcranial magnetic stimulation (TMS) targeted therapy scenario in a hospital's neuromodulation laboratory, a TMS coil was placed on the outside of the subject's head, and a 64-channel EEG electrode network was attached to the scalp surface according to the standard EEG electrode spatial arrangement rules.
[0061] During system initialization, the reference impedance for all EEG channels recorded in the memory is set to 5kΩ. The limiting voltage threshold set inside the pre-clamping circuit is ±300mV. The control unit sets a positive saturation threshold voltage of 150mV and a negative saturation threshold voltage of -150mV for a single EEG channel.
[0062] During the idle time window, the impedance measurement circuit generates an AC carrier wave with a frequency of 1000 Hz and injects it into the EEG electrode network. In the experiment, due to changes in the state of the stratum corneum on the subject's scalp, the current contact impedance measured by EEG channel 15 shifted to 8 kΩ. The control unit wrote this current contact impedance into the internal register to perform a data latching operation.
[0063] The control unit sends a pulse trigger signal to the transcranial magnetic stimulation (TMS) coil upon reaching the pulse trigger node, causing the TMS coil to release an alternating magnetic field. The induced voltage travels along the electrode leads into the pre-clamping circuit; any voltage exceeding the limiting threshold is blocked, and a clamping voltage is output. The EEG amplifier circuit receives the clamping voltage and enters a voltage saturation state, maintaining signal conduction in this state. The analog-to-digital converter (ADC) continuously performs analog-to-digital conversion operations according to the sampling timing, generating a raw EEG signal stream with a complete time sequence.
[0064] The control unit invokes an internal comparison instruction to identify the descent trajectory of the raw EEG signal stream as it exits voltage saturation. It acquires the first time point at which the raw EEG signal stream crosses the positive saturation threshold voltage, extracting the positive raw recovery time as 48ms. Because the current contact impedance (8kΩ) is greater than the reference impedance (5kΩ), the time constant of the discharge circuit shifts, causing a time measurement error. The control unit retrieves the current contact impedance latched in the register and substitutes it into the normalization formula: ; Substituting the values into the normalization formula and performing algebraic calibration, the original positive recovery time is converted into a normalized positive recovery time (48ms × 5 / 8 = 30ms), successfully filtering out the time variable interference caused by the change in current contact impedance. Subsequently, the control unit performs time difference and time summation operations on all EEG channels, fills the results into an empty matrix according to the coordinates of the two-dimensional spatial arrangement, and outputs a dual-channel feature map matrix after merging and stacking.
[0065] The control unit reads artifact-free EEG signals recorded in the memory during the idle time window, performs global field power analysis, and calculates the electric field microstate vector. The dual-channel feature map matrix and the electric field microstate vector are then merged using a tensor concatenation operation to generate a fused feature tensor. This tensor is input into a convolutional neural network model that has completed its parameter iterative training process to perform forward inference operations. The final output is a six-degree-of-freedom deviation vector composed of three-dimensional spatial coordinate deviation values and three-dimensional spatial attitude angle deviation values, thus completing the coordinate localization.
[0066] The experimental verification and effect comparison are as follows: To verify the effectiveness of the present invention, the computing platform connected to the robotic arm calibration system acquired multiple sets of training sample data under different spatial positions and postures, established a training sample dataset, and executed the parameter iterative training process of the convolutional neural network model. Simultaneously, a comparative experiment was conducted on the actual positioning effect before and after the introduction of algebraic calibration operations in the normalization formula.
[0067] Reference Appendix Figure 3 , attached Figure 3This is a diagram illustrating the recovery trajectory and first time point identification of the original EEG signal stream according to the present invention. The diagram shows the attenuation changes of the original EEG signal stream generated by the analog-to-digital converter on the time axis. The high-level, gently sloping solid line represents the highest output level of the EEG amplifier circuit under voltage saturation. As the internal capacitor discharges, the original EEG signal stream exits the voltage saturation state and exhibits a downward trajectory. The horizontal dashed line in the diagram represents the positive saturation threshold voltage set by the control unit. When the downward trajectory first crosses this horizontal dashed line, the control unit identifies the first time point marked in the diagram. At this time, the time span from the first time point to the pulse trigger node can be recorded as the positive original recovery time, thereby providing high-precision original time parameters for the subsequent dynamic normalization calculation of the time constant.
[0068] Reference Appendix Figure 4 , attached Figure 4 This is a convergence curve of the joint loss value in the parameter iterative training process of this invention. The graph records the learning process of the computing platform performing backpropagation and updating the network node weight parameters. The solid line with circular markers in the graph represents the trajectory of the joint loss value as the number of parameter iterative training iterations increases, and the horizontal dotted line represents the set convergence threshold set by the computing platform. In the initial training stage, the joint loss value is high and decreases rapidly; as the data input and network node weight parameter update steps continue to cycle, the downward trend of the curve gradually flattens. When the parameter iterative training is close to the 80th iteration, the joint loss value successfully decreases and stabilizes below the set convergence threshold. At this point, the computing platform stops the parameter iterative training process, indicating that the convolutional neural network model has completed the learning of the spatial mapping relationship and has the ability to accurately output the six-degree-of-freedom bias vector.
[0069] Reference Appendix Figure 5 , attached Figure 5 This is a comparative graph showing the impact of changes in current contact impedance on the three-dimensional spatial coordinate positioning error. The horizontal axis represents the current contact impedance fed back by the impedance measurement circuit, and the vertical axis represents the three-dimensional spatial coordinate loss value output by the calculation platform. The dashed lines marked with squares represent the original calculation method without algebraic calibration, while the solid lines marked with triangles represent the result after the present invention performs algebraic calibration according to the normalization formula. In the experiment, the reference impedance set by the memory was 5kΩ. When the current contact impedance gradually deviated from the reference impedance, the time constant of the discharge circuit shifted significantly. The dashed lines show that without calibration, the time measurement error causes a significant increase in the three-dimensional spatial coordinate loss value, leading to positioning failure. The solid lines, however, show that by converting the original positive recovery time to a normalized positive recovery time to completely filter out interference, regardless of changes in the current contact impedance, the three-dimensional spatial coordinate loss value is consistently suppressed within a low error range, demonstrating the effectiveness of the normalization calibration feature of the present invention in improving spatial positioning accuracy.
Claims
1. A deep learning-based transcranial magnetic stimulation (TMS) EEG localization method, characterized in that, Includes the following steps: The current contact impedance of the EEG electrode network is measured based on the impedance measurement circuit. EEG signals are collected to generate raw EEG signal streams. Positive and negative saturation threshold voltages are set. The first time point when the raw EEG signal stream crosses the positive saturation threshold voltage and the second time point when it crosses the negative saturation threshold voltage are obtained. The positive and negative raw recovery times are extracted. The reference impedance, artifact-free EEG signal, and convolutional neural network model recorded in the memory are read. The reference impedance, the current contact impedance, the positive original recovery time, and the negative original recovery time are converted into positive normalized recovery time and negative normalized recovery time. The positive normalized recovery time and the negative normalized recovery time are extracted, algebraic addition and subtraction operations are performed, and combined with the two-dimensional spatial arrangement coordinates of the EEG electrode network, a dual-channel feature map matrix is calculated and output. The artifact-free EEG signal is calculated as an electric field microstate vector. The dual-channel feature map matrix and the electric field microstate vector are merged to generate a fused feature tensor. This tensor is then input into the convolutional neural network model to calculate a six-degree-of-freedom deviation vector to complete coordinate localization.
2. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 1, characterized in that, The step of measuring the current contact impedance of the EEG electrode network based on the impedance measurement circuit specifically includes: An idle time window is established. Within the idle time window, the impedance measurement circuit generates an AC carrier and continuously injects the AC carrier into the EEG electrode network, receives feedback voltage signals, calculates the current contact impedance based on the feedback voltage signals, and performs a data latching operation.
3. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 2, characterized in that, After calculating the current contact impedance based on the feedback voltage signal, the process includes: The data latching operation is completed and a pulse trigger signal is sent to the transcranial magnetic stimulation coil. The transcranial magnetic stimulation coil generates an alternating magnetic field. The alternating magnetic field passes through the EEG electrode network and electrode leads to generate an induced voltage. The induced voltage is transmitted along the electrode leads to the pre-clamping circuit.
4. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 3, characterized in that, The pre-clamping circuit performs a limiting operation on the induced voltage and outputs a clamping voltage. The clamping voltage is transmitted to the EEG amplification circuit, which enters a voltage saturation state and outputs the highest level signal in the voltage saturation state.
5. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 4, characterized in that, The steps for generating the raw EEG signal stream specifically include: The analog-to-digital converter performs digital quantization conversion on the highest level signal and the subsequent level drop process to generate the original EEG signal stream that records the entire process of voltage saturation.
6. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 1, characterized in that, The specific steps for calculating and outputting the dual-channel feature map matrix include: Extract the positively normalized recovery time and the negatively normalized recovery time, perform algebraic subtraction and algebraic addition operations to generate time difference values and time sum values, fill the empty matrix with the time difference values corresponding to all EEG channels according to the two-dimensional spatial coordinates to generate a direction feature matrix, fill the empty matrix with the time sum values corresponding to all EEG channels according to the two-dimensional spatial coordinates to generate an intensity feature matrix, and merge and stack the direction feature matrix and the intensity feature matrix in the channel dimension to output the dual-channel feature map matrix.
7. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 1, characterized in that, The step of calculating the artifact-free EEG signal into an electric field micro-state vector specifically includes: Global field power analysis is performed on the artifact-free EEG signal, and the electric field micro-state vector is calculated based on the analysis results.
8. The deep learning-based transcranial magnetic stimulation EEG localization method according to claim 1, characterized in that, The convolutional neural network model completes parameter iterative training, connects to the robotic arm calibration system to obtain training sample data, concatenates the standard three-dimensional spatial coordinate deviation values and the standard three-dimensional spatial attitude angle deviation values to generate a standard six-degree-of-freedom deviation vector label, continuously changes the spatial position and spatial attitude of the transcranial magnetic stimulation coil to generate a fusion feature tensor, and establishes a data association relationship between the fusion feature tensor and the standard six-degree-of-freedom deviation vector label to build a training sample dataset.
9. A deep learning-based transcranial magnetic stimulation EEG localization method according to claim 8, characterized in that, The fused feature tensor from the training sample dataset is input into the convolutional neural network model to output the predicted 3D spatial coordinate deviation value and the predicted 3D spatial attitude angle deviation value. The 3D spatial coordinate loss value and the 3D spatial attitude angle loss value are calculated, and backpropagation is performed to generate gradient data to update the network node weight parameters of the convolutional neural network model.
10. A deep learning-based transcranial magnetic stimulation EEG localization device, characterized in that, The method for localizing transcranial magnetic stimulation (TMS) EEG based on deep learning, as described in any one of claims 1-9, comprises: The data acquisition and front-end processing module is used to measure the current contact impedance of the EEG electrode network based on the impedance measurement circuit, generate the original EEG signal flow, set the positive saturation threshold voltage and the negative saturation threshold voltage, obtain the first time point when the original EEG signal flow crosses the positive saturation threshold voltage and the second time point when it crosses the negative saturation threshold voltage, and extract the positive original recovery time and the negative original recovery time. The data calibration and feature construction module is used to read the reference impedance, artifact-free EEG signal and convolutional neural network model recorded in the memory, convert the reference impedance, the current contact impedance, the positive original recovery time and the negative original recovery time into positive normalized recovery time and negative normalized recovery time, extract the positive normalized recovery time and the negative normalized recovery time, perform algebraic addition and subtraction operations on the positive normalized recovery time and the negative normalized recovery time, and combine them with the two-dimensional spatial arrangement coordinates of the EEG electrode network to calculate and output a dual-channel feature map matrix; The spatial positioning reasoning module is used to calculate the artifact-free EEG signal into an electric field microstate vector, merge the dual-channel feature map matrix and the electric field microstate vector to generate a fused feature tensor, and input it into the convolutional neural network model to calculate the six-degree-of-freedom deviation vector to complete the coordinate positioning.