Spontaneous muscle activity classification with delay-based reservoir computing

Neuromuscular disorders (NMDs) affect various parts of a motor unit, such as the motor neuron, neuromuscular junction, and muscle fibers. Abnormal spontaneous activity (SA) is detected with electromyography (EMG) as an essential hallmark in diagnosing NMD

The neuromuscular system, comprised of the nervous and skeletal systems, allows for precise and coordinated muscle force production.The overall estimate of neuromuscular disorders (NMDs) affecting the peripheral motor neurons, neuromuscular junctions, and skeletal muscles, known as a peripheral neuromuscular disorder, exceeds 1 in 3000 people in all age groups. 1 Assessment of NMDs through invasive needle electromyography (iEMG) consists of recording and analyzing signals in both resting muscle and voluntary muscle contraction.Since the skeletal muscles (except the end-plate zone) are electrically silent in resting conditions, the presence of electrical signals in a rest state [known as spontaneous activity (SA)] represents peripheral neuromuscular disorders, which can be derived from dysfunction of motor neurons, neuromuscular junctions, and innervated muscle fibers. 2 As SAs can be generated from abnormalities at different levels of the peripheral neuromuscular system, identifying the origin of spontaneous activity is essential for diagnosing and monitoring NMD, the temporal course of the disease, and its severity.Determining the source of SAs can be accomplished by distinguishing spontaneous waveform characteristics such as morphology, frequency, number of phases, and initial deflection. 3Fibrillation potentials are the most common type of SAs recorded by iEMG.Fibrillation potentials represent muscle activities that occur in response to the spontaneous activation of muscle fibers in the absence of innervation.Therefore, any lesion through the entire length of the innervating motor neuron, which can cause muscles to lose connection with the innervating neuron, generates ARTICLE pubs.aip.org/aip/amlfibrillation potentials. 4The firing pattern of fibrillation is regular, with the frequency rate usually in the 0.5-15 Hz range.The amplitude of the fibrillation potential is between 10 and 100 μV, and it may become lower than 10 μV under chronic conditions (more than 6-12 months). 5hile electrical muscle activities have been measured by surface EMG (sEMG) over the past decades, their application in diagnosing NMD and its characteristics, including SAs, is hampered by many inherent challenges, such as electrode placement and its low spatial resolution. 6To enhance the spatial resolution, EMG can be recorded through needle EMG by penetrating through the electrically isolating tissue interposed between the skeletal muscle and the skin, measuring the skeletal muscle electrical signals directly with high spatial resolution.However, there are drawbacks associated with the needle EMG method, including limited sampling locations, being invasive and painful, and the potential risks associated with needle insertion. 7Despite all these challenges with iEMG, it is still the gold standard method for diagnosing NMDs and SA as it offers a high spatial resolution recording.To reduce the pain caused by needle movement inside the muscle for diagnosing SA and NMDs, there is a need for a solid computing processor that can help inexperienced clinicians, such as junior clinicians, analyze the EMG readings in real-time.Therefore, by decreasing the required time for SA diagnosis by implementing a computing processor, the pain and potential risks are reduced significantly.
In this paper, we propose the use of delay-based reservoir computing (DRC) as a machine learning (ML) method for automatically diagnosing muscle fibrillation, a type of SA, to assist new doctors during training.Mathematical analysis was first proposed for healthcare applications in 1959, 8 inspiring the field of healthcare informatics and, as an extension, the use of artificial intelligence (AI) and ML in healthcare.
Typical commercially available computing devices follow the von Neumann architecture, which has been proven inefficient when being used for complex ML learning applications since the computational and memory units are separate, leading to bottlenecks. 9Neuromorphic computing has proven promising in tackling this problem by introducing in-memory computing using different architectures, which would otherwise be impossible with von Neumann computers.DRC is a type of reservoir computing (RC) and, as an extension of recurrent neural networks (RNNs) (Fig. 1), has been proven efficient enough to classify data of various types using in-memory computing with low power consumption. 10,11NN takes its name from the recurrent loop on the neurons, which offers a memory element to the system accounting for previous neuron states as well (see Fig. 1 for illustration), making them ideal for processing sequential data as they retain a memory of their previous state. 12However, said recurrent loop makes RNNs particularly difficult and computationally expensive to train, leading researchers in the development of Reservoir Computing (RC).RCs replace part of the neural network with a randomly linked neuron (Fig. 1). 10 The purpose of the reservoir itself is to convert the input signal (u) to a high-dimensional spatiotemporal state space (x), and RC networks are more accessible to train than RNN since the weights at the input and inside of the reservoir remain untrained while the output weights are trained via regression. 10In addition, RCs behave as memory units themselves, making them a type of in-memory computing network.This is highly favorable for reducing power consumption as it does not require data to be constantly transferred between the memory unit and central processing unit (CPU), which is where the computations are performed. 9An example of RC is the Echo State Network (ESN), which is a digital algorithm in which the neurons inside the reservoir are randomly interconnected.The number of neurons within the reservoir is denoted as N. 13,14 By incorporating delay lines in RC models, the number of nodes and, consequently, the complexity of the reservoir will be reduced to a single node. 14DRC was first proposed in 2011, 14 and it was proven to be very high performing while simpler than standard RC models (see Fig. 1).
In the input of a DRC, the sampled signal is multiplied by the binary mask M of length N, randomly allocated +1 and −1. 15The resulting signal, J(k), is given by Eq. ( 1), where "u" is the input signal, "k" is the node counter, "s" is the scaling factor, "b" is the bias, and "⌊ ⌋" indicates the floor function. 15J(k) is then fed inside the physical node and then to the N virtual neurons.Each of the neurons within the reservoir is separated by a time step θ, taking τ seconds in total for each sample to complete the entire reservoir cycle 1. 15 The dataset used for this work consists of 78 readings of various durations taken across a variety of muscles and subjects.Those  readings were segmented into 1 s recordings to create an even distribution between the different classes, with 183 data points in total, with an equal number of recordings corresponding to healthy rest (R), fibrillation during rest (F), and healthy voluntary movement (VM).They were downsampled to 91 Hz to avoid overfitting, while any frequencies outside the 30 Hz to 10 kHz range were removed, 5 along with the 50 Hz frequency, which tends to be noise induced by the mains.In addition, values less than 3 μV were removed to make the SA peaks more prominent.The three conditions under which the recordings were obtained, R, F, and VM, were initially coded as classes 0, 1, and 2. At this point, the data were ready to be masked and inserted into the reservoir. 13,15he physical node, which is present at the input of the reservoir, is responsible for the non-linearity of the system and for relating the nodes' state to the previous inputs.The circuit configuration is visualized in Fig. 2 and is derived from Ref. 13.
The low-pass filter (LPF) component will determine the response speed of the non-linear (NL) node, for which a quick response will lead to a smaller memory.It is not ideal for the system to always reach a saturation state for each input sample, as this might eliminate its memory feature.The ideal value of R5 in the LPF is calculated by Eq. ( 2).If we consider that Tc = 5θ and θ = τ/N, 13 then, At the output layer, we dedicate one final neuron for each class.In this work, we used three output classes to indicate when the muscle is at rest, when there is voluntary movement, and for fibrillation, denoted as R, VM, and F, respectively.Each neuron on the output layer is individually connected to all N of the reservoir (Fig. 3).
The Mackey-Glass (MG) node circuit was initially constructed according to Ref. 17, but that provided very low accuracy and a near 0 memory capacity, so the resistor values were adjusted to stabilize the system. 18By setting our delay time to a constant τ = 1/180 and knowing that C = 2.7 nF, 17 R5 depends on the size of the reservoir, and hence Eq. ( 2), becomes Eq. ( 3), (given below) The input/output response of the MG node for a reservoir of size N = 10 nodes is given in Fig. 4.
The equation used to train W out is given by Eq.We can see how the physical node reserves previous states and slowly approaches the next input.This allows for a memory feature in the systems.While we decrease the R 5 value, the memory is reduced as well.In the picture on the left, it appears that the MG node reaches a steady state for every input value, which means that the memory in this case is near 0. The R 5 value for the picture on the right was chosen using Eq. ( 2), and it is seen how the system approaches a steady state more slowly, retaining this way part of the memory.
is a matrix with three rows, indicating the relevance of each node to each of the three classes as follows: 19 W out = Y target X T (XX T + βI), (4) The classes at this point are in a matrix of three rows of length equal to the size of the data, and the classification result Y will show how likely the recording belongs to each class.
In order to test the classification accuracy A, we compare Y to the reference matrix Y test using Eq. ( 6), where L is the number of data points used for testing.The data were then reordered, and the process was repeated several times to test the overall stability of the system as well as to examine different N sizes, The algorithm was trained and tested for various N values, starting from 20 nodes all the way up to 600, and its accuracy improved significantly.For an N = 600 nodes, the algorithm reached an accuracy of 89.5%.
With ESN being a similar version of the RC, the process was repeated with the same data using the code provided in Ref. 19.Although for DRC the accuracy seemed to improve by increasing the number of neurons in the reservoir, the ability of the ESN to distinguish between the muscle in rest, during fibrillation, and during voluntary movement seemed to decrease.Figure 5 shows the comparison of DRC and ESN in accurately diagnosing each class.
The three states during which the readings were obtained were recorded using different people and different muscles around the body.This was done to increase variability in the dataset in order to see how well the algorithm can perform on a variety of fibrillation inputs.64 kHz was found to be unnecessarily high and, therefore, reduced to 91 Hz to avoid overfitting. 20The initial dataset used consisted of only nine readings, with a big class imbalance that threw off the stability of the algorithm.For this, we have included an additional 25 F readings, 18 VM, and 12 R; however, due to the massive class imbalance, the algorithm was very unstable at providing a diagnosis, with the accuracy varying vastly between different rounds of the same N size.To tackle this, the readings were segmented into smaller recordings (1 s each), and we used 61 readings for each class, bringing the total to 183 readings.Due to the length of some of these recordings, the data could be further expanded, but this number was chosen to maintain a balance between the three classes.
During the initial stage of setting up the system, the reservoir size was kept at a small size of N = 10 nodes.With the NL values set as in Ref. 13, the system was very unstable.By adjusting our R5 to be varied with the reservoir size, the system behaved in a more stable manner, 21 and it was then decided it was ready to test its classification abilities using our EMG dataset.The final configuration of the MG node is given in Fig. 2. Before the masked data were put through the MG node, they were time-multiplexed at θ intervals each, using the binary mask.Looking at Fig. 4, we can understand the role of the NL node in associating the input values with the previous states. 13he faster the MG node reaches a steady state, the less association there is with its past states.
The 183 data recordings were shuffled and divided into training and testing; 120 of those were used for training and 60 for testing.The last three were left out to increase the variance between repetitions of the same cycles, as in order to have a more accurate view of the algorithm, it was run five times for each N value.Figure 5 illustrates how the mean accuracy increases with the number of nodes within our reservoir, while for ESN it tends to drop.Although ESN has been proven to be powerful in various applications 19,22 for muscle fibrillation, DRC has been proven to be overall more accurate.For this work, we chose to compare our DRC algorithm with a standard ESN since they are similar, with ESN being fully digital and containing a randomly connected reservoir, as opposed to DRC being partly analog and with a linearly connected reservoir.
In conclusion, DRC is an in-memory computing ML algorithm for sequential data, as it is derived from RNN.It has been specifically created to be more power efficient and compact than typical digital ML algorithms, and in this paper, we explore using a DRC to detect fibrillation potential (a type of spontaneous activity) in patients via EMG recordings.Fibrillation is a type of spontaneous activity observed in a neuropathic disorder (neuropathies, radiculopathies) and is critical for diagnosing and monitoring NMDs, along with the time course of the disease and its severity.We explain in detail the nature of our EMG readings, along with how fibrillations appear in the signal and how they were filtered to make the muscle activity more prominent.We have included a description of how the data were prepared for entering the reservoir, the role of the NL node, and its effect on the characteristic memory of the system.Overall, we have provided a detailed explanation of how to build a DRC, along with equations and figures.With our EMG readings taken by different participants during fibrillation (F) in rest, healthy rest (R), and voluntary movement (VM) from multiple muscles around their body, we have explored the accuracy of the DRC for continuously increasing the size of the reservoir and shown how the larger the reservoir, the better.The analogous calculations were performed with the same dataset, using an ESN, which is a similar model, with a randomly interconnected reservoir layer instead of a linearly connected one, which is the case for DRC.This showed that although the ESN performed adequately, its accuracy was not as high as that obtained using the DRC model.
To the best of our knowledge, there has not been a report of this specific application using a DRC or any other type of RC for diagnosing muscle fibrillations through needle EMG.Considering the above findings, the DRC has been successful in detecting the muscle state using a single sensor.The algorithm can distinguish fibrillation from voluntary movement and rest with almost 90% accuracy for a reservoir of size N = 600 nodes (Table I), and in addition, we have proven that our system can be reliable in providing a reference while medical practitioners perform their clinical assessments.In future work, the algorithm described in this paper will be implemented on-chip to prove in application our system's low-power, in-memory computing nature.

