Intelligent Control of Seizure-like Activity in a Memristive Neuromorphic Circuit Based on the Hodgkin–Huxley Model

: Memristive neuromorphic systems represent one of the most promising technologies to overcome the current challenges faced by conventional computer systems. They have recently been proposed for a wide variety of applications, such as nonvolatile computer memory, neuroprosthetics, and brain–machine interfaces. However, due to their intrinsically nonlinear characteristics, they present a very complex dynamic behavior, including self-sustained oscillations, seizure-like events, and chaos, which may compromise their use in closed-loop systems. In this work, a novel intelligent controller is proposed to suppress seizure-like events in a memristive circuit based on the Hodgkin– Huxley equations. For this purpose, an adaptive neural network is adopted within a Lyapunov-based nonlinear control scheme to attenuate bursting dynamics in the circuit, while compensating for modeling uncertainties and external disturbances. The boundedness and convergence properties of the proposed control scheme are rigorously proved by means of a Lyapunov-like stability analysis. The obtained results conﬁrm the effectiveness of the proposed intelligent controller, presenting a much improved performance when compared with a conventional nonlinear control scheme.


Introduction
Neuromorphic circuits are based on the underlying principles of the nervous system and are intended to be employed in brain-inspired machines. They represent an important alternative to deal with contemporary challenges faced by conventional computer systems, such as the von Neumann bottleneck and the end of both Moore's law and Dennard scaling [1][2][3][4]. Standard computer systems are commonly based on classic von Neumann architecture, where the memory part is separate from the central processing unit (CPU). This continuous data transfer between the CPU and the memory unit generates unavoidable latency and power consumption issues [3]. As matter of fact, along with the increased energy consumption caused by the von Neumann bottleneck, scaling problems related to Moore's law also cause overheating. Neuromorphic systems, on the other hand, are considered low-power devices and allow for a much lower thermal budget [5]. In this context, they have recently been employed in a wide range of applications, from robotics [6] and computer vision [7] to neuroprosthetics and brain-machine interfaces [5,8].
Among the available options for hardware deployment of neuromorphic systems, memristive devices have been recognized as one of the most promising technologies [2,3,[9][10][11]. Memristors can be defined as two-terminal electrical components that are characterized by a state-dependent Ohm's law [11]. They were theoretically proposed by Leon O. Chua in 1971 [12], but their first physical realization had to wait until 2008, when R. Stanley Williams and his team at the Hewlett-Packard laboratories introduced a resistive switching device based on nanoscale titanium dioxide (TiO 2 and TiO 2−x ) films [13,14]. Memristive (or resistive switching) neuromorphic devices present a stimulus response comparable to the synaptic strengthening/weakening process, being intrinsically capable of emulating important brain learning mechanisms, such as short-and long-term plasticity [10,11,15].
Due to their ability to store resistance values indefinitely, requiring energy only to switch or read their states, memristive systems can be used as nonvolatile resistive randomaccess memory (RRAM), which are (much) more energy efficient than capacitor-based dynamic random access memory (DRAM) devices [14]. Furthermore, for the same reason, they also represent the most natural choice for the physical implementation of artificial neural networks (ANN) [3,4,16]. However, despite the promising prospects of using memristive neuromorphic circuits, they are still subject to accuracy issues due to their nonlinear dynamic behavior [3] and disturbances caused by sneak-path currents [17].
In addition to proposing the existence of memristors, Leon O. Chua and his colleagues also suggested that memristive components are essential for an accurate representation of the Hodgkin-Huxley (HH) model [18,19]. The HH model consists of a set of nonlinear differential equations that quantitatively describe current flow through the neuronal membrane [20]. It was introduced seventy years ago from studies carried out with the giant axon of the Loligo squid [21][22][23][24][25] and represents the basis of modern neuroscience [26]. Because of its capacity to describe the excitable dynamics of action potentials in neurons and to emulate a diversity of spiking patterns [27], the HH model plays an essential role in the research of epilepsy [28][29][30][31], Parkinson's disease [32][33][34], and other neuropathies [35][36][37]. However, its rich and nonlinear dynamics can also exhibit self-sustained oscillations [38,39], seizurelike events [29,40], and chaotic behavior [41,42], which in fact challenges the adoption of conventional control strategies.
In this work, we introduce a novel intelligent controller for the suppression of seizurelike events in a memristive neuromorphic circuit based on the Hodgkin-Huxley model. For this purpose, an adaptive neural network is incorporated into a Lyapunov-based nonlinear control scheme, which allows the attenuation of bursting dynamics, even assuming that there is no prior knowledge of the mathematical model of the circuit. By means of a Lyapunov-like stability analysis, the boundedness and convergence properties of the closed-loop signals are rigorously proved. The obtained numerical results confirm that the intelligent control law is capable of dealing with the nonlinear behavior of memristive components, as well as with uncertainties and external disturbances, presenting a much superior performance when compared with a conventional nonlinear controller.
The remainder of this paper is structured as follows: Section 2 presents the adopted memristive Hodgkin-Huxley model; Section 3 introduces the novel intelligent controller for the neuromorphic circuit and presents the Lyapunov-like stability analysis; Section 4 presents the obtained numerical results; and Section 5 summarizes the concluding remarks.

Memristive Neuromorphic Circuit
The memristor was originally introduced in 1971 by Leon O. Chua [12] as the missing fourth passive circuit element whose properties could not be obtained by any combination considering only the other three, namely resistor, inductor, and capacitor. Following the modern definition, a memristor can be understood as a 2-terminal resistive switching component with an associated state-dependent Ohm's law [43,44]: where V is the voltage between the two terminals, I represents the electric current, and G stands for the conductance (or memductance) that depends on the state variables x n , with n representing a measure of the order of complexity of the memristor dynamics. The state variables x n , in turn, can be described by a set of n autonomous ordinary differential equations:ẋ . . .
x n = f n (x 1 , x 2 , . . . , x n ; V) By applying a periodic voltage with positive and negative values to the memristor terminals, a pinched hysteresis loop is formed in the corresponding V × I plane. According to Chua [11,44], this is the main property of the memristor and can be considered its fingerprint. Figure  Furthermore, Chua and his colleagues have also suggested that memristors are the ideal components for the correct implementation of the Hodgkin-Huxley equations [18,19]. The HH model was introduced seventy years ago by Alan Hodgkin and Andrew Huxley to mathematically describe the flow of electric current through the axon membrane [25]. Originally, Hodgkin and Huxley represented the voltage-gated ion channels of the membrane by means of time-varying resistances. This assumption is actually not consistent with basic circuit theory and has led to some paradoxes and anomalous phenomena, as reported in the literature over the years [19]. By replacing the time-varying resistors with time-invariant memristors, however, it became possible to obtain a rigorous biophysical basis for the HH model. Figure 2 shows the memristive HH circuit and the pinched hysteresis loops associated with the two voltage-gated ion channels. For the circuit presented in Figure 2a: C m stands for the membrane capacitance and V its corresponding voltage; G Na , V Na , I Na , and E Na represent, respectively, the memductance, the voltage, the current, and the battery voltage related to the sodium-gated channel; G K , V K , I K , and E K are, respectively, the memductance, the voltage, the current, and the battery voltage associated with the potassium-gated channel; G L , V L , I L , and E L stand for the leakage conductance, voltage, current, and battery voltage, respectively.
Thus, recalling the Kirchhoff's Current Law to the memristive circuit shown in Figure 2a, and considering an external current I ext through the axon membrane, we obtain the following ordinary differential equation [18,19]: where the memductance functions are given by with the dynamics of the internal states x 1 , x 2 , and x 3 being defined according tȯ Equations (3)-(8) represent the four-dimensional vector field that mathematically describes the memristive Hodgkin-Huxley circuit shown in Figure 2a. Regarding the memristors, note that by applying a sinusoidal voltage of 50 sin ωt mV across their terminals, the typical pinched hysteresis loop can be clearly observed for both sodium and potassium ion channels, shown in Figure 2b and Figure 2c, respectively. Moreover, as stated by Chua [19], the shape of their pinched hysteresis loops tends to a straight line as the frequency ω increases. Table 1 presents the parameters for the memristive circuit. It is worth recalling that the conductances given by Equations (4) and (5) were first proposed by Hodgkin and Huxley in 1952 [25] and later were also adopted by Chua to mathematically describe the memristors in the memristive version of the Hodgkin-Huxley circuit [11,18,19,44]. As defined by Hodgkin and Huxley [25], the internal states x 1 , x 2 , and x 3 are dimensionless variables, which can vary between 0 and 1. Thus, the proper dimension of the conductances is actually given by the parameters g Na and g K , as can be seen in Table 1. Moreover, the nonlinearities present in the Hodgkin-Huxley model provide its rich and complex dynamic behavior, which is indeed essential for neuroscience and epilepsy research, as it allows a wide range of spiking and burst-firing patterns [27,42]. As a matter of fact, bursting dynamics can be easily emulated with HH equations. By applying an external electric current such as I ext = −28 sgn{cos(2πt/T) cos[−2πt/(3T)]} µA, with T = 10 3 , it is possible to observe the emergence of seizure-like events, as seen in Figure 3. The membrane voltages presented in Figure 3 were obtained from Equations (3)-(8) by means of a C++ implementation of the Euler-Maruyama method, using a time step of 10 −3 s and considering Gaussian noise of null mean and variance of 0.4 mV 2 .
Brain electrical activity usually has irregular waveforms, but during seizure events, high-amplitude burst patterns can be clearly observed [28]. The bursting activity observed in Figure 3 is in fact quite similar to those previously reported in the literature for both numerical [29,40] and experimental procedures [45,46]. The ability to precisely control the bursting dynamics of the HH model plays an essential role for a better understanding of the treatment of many neuropathies [37]. For this reason, a novel intelligent control scheme is introduced in the next section to suppress seizure-like events in a memristive Hodgkin-Huxley circuit.

Intelligent Control
Due to its ability to deal with highly uncertain systems, adequately compensating for modeling inaccuracies and external disturbances, intelligent control presents itself as a very suitable approach for bio-inspired devices [47]. Intelligent control schemes are able to adapt, learn from experience, and predict the dynamic behavior of the controlled system. They have been successfully employed in the control of robotic [48], underactuated [49] and chaotic systems [50].
Thus, let us start by assuming that the memristive neuromorphic circuit can be described by an uncertain first-order nonlinear system: where I c represents the control input, b stands for the input gain, and f is a nonlinear function that represents the plant dynamics. The input signal I c is introduced to the memristive circuit by means of a controlled current source, as shown in Figure 4. It should be noted that when choosing the first-order plant (9) to represent the entire fourth-order memristive circuit, it is necessary to ensure that the controller is capable of handling not only parametric uncertainties and the unknown external electric current I ext but also the unmodeled dynamics of the internal states of the memristors, as in Equations (6)- (8).
Then, considering that the plant is subject to modeling uncertainties, i.e., f =f + ∆ f and b =b + ∆b, withf andb being estimates of f and b, respectively, Equation (9) can be rewritten as follows:V =f +b I c + d where d comprises the modeling uncertainties ∆ f and ∆b.
By evoking the universal approximation properties of artificial neural networks [51], we propose the adoption of an ANN to deal with both modeling inaccuracies and unmodeled dynamics. The chosen network architecture considers one input and one output, in addition to a hidden layer with n neurons, as shown in Figure 5.
Hidden layer Output The single-hidden layer network depicted in Figure 5 is mathematically described bŷ where w = [w 1 . . . w n ] is the weight vector and ψ = [ψ 1 . . . ψ n ] stands for the vector of activation functions ψ i . Now, following the feedback linearization method [52], a nonlinear control law for the uncertain first-order system (9) can be designed as follows: with λ being a strictly positive constant andṼ = V − V d representing the control error associated with the desired state V d . By applying the control law (12) to (10), the closed-loop dynamics becomeṡṼ Equation (13) shows that the error dynamics are constantly driven by the approximation error d −d. However, recalling that the adopted ANN is a universal approximator, an arbitrary precision can be ensured for the uncertainty/disturbance estimation: withd * being the optimal estimate and | | ≤ ε.
Let us now evaluate the boundedness and convergence properties of the closed-loop signals by defining positive definite Lyapunov candidate function L: where η is a strictly positive constant and δ = w − w * , with w * being the optimal weight vector that minimizes the approximation error.
Sinceδ =ẇ, the time derivative of L iṡ Hence, by updating w according toẇ = ηṼψ, the time derivative becomeṡ According to (16), it can be seen thatV is negative definite only when |Ṽ| > ε/λ. In order to ensure an upper bound on w when |Ṽ| ≤ ε/λ, the projection algorithm [53] can be employed:ẇ with µ being the desired upper bound for w 2 (the Euclidean norm of w). By adopting (17), we ensure that the weight vector always remains within the convex region W = {w ∈ R n : w w ≤ µ 2 } as long as w(0) 2 ≤ µ, and the control error converges to the closed region V = {Ṽ ∈ R : |Ṽ| ≤ ε/λ} as t → ∞.

Numerical Results
The efficacy of the proposed intelligent controller was evaluated by means of numerical simulations carried out at a sampling rate of 100 Hz. As in the numerical studies presented in Section 2, the memristive circuit represented by Equations (3)-(8), now including a controlled current source being defined by the intelligent scheme, were simulated using a C++ implementation of the Euler-Maruyama method, with a time step of 10 −3 s and a Gaussian noise of null mean and variance of 0.4 mV 2 . Assuming that no prior knowledge about the plant was available to the control system designer, we definedb = 1 andf = 0. The control parameter λ was set to 6.
Regarding the artificial neural network, the weight vector was initialized as w = 0 and is updated according to (17), with learning rate η = 300. The activation functions were of the Gaussian type: with corresponding centers c i and widths σ i being defined as in Table 2.      The influence of the adaptive neural network on the control performance is evaluated by comparing the proposed intelligent approach with a conventional nonlinear controller, namely the feedback linearization scheme. In fact, the feedback linearization controller can be easily obtained from the intelligent scheme by simply disregarding the contribution of the neural network to the control signal, i.e., by settingd = 0.
Comparing the results obtained with a conventional nonlinear controller and the intelligent scheme, Figures 6 and 7 respectively, the effectiveness of the proposed intelligent approach can be clearly ascertained. As a matter of fact, the conventional controller was not able to suppress the bursting activity, shown in Figure 6a, despite the higher amplitude of the associated control signal, shown in Figure 6b. The proposed intelligent controller, on the other hand, was able to successfully suppress seizure-like events, as shown in Figure 7a, with a much lower amplitude of the associated control signal, shown in Figure 7b, when compared with the conventional approach.
In order to allow a quantitative comparison of the performance obtained with the two control schemes, the Integral Absolute Error (IAE) and the Integral Absolute Control Input (IACI) were calculated for the numerical results presented in Figures 6 and 7. Table 3 shows the IAE and IACI obtained for the conventional and intelligent controllers, taking into account the numerical results presented in Figures 6 and 7 for t 1 = 2 ks and t 2 = 7 ks. From Table 3, it can be seen that the intelligent controller provided a total control error (IAE) 99.59% lower and also granted a reduction of 37.31% in the overall control effort (IACI). These results confirm the efficiency of the intelligent scheme, being able to drastically reduce the error with a total control effort even lower than the conventional one.
As a matter of fact, the improved performance of the intelligent controller is due to the adaptive neural network, which is able to recognize the dynamics of the memristive neuromorphic circuit and adequately compensate the disturbance caused by the unknown external current. Figure 8 shows the estimated, as computed by the adaptive neural network.  Now, to show that the intelligent scheme is also capable of tracking different references, the desired output is changed during the control phase, causing the controller to stabilize the voltage at distinct setpoints. Figure 9 shows the obtained results. Figure 9a shows that, after activating the controller, the setpoint is then intentionally changed to different voltage levels: V d = 15 mV, V d = 0 mV, V d = −15 mV, V d = 0 mV, and V d = 15 mV, successively. As can be verified, the controller is not only able to suppress seizure-like events but also manages to drive the voltage to the desired levels. The control signal, in this case, is adjusted as needed for the different setpoints, as can be seen in Figure 9b. Once again, it is important to emphasize that this stabilization capability is granted by the neural network embedded into the intelligent controller. By interacting with the plant, the adaptive neural network is able to learn online how to ensure that the desired voltage levels are properly achieved.
Finally, based on the obtained results, the main features of the proposed intelligent controller can be highlighted as follows: 1.
The intelligent control scheme can adequately handle the unknown external electric current I ext and the uncertainties associated with the unmodeled internal states of the memristors, which in fact may allow other different memristive circuits to be controlled by means of the same control framework; 2.
Online learning, rather than offline training, is adopted to allow the controller to continuously improve its overall performance, even when subjected to dynamically changing circumstances; 3.
The neural network can learn to compensate for uncertainties and disturbances by minimizing the control error, making direct measurements of the signal to be estimated (which is not possible in real applications) completely unnecessary; 4.
By combining the artificial neural network with a nonlinear control method, the computational demands on the ANN are minimized, which allows its implementation on low-power embedded hardware and the adoption of the online learning scheme.

Concluding Remarks
This work introduces a novel intelligent control scheme for the suppression of seizurelike events in a memristive neuromorphic circuit. The neuromorphic circuit is based on the Hodgkin-Huxley equations, with memristors representing the voltage-gated ion channels. Regarding the intelligent controller, an adaptive neural network is embedded within a Lyapunov-based nonlinear control law. Moreover, even by assuming that no prior knowledge about the plant is available to the control system designer, the proposed model-free controller is able to identify the unmodeled dynamics of the memristors, as well as the unknown external current, and compensate them accordingly. The boundedness and convergence properties of the closed-loop signals are rigorously addressed through a Lyapunov-like stability analysis. The improved performance of the intelligent controller is confirmed by means of a comparative numerical study. It is important to note that by combining the artificial neural network with a nonlinear control method, the computational demands on the ANN are minimized, which allows its implementation on low-power embedded hardware and the adoption of an online learning scheme. In fact, the reduced complexity of the proposed control scheme makes it a promising candidate for the development of neuroprostheses and brain-machine interfaces. Finally, the online learning feature of the adaptive neural network enables proper identification and automatic compensation of unknown plant dynamics, which allows the proposed control scheme to be employed in a wide variety of memristive neuromorphic systems.