# A peristaltic soft, wearable robot for compression and massage therapy

Mengjia Zhu1, Adrian Ferstera1,2, Stejara Dinulescu1, Nikolas Kastor1, Max
Linnander1,
Elliot W. Hawkes1, and Yon Visell1 1Media Arts and Technology Program,
Department of Electrical and Computer Engineering, Department of Mechanical
Engineering, California NanoSystems Institute, University of California, Santa
Barbara, USA<EMAIL_ADDRESS>Engineering Program, Department of
Mechanical Engineering, ETH Zurich, SwitzerlandManuscript received XXX, 2022;
revised XXX, 2022.

###### Abstract

Soft robotics is attractive for wearable applications that require conformal
interactions with the human body. Soft wearable robotic garments hold promise
for supplying dynamic compression or massage therapies, such as are applied
for disorders affecting lymphatic and blood circulation. In this paper, we
present a wearable robot capable of supplying dynamic compression and massage
therapy via peristaltic motion of finger-sized soft, fluidic actuators. We
show that this peristaltic wearable robot can supply dynamic compression
pressures exceeding 22 kPa at frequencies of 14 Hz or more, meeting
requirements for compression and massage therapy. A large variety of software-
programmable compression wave patterns can be generated by varying frequency,
amplitude, phase delay, and duration parameters. We first demonstrate the
utility of this peristaltic wearable robot for compression therapy, showing
fluid transport in a laboratory model of the upper limb. We theoretically and
empirically identify driving regimes that optimize fluid transport. We second
demonstrate the utility of this garment for dynamic massage therapy. These
findings show the potential of such a wearable robot for the treatment of
several health disorders associated with lymphatic and blood circulation, such
as lymphedema and blood clots.

###### Index Terms:

Soft robotics, Wearable robotics, Compression therapy, Peristalsis

##  I Introduction

Emerging soft robotic technologies are becoming widely investigated for
applications in health and medicine. Soft, wearable robotic systems are well-
suited for delivering dynamic compression or massage therapy. Such therapies,
when administered by a health professional, are effective in treating blood
and lymphatic circulatory disorders, including chronic venous insufficiency
(CVI), venous ulcers, lymphedema, and blood clots [1, 2], as well as for
treating musculoskeletal injuries [3].

Compression therapy devices are expected to meet functional requirements
arising from therapeutic standards that help ensure efficacy and safety or
otherwise conform to norms of massage practice. Such guidelines are
necessarily application-specific. Compression therapies requiring gross
occlusion of venous blood flow in the lower limbs demand substantial
compression pressures, amounting to 3.3 kPa, 8.0 kPa, or 9.3 kPa in the
supine, sitting, or standing positions respectively [4]. Intermittent
compression therapies, such as are used for lymphedema, require pressure
variations to be supplied at frequencies of at least 1 Hz [5, 6]. In other
applications, massage therapies are supplied for mild pain relief, easing of
musculoskeletal tension, or touch elicited (i.e., haptic) emotional comfort.
Examples include sports, Swedish, kinesiologic, or deep tissue massage. Such
practices can involve the application of light to firm pressures, ranging from
less than 12 kPa to 30 kPa or more [7].

Wearability introduces further requirements that arise from ergonomics and
safety. To ensure comfort, compression garments should be soft, low-profile,
and compliant. To avoid pain and avoid injury or lesions damaging soft
tissues, static and dynamic forces should be distributed to avoid stress
concentrations. For devices that emulate manual massage, it may be appropriate
that compression is supplied via individually actuatable modules the size of a
finger or hand.

Based on these requirements for compression therapies, the two existing
predominant tools are graduated compression stockings (GCS) and intermittent
pneumatic pressure (IPC) devices. GCS promote venous flow by applying a
constant compression pressure to the limb to reduce venous caliber, preventing
the static accumulation of blood [2]. GCS are convenient and low-cost while
lacking the capability of dynamic pressure adjustment. IPC devices consist of
single or multiple pneumatic chambers that are inflated to exert compression
pressure on the limb [8]. Compared with GCS, IPC treatment features dynamic
pressure modes with a wide range of pressure delivery (1-20 kPa) [9]. Studies
have shown that the use of IPC instead of GCS is associated with lower
incidents of venous thromboembolism (VTE) [10]. Researchers have also shown
that sequential actuation modes and high pressure in a multi-chamber device
generate a higher lymphatic flow than other modes of treatment [11].

IPC devices rely on the inflation of the bladders to exert compression
pressure on the skin, making it difficult to control the contact area for
efficient mechanical coupling with blood vessels. It is also challenging for a
user to move around when wearing them because the bladders used in IPC devices
are usually bulky. The use of smaller bladders may reduce the clinical
efficacy of the device due to the smaller volume of blood being expelled [12].

Figure 1: A. FFMS actuators are used for the peristaltic wearable robot
design. These actuators are arranged in parallel to mimic peristalsis. B. The
peristaltic wearable robot can be used in various locations on human limbs,
including the upper arm, forearm, and lower limb. The insert demonstrates the
propagation of the peristaltic wave generated. C. Peristaltic transport in
biological organs such as the digestive tract involves sequential contraction
and relaxation of muscles.

Prior researchers have investigated the modeling, control, and device designs
for therapeutic massaging to overcome these limitations in IPC devices. Guan
et al. proposed an evidence-based fluid-structure coupling model for the
interaction between IPC soft actuator and lower limb, providing guidelines for
improving the efficacy of compression therapy for venous flow promotion [13].
To address control challenges for pneumatic operations, Payne et al.
incorporated closed-loop force control in pneumatic actuators with similar
sizes to IPC modules [5]. Zhao et al. proposed a programmable and self-
adaptive dynamic pressure delivery system with a matrix of soft sensors for
IPC therapies [14].

In addition to IPC devices, several soft, wearable robotic systems have been
investigated for supplying forces to the body [15, 16] via pneumatic muscles
[17], shape memory alloys [18, 19], or motor-driven tendons [20, 21]. For
example, Suarez et al. created a system for robotic lymphatic drainage using
three pneumatic bending fabric actuators to compress and laterally push fluid
in a flexible tube [22]. Yoo et al. developed Z-folded pneumatic actuator
modules to generate normal and shear forces for lymphedema massaging [23].

Pneumatic actuation has been widely used in such applications, but is often
energetically inefficient, due to thermodynamic losses arising from gas
compression cycles [24]. Pneumatic actuators also store substantial energy in
gas compression, which can pose hazards upon soft material failure, due to
rapid energy release. Shape memory alloy actuators perform mechanical work via
a thermally actuated phase change; consequently, such actuators are
energetically inefficient and operate at low speeds constrained by heat
transport [19]. Other designs utilize tendon- or Bowden-cable transmissions.
Such wearable devices require careful design to avoid painful or hazardous
stress concentration [20].

To overcome some of these limitations, we present a wearable system based on
fluidic fabric muscle sheets (FFMS), described in recent publications by the
authors [24, 25, 15]. FFMS supply forces via soft, hydraulic transmissions
integrated into finger-sized compact textile matrices (Fig. 1 A). They achieve
greater energy efficiency and safety than many pneumatic designs, avoid stress
concentration through the use of soft materials, and are capable of supplying
large forces (scalable based on application requirements) and of rapid
actuation at speeds exceeding 10 Hz, meeting requirements for dynamic
compression and massage therapies in many application areas.

