An individualized electroencephalogram feedback driven predictability music closed-loop regulation method

CN122889271APending Publication Date: 2026-10-09UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611126004.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0008]本发明目的在于提供一种面向个体化的脑电反馈驱动可预测性音乐闭环调控方法,以解决现有技术中在神经解析、刺激建模、收敛评估三个关键环节中存在系统性不足,导致无法实现个体化、机制驱动且稳定收敛的音乐脑机闭环调控系统的技术问题

Benefits of technology

[0065]1)实现了基于神经预测编码机制的可解释性闭环调控,突破了传统“黑箱”建模的局限。与现有技术仅依赖主观评分或抽象机器学习特征不同,本发明将神经同步性(NeuralEntrainment)作为核心调控指标。通过锚定中央-顶叶区域β频段振荡这一生理学基础,直接量化大脑对音乐结构的“预测信号”生成与“预测误差”反馈过程。这种基于生理机制的指标构建,使得闭环系统不再是不可解释的数据拟合,而是能够精准干预大脑预测编码回路的机制驱动型调控,显著提高了神经调控的靶向性和生理学有效性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122889271A_ABST
    Figure CN122889271A_ABST
Patent Text Reader

Abstract

The application provides an individualized electroencephalogram feedback driven predictability music closed-loop regulation method, and belongs to the technical field of electroencephalogram signal processing. The method comprises the following steps: constructing a single-voice MIDI music segment set; selecting a final music material set from the single-voice MIDI music segment set by means of a fusion mechanism of an IDYOM model and a DDPM model; gradually presenting the final music material set to a subject; obtaining a neural response value of the subject based on music material listened to by the subject at present; calling a locally weighted regression smoothing fitting function and calculating an updated centroid position in stages, so that a music surprise degree index is gradually stabilized in a steady-state playing interval of the most significant individual beta neural response value, and closed-loop regulation of the individualized electroencephalogram driven music surprise degree is realized. The application solves the problem that a traditional model cannot process refined personal audio data, realizes more accurate and stereoscopic quantitative evaluation of individual music preferences, and ensures steady-state stability of the closed-loop system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of electroencephalogram (EEG) signal processing technology, music predictability modeling method, and neuromodulation technology, and particularly relates to a personalized EEG feedback-driven predictable music closed-loop modulation method. Background Technology

[0002] Music, as a multimodal stimulus with a high degree of temporal structure, profoundly influences the allocation of individual attentional resources during perception due to the predictability of its melodic direction, rhythmic patterns, and structure. Neuroscience research shows that the brain does not passively receive stimuli in music perception, but continuously generates internal predictions through predictive coding mechanisms. When there is a deviation between the actual auditory input and the prediction, a prediction error signal is generated; this process is closely related to neural oscillatory activity. (The parietal lobe region...) Frequency band oscillations have been shown to carry top-down predictive signals (S van Pelt, et al. (2016). "Beta-and gamma-band activity reflect predictive coding in the processing of causal events", Social cognitive and affective neuroscience), and form an interactive network with prediction error feedback, subjective pleasure experience, and reward system activation, thus providing a solid physiological basis for music predictive modulation using neural oscillations as an indicator.

[0003] Based on the aforementioned neural mechanisms, real-time neuromodulation technology is gradually developing towards "closed-loop adaptive control." Existing research has demonstrated that EEG characteristics (such as neural synchronicity) can be used to predict an individual's emotional response and engagement with music, providing a preliminary possibility for the dynamic regulation of musical stimuli. However, current technology still has the following key limitations:

[0004] First, neural regulation indicators lack mechanistic anchoring. Existing studies mostly rely on subjective ratings for offline modeling or use machine learning methods to extract abstract neural features. Although such methods have some effectiveness, they mostly belong to multi-feature black-box modeling frameworks, lacking a direct mapping between prediction error mechanisms and neural oscillations (L Schopp, et al. (2026). "Explainability in AI-enabled medical neurotechnology: a scoping review", Journal of NeuroEngineering and Rehabilitation), making it difficult to achieve explainable closed-loop regulation based on physiological mechanisms.

[0005] Second, music predictability modeling lacks a fusion of individualization and cultural universality. Existing statistical models (such as IDyOM) are based on a fixed MIDI format (Pearce & Wiggins, et al. (2012), "Auditory Expectation: The Information Dynamics of Music Perception and Cognition", "Topics incognitive science"), which mainly reflect the statistical patterns of groups and are difficult to combine with the audio that individuals frequently listen to, making it difficult to adapt to individualization. Current technologies have not yet effectively integrated "cultural statistical priors" and "individual experience modeling" into a collaborative mechanism.

[0006] Third, the closed-loop regulation process lacks a convergence quantitative assessment method. Existing EEG-BCI studies mostly focus on classification accuracy or short-term feedback effects, without defining clear convergence criteria or steady-state assessment indicators, making it difficult to quantitatively judge whether closed-loop regulation has reached a steady state (MP Kachhadia, et al. (2025), "Open-Loop and Closed-Loop Neuromodulation Across Neurological Disorders Toward Personalized BrainStimulation: A Narrative Review", Cureus).

[0007] In summary, existing technologies suffer from systemic deficiencies in the three key aspects of neural analysis, stimulus modeling, and convergence assessment, preventing the realization of a personalized, mechanism-driven, and stably convergent music brain-computer interface closed-loop modulation system. Therefore, it is necessary to propose an innovative closed-loop modulation method that combines neural mechanism indicators, personalized predictable music modeling, and convergence quantification assessment. This aims to address current technological bottlenecks and advance music closed-loop modulation from "association prediction" to "mechanism control." Summary of the Invention

[0008] The purpose of this invention is to provide a personalized EEG feedback-driven predictable music closed-loop modulation method to solve the technical problem that existing technologies have systematic deficiencies in the three key links of neural analysis, stimulus modeling, and convergence evaluation, which prevent the realization of a personalized, mechanism-driven, and stably converged music brain-computer closed-loop modulation system.

[0009] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:

[0010] A personalized EEG-feedback-driven predictable closed-loop music modulation method, the method comprising the following steps:

[0011] Step 1: Obtain from the dataset The first multi-part MIDI music file, processed using an improved skyline algorithm. Extracting monophonic melodies from a multi-part MIDI music file yields a set of monophonic MIDI music fragments. ;

[0012] Step 2: Calculate the set of monophonic MIDI music clips The mean surprise and mean uncertainty of all note events in each monophonic MIDI music segment are calculated using the IDYOM model, and structurally stable candidate materials are selected by using the variance of surprise within a sliding time window. The DDPM model is introduced to calculate the surprise level of each candidate track, and the music surprise level index is obtained by fusing the music surprise levels of the IDYOM and DDPM models through robust normalization and adaptive weighting mechanisms; in the candidate track set... The largest subset of candidate materials whose music surprise index and the average uncertainty calculated in the IDYOM model are significantly uncorrelated is determined as the final music material set. .

