• 沒有找到結果。

心跳種類的分析與判斷:模糊C-平均值演算法

N/A
N/A
Protected

Academic year: 2021

Share "心跳種類的分析與判斷:模糊C-平均值演算法"

Copied!
6
0
0

加載中.... (立即查看全文)

全文

(1)

1

心跳種類的分析與判斷:模糊 C-平均值演算法

葉雲奇 清雲科技大學 電子工程系 yunchi@cyu.edu.tw 林泓志 清雲科技大學 電子工程系 m9811001@cyu.edu.tw 摘要―本研究是以 Fuzzy C-Means 演算法為基礎, 提出一個簡單有效的心跳種類的分析與判斷方法,稱為模 糊 C 平均值分析法(Fuzzy C-Means Method, FCMM)。本 研究能分析與判斷五種不同的心跳,包括正常的心跳

(normal heartbeats) 與較 常發生 的四種 不正常 的心跳 (包括“左束分支阻斷 (Left Bundle Branch Block)”、“右

束分支阻斷 (Right Bundle Branch Block)”、“心室過早 收縮 (Ventricular Premature Contractions)”、及“心房 過早收縮 (Atrial Premature Contractions)”)。本研究共 分成四個主要部份,分別是: (1) QRS extraction stage:尋 找心電圖(ECG)信號中的 QRS 複合波、P 波及 T 波的位 置; (2) qualitative features stage:選取主要特徵點; (3)

Procedure-FCM: 計算每一個群 集的中 心值向 量; (4) Procedure-HCD: 心跳種類的分析與判斷 。 最 後 再以 MIT-BIH 資料庫中的 ECG (electrocardiogram) 信號來

測試本研究的效能。經實際的測試,平均正確判斷率可達

93.78%。

關鍵詞:ECG 信號;模糊 C 平均值演算法。

Abstract –This study proposes a simple and reliable method, termed the Fuzzy C-Means method (FCMM) for classifying the heartbeat cases from electrocardiogram (ECG) signals. The FCMM can accurately classify and distinguish the difference between normal heartbeats and abnormal heartbeats. Classifying the heartbeat cases from ECG signals consists of four main procedures: (i) QRS extraction stage for detecting QRS waveform using the Difference Operation Method; (ii) qualitative features stage for qualitative feature selection on ECG signals; (iii) Procedure-FCM is used to compute the cluster center for

each class; and (iv) Procedure-HCD is used to determine the heartbeat case for the patient. The available ECG records in the MIT-BIH arrhythmia database are utilized to illustrate the effectiveness of the proposed method. Experimental results show that the total classification accuracy was approximately 93.78%.

Keywords: ECG signal; Fuzzy C-Means.

一、前言

在傳統的集群分析方法中,假若把每一個 觀測物均“嚴格”的劃分成「屬於」或「不屬於」 某個集群,這種分析方式就稱為“硬式分群法 (Hard clustering)”。此方法的缺點是容易造成原 始資料訊息的喪失,使得分群的結果不具意義。 另一種方法稱為模糊集群分析法(Fuzzy cluster analysis),亦即某一個觀測物它屬於某一個集群 之程度是一個從 0 到 1 之間的數值(該數值稱為 membership value),並且以該 membership value 的大小來決定該觀測物屬於某一個集群的大小 程度。在模糊集群分析法中最常使用的是模糊 C 平均值(Fuzzy C-Means, FCM)演算法。FCM 演 算法目前已廣泛的應用於模糊分群技術,它最 早是由 Dunn 於 1973 年提出[1],由 Bezdek 於 1981 年提出改良[2]。 FCM 演算法現在已被廣 泛的應用於各種領域,例如,圖形識別、影像 處理、醫學工程等等。 心跳種類的分析與判斷,近年來,研究學 者也提出了許多方法,如時域分析法[3]、頻域 分析法[4]、小波轉換分析法[5]、類神經網路分

(2)

2

