Next Article in Journal
Productivity Improvement through Reengineering and Simulation: A Case Study in a Footwear-Industry
Previous Article in Journal
Vitamin D Merging into Immune System-Skeletal Muscle Network: Effects on Human Health
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Event Detection of Muscle Activation Using an Electromyogram

Department of Electronic Engineering and Department of Software Convergence, Soongsil University, Seoul 07040, Korea
*
Author to whom correspondence should be addressed.
Appl. Sci. 2020, 10(16), 5593; https://doi.org/10.3390/app10165593
Submission received: 10 July 2020 / Revised: 3 August 2020 / Accepted: 8 August 2020 / Published: 12 August 2020
(This article belongs to the Section Electrical, Electronics and Communications Engineering)

Abstract

:
In this study, we proposed a precise onset and offset detection algorithm for muscle activation by using an electromyogram (EMG). The adaptive threshold was determined using the constant false alarm rate algorithm. The EMG signal was refined by morphological hole filling, which is used to close up and fill out missing information. By exploiting the EMG amplitude ratio in two channels, we significantly improved the offset detection performance. The proposed method does not require a training process, unlike conventional methods. The experimental results indicated that the estimated errors for both the onset and offset detection are lower than those obtained using two of the conventional methods.

1. Introduction

Electromyography (EMG) is a method used to record electrical signals generated by muscular activities. EMG is related to muscle contraction and extension which can easily be recorded from the surface of the skin. Owing to these features, EMG is widely studied in various research fields, such as biomechanics, rehabilitation, and clinical diagnosis [1,2,3,4,5]. These applications require muscle activity information related to contraction or extension, and this information can be obtained by confirming the activation of EMG signals. Therefore, the muscle activity detection through EMG signal is a basic but crucial part of EMG applications [5,6].
The muscle activity detection aims to obtain both the onset and offset timing of EMG activity. The onset is defined as the beginning of a muscle contraction or extension, while the offset represents the end of a muscle contraction or extension. An easy technique to detect muscle activity is through visual inspection [7,8]. However the visual inspection by experts is accurate but complex. Thus, various methods for automatic onset and offset detection have been studied [9,10,11,12,13,14,15,16,17].
Most automatic detection methods are based on a threshold [9,10,11,12]. These methods detect the event timing by comparing the mean of EMG signals in a sliding window with a certain threshold. The onset detection using the generalized likelihood ratio test has been studied [9,10]. A single threshold is used for the onset detection only during a series of rapid upper limb movements [11]. Further, the onset detection based on Teager–Kaiser Energy method has been studied [12]. Bonato introduced a double threshold method where two thresholds were used to detect onsets of muscles from eight different locations under the waist [13]. Unlike the single threshold method, this method reduces the false alarm rate. Furthermore, other double threshold-based methods have been developed to increase the robustness to a noise level using EMG recorded from the upper and lower limbs [14,15,16,17]. In addition, Xu selected threshold based on the likelihood ratio test [10] where the optimal threshold was calculated via a likelihood ratio test. Rashid has attempted to achieve parameter optimization and then proposed an extended double threshold algorithm as a variant of the double threshold method [13]. However, these methods require optimization and an additional training process for parameter selection, thereby increasing the complexity of algorithm. Moreover, these conventional threshold-based algorithms are unable to accurately detect the offset timing.
In this study, we proposed a novel method used to detect the precise onset and offset timing of muscle activity, during hand-close and hand-open movements. The adaptive threshold was determined using the constant false alarm rate (CFAR) algorithm, and the EMG signal is refined by morphological hole filling that closes up and fills out the missing information. To evaluate the performance, we calculated the estimated error of the onset and offset timing. Furthermore, the results were compared with the two conventional methods based on the double thresholds. The experimental results indicate that the estimated errors for both onset and offset detection are lower than those occurring in the two conventional methods. In addition, the proposed method does not require a training process unlike conventional training-based methods.

2. Data Acquisition

