**Abstract**

Diagnosing pain mechanisms is one of main approaches to improve clinical treatments. Especially, detection of existence and/or level of pain could be vital when oral information is not present for instant for neonates, disabled persons, anesthetized patients and animals. Various researches have been performed to originate and classify the pain; however, consistent results are surprising. The aim of this study is to show a strict relation between electroencephalography (EEG) features and perceptual pain levels and to clarify the relation of classified signal to pain origin. Cortical regions on scalp are assigned based on an evolutional method for optimized alignment of electrodes that improve the clinical monitoring results. The EEG signals are recorded during relax condition and variety of pain conditions. Evolutionary optimization method is used to reduce the features space dimension and computational costs. A hybrid adaptive network fuzzy inference system (ANFIS) and support vector machine (SVM) scheme is used for classification of pain levels. ANFIS optimizer is used to fine tune the non-linear alignment of kernels of SVM. The results show that pain levels could be differentiated with high accuracy and robustness even for few recording electrodes. The proposed classification method provides up to 95% accuracy.

**Keywords:** electro-encephalogram, pain, adaptive network fuzzy inference system, support vector machine