析法[6]、Cross-Distance 分析法[7],等等。本研究 是以 FCM 演算法為基礎,提出一個簡單有效的 心跳種類的分析與判斷方法,稱為模糊 C 平均 值分析法(Fuzzy C-Means Method, FCMM)。本研 究 能 判 斷 五 種 心 跳 種 類 , 包 括 正 常 的 心 跳 NORM (normal heartbeats)與較常發生的四種不 正常的心跳 (包括 LBBB (left bundle branch block)、RBBB (right bundle branch block)、VPC (ventricular premature contractions) 、 及 APC (atrial premature contractions))。FCMM 共分成四 個主要部份,分別是: (1) QRS extraction stage: 尋找心電圖(ECG)信號中的 QRS 複合波、P 波及 T 波的位置; (2) qualitative features stage:選取主 要特徵點; (3) Procedure-FCM:在本研究中,它 的主要用途是計算每一個群集的中心值向量;(4) Procedure-HCD:心跳種類的分析與判斷。系統 方塊圖如圖 1 所示。 圖 1. 系統方塊圖

二、方法描述:模糊 C 平均值分析法

(Fuzzy C-Means Method, FCMM)

FCMM 共分成四個主要部份,分別是: (1) QRS extraction stage:以差分運算法(Difference Operation Method)尋找心電圖(ECG)信號中的 QRS 複合波、P 波及 T 波的位置; (2) qualitative features stage: 從許多特徵點當中選取最重要的 主要特徵點,其目的是要減少資料分群判斷的 運 算 時 間 及 減 少 記 憶 體 的 儲 存 空 間 ; (3) Procedure-FCM;(4) Procedure-HCD。其中的前 兩大部份,請參考我們先前所提出的文獻[9]。 後兩大部份說明如下:

(一). Procedure-FCM (Fuzzy C-Means)

在本研究中,Procedure-FCM 之主要用途是 計算每一個群集的中心值向量。執行步驟如下 所述:[10] Step 1-1:已知資料𝑋 = 𝑋1, 𝑋2 , … , 𝑋𝑁 ,其內 中的每一個元素𝑋𝑘 ∈ 𝑅𝑝。要分群的 群 集 數

c

事 先 已 選 定 , 且 滿 足 2 ≦ 𝑐 ≦ (𝑁 − 1)。歸屬度矩陣𝑈(0) 初始值是隨意給定一個數值,如式子 (1)。但歸屬隸屬度𝑢𝑖,𝑘的值要滿足式 子(2)的二個條件,而𝑢𝑖,𝑘 是表示某個 元素𝑋𝑘在群集 i 中的歸屬度。 𝑈 0 = 𝑢 𝑖,𝑘 0 𝑐 × 𝑁 = 𝑢1,10 𝑢1,20 𝑢1,30 ⋯ 𝑢1,𝑁0 𝑢2,10 𝑢 2,2 0 𝑢 2,30 ⋯ 𝑢2,𝑁0 𝑢3,10 𝑢 3,2 0 𝑢 3,30 ⋯ 𝑢3,𝑁0 𝑢4,10 𝑢 4,2 0 𝑢 4,30 ⋯ 𝑢4,𝑁0 ⋮ 𝑢𝑐,10 𝑢 𝑐,20 𝑢𝑐,30 ⋯ 𝑢𝑐,𝑁0 c× N (1) 條件 1:0 ≤ 𝑢𝑖,𝑘 ≤ 1, and 條件2: 𝑐i=1𝑢𝑖,𝑘 = 1, (2) 其中,1 ≤ 𝑖 ≤ 𝑐, 1 ≤ 𝑘 ≤ 𝑁 Step 1-2:選定模糊度參數 m (其中,1 < 𝑚 < ∞),

(3)

3 及設定“疊代次數”t=0。 Step 1-3:“疊代次數”的值增加 1;即是 t←t+1 (3) Step 1-4:計算(或更新)

c