[0013] Step 3: Predictable Music Closed-Loop Control Process: During music control, the final music material set is gradually presented to the participants. Simultaneous acquisition of the subjects' electroencephalogram (EEG) signals ; Obtain its based on the music material currently being listened to by the subject The neural response value is used to calculate the centroid position by periodically applying a locally weighted regression smoothing fitting function and a uniform sampling grid. This allows for periodic updates to the centroid position, and parameter adjustments and convergence determination are made based on changes in the centroid position, gradually stabilizing the music surprise index at the individual level. The most significant steady-state playback range of neural response values ​​is identified, thereby achieving closed-loop control of personalized brainwave-driven musical surprise.

[0014] Furthermore, in step 1, an improved skyline algorithm is used to analyze the skyline. Extracting monophonic melodies from a multi-part MIDI music file yields a set of monophonic MIDI music fragments. Includes the following steps:

[0015] For each multi-part MIDI music file, perform operations such as removing bass notes, extracting horizon notes, trimming valid music segments, and completing brief silences to obtain a monophonic MIDI music segment. The first monophonic MIDI music clip constitutes a monophonic MIDI music clip set. ;

[0016] Step 1a: Remove bass notes: Iterate through all notes in the multi-part MIDI music file and remove notes whose pitch value is not greater than the pitch threshold. After filtering out the notes, a set of regular pitches is obtained;

[0017] Step 1b: Extract Skyline Notes: Group notes with the same start time from the regular pitch set into the same note group; for each note group, first filter out notes with intensity less than the intensity threshold. The weak note is then selected from the remaining notes, and the highest pitch note is chosen as the representative note of the same note group to obtain the skyline note.

[0018] Step 1c: Extract valid music segments: Detect silent intervals within the skyline notes; if the start time interval between adjacent notes exceeds a time threshold... If the time threshold is exceeded, it is determined that the time limit has been exceeded. The music segment is a silent segment; all consecutive notes before the first silent segment in a multi-part MIDI music file are retained, representing the valid music segment of the multi-part MIDI music file;

[0019] Step 1d: Complete the brief silence: Within the valid music segment, the starting time interval between adjacent notes is less than or equal to the time threshold. A brief period of silence is filled by extending the duration of the preceding note to create a monophonic MIDI music segment.

[0020] Furthermore, step 2 includes the following steps:

[0021] Step 2a: Calculate the average surprise and average uncertainty of all note events in the IDYOM model for each monophonic MIDI music segment;

[0022] Step 2b: Calculate the variance of the note information content of each monophonic MIDI music segment within the sliding time window;

[0023] Step 2c: Determine the sliding time window that minimizes the variance of the note information surprise sequence within the sliding time window for each monophonic MIDI music segment. If the minimum variance is less than or equal to the variance threshold, select all note events within the sliding time window with the minimum variance as candidate materials for that monophonic MIDI music segment; otherwise, discard that monophonic MIDI music segment, obtain the candidate material set, and calculate the average surprise and average uncertainty of the candidate materials in the candidate material set.

[0024] Step 2d: Calculate the surprise level of each candidate material based on the DDPM model;

[0025] Step 2e: Calculate the normalized surprise score of each candidate material in the IDYOM model and DDPM model, and fuse them to obtain the music surprise score index;

[0026] Step 2f: In the candidate material set The largest subset of candidate materials whose music surprise index and the average uncertainty calculated in the IDYOM model are significantly uncorrelated is selected as the final music material set. and the final music material set The musical surprise index of each piece of music is sorted from smallest to largest to obtain the musical surprise index set. .

[0027] Furthermore, in step 2d, each user's personal frequently listened music library is used as the DDPM training set. First candidate material The level of surprise is calculated as follows:

[0028]

[0029] in, For the first First candidate material The initial Mel spectrum; For the first First candidate material No. The noise state during the diffusion process at each time step; For the first Noise scheduling parameters for each time step; Indicates random noise; Indicates a Gaussian distribution. Represents the identity matrix; Indicates the first First candidate material No. Weighted noise prediction error at each time step; For the DDPM model, the first First candidate material No. Prediction of noise at each time step; For the first First candidate material No. Weight of each time step; Indicates the first First candidate material The overall sense of surprise within an individual musical space; This represents the selected set of diffusion time steps.

[0030] Furthermore, in step 2e, the first First candidate material The standardized surprise factor in the IDYOM model is calculated as follows:

[0031]

[0032] in, For the first First candidate material Normalized surprise of all note events in the IDYOM model; Represents the candidate data set for the IDYOM model. A set of surprise levels; Represents the candidate data set for the IDYOM model. The median of the set of surprise levels; Represents the candidate data set for the IDYOM model. The difference between the third quartile and the first quartile of the set of surprise;

[0033] No. First candidate material The standardized surprise factor in the DDPM model is calculated as follows:

[0034]

[0035] in, For the first First candidate material Normalized surprise of all note events in the DDPM model; Represents the candidate data set for the DDPM model. A set of surprise levels; Represents the candidate data set for the DDPM model. The median of the set of surprise levels; Represents the candidate data set for the DDPM model. The difference between the third quartile and the first quartile of the set of surprise;

[0036] No. First candidate material The fusion mechanism for normalized surprise levels between the IDYOM and DDPM models is defined as follows:

[0037]

[0038] in,

[0039]

[0040] in, For the first First candidate material The music surprise index obtained by fusing the IDYOM model and the DDPM model; For the weights of the IDYOM model, These are the weights for the DDPM model; This represents an empirical threshold.

[0041] Furthermore, step 3 includes the following steps:

[0042] Step 3a: Initialize sampling: in the music surprise set The first, last, and midpoint of the sampled music surprise indexes are used to obtain three music surprise indexes, which constitute the set of music surprise indexes sampled in the current round. and the set of sampled music surprise indexes The participants were gradually presented with musical materials corresponding to these three musical surprise levels, and their corresponding electroencephalogram (EEG) signals were collected simultaneously. To calculate the corresponding Neural response value; initial iteration count Total number of sampling points in the current round Total number of sampling points in all rounds ;

[0043] Step 3b: Local response-driven update: Select current The sampling point with the highest neural response value for the music surprise index was used as the sampling center. Take the sampled music surprise index set and the sampling center The nearest left and right neighboring points' musical surprise index and Interpolation sampling is performed separately to obtain two sampling points for the music surprise index, and the total number of sampling points for the current round is updated. Total number of sampling points in all rounds , No. Round of sampled music surprise index set and the set of sampled music surprise indexes ;

[0044] Step 3c: Determine the total number of cumulative sampling points in the current iteration round. Has the preset quantity threshold been reached? If the preset quantity threshold is not reached, continue to step 3b; otherwise, proceed to step 3d.

[0045] Step 3d: Re-estimation of the centroid position of the staged neural response: based on the sampled music surprise index set and its corresponding We weight the neural response values, perform local weighted regression smoothing, and calculate the centroid position of the neural concentrated response in the current iteration. Update iteration count;

[0046] Step 3e: Steady-state detection and convergence determination: Determine whether the centroid position of the concentrated neural response in the current iteration has converged. If it has converged, the position of the most concentrated centroid is obtained. If the first step is 3h, proceed to step 3f; otherwise, proceed to step 3f.