Leveraging the merits of FFMS actuators, we demonstrate a soft wearable robot
that generates massage-like motions on the human limb through dynamic
compression waves based on peristalsis (Fig. 1 B). Peristalsis is a transport
mechanism produced via sequential squeezing of muscles, as in the esophagus
[26], uterus [27], ureter [28], or blood vessels [29]. Media within a
peristaltic channel is transported via wave motion of the channel walls (Fig.
1 C). Peristaltic transport has been previously applied in robotic systems for
liquid pumping [30] or swallowing robots [31]. When applied to the exterior of
the body, peristalsis can supply forces similar to those used in compression
and massage therapies [7].

We present the design, fabrication, and modeling of the peristaltic wearable
robot and the associated control system. We characterize the compression
pressure, dynamic frequency responses, and motion patterns generated by the
peristaltic wearable robot. Results show that the system we designed can
supply compression pressure as large as 22 kPa with frequencies up to 14 Hz,
meeting the requirements for compression and massage therapy [4, 5, 6]. Our
proof-of-concept demonstration for compression therapy shows that this
peristaltic wearable robot is capable of driving venous flow in an artificial
limb with a flow rate up to 1 mL/min. The flow rate increases linearly with
peristaltic wavelength and frequency, in agreement with theoretical models we
derive based on prior literature. Finally, we demonstrate that our wearable
robot can deliver a wide range of massage-like motions on the forearm. This
work provides a controllable and efficient method for supplying compression
massage that could treat venous and lymphatic inefficiencies, as well as a
means for therapeutic massage that could provide comfort or reduce anxiety.

##  II Device Design and Operating Principle

###  II-A Wearable Design and Fabrication

The peristaltic compression wearable aims to create dynamic compression force
patterns on the wearer’s limbs (Fig. 1 B). It consists of eight fluidic fabric
muscle sheets (FFMS) actuators and leverages several benefits of this soft
robotic technology [24]. FFMS actuators are intrinsically compliant and can be
scaled to sizes as small as human fingers. The modular arrangement of these
actuators offers extra flexibility for personalized configurations. In
addition, these actuators can be controlled efficiently with hydraulics [24]
and are capable of generating a large variety of compression patterns that are
easy to be detected and distinguished by humans [25]. These characteristics
make FFMS an ideal candidate that meets the design requirements for
compression therapy.

The operating principle of FFMS resembles Inverse Pneumatic Artificial Muscles
(IPAM) [32]. When fluid pressure is high, the actuator extends to its longest
state. When the fluid pressure decreases, the actuator contracts and exerts
forces on the payload (Fig. 1 A). When wrapped around a human limb
circumferentially, each actuator is capable of supplying localized compressive
pressure to the limb. This working principle is intrinsically different from
the IPC devices, such that a compact-sized FFMS actuator may still supply
large compression pressures. The parallel arrangement of multiple actuators
makes it possible to provide spatial-temporal compression patterns, including
wave-like patterns that produce peristalsis.

We fabricated the actuators using the methods described in Zhu et al. [24].
The geometry of the soft latex tubing used inside the fabric conduits affects
the fluid pressure required to fully operate the actuator, as well as the
maximum compression force generated [24]. The actuator length should be
designed such that the actuator can wrap around the human limb and produce
compression pressure of at least 9.3 kPa for compression therapy. Based on
these requirements and the analytical modeling in Zhu et al. [24], we
specified the tubing to have an outer diameter of 4.8 mm, and an inner
diameter of 3.2 mm. We selected the stitching length as 177 mm and the
wrinkling ratio was 2.5. The fabricated actuators were then pre-pressurized
and hand-sewn onto a stretchable sleeve for comfort using a zig-zag pattern
that preserves stretchability.

###  II-B Design and Modeling of the Fluid Driving System

Figure 2: Schematic design of the slider-crank driving mechanism. Figure 3:
Various control input designs can be used to generate spatial-temporal
compression wave patterns. A. Two pistons can be used to control eight
actuators for maximum efficiency, with spatial compression forces coupled at
locations routed to the same motor. The sinusoidal displacements with a phase
delay of $\pi/2$ on the top denote an example of the input signal for both
pistons. The plot on the bottom illustrates the resulting spatial profile of
the compression force at times $t_{0}$ and $t_{1}$. The two-piston driving
system can also compose other spatial-temporal compression force patterns such
as B and C, with the top figures showing the piston input signals, and the
bottom figures showing the composed spatial waves. D. The driving system can
be expanded to eight pistons to control each actuator independently. Arbitrary
spatial compression force waves can be generated. E. The prototype of the two-
piston driving system. F. The prototype of the eight-piston driving system.

The system uses compact, servo-driven hydraulic cylinders to drive the fluid
(water). The power requirements for the motors are determined by the hydraulic
pressure and the speed of the actuation. A slider-crank linkage converts the
rotary motion to linear motion (Fig. 2). The minimum stroke position occurs
when the crank $r$ is co-linear with the connecting rod $l$ (position C). It
is the initial position of the motor when fluid pressure is maximum. This
design uses $l=r$ such that the minimum operation angle $\alpha$ between the
crank and the horizontal line is $30^{\circ}$. The range of $\alpha$ is
adjustable to accommodate a different fluid volume. For our actuator, the
maximum $\alpha$ needed is $120^{\circ}$ (position A). When the crank is
vertical, the connecting rod is co-linear with the stroke path (position B).
With this design, the torque $\tau$ of the motor can be related to the force
acting on the piston rod of the hydraulic cylinder $F_{t}$ by:

$\tau=rF_{t}\sin\alpha,\ 30^{\circ}\leq\alpha\leq 120^{\circ}\ $ (1)

In a quasi-static condition, $F_{t}=PA$, where $P$ is the quasi-static fluid
pressure and $A$ is the inner cross-sectional area of the hydraulic cylinder.
The relationship between the crank angle $\alpha$ and the piston location $x$
is obtained from the kinematics of a fourbar offset slider-crank [33]:

$x=r\cos{\alpha}+l\sqrt{1-\left(\frac{r\cdot\sin{\alpha}-r}{l}\right)^{2}},\\\
\ 30^{\circ}\leq\alpha\leq 120^{\circ}\ $ (2)

Our two-motor design is sufficient to produce peristaltic motions via coupled
hydraulic channels (Fig. 3 A, E). As the piston of the hydraulic cylinder
moves back and forth, the hydraulic pressure increases in one port but
decreases in the other port. With two motors, the eight actuators can be
connected to the four ports, with two channels sharing one port. When two
sinusoidal signals with a phase delay of $\pi/2$ are fed into the two motors,
a compression force pattern similar to a sinusoidal wave can be generated
spatially along the wearable robot (Fig. 3 A). Different input signals result
in distinct spatial-temporal compression force patterns (Fig. 3 B, C).

Figure 4: The graphic user interface generates a user-defined waveform with
input parameters such as frequency and amplitude. The interface also includes
a two-step donning design of the device. Figure 5: Evaluation of the force
generated by a single actuator. A. Compression force testing set-up for a
single actuator. B. Relationship between fluid volume and compression pressure
follows a similar curve for different operation strokes ranging from 10% to
100% with the margins marked in the plot. Note that the minimum compression
pressure occurs when the fluid volume is maximum. As the fluid is withdrawn
from the actuator, the compression pressure increases. The inserted diagrams
illustrate the extreme conditions for maximum and minimum compression pressure
to occur.

The two-motor compact design uses a minimal number of motors at the cost of
coupled compression forces. In many other situations, each hydraulic channel
needs to be controlled independently. We designed a second driving system
using eight pistons to allow independent control over individual channels to
generate arbitrary compression force patterns (Fig. 3 D, F).

###  II-C Software Development

