Introduction

Hemifacial spasm (HFS) is a prevalent neurological condition that manifests as involuntary, intermittent facial muscle contractions on one side of the face, which can adversely affect patients’ quality of life1,2,3. The diagnosis and evaluation of HFS are largely based on distinctive clinical presentations, which inherently contain an element of subjectivity4,5. Electromyography (EMG), while a standard objective tool for recording facial nerve activity and muscle contractions to gauge the severity of HFS, is limited by its reliance on specialized equipment, its inability to provide continuous monitoring, and its vulnerability to interference from artifact noise6.

Currently, the therapeutic landscape for HFS is dominated by two principal strategies: Botulinum toxin (BTX) injections and Microvascular decompression (MVD). BTX injections serve as a relatively safe palliative measure, with 85–95% of patients reporting moderate to marked symptomatic relief following the procedure, yet the benefits are unfortunately short-lived, enduring only 3–6 months7,8. On the other hand, MVD targets the reduction of nerve compression and boasts a high success rate, with a remarkable 94% of patients achieving complete symptom resolution postoperatively. Nevertheless, MVD is not without its drawbacks, as it is associated with serious risks including facial paralysis and hearing loss, which can reduce patient compliance9,10.

Transcutaneous electrical nerve stimulation (TENS), recognized for its non-invasive nature, is extensively utilized in clinical practice for managing pain, easing spasms, and aiding in functional recovery11,12. It boasts the benefits of high patient compliance, reduced healthcare costs, and the ability to provide consistent treatment. Research indicates that TENS is particularly effective in reducing postoperative pain and alleviating muscle tension13,14. Although a few early studies have applied TENS to HFS cases, these were limited in scope, lacked real-time feedback, and often targeted non-facial nerve areas such as the masseter or temporal muscles15,16. Moreover, conventional EMG-based closed-loop systems face a major technical limitation: the sensing signal is easily contaminated by electrical artifacts during stimulation, making real-time control challenging. This constraint has hindered the broader application of TENS in responsive HFS therapy.

Given TENS’s theoretical potential to suppress abnormal nerve activity, there is a compelling need for integrated solutions that can simultaneously sense and stimulate without mutual interference17. These methods should enable continuous and precise tracking of facial muscle movements, capturing the frequency, duration, and intensity of spasms. This would equip clinicians with more comprehensive assessment data and pave the way for integrating TENS, leading to the development of an integrated, wearable real-time closed-loop treatment system. Triboelectric sensors18, renowned for their cost-effectiveness, broad material applicability, and zero-energy consumption, have become a staple in personal health monitoring and medical diagnostics19,20,21,22,23,24,25,26. These sensors excel at transforming mechanical energy directly into electrical signals, adept at detecting minute signals with high sensitivity and an excellent signal-to-noise ratio (SNR), making them ideally suited for monitoring the dynamic fluctuations in facial muscle activity. Furthermore, their self-powered feature enables extended periods of independent operation, which is expected to markedly enhance the efficacy of healthcare and improve patient welfare27,28,29.

This research introduces a closed-loop facial nerve stimulation system that integrates triboelectric effect sensors into a wearable eyewear platform. By doping substrate material with an appropriate amount of butylated melamine formaldehyde (BMF)–CaCu3Ti4O12 (CCTO) and constructing micrometer-scale hemispherical structures, the output voltage of this flexible hemifacial spasm sensor (HFSS) was enhanced by approximately 2.3 times compared to the unmodified material configuration. Strategically positioned in specific facial regions, such as the eye corners, these sensors are adept at capturing minute dynamic signal changes in real time. Alongside this, the study has crafted a multi-parameter adjustable electrical stimulator. A spasm detection model was developed based on sliding-window peak-to-peak amplitude analysis of HFSS signals, with manually calibrated user-specific thresholds. This enables responsive activation of facial nerve stimulation upon detecting abnormal muscle activity, forming an effective closed-loop control mechanism. Stimulation amplitude was individually set based on each participant’s maximum tolerable sensation without visible muscle contraction, while other parameters were fixed. This approach ensures appropriate timing and effective intervention. The detailed procedure is described in the Methods section. Clinical validation demonstrated improvements in spasm control and facial symmetry under closed-loop stimulation, with supporting statistical evidence provided in the Results section. This comprehensive system encompasses efficient data acquisition, intelligent decision-making, and precise electrical stimulation control, all designed to create an intelligent closed-loop neuromodulation platform. It aims to mitigate HFS symptoms and offer a foundation for the treatment of related neurological conditions in the future.

Results

Design and features of closed-loop facial nerve stimulation system