[0047] Step 3f: Sampling center offset detection: Determine the current centroid position With the current sampling center Does the distance exceed the offset detection threshold? If the sample size exceeds the limit, skip sampling will be performed, and the sampling center will be adjusted accordingly. Updated to the current centroid position Execute step 3g; otherwise, maintain the current sampling center. No change, proceed directly to step 3g;

[0048] Step 3g: Sparse Region Detection and Compensation: If multiple consecutive sampling center offset detections fail to trigger skip sampling, then sparse region compensation is performed to update the total number of sampling points in the current round. Total number of sampling points in all rounds , No. Round of sampled music surprise index set and the set of sampled music surprise indexes Proceed to step 3c;

[0049] Step 3h: Steady-state regulation: at the centroid location where the neural response is most concentrated after convergence. Music is continuously played within the nearby range, and the steady-state playback range is: , This indicates the threshold of the stable control range, completing the closed-loop control of the music.

[0050] Furthermore, step 3d includes the following steps:

[0051] Step 3d1: Constructing the music source material for each piece Weights of neural responses;

[0052] Step 3d2: Construct a locally weighted regression smoothing fitting function;

[0053] Step 3d3: Based on the locally weighted regression smooth fitting function, within the range of the musical surprise parameter... Uniform sampling is performed on the surface to obtain uniform grid points. Then calculate the position of the centroid.

[0054] Furthermore, in step 3d1, the first Musical material of The weights of neural responses are calculated as follows:

[0055]

[0056] in, Indicate listening to the first The first piece of music material Weights of neural responses; Indicate listening to the first Musical material Neural response value; For the set of surprise indexes of sampled music middle The minimum value of the neural response. This represents the set of sampled music surprise indexes. The Middle The first piece of music material Neural response value To prevent tiny constants with zero weights.

[0057] Furthermore, in step 3d2, the formula for the locally weighted regression smoothing fitting function is:

[0058]

[0059]

[0060] in, Indicates the degree of surprise in the music. After local weighted regression smoothing Neural response estimates; These are the dynamic weighting coefficients for local regression; For smoothing bandwidth parameters; This indicates the musical surprise value that needs to be estimated for the smooth response. Indicates the first The sampling points for the musical surprise index of the first piece of music material.

[0061] Furthermore, in step 3d3, the formula for calculating the centroid position is:

[0062]

[0063] in, Indicates the position of the center of mass. This represents the set of sampled music surprise indexes. Minimum Musical Surprise Index; This represents the set of sampled music surprise indexes. The highest musical surprise index; This represents the set of sampled music surprise indexes. Musical Surprise Index Range Uniform grid points within; For uniform grid points Locally weighted regression smoothed The neural response estimate, where Z is the total number of points in the uniform grid.

[0064] Compared with the prior art, the present invention has the following beneficial technical effects:

[0065] 1) This invention achieves interpretable closed-loop modulation based on neural predictive coding mechanisms, overcoming the limitations of traditional "black box" modeling. Unlike existing technologies that rely solely on subjective ratings or abstract machine learning features, this invention uses neural entrainment as the core regulatory indicator. By anchoring the physiological basis of β-band oscillations in the central-parietal region, it directly quantifies the brain's generation of "predictive signals" and feedback of "predictive errors" in response to musical structures. This physiological mechanism-based indicator construction transforms the closed-loop system from uninterpretable data fitting into a mechanism-driven modulation capable of precisely intervening in the brain's predictive coding circuits, significantly improving the targeting and physiological effectiveness of neural modulation.

[0066] 2) A predictability modeling method integrating cultural statistical priors and individual experience is proposed. Addressing the limitation of the IDYOM model, which can only calculate cultural priors based on music sequences and lacks individual adaptability, this invention introduces the DDPM model to achieve spectral-level refined modeling of an individual's music library. By fusing the group statistical patterns represented by IDYOM with the individual spectral experience features represented by DDPM, a predictability index that considers both cultural commonalities and individual differences is constructed. This method solves the problem that traditional models cannot handle refined individual audio data, enabling a more accurate and comprehensive quantitative assessment of individual music preferences.

[0067] 3) An adaptive control strategy with convergent quantitative evaluation was established to ensure the steady-state stability of the closed-loop system. Unlike traditional EEG-BCI studies that focus solely on classification accuracy while neglecting control effectiveness, this invention introduces sampling stagnation detection and sparse region compensation mechanisms into the closed-loop control logic. This not only provides a clear quantitative convergence criterion for determining whether the closed-loop control has reached a "steady state," but also effectively prevents the system from oscillating at local optima, ensuring the global coverage of the control process and the reliability of the final result. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0069] Figure 1 This is an overall flowchart of the personalized EEG feedback-driven predictable music closed-loop modulation method of the present invention.

[0070] Figure 2 This is a flowchart of the predictability fusion feature calculation process of the present invention.

[0071] Figure 3 This is a flowchart of the closed-loop control process of the present invention.

[0072] Figure 4 This is a schematic diagram for the quantitative evaluation of the regulatory effect of the present invention. Detailed Implementation

[0073] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0074] This invention proposes a personalized EEG feedback-driven predictable closed-loop music modulation method, such as... Figure 1 As shown, the method includes the following steps:

[0075] Step 1: Obtain from the dataset The first multi-part MIDI music file, processed using an improved skyline algorithm. Extracting monophonic melodies from a multi-part MIDI music file yields a set of monophonic MIDI music fragments. .

[0076] Specifically, data was obtained from three publicly available datasets: POP909, Pianist8, and GiantMIDI-Piano. First multi-part MIDI music file.

[0077] An improved skyline algorithm is used to extract monophonic melodies from the multi-part MIDI music file, resulting in a set of monophonic MIDI music fragments. Includes the following steps:

[0078] For each multi-part MIDI music file, perform operations such as removing bass notes, extracting horizon notes, trimming valid music segments, and completing brief silences to obtain a monophonic MIDI music segment. The first monophonic MIDI music clip constitutes a monophonic MIDI music clip set. .

[0079] Step 1a: Remove bass notes. Iterate through all notes in the multi-part MIDI music file and remove notes whose pitch value is not greater than the pitch threshold. The notes are filtered out to obtain a set of normal pitches, so as to eliminate the interference of the bass part played by the left hand on the main melody.

[0080] Step 1b: Extract Skyline Notes: Group notes with the same start time from the regular pitch set into the same note group; for each note group, first filter out notes with intensity less than the intensity threshold. The weak note is then selected from the remaining notes, and the highest pitch note is chosen as the representative note of the same note group to obtain the skyline note.

[0081] Step 1c: Extract valid music segments. Detect silent intervals within the skyline notes; if the start time interval between adjacent notes exceeds a time threshold... If the time threshold is exceeded, it is determined that the time limit has been exceeded. The music segment is a silent segment; all consecutive notes before the first silent segment in a multi-part MIDI music file are retained, representing the valid music segment of the multi-part MIDI music file.