Each piston is driven by a programmable high torque servo (HerklueX DRS 0602,
DST Robot) that is controlled by computer via a synchronous serial
communication. A software graphical user interface (GUI) enables the design of
compression patterns via frequency, amplitude, duration, and phase parameters
(Fig. 4). The motors can be powered using a rechargeable Lipo battery (14.8 V,
9 A). The software also implements a two-step donning process. First, pistons
are positioned to fully pressurize one chamber in the hydraulic cylinder,
allowing actuators connected to that chamber to be fastened to the arm of the
user. Then, pistons are positioned to fully pressurize the other chamber,
allowing the rest of the actuators to be fastened.

##  III Mechanical Characterization of the Dynamic Compression System

Various peristaltic, all-in-phase, and sequential squeezing spatial-temporal
compression patterns can be delivered through time-varying signals for a
single actuator, as well as multiple actuators at different locations. In this
section, we evaluate the compression force generated by a single actuator, the
dynamic frequency response of the system, and the large range of dynamic
compression motion patterns that the peristaltic wearable robot is capable of
generating.

###  III-A Single Actuator Compression Force Testing

We characterized the compression force of a single actuator by wrapping it
around a cylindrical testing fixture with a force sensor (ATI Nano17; ATI
Industrial Automation) (Fig. 5 A). The force sensor measures part of the
compression force exerted on the arc segment with a central angle of 68.9
degrees. The diameter of the cylinder in the testing setup is 63.7 mm to mimic
the size of a human limb. Different design parameters of the testing fixture,
such as the cylinder radius, can affect the compression pressure measurement.
Applying the hoop stress equation yields the following expression for the
compression pressure:

$P_{c}=\frac{t_{act}\sigma_{act}}{R}=\frac{F}{A_{c}},$ (3)

where $P_{c}$ represents the compression pressure, $t_{act}$ and
$\sigma_{act}$ are the thickness and the axial stress of the actuator, $R$ is
the radius of the cylinder wrapped by the actuator, $F$ is the force measured
from the ATI nano 17, $A_{c}$ is the contact area between the actuator and the
testing cylinder. A position encoder measured the instantaneous stroke of the
hydraulic cylinder and a pressure sensor was used to monitor hydraulic
pressure. All sensing signals were recorded synchronously using a real-time
computer-in-the-loop system with a sampling rate of 100 Hz (QPIDe; Quanser,
Inc., with Simulink, The MathWorks, Inc.).

Results showed that compression pressure decreased with increasing fluid
volume in the actuator, which is consistent with the model presented in Zhu et
al. [24] (Fig. 5 B). The resting state of the actuator is when the fluid
volume is maximum, leading to minimum compression pressure. When fluid volume
is withdrawn from the actuator, the compression pressure increases. This
relationship was approximately linear both before and after fluid volume of 4
mL, with a larger slope for fluid volume between 4 mL and 5 mL. The maximum
compression pressure decreased with operation stroke range, as the margins
illustrated in Fig. 5 B.

Figure 6: Frequency response of the system. A. The hysteresis loops presented
in the relationship between fluid volume and compression pressure show energy
loss during the actuation. The energy loss increases with increasing
frequency. Legend: commanded frequency in Hz. B. Legend: different operation
stroke range in %. The experimental frequency reaches a plateau for all stroke
ranges. The smaller the stroke range, the higher the experimental frequency
achieved. Overall, the system is able to operate at frequencies up to about 20
Hz despite some discrepancies between commanded frequency and experimental
frequency. C. As the stroke magnitude gets higher, the drop-off in stroke
occurs at lower frequencies. The magnitude remains almost flat across all
frequencies for 10% operation stroke range. Figure 7: Motion capture results
for various dynamic compression patterns including peristaltic motions (A-D,
F), all-in-phase actuation (E), and sequential squeezing (G-H). The texts at
the top left corner of each subfigure denote the wavelength and wave speed of
each peristaltic pattern. For the sequential squeezing patterns, the texts
show the squeezing time of each actuator.  Figure 8: The wearable robot is
configured to promote hemodynamic circulation in a limb model via peristaltic
transport. A. A simplified illustration of the cross-section through the
middle of upper arm [34]. B. The cross-section of the arm model used for the
experiment. C. Testing apparatus for the peristaltic transport.

###  III-B Dynamic Frequency Response of the System

We evaluated the system’s dynamic frequency response at frequencies ranging
from 0.2 Hz to 50 Hz with stroke amplitudes from 10% to 100%. The stroke of
the piston was measured, and the actual frequency (experimental frequency) was
obtained using spectrum analysis of the data. Fig. 6 A shows the results for
the stroke amplitude of 10%. Compression pressure decreased as frequency
increased up to 17 Hz, above which the compression pressure and the fluid
volume had similar ranges. Results also revealed that the system was capable
of operating at frequencies up to 20 Hz (Fig. 6 B). Motor power constrained
the stroke amplitude in that the lower the maximum stroke used, the higher
frequency achieved. The magnitude decrement was more prominent for larger
maximum stroke (Fig. 6 C), while little magnitude decrement was observed when
operating with 10% stroke.

###  III-C Dynamic Compression Motion Patterns

We characterized the dynamic spatial compression motion patterns by measuring
shape deformation with an optical motion capture system (Flex 13; OptiTrack).
Twenty-four reflective markers (5 mm diameter) were distributed on the surface
of the wearable robot, with three on each actuator. Compression patterns were
generated and the dynamic positions of each marker are measured. Fig. 7 shows
the average radius changes of the three markers on each actuator over time.
Five peristaltic motions were composed by varying wavelength, wave speed, and
the starting actuator (Fig. 7 A-D, F), along with an all-in-phase synchronized
compression pattern (Fig. 7 E). Two sequential squeezing patterns were also
evaluated with squeezing times of 1 s and 2 s respectively (Fig. 7 G-H). These
results mechanically validated that the wearable robot was capable of
generating different compression patterns on a soft body.

##  IV Applications for Compression Therapy and Therapeutic Massage

We demonstrated applications of the peristaltic wearable robot for compression
therapy to promote blood circulation and for therapeutic massage therapy.

###  IV-A Compression Therapy for Blood Flow Promotion

Peristaltic action on a flexible tube can introduce fluid flow, thus, can be
used to promote blood flow in the veins, to treat various medical conditions
[1, 2, 3]. To demonstrate the ability of the peristaltic compression robot to
promote blood circulation, we designed and fabricated an upper arm model (Fig.
8 B) that mimics the anatomy of the human upper arm (Fig. 8 A) [34]. The
muscles (triceps, biceps, and brachialis muscles) and skin were realized using
a soft silicone material (Ecoflex 00-30, shore hardness 00-30, Smooth-On,
Inc., Macungie, PA). A rigid 3D printed bone structure was fabricated in CPE
(Ultimaker filament). A latex tube was placed adjacent to the bone,
representing the brachial vein. A soft strip made of stiffer silicone with a
shore hardness of 2A (Dragon Skin FX-Pro, Smooth-On, Inc., Macungie, PA) was
used to direct compression pressure to the vein.

Figure 9: A. Experimental results of the flow rate showed a linear
relationship with the wavelength, in agreement with the theoretical prediction
(equation 7). B. Results showed that the viscosity had a weak effect on the
flow rate, agreeing with the analytical predictions in [35, 36].

The limb apparatus is shown in Fig. 8 C. Vegetable glycerin served as the
fluid for transport in the artificial vein, as it can be mixed with water for
different viscosity values [37]. Peristaltic compression patterns were
generated when each motor rotated sinusoidally with an onset delay time of
$\Delta t$ between adjacent actuators:

$\alpha=A\sin(\,2\pi f(t+(n-1)\Delta t)\,),$ (4)

where $\alpha$ is the rotation degree for the motor, $n$ indexes the actuator
channel, $t$ is the time variable, $A$ and $f$ are the amplitude and frequency
of the sinusoidal wave respectively. The spatial wave generated by all the
actuators is described as:

$y(x,t)=A^{\prime}\cos(\frac{2\pi}{\lambda}x-2\pi f(t-\Delta t)),$ (5)

where $y$ and $x$ are the vertical and horizontal position variables,
$A^{\prime}$ and $\lambda$ are the amplitude and wavelength of the spatial
wave respectively.

The peristaltic compression robot was wrapped around the limb model, with a
spacing of about 1.1 cm between adjacent actuators. During peristaltic
actuation, a flow was induced, transporting fluid from the source through an
elbow connector to the collection container (Fig. 8 C). From the theory of
peristaltic flow in flexible tubes [35], when the pressure change over one
wavelength $\Delta P_{\lambda}=0$, the time average peristaltic flow $\bar{Q}$
in a tube depends on the average radius of the tube $a$, wave amplitude $b$,
and wavespeed $c$ as follows:

$\bar{Q}=\frac{\pi cb^{2}}{2}\frac{16a^{2}-b^{2}}{2a^{2}+3b^{2}}$ (6)

When the frequency $f$ of the peristaltic wave is constant, the time average
flow increases with wavelength $\lambda$ due to the increase in unoccluded
volume:

$\bar{Q}=\frac{\pi\lambda fb^{2}}{2}\frac{16a^{2}-b^{2}}{2a^{2}+3b^{2}}$ (7)

Frequencies of 0.2 Hz and 0.5 Hz were tested. Different peristaltic
compression patterns were generated with onset delay time stepping between 0
ms (all-in-phase actuation) and 1125 ms (90° phase shift) by 125 ms (9° phase
shift). Each wave pattern was repeated three times, and the fluid volume
collected in the container was measured.

TABLE I: Theoretical viscosity and Reynolds number of glycerin-water mixtures with different glycerin concentrations in mass $C_{m}$. $C_{m}$ | Density | Dynamic viscosity [cP] | Reynolds number
---|---|---|---
0.5 | 1.12 | 5.57 | 0.6427
0.7 | 1.17 | 20.88 | 0.1799
0.8 | 1.20 | 53.96 | 0.0714
0.9 | 1.23 | 193.24 | 0.0204
0.95 | 1.24 | 438.10 | 0.0091
1 | 1.26 | 1,178.64 | 0.0034

We found that the flow rate was higher for peristaltic motions than all-in-
phase actuation when the wavelength was larger than about 5 cm. The time-
average flow rate increased with the wavelength following a linear
relationship (Fig. 9 A), in agreement with theoretical predictions (equation
7). The maximum flow rate was achieved when the wavelength was about 22 cm.
When the wavelength further increased to 44 cm, the flow rate decreased. This
may be due to the boundary conditions in the testing configuration, as the
total length of actuation (about 9.2 cm) was much smaller than the wavelength
of 44 cm. When the wavelength was very large, the wave pattern resembled all-
in-phase actuation and the fluid reflux counteracting with the peristaltic
flow was large. This decrement for wavelengths above 22 cm was also presented
when frequency increased to 0.5 Hz. The overall flow rate for 0.5 Hz was
slightly larger than 0.2 Hz, in agreement with theoretical predictions
(equation 7).

The dynamic viscosity of glycerin at temperature 22° is about 1179 cP, which
is much larger than the normal blood viscosity values (between 3.3 cP and 5.5
cP) [38]. Blood is also a non-Newtonian fluid whose viscosity changes
depending on the hemodynamic conditions. Here, we evaluated the effect of
fluid viscosity on induced flow rate. The viscosity of the transported fluid
was varied by mixing glycerin with water at different weight percentages. The
theoretical viscosity of the glycerin-water mixture was obtained using
published results [37] (Table I).

Experimental results showed that viscosity had a weak effect on the flow rate
(Fig. 9 B). The flow rate decreased as the viscosity decreased. This finding
is consistent with predictions in the literature that show that viscosity have
little effect on the flow rate when viscous forces are dominant (small
Reynolds numbers) [35, 36].

###  IV-B Therapeutic Massage with a Haptic Sleeve

Wave-like peristaltic compression can also be used to emulate manual massage
therapy for stress reduction and muscle relaxation. Papadopoulou et al.
developed an affective sleeve that produces sequential compression and warmth
on the forearm using shape memory alloys (SMAs) [18].

We adapted our peristaltic wearable robot to supply massaging patterns (Fig.
10). Different massage patterns may be generated by varying actuation
frequency, amplitude (operation stroke range), the phase time delay between
adjacent actuators, and the initialization location for the wave. A
supplementary video shows several examples illustrating patterns of haptic
massage feedback generated by the device.

Figure 10: A. Our peristaltic wearable robot on user’s forearm for therapeutic
massage. B. The actuator side of the wearable robot. C. The closure side of
the wearable robot.

##  V Discussion and Future Work

This article presents a peristaltic soft, wearable robot for robotic
compression therapy. Although IPC has remained the main tool for automated
compression therapy for decades, little device renovation has been done to
improve the spatial arrangement due to the limitations of pneumatic operation.
We present a novel peristaltic wearable robot that has finely distributed
modules with a width comparable to the size of a finger for localized
compression. We also implement a modular hydraulic actuation system for
efficient control compared to commonly used pneumatic wearables. Each module
is able to generate compression pressure up to 22 kPa and frequency up to 14
Hz, meeting the requirements for compression therapy and therapeutic haptic
massage [4, 5, 6]. With programmable frequency, amplitude, phase delay, and
duration, it is capable of rendering a large range of spatial-temporal wave
patterns. We further demonstrate the application of the peristaltic wearable
robot for blood flow promotion and therapeutic haptic massage.

The theoretical and experimental results demonstrate the device’s ability to
drive fluid flow in a model limb via peristaltic transport, and provide a
quantitative model that parameters governing the peristaltic pattern to the
flow rate and fluid properties. These findings indicate that such systems may
hold substantial promise for the treatment of lymphatic and blood circulation
inefficiencies, which are associated with several health disorders. The model
arm used in our experiments is in reality quite different than a real arm.
Future translational research aimed at designing and evaluating the clinical
efficacy of such a peristaltic robotic sleeve is warranted.

## Acknowledgments

The authors acknowledge support from the U.S. National Science Foundation
Awards 1751348 and 2002529 to Visell, 2139319 to Dinulescu, and 1944816 to
Hawkes. The authors acknowledge the use of the Microfluidics Laboratory and
Innovation Workshop within the California NanoSystems Institute, supported by
the University of California, Santa Barbara and the University of California,
Office of the President.

