$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
This study was conducted in accordance with the guidelines of the Ethics Committee of Quzhou University. The research protocol was approved by the Quzhou University Institutional Review Board (IRB) under approval number QZU-IRB-2026-037. All participants provided informed consent prior to their inclusion in the study.
Experimental preparation and participant recruitment
The experiment consisted of four stages (Figure 1): preparation, experimental design, model construction, and result analysis. In the preparation stage, research objectives were defined based on a review of literature on music therapy, EEG data acquisition, and deep learning models. In the experimental design stage, 30 healthy participants were recruited to perform music listening tasks. EEG signals and music familiarity ratings were recorded. EEG data were standardized and segmented into windows of 2048 samples with 1024 sample overlap. Familiarity features were combined with EEG data as model inputs. Two models, CNN+RNN and EEGNet, were constructed. CNN layers extracted time–frequency features, and bidirectional LSTM captured temporal dependencies. A fully connected layer with a softmax activation function was used for classification. Models were trained with a batch size of 50 for 30 epochs using the Adam optimizer. Dropout and early stopping were applied. Performance was primarily evaluated using Accuracy as the reported metric, with Precision, Recall, and F1-score metrics also calculated for additional evaluation.
Experimental environment and equipment set-up
The experiment was conducted in a quiet, enclosed room free from external interference, with the room temperature maintained at 27 oC. The following equipment was used: an EEG device (Muse S, InteraXon Inc.), a four-channel EEG system (TP9, AF7, AF8, TP10) with a sampling rate of 256 Hz; Final E3000 in-ear headphones; and a data acquisition computer running the Muse SDK and Lab Streaming Layer (LSL).
Before each experimental session, the ear-contact surfaces of the headphones were cleaned with alcohol to ensure hygiene and reduce the risk of cross-contamination. The Muse S headset was fitted to each participant, ensuring stable contact between all four dry electrodes (TP9, AF7, AF8, TP10) and the skin. If the signal quality was poor, the headband position was adjusted until stable signals were obtained. Participants were seated in a comfortable chair with back support and instructed to keep their eyes closed, avoid speaking, and minimize large body movements during the experiment.
Music stimuli preparation
Three music genres were prepared: rock, lyrical (ballad), and folk music. Each genre included three Chinese songs, for a total of nine songs. To control differences in music familiarity, songs in each genre were selected according to the following criteria: one old song; one current popular song (from the Spotify Top Songs chart); and one new song (from the Spotify New Releases chart).
Each song was edited into a standardized audio segment, starting from the introduction, followed by the verse, and ending at the first chorus, with a total duration of 90–130 s. A unique identifier was assigned to each song (e.g., R1–R3, B1–B3, F1–F3) for subsequent data labeling and file management.
Experimental procedure and questionnaire recording
Before the formal experiment, a volume test was conducted by playing a test audio clip. Participants adjusted the volume to a level that was clear, comfortable, and not excessively loud, and kept it constant throughout the experiment. The playback order of the nine songs was randomized (e.g., using a random number table or software randomization) to reduce order effects. All participants completed the music-listening tasks independently. Each music segment was presented from the introduction through the first chorus, lasting 90–130 s. A 30-second rest period was provided between songs. During this interval, participants completed a familiarity questionnaire using an online platform (Questionnaire Star). Participants rated their familiarity with each song using a five-point Likert scale (1 = completely unfamiliar; 5 = very familiar). The participant’s preference label for each song was recorded (0 = dislike; 1 = like) according to the predefined binary classification scheme. The complete experimental procedure is illustrated in Figure 2.
EEG acquisition and data logging
EEG data were acquired using the official Muse SDK and streamed via the Lab Streaming Layer (LSL). The EEG data corresponding to each song were saved as Comma-Separated Values (CSV) files, containing at minimum the following fields: timestamp (milliseconds); raw EEG signals from four channels (TP9, AF7, AF8, TP10); manually recorded familiarity score (1–5); and preference label (0/1). A consistent file-naming convention was used (e.g., S01_R1.csv, indicating participant 01 and rock song 1) to facilitate automated processing and traceability.
Data preprocessing, normalization, and windowing
EEG signals were recorded using a Muse S four-channel EEG device with a sampling rate of 256 Hz, and custom programs were developed using the official development kit. Raw EEG data were acquired through the Lab Streaming Layer (LSL) and saved in CSV format. The CSV files included the following columns: timestamp (milliseconds), four-channel EEG values (TP9, AF7, AF8, TP10), user music familiarity ratings (1–5), and user music preference ratings.
The total number of data entries corresponds to multiple windows generated for each participant and each music piece, resulting in a large-scale dataset depending on the windowing scheme. In the original experiment, music preference was represented as a binary label (0 = dislike, 1 = like), which may lead to artificially high accuracy and limited model generalization.
To improve the practical significance of the prediction task, the preference labels were converted into a multi-level rating scale: 0 = Strongly Disagree; 1 = Disagree; 2 = Neutral; 3 = Agree; 4 = Strongly Agree.
Prior to machine learning, the data were standardized and segmented into windows of 2048 samples each, with 1024-samples overlapping between adjacent windows to preserve temporal continuity. Additionally, data augmentation was applied to increase the number of training samples and reduce the risk of overfitting.
Model architecture
The research model consisted of three convolutional layers, three pooling layers, and a fully connected layer. Max pooling was used for feature selection, dropout was applied to reduce overfitting, and the final output was generated using a softmax classification layer. Each input window included four-channel EEG signals (2048 samples per window) and a familiarity feature. The output represented a five-class preference rating. The architecture is shown in Figure 3, and model parameters are outlined in Table 2.
Model training and cross-validation
The dataset was randomly split into 80% for training and 20% for testing. Ten-fold cross-validation was applied, with one subset used for validation and the remaining nine for training in each iteration. This process was repeated ten times, and the results were aggregated. Training hyperparameters were set as follows: Epochs = 30; Batch size = 50; Optimizer = Adam; Loss function = categorical crossentropy; Evaluation metric = Accuracy. Model performance was recorded under EEG-only and EEG + familiarity conditions, both for all genres combined and for individual genres.
Statistical analysis methods
Data analysis was conducted using Python 3.10 with TensorFlow 2.12, Keras 2.12, and MNE-Python 1.3. Data processing and analysis were performed using Pandas 2.1 and NumPy 1.26. Performance metrics from the 10-fold cross-validation were aggregated, and mean and standard deviation values were calculated. Statistical comparisons between conditions were performed using paired t-tests or Wilcoxon signed-rank tests, with a significance level of P < 0.05.