The closed-loop system is composed of three principal components (Fig. 1a): the HFSS sensing system integrated into eyeglasses, an electrical stimulation module, and an intelligent terminal (Supplementary Fig. 1). As shown in Fig. 1b, when abnormal neural activities affect facial movements through the facial nerve, we inhibit these abnormal activities through external electrical stimulation as a coping strategy. The eyeglass mount is designed for flexible positioning of the HFSS, ensuring a secure fit on the patient’s face. It effectively captures high-fidelity motion signals from the eye area. The HFSS is based on a triboelectric effect sensor, as illustrated in Fig. 1c. It features a PDMS base doped with CCTO and covered with micrometer-scale hemispherical structures that contribute to improved output performance. The other triboelectric layer is made of Nylon-66, a high-polymer material. The surface morphologies of both layers are shown on the right side of Fig. 1c. Silver is used as the conductive layer, and the entire assembly is encapsulated in a silicon enclosure. The operational principle, as shown in Fig. 1d, unfolds as follows: Upon the application of external force, the internal materials of the sensor, CCTO (PDMS) and PA-66, come into contact. Due to their differing electron affinities, a triboelectric effect occurs: PA-66 gains a positive charge, while CCTO (PDMS) becomes negatively charged. Upon the release of the external force, the materials separate, causing a redistribution of charges. This separation induces electrostatic effects in nearby silver conductors, generating a potential difference. As a result, electrons flow through the external circuit, producing a sensing signal that reflects the applied mechanical force. Furthermore, the tailored electrical stimulation module is engineered to deliver a high-frequency, constant current. This design allows it to support a wide range of experimental testing requirements. The integration of the sensor system, electrical stimulation module, and computer terminal through wireless communication boosts the system’s cohesiveness and user-friendliness.

Fig. 1: Design and features of closed-loop facial nerve stimulation system.
figure 1

a Schematic diagram of system composition based on glasses and characteristic of hemifacial spasm (HFS). b External electrical stimulation is applied to inhibit abnormal neural activities affecting facial movements via the facial nerve as a coping strategy. c Material and structural design of HFSS, as well as material surface morphology SEM images (scalebar 40 μm and 2 μm, respectively; the microstructure fabrication was repeated independently 3 times with similar results). d Schematic diagram of HFSS based on the triboelectric effect. e An indicator quantifying the severity of HFS, based on four facial features (M–N, E–N, E–M, and EA. M: mouse; N: nose; E: eye; A: area), demonstrates pronounced improvement in two patients.

HFS typically initiates with “twitching” in the lower eyelid, subsequently affecting other periorbital, facial, perioral, and platysma muscles. These involuntary muscle movements often lead to social discomfort and impaired vision due to involuntary eye closure30. The condition is usually caused by abnormal discharges in the ipsilateral seventh cranial nerve (facial nerve)31. This reflects cranial nerve hyperactivity and results in involuntary muscle contractions30. Research has shown that high-frequency electrical stimulation can effectively reduce nerve excitability to some degree32. Consequently, this study aims to mitigate facial spasm symptoms in patients through a two-step approach. First, it detects abnormal motion signals around the eye area. Then, it provides immediate electrical stimulation as a feedback intervention. In addition, an index was proposed to quantify the severity of HFS, covering four facial features: mouth to nose (M–N), eyes to nose (E–N), eyes to mouth (E–M), and eye area (EA). As shown in the radar chart in Fig. 1e, two patients exhibited pronounced improvement. Values greater than 0 indicate improvement, with higher values representing more substantial symptom relief.

Performance optimization and electrical output characterization of HFSS

HFSS operates on the basis of the synergistic interaction between the triboelectric effect and electrostatic induction. This mechanism harnesses the generation of charge through contact and separation of materials, which is characteristic of the triboelectric effect33,34. And the electrostatic field established by the triboelectric charge drives the flow of electrons through the external load, which is a manifestation of electrostatic induction, leading to the accumulation of free electrons, denoted as \({\sigma }_{1}(z,{t})\), within the electrode. The electric field within two dielectric materials, characterized by their respective dielectric constants of \({\varepsilon }_{1}\), \({\varepsilon }_{2}\), as well as their thicknesses \({d}_{1},\,{d}_{2}\), are given by \({E}_{z}={\sigma }_{1}(z,{t})/{\varepsilon }_{1}\) and \({E}_{z}={\sigma }_{1}(z,{t})/{\varepsilon }_{2}\), respectively. The electric field at the gap is expressed as \({E}_{z}=({\sigma }_{1}\left(z,{t}\right)-{\sigma }_{c})-{\varepsilon }_{0}\). The relative voltage difference between two electrodes is then determined by35,36,37

$$V={\sigma }_{1}\left(z,\,t\right)\left[\frac{{d}_{1}}{{\varepsilon }_{1}}+\frac{{d}_{2}}{{\varepsilon }_{2}}\right]+\frac{Z\left[{\sigma }_{1}\left(z,\,t\right)-{\sigma }_{c}\right]}{{\varepsilon }_{0}}$$
(1)

In the presence of an external load resistance \(R\), external output current density, according to Ohm’s law, is given by

$${RA}\frac{d{\sigma }_{1}\left(z,\,t\right)}{{dt}}=\frac{z{\sigma }_{c}}{{\varepsilon }_{0}}-{\sigma }_{1}\left(z,\,t\right)\left[\frac{{d}_{1}}{{\varepsilon }_{1}}+\frac{{d}_{2}}{{\varepsilon }_{2}}+\frac{{d}_{3}}{{\varepsilon }_{3}}\right]$$
(2)

where \(z\) is a function of \(t\) that describes the dynamics of the force application process, and \(A\) represents the area of the electrode.