[0082] Step 1d: Complete the brief silence. Within the valid musical segment, the starting time interval between adjacent notes is less than or equal to a time threshold. A brief period of silence is filled by extending the duration of the preceding note to create a monophonic MIDI music segment, thus ensuring the continuity of the generated melody.

[0083] Each monophonic MIDI music segment consists of a sequence of note events:

[0084]

[0085] in, Indicates the first First mono MIDI music clip, Indicates the first A musical note event, Indicates the first The total number of note events in the first monophonic MIDI music segment.

[0086] A collection of monophonic MIDI music clips is a collection of monophonic MIDI music clips. , means as follows:

[0087]

[0088] in, This refers to a collection of monophonic MIDI music clips.

[0089] Step 2: Calculate the set of monophonic MIDI music clips The mean surprise and mean uncertainty of all note events in each monophonic MIDI music segment are calculated using the IDYOM model, and structurally stable candidate materials are selected by using the variance of surprise within a sliding time window. Subsequently, the DDPM model was introduced to calculate the surprise level of each candidate track, and the music surprise level of the IDYOM and DDPM models was fused through robust normalization and adaptive weighting mechanisms to obtain a music surprise level index; in the candidate track set The largest subset of candidate materials whose music surprise index and the average uncertainty calculated in the IDYOM model are significantly uncorrelated is determined as the final music material set. .

[0090] like Figure 2 As shown, step 2 includes the following steps:

[0091] Step 2a: Calculate the average surprise and average uncertainty of all note events in the IDYOM model for each monophonic MIDI music segment.

[0092] Based on the IDYOM model (Information Dynamics of Music), this method uses MIDI file sets from publicly available datasets as training data to calculate and simulate long-term prior knowledge of human music culture acquisition. Building upon this, the monophonic MIDI music fragment set obtained in step 1 is calculated. The surprise and uncertainty of each monophonic MIDI music segment.

[0093] The IDYOM model estimates the probability distribution of the next note from multiple perspectives, including pitch, interval, duration, and dynamics. It is based on a multi-order Markov model and combines LTM (Long-Term Memory) and STM (Short-Term Memory) models. Specific metrics include surprise and uncertainty.

[0094] IDYOM model calculation The specific formulas for the surprise and uncertainty of the first monophonic MIDI music clip are as follows:

[0095]

[0096] in, The IDYOM model calculates the first... The first mono MIDI music clip The note event The degree of surprise at the occurrence; musical note events include combinations of four attributes: pitch, note duration, interval, and dynamics; This indicates that the IDYOM model predicts the first [number]th ... The note event The conditional probability; Indicates the current number The note event Previous note event sequence; Indicates the sequence of note events Given the condition, the complete set of all candidate note events at the next moment; express A single element from all possibilities represents a possible note event; Indicates the sequence of note events Under the condition, note event The conditional probability of occurrence; Indicates that for the first The first monophonic MIDI music clip, in the note event sequence Under the given conditions, the uncertainty in predicting the next note event.

[0097] Step 2b: Calculate the set of monophonic MIDI music clips Each monophonic MIDI music clip is within a sliding time window (each sliding time window has a fixed duration of...). The variance of the note information content of the surprise sequence (seconds).

[0098] No. The formula for calculating the variance of the note information content of the first monophonic MIDI music segment is as follows:

[0099]

[0100] in,

[0101]

[0102] in, For the first The first mono MIDI music clip The variance of the note information content within a sliding time window is used to measure the stability of the musical features within that sliding time window. For the first The first mono MIDI music clip The number of note events per time window; Indicates the first The first mono MIDI music clip Time window The set of indexes of musical note events appearing within; No. The first mono MIDI music clip The average level of surprise within a time window; For the first The first mono MIDI music clip The first time window The start time of each note event. Indicates the first The first mono MIDI music clip The start time of the first note event within each time window. This represents the fixed duration of each sliding time window.

[0103] Step 2c: Determine the sliding time window that minimizes the variance of the note information surprise sequence within the sliding time window for each monophonic MIDI music segment. If the minimum variance is less than or equal to the variance threshold, select all note events within the sliding time window with the minimum variance as candidate materials for that monophonic MIDI music segment; otherwise, discard that monophonic MIDI music segment, obtain the candidate material set, and calculate the average surprise and average uncertainty of the candidate materials in the candidate material set.

[0104] For each monophonic MIDI music segment, the sliding time window with the smallest variance in the amount of note information within the sliding time window is considered the most stable segment, and all note events within the sliding time window with the smallest variance have stable structural characteristics.

[0105] No. The sliding time window with the smallest variance of the note information content of the first monophonic MIDI music segment across all sliding time windows is determined as follows:

[0106]

[0107] in, Indicates the first The slide time window with the smallest variance in the amount of note information in the first monophonic MIDI music clip across all slide time windows is the one with the lowest variance in the sequence. Indicates the first In the first monophonic MIDI music clip, iterate through each sliding time window and take the minimum value of the target condition.

[0108]

[0109] in, Indicates the first First candidate material Indicates the first The set of note event indices that appear within the sliding time window with the smallest variance in the first monophonic MIDI music segment; Indicates the first The variance of the note information content within the sliding time window that minimizes the variance of the first monophonic MIDI music segment; The variance threshold representing the information content of a musical note sequence.

[0110] All candidate materials constitute the candidate material set. ,in, Indicates the number of candidate materials.

[0111] No. First candidate material The average surprise and average uncertainty of all note events in the IDYOM model are calculated as follows:

[0112]

[0113] in, Indicates the first First candidate material Average surprise of all note events in the IDYOM model; Indicates the first First candidate material The number of musical note events; Indicates the first The first candidate material corresponds to the first monophonic MIDI music segment. The note event The level of surprise that appeared; Indicates the first The average uncertainty of the first candidate material corresponding to a monophonic MIDI music segment across all note event sequences.

[0114] Step 2d: Calculate the surprise level of each candidate material based on the DDPM model.

[0115] A surprise verification model based on the Diffusion Probability Model (DDPM) is introduced. Each user's personal frequently listened music library is used as the DDPM training set to learn the individual's music probability density space.

[0116] No. First candidate material The level of surprise is calculated as follows: The first... First candidate material Converted to standardized Mel spectrum and in the diffusion time step Adding noise to obtain the noise state The pre-trained DDPM model is used to denoise and predict noise in a personalized model trained based on each user's personal music library. And calculate the prediction error term for each time step. Finally, obtain the prediction error term for the first time step. First candidate material The overall surprise in individual musical spaces This is used to measure the degree of surprise of a piece of music within a user's personalized music probability density space. The specific formula is as follows:

[0117]

[0118] in, For the first First candidate material The initial Mel spectrum; For the first First candidate material No. The noise state during the diffusion process at each time step; For the first Noise scheduling parameters for each time step; Indicates random noise; Indicates a Gaussian distribution. Represents the identity matrix; Indicates the first First candidate material No. Weighted noise prediction error at each time step; For the DDPM model, the first First candidate material No. Prediction of noise at each time step; For the first First candidate material No. Each time step weight (automatically determined by the scheduler, used to adjust the importance of different time steps); Indicates the first First candidate material The overall surprise level in an individual musical space, i.e. the total noise prediction error over all time steps, indicates the greater the surprise level of the current musical information; This represents the selected set of diffusion time steps.

