You are on page 1of 6

Proceedings of the 2010 IEEE

International Conference on Automation and Logistics

August 16-20 2010, Hong Kong and Macau

An Algorithm of ST Segment Classification and Detection

Zhao Shen 1 , Chao Hu 2 , Jingsheng Liao 2

1. Institute of Automation, Northwestern Polytechnical University , Xi’an Shaanxi Province, China 2. Shenzhen Institutes of Advanced Technology Shenzhen, Guangdong Province, China * zhao.shen@sub.siat.ac.cn

{chao.hu & js.liao}@siat.ac.cn

Abstract - In electrocardiogram real-time monitoring, the ST segment detection is important, it has close relationship with myocardial ischemia and myocardial infarction. In this paper, ST detection is divided into two parts, firstly using wavelet and morphology method to calculate the offset direction, waveform and summarizing features of ST, eventually divide the ST in 15 types; next analyzing the ST waveform change tendency in about 30 minutes and discovering the rhythm of ischemia or infarction to help doctor. At last, the first part has been confirmed by MIT- BIH Arrhythmia database and European ST-T database and the second is proved by two experts’ conclusion.

Index Terms - ST segment, wavelet, R wave, T wave

I. INTRODUCTION

In ECG monitoring, ST segment means the change of electric potential in the period which from the end of ventricular depolarization to the origin of repolarization. In normal conditions, ST segment shows horizon level, but in some heart disease conditions, the ST segment will be affected and drifted in different direction and shown in various forms, as is shown in figure1.Because ST segment will show in various form for different kinds heart disease attack, so that the change of ST segment is a significant indicator of various heart disease in ECG clinical care. During analysis the ST segment, the main contents include the following two steps: one is determining the type of ST; the other is analysis the change trend of ST. The first step of ST type classification is calculate ST offset level, it include J+X, R+X, regional search, and T wave methods. The J+X method is firstly determine the end point of QRS, named J point, and then select the point which several milliseconds after J point as J+X point, using the value of this point as the offset level, the R+X method is the same with the above method, just use R point replace J point because R point is easily determined than J point. Regional research method means select several points as a template and uses this template to matching other part of ST segment and selects the max value or min value as the offset level. The T wave method is using the original point of T wave as the offset level.

*

Max Q.H Meng 3 , Fellow IEEE

3.Department of Electronic and Engineering

Chinese University of Hong Kong

Hong Kong , China

max@ee.cuhk.edu.hk

Proceedings of the 2010 IEEE International Conference on Automation and Logistics August 16-20 2010, Hong Kong

Fig1.Different Kinds of ST Waveform

The shape recognition of ST segment is another important. Because ST segment will show various shape for different heart disease, this feature not can help to analysis the reason of ST change, but will help people to determine the different heart disease. In this field, many people have achieved great success. Mao [1] use other methods to eliminate the noise and analysis the pattern of ST, has achieved good result, but the progress is too complex to use in real time monitor, Shi [2] use wavelet transform method to get the key points of ST, and use straight line to fitting ST segment curve, and finally divide ST segment into five pattern, because the complex of ST itself and noise disturbance, the accuracy of this result is relatively low. Liu [3] and others use neural network and other algorithm to analysis the ST segment and achieve good result but it must with lots of data and it can’t recognize the new pattern which have not been trained in the past. Other people also have done much work in this field but most of these methods are too complex to using in real time monitoring. In this paper, a new method about ST segment analysis is proposed. Firstly, using wavelet transform to eliminate the disturbance and determine the key points of ECG, calculating the ST offset, the curve type, and the concave-convex factor or straight slope. After determine the ST pattern, for help doctor monitor and diagnose, the ST change trend will be analysis by using the former method, nearly 30 minutes ECG will be

This work is supported by the grants from National Sc. & Tech. Pillar Program (2008BAI65B21), the Guangdong/CAS Cooperation Project (2009B091300160), Shenzhen Sc. & Tech. Research Funds, and the Knowledge Innovation Eng. Funds of CAS.

978-1-4244-8376-1/10/$26.00 ©2010 IEEE

559