Consequently, the dielectric constant of the triboelectric material plays an important role in its electrical output performance. To ensure the sensor device retains its overall flexibility, PDMS is selected as one of the triboelectric layers. Additionally, doping with CCTO, known for its high dielectric constant (permittivity of 7500), serves to enhance the device’s performance and stability. The internal polarization of CCTO particles promotes charge induction in the bottom electrode, consequently elevating the triboelectric output performance38,39. In order to experimentally validate this theory, a series of PDMS layers with varying CCTO doping ratios were crafted to serve as one triboelectric layer, complemented by PA-66 as the opposing triboelectric layer. Flexible silver was employed as the electrode material, and the entire assembly was encapsulated for subsequent testing (sensor size: 1 × 2 cm2). The results (Fig. 2a) indicate that an appropriate doping ratio improves the sensor’s output performance over that of pure PDMS. However, elevated CCTO concentrations lead to particle aggregation, which in turn forms conductive pathways for leakage currents within the composite layer. These leakage currents, a consequence of over-concentration of CCTO, neutralize the triboelectric charges on the dielectric surface and the induced charges on the bottom electrode, ultimately reducing the triboelectric output performance. It is noteworthy that when the CCTO to PDMS ratio is optimized to 10 wt% in the presence of micron-scale hemispherical structure arrays on the material surface, the device reaches its peak performance with an approximately 2.3 times enhancement in open-circuit voltage compared to the unmodified material configuration. Additionally, as indicated by Eq. 2, the electrode area is another pivotal factor influencing the sensor’s performance. Fig. 2b illustrates that the value of VOC, short-circuit current (ISC), and short-circuit charge (QSC) for the sensor increases in tandem with the enlargement of the sensor’s area. Considering the integration with the temple arms of glasses, the dimension of ‘1 × 2 cm2’ has been selected for its appropriateness.

Fig. 2: Performance optimization and electrical output characterization of HFSS.
figure 2

a Output performance (VOC) of HFSS with CCTO and PDMS at different doping ratios (box plots: centre line=median; box limits = 25th and 75th percentiles; whiskers = 1.5×IQR; points beyond whiskers are outliers; n = 30 technical replicates). b Output performance (VOC, ISC, and QSC) of HFSS at different device sizes (mean ± SD from technical replicates (n = 6) are shown). c Impact of material and surface morphology of the friction layer on the output performance of HFSS. d Impact of varying frequencies of applied force on HFSS output performance (VOC) (mean ± SD from technical replicates (n = 6) are shown). e Output time response of HFSS. f Relationship between HFSS output (VOC) and the magnitude of applied force. g, h Stability and fatigue test of HFSS (fatigue test: motor frequency,1.5 Hz).

Besides, as the HFSS operates based on the friction between the surfaces of two dissimilar materials, their surface morphology, including surface area, also influences the sensor’s performance. Consequently, a photoresist template was employed for the replication of CCTO (PDMS), while the opposing triboelectric layer films, Kapton and PA66, underwent abrasion in both transverse and longitudinal directions using 800-grit sandpaper, aiming to augment the surface charge density of the frictional layers. Fig. 2c demonstrates that the expansion of the material’s surface area, coupled with the synergy between PA66 and CCTO (PDMS), substantially amplifies the sensor’s output performance, reaching up to approximately 30 V. Furthermore, the sensor’s VOC output remains unaffected by the frequency of the applied force, whereas the ISC output exhibits an upward trend as the frequency increases (Fig. 2d, and Supplementary Fig. 2). Regarding response time, the sensor exhibits a rise time of 38.7 ms and a fall time of 42.9 ms, adequately satisfying the detection needs for the majority of mechanical stimulus signals (Fig. 2e). And the mechanical response characteristics of the HFSS are illustrated in Fig. 2f. In addition, The HFSS exhibits remarkable resilience and consistency, retaining its original performance even after numerous twists and folds (Fig. 2g). It has withstood 13,000 cycles of fatigue testing, with the deviation in average output voltage between the initial and final stages remaining within 6% (Fig. 2h), and 6 days of water immersion without observable performance degradation (Supplementary Fig. 3). In addition, the detection signal remained nearly stable at room temperature (20 °C to 30 °C), with only 1.1% attenuation. These findings underscore the sensor’s exceptional durability and dependability in practical scenarios, particularly when it is exposed to recurrent mechanical stressors.

Hardware design and characterization

A dedicated signal acquisition circuit was developed for the HFSS, integrating a main chip with an analog front-end and a 16-bit analog-to-digital converter (ADC)-based digital signal processing architecture, including digital filtering. This setup ensures the precision and reliability of the signals harvested from the HFSS and facilitates wireless transmission through an integrated Bluetooth module (Fig. 3a). The sensor and signal acquisition module have been integrated into the temple arms of the glass, allowing for a discreet and unobtrusive monitoring solution. Following initial validation, the system demonstrated its capability to accurately distinguish and document different blinking patterns—including normal, subtle, and forceful blinks—based on the large dynamic range of signal amplitudes, where subtle blinks produce signals about 9 times higher than normal blinks, and forceful blinks up to 43 times higher (Fig. 3b). This integration not only enhances the user experience by minimizing discomfort but also provides a reliable means of capturing detailed ocular movement data, which is essential for various medical and physiological studies.

Fig. 3: Hardware design and characterization.
figure 3

a Physical diagram and hardware flowchart of signal acquisition module. b Signals of different blinking degrees using signal acquisition module with HFSS. c Physical diagram and hardware flowchart of electric stimulator. d, e Characterization of electrical stimulator at different set current values with 10 kΩ impedance and 10 Hz frequency. f Characterization of electrical stimulator at different set duty ratio with 10 kΩ impedance and 10 Hz frequency. g Characterization of electrical stimulator at high frequency (1000 Hz) with 10 kΩ impedance. h Expanded view of the time axis in Fig. 3g.