[0119] Step 2e: Calculate the normalized surprise level of each candidate material in the IDYOM model and DDPM model, and fuse them to obtain the music surprise level index.

[0120] To comprehensively utilize the surprise factor provided by the IDYOM model and the DDPM model, the candidate data set... The surprise values ​​output by the two models were then subjected to robust scaling to obtain the standardized surprise values.

[0121] No. First candidate material The standardized surprise factor in the IDYOM model is calculated as follows:

[0122]

[0123] in, For the first First candidate material The normalized surprise of all note events in the IDYOM model, representing The result after robust standardization; Represents the candidate data set for the IDYOM model. A set of surprise levels; Represents the candidate data set for the IDYOM model. The median of the set of surprise levels; Represents the candidate data set for the IDYOM model. The difference between the third quartile and the first quartile of the set of surprise.

[0124] No. First candidate material The standardized surprise factor in the DDPM model is calculated as follows:

[0125]

[0126] in, For the first First candidate material The normalized surprise level of all note events in the DDPM model, representing The result after robust standardization; Represents the candidate data set for the DDPM model. A set of surprise levels; Represents the candidate data set for the DDPM model. The median of the set of surprise levels; Represents the candidate data set for the DDPM model. The difference between the third quartile and the first quartile of the set of surprise.

[0127] Subsequently, to address the normalized surprise of the IDYOM and DDPM models after robust normalization, the following adaptive fusion mechanism is constructed: when the normalized surprise of the IDYOM model exceeds an empirical threshold... When the condition is met, it indicates that the IDYOM model lacks effective prior experience with the current music sequence, and the DDPM model (with a weight of 1) completely dominates; otherwise, the contribution weights of the two models are set to... and ,in and satisfy The final musical surprise index is obtained after fusion. .

[0128] No. First candidate material The fusion mechanism for normalized surprise levels between the IDYOM and DDPM models is defined as follows:

[0129]

[0130] in,

[0131]

[0132] In the above formula, For the weights of the IDYOM model, These are the weights of the DDPM model. For the first First candidate material The music surprise index obtained by fusing the IDYOM model and the DDPM model; This represents an empirical threshold.

[0133] Step 2f: In the candidate material set The largest subset of candidate materials whose music surprise index and the average uncertainty calculated in the IDYOM model are significantly uncorrelated is determined as the final music material set. .

[0134] In the candidate material set Select candidate materials Music Surprise Index The average uncertainty calculated in the IDYOM model (See step 2c) The largest subset that satisfies significant discordance among the data points is determined as the final music material set. The criterion for determining significant irrelevance is set as follows: candidate materials Music Surprise Index with average uncertainty A Pearson correlation coefficient of not less than 0.05 indicates that the two sets of indicators are significantly uncorrelated.

[0135] The specific calculation and screening process is as follows:

[0136] set up For candidate material set Any subset of, satisfying The goal of the filtering is to find the selected material set. Maximum subset This ensures that it satisfies the musical surprise index of all candidate materials in the largest subset. with average uncertainty The Pearson correlation coefficient is greater than or equal to 0.05, and the formula for finding the optimal subset is defined as follows:

[0137]

[0138]

[0139] In the above formula, This represents the final music source set. Represents the candidate material set a subset of Representing a subset The total number of materials; Represents all subsets that satisfy the constraints In the process, the optimal subset with the largest number of elements is selected to ensure that the largest set of materials is the largest. Indicates the first First candidate material The musical surprise index; Indicates the first First candidate material The average uncertainty of a monophonic MIDI music segment across all note event sequences; Here are the constraints, where This represents the Pearson correlation coefficient, used to quantify the degree of linear correlation between two sets of indicators; Representing a subset The average of the musical surprise index for all materials in the video; Representing a subset The mean of the average uncertainty index of the music corresponding to all materials in the text.

[0140] Final Music Material Collection ,in, Indicates the final number of music files. This indicates the first [item] in the final music material set. First set of music materials; and the final set of music materials. The musical surprise index of each piece of music is sorted from smallest to largest to obtain the musical surprise index set. , Indicates the first The musical surprise index of the first piece of music material.

[0141] The calculation of this predictability fusion feature involves a variance threshold. Experience threshold Weights of the IDYOM model Weights of the DDPM model Variance threshold Depending on the pre-selected music library, it is recommended to choose 10% of the maximum variance of the pre-selected music library; empirical threshold. It is recommended to set it to 52, which is an empirical threshold; and It is recommended to set it to 0.5.

[0142] Step 3: Predictable Music Closed-Loop Control Process: During music control, the final music material set is gradually presented to the participants. Simultaneous acquisition of the subjects' electroencephalogram (EEG) signals ; Obtain its based on the music material currently being listened to by the subject The neural response value is used to calculate the centroid position by periodically applying a locally weighted regression smoothing fitting function and a uniform sampling grid. This allows for periodic updates to the centroid position, and parameter adjustments and convergence determination are made based on changes in the centroid position, gradually stabilizing the music surprise index at the individual level. The most significant steady-state playback range of neural response values ​​is identified, thereby achieving closed-loop control of personalized brainwave-driven musical surprise.

[0143] The sampling points, sampling center, and number of centroid iterations in the control process are defined as follows:

[0144] set up express The neural response estimates the centroid through iterations, updating its position only once per iteration. In the... In each iteration, the cumulative set of all music surprise index sampling points is denoted as:

[0145]

[0146] in, This represents the total number of sampling points in the current round, which is the number of sampling points in the current round. The number of sampling points for the musical surprise index obtained in each iteration. Indicates the first In the first iteration The musical surprise index of the first piece of music material Indicates the first The set of sampled music surprise indexes for the first round is... The cumulative set of sampling points for the music surprise index obtained during each iteration. This represents the total number of sampling points across all rounds, up to the current sampling point. The number of surprise index sampling points for all music materials listened to in each iteration; This represents the set of sampled music surprise indexes, up to the [number]th [item]. The system iterates through all currently listened music materials, accumulating a set of sampling points for the music surprise index. Indicates up to the number In the first iteration of all the music materials currently being listened to, the... The musical surprise index of the first piece of music material.

[0147] definition The current sampling center indicates the music currently being played. The sampling point with the highest neural response value, representing the musical surprise index, is continuously covered iteratively during the adjustment process. (Sampling Center) As of the end of the Iterate through all the sample points of the currently listened music material. .

[0148] like Figure 3 As shown, step 3 includes the following steps:

[0149] Step 3a: Initialize sampling: in the music surprise set The first, last, and midpoint of the sampled musical surprise indexes are used to obtain three musical surprise indexes, which constitute the first... Round of sampled music surprise index set and the set of sampled music surprise indexes The participants were gradually presented with musical materials corresponding to these three musical surprise levels, and their corresponding electroencephalogram (EEG) signals were collected simultaneously. To calculate the corresponding Neural response value. Number of iterations at this point. The total number of sampling points has been accumulated. , Initial sampling is performed only once.