monitored continually. By detecting several periods ECG in every 5 minutes, the change progresses of ST are analyzed and the period and interval time of heart disease will be analyzed. Finally, through test the data from the MIT-BIT arrhythmia and European ST-T database, the ST detection achieve good result, by comparing two experts decision, the result of diagnose is consistent with experts.

II. ST SEGMENT CLASSIFICATION

In

this

paper,

the

chart of ST segment pattern

classification is shown in figure2. The step is using wavelet transform to eliminate the noise and baseline drift of the original ECG, and calculate the key points firstly, and then determine the offset direction by comparing the ST offset level with ISO, at last conclude the ST type, if it belong to straight line, calculating the slope to divide the ST into upward, downward or horizon, else if it belong to curve, calculating the concave-convex factor for finishing the ST pattern classification.

monitored continually. By detecting several periods ECG in every 5 minutes, the change progresses of ST
monitored continually. By detecting several periods ECG in every 5 minutes, the change progresses of ST

Fig2.The Chart of ST Pattern Classification

  • A. Wavelet Denoising

Wavelet is widely used in ECG signal; the way of using wavelet is shown in figure3.Based on Mallat’s method, signal can be decomposed in different layers and each layer also be divided into wavelet coefficients part (high frequency) and approximate coefficients part (low frequency), we can analysis and process the signal in different layers and parts. Finally, the signal can be reconstructed, in this progress, we can get rid of noise, decompose and reconstruction is shown in figure4:

monitored continually. By detecting several periods ECG in every 5 minutes, the change progresses of ST

Fig3.The Chart of ST Pattern Classification

After the ECG is from hardware or database, the first step is to eliminate noises, especially in ST segment. The noise mainly include two types, one is power interference, which caused by hardware and another is baseline drift caused by patient breathe. First step is remove power interference; using DB6 wavelet decomposed the ECG in 5 layers and designing soft-threshold to eliminate the high frequency part in 1-3 layers, because these parts are mainly composed by power line

interference. After removing it, a wavelet adaptive filter is designed for eliminate the baseline, using Meyer wavelet decompose the ECG in 9 layers and select wavelet coefficients in 1-9 layers as the reference input of the adaptive filter. The algorithm of adaptive filter is least mean square (LMS). The ECG will be compared with the reference and the weight factor will be adjusted, according the error value to adjust the weight to let the adaptive works in optimal state, the output is pure ECG and the baseline will be removed clearly.

monitored continually. By detecting several periods ECG in every 5 minutes, the change progresses of ST

Fig4.The Decompose and Reconstruction of Signal

  • B. Key Points Detection The key points in ST segment include the R peak point,

ISO point, J point, T peak point and Ton point, the R peak is

the wave peak of QRS wave, the ISO point is the original

point of QRS, the J point is the end of QRS wave, the T peak

point is the wave peak of T wave and Ton point is the original

point of the T wave, as is shown in figure5.

monitored continually. By detecting several periods ECG in every 5 minutes, the change progresses of ST

Fig5.Key Points of ST Detection

The R peak point is the most important in ST analysis, in reference of basis method of Li [5] , we design the wavelet difference method to calculate the R peak point. Firstly using

quadratic spline wavelet decomposes ECG in 5 layers and pick

up the low frequency part of 2 layer, and then design a

threshold to compare the value with the ECG in 2 layer, if the value of ECG is bigger than threshold, reserve them and another will be give up. Secondly calculate the first order difference, and get the max and min value of the difference, find the pass zero point in every max-min couple, and these pass zero point is just the R peak point. After the R peak detection, the next step is detecting the ISO point and J point, the method is same but the direction is opposite. For ISO point, firstly select the max value point of one order difference as the reference point (RP), according to

560

the Dascalov [6] method, select the [RP-100ms, RP-20ms] as the ISO exist interval, then calculate slope of this segment, if there exist more than 20ms points that the absolute value of slope is less than threshold, the final point of this segment is regarded as ISO point. If this interval is noised and hard to find the fit point, we use a curve to make curve fitting to this interval, the fit method is least square method, and use the fit curve to calculate and determine the ISO point. As same as the ISO, firstly select the min value point of one order difference as the reference point (RP), and then select the [RP+20,RP+100] as the J exist interval, use the same way and select first point as the J point in ECG. The threshold is between 0.05~0.15, this fit for most of the ECG data. When the ISO and J point have been determined, the next work is to calculate the T peak point and Ton point. According to the Fan [7] method of the length of the QT interval, the T wave end point will be calculate by the formula 1:

Tend = Qon + 0.55 *

R − R
R − R

(1)

The Qon is just the ISO point, and the R-R is RR interval. So we can determine the T wave end point by formula 1. Then using former method as the same as R peak point to detect the T wave peak point, firstly we select the interval from the J point to the Tend point, and using quadratic spline wavelet decompose it in 5 layers, calculate the pass zero point of one order difference max-min value couple, the pass zero point is T wave peak point, named T peak. The Ton point is the end of the ST segment and the original point of T wave, there are many papers which analysis how to calculate the Ton point, in this paper we use the distance method to determine the Ton point, first select the point which 20ms after the J point ( J point sometimes will happen offset for wavelet decompose and call this new point J20 point), and then calculate the function of the straight line from J20 point to T peak point which is called L, the function is shown in formula 2:

y =

y Tpeak

(

)

y

(

J

20)

Tpeak

J 20

* n +

y

(

J

20) *

Tpeak

y Tpeak

(

) *

J

20)

Tpeak

J 20

( 2)

After this, then calculate the distance between the ECG and L from J20 point to T peak point, and get the point which distance is maximum in all these points, we regard this point is Ton point, the distance formula is by formula 3:

Dis =

slope

*

n

+

1 *

(

y n

)

+

K

 
1 + slope * slope (3)

1

+ slope

*

slope

 

(3)

Dis means the distance from the point to line; K is the constant of function in formula 2.

  • C. Determine the ST Offset Level

In this paper

the J+X

method is used to detect the ST

offset level, we detect the X milliseconds after J point and call this point JX, and compare the value of JX with ISO to conclude the offset level, the X is determined by formula 4.

X =

⎪ ⎪

80 ms

72

ms

HR

100

< 100

<

HR

times

/ min

<

110

times

/ min

(4)

64

ms

110

<

HR

<

120

times

/ min

⎪ ⎩

60

ms

HR

> 120

times

/ min

 

HR means the heart rate, after determine the JX point, than compare the value of JX point with the ISO point, to conclude the offset direction, based on formula 5:

 

Offset =

y ( JX ) y ( ISO )

(5)

 

Offset means the offset level, y means the value of the ECG, the judgement criterion is: 1 if the Offset<K1, this means “Lower”; 2 if the Offset>K2, this means “Higher”; 3 if the Offset belong to [K1, K2], this means “Normal”. In this paper the value of K1 is -0.1 and K2 is 0.1.

  • D. Determine the ST Type

After determined the offset level of ST segment, the next step is detect the type of ST, the type include two, one is straight line ST, the other is curve ST. In this paper, Mao [2] method is to use, when the offset level is Higher, we select the points from J20 to T peak as the analysis interval and if the offset is Lower and Normal, we select the points from J20 to Ton as the analysis interval. The original point of this interval is J20, and the end of this interval is T peak or Ton, here is unified called TE, the type judge method is distance method. Firstly calculate function of the straight line which connects the J20 and TE and will been called KST, the KST function is formula 6:

y =

(

y TE

)

(

y J

20)

TE

J 20

* n +

(

y J

20) *

TE

(

y TE

) *

J

20)

 

TE

J 20

(6)

Substitute the parameters of (6) to (3), calculate the distance from the J20 to TE, and select the maximum value of all the distance as the Distance. Compare the Distance with the

threshold and if the Distance>threshold, this means the ST segment is curve type, and if the Distance<threshold, this means the ST segment is straight type. The value of threshold in this paper is 0.15.

  • E. Determine Concave or Convex of Curve Type After the type of ST segment is determined, if the ST

segment belong to curve type, the next step is determine this

