The present invention provides a migraine attack detection system, included building and prediction method. The building method was shown as follows: it was recorded resting-state (open-eyes and closed-eyes) multi-channel brain wave signals by migraine patients. The coherence of brain wave signals would be analyzed between different brain regions based on a migraine attack detection system, which called the coherence eigenvalues. Moreover, machine learning algorithm was applied in the migraine attack detection system, and the analyzed eigenvalues were regarded as input feature of the machine learning algorithm. Furthermore, the eigenvalues would recognize different migraine phases using machine learning algorithm, and it was correctly classified into migraine phase when the classification module was trained well. The prediction method was described as follows: it was recorded the resting-state brain wave signals by a migraine patient first. Then, taking advantage of the coherence eigenvalues and classification module in migraine attack detection system, was to predict the migraine phase when EEG recording.本發明提供一種偏頭痛發作預測系統之建立及預測方法,其中建立方法包括:其擷取一患者在靜息狀態(張眼和閉眼)下之多通道的腦波訊號;利用一偏頭痛發作預測系統分析腦波訊號在不同腦區之間的一致性,得到多通道的一致性特徵值;偏頭痛發作預測系統利用機器學習演算法,把分析所得到之一致性特徵值作為機器學習的輸入特徵;在機器學習中,當學習到屬於不同時期的患者之一致性特徵值後,便可用此一致性特徵值正確判斷分類出偏頭痛的不同時期,由此建立一偏頭痛時期判斷模組。預測方法包括:擷取一偏頭痛患者靜息狀態下之腦波訊號,利用偏頭痛發作預測系統中一致性特徵值和偏頭痛時期判斷模組去預測該偏頭痛患者測量腦波的時刻屬於偏頭痛時期中之何者。