scieee AI-readable full text Open interactive document viewer

Impression extraction for buildings by using EEG

Corominas Bosch, Mario

Full text

IMPRESSION EXTRACTION FOR BUILDINGS BY USING EEG DEPARTMENT OF SYSTEM DESIGN ENIGNEERING STUDENT: MARIO COROMINAS ADVISER: YASUE MITSUKURA JULY 2013 Contents 1 Introduction ..................................................................................................... 2 2 Background ...................................................................................................... 3 2.1 Introduction to EEG ................................................................................... 3 2.1.1 EEG Generation ................................................................................... 4 2.1.2 Brain Rhythms ..................................................................................... 4 2.2 MITSUKURA LAB’S background .................................................................. 5 3 Methods used .................................................................................................. 6 3.1 PCA – Principal component analysis .......................................................... 6 3.2 CV – Cross Validation ................................................................................. 7 3.3 LDA – Linear Discriminant Analysis ............................................................ 8 3.4 SVM – Support Vector Machine ................................................................. 8 3.5 BE – Backward Elimination ........................................................................ 9 4 Experiment .................................................................................................... 10 4.1 Definition ................................................................................................. 10 4.1.1 Study indoor or outdoor .................................................................... 11 4.1.2 Study buildings from different places ................................................ 12 4.1.3 Study real scenarios, pictures with/without manipulation ................ 13 4.1.4 Summary of final features ................................................................. 14 4.2 Preparation .............................................................................................. 16 4.2.1 Eight manipulated pictures ................................................................ 16 4.2.2 Program in MATLAB .......................................................................... 18 4.2.3 Questionnaire .................................................................................... 19 4.3 Experimental development ..................................................................... 20 4.3.1 Procedure of the experiment ............................................................ 21 4.3.2 Extracted data cleansing .................................................................... 22 4.4 Analysis and results ................................................................................. 22 4.4.1 Noise detection ................................................................................. 23 4.4.2 File organization ................................................................................ 24 4.4.3 Grouping ........................................................................................... 27 4.4.4 Initial conditions – variables set up and filter diagram sequence ...... 28 4.4.5 First classification method ................................................................. 30 4.4.6 Combination of frequencies from the first classification method ...... 39 4.4.7 Second classification method ............................................................ 41 5 Discussion ...................................................................................................... 44 6 Conclusion ..................................................................................................... 45 7 Bibliography ................................................................................................... 46 2 1 Introduction Nowadays, in the architecture there are a lot of subjective opinions about how beautiful or likeable they are. Only the judgment of respected people could be taken into account. However, to do this project we believe there could be a way to make a difference in this field. If there was any way to get an objective impression from buildings it would be a powerful tool in the architecture field. The objective impression from people should be directly extracted from their thoughts. That could sound like science fiction, but today it is possible in some specialized laboratories. The MITSUKURA LAB is specialized with the EEG non intrusive devices that measure a simple voltage difference from the frontal lobule part of the brain and the ear. From the frontal lobule it’s possible to detect the LIKE and DISLIKE feelings from people. So it was believed that doing the right experiments and analysis afterwards it could be a starting point for that previous idea commented in the last 2 paragraphs.  Objectives The objectives of this project would be the following ones: 1) Determine one’s preferences (like/dislike) on buildings by reading their brain waves. 2) Analyze different visual aspects on buildings that might be detected by reading the brain waves. 3 2 Background To understand the global importance of this project it should be necessary to introduce some of the concepts related with this study. It’s also important to understand the background of the MITSUKURA LAB not only for this project but also because it will give a deeper and wider vision of this field. 2.1 Introduction to EEG The concept of EEG started on 1875 when Richard Caton measured for the first time the brain activity in the form of electrical signals. The meaning of EEG would be Electro- (referring of the registration of electrical signals) Encephalo- (referring to emitting the signals from the head) and Gram (referring to drawing or writing). At the beginning the main purpose of studying and understanding the brain waves were for medical reasons. The epileptic seizure was one of those first targets to be focused by the study of EEG signals but after the 1950s they started to expand the investigations in other brain illnesses. From then, the study of neuronal activity has increased in many other fields and not only epileptic seizure but also for loss of conscience, behavioral disorder, sleep disorder or just to analyze the electrical activity in the brain. 4 2.1.1 EEG Generation An EEG is a current that flows during the synaptic excitations of the dendrites of many pyramidal neurons in the cerebral cortex. When the neurons are activated, a current goes through the dendrites and that current generates a magnetic field that can be measured. Our heads have some thick layers like the brain, the scalp and the skull; also there are some other thinner ones in between. There is a lot of noise created in the brain and outside external layers so it’s necessary to have a large number of neurons generating signal to get a recordable signal. Afterwards, those signals are greatly amplified. 2.1.2 Brain Rhythms There are brain rhythms on those electrical waves and it has already been tested and confirmed that there exist differences between wakefulness and sleep. The amplitudes and frequencies change from a human to another one. Those characteristics also change with the age. So the main brain frequencies that we could find are: a) Delta ()  0’5-4 Hz b) Theta ()  4-8 Hz c) Alpha ()  8-13 Hz d) Beta ()  13-30 Hz e) Gamma ()  30-45 Hz 5 2.2 MITSUKURA LAB’S background This lab is pioneer on this kind of researches. They always work with brain preferences, extracted from KANSEI (acquired after birth) and not with sensitivity (that would be acquired as an innate ability). Those preferences produce some Bio-signal waves that are possible to be detected by EEG. The biological signal permits to obtain a sequential measurement for each second and permits to avoid questionnaires. If the brain signal is correctly interpreted, the EEG is more reliable than a questionnaire. The EEG signals might be different varying on the people who are evaluated. Then it’s needed to have a easily wearing device like the one used in this project (a Hair-band type device) that doesn’t need gel and it can be used in anyplace at anytime. This device permits to measure a simple signal without stressing the participant and it’s particularly useful to do multiple experiments at different times (and for short duration). MITSUKURA LAB’s EEG device 6 There is also needed a strict signal processing and a signal processing that takes into consideration individual differences. The application of MITSUKURA LAB researches are some as Acoustic sense recognition (preferences on music), Taste sense recognition, Haptic recognition, Visual recognition & acoustic recognition (degree of interest in TV commercial evaluation, stress degree evaluation, sleepiness degree evaluation). 3 Methods used In the experiment chapter there are some methods used that should be introduced before. Here it will be a very short introduction to all of them so the reader can get familiarized with them. 3.1 PCA – Principal component analysis PCA is mathematically defined as an orthogonal linear transformation that transforms the data to a new coordinate system such that the greatest variance by any projection of the data comes to lie on the first coordinate (called 1st PCA), the second greatest variance on the second coordinate, and so on. 7 This method converts a set of observations that might be correlated into a set of linearly uncorrelated variables. It’s a very useful tool in signal processing and almost in all researches is needed. 3.2 CV – Cross Validation This method is a practical technique to repeat a set of experiments and give a reliable result. The basis is to separate the whole data participating on the experiment in small even groups. When the experiment is ongoing, there should be as many repetitions as groups. In each repetition there is a different group as a testing data and the rest of them as training data. Usually, in statistics, the whole amount of data is divided by 20 different groups so each repetition there is a 5% of data treated as testing and 95% as training. PCA of a scatter plot. The vectors shown are actually eigenvectors of the covariance matrix 14 4.1.4 Summary of final features After looking at those parameters and deciding which will be the initial conditions it seems to be that the experiment will be done within the following aspects:  It will be an outdoor scenario. Just one picture from a building that will be modified to obtain new different pictures that will be evaluated in the experiment. At this point it was necessary to define which aspects of the picture would be manipulated. To decide the main aspects to study, it was an accord between the weekly meetings and the verification of the professor Almazán (Architect from Keio University, Architecture studiolab). Those variables have been selected due to their simplicity to visualize and easy to manipulate. So the main aspects to consider in the modifications were 3: 1) Green: one half of the pictures would be with a lot of green (trees and grass) around the house and the other half without it. 2) Color: one half of the pictures would be with a cool color and the other half with calm color 3) Windows: one half would be with a lot of windows and the other one without windows. 15 So the final combination between those 3 variables would be like the following table shows: rows: Color Green Windows 1 calm yes yes 2 calm yes no 3 calm no yes 4 calm no no 5 cool yes yes 6 cool yes no 7 cool no yes 8 cool no no So that makes a total of 8 different pictures that are necessary to be manipulated. The idea is that all of them come from the same background so the differences between those pictures are mainly the ones defined in the table above. There was a painstaking research looking for a real building but easy to manipulate in the internet and finally it was chosen this one: Original picture 16 4.2 Preparation For the preparation for the experiment there were 3 different aspects to get ready. One would be to prepare the 8 pictures that were defined in the definition process; another one would be to prepare the program in MATLAB and the last one to prepare the questionnaire to be answered for each picture. So the following points of this report would be about those 3 issues that needed to be done. 4.2.1 Eight manipulated pictures To do the manipulations on that original picture it was used the Photoshop CS6. A previous training had to be done to learn how to use the basic and more useful tools of Photoshop. After a week all the pictures were done. Those were the results: rows: Color Green Windows Result ORIGINAL 1 calm yes yes 17 2 calm yes no 3 calm no yes 4 calm no no 5 cool yes yes 6 cool yes no 18 7 cool no yes 8 cool no no 4.2.2 Program in MATLAB The idea for the experiments was to show the 8 pictures in a random sequence to make sure that there couldn’t be any correlation in between the order of the pictures and the like/dislike preferences. This was the main reason to decide to use MATLAB as the photo player. To make the program it was important to take into account: a. RANDOMLY The pictures should be selected randomly and the program should make sure that only 8 pictures would be displayed without repeating any of them. b. ROUTINE FOR EACH PICTURE There should be 10 seconds of white screen before and after the 10 seconds of picture. Also a countdown could be included to let the person doing the experiment know that the next routine is coming. c. MANUAL PAUSES 19 As the participant should be able to answer the questionnaire after each picture, a manual pause should exist. The program needs to be activated manually to start the next routine for each picture. d. RECORD SEQUENCES The program should be able to record the order of the sequence that the random function is creating. This is very important to pair the questionnaires and brain waves records with the corresponding picture. 4.2.3 Questionnaire This should be done in the computer first and they should be printed afterwards. The idea was that each participant had the questionnaire in paper in front of them so they could easily answer them while watching the experiment on the computer’s screen. The most important features to include in the questionnaire were already decided when choosing the variables to modify on the original picture. Some essential questions would be the ones related with the modified variables. So the questionnaire was the following one: 20 As it is possible to see in the figure above is there are 2 different kinds of ratings. The 1st one is numerical and it has 4 different fields (green, color, windows and overall). This kind of questionnaire is called Semantic Differential Questionnaire (SDQ) and it’s commonly used for this purpose. There are 7 different options for each field. All the participants were told that the left side of the answers represents LIKE and the right represents DISLIKE (except for Color), so the 0 means neutral option. The 2nd one is open, free answer. This option was hold in case a large amount of participants answered similar words or topics. As we will discuss later, it wasn’t possible to take benefit from it. 4.3 Experimental development As each experiment used 8 pictures and each picture recorded 10 useful seconds of brain wave activity while watching it, each experiment provided 80 seconds of data (80 data). Therefore, it was considered than 20 experiments (20*80 = 1.600 data) would be enough data. For commodity and manageability the participants were actually people from the same laboratory. However, just 10 people collaborated with this project but each of them repeated the experiment a 2nd time some weeks later (so finally it was 10 people * 2 times = 20 experiments). There was a recommendation to use both male and female so the experiments would be more randomly chosen (not just male or just female). To make it even there were 5 males and 5 females. The names of the participants are included in the thanks page of this project. 21 4.3.1 Procedure of the experiment For the experiment 2 laptops were used. One of them would have the role to run the MATLAB program (the one that the participant would look at). The other one would be recording the signal waves collected from the EEG device by running the program MinDSensor5. So in the first laptop the collaborator should be sitting in front of it, while the person in charge of the project should be sitting in front of the other one. The idea was that the participant only needed to focus on the pictures and questionnaires. The other in charge should be pausing and starting the MATLAB program. As it was considered especially useful to get the data separated from each picture, the MinDSensor5 had to be also controlled by the person in charge. There are some pictures of how it was managed. A participant is looking at the picture in the middle of the experiment. The person in charge needs to pay attention at pause and start the 2 programs. 22 4.3.2 Extracted data cleansing As the person in charge can see the seconds that the MinDSensor5 program has been recording, he might take notes of noise, offset values and check if there should be an invalid experiment. The results from that manual quality filter there where many records that had to be modified because of the mismatch of offset values (bad synchronization between the programs). Also, 2 experiments had to be deleted due to the noise; once because of too much blinking and the other one because there was bad contact between the device and the participant. In addition, 2 picture records from 1 experiment had to be deleted due to coughing. So finally, the data that was good enough to be used was 1.600 seconds – 80seconds * 2 experiments – 10 seconds * 2 pictures = 1.420 valid data 4.4 Analysis and results In this section we will see the analysis history that had this project. The contents of this chapter have a combination of analysis and results. The point of this section is to be explained the same way it was thought when working on those analysis so it might be easier for the reader to follow and comprehend the reasons and explanations. So now it would probably be a good idea to continue the explanation separated by small different steps. 23 4.4.1 Noise detection The first thing that was performed in the analysis program was the PCA method. As our data have a lot of noise due to blinking and other external reasons, it is necessary to cleanse them. The PCA doesn’t eliminate the noise directly; this method just gives us a new perspective of the data converting them to uncorrelated data. When this is done, the new data have new coordinates but the relative distance between them haven’t changed. At the same time that those new coordinates are given, the function that endures the PCA also provides the eigenvalues of the PCA matrix (NxN). That matrix NxN comes from the N variable matrix where the columns N represent the Frequency. Those eigenvalues mean the weight that each Hz has and, therefore, they say how important will be each frequency for the new values. To the right side there is the example that was obtained from the experiment. If we pay attention to those eigenvalues we will see that the first one is wide larger than the other ones. Specifically, it means that the frequency 4Hz would matter 9’5 times (157’0/16’6 = 9’5) more than the 5Hz. The 4Hz would accumulate the 75% over the total weight of 19 frequencies. Thanks to the experience in Mitsukura LAB, it is known that the 4Hz usually come from blinking and it is noise that should not be taken into account. This high value on 4Hz would be very hard to explain otherwise and only noise could get it that high. Eigenvalues table result 30 - About the 2nd choice of variables. Linear or quadratic. This is specifically from the LDA classification method. When the function is used, the variable of linear or quadratic can be set up. Only one of them can be set up at a time. - About the 3rd choice of variables. In this diagram it’s possible to see 2 repeated blocks of 6 rows each block. If we focus only on the first block it’s possible to understand that each row represents the answer selected by the participant in the questionnaire. There are 2 types of data, LIKE or DISLIKE. LIKE would be represented on the left side while the DISLIKE on the right side. The green highlighted color means that for that combination the numbers highlighted are chosen. The red colored numbers are discarded in the filter. Only one row can be selected at a time. Those 6 rows and the combinations were discussed and approved by the weekly meetings. It was taken into account that always there should be a difference of 3 numbers in between the LIKE and DILSIKE choices. So if the whole diagram is read for the first option of each group of variables it would be something like… - “All the pictures evaluated on Windows, with linear LDA option, that have a punctuation of 3 or 2 on the left side of 0 would be accepted as LIKE data while the 3 or 2 on the right side of 0 would be accepted as DISLIKE data.” 4.4.5 First classification method As it was the first time to actually get some results, the variables to look at the output were just some basic: the error coming from training data and recognition rate from testing data. The LDA function (classify in MATLAB) gives the error produced by the classification of the sample data 31 directly, so this one was the first output to check. In addition, they gave the recognition results obtained from the testing data. With those recognitions results there is just need to review the labels from each testing original data and then it’s possible to get the recognition rate. As it has been seen previously in the last step, the diagram for the LDA is the following: So there were 48 different starting conditions and one different result for each of them. The results were saved in an Excel sheet where the first 3 columns were the variables selection. The column “filter” is referred to the 3rd group of variables and each number means the following... Diagram for the LDA 32 The combination shows the numbers that represent the boundaries of the elimination group of data in the filter script. The other 4 columns are for the results. The first pair is referred to the error that has been committed (with noise and without noise). The second pair is for the recognition rates (with noise and without noise). Each time the Main Script runs, it calculates the classification results for both paths (eliminating the noise and without eliminating it). 3 2 1 0 1 2 3 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 Questionnaire answers MATLAB interpretation Filter combination = 53 Filter combination = 42 Filter combination = 64 Filter combination = 52 Filter combination = 63 Filter combination = 62 33 So after running the MATLAB program the results were collected in an Excel sheet and arranged from highest recognition rate without noise to the lowest one (the first 24 results are shown). From these results there are a lot of observations: - First of all, the recognition rates are quite high taking under consideration that the errors are really high. However, if this first observation isn’t completely understood (at least for this moment) it’s possible to check the others observations. - It seems there might be a relation between Overall and the combination 42 of the filter and the high recognition rate. - The next topics with also a great recognition rate are the ones with Windows and quadratic order. It might be interesting to look at the plots. 34 - Generally, looking at the pair of columns of the error, the one calculated when the noise isn’t eliminated is higher than when it actually is. So it makes sense that the elimination of noise is beneficial to the classification. - Also, when looking for the recognition rate columns, the one with noise seems to have higher rates than the one without noise. This observation is very important because it can make us believe that the last paragraph isn’t 100% truthful. There is something missing in these explanations. Afterwards these observations, there were some recommendations from the weekly reports to look after separating the recognition rate by the different topics. In this case it should be the LIKE and DISLIKE classifications. So in the next time running the program there should be a difference between the recognition rate of LIKE and DISLIKE with noise and without noise. The error wasn’t considered anymore. The next experiment had new 4 columns. The first pair was for LIKE recognitions rates with and without noise and the second pair were for the DISLIKE recognition rates with and without noise. The results are shown in the following 2 figures. Table results arranged by recognition LIKE rate 35 The previous figure shows the first 15 results arranged from the highest LIKE recognition rates to the lowest ones (without noise). The previous figure shows the first 15 results arranged from the highest DISLIKE recognition rates to the lowest ones (without noise). From those 2 figures it’s possible to get some new observations… - In the first figure it’s possible to see really high values of recognition LIKE rates. They are over 90% and that is a lot. However, if we look at the same time at the recognition rate of DISLIKE it’s possible to realize that the recognition rate is almost the complementary of the LIKE rates. - In the second figures it’s possible to observe the same characteristic as in the first figure. The recognition rate on DISLIKE is very high, but the rate for LIKE is almost the complementary to it, so it’s kind of strange that this happens with all the rows in both figures. Probably a plot would help out a lot to find out what is going on. - If the recognitions were reliable, it would be possible to assure there is a relation between the high LIKE recognition rates and the Windows and quadratic variables. Table results arranged by recognition DISLIKE rate 36 - Again, if the recognitions were reliable, it would be possible to assure there is a relation between the high DISLIKE recognition rates and the Green and quadratic variables. - There is not much difference between the recognition rates with or without noise in both LIKE and DISLIKE. That makes sense with the 1st figure, where it was impossible to get conclusions about the difference between eradicating the noise or not. After those Excel tables it would be nice to see a graph. A plot gives a reallyquick overview of what it is going on. So it was decided, at this point, to plot the 1st and 2nd PCA for each like and dislike columns. The figure above is from the LDA quadratic method and is showing 2 plots; one from LIKE data (where the noise hasn’t been eradicated) and another one from DISLIKE data (where the noise hasn’t been eradicated neither). Scatter plot with LIKE and DISLIKE data separated and the LDA function in green color (with noise) 37 The figure above shows the same plots as before but without noise. It’s possible to see that the LDA quadratic separation line changed its shape between the last 2 figures. The observations from those last 2 figures would be the following ones… - First of all it has to be noticed that the noise makes the LDA experience some changes on its function. It would also be interesting for helping us to understand what is happening to check the variance from all those plots (it would be done after these observations). - If we focus on the couple of plots from the last figure it’s easy to understand what is happening with the recognition rates and the error. The LDA function is wrapping a vast majority of LIKE data without caring much about the nucleus of DISLIKE data (there are some spread data with high variance, but the majority of DISLIKE data is still in the center). So what happens is that the recognition rates of LIKE data are really high but on detriment of the DISLIKE ones. So there seems to be a correlation between those results: one would be the complementary of the other. Scatter plot with LIKE and DISLIKE data separated and the LDA function in green color (without noise) 38 After those observations are done, it was recommended to check the variances first. The Excel sheet of variances results was like this: We could focus only on the first row that corresponds to the lasts figures shown that we checked. However, in general, in all the rows it’s possible to see how much variance does the data has in the 1PCA if the noise isn’t removed. So this result will help the next studies in this project: the noise should be always removed. All those graphs were done 2 times, once taking into account the first 2 valid PCA (the graphs discussed in here are from this one) and another time with 3 PCA. In any case, the results ended up with the same observations so it would repetitive to show the graphs and results involving 3 PCA. Table results from LDA 39 4.4.6 Combination of frequencies from the first classification method The LDA couldn’t work very well so it was intended to use another more complex separation method. Although, before appealing to the next classification method, we wanted to give a chance to BE method to check if it the right combination of Frequencies could make any difference. The BE method was supposed to be applied to the combination of starting variables that provides the highest rates, so we did so. The BE need the starting variables to be fixed. So it was selected the following combination:  Topic rate? Windows  Order? Quadratic  Filter combination? Graph showing BE steps and results 46 7 Bibliography [1] Saeid Sanei and Jonathon Chambers. EEG Signal Processing. August 2009. [2] Jason Wetson. Support Vector Machine (and Statistical Learning Theory) Tutorial. 4 Independence Way, Princeton, USA. [3] S. Balakrishnama and A. Ganapathiraju. Linear Discriminant Analysis – A brief tutorial. Institute for Signal and Information Processing Department of Electrical and Computer Engineering. Mississippi State University. [4] John A. Putman M.A., M.S. Signal Processing Techniques. 2007. Support Internet websites: http://www.wikipedia.org/