Figure 1a shows the self-made wrist-type wearable device, which is used to measure EMG data. This device is composed of a four-channel EMG sensor and connecter, six axis motion sensor module, battery, Bluetooth module, and micro controller unit. The EMG signals and motion sensor data can be recorded simultaneously with a sampling rate of 256 Hz. Bipolar Ag-AgCl snap electrodes were used, and two channels were located in the inner and outer part of the left forearm. A reference electrode was attached to the backside of the neck. Then, gyroscope sensor data were simultaneously recorded from the middle finger of a subject, for the evaluation of the proposed algorithm. The gyroscope is used to obtain the ground truth of the onset and offset timing. One female and nine male subjects were asked to repeat the finger folding sequence. They had to contract all their fingers and maintain this for a certain second (close state), extend all their fingers very quickly (open state), and subsequently relax all their fingers (resting state). The subjects were also instructed to maintain the close stage during two different time intervals, and each trial was repeated 60 times.

3. Proposed Algorithm

Let s [ n ] be the EMG signal and x [ n ] be the absolute value after the DC removal (i.e., x [ n ] = | s [ n ] μ s | ) where μ s is the mean of s [ n ] during the resting period.
Figure 2 depicts the absolute value of EMG signals without the DC component for various states. Evidently, the activation of the inner channel ( x 1 [ n ] ) is greater than that of the outer channel ( x 2 [ n ] ) during finger contraction (close state), and vice versa for finger extension (open state). The ideal onset and offset timings are the start and the end points of the close state, respectively. The mean absolute value (MAV) is the most common feature in EMG analysis owing to its computational simplicity and is calculated for every sliding window. The MAV for the channel c, x ¯ c [ n ] is obtained as
x ¯ c [ n ] = 1 N k = 0 N 1 x c [ n k ] ,
and is illustrated in Figure 3.

3.1. CFAR-Based EMG Binarization

First, we detect the activation of the EMG signal by using the modified CFAR threshold. The CFAR is an algorithm, which sets a threshold to maintain a false alarm rate constantly. We use the median CFAR detector to calculate the decision threshold. Let X c = { x ¯ c [ n N L G ] , x ¯ c [ n N L G + 1 ] , , x ¯ c [ n L G 1 ] } be the training cell, and let x ¯ c [ n ] be the test cell for the channel c, where L G and N represent the guard and the training cell length, respectively.
Subsequently, the CFAR threshold is calculated as
C F A R t h c [ n ] = α · m e d i a n ( X c ) ,
where α = N ( P f a 1 / N 1 ) . Here, P f a denotes the false alarm rate and is set to 0.05 . The CFAR threshold C F A R t h c is modified by setting the upper limit to
t h c [ n ] = min ( C F A R t h c [ n ] , M c )
where M c represents the upper limit. The EMG signal is binarized using this threshold. When the EMG signal is activated, the state is mapped to 1, and when the EMG signal is inactivated, the state is mapped to 0, that is,
x B c [ n ] = 1 , i f x ¯ c [ n ] t h c [ n ] 0 , o t h e r w i s e .
Figure 4 illustrates the binarized EMG using the modified CFAR threshold. There is a notable existence of abnormal peaks and holes that disturb the detection of activation. Morphological hole filling is adopted to refine the binarized EMG, thereby removing these abnormal peaks and holes.

3.2. Refinement of the Binarized EMG

Morphological hole filling is a signal processing algorithm using for closing up and filling out the missing information. The algorithm consists of two steps: erosion and dilation.
The erosion step is calculated as
x E c [ n ] = 1 , i f k = 0 l 1 x B c [ n k ] = 1 0 , o t h e r w i s e .
Although the erosion step may remove abnormal peaks, it also enlarges holes. Therefore, dilation is applied to fill holes. The dilation is calculated as
x D c [ n ] = 1 , i f k = 0 m 1 x E c [ n k ] 1 0 , o t h e r w i s e .
The start and end of the activation are detected from the channel dilation results, x D c [ n ] , and they are denoted by T s c and T f c , respectively.
Figure 5 displays the EMG refinement results and shows that the peaks and holes disappear after the morphological hole filling. From T s c and T f c , we obtain T s 1 and T f 1 by selecting the minimum and maximum values for each channel, that is,
T s 1 = min ( T s 1 , T s 2 )
and
T f 1 = max ( T f 1 , T f 2 ) .