## References

  * [1] R. Duffield and J. Kalkhoven, “Effects of compression garments in strength, power and speed based exercise,” in _Compression garments in sports: Athletic performance and recovery_. Springer, 2016, pp. 63–78.
  * [2] H. Partsch, “Compression therapy: clinical and experimental evidence,” _Annals of vascular diseases_ , pp. ra–12, 2012.
  * [3] J. D. Crane, D. I. Ogborn, C. Cupido, S. Melov, A. Hubbard, J. M. Bourgeois, and M. A. Tarnopolsky, “Massage therapy attenuates inflammatory signaling after exercise-induced muscle damage,” _Science translational medicine_ , vol. 4, no. 119, pp. 119ra13–119ra13, 2012.
  * [4] B. Partsch and H. Partsch, “Calf compression pressure required to achieve venous closure from supine to standing positions,” _Journal of vascular surgery_ , vol. 42, no. 4, pp. 734–738, 2005.
  * [5] C. J. Payne, E. G. Hevia, N. Phipps, A. Atalay, O. Atalay, B. R. Seo, D. J. Mooney, and C. J. Walsh, “Force control of textile-based soft wearable robots for mechanotherapy,” in _2018 IEEE International Conference on Robotics and Automation (ICRA)_. IEEE, 2018, pp. 5459–5465.
  * [6] K. Delis, Z. Azizi, R. Stevens, J. Wolfe, and A. Nicolaides, “Optimum intermittent pneumatic compression stimulus for lower-limb venous emptying,” _European Journal of Vascular and Endovascular Surgery_ , vol. 19, no. 3, pp. 261–269, 2000.
  * [7] L. Roberts, “Effects of patterns of pressure application on resting electromyography during massage,” _International journal of therapeutic massage & bodywork_, vol. 4, no. 1, p. 4, 2011.
  * [8] A. Chen, S. Frangos, S. Kilaru, and B. Sumpio, “Intermittent pneumatic compression devices–physiological mechanisms of action,” _European Journal of Vascular and Endovascular Surgery_ , vol. 21, no. 5, pp. 383–392, 2001\.
  * [9] P. S. Moran, C. Teljeur, P. Harrington, and M. Ryan, “A systematic review of intermittent pneumatic compression for critical limb ischaemia,” _Vascular Medicine_ , vol. 20, no. 1, pp. 41–50, 2015.
  * [10] Y. M. Arabi, M. Khedr, S. I. Dara, G. S. Dhar, S. A. Bhat, H. M. Tamim, and L. Y. Afesh, “Use of intermittent pneumatic compression and not graduated compression stockings is associated with lower incident vte in critically ill patients: a multiple propensity scores adjusted analysis,” _Chest_ , vol. 144, no. 1, pp. 152–159, 2013.
  * [11] S. Kitayama, J. Maegawa, S. Matsubara, S. Kobayashi, T. Mikami, K. Hirotomi, and S. Kagimoto, “Real-time direct evidence of the superficial lymphatic drainage effect of intermittent pneumatic compression treatment for lower limb lymphedema,” _Lymphatic research and biology_ , vol. 15, no. 1, pp. 77–86, 2017.
  * [12] A. J. COMEROTA, “Intermittent pneumatic compression for dvt prophylaxis,” _Supplement to endovascular today_ , pp. 3–5, 2011.
  * [13] D. Guan, R. Liu, C. Fei, S. Zhao, and L. Jing, “Fluid–structure coupling model and experimental validation of interaction between pneumatic soft actuator and lower limb,” _Soft robotics_ , vol. 7, no. 5, pp. 627–638, 2020\.
  * [14] S. Zhao, R. Liu, X. Wu, C. Ye, and A. W. Zia, “A programmable and self-adaptive dynamic pressure delivery and feedback system for efficient intermittent pneumatic compression therapy,” _Sensors and Actuators A: Physical_ , vol. 315, p. 112285, 2020.
  * [15] M. Zhu, S. Biswas, S. I. Dinulescu, N. Kastor, E. W. Hawkes, and Y. Visell, “Soft, wearable robotics and haptics: Technologies, trends, and emerging applications,” _Proceedings of the IEEE_ , vol. 110, no. 2, pp. 246–272, 2022.
  * [16] C. Thalman and P. Artemiadis, “A review of soft wearable robots that provide active assistance: trends, common actuation methods, fabrication, and applications,” _Wearable Technologies_ , vol. 1, 2020.
  * [17] W. Wu and H. Culbertson, “Wearable haptic pneumatic device for creating the illusion of lateral motion on the arm,” in _2019 IEEE World Haptics Conference (WHC)_. IEEE, 2019, pp. 193–198.
  * [18] A. Papadopoulou, J. Berry, T. Knight, and R. Picard, “Affective sleeve: Wearable materials with haptic action for promoting calmness,” in _International Conference on Human-Computer Interaction_. Springer, 2019, pp. 304–319.
  * [19] K. Otsuka and C. M. Wayman, _Shape memory materials_. Cambridge university press, 1999.
  * [20] B. B. Kang, H. Choi, H. Lee, and K.-J. Cho, “Exo-glove poly ii: A polymer-based soft wearable robot for the hand with a tendon-driven actuation system,” _Soft robotics_ , vol. 6, no. 2, pp. 214–227, 2019.
  * [21] U. A. Hofmann, T. Bützer, O. Lambercy, and R. Gassert, “Design and evaluation of a bowden-cable-based remote actuation system for wearable robotics,” _IEEE Robotics and Automation Letters_ , vol. 3, no. 3, pp. 2101–2108, 2018.
  * [22] E. Suarez, J. J. Huaroto, A. A. Reymundo, D. Holland, C. Walsh, and E. Vela, “A soft pneumatic fabric-polymer actuator for wearable biomedical devices: Proof of concept for lymphedema treatment,” in _2018 IEEE International Conference on Robotics and Automation (ICRA)_. IEEE, 2018, pp. 5452–5458.
  * [23] H. J. Yoo, W. Kim, S.-Y. Lee, J. Choi, Y. J. Kim, Y. Nam, K.-J. Cho _et al._ , “Wearable lymphedema massaging modules: Proof of concept using origami-inspired soft fabric pneumatic actuators,” in _2019 IEEE 16th International Conference on Rehabilitation Robotics (ICORR)_. IEEE, 2019, pp. 950–956.
  * [24] M. Zhu, T. N. Do, E. Hawkes, and Y. Visell, “Fluidic fabric muscle sheets for wearable and soft robotics,” _Soft Robotics_ , 2020.
  * [25] M. Zhu, A. H. Memar, A. Gupta, M. Samad, P. Agarwal, Y. Visell, S. J. Keller, and N. Colonnese, “Pneusleeve: In-fabric multimodal actuation and sensing in a soft, compact, and expressive haptic sleeve,” in _Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems_ , 2020, pp. 1–12.
  * [26] W. G. Paterson, “Esophageal peristalsis,” _GI Motility online_ , 2006.
  * [27] N. P. M. Kuijsters, W. G. Methorst, M. S. Q. Kortenhorst, C. Rabotti, M. Mischi, and B. C. Schoot, “Uterine peristalsis and fertility: current knowledge and future perspectives: a review and meta-analysis,” _Reproductive biomedicine online_ , vol. 35, no. 1, pp. 50–71, 2017.
  * [28] P. Edmond, J. A. Ross, and I. S. Kirkland, “Human ureteral peristalsis,” _The Journal of urology_ , vol. 104, no. 5, pp. 670–674, 1970.
  * [29] J. Misra and S. Pandey, “Peristaltic transport of blood in small vessels: study of a mathematical model,” _Computers & Mathematics with Applications_, vol. 43, no. 8-9, pp. 1183–1193, 2002.
  * [30] M. Jaffrin and A. Shapiro, “Peristaltic pumping,” _Annual review of fluid mechanics_ , vol. 3, no. 1, pp. 13–37, 1971.
  * [31] F. Chen, S. Dirven, W. Xu, and X. Li, “Soft actuator mimicking human esophageal peristalsis for a swallowing robot,” _IEEE/ASME Transactions on Mechatronics_ , vol. 19, no. 4, pp. 1300–1308, 2013.
  * [32] E. W. Hawkes, D. L. Christensen, and A. M. Okamura, “Design and implementation of a 300% strain soft artificial muscle,” in _2016 IEEE International Conference on Robotics and Automation (ICRA)_. IEEE, 2016, pp. 4022–4029.
  * [33] R. L. Norton, _Design of Machinery: An Introduction to the Synthesis and Analysis of Mechanisms and Machines_ , 3rd ed. McGraw Hill, 2004, pp. 178–180.
  * [34] A. C. Eycleshymer and D. M. Schoemaker, _A cross-section anatomy_. D. Appleton, 1911.
  * [35] C. Barton and S. Raynor, “Peristaltic flow in tubes,” _The Bulletin of mathematical biophysics_ , vol. 30, no. 4, pp. 663–680, 1968.
  * [36] M. Y. Jaffrin, “Inertia and streamline curvature effects on peristaltic pumping,” _International Journal of Engineering Science_ , vol. 11, no. 6, pp. 681–699, 1973.
  * [37] N.-S. Cheng, “Formula for the viscosity of a glycerol- water mixture,” _Industrial & engineering chemistry research_, vol. 47, no. 9, pp. 3285–3288, 2008.
  * [38] E. Nader, S. Skinner, M. Romana, R. Fort, N. Lemonne, N. Guillot, A. Gauthier, S. Antoine-Jonville, C. Renoux, M.-D. Hardy-Dessources _et al._ , “Blood rheology: key parameters, impact on blood flow, role in sickle cell disease and effects of exercise,” _Frontiers in physiology_ , vol. 10, p. 1329, 2019\.

## Biography Section

|  Mengjia Zhu received the B.Eng. (Hons.) degree in apparel design and
engineering from Soochow University, Suzhou, China, in 2015, and the M.S.
degree in materials science and engineering from Arizona State University,
Tempe, AZ, USA, in 2017. She is currently working toward the Ph.D. degree in
media arts and technology at the University of California, Santa Barbara,
Santa Barbara, CA, USA, under the supervision of Prof. Yon Visell in the RE
Touch Lab. Her research interests lie in the area of functional wearables
including wearable haptics, soft robotics, and assistive technologies.
---|---
|  Adrian Ferstera received his M.Sc in Mech Eng with a major in Robotics,
Systems and Control from ETH Zurich. During his time at ETH Zurich, he focused
on software development for any robotic application under the supervision of
Prof. Bradley Nelson in the Multi-Scale Robotics Laboratory. He is currently
working for a software consultancy company which focuses on software
development for novel banking applications.
---|---
|  Stejara Iulia Dinulescu received the B.S. degree in Psychology (with
Distinction), the B.A. degree in Creative Computation, and the B.A. degree in
Studio Arts from Southern Methodist University, Dallas, TX, USA, in 2019, with
minors in Neuroscience and Cognitive Science. She is currently a Ph.D.
candidate in the Media Arts and Technology department at the University of
California, Santa Barbara, Santa Barbara, CA, USA, working in the RE Touch Lab
and mentored by Prof. Y. Visell. Her research interests include studying the
perceptual and mechanical properties of interpersonal touch and developing
wearable haptic and soft robotic devices for reproducing touch experiences
remotely.
---|---
|  Nikolas Kastor holds a Ph.D. in Mechanical Engineering from Tufts
University and is a Fellow of the Tufts University Soft Material Robotics
National Science Foundation (NSF) Integrative Graduate Education and Research
Traineeship (IGERT). Dr. Kastor contributes over 13 years of research, design,
manufacturing, and project management experience in the fields of soft
material robotics, haptics, MEMS sensors, commercial transducers, and consumer
products; where he has published numerous papers and patents. He has conducted
business and presented research in North America, Europe, and Asia. Dr. Kastor
has participated in the NSF Innovation Corps (I-Corps) customer discovery
training for a wearable robotics application and is currently self-employed.
During this project, Nikolas was a postdoctoral scholar at the University of
California Santa Barbara working on soft haptic, sensing, and actuation
systems with the RE Touch Lab.
---|---
|  Max Linnander received the B.Sc. degree in physics from Arizona State
University, Tempe, AZ, USA, in 2021. He is currently working toward the Ph.D.
degree in mechanical engineering with the University of California, Santa
Barbara, Santa Barbara, CA, USA, under the supervision of Prof. Y. Visell. His
research interests include optics, acoustics, and haptics.
---|---
|  Elliot Wright Hawkes (Member, IEEE) received the A.B. degree with highest
honors in mechanical engineering from Harvard University, Cambridge, MA, USA;
the M.S. degree in mechanical engineering from Stanford University, Stanford,
CA, USA; and the Ph.D. degree in mechanical engineering from Stanford
University under the supervision of Prof. M. Cutkosky, in 2009, 2012, and
2015, respectively. He is an Assistant Professor with the Department of
Mechanical Engineering, University of California, Santa Barbara, USA. His
research interests include compliant robot design, mechanism design,
nontraditional materials, artificial muscles, directional adhesion, and
growing robots. Dr. Hawkes recently received the National Science Foundation
CAREER Award and the NASA Early Faculty Career Award.
---|---
|  Yon Visell received the B.A. degree in physics from the Wesleyan
University, Middletown, CT, USA, in 1995, and the M.A. degree in physics from
The University of Texas, Austin, Austin, TX, USA, in 1999, and the Ph.D.
degree in electrical and computer engineering from McGill University,
Montreal, QC, Canada, in 2011. He is currently an Associate Professor with the
University of California, Santa Barbara, Santa Barbara, CA, USA, in the Media
Arts and Technology Program, Department of Electrical and Computer
Engineering, and Department of Mechanical Engineering (by courtesy). His
academic interests include haptics, soft robotics, and soft electronics. He
was a Postdoctoral Scholar with Sorbonne University, Paris. Prior to his Ph.D.
studies, Visell spent several years in industry positions, including that of
digital signal processing (DSP) developer for Ableton Live. He has authored
and coauthored more than 75 scientific works. Dr. Visell was the recipient of
several awards for work presented at prominent academic conferences. He
received a Google Faculty Research Award in 2016, a Hellman Family Foundation
Faculty Fellowship in 2017, and a U.S. National Science Foundation CAREER
award in 2018. He is an Associate Editor for the IEEE ROBOTICS AND AUTOMATION
LETTERS and serves as General Co-Chair of the 2022 IEEE Haptics Symposium.
---|---


11institutetext: Department of Electronics and Information Technology, Warsaw
University of Technology
11email<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>22institutetext: Research and Academic
Computer Network (NASK-PIB) 22email<EMAIL_ADDRESS>
# Deep learning for spike detection in deep brain stimulation surgery

Arkadiusz Nowacki 11 Ewelina Kołpa 11 Mateusz Szychiewicz 11
Konrad Ciecierski 22

###### Abstract

Deep brain stimulation (DBS) is a neurosurgical procedure successfully used to
treat conditions such as Parkinson’s disease. Electrostimulation, carried out
by implanting electrodes into an identified focus in the brain, makes it
possible to reduce the symptoms of the disease significantly. In this paper, a
method for analyzing recordings of neuronal activity acquired during DBS
neurosurgery using deep learning is presented. We tested using a convolutional
neural network (CNN) for this purpose. Based on the time window, the
classifier assesses whether neuronal activity (spike) is present. The maximum
accuracy value for the classifier was 98.98%, and the area under the receiver
operating characteristic curve (AUC) was 0.9898. The method made it possible
to obtain a classification without using data preprocessing.

###### Keywords:

deep learning convolutional neural network medical diagnosis DBS deep brain
stimulation spike

##  1 Introduction and Problem Formulation

Deep brain stimulation (DBS) is an efficient method in the field of
neurosurgery, which not only can be used to treat Parkinson’s disease but also
Tourette’s syndrome, movement, and anxiety disorders [10]. This is a more
efficient method for the localization of a small structure Subthalamic Nucleus
than standard imaging techniques such as CT and MRI. The main essence of DBS
is the modulation of specific structures in the brain by electrical impulses
generated with a frequency of 100-200 Hz via surgically implanted electrodes
in specific brain regions. These electrodes emit electrical impulses that can
modulate the activity of neurons, which can help to alleviate symptoms of
conditions such as dystonia and essential tremor. Due to its clinical
effectiveness, scientists are still looking for alternative ways to use it in
psychiatry and other fields of medicine. To ensure that the electrodes are
placed in the optimal location, doctors use spike detection to identify the
specific neural activity that is associated with the condition being treated.

Once the electrodes are in place, spike detection can also be used to monitor
the effects of DBS treatment over time. By measuring the neural activity
before and after DBS, doctors can determine if the treatment has the desired
effect and adjust the stimulation parameters as needed. Additionally, spike
detection can be used to detect any side effects of DBS treatment, such as
changes in cognitive function or mood.

The following parts of this work will discuss related scientific studies on
data acquisition, cleaning of artifacts, and spike detection. The developed
methods of spike detection using deep learning, data analysis on which
experiments were carried out, and their results will also be described. The
paper proposes the use of a convolutional neural network for spike detection.
The model was trained on real data obtained during the DBS operation.
Additionally, the impact of the training data on accuracy, precision, recall,
and F1 score is considered.

##  2 Related Work

###  2.1 Spike detection

A neural spike, also known as an action potential, is a brief, rapid change in
the electrical potential of a neuron. This is due to the rapid influx of
positively charged ions into the cell, causing the membrane potential to
change rapidly from negative to positive[6].

Spike detection identifies the presence of nerve impulses in an
electrophysiological signal, such as EEG or extracellular recording. There are
various methods for detecting spikes in neural signals, including:

  1. 1.

threshold-based methods

  2. 2.

wavelet-based methods

  3. 3.

template matching

  4. 4.

spectral method

Threshold-based methods involve setting a threshold value; any signal
exceeding that threshold is considered a spike.

Wavelet-based methods use wavelet transforms to decompose the signal into
different frequency bands and then identify spikes based on wavelet
coefficients.

Template matching involves creating a peak waveform template and then using
that template to detect signal spikes.

The spectral method is based on the power spectral density of signals and is
used to detect high-frequency spikes[12].

###  2.2 Deep learning in brain waves analysis

Deep learning is a subfield of machine learning that uses neural networks with
multiple layers to analyze complex data. Much work has been done on EEG
analysis in terms of using deep learning to analyze brainwaves. In the context
of brainwave analysis, deep learning techniques such as convolutional neural
networks (CNNs) and recurrent neural networks (RNNs) can be used to analyze
large amounts of electroencephalography data, identifying patterns and
features that are indicative of different cognitive states[11].

Convolutional neural networks (CNNs) are particularly well suited for
analyzing electroencephalography data, as they can learn spatial
representations of the data by applying filters to small regions of the input
data. This allows them to identify patterns in the electroencephalography data
specific to certain brain regions or cognitive states[11].

Recurrent neural networks (RNNs) are another type of deep learning algorithm
that can be used in brainwave analysis. RNNs can process sequential data, such
as time series data, and learn patterns in the data that span multiple time
steps. This makes them well suited for analyzing electroencephalography data,
as signals are time series data that change over time[1].

Deep learning techniques such as deep belief networks (DBNs) and autoencoders
(AEs) are also used for EEG-based brain-computer interfaces (BCIs) and for
identifying abnormal brain activities such as seizures and sleep disorders[9].

##  3 Deep Learning-based Algorithm for Spike Detection

###  3.1 Input Dataset Description

The analyzed data came from recordings made during deep brain stimulation
surgery. The sampling device took data at a frequency of 24 kHz. Such
frequency means that there are 24 samples per 1 ms of recording. Each
recording is 4s long, giving 240000 samples per recording. To create the
dataset, the data was processed to obtain the timestamps in which the spikes
occurred.

The recordings contain a lot of noise and interference. To better detect
spikes, has been carried out data renormalization. The renormalization was
based on the median absolute deviation (MAD). MAD is calculated by finding the
median of a data set and then finding the absolute difference between each
data point and the median. The median of absolute differences is then taken as
a measure of the dispersion or variability of the data set[4].

Figure 1: Samples from the recording before (left) and after (right)
renormalization. In red: +/- the MAD; in dashed blue +/- the SD

${MAD}={median}(|X-{median}(X)|)\frac{1}{0.6745}$ (1)

Where:

  * •

$X$: is the dataset

  * •

$median(X)$: is the median of the dataset

  * •

$|x-median(x)|$: is the absolute difference between each data point and the
median of the dataset

The constant $\frac{1}{0.6745}$ is used to make the MAD comparable to the
standard deviation for a normal distribution[8].

Renormalization aims to rescale the raw data such that the standard deviation
(SD) noise is approximately 1. Exact scaling may not be feasible, but MAD
significantly approximates the noise value to SD (Figure 1). Renormalization
using MAD can help when recordings are multichannel. This allows for comparing
electrode/channel values with each other.

Figure 2: Sample from the recording with detection threshold (dashed blue) and
the filtered and rectified trace (red).

Spike detection involves selecting local extremes above a designated
threshold. The data is first filtered using a box filter (a moving average) to
reduce high-frequency noise[7]. The box filter works by averaging the data
over a specific time window, smoothing out high-frequency signal fluctuations.
This can help improve spike detection because it reduces the impact of noise
on the detection process.

The SD value determines the detection threshold. It can be a multiple of SD or
its value. Based on the crossing of this threshold, sites where a spike could
occur, are selected(Figure 2).

Spike detection involves checking selected samples. The absolute value of
detected spikes and their minimum distances from each other is checked[7].
This makes it possible to filter out distorted, overlapping spikes. This way,
timestamps were obtained where spikes occur (Figure 3).

Figure 3: Raw data with a detected spike (red dot)

Spikes usually last about one millisecond[5]. To create a training and
validation dataset, time windows were stretched around the timestamps. As the
device operates at a frequency of 24 samples per millisecond, time windows of
48 samples were created. The time windows were created using the raw data
before renormalization (Figure 4). The resulting data was divided into a
training and validation dataset at a ratio of 80:20.

Figure 4: Sample time window with spike

###  3.2 Neural network

In order to detect spikes, was created a binary classifier. It was based on a
convolutional neural network. Using deep learning with convolutional neural
networks yielded promising results in classifying EEG problems[11]. The
architecture of the created network is shown in Figure 5.

Figure 5: Structure of the neural network (top) and the structure of the
sequence, repeated six times (bottom)

The size of the input data corresponds to the size of the time window. The
recordings are single-channel, and the window is 48 samples in size, so the
input vector is 1x48. The input data is then preprocessed through several one-
dimensional convolution layers. The Leaky Rectified Linear Unit (or Leaky
ReLU) is used here. Unlike the standard ReLU, the function has a slight bias
for negative values, unlike the ReLU, where for negative values, the function
value is equal to 0[13].

A block was then applied: dropout, a one-dimensional convolutional layer, and
Leaky ReLU. The block is designed to get all the necessary information
regarding the time window and the presence of a spike in it. This block is
repeated six times.