ST segment belong to concave curve or convex curve, if the ST segment belong to straight type, the next step is determine it belong to upward type, downward type or horizon type. Through analysis the features of the curve, it is known that if the curve belong to the concave, all the curve is below the line which connect the original and end point, this means in the graph, all the value of the curve is smaller than the line. On the contrary, if the curve belongs to convex, all the value of the curve is higher than the line. We can use this feature to determine the curve type. Compare the ST segment from J20 to TE with the corresponding in KST, and design two factors, one is concave, the other is convex. Suppose the number of points from the J20 to TE is M, and the number of points in ECG which value

561

is higher than the corresponding KST value is P, and the number of points in ECG which value is lower than the KST is N, the concave and convex is define as formula 7:

concave =

N

M

convex =

P

M

(7)

If the concave>0.7, it means that more than 70% points is lower than KST, we can conclude this curve is belong to concave. At the same method, if the convex>0.7, it means that more than 70% points is higher than KST, so it belong to convex. If neither concave nor convex is more than 0.7, it seems the ST has been noised, in this condition we use a curve and do curve fitting for the ST segment and repeat former step again, until to get the final result.

  • F. Determine Slope Direction of Straight Type

IF the ST belongs to straight type, it needs to determine the trend of the ST segment. Because ST segment belong to straight type, it means that ST segment has a little deviation from the KST, we can use the KST replace ST to analysis, so calculate the slope of KST to determine the ST trend. As is shown in formula 8:

SKST =

(

y TE

)

y

(

J

20)

TE

J 20

(8)

If the SKST>k1, it seems that the ST segment is upward, and if the SKST<k2, it seems that the ST segment is downward, and if the k2<SKST<k1, it seems the ST is horizon. In this paper, we select k1=0.15, k2= -0.15.

  • G. Result of ST Classification

In ST segment pattern classification, finally we give the ST segment feature include three parts, that include the offset direction, the ST type determine, if it belong to curve type, determine the concave or convex, and if it belong to straight type, we will give the ST direction by calculating the slope of the fit line. The summary of ST segment pattern classification is shown in table1. In this paper, the test data from the MIT-BIH arrhythmia and European ST-T database, from MIT-BIT arrhythmia, the 100.dat MLII and 105.dat MLII are selected and from European ST-T database, the e0104.dat MLIII, e0105.dat MLIII, e0515.dat V2, e0601.datV5,e0614.dat V5and e0704.dat V5 are selected, the typical waveforms of these data are shown in figure6. For the test result of data, we select 30 periods of ECG which from the every database to detect. And all the data have been determined by the two experts, the experts give the reference advice of the ST type for every period, it include the offset direction, ST segment type and ST trend and possible diseases. If the result of this method is as same as the expert advice, it seem that the method is correct otherwise it will be false, finally the error rate will be calculated to prove the effectiveness of this new method. Besides this, every database is a typical of ST segment pattern, for example in 105.dat, the ST segment is lower than ISO and

shown in straight and horizon, in e0105.dat, the ST has elevated and shown in curve and concave, on the contrary, in e0515, the ST also has elevated but in convex, in e0614 the ST segment is noised and we will use a curve to make curve

fitting for the ST segment.

Table 1. ST Pattern Classification Summarize

   

Concave-Convex

 

Offset Direction

Type

Feature

Slope Direction

 

Curve

Concave

 

Higher

Convex

   

Upward

 

Straight

Horizon

Downward

 

Curve

Concave

 

Normal

Convex

   

Upward

 

Straight

Horizon

Downward

 

Curve

Concave

 

Lower

Convex

   

Upward

Straight

Horizon

Downward

is higher than the corresponding KST value is P, and the number of points in ECG

Fig6.Typical Waveform of Test Data

We divided ECG data in three groups, the first ten periods ECG is mainly in the first 10 minutes, and the second ten periods ECG is between 10~20 minutes, and the last ten periods ECG is in the 20 minutes later, this will be benefit to give the change analysis of ST segment in the later and this will be analyzed detail later. Both the experts’ conclusion of ST type and real test result are shown in table 2. In table 2, the maximum error rate of ST pattern detection is 16.67%, and the minimum is 0.00%. Most of the ST pattern classification result is consistent with the expert conclusion. It seems that this recognize method is effective, which will be suit for most of the ST pattern recognitions.