3.3. Onset and Offset Detection

Since they are both activated during the hand-close movement, the onset detection can be easily achieved using either x 1 [ n ] or x 2 [ n ] . However, the offset, which is the end time of the hand-close movement or the start time of the hand-open movement, is more difficult to detect than the onset. This is because EMG signals are sustained even after the completion of hand-close movements. Thus the offset detection becomes inaccurate [14,17]. This phenomenon can be observed in Figure 5. In the hand-close movement, x ¯ 1 [ n ] is clearly higher than x ¯ 2 [ n ] and vice versa in the hand-open movement. Thus, if we investigate the EMG amplitude ratio of x ¯ 1 [ n ] and x ¯ 2 [ n ] , we can successfully detect the time taken to transition from the hand-close to the hand-open movement. The transition time is the same as the offset time, the end point of the hand-close movement. To do this, we calculate the EMG ratio, r x ¯ [ n ] as
r x ¯ [ n ] = 1 N k = 1 N x ¯ 1 [ n k ] x ¯ 2 [ n k ] .
Then x p [ n ] is defined as
x p [ n ] = 1 , i f r x ¯ [ n ] μ r [ n ] ϵ , f o r T s 1 n T f 1 0 , o t h e r w i s e
where μ r [ n ] is the mean of r x ¯ [ n ] ; that is,
μ r [ n ] = μ r [ n 1 ] , f o r T s 1 n T f 1 β μ r [ n 1 ] + ( 1 β ) r x ¯ [ n ] , o t h e r w i s e .
Further, ϵ is a standard deviation of r x ¯ [ n ] during resting period. Using x p [ n ] , we calculate T s 2 and T f 2 as
T s 2 = arg min n ( x p [ n ] = 1 )
and
T f 2 = arg max n ( x p [ n ] = 1 ) .
Figure 6 shows T s 2 and T f 2 .
Finally, by compensating for the delay occurred by sliding windows from T s 2 , and T f 2 , the onset, T ^ s , and the offset time, T ^ f , are estimated as
T ^ s = T s 2 τ
and
T ^ f = T f 2 τ .
Here, τ means the compensation value calculated as τ = N 1 2 f s . Figure 7 presents the onset and offset detection results of the two subjects. These results are compared with those obtained through conventional methods.

4. Experimental Results

We compared the results of the proposed algorithm with the novel double threshold method (nDTM) [14] and the extended double threshold algorithm (eDTA) [17] to evaluate the performance of the proposed algorithm. Both conventional algorithms are based on the original double threshold method [13], which is a simple but widely used method for muscle activity detection. In the experiments, we set β = 0.75 , and τ = 78 m s . Figure 7 verifies that the proposed algorithm is more accurate than the eDTA or nDTM.
Figure 8 shows the effect of the P f a selection on the estimate error by varying from 0 to 0.5 for 10 subjects. Althouogh P f a higher than 0.3 results in the increased estimated error, P f a smaller than 0.2 results in the steady performace.
To quantify the accuracy, we have computed the estimation error as
e k = | T k T ^ k | ,
where T k represents the ground truth of the onset or the offset and T ^ k is estimated. The performance of the onset and the offset detection are separately evaluated. Figure 9 shows the results of subjects who show the best and the worst detection performance. For the onset detection, the proposed algorithm and eDTA reveal a similar estimate error, whereas nDTM exhibits a higher estimate error both in the best and the worst cases. It is noticeable that the offset detection result of the proposed algorithm is better than both of conventional methods.
The means and the standard deviations of the estimated error for the 10 subjects are listed in Table 1. For the onset detection, the proposed algorithm exhibits better or similar estimated errors compared to conventional methods for all the subjects. Regarding the offset detection, the proposed algorithm demonstrates the better performance than conventional methods. This indicates that the proposed algorithm can detect the onset and the offset of muscle activation more accurately than eDTA and nDTM.

