Electrical stimulation device and method for generating electrical stimulation signals
By generating a finite element model and optimizing electrode position and current intensity using particle swarm algorithm, the problem of difficult to personalize electrode selection in existing equipment is solved, achieving a more efficient and accurate electrical stimulation effect.
Patent Information
- Application Number
- CN202211333806.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-10-28
AI Technical Summary
The existing transcranial DC stimulation equipment is difficult to achieve personalized electrode selection and stimulation scheme optimization, which makes it difficult to accurately control the stimulation range, affecting the accuracy and efficiency of electrical stimulation.
By segmenting the nuclear magnetic image, the optimization objective function is solved using particle swarm algorithm and natural heuristic algorithm to generate the Pareto frontier, and thus select the Pareto optimal solution to generate an electrical stimulation signal and optimize the electrode position and current intensity.
It improves the accuracy and efficiency of electrical stimulation, forms a more personalized stimulation solution, and enhances the flexibility and accuracy of electrical stimulation.
Smart Images

Figure CN115691816B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of transcranial electrical stimulation, and in particular to an electrical stimulation device and a method for generating an electrical stimulation signal. Background Art
[0002] Transcranial direct current stimulation (tDCS) is a non-invasive neurostimulation technology that applies low-intensity currents through scalp electrodes, ultimately acting on specific brain areas to regulate neural activity in the cerebral cortex. Related studies have found that transcranial direct current stimulation has a regulatory effect on emotional regulation, enhancing cognitive ability, etc. Early transcranial direct current stimulation was performed through electrodes connected to the scalp. Such electrodes have a large area, and the current diffuses greatly between tissues, making it difficult to accurately control the stimulation range. To solve this problem, a group of high-resolution electrical stimulation devices with multiple small-sized electrode heads have been developed. This type of stimulation device has a large number of electrodes and strong adjustability, and the choice of electrode position and current intensity has a decisive influence on the effect of transcranial direct current stimulation.
[0003] In addition, due to the significant differences in individual head shapes and target points, and the different specifications and parameters of different electrical stimulation devices, the stimulation plan needs to be personalized and optimized to improve the accuracy and efficiency of stimulation. However, existing electrical stimulation devices rely heavily on the user's experience in the selection of activation electrodes, making personalized selection difficult, resulting in poor flexibility in the optimization of their stimulation plans. Summary of the Invention
[0004] In view of this, in order to solve the problems of the prior art, the present invention provides an electrical stimulation device and an electrical stimulation signal generating method.
[0005] In a first aspect, the present invention provides an electrical stimulation device comprising:
[0006] a controller configured to segment the acquired nuclear magnetic resonance image and form a corresponding finite element model, perform an electrical stimulation simulation on the finite element model, collect stimulation responses, and solve an optimization objective function corresponding to predetermined target optimization parameters based on the stimulation responses and a nature-inspired algorithm to obtain a Pareto front; and select a Pareto optimal solution from the Pareto front to generate a corresponding electrical stimulation signal;
[0007] The electrode cap is used to receive the electrical stimulation signal sent by the controller.
[0008] In an optional embodiment, segmenting the acquired nuclear magnetic resonance image and forming a corresponding finite element model includes:
[0009] Segmenting different tissue structures of the MRI image of the subject's head based on an algorithm to obtain a head segmentation model, wherein corresponding conductivity information is assigned to each tissue in the head segmentation model;
[0010] The head segmentation model is converted into a 3D mesh according to the brain structure to generate a finite element model.
[0011] In an optional embodiment, performing electrical stimulation simulation on the finite element model and collecting stimulation responses includes:
[0012] Single-channel electrical stimulation simulations are performed successively on the electrode positions corresponding to the finite element head model, and stimulation responses corresponding to each finite element in the finite element model are collected.
[0013] In an optional embodiment, solving the optimization objective function corresponding to the predetermined target optimization parameter according to the stimulus response and nature-inspired algorithm to obtain the Pareto front includes:
[0014] Using a particle swarm algorithm, according to predetermined target optimization parameters and their corresponding optimization objective functions, a particle swarm is initialized and generated, wherein each particle in the particle swarm corresponds to the optimization objective functions of at least two of the target optimization parameters and is used to represent a combination scheme of at least two of the target optimization parameters;
[0015] Based on predetermined constraints and the stimulus response, a Pareto optimal solution of each particle in the particle swarm is calculated to form a corresponding Pareto frontier, wherein the Pareto optimal solution is used to represent an optimized combination scheme of at least two of the target optimization parameters.
[0016] In an optional embodiment, after the particle swarm algorithm is used to initialize and generate a particle swarm based on predetermined constraints and the stimulus response, the method further includes:
[0017] A random number generator is used to generate multiple random numbers in the interval (-1, 1), the number of which is consistent with the number of leads of the electrical stimulation device. The random numbers are used to represent the initial position of each particle in the particle group, and the initial velocity of each particle is zero.
[0018] In an optional embodiment, the calculating the Pareto optimal solution of each particle in the particle swarm based on the predetermined constraint condition and the stimulus response to form the corresponding Pareto front includes:
[0019] Based on a predetermined constraint and the stimulus response, calculating a first external solution set corresponding to each particle in the particle swarm, each solution in the first external solution set being an optimal solution of the objective function corresponding to each particle;
[0020] calculating the crowding degree of each particle in the first external solution set, and selecting a global optimal solution from the first external solution set according to the crowding degree;
[0021] Based on the global optimal solution, updating the speed and position of each particle in the particle swarm;
[0022] Calculating the updated Pareto optimal solution of each particle, and adding the Pareto optimal solution to the first external solution set;
[0023] Performing crossover and mutation calculations on the first external solution set to obtain a second external solution set;
[0024] Calculate the Pareto front corresponding to the second external solution set.
[0025] In an optional embodiment, calculating the updated Pareto optimal solution of each particle and adding the Pareto optimal solution to the first external solution set includes:
[0026] Calculate the current fitness of each updated particle;
[0027] If the current fitness of each particle can Pareto dominate the historical optimal fitness corresponding to the particle, then the position corresponding to the current fitness of each particle is taken as the current individual optimal solution, and the historical minimum fitness of the particle is the historical optimal fitness;
[0028] Calculating the Pareto optimal solution of each particle according to the current individual optimal solution;
[0029] The Pareto optimal solution is added to the first external solution set.
[0030] In an optional embodiment, after calculating the Pareto front corresponding to the second external solution set, the method further includes:
[0031] If the number of particles in the Pareto front is greater than a predetermined limit, the congestion degree of each particle in the Pareto front is calculated to eliminate particles with the smallest congestion degree until the number of particles is no greater than the predetermined limit.
[0032] In a second aspect, the present invention provides a method for generating an electrical stimulation signal, comprising:
[0033] Segment the acquired MRI images and generate corresponding finite element models;
[0034] Performing electrical stimulation simulation on the finite element model, collecting stimulation responses, and solving an optimization objective function corresponding to predetermined target optimization parameters based on the stimulation responses and a nature-inspired algorithm to obtain a Pareto frontier;
[0035] A Pareto optimal solution is selected from the Pareto front to generate a corresponding electrical stimulation signal.
[0036] In a third aspect, the present invention provides a computer storage medium storing a computer program, wherein when the computer program is executed, the aforementioned method for generating an electrical stimulation signal is implemented.
[0037] The embodiments of the present invention have the following beneficial effects:
[0038] This embodiment uses a particle swarm algorithm to generate a particle swarm containing multiple particles based on multiple transcranial electrical stimulation optimization objectives (target optimization parameters to be optimized), with each particle representing a combination of at least two optimization objectives. A genetic algorithm is then used to calculate the Pareto front of the particle swarm to simultaneously optimize multiple optimization objectives, forming a stimulation scheme that includes multiple optimization objectives. This allows a Pareto optimal solution to be selected from the Pareto front, and an electrical stimulation signal corresponding to the stimulation scheme is generated to complete the electrical stimulation. Furthermore, this embodiment can optimize and generate a corresponding stimulation scheme based on the number of desired optimization objectives. Therefore, the resulting stimulation scheme is more personalized, thereby increasing the optimization flexibility of the stimulation scheme and improving the accuracy and efficiency of electrical stimulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.
[0040] Figure 1 shows a first structural schematic diagram of an electrical stimulation device according to an embodiment of the present invention;
[0041] Figure 2 shows a second structural schematic diagram of the electrical stimulation device according to an embodiment of the present invention;
[0042] Figure 3 A schematic diagram showing a first implementation of a method for generating an electrical stimulation signal according to an embodiment of the present invention is shown;
[0043] Figure 4 FIG2 shows a schematic diagram of a second embodiment of the method for generating an electrical stimulation signal according to an embodiment of the present invention;
[0044] Figure 5 FIG2 shows a schematic diagram of a third implementation of the method for generating an electrical stimulation signal according to an embodiment of the present invention;
[0045] Figure 6 FIG4 is a schematic diagram showing a fourth embodiment of the method for generating an electrical stimulation signal according to an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of the Pareto front in an embodiment of the present invention is shown;
[0047] Figure 8 A schematic diagram of a Pareto plane according to an embodiment of the present invention is shown;
[0048] Figure 9 A schematic diagram of the visualization results of the optimization scheme in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0050] The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the figures is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by those skilled in the art based on the embodiments of the present invention without inventive effort are intended to be within the scope of protection of the present invention.
[0051] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0052] Furthermore, the terms “first,” “second,” “third,” etc., are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0053] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present invention pertain. Terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as their contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present invention.
[0054] Transcranial direct current stimulation (tDCS) is a non-invasive neurostimulation technique that applies low-intensity currents to scalp electrodes, ultimately acting on specific brain regions to modulate cortical neural activity. tDCS is achieved by applying voltage from an electrical stimulation device to electrodes in an electrode cap to trigger the stimulation.
[0055] Based on this, Figure 1 As shown, this embodiment provides an electrical stimulation device, including a controller 100 and an electrode cap 200; the controller 100 is used to segment the acquired nuclear magnetic resonance image and generate a corresponding finite element model, perform electrical stimulation simulation on the finite element model, collect stimulation responses, and solve the optimization objective function corresponding to the predetermined target optimization parameters based on the stimulation responses and the nature-inspired algorithm to obtain the Pareto front; a Pareto optimal solution is selected from the Pareto front to generate a corresponding electrical stimulation signal; the electrode cap 200 is used to receive the electrical stimulation signal sent by the controller 100.
[0056] For example, Figure 2 As shown, the structure of the electrical stimulation device can be further subdivided into an electrode cap 200, an I / O module 300, and a controller 100. The electrode cap 200 contains a certain number of electrodes for collecting EEG data or MRI images from the subject. The electrodes on the electrode cap 200 not only receive electrical signals from the brain but also transmit them in the opposite direction, transmitting stimulation signals from the upper circuit to the scalp for transcranial electrical stimulation. The I / O module 300 is responsible for receiving and processing analog and digital signals from both ends. Specifically, it receives and amplifies EEG signals collected by the electrode cap 200, converting them to digital signals after analog-to-digital conversion. It also receives digital signals from the upper circuit, converts and scales them on specific leads to analog stimulation signals, and transmits them to the corresponding electrodes. The activation status of a certain number of electrodes can be customized as needed. The controller 100 is responsible for communicating with the computer, integrating the digital signals sent by the I / O module 300 and transmitting them to the computer. It also aligns and processes the digital signals according to the stimulation instructions output, and outputs them to the I / O module 300.
[0057] In short, the controller 100 sends stimulation instructions (electrical stimulation signals) according to the electrical stimulation requirements, the I / O module 300 converts the digital-to-analog signals into corresponding analog signals, activates the required electrodes, and finally transmits the electrical signals to the subject's scalp through the electrodes on the electrode cap 200 to complete the stimulation.
[0058] When completing electrical stimulation, due to the significant differences in individual head shapes and target points, and the different specifications and parameters of different electrical stimulation devices, it is necessary to customize and optimize the stimulation scheme to improve the accuracy and efficiency of electrical stimulation. In addition, it is necessary to optimize the various target optimization parameters (such as the intensity and convergence of electrical stimulation) during the electrical stimulation process. Based on this, this embodiment also provides an electrical stimulation signal generation method, which is applied to the controller 100 of the electrical stimulation device. The controller 100 optimizes the target optimization parameters of the electrical stimulation to form an optimization scheme that can simultaneously optimize multiple target optimization parameters, and then selects an optimization scheme to generate a corresponding electrical stimulation signal to complete the electrical stimulation. In addition, the electrical stimulation signal generation method provided in this embodiment can be applied not only to fields such as electrical stimulation, but also to fields such as brain-computer interface, human-computer interaction, and neural regulation, and has good scalability and practicality.
[0059] Please refer to Figure 3 This embodiment provides a method for generating an electrical stimulation signal, which is used for the controller 100. The method is described in detail below.
[0060] S10, segmenting the acquired nuclear magnetic resonance image and generating a corresponding finite element model.
[0061] Obtain a magnetic resonance imaging (MRI) image of the subject's head and segment it to identify different brain tissue structures. Open-source tools such as iso2mesh or Gmsh can be used to segment the MRI image to identify different tissue structures, thereby forming a head segmentation model. Tissue structures include white matter, gray matter, cerebrospinal fluid, skull, scalp, cavities, electrodes, gel, etc.
[0062] Specifically, tissue boundaries (scalp; skull; cerebrospinal fluid (CSF), including ventricles, gray matter, and white matter) are derived from MRI images, and the finite element method is used to calculate the electric potential in the head subject to appropriate boundary conditions, thereby demarcating the tissue structure.
[0063] Furthermore, we assume that the electrical conductivity of all tissue structures is isotropic, and set different conductivity for each tissue, with the following specific values: 0.126 S / m (white matter), 0.276 S / m (gray matter), 1.65 S / m (cerebrospinal fluid), 0.01 S / m (skull), 0.465 S / m (scalp), 2.5e-14 S / m (cavity), 5.9e7 S / m (electrode), 0.3 S / m (gel).
[0064] Virtual electrodes are placed on the generated head segmentation model, which is then subdivided into a 3D mesh based on brain structure to generate a finite element model, where the finite elements are brain voxels. Furthermore, the voltage distribution on this finite element model is controlled by the curl equation of the current density, which is expressed as follows:
[0065]
[0066] Where σ represents electrical conductivity and V represents tissue volume.
[0067] This process can be implemented using open-source software packages (such as Simnibs), which can generate a finite element model of the subject. The finite element model contains the position of each finite element in the spatial coordinate system and the relationship matrix between the electric field distribution of the scalp electrodes and the head model finite element.
[0068] S20, performing electrical stimulation simulation on the finite element model, collecting stimulation responses, and solving the optimization objective function corresponding to the predetermined target optimization parameters based on the stimulation responses and the nature-inspired algorithm to obtain the Pareto front.
[0069] An electrical stimulation simulation is performed on the finite head model to collect the stimulation responses of each finite element of the finite head model. Based on the measurement parameters contained in the stimulation response and the nature-inspired algorithm, the optimization objective function corresponding to the predetermined target optimization parameters is solved to obtain the Pareto front.
[0070] Specifically, according to the number of leads and electrode shapes of the electrical stimulation device that need to be optimized, at all optional electrode positions on the constructed finite element model, the open source software package (Simnibs) is used to perform single-channel electrical stimulation simulation on the finite element model one by one, and the stimulation responses of each finite element are collected, all stimulation responses are aggregated, and a forward matrix is generated. The forward matrix contains the stimulation response information of the electrical stimulation device to each voxel (finite element) in the brain, and then according to the electrical stimulation measurement parameters contained in the stimulation response information, the optimization objective function corresponding to each predetermined target optimization parameter is solved. Among them, the measurement parameters include but are not limited to the electrical stimulation applied by the electrical stimulation device, the current value of each electrode input, etc., and the target optimization parameters include but are not limited to the intensity of the electrical stimulation, the degree of convergence, the avoidance area, the limit on the number of stimulation electrodes used, etc.
[0071] It can be understood that each target optimization parameter is a target to be optimized during the electrical stimulation process, and the optimization scheme includes the optimization of at least two target optimization parameters.
[0072] For example, when the optimization target is the intensity of electrical stimulation, the corresponding optimization objective function is the electric field intensity f1 in the desired direction at the electrode that maximizes the intensity. Its mathematical expression is as follows:
[0073] max f1(s)=eCs;
[0074] If the electric field direction is not specified, the unconstrained electric field intensity f2 at the electrode can be calculated using the three-axis electric field. The mathematical expression is as follows:
[0075]
[0076] In addition, in the case of multi-target electrode stimulation, the field strength of multiple electrodes (target points) can be maximized simultaneously.
[0077] For example, when the optimization goal is the convergence of electrical stimulation, the half-maximum radius (half-maximum radius) is used to represent the convergence of electrical stimulation. Using the spatial position information of brain voxels, the distance of each brain voxel from the target point is calculated, and the electric field strength (f3) of the brain voxels is added from near to far until the value obtained is greater than or equal to half of the sum of the electric fields of all brain voxels. At this time, the distance (r) from the brain voxel to the target electrode point is the half-maximum radius (r0.5), and its mathematical expression is as follows:
[0078]
[0079] min f3(s)=r 0.5 ;
[0080] For example, when the optimization target is the avoidance zone, the electric field intensity (f4) within the avoidance zone should be as small as possible. When multiple targets are set, multiple optimized avoidance zones can be obtained. The mathematical expression is as follows:
[0081] min f4(s)=eCs;
[0082] For example, when the optimization goal is to limit the number of stimulation electrodes used (f5), the corresponding mathematical expression is as follows:
[0083] min f5(s)=||s||0;
[0084] Here, ||s||0 refers to the zero-norm of s, and the zero-norm represents the number of non-zero elements in the vector (that is, its sparsity).
[0085] In addition, for safety reasons, corresponding limiting conditions need to be set in advance. The predetermined limiting conditions include limiting the total injection current and limiting the maximum current at each electrode.
[0086] For example, when the constraint is to limit the total injected current (i.e., the maximum total current, g1), according to Kirchhoff's current law, the total inflow current is equal to the total outflow current. Therefore, the mathematical expression corresponding to the constraint is:
[0087] g1(s)=∑ m |s i |+|∑m s m |≤2I max ;
[0088] When using small electrodes, it is also necessary to limit the maximum current at each electrode; otherwise, the relatively high current density may create risks, such as skin irritation and burns to the subject. Limiting the maximum current at each electrode includes limiting the current of all electrodes participating in the optimization (g2) and the current of the reference electrode (g3). The current of the electrodes participating in the optimization can be directly limited by the model code and does not require additional consideration; the corresponding mathematical expression is as follows:
[0089] g2(s)=|s m |≤I ind ;
[0090] g3(s)=|∑ m s m |≤I ind .
[0091] The meanings of the parameters in the above mathematical expressions are shown in Table 1 below:
[0092] Table 1 Parameter meaning
[0093] symbol describe shape A Forward Matrix N*M*3 C Partial forward matrix at the target point N*1*3 e Expected direction of electric field 1 s Electrical stimulation applied by the device 1*N <![CDATA[s m ]]> The current applied by lead number m 1 <![CDATA[I max ]]> Total input current specified by the safety protocol (2mA) 1 <![CDATA[I ind ]]> The current that can be input into a single electrode according to the safety protocol (1mA) 1
[0094] In one embodiment, if Figure 4 As shown, in step S20, "solving the optimization objective function corresponding to the predetermined target optimization parameters according to the stimulus response and nature-inspired algorithm to obtain the Pareto front" specifically includes the following steps:
[0095] S21, using a particle swarm algorithm, based on predetermined target optimization parameters and their corresponding optimization objective functions, initialize and generate a particle swarm, wherein each particle in the particle swarm corresponds to the optimization objective function of at least two target optimization parameters, and is used to represent a combination scheme of the at least two target optimization parameters.
[0096] After obtaining the subject's MRI images and stimulus response data, an optimization algorithm is designed based on the optimization objective function corresponding to each target optimization parameter to be optimized and predetermined constraints to optimize the stimulation optimization scheme containing each target optimization parameter. Each optimization scheme includes the optimization of at least two target optimization parameters. In this embodiment, a particle swarm algorithm based on a nature-inspired algorithm is used to optimize the stimulation optimization scheme, that is, the particle swarm algorithm is used to solve the optimization objective function.
[0097] A nature-inspired algorithm is a technology inspired by processes observed in nature. The particle swarm algorithm is a population-based stochastic optimization technology that imitates the clustering behavior of insects, animal flocks, bird flocks, and fish schools. These groups search for food in a cooperative manner, and each member of the group continuously changes its search pattern by learning from its own experience and the experience of other members.
[0098] This embodiment also uses the Pareto relationship to calculate the Pareto frontier of each optimization objective function corresponding to the target optimization parameters to achieve multi-objective optimization. For a solution, if no other solution in the variable space can dominate it, then this solution is a Pareto optimal solution. The set of all Pareto optimal solutions is the Pareto frontier.
[0099] The particle swarm algorithm simulates birds in a flock by designing massless particles with only two properties: velocity (V) and position (x). Each particle represents an optimization solution, with its position in a high-dimensional space representing the intensity of electrical stimulation for each channel, and its velocity representing the direction of the stimulation optimization. The entire collection of particles is considered a population, and the pre-set optimal solution or the Pareto front of the population is added to an external solution set to store the global optimal solution.
[0100] Each particle searches for the optimal solution in the search space independently and records it as the current individual optimal solution (pbest). Then, it uses the crowding method to select a solution from the external solution set as the global optimal solution (gbest). All particles in the particle swarm adjust their speed and position according to the current individual extreme value they have found and the current global optimal solution they have selected from the external solution set. The mathematical expression is as follows:
[0101] V i+1 =V i +C1*rand()*(pbest-x i )+C2*rand()*(gbest-x i );
[0102] In addition, a random function (rand()) that can generate random numbers is used to control the degree to which the speed is affected, wherein rand() generates a random value from 0 to 1, which is used to control the degree to which the speed is affected by the self-cognition item and the group cognition item respectively.
[0103] Based on the predetermined target optimization parameters and their corresponding optimization objective functions, a predetermined population of particles is initialized and generated to form a particle swarm. The population size is not limited herein. Each particle in the particle swarm corresponds to the optimization objective function of at least two target optimization parameters and is used to represent a combination of the at least two target optimization parameters.
[0104] To meet the constraints of limiting the total injected current, a random number generator was used to generate multiple random numbers in the interval (-1, 1). The number of random numbers corresponded to the number of leads in the electrical stimulation device used for the electrical stimulation simulation. The random numbers were used to represent the initial position of each particle in the particle swarm, and the initial velocity of each particle was zero. The position of the particle was the individual optimal solution for that particle. The number of leads was not limited here.
[0105] S22, based on the predetermined constraints and stimulus response, calculating the Pareto optimal solution of each particle in the particle swarm, and correspondingly forming a Pareto frontier, where the Pareto optimal solution is used to represent an optimal combination scheme of at least two target optimization parameters.
[0106] Based on the predetermined constraints and the measurement parameters contained in the stimulus response, the Pareto relationship of each particle in the particle swarm is calculated to obtain the Pareto optimal solution of each particle, so as to form a Pareto front. Each particle in the Pareto front (Pareto optimal solution) is used to represent an optimized combination scheme of at least two target optimization parameters.
[0107] In one embodiment, if Figure 5 As shown, step S22 includes the following steps:
[0108] S221 , based on predetermined constraints and stimulus responses, calculating a first external solution set corresponding to each particle in the particle swarm, wherein each solution in the first external solution set is an optimal solution of the objective function corresponding to each particle.
[0109] While the particle swarm is being generated by initialization, the solution of each particle in the particle swarm is calculated by using predetermined constraints and measurement parameters included in the stimulus response to form a first external solution set.
[0110] Then, a fitness algorithm is used to calculate the Pareto optimal solution for each particle in the first external solution set, and the solution is added to the first external solution set to form a second external solution set. Multiple Pareto optimal solutions can form a Pareto frontier. That is, the second external solution set is composed of the Pareto frontier of the particle swarm, and each particle in the Pareto frontier is used to represent an optimization combination scheme of at least two target optimization parameters.
[0111] S222, calculating the crowding degree of each particle in the first external solution set, and selecting a global optimal solution from the first external solution set according to the crowding degree.
[0112] Before using the fitness algorithm to calculate the Pareto optimal solution for each particle in the first external solution set, it is necessary to calculate the crowding (density) between the particles in the first external solution set. The distance between the two closest particles in the decision space of each particle in the first external solution set is considered the crowding of the particle. The greater the crowding of a particle, the more unique the optimization solution represented by the particle is, and the more worthy of retention and development.
[0113] Then, a solution is selected from the first external solution set according to the congestion as the global optimal solution. The global optimal solution is selected according to probability. The greater the congestion of the particle, the easier it is to be selected. That is, the greater the congestion of the particle, the greater the probability that the particle is the global optimal solution.
[0114] S223, based on the global optimal solution, update the speed and position of each particle in the particle swarm.
[0115] According to the current individual optimal value of each particle in the particle swarm and the selected global optimal solution, the properties of each particle in the particle swarm are updated and adjusted. The properties include position and speed, that is, the speed and position of each particle are updated.
[0116] Specifically, each particle in the particle swarm searches for the optimal solution in the search space individually and records it as the current individual optimal solution. All particles in the particle swarm adjust their speed and position according to the current individual extreme value they find and the current global optimal solution they select from the external solution set.
[0117] S224 , calculating the updated Pareto optimal solution of each particle, and adding the Pareto optimal solution to the first external solution set.
[0118] The Pareto optimal solution of each updated particle in the particle swarm is calculated to add the Pareto optimal solution to the first external solution set to generate a Pareto frontier.
[0119] In one embodiment, if Figure 6 As shown, step S224 includes the following steps:
[0120] S2241, calculate the current fitness of each updated particle.
[0121] The particle position information, i.e., the electrical stimulus s applied by the device, is substituted into the mathematical expression corresponding to the optimization objective function of the target optimization parameter and the predetermined constraint conditions (optimizing the intensity and convergence of the electrical stimulus as the optimization goal, with the motor cortex as the target), and the preliminary fitness is calculated. The two constraints are unified according to the constraint violation value (CV) as follows:
[0122]
[0123] The bracket operator 〈α〉 indicates that if α<0, zero is returned, otherwise α is returned. It is the normalized function of the variable in the constraint condition minus the constraint, specifically:
[0124]
[0125] In this embodiment, the smaller the fitness, the better the fitness (all fitness are non-negative numbers). Therefore, a minimum value is added to the maximized optimization objective function (to prevent the value from reaching 0) and the inverse is taken. Then, the processed result and the weighted (weight value is not limited) constraint violation value (CV) are added together as the current fitness value of the particle.
[0126] S2242: If the current fitness of each particle can Pareto dominate the historical optimal fitness of the particle, the position corresponding to the current fitness of each particle is taken as the current individual optimal solution, and the historical minimum fitness of the particle is taken as the historical optimal fitness.
[0127] If the current fitness of the particle can Pareto dominate the historical optimal fitness of the particle, then the current position of the particle is recorded as the individual optimal solution of the particle.
[0128] S2243, calculate the Pareto optimal solution of each particle based on the current individual optimal solution.
[0129] S2244, adding the Pareto optimal solution to the first external solution set.
[0130] According to the individual optimal solution, the Pareto relationship is calculated for each particle to obtain the Pareto optimal solution, and all Pareto optimal solutions are added to the first external solution set.
[0131] S225 , performing crossover and mutation calculations on the first external solution set to obtain a second external solution set.
[0132] A random number is used to determine whether to perform mutation and crossover on the first external solution set. Specifically, a random number generator generates a value between 0 and 1. If the random number is greater than a predetermined threshold, it is considered true, indicating that mutation and crossover are performed. The predetermined threshold is not limited here and can be set to 0.5, for example.
[0133] When the first external solution set is subjected to the genetic algorithm's simulated binary crossover and polynomial mutation, the offspring and parent generations generated in the process are merged to form a second external solution set. The genetic algorithm can be implemented by an open source toolkit (such as Geatpy).
[0134] S226, calculating the Pareto front corresponding to the second external solution set.
[0135] Perform a Pareto sorting calculation on the second external solution set to obtain the Pareto front. Furthermore, if the number of particles in the Pareto front exceeds a predetermined limit, calculate the congestion degree of each particle in the Pareto front and remove the particle with the smallest congestion degree until the number of particles is no greater than the predetermined limit.
[0136] Furthermore, the Pareto front represents the optimization result after optimization, such as Figure 7As shown, the optimization result of the two optimization objectives is a Pareto frontier, such as Figure 8 As shown in , two or more optimization objectives are a Pareto hyperplane. Each point in the Pareto hyperplane or Pareto front represents an optimization result, which can be selected according to the target optimization parameters to be optimized. The visualization results corresponding to the optimization scheme are shown in Figure 9 shown.
[0137] S30, selecting a Pareto optimal solution from the Pareto front to generate a corresponding electrical stimulation signal.
[0138] The controller 100 selects a Pareto optimal solution from the Pareto front according to the electrical stimulation requirements, or randomly selects a Pareto optimal solution, and generates an electrical stimulation signal corresponding to the Pareto optimal solution; transmits the electrical stimulation signal to the I / O module 300; the I / O module 300 performs signal conversion and activates the corresponding electrodes on the electrode cap 200, thereby better completing the electrical stimulation and improving the accuracy and efficiency of the electrical stimulation.
[0139] The technical solution of this embodiment uses a multi-objective particle swarm algorithm to set a particle swarm containing multiple particles corresponding to multiple optimization objectives (target optimization parameters) of transcranial electrical stimulation, where one particle represents a combination of at least two optimization objectives. The Pareto front of each particle is calculated through a genetic algorithm to simultaneously optimize multiple target optimization parameters to form a stimulation scheme containing multiple optimization objectives. A Pareto optimal solution can then be selected from the Pareto front to generate an electrical stimulation signal for the stimulation scheme corresponding to the Pareto optimal solution to complete the electrical stimulation. Furthermore, on the one hand, multiple optimization objectives (target optimization parameters) can be comprehensively optimized simultaneously to obtain a set of alternative solution sets. On the other hand, the structure of the Lagrangian operator is utilized to promote the development of the Pareto front using solutions that do not meet the safety conditions, which performs better than existing non-numerical algorithms. On the other hand, a genetic algorithm process is added to the external solution set to further improve the optimization accuracy. On the other hand, due to the diversity of its optimization objectives, this embodiment is not limited to optimization of a single objective, but can optimize and generate corresponding stimulation schemes based on the required number of optimization objectives. Therefore, the resulting stimulation scheme is more personalized and has improved optimization flexibility.
[0140] An embodiment of the present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the electrical stimulation signal generation method of the above embodiment.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0142] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0143] If the functions are implemented in the form of software function 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0144] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.
Claims
1. An electrical stimulation device, characterized in that include: a controller configured to segment the acquired nuclear magnetic resonance image and form a corresponding finite element model, perform an electrical stimulation simulation on the finite element model, collect stimulation responses, and solve an optimization objective function corresponding to predetermined target optimization parameters based on the stimulation responses and a nature-inspired algorithm to obtain a Pareto front; and select a Pareto optimal solution from the Pareto front to generate a corresponding electrical stimulation signal; an electrode cap, configured to receive electrical stimulation signals sent by the controller; The step of segmenting the acquired nuclear magnetic resonance image and forming a corresponding finite element model includes: Based on the algorithm, different tissue structures of the MRI image of the subject's head are segmented to obtain a head segmentation model, wherein corresponding conductivity information is assigned to each tissue in the head segmentation model; the head segmentation model is converted into a 3D mesh according to the brain structure to generate a finite element model; Solving the optimization objective function corresponding to the predetermined target optimization parameters according to the stimulus response and nature-inspired algorithm to obtain the Pareto frontier includes: A particle swarm algorithm is used to initialize and generate a particle swarm based on predetermined target optimization parameters and their corresponding optimization objective functions, wherein each particle in the particle swarm corresponds to the optimization objective functions of at least two of the target optimization parameters and is used to represent a combination scheme of at least two of the target optimization parameters; based on predetermined constraints and the stimulus response, a Pareto optimal solution of each particle in the particle swarm is calculated to form a corresponding Pareto frontier, wherein the Pareto optimal solution is used to represent an optimization combination scheme of at least two of the target optimization parameters; The step of calculating the Pareto optimal solution of each particle in the particle swarm based on the predetermined constraint condition and the stimulus response to form a corresponding Pareto frontier includes: Based on predetermined constraints and the stimulus response, a first external solution set corresponding to each particle in the particle swarm is calculated, where each solution in the first external solution set is an optimal solution to the objective function corresponding to each particle; the congestion degree of each particle in the first external solution set is calculated, and a global optimal solution is selected from the first external solution set according to the congestion degree; based on the global optimal solution, the speed and position of each particle in the particle swarm are updated; the Pareto optimal solution of each updated particle is calculated, and the Pareto optimal solution is added to the first external solution set; crossover and mutation calculations are performed on the first external solution set to obtain a second external solution set; and the Pareto front corresponding to the second external solution set is calculated.
2. The electrical stimulation device according to claim 1, wherein The performing electrical stimulation simulation on the finite element model and collecting stimulation responses includes: Single-channel electrical stimulation simulations are performed successively on the electrode positions corresponding to the finite element model, and stimulation responses corresponding to each finite element in the finite element model are collected.
3. The electrical stimulation device according to claim 1, wherein After the particle swarm algorithm is used to initialize and generate a particle swarm based on predetermined constraints and the stimulus response, the method further includes: A random number generator is used to generate multiple random numbers in the interval (-1, 1), the number of which is consistent with the number of leads of the electrical stimulation device. The random numbers are used to represent the initial position of each particle in the particle group, and the initial velocity of each particle is zero.
4. The electrical stimulation device according to claim 1, wherein The calculating the updated Pareto optimal solution of each particle and adding the Pareto optimal solution to the first external solution set includes: Calculate the current fitness of each updated particle; If the current fitness of each particle can Pareto dominate the historical optimal fitness corresponding to the particle, then the position corresponding to the current fitness of each particle is taken as the current individual optimal solution, and the historical minimum fitness of the particle is the historical optimal fitness; Calculating the Pareto optimal solution of each particle according to the current individual optimal solution; The Pareto optimal solution is added to the first external solution set.
5. The electrical stimulation device according to claim 1, wherein After calculating the Pareto front corresponding to the second external solution set, the method further includes: If the number of particles in the Pareto front is greater than a predetermined limit, the congestion degree of each particle in the Pareto front is calculated to eliminate particles with the smallest congestion degree until the number of particles is no greater than the predetermined limit.
6. A method for generating an electrical stimulation signal, characterized in that: include: Segment the acquired MRI images and form corresponding finite element models; Performing electrical stimulation simulation on the finite element model, collecting stimulation responses, and solving an optimization objective function corresponding to predetermined target optimization parameters based on the stimulation responses and a nature-inspired algorithm to obtain a Pareto frontier; selecting a Pareto optimal solution from the Pareto front to generate a corresponding electrical stimulation signal; The step of segmenting the acquired nuclear magnetic resonance image and forming a corresponding finite element model includes: Based on the algorithm, different tissue structures of the MRI image of the subject's head are segmented to obtain a head segmentation model, wherein corresponding conductivity information is assigned to each tissue in the head segmentation model; the head segmentation model is converted into a 3D mesh according to the brain structure to generate a finite element model; Solving the optimization objective function corresponding to the predetermined target optimization parameters according to the stimulus response and nature-inspired algorithm to obtain the Pareto frontier includes: A particle swarm algorithm is used to initialize and generate a particle swarm based on predetermined target optimization parameters and their corresponding optimization objective functions, wherein each particle in the particle swarm corresponds to the optimization objective functions of at least two of the target optimization parameters and is used to represent a combination scheme of at least two of the target optimization parameters; based on predetermined constraints and the stimulus response, a Pareto optimal solution of each particle in the particle swarm is calculated to form a corresponding Pareto frontier, wherein the Pareto optimal solution is used to represent an optimization combination scheme of at least two of the target optimization parameters; The step of calculating the Pareto optimal solution of each particle in the particle swarm based on the predetermined constraint condition and the stimulus response to form a corresponding Pareto frontier includes: Based on predetermined constraints and the stimulus response, a first external solution set corresponding to each particle in the particle swarm is calculated, where each solution in the first external solution set is an optimal solution to the objective function corresponding to each particle; the congestion degree of each particle in the first external solution set is calculated, and a global optimal solution is selected from the first external solution set according to the congestion degree; based on the global optimal solution, the speed and position of each particle in the particle swarm are updated; the Pareto optimal solution of each updated particle is calculated, and the Pareto optimal solution is added to the first external solution set; crossover and mutation calculations are performed on the first external solution set to obtain a second external solution set; and the Pareto front corresponding to the second external solution set is calculated.
7. A computer storage medium, characterized in that It stores a computer program, which, when executed, implements the method for generating an electrical stimulation signal according to claim 6.
Citation Information
Patent Citations
Adaptive closed-loop deep brain stimulation method and device and electronic equipment
CN113941090A