個群集的中心值向 量𝑣𝑖(𝑡),如式子(4)。 𝑣𝑖(𝑡)= 𝑁𝑘=1(𝑢𝑖,𝑘(𝑡−1))𝑚 (𝑋𝑘) ( 𝑁 𝑘=1𝑢𝑖,𝑘(𝑡−1))𝑚 , 1 ≤ 𝑖 ≤ 𝑐 (4) 其中群集中心值向量 𝑉 = 𝑣1, 𝑣2, … , 𝑣𝑐 。 Step 1-5:更新𝑈(t)。其中𝑈(t)是一個大小為 c× N 的歸屬度矩陣(如式子(5)),而𝑢𝑖,𝑘 𝑡 之 計算如式子(6)。 𝑈(t)= 𝑢 𝑖,𝑘 (𝑡) 𝑐 × 𝑁 = 𝑢1,1𝑡 𝑢 1,2 𝑡 𝑢 1,3 𝑡 ⋯ 𝑢 1,𝑁𝑡 𝑢2,1𝑡 𝑢 2,2 𝑡 𝑢 2,3 𝑡 ⋯ 𝑢 2,𝑁 𝑡 𝑢3,1𝑡 𝑢 3,2 𝑡 𝑢 3,3 𝑡 ⋯ 𝑢 3,𝑁 𝑡 𝑢4,1𝑡 𝑢 4,2 𝑡 𝑢 4,3 𝑡 ⋯ 𝑢 4,𝑁 𝑡 ⋮ 𝑢𝑐,1𝑡 𝑢 𝑐,2 𝑡 𝑢 𝑐,3 𝑡 ⋯ 𝑢 𝑐,𝑁𝑡 c× N (5) 𝑢𝑖,𝑘 𝑡 = 1 ||X k −𝑣𝑖 𝑡 ||2 1 𝑚 −1 1 ||X k −𝑣𝑞 𝑡 ||2 1 𝑚 −1 𝐶 𝑞=1 , (6) 其中1 ≤ 𝑖 ≤ 𝑐 及 1 ≤ 𝑘 ≤ 𝑁 式子(6)中的||Xk− 𝑣𝑖 𝑡 ||2,是表示元素𝑋 𝑘 到 群集中心 𝑣𝑖 的歐氏距離(Euclidean distance)。 Step 1-6:條件 ∥ 𝑈(𝑡)− 𝑈(𝑡−1) ∥< ε,若有滿足 則跳到 Step 1-7。若沒有滿足,則回到 Step 1-3。其中 ε 為預先設定之很小的 正數。 Step 1-7:判斷元素𝑋𝑘屬於 class-z,條件是它最 後的𝑢𝑖,𝑘(𝑡)的值,在群集 i 中是最大的值, 如式子(7)。 𝑧 = 𝑎𝑟𝑔 𝑀𝑎𝑥 𝑢𝑖,𝑘 𝑡 , 𝑖 = 1, 2, … , 𝑐 (7)

(二). Procedure-HCD (Heartbeat Case

Decision)

假設每一個樣本點 X 有四個特徵值 (經 Procedure-QFS 所選的特徵值),表示如下:[9] X = X1 X2 X3 X4 = QRS − dur QTP − int Ratio − RR Area − R′ST′ (8) 本單元分成兩個部份說明,一是初值的計 算,另一個是心跳種類的分析與判斷。 1. 初值的計算: (1) 計算 Mean vector.

   k N i i k k k X K , N X 1 5 , 2 , 1 , 1  (9) 其中Xki是第 k 群(假若有 5 群)的第 i 個樣 本,Nk是第 k 群的樣本總個數。

(2) 計算 Sample covariance matrix.