5. Conclusions

In this study, we investigated a precise onset and offset detection algorithm for muscle activation by using two channel EMG signals. In controlling prosthetic devices or smart user interface, user’s intended gestures or motions are usually predicted by EMG signals. The onset and offset timing as well as types of gestures are very important to control prosthetic devices or smart user interface accurately. Since inaccurate onset or offset detection may result in non-causal or delayed response, the accurate onset and offset detection are required.
We significantly enhanced the offset detection performance by exploiting the EMG amplitude ratio in two channels. The estimated onset and offset errors have been calculated separately for the performance evaluation. The results have been compared with those of two conventional methods, which are based on the double threshold method. For onset detection, the proposed algorithm is comparable to eDTA and nDTM, whereas for offset detection, the proposed algorithm exhibits a performance that surpasses that of conventional ones.

Author Contributions

Conceptualization, H.-C.S.; methodology, K.K. and K.R.; software, K.K.; validation, K.K., K.R. and H.-C.S.; writing—original draft preparation, K.K.; writing—review and editing, K.K. and H.-C.S.; visualization, K.K. and K.R.; supervision, project administration, and funding acquisition, H.-C.S. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the BK21 Plus (Software Security Program, Dept. of Software Convergence, Soongsil Univ.) through the National Research Foundation (NRF) of Korea funded by the Ministry of Science and ICT.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
EMGElectromyography
CFARConstant false alarm rate
DCDirect current
MAVMean absolute value
nDTMNovel double threshold method
eDTAExtended double threshold algorithm