[0150] Current number The first piece of music material corresponding to The specific calculation method for neural response values ​​is as follows:

[0151] For the first Musical material Corresponding EEG signals The process is divided into segments using sliding time windows, and the central-apical leaf is calculated within each time window. Frequency band power, the central-apical leaf region The method for calculating frequency band power is as follows:

[0152]

[0153] in, Indicates the central-parietal region Frequency band power; central-top leaf channel includes , , , EEG signals The Fourier transform form of .

[0154] Selecting music materials Inside The largest central-apical leaf in a sliding time window Frequency band power As the first Musical material of The neural response value was used to characterize the intensity of the subject's neural response to different predictable musical stimuli. The total duration of each musical piece was 25 seconds, the time window for each piece was 5 seconds, and the start time of each time window was 1 second apart.

[0155] Step 3b: Local response-driven update: Select current The sampling point with the highest neural response value for the music surprise index was used as the sampling center. Take the sampled music surprise index set and the sampling center The nearest left and right neighboring points' musical surprise index and Interpolation sampling is performed separately to obtain two sampling points, and the total number of sampling points in the current round is updated. Total number of sampling points in all rounds , No. Round of sampled music surprise index set and the set of sampled music surprise indexes .

[0156] Specifically, the interpolation sampling is as follows:

[0157]

[0158] in, and The distance from the current sampling center in the set of sampled music surprise indexes. The latest left and right neighboring point music surprise index, This indicates the next music surprise index sampling point obtained after interpolation sampling to the left of the music surprise index sampling center; This indicates the next music surprise index sampling point obtained after interpolation sampling to the right of the music surprise index sampling center. The total number of sampling points across all rounds is updated to ;No. Round of sampled music surprise index set Two additional sampling points were added for interpolation, and the sampled music surprise index set was also included. Two sampling points for interpolation are added.

[0159] Step 3c: Determine the total number of cumulative sampling points in the current iteration round. Has the preset quantity threshold been reached? If the preset quantity threshold is not reached, proceed to step 3b; otherwise, proceed to step 3d.

[0160] like If so, continue with the interpolation sampling in step 3b;

[0161] like Then proceed to step 3d.

[0162] Step 3d: Re-estimation of the centroid position of the staged neural response: based on the sampled music surprise index set and its corresponding We weight the neural response values, perform local weighted regression smoothing, and calculate the centroid position of the neural concentrated response in the current iteration. The number of updates and iterations is .

[0163] Step 3d1: Constructing the music source material for each piece Weights of neural responses.

[0164] Specifically, regarding musical materials The neural response values ​​are subjected to non-negative translation and normalization to obtain the neural response weights for the listened music material. Musical material of The weights of neural responses are represented as follows:

[0165]

[0166] in, Indicate listening to the first The first piece of music material Weights of neural responses; Indicate listening to the first Musical material Neural response value; For the set of surprise indexes of sampled music middle The minimum value of the neural response. Indicates the first The first piece of music material Neural response value, which is a set of sampled music surprise indices. The Middle The first piece of music material Neural response value To prevent tiny constants with zero weights.

[0167] Step 3d2: Construct a locally weighted regression (LOWESS) smooth fitting function.

[0168] The formula for the locally weighted regression smoothing fitting function is:

[0169]

