After more than two months, I did not get this because I was working on socket some time ago. Now, it takes a few days to complete a small part. This section describes the relationships among α, β, Delta, θ, and other bands. Let's talk about the results of the past few days.
Last time, we analyzed the relationship between attention and meditation and fatigue. For example
The previous section on the curve has been briefly described. Now we need to note that the first half of the curve is a normal test, and the second part of the two pairs is a bit separated by simulating closed-eye rest, easy to fit. It can be seen whether or not the concentration and meditation are simple.
The next step is the other band. Here we will only list several influential band combinations.
Alpha/beta
Low-alpha/Theta
Alpha % (percentage of Alpha band in all bands)
Attention/meditation
Taking the first alpha/beta as an example, we can see that there are some noise points in it. It is about 601. We can remove vertices greater than 20 to obtain the following figure.
Now it's almost the same, and the other two are processed in this way, after noise removal. Have you ever seen such an image before? That's right. In the fourth section, we have already discussed how to deal with it. This is the same solution. A curve is generated. After the curve is obtained, we can analyze the relational images provided above. All the above images are drawn using the same group of test data. It can be seen that at 570 seconds, all values will have a slight upward trend. During that period of rise, we were just in the resting and relaxing state!
After analyzing the relationship between these bands and the degree of concentration and meditation, we can get a specific fatigue value from the data. These are all defined by yourself. The ratios obtained by different hardware may be slightly different. Some parameters need to be modified for the specific application. The data parameters obtained by my hardware are as follows:
1 double fatiguedetection: fd_getvalue () 2 {3 // The tested Alpha % low-A/Theta low-A/beta value range is 0 ~ 100 0: awake 100: fatigue 20: Generally, the value of 4 // meditation/attention is about 0.6 ~ Between 1.8 and 0.6 indicates waking 5 // The higher the Meditation level indicates fatigue 6 // The higher the attention concentration level indicates the more focused, the more sober 7 double result = 0.0; 8 result = (avg. alpha + avg. alphatheta + avg. alphabeta)/3 * (avg. meddivatt-1)/3) + 1); 9 fatiguevalue = result; 10 return result; 11}
There is no specific meaning for the formula, that is, simple weighting. The final fatigue value is shown as follows:
We can see that all the values produced by the hardware I use fall into the middle part, and the difference between them is not very large, the solution I came up with here is to use the exponential transformation method for enhancing contrast in image processing to enhance the degree of discrimination of values.
Another method is to use the KNN algorithm. The general idea is to use the indicators mentioned above for classification display. (These two solutions do not know when to explain them next time)
In the past few days, the previous code is encapsulated into a class for convenient calling.
1 class fatiguedetection 2 {3 Public: 4 fatiguedetection (INT vsize); 5 void fd_setvalue (INT at, int me, int de, int th, int al1, int Al, int be1, int Be2, int GA1, int ga2); 6 void fd_setvalue (struct fd_data); 7 void fd_setvalue (INT array [10]); 8 void fd_activewindow (struct fd_data data ); 9 void fd_compensation (struct fd_data data); 10 void fd_pretreatment (struct fd_data data); // pre-processing 11 void fd_printdebugmessage (File * FD); 12 // int fd_knn (); // perform KNN processing on several metrics 13 // If the curve distribution of the getvalue value is too concentrated, you can use the enhanced contrast method 14 double fd_getvalue () in image processing (); // return an integer of 15 private: 16 struct fd_data_do AVG; // used for Sliding Window 17 struct fd_data_do sum; // used for Sliding Window 18 double attention; 19 double meditation; 20 int size; // The Sliding Window Length, that is, the number 21 int window; // The number of currently available sliding windows 22 vector <struct fd_data_do> vdatado; 23 int ID; // 24 Double fatiguevalue indicates the total number of processed data; // The final fatigue value is 25 };
I don't know whether I have said that my algorithm is currently trying to solve this problem-checking the driver's fatigue status. We know that the driver sometimes gets tired and this is extremely dangerous. However, we cannot clearly know whether the person is tired. Of course we know continuous yawning. However, Brainwave Data is hard to be controlled by itself. Therefore, it is very useful to detect driver fatigue. But you can give a reminder when you are tired. What I'm working on now is someone else responsible for Android. Then the user carries the headset provided above. Send messages via Bluetooth. Once fatigue is detected, the mobile phone will give different prompts based on different degrees. On the one hand, I want to add a smart bracelet that is currently popular. Obtain heartbeat blood pressure and other physiological features, analyze them, calculate the fatigue value, and complement multiple indicators to improve accuracy. I think it is of great help to prevent the dangers caused by fatigue driving.
Address: http://www.cnblogs.com/wunaozai/p/3923649.html
Portals for each section:
Design of Fatigue Detection Algorithm Based on mindwave brainwaves (1)
Http://www.cnblogs.com/wunaozai/p/3677501.html
Design of Fatigue Detection Algorithm Based on mindwave brainwaves (2)
Http://www.cnblogs.com/wunaozai/p/3677554.html
Design of Fatigue Detection Algorithm Based on mindwave brainwaves (3)
Http://www.cnblogs.com/wunaozai/p/3678125.html
Design of Fatigue Detection Algorithm Based on mindwave brainwaves (4)
Http://www.cnblogs.com/wunaozai/p/3766779.html
Design of Fatigue Detection Algorithm Based on mindwave brainwaves (5)
Http://www.cnblogs.com/wunaozai/p/3923649.html