References

  1. Bojanic, D.M.; Petrovacki-Balj, B.D.; Jorgovanovic, N.D.; Ilic, V.R. Quantification of dynamic EMG patterns during gait in children with cerebral palsy. J. Neurosci. Methods 2011, 198, 325–331. [Google Scholar] [CrossRef]
  2. Benedetti, M.G.; Bonato, P.; Catani, F.; D’Alessio, T.; Knaflitz, M.; Marcacci, M.; Simoncini, L. Myoelectric activation pattern during gait in total knee replacement: Relationship with kinematics, kinetics, and clinical outcome. IEEE Trans. Rehabil. Eng. 1999, 7, 140–149. [Google Scholar] [CrossRef] [PubMed]
  3. Castellini, C.; van der Smagt, P. Surface EMG in advanced hand prosthetics. Biol. Cybern. 2009, 100, 35–47. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  4. Frigo, C.; Crenna, P. Multichannel SEMG in clinical gait analysis: A review and state-of-the-art. Clin. Biomech. 2009, 24, 236–245. [Google Scholar] [CrossRef] [PubMed]
  5. Kawakami, M.; Fujiwara, T.; Ushiba, J.; Nishimoto, A.; Abe, K.; Honaga, K.; Nishimura, A.; Mizuno, K.; Kodama, M.; Masakado, Y.; et al. A new therapeutic application of brain-machine interface (BMI) training followed by hybrid assistive neuromuscular dynamic stimulation (HANDS) therapy for patients with severe hemiparetic stroke: A proof of concept study. Restor. Neurol. Neurosci. 2016, 34, 789–797. [Google Scholar] [CrossRef] [PubMed]
  6. Micera, S.; Vannozzi, G.; Sabatini, A.M.; Dario, P. Improving detection of muscle activation intervals. IEEE Eng. Med. Biol. Mag. 2001, 20, 38–46. [Google Scholar] [CrossRef] [PubMed]
  7. Hodges, P.W.; Moseley, G.L.; Gandevia, S.C. Experimental muscle pain changes feedforward postural responses of the trunk muscles. Exp. Brain Res. 2003, 151, 262–271. [Google Scholar] [CrossRef] [PubMed]
  8. Worsley, P.; Warner, M.; Mottram, S.; Gadola, S.; Veeger, H.E.J.; Hermens, H.; Morrissey, D.; Little, P.; Cooper, C.; Carr, A. Motor control retraining exercises for shoulder impingement: Effects on function, muscle activation, and biomechanics in young adults. J. Shoulder Elb. Surg. 2013, 22, e11–e19. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  9. Micera, S.; Sabatini, A.M.; Dario, P. An algorithm for detecting the onset of muscle contraction by EMG signal processing. Med. Eng. Phys. 1998, 20, 211–215. [Google Scholar] [CrossRef]
  10. Xu, Q.; Quan, Y.; Yang, L.; He, J. An adaptive algorithm for the determination of the onset and offset of muscle contraction by emg signal processing. IEEE Trans. Neural Syst. Rehabil. Eng. 2013, 21, 65–73. [Google Scholar] [CrossRef] [PubMed]
  11. Hodges, P.W.; Bui, B.H. A comparison of computer-based methods for the determination of onset of muscle contraction using electromyography. Electroencephalogr. Clin.Neurophysiol./Electromyogr. Motor Control 1996, 101, 511–519. [Google Scholar]
  12. Yang, D.; Zhang, H.; Gu, Y.; Liu, H. Accurate EMG onset detection in pathological, weak and noisy myoelectric signals. Biomed. Signal Proc. Control 2017, 33, 306–315. [Google Scholar] [CrossRef]
  13. Bonato, P.; D’Alessio, T.; Knaflitz, M. A statistical method for the measurement of muscle activation intervals from surface myoelectric signal during gait. IEEE Trans. Biomed. Eng. 1998, 45, 287–299. [Google Scholar] [CrossRef] [PubMed]
  14. Severini, G.; Conforto, S.; Chmid, M.S.; D’alessio, T. Novel Formulation of A Double Threshold Algorithm for the Estimation of Muscle Activation Intervals Designed for Variable Snr Environments. J. Electromyogr. Kinesiol. 2012, 22, 878–885. [Google Scholar] [CrossRef] [PubMed]
  15. Di Nardo, F.; Mengarelli, A.; Burattini, L.; Maranesi, E.; Agostini, V.; Nascimbeni, A.; Knaflitz, M.; Fioretti, S. Normative EMG patterns of ankle muscle co-contractions in school-age children during gait. Gait Posture 2016, 46, 161–166. [Google Scholar] [CrossRef] [PubMed]
  16. Strazza, A.; Mengarelli, A.; Fioretti, S.; Burattini, L.; Agostini, V.; Knaflitz, M.; Di Nardo, F. Surface-EMG analysis for the quantification of thigh muscle dynamic co-contractions during normal gait. Gait Posture 2017, 51, 228–233. [Google Scholar] [CrossRef] [PubMed]
  17. Rashid, U.; Niazi, I.K.; Signal, N.; Farina, D.; Taylor, D. Optimal automatic detection of muscle activation intervals. J. Electromyogr. Kinesiol. 2019, 48, 103–111. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Wearable EMG sensing device and sensor location. (a) Wrist-type wearable device. (b) Location of two EMG sensors. (c) Hand-close. (d) Hand-open.
