###### Abstract  
The constantly developing biomedical engineering field and newer and more advanced BCI (brain-computer interface) systems require their designers to constantly develop and search for various innovative methods used in their creation. In response to practical requirements and the possibility of using the system in real conditions, the authors propose an advanced solution using EEG (electroencephalography) signal analysis. A BCI system design approach using artificial intelligence for the advanced analysis of signals containing facial expressions as control commands was used. The signals were burdened with numerous artifacts caused by simulated nervous tics. The proposed expert system consisted of two neural networks. The first one allowed for the analysis of one-second samples of EEG signals from selected electrodes on the basis of power spectrum estimation waveforms. Thus, it was possible to generate an appropriate control signal as a result of appropriate facial expression commands. The second of the neural networks detected the appearance and type of nervous tics in the signal. Additionally, the participants were affected by interference such as street and TV or radio sound, Wi-Fi and radio waves. The system designed in such a way is adapted to the requirements of the everyday life of people with disabilities, in particular those in wheelchairs, whose control is based on BCI technology. EEG; Emotiv EPOC Flex; NeuroHeadset; control with facial expressions; brain-computer interface (BCI); expert system; artificial intelligence; nervous tics +
Footnote †: journal: Accepted: 12 October 2022  
movement or facial expressions into a control or executive signal that a computer or other microprocessor system sends to various types of devices. The listed applications are presented in detail in the articles [7; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25]. Based on a review of the classification algorithms used to design brain-computer interface (BCI) systems presented in [26; 27], the classification of these types of designs that rely heavily on electroencephalographic signal measurements can be summarized. The authors proposed a division according to four main categories: adaptive classifiers, matrix and tensor classifiers, transfer learning and deep learning and other classifiers. The aim of the research carried out in this work was to design a system that is able to cope with the classification of signals where control commands are given by means of facial expressions. These commands were forward (both eyes squint), right (right eye squints) and left (left eye squints). As the system was designed with people with disabilities in mind, the tested person during the measurements was moved in a wheelchair in order to reflect the real conditions and the evident disturbances that arose in this way. In addition, it was assumed that the system's task was to detect three selected nervous tics that the examined person was supposed to emit. These were: eye blinking, neck tightening and shoulder tension. In addition, sound stimuli in the form of street noise, radio and television were used during the study. Side interference was Wi-Fi signals and the radio signal affecting the connection of the Emotiv set to the computer via Bluetooth technology. The aim of the study was to reproduce the conditions of everyday life as faithfully as possible. Consequently, the focus was on generating movement commands using facial expressions rather than mental commands that can be difficult to implement. This is due to the concern for the greatest possible adaptation of the system to the needs of everyday life. Mental commands could be influenced by disturbances from the outside world and disturbances caused by the distraction of the subject. In the case of mental commands, the person must be clearly focused to generate the expected potentials. Unfortunately, it is not possible to maintain a full and continuous state of concentration in the tasks of everyday life.