5 , , 2 , 1 , ) ( ) ( 1 1 1 k X X X X N S T k i k N i k i k k k K      

 (10) 其中S 是 4 × 4 的矩陣. k

(4)

4

(3) 計算 Pooled sample covariance matrix S.

5 ) 1 ( ) 1 ( ) 1 ( ) 1 ( ) 1 ( ) 1 ( 5 4 3 2 1 5 5 4 4 3 3 2 2 1 1 5 1 N N N N N S N S N S N S N S N k N S N S T k k k                   

 (11) 其中 S 是 4 × 4 的矩陣。 2. 心跳種類的分析與判斷: 執行步驟如下: Step 2-1:設Mk= 0,Mk是各種心跳種類的總數, 而 k = 1,2,3,4,5。 Step 2-2:從病人身上取一個心跳Yi,假設每一 個心跳有四個特徵值(經 Procedure-QFS 所 選的特徵值),表示如下:[9] Yi = Yi1 Yi2 Yi3 Yi4 = QRS − dur QTP − int Ratio − RR Area − R′ST′ (12) Step 2-3:測量Y 與i X 之間的馬氏距離 k d2 Yi, k = Yi− X k ′S−1 Yi− X , (13) k 其中,k = 1,2,3,4,5。 Step 2-4:心跳Yi被指定是第 k*群,條件是Yi的 馬氏距離d2 Y i, k 在 k 群中是最小的值。 d2 Y i, k∗ = Min d2 Yi, k , (14) 其中,k = 1,2,3,4,5。 Step 2-5: Mk*=Mk*+ 1 (15) Step 2-6:判斷是否要取下一個心跳 Yi首先是執行 i = i + 1。 假若in能滿 足,則回到 Step 2-2 取下一個心跳Yi作 測試。否則,繼續執行 Step 2-7。其 中 n 是測試的心跳總個數。 Step 2-7:病人的心跳種類被判斷是第 k* 群, 條件是它的Mk*≠ 0。

三、性能評估

評 估 所 使 用 的 參 數 有 sensitivity (Se) , specificity (Sp),positive predictive value (PPV), negative predictive value (NPV) , 及 total classification accuracy (TCA)。這些參數的定義如 下:[3][9] i i i i FN TP TP Se   (16) i i i i FP TN TN Sp   (17) i i i i FP TP TP PPV   (18) i i i i FN TN TN NPV   (19)

   5 1 i r i T TP beats total of number the beats diagnosis correct of number the TCA (20) 其中,TPi (true positives) 是表示能正確的 判斷是心跳病症分類 i 的總心跳個數 (即是將

NORM 正 確 的 判 斷 是 NORM) , FNi (false

negatives) 是表示不能正確的判斷是心跳病症 分類 i 的總心跳個數 (即是 NORM 不能正確的

判斷是 NORM),TNi (true negatives) 是表示將

不是心跳病症分類 i 的心跳,判斷成不是心跳病 症分類 i的總心跳個數 (即是將 LBBB、RBBB、

VPC、及 APC 等,判斷成不是 NORM),FPi (false

positives) 是表示將本來就不是心跳病症分類 i 的心跳,判斷成是心跳病症分類 i 的總心跳個數 (即是將 LBBB、RBBB、VPC、及 APC 等,判

(5)

5 斷成是 NORM)。 Tr 是表示所有待測試之心跳 總個數。最後,以 MIT-BIH 資料庫中的部份檔 案,驗證本研究所提出的 FCMM 的效能。經實 際的測試,心跳病症分類 NORM 是 95.06%, LBBB 是 91.03%,RBBB 是 90.50%,VPC 是 92.63%,APC 是 93.77%,平均正確判斷率可達 93.78%。表 1 是性能比較表,它是本文所提的 FCMM 法與現有且性能評估方式類似的文獻[6, 11]的性能比較表,由此表中可看出 FCMM 法與 其它方法一樣有很高的正確判斷率,但 FCMM 法是一個方法簡單不須要複雜數學計算的方 法。

四、結論

使用 FCMM 的最大好處是方法簡單,不需 要複雜的數學式子,以及有高的辨識率。 經實 際的測試,Sensitivity 如下:心跳分類 NORM 是 95.06%,LBBB 是 91.03%, RBBB 是 90.50%, VPC 是 92.63%,APC 是 93.77%,平均正確判 斷率可達 93.78%。測試 30 分鐘長的 MIT-BIH 中 的 ECG 信號,所需要的測試時間少於 1 分鐘。

五、參考文獻

[1] J.C. Dunn, “A fuzzy relative of the ISODATA process and its use in detecting compact Well-Separated clusters”, Journal of Cybernetics, Vol. 3, pp. 32-57, 1973

[2] J.C. Bezdek, “Pattern recognition with fuzzy objective function algorithms”, New York, Plenum Press, 1981

[3] I. Christov, G. Gómez-Herrero, V. Krasteva, I. Jekova, “A. Gotchev K. Egiazarian,

Comparative study of morphological and time-frequency ECG descriptors for heartbeat classification”, Med. Eng. Phys., Vol. 28, pp.876-887, 2006

[4] V.X. Afonso, W.J. Tomkins, T.Q. Nguyen, S. Luo, “ECG beat detection using filter banks”, IEEE Trans. Biomed. Eng., Vol. 46, pp. 192-202, 1999

[5] C.W. Li, C.X. Zheng, C.F. Tai, “Detection of ECG characteristic points using wavelet transforms”, IEEE Trans. on Biomed. Eng., Vol. 42, pp. 21-28, 1995

[6] Z. Dokur, T. Olmez, “ECG beat classification by a Novel Hybrid neural network”, Computer Methods and Programs in Biomedicine, Vol. 66, pp. 167-181, 2001

[7] M. Shahram, K. Nayebi, “ECG beat classification based on a Cross-Distance analysis”, International Symposium on Signal Processing and its Applications, Malaysia, pp.234-237, ISSPA-2001

[8] MIT-BIH database distribution, Massachusetts Institute of Technology, 77 Massachusetts Avenue, Cambridge, MA 02139, 1998.

[9] Yeh, Y.C., Wang, W.J., Chiou, C.W.: “Cardiac arrhythmia diagnosis method using Linear Discriminant Analysis on ECG signals”, Measurement, Vol.42, pp. 778-789, 2009. [10] W. C. Chen, M. S. Wang, “A fuzzy c-means

clustering-based fragile watermarking scheme for image authentication”, Expert System with Application, Vol. 36, pp.1300-1307, 2009

[11] I.Jekova, G.Bortolan, I.Christov, “Assessment and comparison of different methods for heartbeat classification”, Medical Engineering and Physics, Vol. 30, pp. 248-257, 2008.

(6)

6 表 1. 性能比較表 NORM LBBB RBBB VPC APC FCMM Se (%) 95.06 91.03 90.50 92.63 93.77 93.78 PPV (%) TCA (%) 97.79 91.96 89.95 82.89 80.22 Knn-NN [11] Knn Se (%) PPV (%) TCA (%) 94.80 98.09 58.10 74.36 88.50 78.86 88.80 54.79 74.50 78.49 -- FL Se (%) PPV (%) TCA (%) 94.23 94.33 64.26 63.93 75.93 90.24 85.30 58.78 65.16 93.10 -- DA Se (%) PPV (%) TCA (%) 88.84 97.81 85.56 44.76 81.38 76.28 70.96 68.65 80.52 96.78 -- NN Se (%) PPV (%) TCA (%) 86.54 95.57 64.94 54.32 58.59 57.32 85.98 48.30 62.82 64.84 -- RCE Network [6] DWT Se (%) 93.2 39.1 78.4 86.5 63.0 60.0 PPV (%) TCA (%) 86.0 72.2 73.9 54.5 96.3 DFT Se (%) 86.3 60.8 47.0 77.6 85.0 50.1 PPV (%) TCA (%) 73.1 38.0 73.6 60.6 92.2 InS Network [6] DWT Se (%) 100 94.6 98.6 91.3 100 95.7 PPV (%) TCA (%) 96.7 91.0 94.2 93.5 98.0 DFT Se (%) 77.3 78.0 82.0 66.6 94.6 78.2 PPV (%) TCA (%) 74.3 70.4 70.2 75.7 83.5 MLP Network [6] DWT Se (%) 100 48.0 74.6 98.6 99.3 87.6 PPV (%) TCA (%) 92.6 96.0 99.1 81.3 78.8 DFT Se (%) 89.3 81.3 88.6 92.0 96.0 84.7 PPV (%) TCA (%) 93.7 77.2 73.4 76.2 91.3

參考文獻

相關文件

The prototype consists of four major modules, including the module for image processing, the module for license plate region identification, the module for character extraction,

A Boolean function described by an algebraic expression consists of binary variables, the constant 0 and 1, and the logic operation symbols.. For a given value of the binary

To facilitate the Administrator to create student accounts, a set of procedures is prepared for the Administrator to extract the student accounts from WebSAMS. For detailed

The ES and component shortfall are calculated using the simulation from C-vine copula structure instead of that from multivariate distribution because the C-vine copula

Keywords: pattern classification, FRBCS, fuzzy GBML, fuzzy model, genetic algorithm... 第一章

本論文之目的,便是以 The Up-to-date Patterns Mining 演算法為基礎以及導 入 WDPA 演算法的平行分散技術,藉由 WDPA

The Ministry of Justice look highly upon the operation of volunteer, which can be assorted into four categories by its clients, some for the crime victims , some for

The main goal of this research is to identify the characteristics of hyperkalemia ECG by studying the effects of potassium concentrations in blood on the