Figure 1. Wearable EMG sensing device and sensor location. (a) Wrist-type wearable device. (b) Location of two EMG sensors. (c) Hand-close. (d) Hand-open.
Applsci 10 05593 g001
Figure 2. Pre-processed data and activation state related to muscle state.
Figure 2. Pre-processed data and activation state related to muscle state.
Applsci 10 05593 g002
Figure 3. Mean absolute value (MAV) of EMG (Black solid line represents MAV ( x ¯ 1 [ n ] ) of EMG).
Figure 3. Mean absolute value (MAV) of EMG (Black solid line represents MAV ( x ¯ 1 [ n ] ) of EMG).
Applsci 10 05593 g003
Figure 4. Binarized EMG using the modified CFAR threshold.
Figure 4. Binarized EMG using the modified CFAR threshold.
Applsci 10 05593 g004
Figure 5. EMG refinement process. Solid line at the bottom illustrates the refined result of binarized EMG.
Figure 5. EMG refinement process. Solid line at the bottom illustrates the refined result of binarized EMG.
Applsci 10 05593 g005
Figure 6. Estimated onset and offset results.
Figure 6. Estimated onset and offset results.
Applsci 10 05593 g006
Figure 7. Onset and offset detection results and comparison. (a) Onset and offset detection result of subject 1. (b) Onset and offset detection result of subject 2.
Figure 7. Onset and offset detection results and comparison. (a) Onset and offset detection result of subject 1. (b) Onset and offset detection result of subject 2.
Applsci 10 05593 g007aApplsci 10 05593 g007b
Figure 8. Estimated error variation related to P f a for 10 subjects. (a) Estimation error of onset detection. (b) Estimation error of offset detection.
Figure 8. Estimated error variation related to P f a for 10 subjects. (a) Estimation error of onset detection. (b) Estimation error of offset detection.
Applsci 10 05593 g008
Figure 9. The performance comparison of the proposed algorithm and two conventional methods. (a) Results of onset detection for the best case (subject #1). (b) Results of offset detection for the best case (subject #1). (c) Results of onset detection for the worst case (subject #10). (d) Results of offset detection for the worst case (subject #10).
Figure 9. The performance comparison of the proposed algorithm and two conventional methods. (a) Results of onset detection for the best case (subject #1). (b) Results of offset detection for the best case (subject #1). (c) Results of onset detection for the worst case (subject #10). (d) Results of offset detection for the worst case (subject #10).
Applsci 10 05593 g009
Table 1. Results of the proposed method and two conventional methods for the 10 subjects.
Table 1. Results of the proposed method and two conventional methods for the 10 subjects.
SubjectEstimation Accuracy (Mean ± Std in Msec.)
OnsetOffset
ProposedeDTA [17]nDTM [14]ProposedeDTA [17]nDTM [14]
113.02 ± 11.1718.77 ± 15.0087.46 ± 71.1223.98 ± 22.4974.31 ± 64.96275.46 ± 83.76
223.71 ± 15.7832.60 ± 20.9066.20 ± 15.4933.41 ± 22.0140.81 ± 38.5558.39 ± 49.49
335.93 ± 22.5327.83 ± 25.5962.93 ± 16.4626.77 ± 35.98174.77 ± 72.6171.71 ± 62.71
437.27 ± 20.4936.99 ± 66.0382.60 ± 30.4137.51 ± 66.6091.96 ± 120.47134.93 ± 103.09
558.17 ± 52.12126.24 ± 138.6085.03 ± 248.30222.51 ± 169.26547.49 ± 397.46243.96 ± 121.18
667.57 ± 67.8078.70 ± 433.0566.96 ± 150.99198.66 ± 88.37214.31 ± 419.42259.33 ± 213.06
778.84 ± 115.66112.82 ± 182.4762.36 ± 132.80272.29 ± 111.78493.12 ± 571.60477.45 ± 537.98
881.00 ± 217.04157.54 ± 264.78307.89 ± 459.48289.27 ± 203.44485.15 ± 461.15321.89 ± 272.70
990.33 ± 82.46189.53 ± 151.18230.72 ± 315.83289.51 ± 134.38364.49 ± 192.19344.83 ± 151.68
10134.84 ± 130.39179.92 ± 151.50176.94 ± 192.35323.46 ± 203.20496.47 ± 182.11476.66 ± 123.26

Share and Cite

MDPI and ACS Style

Kang, K.; Rhee, K.; Shin, H.-C. Event Detection of Muscle Activation Using an Electromyogram. Appl. Sci. 2020, 10, 5593. https://doi.org/10.3390/app10165593

AMA Style

Kang K, Rhee K, Shin H-C. Event Detection of Muscle Activation Using an Electromyogram. Applied Sciences. 2020; 10(16):5593. https://doi.org/10.3390/app10165593

Chicago/Turabian Style

Kang, Kimoon, Kiwon Rhee, and Hyun-Chool Shin. 2020. "Event Detection of Muscle Activation Using an Electromyogram" Applied Sciences 10, no. 16: 5593. https://doi.org/10.3390/app10165593

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop