A. Introduction
Research Question: To what extent do the mean intensities of neural signals from different scalp locations (Channel 0 and Channel 1) differ when a subject is in a state of concentration compared to a state of relaxation?
This project utilizes the “EEG Brainwave Dataset: Mental State,” which was collected using a Muse EEG headband to record neural activity from four distinct electrode placements. To answer my research question, I will focus on a subset of variables that represent the physical state of the brain. The primary columns used are Label, which categorizes the subject’s mental state (0 for neutral, 1 for concentrating, and 2 for relaxed), and mean_0 and mean_1, which represent the average signal intensity from sensors on the TP9 and AF7 regions of the scalp. These variables are essential because they provide a direct quantitative measure of the brain’s electrical output, allowing for an analysis of how cognitive load changes physical signal patterns.
B. Data Analysis
In this section, I will perform exploratory data analysis to understand the distribution of brainwave intensities across the different categories. I will clean the dataset by filtering for only the specific mental states required for the research question: “Concentrating” and “Relaxed.” Finally, I will generate a boxplot to visualize the relationship between mental states and brainwave intensity.
Code Chunk 1: Setup and Import
# Load necessary libraries
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
# Import the dataset
eeg_data <- read.csv("mental-state.csv")
Chunk 2: Cleaning and EDA
# Check the dimensions of the dataset
dim(eeg_data)
## [1] 2479 989
# Get a summary of the brainwave mean intensities
summary(eeg_data$mean_0)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -35.22 18.75 23.55 23.61 27.77 94.85
Chunk 3: Data Transformation
# Filter to compare only 'Concentrating' (1) and 'Relaxed' (2) states
clean_eeg <- eeg_data %>%
filter(Label %in% c(1, 2)) %>%
select(Label, mean_0, mean_1, mean_2, mean_3)
Chunk 4: Data Mutation
# Convert numeric labels into descriptive text for the presentation
clean_eeg <- clean_eeg %>%
mutate(Mental_State = ifelse(Label == 1, "Concentrating", "Relaxed"))
Chunk 5: Visualization
# Create a boxplot to compare brainwave intensity across mental states
ggplot(clean_eeg, aes(x = Mental_State, y = mean_0, fill = Mental_State)) +
geom_boxplot() +
labs(title = "Brainwave Intensity: Concentrating vs. Relaxed",
x = "Mental State",
y = "Mean Intensity (Channel 0)") +
theme_minimal()
C. Conclusion and Future Directions
The results demonstrate a clear physical distinction between cognitive states. While the “Concentrating” state has a slightly lower median intensity ( 24), it is characterized by a very stable and tight distribution. In contrast, the “Relaxed” state shows a higher median (27) but is significantly more variable, featuring a wider range and multiple extreme outliers. This suggests that concentration involves more controlled, steady brain activity, while relaxation is marked by greater fluctuation and occasional spikes in neural intensity.
These findings prove that stability is a robust biomarker for concentration. For Brain-Computer Interface applications, a model should not rely on a single average value but rather on the consistency of the signal. This low variance provides a clear “feature” that can be used to automatically distinguish a focused mind from one that is wandering.
Future research should investigate the cause of high-intensity outliers during relaxation. I also plan to apply machine learning classifiers to determine if these stability patterns can reliably predict cognitive load in real-time.
D. References
Dataset Source: Bird, J. J. (2018). EEG Brainwave Dataset: Mental State. Kaggle Repository. https://www.kaggle.com/datasets/birdy654/eeg-brainwave-dataset-mental-state
Primary Research Paper: Bird, J. J., Manso, L. J., Ribeiro, E. P., Ekart, A., & Faria, D. R. (2018). A study on mental state classification using eeg-based brain-machine interface. 9th International Conference on Intelligent Systems (IS). IEEE.