[0170] in, Indicates the surprise level of a given piece of music. place ( For continuous values, (Discrete values), smoothed after local weighted regression Neural response estimates; The dynamic weighting coefficients for local regression are based on the given musical surprise level. With the Musical Surprise Index of the First Musical Material The distance is calculated using a cubic weighting function, as shown below:

[0171]

[0172] in, To smooth the bandwidth parameter, control the size of the local region; This indicates the musical surprise value that needs to be estimated for the smooth response. Indicates the first The sampling points for the musical surprise index of the first piece of music material.

[0173] Step 3d3: Based on the locally weighted regression smooth fitting function, within the range of the musical surprise parameter... Uniform sampling is performed on the surface to obtain uniform grid points. Then calculate the position of the centroid:

[0174]

[0175] in, This represents the set of sampled music surprise indexes. Minimum Musical Surprise Index; This represents the set of sampled music surprise indexes. The highest musical surprise index; This represents the set of sampled music surprise indexes. Musical Surprise Index Range Uniform grid points within; For uniform grid points Locally weighted regression Neural response estimate, where Z is the total number of points in the uniform grid. Indicates the position of the centroid, which is the first... When calculating the position of the secondary centroid The location where the neural response estimates are most concentrated is the center of the interval where the individual neural response has the most significant musical complexity, which is used to determine the interval where the neural response has the most significant musical complexity in a stable regulatory state.

[0176] Step 3e: Steady-state detection and convergence determination: Determine whether the centroid position of the current iteration's neural concentrated response has converged. If it has converged, obtain the most concentrated centroid position and execute step 3h; otherwise, execute step 3f.

[0177] when If so, proceed directly to step 3f;

[0178] when At that time, if Centroid position in the next iteration and Centroid position in the next iteration The absolute difference is less than the convergence threshold. , that is | - If | < δ, then the iteration is considered convergent, and the centroid location of the most concentrated neural response after convergence is obtained. If the condition is not met, proceed to step 3h for steady-state regulation; otherwise, continue to step 3f.

[0179] Step 3f: Sampling center offset detection: Determine the current centroid position With the current sampling center Does the distance exceed the offset detection threshold? If the sample size exceeds the limit, skip sampling will be performed, and the sampling center will be adjusted accordingly. Updated to the current centroid position Execute step 3g; otherwise, maintain the current sampling center. No change, proceed directly to step 3g.

[0180] Current centroid position With the current sampling center The distance is calculated as follows:

[0181]

[0182] in, Indicates the current position of the centroid. With the current sampling center The distance between them.

[0183] If the current centroid position With the current sampling center The distance between them exceeds the offset detection threshold ,Right now If this happens, skip sampling will be performed, and the sampling center will be updated. Then proceed to step 3g;

[0184] Otherwise, maintain the current sampling center. No change, proceed directly to step 3g.

[0185] Step 3g: Sparse Region Detection and Compensation: If multiple consecutive sampling center offset detections fail to trigger skip sampling, then sparse region compensation is performed to update the total number of sampling points in the current round. Total number of sampling points in all rounds , No. Round of sampled music surprise index set and the set of sampled music surprise indexes Proceed to step 3c.

[0186] To enhance the global coverage of the musical surprise space, a set of sampled musical surprise indices is calculated. The adjacent spacing of the music surprise index is determined by taking the interval with the largest adjacent spacing between adjacent music surprise index sampling points as the sparsest region, and taking the center of the sparsest region as the new sampling point after compensation.

[0187] Sampled music surprise index set The adjacent spacing of the musical surprise index is calculated as follows:

[0188]

[0189] in, Indicates the first The musical surprise index of the sampled points, Indicates the first The musical surprise index of each sampled point This represents the maximum value among the adjacent intervals of all adjacent music surprise index sampling points; This represents the operation of iterating through all combinations of adjacent sampling points and taking the maximum value of the adjacent spacing; after traversal, the sparsest region is denoted as... ; The musical surprise index represents the left endpoint of the sparsest region. The musical surprise index represents the right endpoint of the sparsest region.

[0190] Then the center of the sparsest region is used as the new sampling point after compensation:

[0191]

[0192] in, The new sampling points after sparse region compensation are updated, and the total number of sampling points in the current round is updated to... The total number of sampling points across all rounds is updated to . No. Round of sampled music surprise index set The new sampling points after compensation have been added to the sampled music surprise index set. New sampling points were added after compensation.

[0193] Step 3h: Steady-state regulation: at the centroid location where the neural response is most concentrated after convergence. Music is continuously played within the nearby range, and the steady-state playback range is: , This indicates the threshold of the stable control range, completing the closed-loop control of the music.

[0194] This closed-loop control involves preset quantity thresholds. Convergence threshold Offset detection threshold and stable control range threshold Offset detection threshold The recommended value is 0.3, which is the threshold for stable control range. The recommended value is 0.1, and the preset quantity threshold is [value missing]. The recommended threshold is 6 for convergence determination. The suggested value is 0.2, but it can be adjusted according to the overall range and breadth of the final music material set.

[0195] Step 4: Fit the optimal music complexity point of individual behavioral preferences through a behavioral preference rating task. Specifically, collect the individual's preference rating (out of 100) for the final music material set and the corresponding music surprise index. Plot the music surprise index on the horizontal axis and the preference rating on the vertical axis, and perform a quadratic function fitting (i.e., inverted U-shaped curve fitting, where the coefficient of the quadratic term is less than 0) on the individual's data. Solve for the music surprise index corresponding to the peak point; this is the optimal music complexity point of the individual's behavioral preferences. Then, the optimal complexity point for music based on individual behavioral preferences. The centroid location of the most concentrated neural response obtained after closed-loop modulation in step 3h. By comparing and calculating neurobehavioral consistency and other relevant quantitative indicators, the regulatory effect of the closed-loop regulation method can be quantified.

[0196] Figure 4 This is a schematic diagram of the evaluation result report obtained by assessing the closed-loop control effect of this invention. The report provides researchers with a series of quantitative indicators for quality assessment, which researchers can use for quality control. The specific indicators are as follows:

[0197] (1) The Neuro-behavioral Consistency Index (NCN) is defined as:

[0198]

[0199] in Indicates the consistency index of neurobehavioral behavior; This is the location of the centroid where the neural response is most concentrated after convergence; The optimal complexity point for music based on individual behavioral preferences; Final Music Material Collection The musical surprise index for the first piece of music in the text; Final Music Material Collection The Middle The musical surprise index of the first piece of music material.

[0200] A higher neurobehavioral consistency index indicates higher neurobehavioral consistency.

[0201] (2) The number of convergence steps (NCS) refers to the number of times the centroid position of the fitting is obtained during the sampling process. The absolute difference between the current centroid position of the neural response and the previous centroid position of the neural response is less than the convergence threshold. When convergence is reached, it can be determined that the convergence has occurred.

[0202]

[0203] in, Indicates the number of convergence steps; For the first Location of the centroid of the neural response in the next iteration; For the first Location of the centroid of the neural response in the next iteration; The convergence threshold represents the maximum allowable error.

[0204] (3) Peak Stability Index (PSI), defined as the degree of fluctuation of the peak value of the neural response during the convergence phase, is expressed as:

[0205]

[0206] in, Indicates peak stability index, This represents the total number of iterations. This represents the average centroid location for all iterative neural responses.

[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A personalized EEG feedback-driven predictable closed-loop music modulation method, characterized in that, The method includes the following steps: Step 1: Obtain from the dataset The first multi-part MIDI music file, processed using an improved skyline algorithm. Extracting monophonic melodies from a multi-part MIDI music file yields a set of monophonic MIDI music fragments. ; Step 2: Calculate the set of monophonic MIDI music clips The mean surprise and mean uncertainty of all note events in each monophonic MIDI music segment are calculated using the IDYOM model, and structurally stable candidate materials are selected by using the variance of surprise within a sliding time window. The DDPM model is introduced to calculate the surprise level of each candidate track, and the music surprise level index is obtained by fusing the music surprise levels of the IDYOM and DDPM models through robust normalization and adaptive weighting mechanisms; in the candidate track set... The largest subset of candidate materials whose music surprise index and the average uncertainty calculated in the IDYOM model are significantly uncorrelated is determined as the final music material set. ; Step 3: Predictable Music Closed-Loop Control Process: During music control, the final music material set is gradually presented to the participants. Simultaneous acquisition of the subjects' electroencephalogram (EEG) signals ; Obtain its based on the music material currently being listened to by the subject The neural response value is used to calculate the centroid position by periodically applying a locally weighted regression smoothing fitting function and a uniform sampling grid. This allows for periodic updates to the centroid position, and parameter adjustments and convergence determination are made based on changes in the centroid position, gradually stabilizing the music surprise index at the individual level. The steady-state playback range of neural response values ​​enables closed-loop control of personalized brainwave-driven musical surprise.

2. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 1, characterized in that, In step 1, an improved skyline algorithm is used to analyze the skyline. Extracting monophonic melodies from a multi-part MIDI music file yields a set of monophonic MIDI music fragments. Includes the following steps: For each multi-part MIDI music file, perform operations such as removing bass notes, extracting horizon notes, trimming valid music segments, and completing brief silences to obtain a monophonic MIDI music segment. The first monophonic MIDI music clip constitutes a monophonic MIDI music clip set. ; Step 1a: Remove bass notes: Iterate through all notes in the multi-part MIDI music file and remove notes whose pitch value is not greater than the pitch threshold. After filtering out the notes, a set of regular pitches is obtained; Step 1b: Extract Skyline Notes: Group notes with the same start time from the regular pitch set into the same note group; for each note group, first filter out notes with intensity less than the intensity threshold. The weak note is then selected from the remaining notes, and the highest pitch note is chosen as the representative note of the same note group to obtain the skyline note. Step 1c: Extract valid music segments: Detect silent intervals within the skyline notes; if the start time interval between adjacent notes exceeds a time threshold... If the time threshold is exceeded, it is determined that the time limit has been exceeded. The music clip is a silent clip; Preserve all consecutive notes before the first silent segment in a multi-part MIDI music file, representing the valid music segment of the multi-part MIDI music file; Step 1d: Complete the brief silence: Within the valid music segment, the starting time interval between adjacent notes is less than or equal to the time threshold. A brief period of silence is filled by extending the duration of the preceding note to create a monophonic MIDI music segment.

3. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 1, characterized in that, Step 2 includes the following steps: Step 2a: Calculate the average surprise and average uncertainty of all note events in the IDYOM model for each monophonic MIDI music segment; Step 2b: Calculate the variance of the note information content of each monophonic MIDI music segment within the sliding time window; Step 2c: Determine the sliding time window that minimizes the variance of the note information surprise sequence within the sliding time window for each monophonic MIDI music segment. If the minimum variance is less than or equal to the variance threshold, select all note events within the sliding time window with the minimum variance as candidate materials for that monophonic MIDI music segment; otherwise, discard that monophonic MIDI music segment, obtain the candidate material set, and calculate the average surprise and average uncertainty of the candidate materials in the candidate material set. Step 2d: Calculate the surprise level of each candidate material based on the DDPM model; Step 2e: Calculate the normalized surprise score of each candidate material in the IDYOM model and DDPM model, and fuse them to obtain the music surprise score index; Step 2f: In the candidate material set The largest subset of candidate materials whose music surprise index and the average uncertainty calculated in the IDYOM model are significantly uncorrelated is selected as the final music material set. and the final music material set The musical surprise index of each piece of music is sorted from smallest to largest to obtain the musical surprise index set. .

4. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 3, characterized in that, In step 2d, each user's personal frequently listened music library is used as the DDPM training set. First candidate material The level of surprise is calculated as follows: in, For the first First candidate material The initial Mel spectrum; For the first First candidate material No. The noise state during the diffusion process at each time step; For the first Noise scheduling parameters for each time step; Indicates random noise; Indicates a Gaussian distribution. Represents the identity matrix; Indicates the first First candidate material No. Weighted noise prediction error at each time step; For the DDPM model, the first First candidate material No. Prediction of noise at each time step; For the first First candidate material No. Weight of each time step; Indicates the first First candidate material The overall sense of surprise within an individual musical space; This represents the selected set of diffusion time steps.

5. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 4, characterized in that, In step 2e, the first First candidate material The standardized surprise factor in the IDYOM model is calculated as follows: in, For the first First candidate material Normalized surprise of all note events in the IDYOM model; Represents the candidate data set for the IDYOM model. A set of surprise levels; Represents the candidate data set for the IDYOM model. The median of the set of surprise levels; Represents the candidate data set for the IDYOM model. The difference between the third quartile and the first quartile of the set of surprise; No. First candidate material The standardized surprise factor in the DDPM model is calculated as follows: in, For the first First candidate material Normalized surprise of all note events in the DDPM model; Represents the candidate data set for the DDPM model. A set of surprise levels; Represents the candidate data set for the DDPM model. The median of the set of surprise levels; Represents the candidate data set for the DDPM model. The difference between the third quartile and the first quartile of the set of surprise; No. First candidate material The fusion mechanism for normalized surprise levels between the IDYOM and DDPM models is defined as follows: in, in, For the first First candidate material The music surprise index obtained by fusing the IDYOM model and the DDPM model; For the weights of the IDYOM model, These are the weights for the DDPM model; This represents an empirical threshold.

6. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 1, characterized in that, Step 3 includes the following steps: Step 3a: Initialize sampling: in the music surprise set The first, last, and midpoint of the sampled music surprise indexes are used to obtain three music surprise indexes, which constitute the set of music surprise indexes sampled in the current round. and the set of sampled music surprise indexes The participants were gradually presented with musical materials corresponding to these three musical surprise levels, and their corresponding electroencephalogram (EEG) signals were collected simultaneously. To calculate the corresponding Neural response value; initial iteration count Total number of sampling points in the current round Total number of sampling points in all rounds ; Step 3b: Local response-driven update: Select current The sampling point with the highest neural response value for the music surprise index was used as the sampling center. Take the sampled music surprise index set and the sampling center The nearest left and right neighboring points' musical surprise index and Interpolation sampling is performed separately to obtain two sampling points for the music surprise index, and the total number of sampling points for the current round is updated. Total number of sampling points in all rounds , No. Round of sampled music surprise index set and the set of sampled music surprise indexes ; Step 3c: Determine the total number of cumulative sampling points in the current iteration round. Has the preset quantity threshold been reached? If the preset quantity threshold is not reached, continue to step 3b; otherwise, proceed to step 3d. Step 3d: Re-estimation of the centroid position of the staged neural response: based on the sampled music surprise index set and its corresponding We weight the neural response values, perform local weighted regression smoothing, and calculate the centroid position of the neural concentrated response in the current iteration. Update iteration count; Step 3e: Steady-state detection and convergence determination: Determine whether the centroid position of the concentrated neural response in the current iteration has converged. If it has converged, the position of the most concentrated centroid is obtained. Execute step 3h; Otherwise, proceed to step 3f; Step 3f: Sampling center offset detection: Determine the current centroid position With the current sampling center Does the distance exceed the offset detection threshold? ; If the sample size exceeds the limit, skip sampling will be performed, and the sampling center will be adjusted accordingly. Updated to the current centroid position Execute step 3g; otherwise, maintain the current sampling center. No change, proceed directly to step 3g; Step 3g: Sparse Region Detection and Compensation: If multiple consecutive sampling center offset detections fail to trigger skip sampling, then sparse region compensation is performed to update the total number of sampling points in the current round. Total number of sampling points in all rounds , No. Round of sampled music surprise index set and the set of sampled music surprise indexes Proceed to step 3c; Step 3h: Steady-state regulation: at the centroid location where the neural response is most concentrated after convergence. Music is continuously played within the nearby range, and the steady-state playback range is: , This indicates the threshold of the stable control range, completing the closed-loop control of the music.

7. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 6, characterized in that, Step 3d includes the following steps: Step 3d1: Constructing the music source material for each piece Weights of neural responses; Step 3d2: Construct a locally weighted regression smoothing fitting function; Step 3d3: Based on the locally weighted regression smooth fitting function, within the range of the music surprise parameter. Uniform sampling is performed on the surface to obtain uniform grid points. Then calculate the position of the centroid.

8. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 7, characterized in that, In step 3d1, the first Musical material of The weights of neural responses are calculated as follows: in, Indicate listening to the first The first piece of music material Weights of neural responses; Indicate listening to the first Musical material Neural response value; For the set of surprise indexes of sampled music middle The minimum value of the neural response. This represents the set of sampled music surprise indexes. Middle The first piece of music material Neural response value To prevent tiny constants with zero weights.

9. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 8, characterized in that, In step 3d2, the formula for the locally weighted regression smoothing fitting function is: in, Indicates the degree of surprise in the music. After local weighted regression smoothing Neural response estimates; These are the dynamic weighting coefficients for local regression; For smoothing bandwidth parameters; This indicates the musical surprise value that needs to be estimated for the smooth response. Indicates the first The sampling points for the musical surprise index of the first piece of music material.

10. The personalized EEG feedback-driven predictable music closed-loop modulation method according to claim 9, characterized in that, In step 3d3, the formula for calculating the centroid position is: in, Indicates the position of the center of mass. This represents the set of sampled music surprise indexes. Minimum Musical Surprise Index; This represents the set of sampled music surprise indexes. The highest musical surprise index; This represents the set of sampled music surprise indexes. Musical Surprise Index Range Uniform grid points within; For uniform grid points Locally weighted regression smoothed The neural response estimate, where Z is the total number of points in the uniform grid.