FIG. 1 .
FIG. 1.Progression of how DRC was derived from RNN. RNN is the type of Artificial Neural Network (ANN) used to process time series data (left), and RC is the simplified version of RNN (center), with randomly interconnected neurons.DRC is a further simplified version of RC, using a single dynamical node and a delay line, all of which collectively make up the reservoir.

FIG. 2 .
FIG. 2. DRCs utilize a single analog non-linear node at their input.The two most important parts of it are the non-linear part and the LPF part.This configuration was derived from Refs.16 and 17.

( 3 )FIG. 3 .
FIG.3.Full DRC system process for classification, which is the simplified evolution of the RC we have seen in the figure before.The first block (a) shows the masking of the data at the input layer, the second block (b) illustrates how the physical NL node is delayed into the virtual nodes, and the output layer is shown in the third block (c) as each of the N virtual nodes is connected to each of the nodes representing the classes through the weight matrix W out of dimensions (N × 3).

FIG. 4 .
FIG. 4.NL node response.We can see how the physical node reserves previous states and slowly approaches the next input.This allows for a memory feature in the systems.While we decrease the R 5 value, the memory is reduced as well.In the picture on the left, it appears that the MG node reaches a steady state for every input value, which means that the memory in this case is near 0. The R 5 value for the picture on the right was chosen using Eq.(2), and it is seen how the system approaches a steady state more slowly, retaining this way part of the memory.

FIG. 5 .
FIG. 5.Accuracy plot comparison for DRC and ESN in detecting the muscle state for three classes: F, R, and VM.It is observed that the DRC performs with higher accuracy, especially while the reservoir size N increases.

TABLE I .
Performance benchmarks of the DRC and its ability to detect the correct out of three classes.The values below correspond to the mean taken for five iterations for each N size.