III. ST MONITORING AND DIAGNOSE

562

In part two, the ST waveform has been recognized in 15 types, next we will use this conclusion to continues monitoring and diagnose myocardial ischemia and infarction.

  • A. Myocardial Ischemia and Infarction

Myocardial ischemia is one of the most common heart diseases. The main reason is coronary atherosclerosis decreased blood flow to the heart, that make oxygen supply decrease and myocardial metabolism appears abnormal, in this condition the heart can not work normally. If this continues, it means the patient get myocardial ischemia. Myocardial infarction means myocardial vascular necrosis, the immediate reason is coronary artery disease which makes blood fell sharply or interrupted, thus heart will appears serious and sustainability of ischemia and cause infarction. The basic reason is plaques and thrombosis which caused by coronary atherosclerotic limit the blood flow and make coronary artery disease.

  • B. The Relationship of ST with Ischemia and Infarction

ST can rapidly and accurately reflects the myocardial ischemia attack interval, duration and severity, the modern standard is if ST fit for the following: 1 at JX point and

nearby, ST shows in horizon or downward type; 2 drop over 1mm or 0.5mV and continue over 1 minute; 3 the attack interval is over 1 minute, this we can conclude the myocardial ischemia has happened. And myocardial infarction can also be reflected by ST change, when myocardial infarction has happened, ST will shows in convex type, and be elevated until exceed T wave, sometimes because of T wave inversion, ST will become wilder than ever. For the relationship between ST and myocardial ischemia or infarction is analysed, the diagnose result is concluded by experts and shown in table2.

  • C. Analysis the Process of ST Change

In real time monitoring, ST change means the patient has been attacked by myocardial ischemia or infarction. In table2, experts have given a reference diagnose result, based on this we will analysis the rhythm of ST change process, it will help the doctor to detect the heart disease pathogenesis regularity, the work mainly include three part: at the beginning the attack time of ischemia or infarction is detected, the next step is duration time, finally is the severity. According these test result doctor will conclude the ischemia or infarction belong to acute or continually disease, and common or severe. During the time from 0:00~30:00, firstly we detect the ST waveform type at 0:00 o’clock, and in every 5 minute we detect ST type and compare with the type 5 minutes ago, at the same time if there happens the break out of disease and T wave change, record and give the diagnose result. The ST change process test result is shown in table 3.

In part two, the ST waveform has been recognized in 15 types, next we will use

“N means this ST segment with great noise”

Table 3. ST Change Process

 

0:00

5:00

10:00

15:00

20:00

25:00

30:00

 

Normal

           
  • 100 Straight Horizon

No

Change

No

Change

No

Change

No

Change

No

Change

No

Change

 

Lower

     

ST

   
  • 105 Straight Horizon

No

Change

No

Change

No

Change

Great

Noise

ST

Noise

No

Change

 

Lower

           

E0104

Straight

Down

No

Change

ST

Noise

ST

Noise

No

Change

No

Change

No

Change

 

Higher

ST

       

ST

E0105

Curve

T

ST

ST

ST

ST

T

Concave

MI

MI

 

Higher

     

ST

Burst MI

ST

Revert

 

E0515

Straight

Upward

No

Change

No

Change

ST

ST

 

Higher

           

E0601

Curve

Concave

No

Change

ST

Noise

No

Change

No

Change

No

Change

ST

 

Lower

           

E0614

Curve

Concave

ST

Noise

No

Change

No

Change

ST

Noise

ST

ST

E0704

Lower

Curve

ST

ST

ST

ST

T wave

ST

No

Change

Convex

Notch

“MI means myocardial infarction

In table 3 we select two examples to explain the change process of ST segment, both of two diagnose are consistent with the experts conclusion, first example in E0105, at the original time, the patient has signs of myocardial infarction for ST begin to raise, at about 5:00 o’clock, myocardial infarction happen and ST is higher than T wave, after the time ST begin to drop and the symptom begin to gradually release, and before 30:00 o’clock, ST raise again and the myocardial infarction happen, this means that the myocardial infarction is period occur, the period is about every 25~30 minutes, and

563

