Personalized music intervention system for adolescent depression
By dynamically generating personalized music based on the real-time calculation of adolescents' emotional state and ground state vector, this solves the problem that existing music intervention systems cannot quantify the elasticity of the emotional system, realizes the adaptive regulation of the emotional system and personalized music intervention, and improves the emotional regulation ability of depressed adolescents.
Patent Information
- Application Number
- CN202511641168.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-11
AI Technical Summary
Existing music intervention systems cannot quantify the emotional resilience of depressed adolescents in real time, nor can they dynamically modulate music to break emotional inertia and enhance the adaptive regulation ability of the emotional system. Furthermore, general music may be ineffective or have the opposite effect on depressed individuals.
The personalized music intervention system for adolescent depression is adopted. By collecting multimodal physiological and behavioral data, the system calculates the emotional state vector and emotional ground state vector in real time. The system uses the elasticity factor calculation module to dynamically generate the target music entropy value, drives the controllable artificial intelligence music generation engine to generate personalized music fragments, and optimizes the intervention parameters through the adaptive optimization module.
It enables modulation in the early stages of a deteriorating mood, avoiding secondary harm caused by excessive music information load, improving user experience, and ensuring that music intervention programs are fully personalized and dynamically adaptable to individual emotional changes.
Smart Images

Figure CN121081809B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of healthcare informatics, and in particular to a personalized music intervention system for adolescents with depression. BACKGROUND
[0002] Existing music intervention systems mostly match pre-defined music libraries with subjective emotion labels (e.g., "sad", "calm") or linearly map based on simple physiological signals (e.g., heart rate). These systems have significant limitations: the intervention is based on "already happened" emotional responses, not the "trend" of emotional changes, resulting in missed optimal windows for intervention. The unique emotional dynamic characteristics of adolescents in a depressive state, such as "emotional inertia" (i.e., difficulty in transitioning emotional states) and "anhedonia" (blunted response to positive stimuli), are not considered. Universal "calm" music may be ineffective or even counterproductive for depressed individuals. The adjustment of music parameters (e.g., rhythm, pitch) is often preset and linear, failing to adapt to the individual's dynamically changing emotional processing capacity during the intervention. In existing technologies, electroencephalogram signals are introduced to obtain user emotions, but they are only used as discrete emotion classification criteria (e.g., alpha waves represent relaxation), failing to capture the drift and recovery ability of the "emotional base state", a core feature of the emotional system as a dynamic complex system. Those skilled in the art usually focus on improving the instantaneous accuracy of emotion recognition, while ignoring the information contained in the emotional dynamic process itself, which is more instructive for intervention. SUMMARY
[0003] The technical problem to be solved by the present application is how to quantitatively measure the "emotional system resilience" of depressed adolescents in real time during music intervention, and dynamically modulate the "information entropy" of music based on this resilience, in order to break the emotional inertia and enhance the adaptive adjustment ability of the emotional system, rather than simply inducing a certain specific emotional state.
[0004] To solve the above technical problems, the technical scheme adopted by the present application is as follows:
[0005] The personalized music intervention system for adolescents with depression comprises:
[0006] The acquisition module is used to acquire multi-modal physiological and behavioral data of adolescents in real time, and to synchronize and preprocess the data to form a multi-modal data stream;
[0007] The emotional base vector calculation module is used to calculate the current emotional state vector E(t) in real time based on the preprocessed multi-modal data stream through an emotional state calculation model, and to calculate the dynamic emotional base vector E_base(t) based on the historical data of the emotional state vector through an exponentially decaying weighted moving average;
[0008] elasticity factor calculation module: configured to calculate an elasticity factor λ(t) representing the resilience of the emotional system in real time according to the current emotional state vector E(t) and the emotional ground state vector E_base(t);
[0009] music entropy generation module: configured to dynamically generate a target music entropy value M_target(t) based on the elasticity factor λ(t) according to a preset nonlinear "challenge-support" principle;
[0010] music segment generation module: configured to drive a controllable artificial intelligence music generation engine to generate and render a music segment conforming to the target entropy value in real time based on the target music entropy value M_target(t), and play the music segment to the teenager;
[0011] adaptive optimization module: configured to long-term adaptively optimize intervention parameters based on data of multiple intervention sessions.
[0012] Further, in the use of the emotional ground state vector calculation module in the above-mentioned personalized music intervention system for teenagers with depression, "calculating the current emotional state vector E(t) in real time through the emotional state calculation model" specifically includes:
[0013] extracting the time series features of heart rate variability, skin electrical response, facial action unit intensity and speech prosody from the preprocessed multi-modal data stream in parallel;
[0014] constructing the time series features in a fixed time window into a feature matrix and inputting the feature matrix into a pre-trained deep belief network model;
[0015] The deep belief network model outputs a multi-dimensional vector as the emotional state vector E(t), which includes at least pleasantness, arousal, dominance and conflict.
[0016] Further, in the use of the emotional ground state vector calculation module in the above-mentioned personalized music intervention system for teenagers with depression, the specific calculation formula of "calculating the dynamic emotional ground state vector E_base(t)" is:
[0017]
[0018] wherein the weight wi=exp(-i / τ); t is the current time; L is the length of the sliding window, i is the time index, E(t-i) is the emotional state vector at time t-i, wi is the weight given to time t-i and data, τ is the decay time constant.
[0019] Further, in the use of the elasticity factor calculation module in the above-mentioned personalized music intervention system for teenagers with depression, "calculating the elasticity factor λ(t) in real time" specifically includes:
[0020] calculating the Euclidean distance between the current emotional state vector E(t) and the emotional ground state vector E_base(t) as the emotional deviation D(t);
[0021] calculating the rate of change of the emotional deviation D(t) in unit time as the emotional recovery speed V(t);
[0022] calculating the original elasticity ratio R(t) based on the emotional recovery speed V(t) and the emotional deviation D(t), the calculation formula is where ε is a very small constant;
[0023] normalizing the original elasticity ratio R(t) to the interval [0, 1] through a sigmoid function to obtain the elasticity factor where k and R0 are preset parameters.
[0024] Further, in the use of the music entropy generation module in the above-mentioned personalized music intervention system for adolescent depression, "dynamically generating a target music entropy value M_target(t) according to a preset nonlinear 'challenge-support' principle" specifically refers to:
[0025] When λ(t) is lower than the first threshold value, set M_target(t) to be lower than the current music entropy value M_current(t) to provide a supportive environment;
[0026] When λ(t) is between the first threshold value and the second threshold value, set M_target(t) to be M_current(t) plus an increment that is positively correlated with λ(t) to provide a controllable challenge;
[0027] When λ(t) is higher than the second threshold value, set M_target(t) to be M_current(t) plus a fixed large proportion increment to actively expand.
[0028] Further, in the use of the music segment generation module in the above-mentioned personalized music intervention system for adolescent depression, "driving a controllable artificial intelligence music generation engine" specifically includes:
[0029] decomposing the target music entropy value M_target(t) into target values of four sub-dimensions of rhythm entropy, harmony entropy, timbre entropy, and dynamic entropy;
[0030] combining the last N measures of the currently played music segment as a context with the target values of the four sub-dimensions and the emotional ground state vector E_base(t) into a conditional control vector;
[0031] inputting the context and the conditional control vector into a conditional music generation model based on the Transformer architecture;
[0032] The conditional music generation model fuses the condition control vector through a conditional layer normalization technique, and outputs a symbolic representation of a subsequent music segment conforming to a target entropy value based on an autoregressive generation manner;
[0033] The symbolic representation is converted into an audio signal and rendered seamlessly cross-faded with the currently played music.
[0034] Further, in the above-mentioned personalized music intervention system for adolescent depression, the process of "decomposing the target music entropy value M_target(t) into four sub-dimension target values" is a constrained optimization problem, and the goal is to find a set of sub-dimension change amounts: rhythm entropy change amount ΔE_r, harmony entropy change amount ΔE_h, timbre entropy change amount ΔE_t, and dynamic entropy change amount ΔE_d, such that w_r ΔE_r + w_h ΔE_h + w_t ΔE_t + w_d ΔE_d≈ΔM, where ΔM = M_target(t)- M_current(t), w_r is the preset weight of the rhythm entropy change amount, w_h is the preset weight of the harmony entropy change amount, w_t is the preset weight of the timbre entropy change amount, and w_d is the preset weight of the dynamic entropy change amount.
[0035] Further, in the above-mentioned personalized music intervention system for adolescent depression, before the "real-time generation and rendering of a music segment conforming to a target entropy value" in the use of the music segment generation module, there is also a step of calculating the real-time entropy value M_current(t) of the currently played music segment, which is specifically:
[0036] Analyzing the rhythm, harmony, timbre, and dynamic characteristics of the currently played music segment;
[0037] Calculating the rhythm entropy E_r, harmony entropy E_h, timbre entropy E_t, and dynamic entropy E_d, respectively, wherein each sub-entropy is obtained by calculating the information entropy of the corresponding feature sequence and normalizing it;
[0038] The comprehensive music entropy value is calculated by the weighted formula M_current(t) = w_r × E_r + w_h × E_h + w_t × E_t + w_d × E_d.
[0039] The beneficial effects of the present application are that: the personalized music intervention system for adolescent depression involved in the present application changes from intervention emotion "state" to intervention emotion "system function", solves the core problem of depression of emotional inertia, and the predictive intervention based on the elasticity factor λ(t) can modulate early in the early stage of the deterioration trend of emotion, rather than after the event; the "elasticity-entropy" response model of the individual is learned through long-term data, so that the intervention plan is completely individualized; the "challenge-support" model avoids applying too high music information load to the individual when the individual is weak, and prevents secondary damage; the dynamically generated music has fluency and artistic nature, avoids the repetition and mechanical feeling of the preset music library, and improves the user experience. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 The present application relates to a block diagram of a personalized music intervention system for adolescent depression. DETAILED DESCRIPTION
[0041] In order to explain the technical content, the purpose and the effect of the present application in detail, the following will be explained in combination with the embodiments and the drawings.
[0042] Please refer to Figure 1 The present application relates to a personalized music intervention system for adolescent depression, comprising:
[0043] The acquisition module is used for real-time acquisition of multi-modal physiological and behavioral data of adolescents, and synchronous and preprocessing of the data to form a multi-modal data stream;
[0044] Specifically, the multi-modal physiological and behavioral data are synchronously acquired and preprocessed, at the beginning of the intervention session, physiological data (heart rate variability HRV, galvanic skin response GSR) and behavioral data (facial action unit intensity, speech prosody features) of the adolescent are synchronously acquired through wearable devices (such as heart rate wristbands, galvanic skin sensors) and terminal devices (cameras, microphones), and the data are standardized and denoised to form a time-aligned multi-modal data stream;
[0045] In a specific embodiment, taking a 16-year-old mild depressive adolescent Xiaoming as an example, a 30-minute music intervention is being carried out, Xiaoming wears Empatica E4 wristband (acquiring HRV, GSR), sits in front of a tablet computer, the front camera of the tablet records his facial video, and the built-in microphone records the ambient sound; all data are synchronized at a frequency of 10Hz;
[0046] The emotion ground state vector calculation module is used for real-time calculation of the current emotion state vector E(t) based on the preprocessed multi-modal data stream through the emotion state calculation model, and dynamic calculation of the emotion ground state vector E_base(t) based on the historical data of the emotion state vector through the exponential decay weighted moving average.
[0047] Specifically, the emotion ground state calculation and the emotion state vector construction, the pre-processed multi-modal data is input into a pre-trained deep belief network (DBN) model; the model outputs a high-dimensional emotion state vector E(t) = [e1, e2, …, en], wherein each dimension represents the intensity of an emotional component, including pleasantness, arousal, dominance, and conflict, a sliding time window (for example, the past 3 minutes) is introduced, and the weighted moving average value E_base(t) of the emotion state vector in the window is calculated, which is called "emotion ground state"; the weighting coefficient decays over time, so that the recent state has a greater impact on the ground state; the emotion ground state E_base(t) represents the relatively stable emotional background of the individual at the current time;
[0048] Specifically, after receiving the pre-processed synchronous data stream, the system extracts key features related to emotions from each modality in parallel, including:
[0049] Extract time-domain features from heart rate variability (HRV): SDNN (standard deviation of normal RR intervals), RMSSD (root mean square of successive differences in RR intervals), these features mainly reflect the parasympathetic nervous activity (related to relaxation and recovery); frequency domain features: low frequency power (LF: 0.04-0.15 Hz): represents the common regulation of sympathetic and parasympathetic nerves; high frequency power (HF: 0.15-0.4 Hz): related to respiratory sinus arrhythmia, mainly reflects parasympathetic nervous activity; LF / HF ratio: often used as a rough indicator of sympathetic-vagal balance;
[0050] Extract skin conductance level (SCL) from galvanic skin response (GSR): the slow changing baseline of skin conductance is related to the overall level of arousal; extract skin conductance response (SCR): the rapid, spiky changes in skin conductance, the extracted features include: SCR amplitude, SCR frequency, and SCR rise time;
[0051] Extract from facial action units (through camera): use a tool library similar to OpenFace to identify and quantify the intensity of specific action units (AU) in the Facial Action Coding System (FACS) defined by Ekman and Friesen in real time, for example: AU4 (brow raiser): related to tension and confusion; AU12 (cheek raiser): related to smiling and pleasure; AU15 (lower lip corner depressor): related to mouth corner lowering and sadness; AU45 (eye blink): blink frequency is related to arousal; the output is the standardized intensity value (0-1) of these AUs;
[0052] Extract from language prosody (through microphone): fundamental frequency: and its standard deviation (reflecting pitch variation); energy: and its dynamic range; speech rate; spectral tilt: reflects the brightness of the sound;
[0053] The above features are Z-score standardized, which is a technique in the prior art and will not be described in detail;
[0054] Constructing the time window matrix: the system maintains a sliding window of fixed length (e.g. T = 3 seconds); at each time instant t, a feature matrix F(t) is formed, with dimension [Tx N_f], where N_f is the total number of extracted features (e.g. 20 features are extracted from HRV, GSR, face, speech); this matrix captures the dynamic changes of all features in the last T seconds;
[0055] Deep belief network (DBN) emotion state inference:
[0056] Model input: the feature matrix F(t) obtained in the previous step is flattened into a one-dimensional vector, which is used as the input of the DBN;
[0057] Model structure and pre-training:
[0058] The DBN consists of an input layer, multiple stacked hidden layers of restricted Boltzmann machines (RBM), and a final emotion state output layer;
[0059] Pre-training phase: unsupervised layer-by-layer pre-training is performed on a large amount of multi-modal data of healthy and depressed adolescents, so that the model learns the underlying structure and patterns of multi-modal physiological behavior data;
[0060] Fine-tuning phase: supervised fine-tuning is performed on part of the data with "weak labels" (e.g. obtained by filling out a short emotion self-rating scale at the same time), and the output layer is designed with four nodes corresponding to the four emotion dimensions of pleasantness, arousal, dominance, and conflict;
[0061] Real-time inference:
[0062] During the intervention, the pre-trained DBN model receives the flattened F(t) vector.
[0063] After forward propagation, four real values between 0 and 1 are generated at the output layer, which together form the emotion state vector E(t) = [e1, e2, e3, e4] at the current time instant;
[0064] Dimension explanation:
[0065] e1 pleasantness: a continuous body from negative emotions (0) to positive emotions (1);
[0066] e2 arousal: a continuous body from calm / drowsy (0) to excited / excited (1);
[0067] e3 Dominance: a continuum from feeling dominated / minimal (0) to feeling in control / powerful (1);
[0068] e4 Conflict: a continuum from inner harmony (0) to inner conflict (1); this dimension is particularly important for capturing the "ruminative thinking" or "emotional conflict" of depressed adolescents;
[0069] In a specific embodiment, the pre-trained DBN model receives 30 data points (multimodal features) in the past 3 seconds, and outputs a 4-dimensional emotion state vector E(t) = [pleasure, arousal, dominance, conflict], each dimension ranging from [0, 1]; the system maintains a sliding window of length L = 1800 (corresponding to 3 minutes) to store the history E_history(t);
[0070] At time t, the calculation formula of the emotion ground state E_base(t) is:
[0071]
[0072] where the weight wi = exp(-i / τ);
[0073] The above The purpose is to calculate a vector that can represent the individual's recent stable emotional background, and give higher weight to the more recent data, so as to more sensitively reflect the slow drift of the ground state;
[0074] where t is the current time; L is the length of the sliding window, in this embodiment, the data acquisition frequency is 10 Hz, the window length is 3 minutes, L = 3 60 10=1800 data points, i is the time index, from 0 (current time) to L-1 (the oldest time in the window), E(t-i) is the emotion state vector (pleasure, arousal, dominance, conflict) at time t-i, wi is the weight given to time t-i and data, which is an exponential decay weight, τ is the decay time constant, which is the time step required for the weight to decay to 1 / e (about 36.8%) of the initial value (w0);
[0075] For example, set τ = 90 (representing a weight decay to 36.8% after about 9 seconds), for i from 0 to 1799, calculate the weight vector W = [w0, w1, …, w1799], where w0 = exp(0 / 90) = 1, w1 = exp(-1 / 90) ≈ 0.9889, w2 = exp(-2 / 90) ≈ 0.9780, …, w1799 = exp(-1799 / 90) is a value very close to 0;
[0076] Obtain historical data: Retrieve the emotional state vectors of the past 1800 moments from the cache and construct a matrix E_history=[E(t), E(t-1), ..., E(t-1799)];
[0077] Calculate the weighted sum: Calculate the weighted average separately for each dimension of the emotional state vector (such as the degree of pleasure);
[0078] =(w0 e_pleasure(t)+w1 e_pleasure(t-1)+……+w1799 e_pleasure(t-1799)) / (w0+w1 +……+w1799)
[0079] Similarly, calculate the ground state of arousal, dominance, and conflict respectively.
[0080] Elasticity factor calculation module: used to calculate the elasticity factor λ(t) that characterizes the recovery ability of the emotional system in real time based on the current emotional state vector E(t) and the emotional base state vector E_base(t);
[0081] Specifically, based on the obtained real-time emotion state vector E(t) and emotion base state E_base(t), two key resilience indicators are calculated:
[0082] Deviation D(t) = ||E(t) E_base(t)|| (vector norm) represents the degree to which the current emotional state deviates from its ground state;
[0083] Recovery rate V(t): Calculates the rate of change of deviation D(t) within a short time window (e.g., the past 30 seconds); a positive value of V(t) indicates that the emotion is recovering to the ground state, while a negative value indicates that the emotion is deviating further.
[0084] Define the emotional system resilience factor λ(t) as a composite function:
[0085]
[0086] Calculate the original elasticity ratio:
[0087] The elasticity factor is obtained by normalizing using the sigmoid function:
[0088]
[0089] Where k and R0 are preset parameters used to adjust the steepness and center point of the S-curve; R0 is the center point of the S-curve, that is, the R(t) value corresponding to λ(t)=0.5; it can be interpreted as the original ratio of the "elastic pass line";
[0090] wherein ε is a minimum value to prevent division by zero error, f is a S-shaped normalization function to map the ratio to the interval [0, 1], and the higher the value of λ(t) is, the better the elasticity of the emotional system at the current time is, i.e., the faster the system can recover from the deviation;
[0091] In specific embodiments,
[0092]
[0093] The recovery speed is calculated as:
[0094] wherein Δt is a time step, in the present embodiment, the calculation frequency is 1 Hz, and therefore Δt = 1 second;
[0095] D(t) is the deviation degree at the current time, and D(t-1) is the deviation degree one second ago;
[0096] V(t) < 0: indicates that the deviation degree is decreasing, and the emotion is recovering to the ground state;
[0097] V(t) > 0: indicates that the deviation degree is increasing, and the emotion is deviating from the ground state;
[0098] V(t) ≈ 0: indicates that the deviation degree is stable, and the emotion is in a temporary “stasis” state;
[0099] The original elasticity ratio is calculated as:
[0100] The elasticity factor is obtained by S-shaped function normalization:
[0101]
[0102] wherein k and R0 are preset parameters for adjusting the steepness and center point of the S-shaped curve, the greater k is, the steeper the curve is, meaning that the system is more sensitive to the change of R(t); for example, if k = 2 and R0 = 0.5, when R(t) = 0.5, λ(t) = 0.5;
[0103] The music entropy generation module is configured to generate a target music entropy value M_target(t) based on the elasticity factor λ(t) according to a preset nonlinear “challenge-support” principle;
[0104] Specifically, the “information entropy” of a music piece is defined as a comprehensive measure of music features including rhythm complexity, harmony complexity, timbre richness, and dynamic change rate; high-entropy music information is rich and varied, and low-entropy music is simple and stable.
[0105] According to the real-time elasticity factor λ(t), a target music entropy value M_target(t) is dynamically generated.
[0106] The generation follows a non-linear "challenge-support" principle:
[0107] When λ(t) is below threshold Th_low (indicating poor resilience, system is fragile), M_target(t) is set to a low-entropy value close to the individual's comfort zone, providing emotional support;
[0108] When λ(t) is in the middle range, M_target(t) is set to a value moderately higher than the current music entropy, forming a "controllable challenge" aiming to gently stretch the emotional system's regulatory capacity;
[0109] When λ(t) is above threshold Th_high (indicating good resilience), M_target(t) can be set to a higher-entropy value for more aggressive training, or allowed to fluctuate significantly in a short time, simulating complex emotional stimuli in the real world;
[0110] The core of this step is to dynamically adjust the difficulty of the challenge (music entropy) according to the system's real-time capacity (resilience);
[0111] In a specific embodiment, the system presets: Th_low=0.3, Th_high=0.7;
[0112] The current measured λ(t)=0.4 (moderate elasticity);
[0113] The real-time entropy value M_current(t) of the currently playing music segment is 0.6 (calculated by analyzing its rhythm, harmony, etc. characteristics);
[0114] According to the "challenge-support" principle, the target entropy generation function is:
[0115] If λ(t)<Th_low;
[0116] then M_target(t)=M_current(t) 0.9, reduce entropy, provide support;
[0117] If Th_low≤λ(t)≤Th_high;
[0118] then M_target(t)=M_current(t)+α (1 λ(t)) (M_max M_current(t)); Apply controllable challenge;
[0119] If λ(t)>Th_high;
[0120] Then M_target(t)=M_current(t)+β (M_max M_current(t)); impose a stronger challenge;
[0121] Where α=0.2 and β=0.5 are challenge coefficients, and M_max=1 is the maximum entropy value allowed by the system;
[0122] In this example, M_target(t) = 0.6 + 0.2 (1-0.4) (1-0.6)=0.648; the system aims to gently increase the music entropy from 0.6 to 0.648.
[0123] Music clip generation module: Based on the target music entropy value M_target(t), it drives a controllable artificial intelligence music generation engine to generate and render music clips that conform to the target entropy value in real time, and play them to the teenagers;
[0124] Specifically, real-time music generation and rendering; music is generated based on the Transformer model, receiving M_target(t); the engine uses the currently playing music segment as a seed to generate a new music segment in real time that meets the target entropy value M_target(t). The generation process is achieved by adjusting the following parameters:
[0125]
[0126] Rhythmic entropy: Increase entropy by introducing subtle rhythmic asynchrony and complex beats;
[0127] Harmonic entropy: Entropy is adjusted by controlling the frequency of use of dissonant intervals and the predictability of harmonic progressions;
[0128] E_t is the timbre entropy: the richness of timbre can be changed by superimposing or removing voices and modulating the cutoff frequency of the filter;
[0129] E_d is the dynamic entropy: the dynamic rate of change is adjusted by changing the fluctuation of the volume envelope;
[0130] w_* represents the weights of each dimension, with a sum of 1, which can be adjusted according to treatment preferences; each E_* is normalized to the [0,1] interval;
[0131] Upon receiving M_target(t), the system decomposes it into specific targets for each music parameter, including:
[0132] Current state analysis: The system analyzes the currently playing music segment in real time, calculates its current E_*_current(t), according to the preset weight, calculates the total E_current(t), calculates the difference between the total target entropy and the current entropy: ΔM = M_target(t) - M_current(t); M_current(t)=w_r×E_r+w_h×E_h+w_t×E_t+w_d×E_d; distribute the total ΔM to each music parameter dimension; our goal is to find a set of parameter change amounts (ΔE_r, ΔE_h, ΔE_t, ΔE_d), so that w_r ΔE_r + w_h ΔE_h + w_t ΔE_t + w_d ΔE_d≈ΔM;
[0133] It should be noted that each ΔE_* has an upper and lower limit to prevent sudden changes in music; there is a coupling relationship between parameters (for example, increasing the rhythm complexity may naturally require richer timbre to support), which is encoded in the constraints;
[0134] Through a lightweight optimizer (such as gradient descent or simple heuristic search), a set of feasible parameter target values: [E_r_target, E_h_target, E_t_target, E_d_target] is quickly solved;
[0135] The system takes the last N measures of the currently playing music as the "context" or "seed"; encodes this segment of music into an internal hidden space representation vector z_context;
[0136] The resulting parameter target values: [E_r_target, E_h_target, E_t_target, E_d_target] are constructed into a conditional control vector C, in order to maintain the overall style and coherence of the music, some dimensions of the user's emotional base state E_base(t) (such as pleasantness, arousal) are also auxiliary conditions integrated into vector C. This ensures that the generated music is roughly consistent with the user's long-term state in terms of emotional color, avoiding extreme and discordant stimuli;
[0137] The generation model takes z_context as the starting point and C as the guide, and performs autoregressive or parallel generation to predict the next M measures (for example, 2 measures) of music;
[0138] In the training phase of the model, in addition to learning the probability distribution of the music itself, the mapping relationship between the music segment and its corresponding (E_r, E_h, E_t, E_d) parameter value is also learned; in the generation, the model will try to make the output music approach the target specified by the condition vector C. This can be achieved through conditional adversarial training or guided sampling technology;
[0139] Specifically, in the modulation of rhythm entropy E_r, low entropy is stable quarter note or eighth note pulse, and the strong beat is prominent. Simple cut or no cut is used; high entropy is to introduce polynomial rhythm: for example, on the basis of 4 / 4 beat, embed short 3 / 8 or 5 / 8 phrases; and subdivided rhythm asynchrony: under the premise of maintaining the overall rhythm, create subtle rhythm shift between parts (such as the piano part slightly ahead of the bass part); and use complex cut and tie: such as the interweaving of triplets, quintuplets and regular rhythms; and dynamic change of beat density: suddenly insert a string of fast 32nd notes within a phrase, and then return to calm;
[0140] Specifically, in the modulation of harmony entropy E_h, low entropy is to use strong progressions of primary-secondary-subordinate and other pure fifth relationships. The harmony rhythm is slow, mainly using consonant triads; high entropy is to expand chords: use a lot of seventh chords, ninth chords, eleventh chords to increase tension; and non-functional harmonic progressions: avoid traditional endings, use modulating, parallel harmony, etc. Colorful progressions; and tonal ambiguity: temporarily turn to remote relationship tuning, or use major scale, minor scale, etc. Increase uncertainty; and counterpoint: introduce polyphonic elements, make multiple melody lines independent, produce complex harmonic interaction;
[0141] Specifically, in the modulation of timbre entropy E_t, low entropy is to use a few persistent, warm timbres (such as string pad, flute), and simple filter modulation and effects (such as reverb, delay) settings; high entropy is dynamic timbre shaping: real-time modulation of synthesizer filter cutoff frequency and resonance peak to create "wow" or "sweep" effects; and granular synthesis technology: decompose audio samples into tiny particles and reorganize them to produce complex and unpredictable textures; and effect automation: dynamically adjust delay feedback rate, reverb size or modulation depth to create a vast and constantly changing sound space; and part alternation and superposition: let different instrument parts appear quickly in a "call and response" style, or temporarily superimpose a new percussion part without warning;
[0142] Specifically, in the modulation of dynamic entropy E_d, low entropy means smooth volume changes and small contrast between loud and weak (such as always staying between mp-mf); high entropy means large-amplitude sudden contrast between loud and weak: using the effect of "very loud followed by weak"; and complex volume envelope: designing a dynamic curve with multiple rise and fall stages for each note or phrase, rather than a simple start-release.
[0143] The generated music clip is fed into a short output buffer. The system quickly analyzes the actual music entropy M_generated of the generated clip to ensure that its error with M_target(t) is within an acceptable range. If the deviation is too large, a quick regeneration or fine-tuning can be triggered.
[0144] Preferably, a crossfade region lasting from several hundred milliseconds to one second is designed between the end of the currently playing segment and the beginning of the new segment;
[0145] The fade curve design is not a simple linear fade. The fade curve will be dynamically adjusted according to the harmonic compatibility of the two pieces of music. If there is a large harmonic conflict, the fade-out speed of the old music will be accelerated; if the transition is smooth, a slower linear fade will be used to maintain the immersive feeling.
[0146] Ultimately, the seamlessly processed audio signal is sent to speakers or headphones, and the user perceives a continuous, yet subtly evolving, therapeutic piece of music.
[0147] The generated music clips are seamlessly rendered and played to teenagers, completing one intervention cycle;
[0148] The model architecture for generating music using the Transformer model employs a conditional Transformer-Decoder;
[0149] The core components include:
[0150] Token Embedding layer: Converts each event token into a high-dimensional vector;
[0151] Positional encoding: Injecting absolute or relative positional information into each position in the sequence, enabling the model to understand the temporal sequence;
[0152] N Transformer decoder layers: Each layer contains:
[0153] Masking self-attention mechanism: ensures that when generating the i-th token, only the tokens preceding it can be seen, preventing information leakage;
[0154] Feedforward neural networks: perform nonlinear transformations on the attention output;
[0155] To control the characteristics of the generated music, we need to incorporate the conditioning vector C (containing [E_r_target, E_h_target, E_t_target, E_d_target] and [e1_base, e2_base]) into the model; we adopt a conditioning layer normalization;
[0156] Before the layer normalization operation in each Transformer layer, the conditioning vector C is passed through a small fully connected network to generate the scaling factor γ and the bias term β for that layer;
[0157] Formula: Conditional_LayerNorm(x, C) = γ(C) (LayerNorm(x)) + β(C)
[0158] This allows the conditioning information to directly affect the mean and variance of the feature distribution at each layer, allowing deep control of the generated music style and features from the bottom up, rather than simply inputting conditions at the beginning, which is the key to achieving fine control;
[0159] The model training process is divided into two stages;
[0160] The first stage is the pre-training stage; the data uses a large amount of diverse MIDI music dataset; the standard autoregressive language model task, given a prefix of a piece of music token, predicts the next most likely token to appear; maximize the likelihood function of the entire dataset (minimize cross-entropy loss); after this stage, the model has learned the general music creation "grammar" and can generate coherent and pleasant but uncontrollable music;
[0161] The second stage is the conditional fine-tuning; a paired dataset consisting of (music segment, conditioning vector) is constructed; for each piece of music in the training set, use the offline analysis tool to accurately calculate its (E_r, E_h, E_t, E_d); At the same time, label its approximate emotional label (pleasure, arousal) for each piece of music, or use the model to infer from the music audio features; the conditioning vector C is [E_r, E_h, E_t, E_d, e1_label, e2_label];
[0162] On the basis of the pre-trained model, input the conditioning vector C and the music token prefix, and require the model to predict the next token;
[0163] Again, the cross-entropy loss, but this time the model must learn to make predictions under the constraints of the given condition C;
[0164] To enhance the robustness of the model, random noise can be added to the condition vector C or some dimensions can be randomly dropped during training, forcing the model not to rely too much on any one condition;
[0165] During the intervention process, the model generates in real time:
[0166] Including:
[0167] Initialization: The last 2 bars of the currently playing music token sequence is taken as the initial context Context;
[0168] Condition setting: build condition control vector C = [E_r_target, E_h_target, E_t_target, E_d_target, e1_base, e2_base];
[0169] Iterative generation:
[0170] Input Context and condition vector C into the trained conditional Transformer model;
[0171] The model outputs a probability distribution over the vocabulary, representing the likelihood of the next possible token;
[0172] The sampling strategy uses core sampling: take the top k (for example, k = 40) candidate tokens from the probability distribution, renormalize the probabilities of these k tokens so that their sum is 1, and randomly sample a token from this new distribution as the next event; The newly generated token is appended to the Context, and the oldest token at the beginning of the sequence is removed to maintain a fixed length context window;
[0173] When the generated token sequence corresponds to a predetermined target time length (for example, 2 bars), stop generating; convert the generated token sequence back to standard MIDI format, ready for audio synthesis and rendering;
[0174] In order to better handle the repetitive structure and long-range dependence in music, relative position encoding is used instead of absolute position encoding, making the model pay more attention to the relative time distance between notes;
[0175] In order to solve the repetition and collapse problem that may occur when the Transformer generates long sequences, a product key-value memory network can be introduced to provide an external memory for the model to help maintain the structural and diverse nature of music;
[0176] For more complex systems, a dual-stream Transformer can be used to process melody and harmony separately, and then integrated through a fusion module to achieve more fine-grained control.
[0177] In a specific embodiment, music is generated based on a Transformer model, receiving M_target(t), specifically receiving the previous 4-bar music as context to generate the next 2-bar music, so that the overall entropy value is close to 0.648;
[0178] The model adjusts the entropy value in the following ways;
[0179] Rhythm entropy: Under the premise of maintaining the basic tempo, introduce a group of 32nd note decorations at some weak beat positions to slightly break the regularity;
[0180] Harmonic entropy: In the process of resolving the relative chord to the tonic chord, temporarily introduce a passing ninth chord to increase a little dissonance and color;
[0181] Timbre entropy: On the string background, superimpose a very weak, delayed piano timbre to increase the sense of space;
[0182] The generated new music segment is processed with seamless cross-fade, replacing the original segment for playback; Xiaoming hears the music as smooth, but the subtle details become more rich and slightly thoughtful;
[0183] Adaptive optimization module: used for long-term adaptive optimization of intervention parameters based on multiple intervention sessions;
[0184] Specifically, the system records the trajectory of λ(t) and M_target(t) during the entire conversation, and through analysis of multiple session data, the system can learn the unique "elasticity-entropy" response curve of the teenager, and adaptively adjust the threshold (Th_low, Th_high) and challenge intensity, to achieve personalized and progressive intervention scheme optimization;
[0185] In a specific embodiment, the above process is continuously cycled within the next 30 minutes (e.g. evaluated and adjusted every 2 seconds);
[0186] The system records Xiaoming's λ(t) response to M_target(t) changes, after 5 interventions, the system finds that when λ(t) is in the interval of 0.4-0.5, increasing α from 0.2 to 0.25 can trigger a more positive elastic response without adverse reactions; Therefore, the system automatically updates Xiaoming's personalized intervention parameter library.
[0187] The above merely illustrates the embodiments of the present application, and is not intended to limit the patent scope of the present application. Any equivalent transformation or direct or indirect application in the related technical field based on the content of the present application specification and drawings is also included in the patent protection scope of the present application.
Claims
1. A personalized music intervention system for adolescent depression, characterized in that, The system comprises: a collection module for collecting real-time multi-modal physiological and behavioral data of adolescents, synchronizing and preprocessing the data, and forming a multi-modal data stream; an emotional ground state vector calculation module for calculating a current emotional state vector E(t) in real time based on the preprocessed multi-modal data stream through an emotional state calculation model, and calculating a dynamic emotional ground state vector E_base(t) based on historical data of the emotional state vector through an exponentially decaying weighted moving average; an elasticity factor calculation module for calculating an elasticity factor λ(t) representing the recovery ability of the emotional system in real time according to the current emotional state vector E(t) and the emotional ground state vector E_base(t); a music entropy generation module for dynamically generating a target music entropy value M_target(t) based on the elasticity factor λ(t) according to a preset nonlinear "challenge-support" principle; a music segment generation module for driving a controllable artificial intelligence music generation engine based on the target music entropy value M_target(t) to generate and render a music segment conforming to the target entropy value in real time, and playing it to the adolescent; an adaptive optimization module for long-term adaptive optimization of intervention parameters based on data of multiple intervention sessions; In the use of the elasticity factor calculation module, "real-time calculation of the elasticity factor λ(t)" specifically includes: calculating the Euclidean distance between the current emotional state vector E(t) and the emotional ground state vector E_base(t) as the emotional deviation D(t); calculating the change rate of the emotional deviation D(t) in unit time as the emotional recovery speed V(t); Based on the emotion recovery speed V(t) and the emotion deviation degree D(t), the original elasticity ratio R(t) is calculated, and the calculation formula is wherein ε is a minimum constant; normalizing the original elasticity ratio R(t) to the interval [0, 1] by a sigmoid function to obtain the elasticity factor where k and R0 are preset parameters; In the use of the music entropy generation module, "dynamically generating a target music entropy value M_target(t) according to a preset nonlinear 'challenge-support' principle" specifically includes: when the elasticity factor λ(t) is lower than a first threshold, set the target music entropy value M_target(t) to be lower than the current music entropy value M_current(t) to provide a supportive environment; when the elasticity factor λ(t) is between the first threshold and a second threshold, set the target music entropy value M_target(t) to be the current music entropy value M_current(t) plus an increment positively correlated with the elasticity factor λ(t) to provide a controllable challenge; when the elasticity factor λ(t) is higher than the second threshold, set the target music entropy value M_target(t) to be the current music entropy value M_current(t) plus a fixed larger proportion increment for active expansion.
2. The personalized music intervention system for adolescent depression according to claim 1, characterized in that, In the use of the emotional ground state vector calculation module, "calculating a current emotional state vector in real time through an emotional state calculation model" specifically includes: extracting heart rate variability, skin electrical response, facial action unit intensity, and speech prosody time series features from the preprocessed multi-modal data stream in parallel; constructing the time series features in a fixed time window into a feature matrix and inputting it into a pre-trained deep belief network model; the deep belief network model outputs a multi-dimensional vector as the emotional state vector E(t), which includes at least pleasantness, arousal, dominance, and conflict.
3. The personalized music intervention system for adolescent depression according to claim 1, characterized in that, In the use of the emotional ground state vector calculation module, the specific calculation formula of "calculating a dynamic emotional ground state vector E_base(t)" is: Wherein, the weight wi=exp(-i / τ); t is the current time; L is the length of the sliding window, i is the time index, E(t-i) is the emotional state vector at time t-i, wi is the weight given to time t-i and data, τ is the decay time constant.
4. The personalized music intervention system for adolescent depression according to claim 1, wherein, In the use of the music segment generation module, "driving the controllable artificial intelligence music generation engine" specifically includes: decomposing the target music entropy value M_target(t) into target values of four sub-dimensions of rhythm entropy, harmony entropy, timbre entropy and dynamic entropy; combining the last N measures of the currently played music segment as a context with the target values of the four sub-dimensions and the emotional ground state vector E_base(t) into a conditional control vector; inputting the context and the conditional control vector into a conditional music generation model based on the Transformer architecture; the conditional music generation model fuses the conditional control vector through conditional layer normalization technology, and outputs the symbolic representation of the subsequent music segment conforming to the target entropy value based on the autoregressive generation method; convert the symbolic representation into an audio signal and render it seamlessly with the currently played music.
5. The personalized music intervention system for adolescent depression according to claim 4, characterized in that, The process of "deconstructing the target music entropy value M_target(t) into four sub-dimension target values" is a constrained optimization problem, which aims to find a set of sub-dimension changes: rhythm entropy change ΔE_r, harmony entropy change ΔE_h, timbre entropy change ΔE_t, and dynamic entropy change ΔE_d, such that w_r ΔE_r + w_h ΔE_h + w_t ΔE_t + w_d ΔE_d≈ΔM, where ΔM = M_target(t) - M_current(t), w_r is the preset weight of the rhythm entropy change, w_h is the preset weight of the harmony entropy change, w_t is the preset weight of the timbre entropy change, and w_d is the preset weight of the dynamic entropy change.
6. The personalized music intervention system for adolescent depression according to claim 5, characterized in that, In the use of the music segment generation module, before "real-time generation and rendering of a music segment conforming to the target entropy value", there is a step of calculating the real-time entropy value M_current(t) of the currently played music segment, which is specifically: analyze the rhythm, harmony, timbre and dynamic characteristics of the currently played music segment; calculate the rhythm entropy E_r, harmony entropy E_h, timbre entropy E_t and dynamic entropy E_d respectively, wherein each sub-entropy is obtained by calculating the information entropy of the corresponding feature sequence and normalizing it; calculate the comprehensive music entropy value through the weighted formula M_current(t)=w_r×E_r+w_h×E_r+w_t×E_t+w_d×E_d.
Citation Information
Patent Citations
System for realizing personalized music emotion regulation processing based on parameter adaptive mechanism
CN118299004A
Self-adaptive music intervention system based on multi-modal physiological feedback
CN119499507A