Employing a non-invasive electrical stimulation approach, a specialized electrical stimulation module has been engineered, encompassing a power management unit, WiFi module, main control chip, constant current module, and a multi-channel management unit as its core components (Fig. 3c). With the aim of delving deeper into the mechanisms of HFS electrical stimulation in the follow-up experiment, this module has been meticulously designed with redundancy in mind. Firstly, recognizing that pulse shape affects the efficacy and comfort of electrical stimulation, our device has been engineered to generate a variety of waveforms, including square waves, triangular waves, and sine waves, offering a selection of six-channel interfaces. In this experimental phase, we have predominantly utilized pulse waves to stimulate patients, thereby validating the system’s effectiveness. Secondly, maintaining a consistent current output is essential for reducing tissue damage to a minimum, which is a fundamental capability of this device. By simulating a 10 kΩ human body impedance and characterizing the device at a constant frequency of 10 Hz, we have confirmed its ability to deliver a stable current output. The amplitude can be finely tuned to provide a stable output of either 1 mA (Fig. 3d) or 4 mA (Fig. 3e) and other current, which is vital for the accuracy and safety of electrical stimulation treatments. Moreover, ionic flow cycle-also referred to as the the pulse width-is a critical parameter in facial nerve electrical stimulation, typically defined in microseconds. This ionic flow cycle represents the minimum current that must be applied over time to depolarize the facial nerve axons. A longer cycle allows more ions to pass through, potentially enhancing stimulation effectiveness. Based on the above theoretical considerations, the selection of pulse width becomes a critical design parameter in neural electrical stimulation devices. An excessively short pulse width may result in inadequate stimulation, whereas an overly long duration can lead to patient discomfort and accelerated muscle fatigue. To meet the requirements for precise and individualized stimulation control, the device has been designed to support pulse width adjustability ranging from 1% to 50% (Fig. 3f). In addition, this device is capable of delivering signals as low as 1 Hz and as high as 1000 Hz (Fig. 3g, h), essentially meeting the electrical stimulation needs across various levels and facilitating the analysis of mechanism parameters.

HFS diagnosis/treatment integrated system and patient testing

The clinical trial process consists of multiple stages (Supplementary Fig. 4). We recruited three HFS patients, one male (Patient 0, used to verify the stability of the closed-loop paradigm of the system) and two females (Patient 1 and Patient 2, used to verify the effect of closed-loop electrical stimulation). Before the experiment began, all participants signed an informed consent form to ensure that they fully understood the experimental content and potential risks. Subsequently, the researchers determined personalized stimulation thresholds for each participant to prepare for subsequent experiments. During the experiment, participants will be tested alternately in the control group and the stimulation group. During the experiment, participants are required to raise their hand when experiencing a HFS occur to mark the time point of the attack, facilitating subsequent data analysis. The experimental records include four key elements: First, the stimulation parameter set, which records the personalized stimulation plan; second, the video data record, used to objectively record the facial spasm manifestations of the participants; third, the HFS data record, which details the triggering and occurrence of HFS; and fourth, the trigger basis record, describing the specific context and conditions under which the spasm is triggered. The experimental data will be analyzed collectively after the experiment (data analysis) to assess the alleviating effect of electrical stimulation on HFS and its potential mechanisms.

The system process is shown in Fig. 4a. Patients are provided with a sensor system that is mounted on glasses, and the sensor base is fine-tuned to the ideal position for optimal performance. Upon the detection of a HFS, the host computer wirelessly captures signals emitted by the sensor, and performs synchronized low-pass filtering of the signal (cutoff frequency: 5 Hz, selected to retain spasm-related components while removing high-frequency noise) to enhance SNR and ensure reliable onset detection. If the signal amplitude exceeds a manually calibrated, user-specific threshold—determined from the baseline HFSS signal and maximum amplitude during non-spastic periods—the system activates the stimulation module to deliver electrical stimulation. The stimulation is applied to a target area located inferior to the apex of the mastoid process, corresponding to the surface projection of the facial nerve trunk. Stimulation is delivered using individualized intensity parameters determined during a pre-test session, while all other stimulation settings remain constant (see Methods for details). Simultaneously, the system simultaneously records the patient’s facial video data to enable an objective analysis. Additionally, to make signal display and parameter adjustment more convenient and intuitive, a computer interface was developed, as shown in Supplementary Fig. 5.

Fig. 4: HFS diagnosis/treatment integrated system and preliminary experiment.
figure 4

a Schematic diagram of HFS diagnosis/treatment integrated system process. b HFSS detection signals for single HFS seizure. c HFSS detection signals during a persistent HFS episode. The manually labeled time points align with the patient’s actual condition: normal state; and spasm episodes. d HFS diagnosis/treatment integrated system monitors the patient’s condition and triggers stimulatory signals when HFS occurs. e Photo of test site.