when each happened, it will continue 5~10 minutes, the disease is more serious. Second example in E0515, at the beginning time the ST is no obviously change and patient has no obvious symptom, at about 15:00, ST drop to normal, but between 15:00~20:00, ST suddenly raise up fast and exceed T wave, it means the patient has a acute myocardial infarction, it continues no more than 10 minutes and ST rapidly drop and myocardial infarction release quickly in about 25:00, it seems that this belong to acute myocardial infarction and the condition of heart is very bad. If it happens next, the patient must be send to emergency. When doctor master these useful messages, he will take preparation and do some preventive measurements before the disease happen again.

IV. CONCLUSION

ST segment is an important part in ECG detection, especially in myocardial ischemia and myocardial infarction. Because ST usually changes variously, that makes a lot of difficulties of ST detection. In this paper a new ST detection and diagnose is proposed, which include two parts, the first part is recognize the ST type. It include using wavelet to determine the key points of the ECG, and compare the value of JX and ISO to confirm the offset direction of the ST; than use distance method, by calculating the distance from the ECG to the line connect J20 to TE, to make sure of the ST type, which belong to curve or straight; at last use morphological

method to determine the concave-convex feature of curve or use slope to determine the direction of the straight. After the analysis of ST shape feature, the second part is heart disease analysis of ST change trend, we detect the ECG in different time for 30 minutes continually, analysis the process and different features of ST, propose that regular of some heart disease can be known from the ST change, this will help doctor to make decision and diagnose. In the end, using MIT- BIH arrhythmia and European ST-T database to prove the

effectiveness of this method, and the experts conclusions confirm the analysis of ST change is useful and can give support to doctor.

REFERENCES

[1] Mao, “Research on Shape Analysis of ST Segment in ECG Signal,” Signal Process, vol. 25, no. 9, pp. 1360-1365, Sep. 2009. [2] Shi, “Electrocardiogram R wave and ST segment extraction based on wavelet transform,” Chinese Journal of Scientific Instrument, vol. 29, no.4, and pp: 804-809, Apr. 2008.

[3] Liu, “Shape Identify of ST Based on Radial Basis Function Manual Neural Network,” Acta Biophysica Sinica, vol. 21, no. 5, pp. 457-463, Dec. 2005. [4] Donoho. “Adaptiving to Unknown Smoothness via Wavelet Shrinkage [J]”, J Amer Stat Assoc, vol.90, no.432, pp: 1200-1224, Dec, 1995. [5] Li, “Detection of ECG Characteristic Points Using Wavelet Transforms,” IEEE Trans on Biomed Eng, vol. 42, no. 1, pp. 21-29, Jan 1995. [6] Daskalov, “Development in ECG Acquisition, Preprocessing, Parameter Measurement, and Recording,” IEEE Trans on Biomedical Engineering,

1998.

[7] Fan, “An Algorithm for Locating ECG Key Points,” Peking Biomedical Engineering, vol.15, no. 1, pp: 15-18, 1996. [8] Fan, “The Measurement of ST-T Segment Parameters in Ambulatory ECG,” Journal of Biomedical Engineering, vol.14, no. 1, pp: 51-53, 1997. [9] Zhu, “A new ST Segment Analysis Scheme for Holter System,” Journal of Biomedical Engineering, vol. 21, no. 6, and pp: 943-946, 2004.

[10] Sun, “The Automatic Detection Algorithms and Analysis Methods of QT Interval,” Chinese Journal of Biomedical Engineering, vol. 28, no. 1, Feb.

2009

[11] Hamilton and Tompkins, “Quantitative Investigation of QRS Detection Rules Using the MIT/BIH Arrhythmia Database,” IEEE Transactions on Biomedical Engineering, vol. 33, no. 12, Dec. 1986. [12] Lu, “Wavelet Based ST Segment Measurement Method for Exercise ECG Monitoring,” Peking Biomedical Engineering, vol. 24, no. 5, and pp: 329- 333, Oct. 2005. [13] Song, “Automatic Detection of ST-T Segment Based on Wavelet Transform,” Chinese Journal of Medical Engineering, vol. 22, no. 4, and pp: 601-603, Jul. 2005.

564