The data is then modified to the target output size. The output is of form
2x1. The two outputs correspond to binary classification: no spike(or presence
of noise) and the presence of spike. To process the data in this way, two
layers were used: a one-dimensional convolutional network and a sigmoid.
Sigmoid was used to normalize the data to an interval of 0-1 so that the
largest value[3]. The largest value thus indicates the classifier’s
prediction.

##  4 Numerical Experiments and Performance Evaluation

###  4.1 Neural Network Training

The classifier was trained for 15 epochs. For every epoch, a checkpoint of the
trained model was created, and its metric values were saved. The loss function
is Binary Cross Entropy, and the learning rate was set to 0.001; adaptive
Moment Estimation (Adam) was chosen as an optimizer.

The following metrics have been checked:

  1. 1.

accuracy

  2. 2.

precision

  3. 3.

recall

  4. 4.

$F_{1}$ score

Accuracy is a commonly used metric to evaluate the performance of a
classification model. It is the ratio of the number of correct predictions
made by the model to the total number of predictions made. Accuracy is between
0 and 1, where 1 is perfect accuracy, and 0 is no accuracy[2].

${ACC}=\frac{TP+TN}{TP+TN+FN+FP}$ (2)

Precision is the ratio of the number of true positive predictions (i.e., the
number of times the model correctly predicted a positive class) to the total
number of positive predictions made by the model. Precision is between 0 and
1, where 1 mean perfect precision and 0 mean no precision[2].

${Precision}=\frac{TP}{TP+FP}$ (3)

The recall is the ratio of the number of true positive predictions (i.e., the
number of times the model correctly predicted the positive class) to the total
number of positive instances in the dataset. The recall is between 0 and 1,
where 1 represents perfect recall, and 0 represents no recall[2].

${Recall}=\frac{TP}{TP+FN}$ (4)

The $F_{1}$ score balances precision and recall, giving equal weight to both.
A high F1 score means the model has both a high precision and recall.

${F_{1}}=2*\frac{Precision*Recall}{Precision+Recall}$ (5)

Before the actual training, the number of blocks containing dropout, a one-
dimensional convolutional layer, and Leaky ReLU was selected. The average
values of the accuracy metrics were compared for 15 epochs. Values have been
compared in the tabular 1.

Table 1: Comparison of average accuracy metrics against a number of blocks. Number block | Accuracy (avg)
---|---
1 | 0.9686
3 | 0.9726
6 | 0.9827
9 | 0.9829
12 | 0.9831

Based on the comparison, six blocks were selected. Admittedly, nine and 12
achieved higher average accuracy but significantly increased training and
prediction times, with minimal accuracy gains.

The training was done using a previously created dataset discussed in the
previous chapter.

###  4.2 Results of Experiments

Classifier training was carried out in several variants, using 25%, 50%, 75%,
and 100% of the training set. It was thus tested how much data the network
needs to achieve promising results. The results for the best models are
presented in table 2.

Table 2: Compare the metrics against the percentage of the original training set used (the best results) Metric |  25% data |  50% data |  75% data |  100% data
---|---|---|---|---
Accuracy |  0.9099 |  0.9852 |  0.9865 |  0.9898
Precision |  0.9963 |  0.9929 |  0.9740 |  0.9846
Recall |  0.8226 |  0.9774 |  0.9996 |  0.9951
$F_{1}$ score |  0.9011 |  0.9851 |  0.9866 |  0.9898

The best results were achieved by the model for which the entire available
training set was used. The value of the accuracy metric was 0.9898, and the F1
score was 0.9898 (both values were the highest in the entire comparison).

It is worth noting that high metrics values were also achieved by models
trained at 50% and 75% of the original training set.

Figure 6: Confusion matrixes for 25% (left) and 100% (right) dataset (the best
model)

Confusion matrices were created to illustrate the results (Figure 6). The
validation set consisted of 9762 examples. In the case of the best model, it
achieved high values for True Positive (4852) and True Negative (4810). This
gives the correct answer for 98% and over 99% for true negative and true
positive, respectively.

In order to check the correctness of distinguishing between classes by the
classifier, a graph of the ROC curve was created (Figure 7). The area under
the curve (AUC) was 0.990.

Figure 7: ROC curve for best model

##  5 Summary and Conclusions

In this paper, we presented the use of deep learning using convolutional
neural networks to detect spikes in recordings from DBS surgery automatically.
The best model achieved 0.9898 accuracies and $F_{1}$ score of 0.9898. The
binary classifier has yielded promising results for use in accelerating
automatic spike detection. Reducing the training crop by 50% yielded further
satisfactory results.

A high value of the AUC metric (0.990) means that the classifier is good at
recognizing individual classes. It can distinguish spikes from noise contained
in the recording or overlapping spikes.

The classifier can be used to find spikes for sorting faster, and can also
search for correct spikes in a distorted narrative containing much noise.

## References

  * [1] Alhagry, S., Fahmy, A.A., El-Khoribi, R.A.: Emotion recognition based on eeg using lstm recurrent neural network. International Journal of Advanced Computer Science and Applications 8(10) (2017)
  * [2] Alpaydin, E.: Introduction to machine learning. MIT press (2020)
  * [3] Han, J., Moraga, C.: The influence of the sigmoid function parameters on the speed of backpropagation learning. In: From Natural to Artificial Neural Computation: International Workshop on Artificial Neural Networks Malaga-Torremolinos, Spain, June 7–9, 1995 Proceedings 3. pp. 195–201. Springer (1995)
  * [4] Hoaglin, D.C., Mosteller, F., Tukey, J.W.: Understanding robust and exploratory data anlysis. Wiley series in probability and mathematical statistics (1983)
  * [5] Kandel, E.R., Schwartz, J.H., Jessell, T.M., Siegelbaum, S., Hudspeth, A.J., Mack, S., et al.: Principles of neural science, vol. 4. McGraw-hill New York (2000)
  * [6] Quian Quiroga, R., Panzeri, S.: Extracting information from neuronal populations: information theory and decoding approaches. Nature Reviews Neuroscience 10(3), 173–185 (2009)
  * [7] Quiroga, R.Q., Nadasdy, Z., Ben-Shaul, Y.: Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering. Neural computation 16(8), 1661–1687 (2004)
  * [8] Rousseeuw, P.J., Croux, C.: Alternatives to the median absolute deviation. Journal of the American Statistical association 88(424), 1273–1283 (1993)
  * [9] Roy, Y., Banville, H., Albuquerque, I., Gramfort, A., Falk, T.H., Faubert, J.: Deep learning-based electroencephalography analysis: a systematic review. Journal of neural engineering 16(5), 051001 (2019)
  * [10] Sara C.B. Casagrande, R.G.C.: Deep brain stimulation in tourette’s syndrome: evidence to date. Neuropsychiatric Disease and Treatment, 15, 1061-1075 (2019)
  * [11] Schirrmeister, R.T., Springenberg, J.T., Fiederer, L.D.J., Glasstetter, M., Eggensperger, K., Tangermann, M., Hutter, F., Burgard, W., Ball, T.: Deep learning with convolutional neural networks for eeg decoding and visualization. Human brain mapping 38(11), 5391–5420 (2017)
  * [12] Wilson, S.B., Emerson, R.: Spike detection: a review and comparison of algorithms. Clinical Neurophysiology 113(12), 1873–1881 (2002)
  * [13] Xu, J., Li, Z., Du, B., Zhang, M., Liu, J.: Reluplex made more practical: Leaky relu. In: 2020 IEEE Symposium on Computers and communications (ISCC). pp. 1–7. IEEE (2020)