Due to its meticulous design, the sensor system can accurately detect both single (Fig. 4b) and sustained episodes (Fig. 4c) associated with HFS. It then converts these detected movements into detailed electrical signals. Such highly sensitive monitoring capabilities enable the system to comprehensively record the complex symptoms of HFS, providing valuable data support for subsequent diagnosis and treatment. Furthermore, a pre-experiment was conducted on Patient 0, successfully validating the closed-loop system’s effectiveness: the system is capable of monitoring the onset of HFS and promptly triggering electrical stimulation (Fig. 4d, Supplementary Fig. 6 and Supplementary Movie 1). Concurrently, Fig. 4e offers a visual representation of the actual test site conditions. Additionally, the system’s performance is evaluated based on two key metrics: spasm detection rate and trigger signal accuracy. To obtain ground truth for evaluation, synchronized video recordings of the patients’ facial movements were captured using an external camera mounted on a tripod. These recordings were used exclusively for offline analysis and clinical annotation. The reported recognition accuracy was validated by comparing the system-detected HFS episodes with clinician-annotated spasm events extracted from several hundred video-recorded episodes. The average recognition accuracy of the three individuals was 98.0% for spasm recognition and about 95.9% for trigger signal recognition. The data for each patient is shown in Supplementary Figs. 79.

Distribution and statistical analysis of facial spasm experimental data

This section investigates the effects of closed-loop stimulation on mitigating facial spasms and enhancing symmetry through statistical analysis and data visualization. The HFS diagnosis and treatment integrated system continuously monitors the condition of patient and automatically triggers a stimulation signal (frequency: 1 kHz; current: 200–400 μA; waveform: pulsed; duty cycle: 10%) upon HFS detection. The 1 kHz frequency was selected based on evidence that high-frequency stimulation can transiently block peripheral nerve conduction, enabling rapid and comfortable spasm suppression32. The analysis focuses on four facial features: mouth to nose (M–N), eye to nose (E–N), eye to mouth (E–M) and eye area (EA) (Supplementary Fig. 10). We developed an algorithm based on real-time facial point recognition. By accurately detecting the positions of key facial points and calculating the distances, areas, and other facial features between various parts, it can provide an effective and objective evaluation tool for the HFS closed-loop system. This algorithm uses the mediapipe library to quantify the dynamic changes of key points such as the corners of the eyes, corners of the mouth, nose tip, and forehead center to evaluate the severity of HFS.

Figure 5 and Supplementary Movie 2 show the changes in facial features of Patient 1 in the no-intervention state and the closed-loop electrical stimulation state. Fig. 5a–h represent the time series of the four facial features M–N, E–N, E–M, and EA during the spasm. The shaded area in the figure represents the difference between the left and right facial features. The larger the shaded area, the more severe the facial asymmetry and the more severe the spasm. By comparing the two states, a noticeable reduction in facial asymmetry is observed during closed-loop electrical stimulation, resulting in improved facial symmetry. Specifically, Fig. 5a–d is the time series data of the four facial features in the no-intervention state, while Fig. 5e–h are the data under closed-loop electrical stimulation. In the latter state, the differences in M–N, E–N, E–M and EA are smaller, indicating that facial symmetry is improved during stimulation.

Fig. 5: Distribution and statistical analysis of facial features of patients in different states (non-stimulation vs. closed-loop stimulation).
figure 5

a M–N feature over time, comparing the left and right sides, with shaded areas indicating asymmetry. b E–N feature over time, showing the difference in distance measurements between the left and right sides. c E–M feature over time, showing the change in the distance between the left and right eyes to the corners of the mouth. d EA over time, showing the temporal fluctuations in the area of the left and right eyes. eh Separate plots of the same features under closed-loop stimulation, showing the reduction in asymmetry compared to the non-stimulation state. il Boxplots of four facial features (M–N, E–N, E–M, EA) in both conditions, illustrating the improvement in facial symmetry under closed-loop stimulation (Box plots: centre line = median; box limits = 25th and 75th percentiles; whiskers = 1.5 × IQR; points beyond whiskers are defined as outliers; n = 17 for non-stimulation (blue) and n = 25 for closed-loop stimulation (purple)).

Figure i–l shows the statistical results of multiple spasms in Patient 1 in two different trials. The box plots of the four facial features M–N, E–N, E–M, and EA show that the symmetry of facial features improved in the closed-loop electrical stimulation group compared with the non-electrical stimulation group. The specific statistical analysis is as follows: In the three facial features of M–N (Fig. 5i), E–N (Fig. 5j), and E–M (Fig. 5k), there are pronounced differences between the closed-loop electrical stimulation group and the non-intervention group (Mann–Whitney U test: M–N, U = 335.0000, p = 0.0018; E–N, U = 380.0000, p < 0.0001; E–M, U = 347.0000, p = 0.0006). The difference in EA (Fig. 5l) is also statistically distinguishable (t = 2.5292, p = 0.0175, Cohen’s d = 0.8427), indicating that closed-loop electrical stimulation helps to improve the asymmetry of these facial features.

For the analysis of Patient 2 (Supplementary Fig. 11, and Supplementary Movie 3) in the supplementary materials, pronounced improvements were observed in the M–N and E–N indicators in the closed-loop electrical stimulation group compared with the non-electrical stimulation group. Specifically, the M–N improvement was supported by the Mann–Whitney U test (U = 380.0000, p < 0.0001); the E–N improvement was confirmed by an independent sample t test (t = 14.0486, p < 0.0001, Cohen’s d = 4.4185). However, the differences in EA and E–M did not show clear changes, likely due to the subtle sensitivity of these indicators to periorbital or eye–mouth coordination variations in Patient 2, as well as individual differences in spasm expression. Nonetheless, other facial symmetry metrics improved, indicating that the system effectively enhanced symmetry in specific facial regions affected by muscle spasms.

In addition, by positioning the HFSS device over the superficial temporal artery, we successfully monitored pulse wave variations. The superficial temporal artery was selected due to its shallow anatomical location and strong, stable pulse pressure, which are well-suited for high-fidelity mechanical sensing. Periodic skin-surface deformations induced by arterial pulsation were captured by the sensor and converted into electrical signals for further analysis18. Notably, prior studies have reported a transient increase in heart rate preceding HFS onset, along with elevated heart rate variability parameters during spasm episodes. These findings suggest that heightened sympathetic nervous activity may be closely associated with HFS. Consequently, the pathogenesis of HFS may not be solely attributed to mechanical compression of the facial nerve but could also involve changes in vascular pulsation frequency, providing a theoretical basis for disease prediction and intervention40. Accordingly, the device may offer preliminary potential for monitoring autonomic nervous activity via HRV, which could be associated with HFS onset. This may serve as a foundation for future investigations into early warning and intervention strategies. To assess heart-rate tracking, participants performed stationary cycling followed by rest. Fig. 6a presents the aligned heart rate comparison curves: the pink line denotes measurements from a professional ECG device, while the blue line represents readings from HFSS device. The two curves exhibit a high degree of concordance, with a Pearson correlation coefficient of 0.96 (Fig. 6b). During the exercise phase, heart rates increased from lower levels to approximately 155 BPM, then gradually decreased and stabilized during the rest phase. This demonstrates the HFSS device’s accuracy and stability in capturing dynamic heart rate changes. Fig. 6c illustrates a comparison of signals from two devices during the exercise phase, specifically between the 150th and 200th seconds. In summary, the HFSS device shows high accuracy in heart rate detection. Future algorithm optimizations could further enhance data precision during specific time intervals, bolstering the system’s potential in disease prediction and health monitoring applications. Furthermore, a preliminary HFSS-based pulse-wave trace from Patient 3 showed a brief pre-spasm heart-rate rise (Supplementary Fig. 12), consistent with ECG-HRV reports of autonomic changes preceding HFS events40. Notably, this should be regarded as supportive, modality-specific evidence rather than independent statistical confirmation.

Fig. 6: Records of heart rate changes from two devices before and after exercise.
figure 6

a Heart rate comparison curves: the pink line denotes measurements from a professional ECG device, the blue line represents readings from HFSS device. b Scatter plot of the correlation between heart rate recordings from two devices. c A comparison of signals from two devices during the exercise phase, specifically between the 150th and 200th seconds.

Discussion

This study introduces a closed-loop facial nerve stimulation system integrated into eyewear, utilizing triboelectric sensors enhanced with butylated melamine formaldehyde–CaCu3Ti4O12 and featuring micrometer-scale hemispherical structures. This method has improved the output voltage of HFSS by approximately 2.3 times, enabling the capture of subtle dynamic signal changes in real-time, particularly in areas such as the eye corners. The system also integrates a multi-parameter electrical stimulator with a spasm detection algorithm based on sliding-window peak-to-peak amplitude analysis of HFSS signals. Manually calibrated, user-specific thresholds enable timely and reliable stimulation upon spasm onset. When abnormal muscle activities indicative of spasms are detected, the closed-loop control algorithm rapidly activates the facial nerve stimulator to deliver targeted neuromodulation interventions.

The HFSS used in this study offers several key advantages over conventional surface electrodes. It is self-powered, requiring no energy at the sensing interface, and provides a high signal-to-noise ratio with good sensitivity to dynamic facial muscle activity. Compared to traditional EMG electrodes, the HFSS is expected to offer better selectivity for HFS and to be less affected by normal movements such as blinking. Additionally, it is lightweight, gel-free, and easier to use than EMG, enhancing comfort for long-term monitoring. However, the HFSS has not yet reached the maturity of commercial EMG systems in terms of signal processing and system integration. It is also sensitive to mechanical factors such as pressure and displacement and requires manual positioning before use. These limitations may be addressed in future work through improved mechanical designs and advanced signal processing algorithms. In addition, compared with previous studies that either focused solely on detection or used externally applied stimulation without real-time feedback, our system features an integrated design combining monitoring and responsive stimulation. The sensing approach may also be less susceptible to stimulation-induced artifacts than EMG-based methods, though formal comparative testing remains to be performed, which could further enhance the reliability of real-time monitoring and closed-loop control. The entire sensing module is embedded in a glasses-like form factor, greatly enhancing portability and patient compliance—an advantage over many existing setups that rely on wired or cumbersome equipment. Furthermore, the sensor and stimulator were both independently developed, allowing for tailored optimization of signal acquisition and feedback control. The system achieved 98% accuracy in recognizing HFS episodes, as validated by comparing its detections with clinician-annotated video data based on several hundred recorded spasm events. Stimulation parameters are carefully calibrated based on individual patient feedback, with electrical stimulation initiated automatically and only upon the detection of spasm events, ensuring optimal timing and therapeutic efficacy.

Clinical validation showed Patient 1 improved across all facial-symmetry metrics during HFS episodes under closed-loop electrical stimulation (epresentative statistics include E–N: U = 380.0000, p < 0.0001; EA: t = 2.5292, p = 0.0175), whereas Patient 2 improved on a subset of metrics, some measures in Patient 2 did not reach significance. Overall, given this inter-patient heterogeneity, the findings constitute preliminary evidence of a positive yet variable therapeutic effect. The improvements are plausibly mediated by modulation of facial-nerve excitability and suppression of aberrant signaling, promoting more balanced facial movement. At this stage, our primary objective is to establish the clinical feasibility and effectiveness of this non-invasive, closed-loop approach to facial spasm management, with larger studies planned to assess generalizability.

Future work will involve systematic optimization of hardware and software to enable more advanced, adaptive detection (e.g., multi-feature algorithms and lightweight classification models), facilitating patient use in real-world settings. This study is an initial proof-of-concept with limited enrollment; thus, the findings primarily establish feasibility and therapeutic potential. To strengthen generalizability and robustness, the cohort will be expanded to include a more diverse patient population, and longer follow-up and wearability/comfort assessments will be implemented. The dynamic effects of stimulation parameters will be investigated, inter-patient variability quantified, and multimodal data integrated to refine and personalize closed-loop stimulation.

Methods

Fabrication of HFSS

PDMS base and curing agent (Sylgard 184, Dow Inc) were mixed at a 10:1 weight ratio. After the addition of the curing agent, the PDMS mixture was further diluted with n-hexane (Macklin Inc.) at a weight ratio of 10:1 (PDMS to n-hexane) to enhance dispersion. CCTO powder (CaCu₃Ti₄O₁₂, Aladdin Inc.) was then added to the above-mentioned mixed PDMS solution to achieve final doping concentrations of 1 wt%, 5 wt%, 10 wt%, 15 wt%, and 20 wt%. These specific concentrations were designed to investigate the effect of CCTO content on the output performance of the sensor. The mixture was stirred at 500 rpm for 15 min, placed in a vacuum chamber for 15 min to remove air bubbles, and then spin-coated onto a photolithography template at 25 rpm for 30 s. After curing at 40 °C for 5 h, the mold was demolded to obtain the friction layer.

Conductive silver paste was screen-printed onto a PA-66 (Nylon, BASF Inc.) film to form the electrode pattern. The printed silver layer had an average thickness of approximately 20 μm. The resulting PA-66 film with printed electrodes had a total thickness of ~100 μm and a dimension of 1 × 2 cm. After printing, the film was cured in a constant-temperature drying oven at 40 °C for 4 h to ensure complete solidification of the silver layer. Another PA-66 film was subsequently sanded using 800-grit sandpaper to enhance surface roughness and thereby improve triboelectric performance. The sanding was performed manually in both horizontal and vertical directions, with five passes in each direction to ensure uniform texture. This prepared film served as one of the triboelectric layers in the sensor device. Silicone A and B (Dragon Skin 30, Smooth-On, Inc.) were mixed in a 1:1 weight ratio, stirred at 500 rpm for 1 min, and degassed for 5 min. The mixture was poured into a 3D-printed mold and cured at 40 °C for 4 h to form the sensor’s encapsulation layers. The two friction layers were cut to 1 × 2 cm rectangles and individually bonded to the inner surfaces of two encapsulation layers using Sil-Poxy adhesive (Smooth-On, Inc.). The edges of the encapsulation layers were then sealed with the same adhesive. Due to the presence of pre-defined grooves in the mold, no additional alignment was required during assembly. A 500 g weight was applied evenly to the top of the structure for 5 h at room temperature to ensure firm bonding, resulting in a fully integrated dual-electrode sensor.

Design and manufacture of circuit hardware

Altium Designer software was used to design the signal acquisition module and electrical stimulator. The custom control chip is an ultra-low power chip, which has the characteristic of a low power supply voltage range. The circuit board adopts the welding process of Surface Mounted Technology (SMT). The data acquisition system was built around a 16-bit ADC with a sampling rate of 512 Hz. Bluetooth 5.0 was used for wireless transmission, providing a stable and energy-efficient connection.

Blink classification

Blink classes were defined based on the raw amplitude of the acquisition circuit (A/D counts), following a brief, session-specific manual calibration performed before data collection. Each participant first produced several blinks of each type (normal, subtle, forceful); peak amplitudes were recorded across 3–5 trials per type, and fixed thresholds for that session were then set. Quantitatively, normal blinks were classified as peaks ≤~500, subtle as ~500–2000, and forceful as ≥~2000.

Characterization methods

The scanning electron microscopy (SEM) images were taken by a field emission scanning electron microscope (SU 8020, Hitachi). The optical photographs were taken by a digital camera (A7M4, Sony Inc.). Fundamental data acquisition (frequency response testing, mechanical response testing, and fatigue testing, etc.) utilizing a linear motor (E1100, LinMot) for HFSS actuation. The output performance (open circuit voltage, short circuit current and transferred charge) of the HFSS was detected by an electrometer (Keithley 6517, The Keithley Inc.) and recorded by LabView, along with a data acquisition card (USB-6009, NI Inc). Mechanical calibration using a force gauge (AD2016SC2, Autoda Inc.)

The measurement of the output current from the electrical stimulator was conducted by an electrometer (Keithley 6554, The Keithley Inc.). Data collection and recording were performed by an oscilloscope (Tektronix MSO 2024B C031472, The Tektronix Inc.).

Construction of feedback control system

The sensor signals were collected using an acquisition circuit board, which converted the voltage signals into digital signals via an ADC and transmitted them to the main controller chip. This chip packaged the data and sent it in string format over Bluetooth to a computer. A server (Supplementary Fig. 13) on the computer received the data and utilized a Python-based multithreading program for processing, visualization, and storage.

Based on the stimulation strategy defined in the Python control algorithm, the system transmitted the stimulation trigger code to the stimulator control board to initiate the output of stimulation current.

Experimental procedure of HFS patient

Three adult participants with unilateral HFS (1 male, 2 females) were recruited from the Department of Neurosurgery at Tsinghua University Yuquan Hospital. Inclusion criteria were: primary HFS duration of at least 2 years, spasm frequency ≥ 5 episodes per minute, and no history of facial surgery within the past six months. Exclusion criteria included the presence of a cardiac pacemaker, dermatological conditions at the electrode placement site, or any other diagnosed neurological disorders.

The experiment was divided into two continuous groups. During the experiment, the sensor-carrier installation position and angle were adjusted according to the patient’s eye corner position to ensure the sensor could accurately and instantly capture spasm signals. The recognition accuracy of the system for HFS episodes was evaluated by comparing its detections with manual annotations performed by an experienced clinician based on synchronized video recordings. These annotations marked the onset and offset of spasm events and served as ground truth. The system-detected events were temporally aligned with the annotated events. A total of several hundred spasm episodes were included in the dataset for validation. The recognition accuracy was calculated based on the consistency between the system outputs and the manually labeled ground truth. In addition, the electrical stimulation parameters were adjusted based on the patient’s tolerance and pain threshold to ensure sufficient electrical current output during spasm events. The first group of the experiment included a control group, an intermittent group, and a stimulation group.

To determine individualized stimulation amplitudes, each participant underwent a brief pretest prior to the formal experiment. The stimulation current was gradually increased in small increments until the participant reported a maximum tolerable tingling sensation without any visible facial muscle contraction. This amplitude was then fixed for all subsequent trials. The waveform (pulsed), frequency (1 kHz), and duty cycle (10%) were kept constant across all participants.

Control Group

The patient was in a resting state, and the sensor monitored the patient’s resting state and spasm signals. The data collector collected and recorded sensor data while a camera tracked and recorded the patient’s facial features for subsequent computer vision (CV) analysis. The control group lasted for 3 minutes. Afterward, the patient entered the intermittent group 1 for 3 min of rest and recovery.

Stimulation group

The patient was in a stimulation treatment state, and the sensor monitored the spasm signals in real time, recording HFSS data. Meanwhile, the electrical stimulator received the stimulation trigger signal and outputted electrical current to stimulate the patient’s facial nerve. The Python program recorded the output data from the stimulator. During the experiment, the camera simultaneously tracked and recorded the patient’s facial features for CV analysis. Stimulation group 1 lasted for 3 min, followed by intermittent group 2 for 5 min of rest. The time is adjusted according to the patient’s condition.

Stimulation parameters

Patient 1, waveform (pulsed), frequency (1 kHz), duty cycle (10%), stimulation intensity (200 μA); Patient 2, waveform (pulsed), frequency (1 kHz), duty cycle (10%), stimulation intensity (300 μA).

Sensor and Electrode Placement: The sensor was positioned near the temple region. Final placement was individually adjusted based on the signal-to-noise ratio. Two Ag/AgCl gel electrodes (Ø 10 mm) were used for stimulation. The anode was placed 20 mm below the mastoid tip, and the cathode was positioned approximately 30 mm distal to the mandibular angle, aligned with the projected course of the facial nerve trunk.

Real-time trigger logic

The incoming HFSS signal stream (sampled at 512 Hz) is processed using a 0.5-second sliding window. When the peak-to-peak amplitude within a given window exceeds a manually defined threshold baseline, a spasm event is detected. Upon detection, a stimulation start signal is immediately issued. A 500 ms countdown timer maintains the stimulation and is reset if any subsequent window also exceeds the threshold. Once the timer expires without further threshold crossings, a stimulation stop signal is triggered.

HRV signal processing

The raw signals were first processed with a 2nd-order Butterworth low-pass filter (cutoff frequency: 16 Hz) to suppress high-frequency noise while preserving heart-beat-related components. Peak detection was then performed to identify systolic peaks. Inter-beat intervals (IBIs) were calculated based on the time differences between successive peaks. Subsequently, standard time-domain HRV features.

Ethics

This experiment was approved by the Ethics Committee of Tsinghua University Yuquan Mountain Hospital. Patients with spasms were recruited, and all participants were free from other major diseases. Before the experiment began, participants were fully informed of the experimental process. Each participant gave informed written consent, and granted permission for the publication of identifiable images and relevant information. The authors affirm that human research participants provided informed consent for publication of the images/videos in Fig. 4, Supplementary Fig. 6-Supplementary Fig. 10, and Supplementary Movie 1-Supplementary Movie 3.

The patient experiment was performed by the Department of Neurosurgery, Tsinghua University Yuquan Hospital, following the Tsinghua University Yuquan Hospital Ethics Committee (2025KY005), and registered under ChiCTR2200066229.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.