Dynamic music generation method and device based on video frame-level sentiment analysis
By combining a cross-modal multi-feature reasoning engine and community detection algorithm with temporal sentiment analysis and a music style knowledge graph, the problem of predicting the continuity of emotions and adaptation bias in dynamic music generation is solved, achieving high-precision and intelligent music generation and improving the synchronization and adaptability of music and video emotions.
Patent Information
- Application Number
- CN202611476620.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-24
AI Technical Summary
Existing dynamic music generation technology ignores the continuity and dynamic difference characteristics of emotions between video frames, and lacks the ability to deeply predict the emotional evolution path and music matching deviation. This results in the generated music being out of sync with the emotional trend of the video, and has problems such as low matching accuracy, slow response and rhythm misalignment.
A cross-modal multi-feature inference engine is used for sliding frame sampling and block processing. A community detection algorithm is combined to classify frame-level sentiment features and inter-frame difference features. Through temporal sentiment evolution analysis and staged sentiment modeling, the music matching needs are predicted. A music style knowledge graph is constructed to predict potential matching deviations. Semantic sentiment association matching is used to generate matching deviation correction plans.
It significantly improves the granularity and robustness of emotion perception, enhances the ability to predict the development trend of emotions, avoids the lag or mismatch of traditional background music response, achieves high-precision matching between music generation and video content, and enhances the intelligence and adaptability of the system.
Smart Images

Figure CN123164306A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of background music generation technology, and in particular to a method and apparatus for dynamic background music generation based on video frame-level emotion analysis. Background Technology
[0002] With the rapid growth of multimedia content and the increasing demands of users for audiovisual experiences, video scoring is no longer limited to manual post-production but is gradually developing towards intelligence and automation. Traditional video scoring methods rely heavily on human experience or coarse-grained analysis based on the overall mood of the video, making it difficult to achieve precise synchronization with the emotional changes in the video footage. Especially when facing complex emotional evolution, rapid shot transitions, or subtle changes in facial expressions, the scoring often lacks real-time responsiveness and emotional matching accuracy. In addition, existing automated scoring systems mostly use static template matching or fixed rule-driven methods, ignoring the continuity and dynamic differential characteristics of emotions between video frames. This results in a disconnect between the generated music rhythm and melody and the emotional trajectory of the video, leading to problems such as emotional misalignment or rhythmic lag.
[0003] In recent years, the development of deep learning and affective computing technologies has provided new possibilities for video sentiment analysis. Frame-level sentiment recognition methods based on multimodal features such as facial expressions, color changes, and motion intensity have gradually matured, making it possible to model the emotional state of each frame in a video in a refined way. However, how to effectively transform frame-level emotional information into a driving force for the generation of dynamic background music still faces many challenges: on the one hand, video emotions have temporal continuity and non-linear evolution characteristics, and simple frame-by-frame mapping is difficult to capture the accumulation, transition, and explosion of emotions; on the other hand, music adaptation not only needs to consider the current emotional state, but also needs to predict the emotional development trend and evaluate the potential deviation between the background music style and emotional changes. Existing methods are still insufficient in modeling the deep correlation between the emotional evolution path and background music parameters.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a method and apparatus for generating dynamic background music based on video frame-level emotion analysis. This invention aims to solve the technical problems of existing dynamic background music generation technology, which ignores the continuity and dynamic difference characteristics of emotions between video frames and lacks the ability to deeply predict the emotion evolution path and the adaptation deviation of background music. As a result, the generated music is out of sync with the emotional trend of the video, and has low matching accuracy, slow response and rhythm misalignment.
[0006] To achieve the above objectives, this invention provides a dynamic background music generation method based on video frame-level sentiment analysis, applied to an intelligent dynamic background music generation system, wherein the intelligent dynamic background music generation system is deployed with a cross-modal multi-feature inference engine; the method includes: The cross-modal multi-feature inference engine of the intelligent dynamic music generation system uses a sliding frame sampling strategy to obtain the sequence frame images and inter-frame temporal correlation data of the video to be set to music, and preprocesses the data to obtain preprocessed video frame data. The preprocessed video frame data is divided into blocks to obtain block-processed video frame data; based on the community detection algorithm, the block-processed video frame data is classified into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data. Based on the target frame-level emotion data, video temporal emotion evolution analysis is performed to obtain temporal emotion evolution data; based on the temporal emotion evolution data and the target frame inter-frame difference feature data, staged emotion modeling is used to predict the music matching requirements to obtain dynamic music matching requirements data. A music style knowledge graph is constructed. Based on the temporal emotion evolution data and dynamic music adaptation requirement data, the music style knowledge graph is used to predict the potential adaptation deviation of music generation and obtain potential adaptation deviation data. Several music parameter adjustment strategy libraries are obtained from the music material library. Semantic and emotional association matching is performed on the potential adaptation deviation data and each music parameter adjustment strategy to obtain semantic and emotional association matching results. Adaptation deviation correction plan is generated based on the semantic and emotional association matching results. Dynamic music is dynamically generated and optimized based on the adaptation deviation correction plan.
[0007] Optionally, the step of using a sliding frame sampling strategy to obtain the sequence of frame images and inter-frame temporal correlation data of the video to be accompanied by music, and preprocessing the data to obtain preprocessed video frame data, includes: The frame sampling period and frame sampling granularity are determined based on the preset video emotion resolution, and the frame sampling threshold is constructed based on the dynamic coupling relationship between the frame sampling period and the frame sampling granularity. Based on the frame sampling threshold, a sliding frame sampling strategy is determined, and based on the sliding frame sampling strategy, the sequence frame images and inter-frame temporal correlation data of the video to be accompanied by music are obtained. The video frame data is subjected to noise frame filtering processing to obtain noise frame filtered video frame data. Cross-modal feature alignment is performed on the video frame data after noise frame filtering to obtain preprocessed video frame data.
[0008] Optionally, the step of classifying the segmented video frame block data based on the community detection algorithm to obtain target frame-level sentiment data and target inter-frame difference feature data includes: Sentiment annotation is performed on feature nodes of the segmented video frame block data to obtain several sentiment annotation categories; Obtain the feature association matrix for each sentiment labeling category, and construct a feature community network model based on the feature association matrix using sentiment change intensity weight quantization. Based on the aforementioned feature community network model, the video frame block data after block processing is divided into communities to obtain the community division results. The hybrid classification method based on sentiment feature topology and inter-frame difference path uses the community division results to classify frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data.
[0009] Optionally, the step of performing video temporal emotion evolution analysis based on the target frame-level emotion data to obtain temporal emotion evolution data includes: Based on the target frame-level emotion data, the intensity of change of emotion feature points is analyzed to obtain the intensity of change of emotion feature points. Based on the target frame-level emotion data, curve fitting is used to analyze the evolution trajectory between emotion feature points to obtain the dynamic evolution trajectory between emotion feature points. Based on the temporal emotion transfer probability network, the periodic extrapolation of emotion time sequence is performed using the change intensity and dynamic evolution trajectory to obtain periodic extrapolation data of emotion time sequence; Based on the intensity of change and dynamic evolution trajectory, a deep time series prediction model is used to infer the trend of emotion evolution and obtain emotion evolution trend inference data. Based on the periodic extrapolation data and the inference data on the trend of emotion evolution, video temporal emotion evolution analysis is performed to obtain temporal emotion evolution data.
[0010] Optionally, the step of using phased emotion modeling to predict music adaptation needs based on the temporal emotion evolution data and the target frame inter-frame difference feature data to obtain dynamic music adaptation need data includes: An emotion difference curve is generated based on the target inter-frame difference feature data, and the threshold range of the adaptation stage is divided based on the emotion difference curve. Based on the threshold range, migration analysis is performed during the adaptation phase to obtain migration data for the adaptation phase. Based on the migration data of the adaptation stage, the temporal emotion evolution data is used to extrapolate the music adaptation requirements, and music adaptation requirement extrapolation data is obtained. Noise robustness estimation is performed based on the temporal emotion evolution data and the target frame inter-frame difference feature data to obtain noise robustness parameters; Based on the music adaptation requirement projection data and noise robustness parameters, a dynamic music adaptation requirement prediction is performed using an adaptation requirement simulator to obtain dynamic music adaptation requirement data.
[0011] Optionally, the construction of the music style knowledge graph, based on the temporal emotion evolution data and dynamic music adaptation requirement data, utilizes the music style knowledge graph to predict potential adaptation biases in music generation, obtaining potential adaptation bias data, including: The historical adaptation data of dynamic background music and video emotion topology network are obtained. The historical adaptation data includes historical emotion data and historical adaptation effect data. Based on the historical adaptation data, emotion semantic level division and adaptation quality level division are performed to obtain emotion semantic level division data and adaptation quality level division data. An adaptation bias matrix is constructed based on the aforementioned emotion semantic hierarchy segmentation data, adaptation quality hierarchy segmentation data, and video emotion topology network. Based on the historical adaptation data, an adaptation deviation coupling degree analysis is performed to obtain adaptation deviation coupling degree data. Based on the adaptation deviation matrix and adaptation deviation coupling degree data, a deviation chain relationship is constructed to obtain a deviation chain structure graph, and a music style knowledge graph is constructed based on the deviation chain structure graph. A potential adaptation bias prediction model is constructed based on the aforementioned music style knowledge graph and graph neural network prediction model. Based on the potential adaptation bias prediction model, the potential adaptation bias prediction of music generation is performed using the temporal emotion evolution data and dynamic music adaptation requirement data to obtain potential adaptation bias data.
[0012] Optionally, the step of performing semantic-sentiment correlation matching on the potential adaptation deviation data and the adjustment strategies for each music parameter to obtain semantic-sentiment correlation matching results includes: Obtain the emotional semantic feature vector of the potential adaptation deviation data and the strategy feature vector of each music parameter adjustment strategy; The similarity measurement results are obtained by performing similarity measurement on the emotional semantic feature vector and the feature vector of each strategy based on the semantic graph neural network. Obtain the difference feature set of the sentiment semantic feature vector and each strategy feature vector; Based on the aforementioned difference feature set, heterogeneous graph matching is used to evaluate the difference between the sentiment semantic feature vector and each strategy feature vector, and the corresponding difference evaluation results are obtained. Based on the similarity quantification results and difference assessment results, semantic sentiment association matching is performed on the potential adaptation deviation data and the adjustment strategies of each music parameter to obtain semantic sentiment association matching results.
[0013] Furthermore, to achieve the above objectives, the present invention also provides a dynamic background music generation device based on video frame-level emotion analysis, the device comprising: The sliding sampling module is used to obtain the sequence frame images and inter-frame temporal correlation data of the video to be accompanied by music through the cross-modal multi-feature inference engine of the intelligent dynamic music generation system using the sliding frame sampling strategy, and to preprocess the data to obtain preprocessed video frame data. The community classification module is used to divide the preprocessed video frame data into blocks to obtain the block-processed video frame block data; based on the community detection algorithm, the block-processed video frame block data is classified into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data. The evolution prediction module is used to perform video temporal emotion evolution analysis based on the target frame-level emotion data to obtain temporal emotion evolution data; and to perform music matching requirement prediction based on the temporal emotion evolution data and the target frame inter-differential feature data using staged emotion modeling to obtain dynamic music matching requirement data. The graph inference module is used to construct a music style knowledge graph. Based on the temporal emotion evolution data and dynamic music adaptation requirement data, the music style knowledge graph is used to predict the potential adaptation deviation of music generation and obtain potential adaptation deviation data. The semantic correction module is used to obtain several music parameter adjustment strategy libraries from the music material library, perform semantic and emotional association matching on the potential adaptation deviation data and each music parameter adjustment strategy, obtain semantic and emotional association matching results, generate adaptation deviation correction plan based on the semantic and emotional association matching results, and dynamically generate and optimize dynamic music based on the adaptation deviation correction plan.
[0014] Furthermore, to achieve the above objectives, the present invention also provides a dynamic music generation device based on video frame-level sentiment analysis. The device includes: a memory, a processor, and a dynamic music generation program based on video frame-level sentiment analysis stored in the memory and executable on the processor. The dynamic music generation program based on video frame-level sentiment analysis is configured to implement the steps of the dynamic music generation method based on video frame-level sentiment analysis as described above.
[0015] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a dynamic music generation program based on video frame-level sentiment analysis, wherein when the dynamic music generation program based on video frame-level sentiment analysis is executed by a processor, it implements the steps of the dynamic music generation method based on video frame-level sentiment analysis as described above.
[0016] This invention provides a dynamic background music generation method based on video frame-level sentiment analysis. This method, by introducing sliding frame sampling and block processing combined with a community detection algorithm, achieves refined extraction and structured classification of video frame-level sentiment features and inter-frame differential changes, significantly improving the fine-grainedness and robustness of sentiment perception. Furthermore, by performing temporal sentiment evolution analysis on the target frame-level sentiment data, it accurately characterizes the intensity of sentiment changes, dynamic evolution trajectory, and periodic patterns, enhancing the system's ability to predict sentiment development trends and avoiding the problems of delayed or mismatched background music responses found in traditional methods. Moreover, by combining a phased sentiment modeling mechanism with noise robustness estimation, it achieves phased division and stable extrapolation of background music adaptation requirements, enabling… The music generation is more closely aligned with the emotional development stage. By constructing a music style knowledge graph that integrates historical adaptation data and emotional topological relationships, and using graph neural networks to predict potential adaptation deviations, the system is endowed with forward-looking error correction capabilities. Finally, by performing semantic and emotional correlation matching on potential deviations and music parameter adjustment strategies, personalized adaptation deviation correction plans are generated, completing a closed-loop control from emotional perception, evolution prediction, deviation warning, and dynamic optimization. This not only significantly improves the fit between dynamic music and video content in terms of rhythm, melody, and emotional color, but also significantly enhances the system's intelligence, adaptability, and artistic expression capabilities, providing a high-precision, high-response intelligent music solution for short video creation, film and television post-production, and interactive media scenarios. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating an embodiment of the dynamic background music generation method based on video frame-level emotion analysis of the present invention. Figure 2 This is a structural block diagram of an embodiment of the dynamic background music generation device based on video frame-level emotion analysis of the present invention.
[0018] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0020] Reference Figure 1 , Figure 1This is a flowchart illustrating an embodiment of the dynamic background music generation method based on video frame-level sentiment analysis according to the present invention. An embodiment of the dynamic background music generation method based on video frame-level sentiment analysis according to the present invention is presented.
[0021] In one embodiment, the dynamic background music generation method based on video frame-level sentiment analysis includes: In step S100, the cross-modal multi-feature inference engine of the intelligent dynamic background music generation system uses a sliding frame sampling strategy to obtain the sequence frame images and inter-frame temporal correlation data of the video to be set to music, and preprocesses the data to obtain preprocessed video frame data.
[0022] The intelligent dynamic background music generation system can be an automated audiovisual content processing platform integrating cross-modal inference and music generation modules, capable of carrying and scheduling the entire computational task of video sentiment analysis and background music generation. In this embodiment, the intelligent dynamic background music generation system can provide a runtime environment and data interface for the cross-modal multi-feature inference engine, and receive and execute adaptation deviation correction plans to output the final background music. The cross-modal multi-feature inference engine can be a computational core that integrates visual frame sequences and temporal correlation information for joint semantic parsing, capable of end-to-end extraction and inference from raw video pixels to high-level sentiment semantics and differential features. For example, the cross-modal multi-feature inference engine can load pre-trained deep learning model weights to perform tensor operations and feature mapping on the input video frame data and inter-frame temporal correlation data. In an exemplary embodiment, the cross-modal multi-feature inference engine can drive a sliding frame sampling strategy to acquire data and pass the inference results to a community detection algorithm for structured classification. Furthermore, cross-modal multi-feature inference engines may include, but are not limited to, Transformer-based temporal inference engines, CNN-LSTM-based hybrid inference engines, and graph neural network-based topological inference engines.
[0023] A sliding frame sampling strategy can be a sampling mechanism that continuously extracts image sequences along the video timeline with a fixed step size or an adaptive window. This can be used to reduce data redundancy while maintaining temporal continuity and capturing transient emotional changes during rapid shot transitions. In one specific embodiment, the sliding frame sampling strategy can set the sampling window size and sliding step size, traverse the video stream in chronological order, and extract image frames and their timestamp information at corresponding moments. Furthermore, the sliding frame sampling strategy can provide a cross-modal multi-feature inference engine with sequence frame images and inter-frame temporal correlation data with temporal context. For example, the sliding frame sampling strategy can employ fixed-interval sliding sampling, adaptive sampling triggered by keyframes, and dynamic sampling based on motion intensity feedback. The sequence frame images can be a collection of video frames with continuous timestamps extracted by the sliding frame sampling strategy, serving as the original input carrier for visual sentiment analysis while preserving the spatiotemporal continuity of the image content. In this embodiment, the sequence frame images can be processed by the cross-modal multi-feature inference engine to extract emotional features and simultaneously used to calculate inter-frame temporal correlation data. Inter-frame temporal correlation data can be metadata that characterizes the temporal span and state change relationship between adjacent or spaced sampling frames. It can be used to provide a temporal dimension benchmark for emotion evolution analysis and help determine the rate and direction of emotion changes. For example, inter-frame temporal correlation data can be calculated from the timestamp difference of the recorded sampling time, optical flow vector, or feature space distance.
[0024] The sliding frame sampling strategy is used to acquire the sequence of frames and inter-frame temporal correlation data of the video to be accompanied by music. This can be achieved by sliding the window and step size along the video timeline, extracting the corresponding frame images, and simultaneously recording timestamps or motion information. Furthermore, the acquisition of the sequence of frames and inter-frame temporal correlation data of the video to be accompanied by music can be achieved by using uniform sliding sampling at fixed time intervals or non-uniform sliding sampling triggered by scene transition detection. This allows for control of the data volume while preserving temporal continuity, effectively capturing transient emotional details in rapid shot transitions. Preprocessing the data to obtain preprocessed video frame data can involve denoising, color normalization, size normalization, and tensor format conversion of the original sampled frames. The preprocessed video frame data can be a standardized, cleaned, and format-converted representation suitable for model inference. It can be used to eliminate interference introduced by the acquisition device and environment, and to unify the data distribution to improve the stability of subsequent feature extraction. In this embodiment, the preprocessed video frame data can be used as the direct input for block processing, and its quality directly affects the accuracy of the target frame-level emotional data. For example, preprocessing the data to obtain preprocessed video frame data can be achieved by using traditional image processing algorithms for denoising and color correction or by using lightweight neural networks for end-to-end preprocessing. This can eliminate acquisition noise and device differences, unify data distribution, and improve the robustness of subsequent feature extraction.
[0025] Step S200: The preprocessed video frame data is divided into blocks to obtain block-processed video frame data. Based on the community detection algorithm, the block-processed video frame data is classified into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data.
[0026] The process of segmenting preprocessed video frame data into blocks can involve dividing the entire frame image into multiple local data blocks based on a spatial grid or semantic region. These segmented video frame blocks, formed by dividing the preprocessed video frame into spatial or semantic regions, can support fine-grained sentiment analysis and prevent global averaging from masking the emotional expression of local facial expressions or colors. In one specific embodiment, the segmented video frame blocks can serve as input nodes for a community detection algorithm, enabling the algorithm to identify sentiment clustering structures at a local scale. Furthermore, the segmentation of preprocessed video frame data can be achieved by uniformly dividing the data using a fixed-size grid or by non-uniformly dividing it using saliency detection or face / object localization guidance. This supports independent analysis of local emotional features and avoids the loss of subtle facial expressions or color emotions caused by global averaging. Community detection algorithms can be unsupervised learning methods based on graph theory or density clustering to identify tightly connected substructures within data. They can be used to classify discrete frame-level sentiment and differential features into semantically consistent clusters of emotional states, enhancing the structured understanding of complex emotional evolution. For example, community detection algorithms can construct similarity graphs between frame blocks and discover highly cohesive sentiment feature communities through modularity optimization or label propagation.
[0027] The community detection algorithm performs frame-level sentiment feature and inter-frame difference feature classification on the segmented video frame data. This can be achieved by constructing an inter-frame similarity graph and running a community detection algorithm to group highly cohesive features into the same emotional semantic cluster. Furthermore, the community detection algorithm can be used to perform frame-level sentiment feature and inter-frame difference feature classification on the segmented video frame data. This can be achieved by using the Louvain algorithm to optimize modularity for community partitioning or by using a label propagation algorithm for fast community classification. This allows discrete features to be structured into semantically consistent emotional states, improving the fine-grained perception and noise resistance of complex emotional evolution. The target frame-level sentiment data can be a frame-level sentiment representation vector representing a specific emotional state after community detection classification. It can provide denoised and semantically clear emotion labels or embeddings as the basic unit for temporal emotion evolution analysis. In this embodiment, the target frame-level sentiment data can be generated by the community detection algorithm to drive video temporal emotion evolution analysis to characterize emotional trajectories. Target frame differential feature data can be a differentiated feature representation reflecting the magnitude and direction of changes between adjacent emotional states. It can be used to quantify the intensity of emotional transitions and help identify emotional outburst points or smooth transitions. For example, target frame differential feature data can be used together with target frame-level sentiment data to participate in staged emotion modeling, supporting the dynamic prediction of background music adaptation needs.
[0028] Step S300: Perform temporal emotion evolution analysis on the target frame-level emotion data to obtain temporal emotion evolution data. Based on the temporal emotion evolution data and the target frame inter-frame difference feature data, use staged emotion modeling to predict the music matching requirements to obtain dynamic music matching requirements data.
[0029] The process of obtaining temporal emotion evolution data through video temporal emotion evolution analysis based on target frame-level emotion data can involve temporal modeling of the categorized frame-level emotion sequences to extract trends, cycles, and turning points. This temporal emotion evolution data can be structured data describing the nonlinear evolution path and periodic patterns of emotional states over time. It can be used to reveal the accumulation, transition, and decay of emotions, providing a temporal basis for the dynamic adjustment of musical rhythm and melody. In a specific embodiment, the temporal emotion evolution data can be obtained by temporal smoothing, trend fitting, or hidden Markov modeling of the target frame-level emotion data. Furthermore, the temporal emotion evolution data can serve as a key input for staged emotion modeling and musical style knowledge graph queries, connecting the perception and generation stages. For example, obtaining temporal emotion evolution data through video temporal emotion evolution analysis based on target frame-level emotion data can be achieved by using sliding window statistics and curve fitting to extract macroscopic trends or by using hidden Markov models or RNNs to model microscopic state transitions. This allows for the accurate depiction of the nonlinear evolution trajectory of emotions, providing a temporal basis for the dynamic adaptation of musical rhythm and melody.
[0030] Phased emotion modeling is a modeling method that divides continuous emotion evolution into several semantically coherent stages and establishes adaptation rules for each stage. It can be used to ensure that background music adaptation requirements align with the phased characteristics of emotion development, avoiding the inability of a single template to adapt to dynamic emotional changes. For example, phased emotion modeling can automatically segment stages based on inflection points, extreme values, or durations of temporal emotion evolution data, and fit a unique emotion-background music mapping function for each stage. In an exemplary embodiment, phased emotion modeling can consume temporal emotion evolution data and target frame inter-differential feature data to output dynamic background music adaptation requirement data. Predicting background music adaptation requirements using phased emotion modeling based on temporal emotion evolution data and target frame inter-differential feature data can involve segmenting stages according to emotion evolution inflection points and generating unique background music parameter requirements for each stage based on the differential features. Furthermore, predicting music adaptation requirements based on temporal emotion evolution data and target frame inter-frame difference feature data using staged emotion modeling can be achieved through stage segmentation and requirement mapping based on rule thresholds, or by automatically identifying stages and fitting requirement functions based on clustering or sequence segmentation algorithms. This ensures that music adaptation requirements align with the stage-specific characteristics of emotional development, avoiding rhythmic lag or emotional misalignment caused by static templates. Dynamic music adaptation requirement data can be a parameterized requirement description representing the musical attributes needed for the current emotional stage. It can be used to transform abstract emotional states into executable music generation instructions, guiding subsequent material selection and parameter adjustments. In this embodiment, dynamic music adaptation requirement data can be generated by staged emotion modeling, serving as the basis for music style knowledge graph retrieval and deviation prediction.
[0031] Step S400: Construct a music style knowledge graph. Based on temporal emotion evolution data and dynamic music adaptation requirement data, use the music style knowledge graph to predict potential adaptation bias in music generation and obtain potential adaptation bias data.
[0032] The construction of a music style knowledge graph can involve extracting emotion-style relationships from historical adaptation data, combining this with a music ontology to build a graph structure, and continuously updating it. The music style knowledge graph can be a structured knowledge base integrating historical music adaptation cases, emotional topological relationships, and music style attributes. It can provide prior mappings from emotions to music styles and early warnings of potential conflicts, supporting deviation prediction based on graph neural networks. For example, the music style knowledge graph can extract emotion-style triples from historical successful music adaptation cases, combine them with music ontology to build nodes and edges, and continuously update incrementally. In a specific embodiment, the music style knowledge graph can receive temporal emotion evolution data and dynamic music adaptation requirement data, and output potential adaptation deviation data for generating correction plans. For example, the construction of the music style knowledge graph can be achieved by manually constructing an initial graph based on an expert-defined ontology and then automatically expanding it, or by automatically constructing the graph entirely based on historical data mining. This allows for the accumulation of historical experience and emotional topological knowledge, providing structured prior support for deviation prediction.
[0033] Predicting potential adaptation biases in music generation using a music style knowledge graph based on temporal emotion evolution data and dynamic music adaptation requirements data can be achieved by using the current emotion trajectory and adaptation requirements as input queries to the knowledge graph, and then inferring potential mismatches through a graph neural network. Potential adaptation bias data can be the predicted degree of semantic or rhythmic mismatch between the current music requirements and the ideal style, which can be used to identify potential misalignment risks during music generation in advance and trigger a proactive error correction mechanism. In one exemplary embodiment, potential adaptation bias data can be inferred from the music style knowledge graph and used as query conditions for semantic and emotional association matching. Furthermore, the prediction of potential adaptation biases in music generation using a music style knowledge graph based on temporal emotion evolution data and dynamic music adaptation requirements data can be achieved by using GCN to classify nodes on the graph to predict the type of bias or by using the GAT attention mechanism to weight neighbor nodes to evaluate the degree of bias. This gives the system a proactive error correction capability, allowing it to identify and warn of possible style or rhythmic misalignments before music generation.
[0034] Step S500: Obtain several music parameter adjustment strategy libraries from the music material library, perform semantic and emotional association matching on potential adaptation deviation data and each music parameter adjustment strategy, obtain semantic and emotional association matching results, generate adaptation deviation correction plan based on semantic and emotional association matching results, and dynamically generate and optimize dynamic music based on adaptation deviation correction plan.
[0035] The music resource library can be a collection of resources storing a large number of music clips labeled with emotional tags and adjustable parameters, as well as generation templates. This provides basic audio materials and parameter adjustment space for dynamic music generation. In this embodiment, the music resource library can provide a music parameter adjustment strategy library for semantic and emotional association matching retrieval. The music parameter adjustment strategy library can be a set of strategies encapsulating executable rules for modifying music parameters for different deviation types. It can provide specific and feasible correction methods, such as parameter configurations for operations like speed change, pitch shift, and timbre replacement. For example, the music parameter adjustment strategy library can perform semantic and emotional association matching with potential adaptation deviation data to generate adaptation deviation correction plans. Obtaining several music parameter adjustment strategy libraries from the music resource library can be achieved by retrieving a set of parameter adjustment strategies related to the current task from the resource library index. Furthermore, obtaining several music parameter adjustment strategy libraries from the music resource library can be achieved by searching strategies by deviation type keywords or sorting by historical usage frequency or success rate to obtain Top-K strategies, thereby providing a diverse set of correction method candidates and ensuring the feasibility and richness of the correction scheme.
[0036] Semantic sentiment association matching results are obtained by performing semantic sentiment association matching on potential adaptation bias data and various music parameter adjustment strategies. This can be achieved by calculating the similarity or compatibility score between the bias semantics and the strategy sentiment labels. The semantic sentiment association matching results can be seen as an alignment score or mapping relationship between potential adaptation bias and music parameter adjustment strategies at the sentiment semantic level. This can be used to select the correction strategy that best fits the current emotional context, avoiding mechanical correction that could damage artistic expression. In one specific embodiment, the semantic sentiment association matching results can serve as a direct basis for generating adaptation bias correction plans, ensuring the emotional consistency of the correction actions. For example, obtaining semantic sentiment association matching results by performing semantic sentiment association matching on potential adaptation bias data and various music parameter adjustment strategies can be achieved by calculating cosine similarity based on semantic embedding of a pre-trained language model or evaluating semantic alignment based on knowledge graph path reasoning. This ensures that the selected correction strategy is consistent with the video content in terms of emotional context, avoiding mechanical correction that could damage artistic expression.
[0037] Generating an adaptation deviation correction plan based on semantic sentiment correlation matching results can involve selecting high-scoring matching strategies and combining them into a complete correction scheme that includes parameter adjustment values and execution timing. The adaptation deviation correction plan can be a personalized correction scheme tailored to prediction deviations, including specific parameter adjustment steps and execution timing. It can be used to transform abstract matching results into executable music optimization instructions, completing the final link in closed-loop control. In an exemplary embodiment, the adaptation deviation correction plan can drive the real-time generation optimization of dynamic music, ensuring the final output matches the emotional trend of the video. Furthermore, generating an adaptation deviation correction plan based on semantic sentiment correlation matching results can be achieved by selecting a single optimal strategy or fusing multiple high-scoring strategies to generate a composite correction plan. This transforms abstract matching results into executable personalized correction instructions, completing a crucial step in closed-loop control. Dynamically optimizing dynamic music generation based on the adaptation deviation correction plan can involve applying parameter adjustments from the correction plan in real-time during music generation, dynamically adjusting the output audio. Furthermore, dynamic generation optimization of background music based on the adaptation deviation correction plan can be achieved by injecting parameter modification instructions before audio synthesis or by interpolating and adjusting parameters in real time during audio stream playback. This can achieve precise synchronization between the background music and the video's emotion, significantly improving the fit of rhythm, melody, and emotional color, as well as the system's adaptive capabilities.
[0038] Taking the intelligent background music on a short video creation platform as an example, the dynamic background music generation method based on video frame-level sentiment analysis in this embodiment can be a user uploading a travel vlog containing fast cuts and micro-expressions of the characters. The cross-modal multi-feature inference engine of the intelligent dynamic background music generation system starts a sliding frame sampling strategy to extract sequential frame images and inter-frame temporal correlation data with an adaptive step size. After preprocessing and block processing, the community detection algorithm classifies local features such as facial expressions and color changes into emotional communities such as excitement, tranquility, and surprise. Based on this, the system analyzes the non-linear evolution trajectory of emotions from calm to explosion and then back down, and predicts the rhythm and tonality required for each stage through phased emotion modeling. The background music style knowledge graph combined with historical data predicts that there may be rhythmic lag deviations at the emotional turning point, and then matches an adjustment strategy of crescendo drum beats and tonality upward to generate a correction plan. Finally, the plan is dynamically applied when generating background music, so that the climax of the music is accurately aligned with the emotional explosion point of sunrise in the video, achieving a high degree of synchronization between audiovisual emotions.
[0039] In one embodiment, a sliding frame sampling strategy is used to acquire the sequence of frame images and inter-frame temporal correlation data of the video to be accompanied by music, and the data is preprocessed to obtain preprocessed video frame data, including: The frame sampling period and frame sampling granularity are determined based on the preset video emotion resolution, and the frame sampling threshold is constructed based on the dynamic coupling relationship between the frame sampling period and frame sampling granularity.
[0040] The preset video emotion resolution can be a preset benchmark parameter characterizing the system's precision in perceiving changes in video emotion. It can be used as the basis for adjusting the sampling strategy and determining the basic value range of the frame sampling period and granularity. In this embodiment, the preset video emotion resolution can be preset according to the emotion analysis accuracy requirements of the application scenario or the statistical characteristics of emotion fluctuations in historical data. Furthermore, the preset video emotion resolution can drive the determination of the frame sampling period and frame sampling granularity and influence the construction of the frame sampling threshold through dynamic coupling. For example, the preset video emotion resolution can include, but is not limited to, coarse-grained emotion resolution, medium-grained emotion resolution, and fine-grained emotion resolution. The frame sampling period can be the time interval or frame interval between two adjacent frame sampling operations, which can be used to control the temporal density of sampling and balance temporal continuity and computational load. In an exemplary embodiment, the frame sampling period can be determined by the preset video emotion resolution and together with the frame sampling granularity to form a dynamic coupling relationship to generate the frame sampling threshold. The frame sampling granularity can be the level of detail of visual information covered by a single sampling or the spatial resolution level, which can be used to determine the feature richness available for emotion analysis in each frame image. Furthermore, the frame sampling granularity can be determined by a preset video emotional resolution and dynamically coupled with the frame sampling period to jointly constrain the frame sampling threshold. This dynamic coupling can be a mutual constraint mechanism where the frame sampling period and frame sampling granularity adaptively adjust as the video content changes. It can be used to ensure that the sampling strategy is always at the optimal balance point under different emotional complexity scenarios and to avoid oversampling or undersampling. In one specific embodiment, the dynamic coupling can establish a nonlinear mapping between the two through a preset function or an online learning model, so that when one changes, the other adjusts accordingly to maintain overall sampling efficiency. Furthermore, the dynamic coupling can connect the frame sampling period and the frame sampling granularity and serve as the logical basis for constructing the frame sampling threshold.
[0041] The frame sampling threshold can be an adaptive decision boundary generated based on dynamic coupling relationships to trigger or adjust sliding frame sampling behavior. It can be used to enable the sliding frame sampling strategy to dynamically adjust the sampling density according to real-time video content while accommodating complex emotional evolution and rapid shot transitions. For example, the frame sampling threshold can be a comparable numerical threshold formed by normalizing or weighted fusion of the coupled output of the frame sampling period and granularity. Furthermore, the frame sampling threshold can be constructed by dynamic coupling relationships and directly determine the specific execution parameters of the sliding frame sampling strategy. Determining the frame sampling period and granularity based on the preset video emotional resolution can be achieved by looking up a table according to the hierarchy of the preset video emotional resolution or by calculating the corresponding initial values of the frame sampling period and granularity through a mapping function. Further, determining the frame sampling period and granularity based on the preset video emotional resolution can be achieved by mapping using a predefined resolution-to-sampling parameter lookup table or by dynamically predicting sampling parameters based on the resolution using a lightweight regression model. This provides the sampling strategy with basic parameters that match the accuracy of emotional analysis and avoids resource waste or information loss caused by blindly fixing sampling. Constructing a frame sampling threshold based on the dynamic coupling relationship between the frame sampling period and frame sampling granularity can be achieved by substituting the current frame sampling period and granularity into a preset coupling function or model and calculating an adaptive threshold that reflects the complexity of the current content. Furthermore, constructing a frame sampling threshold based on the dynamic coupling relationship between the frame sampling period and frame sampling granularity can be achieved by using an analytical coupling function in the form of a weighted product or by using an online-updating neural network model to learn the nonlinear coupling between the two and output the threshold. This allows the sampling threshold to dynamically change with the video content and achieve adaptive matching between sampling density and emotional richness.
[0042] The sliding frame sampling strategy is determined based on the frame sampling threshold, and the sequence frame images and inter-frame temporal correlation data of the video to be accompanied by music are obtained based on the sliding frame sampling strategy.
[0043] The sliding frame sampling strategy, determined based on a frame sampling threshold, can be achieved by using the frame sampling threshold as a conditional input and dynamically adjusting the step size, size, or triggering conditions of the sliding window to form a specific sampling strategy. Furthermore, determining the sliding frame sampling strategy based on the frame sampling threshold can be implemented by shortening the step size and increasing the sampling density when the threshold is above the upper limit, and increasing the step size and decreasing the density when it is below the lower limit, or by using fuzzy logic to continuously adjust the sampling parameters according to the threshold. This allows for real-time adaptation of the sampling strategy and effectively balances the capture of complex emotional evolution with rapid shot transitions.
[0044] The video frame data is subjected to noise frame filtering to obtain the noise frame filtered video frame data.
[0045] The video frame data after noise frame filtering can be a sequence of valid video frames retained after removing invalid or interfering frames. This can be used to improve the robustness of subsequent sentiment analysis and avoid noise frames misleading the judgment of emotional state. In this embodiment, the video frame data after noise frame filtering can be used as input for cross-modal feature alignment processing, and its quality directly affects the alignment accuracy and the final preprocessing result. Obtaining noise-filtered video frame data by performing noise frame filtering can involve detecting and removing invalid frames that are blurry, overexposed, occluded, or have no significant content, while retaining the valid frame sequence. Furthermore, obtaining noise-filtered video frame data by performing noise frame filtering can be achieved by setting a hard threshold based on image quality assessment metrics or by identifying and removing noise frame categories based on a lightweight classifier. This can eliminate the negative impact of interfering frames on sentiment analysis and improve the robustness of subsequent feature extraction and sentiment modeling.
[0046] Cross-modal feature alignment is performed on the video frame data after noise frame filtering to obtain preprocessed video frame data.
[0047] Cross-modal feature alignment processing can be an alignment operation that precisely synchronizes visual frame data with inter-frame temporal correlation information in semantics and timeline. This can overcome the emotional misalignment caused by asynchronous multimodal features and ensure the consistency of subsequent inference engine input. For example, cross-modal feature alignment processing can achieve spatiotemporal alignment of multimodal features through timestamp calibration, semantic embedding matching, or attention mechanisms. Furthermore, cross-modal feature alignment processing can be applied to video frame data after noise frame filtering and output the final pre-processed video frame data for downstream use. Performing cross-modal feature alignment processing on video frame data after noise frame filtering can involve precisely aligning the filtered visual frames with their corresponding inter-frame temporal correlation data in timestamp and semantic space. Furthermore, cross-modal feature alignment processing on video frame data after noise frame filtering can be achieved through timeline alignment based on precise timestamp interpolation or semantic-level alignment based on embedding spaces trained by contrastive learning. This ensures the spatiotemporal and semantic consistency of multimodal input and avoids emotional misjudgment or misaligned background music caused by asynchrony.
[0048] Taking the background music for high-dynamic emotional segments in film and television post-production as an example, the dynamic background music generation method based on video frame-level emotion analysis in this embodiment can be as follows: When processing a film segment containing alternating intense fighting and character close-ups, the system automatically sets a shorter frame sampling period and a higher frame sampling granularity according to a preset fine-grained video emotion resolution. The two are dynamically coupled to generate a lower frame sampling threshold and trigger a sliding frame sampling strategy to collect high-density sequence frame images and inter-frame temporal correlation data. Then, the collected data is subjected to noise frame filtering to remove blurred frames caused by high-speed motion. The remaining valid frames are then subjected to cross-modal feature alignment to ensure that facial expression frames and action temporal data are accurately synchronized in time and semantics. The final output preprocessed video frame data not only retains the transient changes in the fighting rhythm but also accurately captures the subtle emotional transitions in the close-ups, providing high-quality input for subsequent community detection and temporal emotion evolution analysis and enabling the generated background music to accurately match the dramatic fluctuations in the emotions of the scene.
[0049] In one embodiment, a community detection algorithm is used to classify the segmented video frame block data into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data, including: Sentiment annotation is performed on feature nodes of the segmented video frame data to obtain several sentiment annotation categories.
[0050] In this context, sentiment annotation categories can be a set of discrete emotional semantic labels assigned to feature nodes in video frame block data. These categories can provide semantic anchors for constructing the feature association matrix and enable unsupervised community detection to be sentiment-driven. In this embodiment, sentiment annotation categories can be obtained by reasoning about frame block features using a pre-trained sentiment classifier or clustering algorithm and outputting corresponding sentiment category identifiers. For example, sentiment annotation categories can serve as the basis for constructing the feature association matrix and determine the semantic foundation for connections between nodes. Furthermore, sentiment annotation categories can include, but are not limited to, basic sentiment categories, composite sentiment categories, and sentiment intensity level categories. Obtaining several sentiment annotation categories by performing sentiment annotation on feature nodes of the segmented video frame block data can be achieved by applying a sentiment recognition model or clustering algorithm to each frame block feature node and outputting the corresponding sentiment category label. In an exemplary embodiment, obtaining several sentiment annotation categories by performing sentiment annotation on feature nodes of the segmented video frame block data can be achieved by using a pre-trained multi-label sentiment classifier for supervised annotation or by using an unsupervised clustering algorithm to automatically generate sentiment category clusters. This provides a semantic foundation for graph structure construction and enables subsequent community detection to be sentiment-driven rather than purely data-driven.
[0051] Obtain the feature association matrix for each sentiment labeling category, and construct a feature community network model based on the feature association matrix using the intensity weight of sentiment change.
[0052] The feature association matrix can be a numerical matrix representing the similarity or correlation between feature nodes of frame blocks under each sentiment labeling category. It can be used to quantify the sentiment association strength between nodes and provide the basis for edge weights in the feature community network model. In this embodiment, the feature association matrix can be obtained by calculating the cosine similarity, Euclidean distance, or attention weights between feature vectors of all frame blocks within the same sentiment labeling category. For example, the feature association matrix can work together with the sentiment change intensity weight to construct a feature community network model with dynamic weights. The sentiment change intensity weight can be a dynamic adjustment factor reflecting the intensity of sentiment state changes between adjacent frame blocks. It can be used to enable the community network to adaptively adjust the connection tightness according to the dynamic characteristics of sentiment evolution and strengthen the perception of sentiment turning points. Furthermore, the sentiment change intensity weight can be calculated based on the amplitude, rate of change, or acceleration of inter-frame difference features and used to modulate the edge weights in the feature association matrix. In a specific embodiment, the sentiment change intensity weight can act on the feature association matrix and drive the feature community network model to reflect temporal dynamics rather than just static similarity. The feature community network model can be a weighted graph structure model that integrates emotional semantic associations and the intensity of emotion changes. It can be used to simultaneously encode the static topological relationships and temporal dynamic evolution characteristics of emotions within a unified graph structure, supporting refined community partitioning. In this embodiment, the feature community network model can be obtained by constructing a graph model using frame block feature nodes as vertices and feature association matrix values modulated by emotion change intensity weights as edge weights. For example, the feature community network model can be a direct input for community partitioning, and its structural quality determines the classification accuracy of the target frame-level emotion data and the target frame-to-frame differential feature data. Furthermore, the feature community network model can include, but is not limited to, static weighted community networks, temporally adaptive community networks, and multi-scale fusion community networks.
[0053] Obtaining the feature association matrix for each sentiment label category can be achieved by calculating the pairwise similarity between all feature nodes in each frame block under that sentiment label category and forming a matrix. In an exemplary embodiment, the feature association matrix for each sentiment label category can be obtained by constructing a dense association matrix using cosine similarity or by constructing a sparse association matrix using a K-nearest neighbor sparsification strategy. This allows for quantifying the degree of sentiment consistency among nodes within the same category and providing an initial connection structure for dynamic weight modulation. Constructing a feature community network model based on the feature association matrix using sentiment change intensity weights can be achieved by multiplying the sentiment change intensity weights as modulation factors by the corresponding elements of the feature association matrix to generate a weighted adjacency matrix and constructing a graph model. Furthermore, constructing a feature community network model based on the feature association matrix using sentiment change intensity weights can be achieved by fusing weights and associations using linear multiplication or by compressing the range of the fused edge weights using a nonlinear activation function. This allows the graph model to dynamically reflect the intensity of sentiment evolution, strengthen inflection point connections, and weaken redundant connections in stable segments.
[0054] The video frame block data after block processing is divided into communities based on the feature community network model to obtain the community division results.
[0055] The community partitioning result can be a node clustering allocation scheme output by the feature community network model, which can be used to automatically group frame blocks with similar emotional evolution patterns or synchronous change trends into semantically consistent analysis units. In this embodiment, the community partitioning result can be obtained by running a community detection algorithm to optimize the modularity or propagate labels on the weighted graph and obtain the community ID to which each node belongs. For example, the community partitioning result can be the input basis of a hybrid classification method and support the joint classification of frame-level sentiment and inter-frame differential features. Obtaining the community partitioning result by performing community partitioning on the segmented video frame block data based on the feature community network model can be achieved by running a community detection algorithm on the constructed weighted graph and optimizing the objective function to obtain node clustering allocation. In a specific embodiment, obtaining the community partitioning result by performing community partitioning on the segmented video frame block data based on the feature community network model can be achieved by using the Louvain algorithm to maximize the weighted modularity or using the Infomap algorithm to partition communities based on the principle of minimizing information flow, thereby automatically discovering frame block groups with collaborative emotional evolution patterns and overcoming the subjectivity and limitations of manually set thresholds.
[0056] A hybrid classification method based on sentiment feature topology and inter-frame difference path uses community partitioning results to classify frame-level sentiment features and inter-frame difference features, thereby obtaining target frame-level sentiment data and target inter-frame difference feature data.
[0057] The hybrid classification method combining emotional feature topology and inter-frame difference paths can be a joint classification strategy that combines the static emotional structure within a community with the temporal difference trajectory across communities. This approach can balance the stability and evolutionary continuity of emotional states while avoiding emotional misalignment or rhythmic disconnection caused by single-dimensional classification. In this embodiment, the hybrid classification method extracts emotional topology features within a community based on the community partitioning results, tracks the migration paths of nodes between communities, and fuses both for final classification. For example, the hybrid classification method can consume the community partitioning results and output target frame-level emotional data and target inter-frame difference feature data to complete the transformation from graph structure to usable features for background music. Furthermore, the hybrid classification method can include, but is not limited to, serial cascaded hybrid classification, parallel fusion hybrid classification, and attention-weighted hybrid classification. A hybrid classification method based on sentiment feature topology and inter-frame differential paths utilizes community partitioning results to classify frame-level sentiment features and inter-frame differential features. This can involve extracting intra-community topological features and cross-community migration paths, and fusing the two to perform final sentiment and differential feature classification for nodes. In an exemplary embodiment, this hybrid classification method can classify frame-level sentiment features and inter-frame differential features using community partitioning results by first classifying sentiment states based on topological features and then correcting the classification results along differential paths, or by extracting both types of features in parallel and then using an attention mechanism for weighted fusion classification. This allows for a unified expression of static sentiment structure and dynamic evolution paths, and significantly improves the fine-grainedness and robustness of target frame-level sentiment data and target inter-frame differential feature data.
[0058] For example, in the scenario of synchronized background music for emotional climaxes in film and television post-production, the dynamic background music generation method based on video frame-level emotion analysis in this embodiment can be as follows: when processing a scene of a character's emotional transition from repression to explosion, the segmented close-up facial frames are emotionally labeled and classified into categories such as sadness, tension, and anger. After constructing a feature association matrix, the intensity weight of emotional change is calculated using the rate of change of facial expressions between frames, and the connection weight of the frames before and after the anger explosion is significantly enhanced. Based on this, the feature community network model divides the repression period into stable communities, transition period fluctuating communities, and explosion period high-energy communities. The hybrid classification method further tracks the migration path of nodes from the repression community to the explosion community and combines the high-density topology within the explosion community to accurately classify the target frame-level emotional data and strong ascending inter-frame difference features at the moment of explosion. The subsequent background music generation is based on this to trigger the drum beat crescendo and tonality ascending so that the music climax and the emotional explosion point of the screen are aligned at the millisecond level.
[0059] In one embodiment, video temporal emotion evolution analysis is performed based on target frame-level emotion data to obtain temporal emotion evolution data, including: The intensity of change of emotional feature points is analyzed based on the target frame-level sentiment data to obtain the intensity of change of emotional feature points.
[0060] Emotional feature points can be key anchor points extracted from target frame-level emotion data, representing significant changes in emotional state. They can serve as discrete benchmarks for emotion evolution analysis and identify critical moments of emotional transitions, peaks, or steady states. In this embodiment, the intensity of change of emotional feature points, along with their dynamic evolution trajectories, forms the input basis for a temporal emotion transition probability network and a deep temporal prediction model. Analyzing the intensity of change of emotional feature points based on target frame-level emotion data can obtain the intensity of change of these feature points by calculating the difference between adjacent or spaced emotional feature points in the emotion embedding space. Furthermore, this analysis can be achieved by using Euclidean distance to calculate the absolute magnitude of change or by using the magnitude of the emotion space gradient to calculate the relative rate of change, thereby transforming abstract emotional fluctuations into quantifiable intensity indicators and providing a numerical basis for subsequent periodic and trend analyses.
[0061] Based on target frame-level sentiment data, curve fitting is used to analyze the evolutionary trajectory between sentiment feature points, thereby obtaining the dynamic evolutionary trajectory between sentiment feature points.
[0062] The intensity of change in emotional feature points can be a numerical indicator that quantifies the difference in emotional state between adjacent emotional feature points. This can reflect the severity of emotional fluctuations and provide a quantitative basis for identifying emotional outbursts or smooth transitions. For example, the intensity of change in emotional feature points can be jointly driven by dynamic evolution trajectories to perform periodic extrapolation and trend inference, supporting the generation of time-series emotional evolution data. In an exemplary embodiment, the intensity of change in emotional feature points can be obtained by calculating the Euclidean distance, cosine similarity, or gradient magnitude of the emotional feature points in the emotional space. Based on target frame-level emotional data, curve fitting is used to analyze the evolutionary trajectory between emotional feature points to obtain the dynamic evolutionary trajectory between them. This can be achieved by fitting a continuous function to discrete emotional feature points to reconstruct a smooth evolutionary path. Furthermore, this analysis can be achieved by using cubic spline interpolation to ensure the trajectory is second-order continuously differentiable or by using Bezier curve fitting to retain local morphological control points, thereby eliminating the sawtooth effect caused by discrete sampling and accurately restoring the continuous form of nonlinear emotional transitions.
[0063] Based on the temporal emotion transfer probability network, the periodic extrapolation of emotion time sequence is carried out by using the intensity of change and dynamic evolution trajectory to obtain periodic extrapolation data of emotion time sequence.
[0064] The dynamic evolution trajectory can be a smooth curve representation describing the continuous change path between emotional feature points. It can be used to transform discrete emotional states into continuously differentiable evolutionary paths while preserving the morphological information of nonlinear emotional transitions. In this embodiment, the dynamic evolution trajectory, along with the change intensity, can serve as dual inputs to both the temporal emotion transition probability network and the deep temporal prediction model. Furthermore, the dynamic evolution trajectory can be obtained by polynomial fitting, spline interpolation, or Bézier curve construction on discrete emotional feature points. The temporal emotion transition probability network can be a probabilistic graphical model that models the temporal transition patterns between emotional states and mines periodic patterns. It can be used to reveal the inherent rhythm and repetitive patterns of emotional changes and provide prior support for the periodic adaptation of background music rhythms. For example, the temporal emotion transition probability network can receive change intensity and dynamic evolution trajectory and output periodic inference data for fusion in temporal emotion evolution analysis. Based on a temporal emotion transition probabilistic network, periodic extrapolation of emotion time series is obtained by utilizing the intensity of change and dynamic evolution trajectory. This can be achieved by inputting the intensity of change and the evolution trajectory into the probabilistic network and extracting and extrapolating the periodic components of emotion changes. Furthermore, this extrapolation can be achieved by extracting the main period through state transition matrix combined with Fourier decomposition or by separating multi-scale periodic components through wavelet multi-resolution analysis. This allows for the discovery of the inherent rhythmic patterns of emotions and enables background music to maintain rhythmic stability and predictability in repetitive emotional passages.
[0065] Based on the intensity of change and dynamic evolution trajectory, a deep time series prediction model is used to infer the trend of emotion evolution and obtain data for inferring the trend of emotion evolution.
[0066] The periodic extrapolation data of emotional time series can be a structured temporal representation characterizing the predictable periodic components in emotional changes. This can be used to provide a rhythmic benchmark for emotional fluctuations and assist background music in maintaining rhythmic consistency in repetitive emotional passages. In this embodiment, the periodic extrapolation data of emotional time series can be generated by a temporal emotional transition probability network and fused with emotional evolution trend inference data to form complete temporal emotional evolution data. The deep temporal prediction model can be a sequence prediction model based on a deep learning architecture that makes nonlinear inferences about future emotional trends. It can be used to proactively estimate emotional development trends and enable the system to predict turning points and outburst points to avoid lag in background music response. For example, the deep temporal prediction model can be based on the intensity of consumption changes and dynamic evolution trajectories, outputting emotional evolution trend inference data for use in temporal emotional evolution analysis. Further, the deep temporal prediction model can include, but is not limited to, long short-term memory networks, temporal convolutional networks, autoregressive Transformer models, etc. Obtaining emotional evolution trend inference data by using a deep temporal prediction model based on the intensity of changes and dynamic evolution trajectories can involve using the intensity of changes and evolution trajectories as temporal inputs and predicting future emotional states through a deep sequence model. In one exemplary embodiment, the inference can use LSTM to capture long-range dependencies for trend extrapolation or use a causal Transformer based on an attention mechanism to predict recent trends, thereby enabling forward-looking perception of emotional turning points and climaxes and avoiding emotional misalignment caused by delayed response of background music.
[0067] Based on periodic extrapolation data and emotion evolution trend inference data, video temporal emotion evolution analysis is performed to obtain temporal emotion evolution data.
[0068] The emotion evolution trend inference data can be a predictive temporal representation of the direction and intensity of emotion development over a future period. This data can provide forward-looking emotion guidance signals and enable music generation to adjust parameters in advance to match upcoming emotional changes. In this embodiment, the emotion evolution trend inference data can be generated by a deep temporal prediction model and fused with periodic extrapolation data to complete temporal emotion evolution analysis. Based on periodic extrapolation data and emotion evolution trend inference data, video temporal emotion evolution analysis yields temporal emotion evolution data, which can fuse periodic and trend components to generate a complete temporal emotion representation that balances rhythmic stability and forward-looking guidance. Furthermore, this analysis can employ weighted linear fusion to balance the contributions of periodicity and trend, or use a gating mechanism to dynamically adjust the weights of both at different times. This provides high-precision temporal-driven data that conforms to historical rhythms and predicts future trends, significantly improving the synchronization accuracy between music and video emotion.
[0069] For example, in the context of creating emotionally charged background music during film and television post-production, the dynamic background music generation method based on video frame-level emotion analysis in this embodiment can be used to process a segment where the protagonist's emotions shift from repression to relief and then to joy. The system first extracts key emotional feature points of facial expressions and tonal changes from the target frame-level emotion data, calculates the intensity of these changes, and fits a smooth dynamic evolution trajectory. The temporal emotion transition probability network identifies that the repressive emotions in the first half have low-frequency periodic fluctuations, generating corresponding soothing rhythm prediction data. At the same time, the deep temporal prediction model infers that the joyful explosion stage will begin three seconds later based on the trajectory inflection point and intensity surge, outputting upward melody trend prediction data. The temporal emotion evolution data formed by the fusion of the two accurately indicates the transition time from periodic depression to trend climax, enabling the background music to start crescendoing 0.5 seconds before the emotional turning point, achieving perfect alignment between the musical climax and the moment of relief on screen.
[0070] In one embodiment, based on temporal emotion evolution data and target frame-to-frame difference feature data, staged emotion modeling is used to predict music adaptation requirements, obtaining dynamic music adaptation requirement data, including: An emotion difference curve is generated based on the inter-frame difference feature data of the target frame, and the threshold interval of the adaptation stage is divided based on the emotion difference curve.
[0071] The emotion difference curve can be a continuous function curve characterizing the rate and direction of change in emotional state between video frames. It can be used to transform discrete emotion difference features into a continuous dynamic trend expression and provide a quantitative basis for the division of adaptation stages. In this embodiment, the emotion difference curve can be generated by performing temporal interpolation, smoothing filtering, or numerical differentiation on the target frame difference feature data. Furthermore, the emotion difference curve can be used as a direct input for dividing the threshold interval of the adaptation stage and simultaneously participate in noise robustness estimation to identify abnormal fluctuations. The threshold interval of the adaptation stage can be a set of numerical ranges characterizing different emotional evolution intensities, defined by the amplitude of the emotion difference curve. It can be used to discretize the continuous emotional change process into music adaptation stages with clear semantic boundaries and support staged modeling. In an exemplary embodiment, the threshold interval of the adaptation stage can be determined by performing extreme value detection, cluster analysis, or adaptive threshold calculation on the emotion difference curve. Furthermore, the threshold interval of the adaptation stage can be generated by the emotion difference curve and used as a benchmark reference for adaptation stage migration analysis.
[0072] Generating an emotion difference curve based on target inter-frame difference feature data can be achieved by performing temporal interpolation and smoothing on discrete inter-frame difference features to construct a continuous rate of change function. Furthermore, generating the emotion difference curve based on the target inter-frame difference feature data can be achieved by using cubic spline interpolation combined with low-pass filtering to generate a smooth curve, thereby transforming discrete difference features into a differentiable continuous trend expression and providing a mathematical basis for subsequent stage division. Defining the threshold intervals for adaptation stages based on the emotion difference curve can be achieved by analyzing the amplitude distribution and extreme points of the emotion difference curve to determine the numerical boundaries of each adaptation stage. Furthermore, defining the threshold intervals for adaptation stages based on the emotion difference curve can be achieved by automatically identifying natural segment boundaries using K-means clustering, thereby quantifying nonlinear emotion changes into structured stage indicators and solving the rhythm discontinuity problem caused by traditional methods neglecting dynamic difference characteristics.
[0073] Migration analysis during the adaptation phase is performed based on threshold ranges to obtain migration data for the adaptation phase.
[0074] The adaptation stage migration data can be structured data describing the timing and path of music adaptation needs switching between different threshold intervals. This data can be used to characterize the phased transition logic of emotional development and prevent music adaptation from merely responding to instantaneous states while ignoring the evolutionary context. In this embodiment, adaptation stage migration data can be generated by monitoring the time, duration, and magnitude of the emotional difference curve crossing the threshold interval. Furthermore, adaptation stage migration data can drive the deduction of music adaptation needs and ensure that the deduction results align with the actual rhythm of emotional accumulation and outburst. Obtaining adaptation stage migration data based on threshold interval migration analysis can involve tracking the crossing behavior of the emotional difference curve between threshold intervals and recording the migration time, direction, and duration. Furthermore, obtaining adaptation stage migration data based on threshold interval migration analysis can be achieved by using a finite state machine model to record the state transition sequence, thereby accurately capturing the evolutionary logic of emotional accumulation, transition, and outburst and ensuring that music adaptation aligns with the actual stages of emotional development.
[0075] Based on the migration data of the adaptation stage, the temporal emotion evolution data is used to extrapolate the music adaptation requirements, and music adaptation requirement extrapolation data is obtained.
[0076] The music adaptation requirement projection data can be a sequence of expected music parameters derived from stage transition logic and temporal emotion evolution. This sequence can be used to provide a prediction of music requirements that considers the context of emotional evolution and compensate for the lag in simple current frame mapping. In this embodiment, the music adaptation requirement projection data can be obtained by inputting adaptation stage transition data and temporal emotion evolution data into a temporal prediction model or rule engine for forward projection. Furthermore, the music adaptation requirement projection data can be one of the core inputs of the adaptation requirement simulator and, together with noise robustness parameters, determine the final prediction result. Obtaining music adaptation requirement projection data by using temporal emotion evolution data based on adaptation stage transition data can involve inputting the stage transition sequence and temporal emotion trajectory into a prediction model to deduce the music parameter requirements for several future moments. Furthermore, based on the migration data of the adaptation stage, the music adaptation demand can be inferred by using temporal emotion evolution data. The music adaptation demand inference data can be obtained by using LSTM network for temporal demand prediction, which can provide a context-aware prediction of music demand and avoid emotional misalignment and response lag caused by only responding to the instantaneous state.
[0077] Noise robustness is estimated based on temporal emotion evolution data and target frame difference feature data to obtain noise robustness parameters.
[0078] The noise robustness parameter can be a confidence index that quantifies the degree of interference from non-realistic emotional fluctuations in the video emotional signal. It can be used to identify the credibility of the current emotional signal and guide the simulator to suppress jitter or smooth transitions during prediction. In this embodiment, the noise robustness parameter can be calculated by analyzing the variance, mutation frequency, or deviation from historical patterns of the temporal emotion evolution data and the target frame inter-differential feature data. Furthermore, the noise robustness parameter can be input into the adaptation requirement simulator along with the music adaptation requirement extrapolation data and adjust the stability weight of the prediction output. Obtaining the noise robustness parameter by estimating the noise robustness based on the temporal emotion evolution data and the target frame inter-differential feature data can be achieved by calculating the fluctuation anomaly degree of the emotional signal or the deviation from the prior pattern to generate confidence weights. Furthermore, obtaining the noise robustness parameter by estimating the noise robustness based on the temporal emotion evolution data and the target frame inter-differential feature data can be achieved by jointly evaluating the sliding window variance and mutation frequency, thereby effectively filtering emotional jitter interference caused by rapid shot switching or recognition errors and enhancing system stability in complex scenes.
[0079] Based on the inference data of music adaptation requirements and noise robustness parameters, the dynamic music adaptation requirements are predicted using an adaptation requirements simulator to obtain dynamic music adaptation requirements data.
[0080] The adaptation requirement simulator can be a computational module that fuses inference data and robustness parameters to stably predict music adaptation requirements. It can output interference-resistant and forward-looking dynamic music adaptation requirement data and achieve a robust transition from emotion perception to music generation. In this embodiment, the adaptation requirement simulator can operate by comprehensively processing inference data and noise robustness parameters using weighted fusion, Kalman filtering, or probabilistic graphical models. Furthermore, the adaptation requirement simulator can receive music adaptation requirement inference data and noise robustness parameters and output the final dynamic music adaptation requirement data. For example, the adaptation requirement simulator can include, but is not limited to, filter-type simulators based on state-space models, synthesis-type simulators based on generative adversarial networks, and decision-type simulators based on reinforcement learning. Using the adaptation requirement simulator to predict dynamic music adaptation requirements based on music adaptation requirement inference data and noise robustness parameters can involve fusing inference data and robustness parameters in the simulator to output a final, stability-adjusted adaptation requirement. Furthermore, based on the inference data of music adaptation requirements and noise robustness parameters, dynamic music adaptation requirement prediction using an adaptation requirement simulator can be achieved by using a Kalman filter with the robustness parameter as the observation noise covariance for state estimation. This can realize stable output and forward-looking planning of music adaptation requirements and significantly improve the accuracy, coherence and adaptive matching ability of dynamic music generation.
[0081] Taking the background music for emotionally charged scenes in film and television post-production as an example, the dynamic background music generation method based on video frame-level emotion analysis in this embodiment can generate an emotion difference curve based on the target frame difference feature data when processing a film clip containing alternating intense fighting and character inner monologues. This curve clearly presents a fluctuation pattern of alternating high-intensity action and low-intensity contemplation. By dividing the threshold range of the adaptation stage, the curve is divided into three categories: explosion, buffer, and build-up, and the rapid migration path from explosion to buffer is analyzed. Combined with the temporal emotion evolution data, the background music requirement of gradually reducing the tempo while retaining tension and lingering resonance during the buffer stage is deduced. At the same time, due to the frequent switching of fighting scenes causing some frames of emotion recognition jitter, the noise robustness estimation automatically reduces the signal confidence of that period. The adaptation requirement simulator smooths out the abnormal jumps in the deduced data accordingly. The final output dynamic background music adaptation requirement accurately matches the rhythm of emotional transitions and avoids abrupt interruptions in music caused by recognition noise, ensuring the audiovisual continuity of the climax.
[0082] In one embodiment, a music style knowledge graph is constructed. Based on temporal emotion evolution data and dynamic music adaptation requirement data, the music style knowledge graph is used to predict potential adaptation biases in music generation, obtaining potential adaptation bias data, including: The system acquires historical adaptation data for dynamic background music and video emotion topology network. The historical adaptation data includes historical emotion data and historical adaptation effect data. Based on the historical adaptation data, the system performs emotion semantic level division and adaptation quality level division to obtain emotion semantic level division data and adaptation quality level division data.
[0083] The historical adaptation data for dynamic background music can be a structured dataset recording the correspondence between emotional states and background music parameters and feedback results in past video background music tasks. This data can be used to provide training samples and prior knowledge for the bias prediction model and support the quantitative modeling of the emotion-to-background music mapping relationship. In this embodiment, the historical adaptation data for dynamic background music can serve as a data source for emotional semantic hierarchy partitioning, adaptation quality hierarchy partitioning, and adaptation bias coupling degree analysis. The video emotion topology network can be a graph structure model representing the transition probability, correlation strength, and evolution path between emotional states in a video. This can be used to provide structured priors for emotional evolution and assist in identifying nonlinear complex emotional trajectories. For example, the video emotion topology network can construct nodes and edges based on a large amount of video emotion annotation data and obtain edge weights through statistics or learning. In an exemplary embodiment, the video emotion topology network can be used together with hierarchy partitioning data to construct an adaptation bias matrix and provide a topological basis for the bias chain relationship. Historical emotion data can be the emotion labels, intensity, and type information recorded at each time point or segment in the historical adaptation data. This data can be used as input for emotional semantic hierarchy partitioning and support the refined classification of emotional states. Furthermore, historical emotion data can be a subset of the historical adaptation data of dynamic background music and participate in the construction of the adaptation deviation matrix.
[0084] Historical adaptation performance data can be evaluation metrics or user feedback records reflecting the degree of matching between background music and video emotion in historical adaptation data. It can be used as a basis for classifying adaptation quality levels and quantifying the success or failure of historical background music. In one specific embodiment, historical adaptation performance data can be a subset of the historical adaptation data for dynamic background music and used to assess the severity of bias and guide coupling analysis. Emotional semantic level classification data can be a classification system that divides original emotion tags into multiple levels according to their semantic abstraction. It can be used to achieve abstraction from specific emotion instances to general emotion categories and enhance the model's generalization ability to unseen emotional states. It is understood that emotional semantic level classification data can use hierarchical clustering, ontology mapping, or expert rules to perform bottom-up or top-down hierarchical induction of historical emotion data. In this embodiment, emotional semantic level classification data, together with adaptation quality level classification data and the video emotion topology network, constitute the dimensional basis of the adaptation bias matrix. The fit quality grading data can be evaluation criteria data that divides the quality of music matching into several levels based on historical fit effect data. It can be used to transform continuous fit effects into calculable discrete quality levels and facilitate the quantitative expression of deviation. For example, the fit quality grading data can discretize and grade the fit effect data based on scoring thresholds, cluster analysis, or ranking learning. In an exemplary embodiment, the fit quality grading data can be interleaved with the emotion semantic grading data to form the row header of the fit deviation matrix.
[0085] Obtaining historical adaptation data and video emotion topology networks for dynamic soundtracks can be achieved by reading historical soundtrack task records from a database or file system and loading a pre-built emotion topology graph structure. Furthermore, obtaining historical adaptation data and video emotion topology networks for dynamic soundtracks can be achieved by batch loading from local persistent storage or by pulling historical data and topology networks from the cloud in real time via an interface, thus providing complete historical experience and prior knowledge of emotion evolution for subsequent hierarchical partitioning and bias modeling. Obtaining emotion semantic hierarchical partitioning and adaptation quality hierarchical partitioning data based on historical adaptation data can be achieved by performing hierarchical induction and discretization classification on historical emotion data and historical adaptation effect data, respectively. In a specific embodiment, obtaining emotion semantic hierarchical partitioning and adaptation quality hierarchical partitioning data based on historical adaptation data can be achieved by automatically generating hierarchies using unsupervised clustering or by supervised partitioning based on a predefined emotion ontology and quality scale, thereby transforming raw continuous or fine-grained data into a structured hierarchical representation and improving the interpretability and generalization of the bias matrix.
[0086] An adaptation bias matrix is constructed based on emotion semantic hierarchy classification data, adaptation quality hierarchy classification data, and video emotion topology network.
[0087] The adaptation deviation matrix can be a two-dimensional table with emotional semantic level as rows and adaptation quality level as columns, storing the frequency or intensity of historical deviations for corresponding combinations. It can be used to compress discrete historical experience into a structured deviation distribution and intuitively reflect the types and degrees of deviations prone to occur under specific emotional states. In this embodiment, the adaptation deviation matrix can traverse historical adaptation data, statistically analyze the occurrence of deviations for each emotion-to-quality combination, and fill the matrix cells. For example, the adaptation deviation matrix can serve as one of the basic data sources for constructing deviation chain relationships and support the initialization of node attributes in the knowledge graph. Constructing the adaptation deviation matrix based on emotional semantic level classification data, adaptation quality level classification data, and video emotion topology network can involve using the two level classification results as coordinate axes and combining the emotional associations in the topology network to fill in historical deviation statistics. Furthermore, the adaptation bias matrix can be constructed based on the emotional semantic hierarchy classification data, the adaptation quality hierarchy classification data, and the video emotion topology network. This can be achieved by filling the matrix with only historical frequency data or by filling the matrix with bias intensity after fusing topological distance weighting. This can generate a bias distribution representation that combines semantic abstraction and topological awareness and overcome the shortcomings of pure statistical methods that ignore emotional correlation.
[0088] Adaptation deviation coupling degree analysis is performed based on historical adaptation data to obtain adaptation deviation coupling degree data.
[0089] In this context, the fitting deviation coupling degree data can be a numerical indicator that quantifies the mutual influence, superposition, or inhibition relationships between different deviation types. It can be used to reveal the intrinsic correlation mechanisms between deviations and avoid viewing a single deviation in isolation while ignoring systemic risks. In an exemplary embodiment, the fitting deviation coupling degree data can extract deviation co-occurrence patterns from historical fitting data through correlation analysis, conditional probability calculation, or causal inference. In a specific embodiment, the fitting deviation coupling degree data can participate in the construction of a deviation chain structure graph together with the fitting deviation matrix, determining the weights and directions of the edges in the graph. Obtaining the fitting deviation coupling degree data based on historical fitting data can involve analyzing the co-occurrence patterns and conditional dependencies of different deviation types in historical data. Furthermore, obtaining the fitting deviation coupling degree data based on historical fitting data can be achieved by using Pearson correlation coefficients to calculate linear coupling or using Granger causality tests to identify temporal causal coupling, thereby quantifying the interaction mechanisms between deviations and providing accurate edge weights for the chain structure.
[0090] Based on the adaptation deviation matrix and adaptation deviation coupling degree data, a deviation chain relationship is constructed to obtain a deviation chain structure graph, and a music style knowledge graph is constructed based on the deviation chain structure graph.
[0091] The deviation chain structure graph can be a directed weighted graph composed of deviation types as nodes and coupling relationships as edges, representing the propagation path of deviations in the process of emotional evolution. It can be used to explicitly model the accumulation and diffusion mechanism of errors in temporal emotional evolution and provide a structural basis for forward-looking prediction. In this embodiment, the deviation chain structure graph can use high deviation items in the adaptation deviation matrix as nodes and define the relationships between nodes using adaptation deviation coupling degree data. For example, the deviation chain structure graph can serve as the skeleton of a music style knowledge graph and carry the topological information of deviation propagation. The deviation chain structure graph can be obtained by constructing deviation chain relationships based on the adaptation deviation matrix and adaptation deviation coupling degree data by setting high deviation items in the matrix as nodes and defining directed weighted edges between nodes using coupling degree data. Furthermore, the deviation chain structure graph can be obtained by constructing deviation chain relationships based on the adaptation deviation matrix and adaptation deviation coupling degree data by setting a threshold to filter strongly coupled edges to construct a sparse graph or retaining all edges and dynamically weighting them through an attention mechanism, thereby explicitly expressing the propagation path of deviations in emotional evolution and enabling the knowledge graph to have error propagation reasoning capabilities. Constructing a music style knowledge graph based on a deviation chain structure graph can involve embedding the deviation chain structure graph as a subgraph into a broader music style knowledge system and supplementing it with music attribute nodes and cross-modal edges. In a specific embodiment, constructing a music style knowledge graph based on a deviation chain structure graph can be achieved by directly expanding music nodes with the deviation chain graph as the core or by aligning and merging the deviation graph with an existing music ontology graph. This can form a complete knowledge base that takes into account both deviation propagation mechanisms and music semantics, and supports high-precision deviation prediction.
[0092] A potential adaptation bias prediction model is constructed based on a knowledge graph of music style combined with a graph neural network prediction model. Based on the potential adaptation bias prediction model, the potential adaptation bias of music generation is predicted using temporal emotion evolution data and dynamic music adaptation demand data, thereby obtaining potential adaptation bias data.
[0093] The graph neural network prediction model can be a deep learning model capable of message passing and node representation learning on graph-structured data. It can be used to capture long-range dependencies and nonlinear interactions between deviations by leveraging the graph topology. Understandably, the graph neural network prediction model can update the current node embedding by aggregating neighbor node information and combining it with temporal input for end-to-end training. In this embodiment, the graph neural network prediction model can be combined with a music style knowledge graph to form the inference core of the latent adaptation deviation prediction model. The latent adaptation deviation prediction model can be an end-to-end deviation prediction system that integrates the music style knowledge graph and the graph neural network prediction model. It can be used to proactively identify potential style misalignments or rhythmic disconnections before music generation and trigger the generation of corrective plans. For example, the latent adaptation deviation prediction model can encode temporal emotion evolution data and dynamic music adaptation requirement data, inject them into graph nodes, and output the deviation probability or type for future moments through graph neural network inference. In an exemplary embodiment, the latent adaptation deviation prediction model can consume all upstream structured data and output latent adaptation deviation data for downstream semantic and emotional association matching.
[0094] Constructing a potential adaptation bias prediction model based on a music style knowledge graph combined with a graph neural network prediction model can be achieved by using the knowledge graph as the input graph structure of the graph neural network and designing message passing and output headers adapted to bias prediction. Furthermore, this model can be implemented by using standard graph convolutional networks or graph attention network architectures, or by designing customized temporal-aware graph neural network variants to fuse emotional evolution sequences. This allows for joint modeling of graph topology and temporal dynamics, improving the accuracy of bias prediction under complex emotional paths. The potential adaptation bias prediction model utilizes temporal emotional evolution data and dynamic music adaptation requirement data to predict potential adaptation bias in music generation. Obtaining potential adaptation bias data can be achieved by encoding the current emotional trajectory and adaptation requirements as graph node features and then using a graph neural network to infer and output future bias prediction results. In one specific embodiment, the potential adaptation deviation prediction model uses temporal emotion evolution data and dynamic music adaptation requirement data to predict the potential adaptation deviation in music generation. The potential adaptation deviation data can be obtained by predicting the deviation at the next moment in a single step or by predicting the deviation sequence of the entire emotion stage in multiple steps. This allows for the proactive identification of potential misalignment risks before music generation and provides accurate forward-looking input for closed-loop error correction.
[0095] For example, in the context of music selection for emotionally sensitive segments during film and television post-production, the dynamic music generation method based on video frame-level sentiment analysis in this embodiment can be used to process a movie monologue scene containing complex psychological shifts. The system first acquires historical music data and a general emotional topology network for this type of film. By semantically classifying emotions such as repression, relief, and forbearance in the historical data and classifying audience feedback such as abruptness, dragging, and precision into a quality level, an adaptation deviation matrix reflecting the frequency of deviations from specific emotions to quality combinations is constructed. Further analysis reveals a strong coupling between rhythmic lag and tonal conflict, and a deviation chain structure diagram is constructed accordingly, incorporating a music style knowledge graph. When processing the current segment, the potential adaptation deviation prediction model, combined with the real-time emotional evolution trajectory and adaptation requirements, predicts that an energy deficiency deviation is highly likely to occur at the turning point from forbearance to relief. The system then triggers a correction plan, increases the volume envelope of the string section in advance, and introduces bright timbres to ensure that the musical emotional shift is accurately synchronized with the actor's performance.
[0096] In one embodiment, semantic-sentiment correlation matching is performed on potential adaptation deviation data and adjustment strategies for each music parameter to obtain semantic-sentiment correlation matching results, including: Obtain the emotional semantic feature vector of potential adaptation bias data and the strategy feature vector of each music parameter adjustment strategy.
[0097] The emotional semantic feature vector can be a high-dimensional numerical representation of the emotional state, intensity, and evolution trend contained in the potential adaptation bias data. It can be used to provide a standardized emotional semantic representation for cross-modal matching and support subsequent similarity quantification and difference assessment. In this embodiment, the emotional semantic feature vector can map the structured bias description to a continuous semantic space through a pre-trained emotional encoder or graph embedding layer. Furthermore, the emotional semantic feature vector can serve as a common input source for semantic graph neural networks and heterogeneous graph matching, forming a matching pair with the policy feature vector. The policy feature vector can be a numerical representation of the functional attributes, applicable contexts, and emotional tendencies of the music parameter adjustment strategy. It can be used to achieve comparability between the music adjustment strategy and emotional semantics in the same representation space and support refined association analysis. For example, the policy feature vector can utilize a policy encoder to convert text descriptions or parameter configurations into feature vectors in the same space as the emotional semantics. In an exemplary embodiment, the policy feature vector can participate in a dual matching mechanism together with the emotional semantic feature vector and determine the generation of the final association matching result. Obtaining the sentiment semantic feature vector of potential fitting bias data and the policy feature vector of each music parameter adjustment strategy can be achieved by separately calling the sentiment encoder and the policy encoder to vectorize the original bias description and policy configuration. Furthermore, obtaining the sentiment semantic feature vector of potential fitting bias data and the policy feature vector of each music parameter adjustment strategy can be achieved by using a dual-tower encoder with shared weights to encode the two types of inputs separately, or by using independent pre-trained models and then aligning them to a unified space through a projection layer. This allows for a unified numerical representation of cross-modal information and provides a computable basic input for subsequent double matching.
[0098] The similarity measurement results are obtained by using a semantic graph neural network to measure the similarity of the sentiment semantic feature vector and the feature vectors of each strategy.
[0099] The semantic graph neural network (SNN) can be a variant of the graph neural network specifically designed to capture high-order relationships between semantic entities. It can be used to go beyond simple vector dot products and model complex nonlinear semantic dependencies between sentiment and policy to improve the accuracy of similarity measurement. In this embodiment, the SNN can perform multi-hop message passing on the sentiment-policy semantic graph to aggregate neighborhood information, enhance node semantic representations, and calculate pairwise similarity. Furthermore, the SNN can receive sentiment semantic feature vectors and policy feature vectors and output similarity measurement results for comprehensive matching. In a specific embodiment, the SNN may include, but is not limited to, attention-based GAT, gated recursive unit-based GGNN, and subgraph sampling-based GraphSAGE.
[0100] Similarity metric results can be numerical indicators representing the closeness between emotional semantic feature vectors and policy feature vectors in a high-level semantic space. They can reflect the overall fit between the music strategy and the current emotional tone and serve as a basis for positive matching decisions. For example, similarity metric results can be calculated by a semantic graph neural network based on inter-node message passing and aggregation mechanisms. In an exemplary embodiment, similarity metric results can be fused with difference assessment results to jointly determine the final output of semantic-emotional association matching. Obtaining corresponding similarity metric results by performing similarity metric on emotional semantic feature vectors and policy feature vectors based on a semantic graph neural network can be achieved by constructing a semantic graph using the two types of vectors as nodes and running the semantic graph neural network for multi-hop inference, outputting pairwise similarity scores. Furthermore, obtaining corresponding similarity metric results by performing similarity metric on emotional semantic feature vectors and policy feature vectors based on a semantic graph neural network can be achieved by directly outputting similarity using an end-to-end trained GAT or by first enhancing node representations and then calculating cosine similarity. This can capture high-order semantic associations between emotions and strategies and overcome the problem that simple vector operations cannot express complex emotional fit.
[0101] Obtain the difference feature set of sentiment semantic feature vector and feature vector of each strategy.
[0102] The difference feature set can be a set of features extracted from the emotional semantic feature vector and the policy feature vector, representing incompatible or conflicting dimensions between the two. It can be used to accurately locate structural or detailed contradictions between emotion and policy, avoiding mismatches caused by relying solely on similarity. In this embodiment, the difference feature set can identify and separate significantly deviating semantic components through vector differencing, attention masks, or residual networks. Furthermore, the difference feature set can serve as the input basis for heterogeneous graph matching and drive difference evaluation to supplement the blind spots of similarity measurement. Obtaining the difference feature set of the emotional semantic feature vector and each policy feature vector can be achieved by performing differencing operations or selective filtering on the two sets of vectors to extract semantic components representing conflicting or inconsistent meanings. Furthermore, obtaining the difference feature set of the emotional semantic feature vector and each policy feature vector can be achieved by filtering significantly different dimensions using absolute value differencing thresholds or by dynamically focusing on mismatched subspaces using attention mechanisms. This allows for explicit separation of key contradictions that may lead to mismatched music and provides accurate input for differential evaluation.
[0103] Based on the difference feature set, heterogeneous graph matching is used to evaluate the difference between the sentiment semantic feature vector and the feature vector of each strategy, and the corresponding difference evaluation results are obtained.
[0104] Heterogeneous graph matching can be a matching method that aligns and calculates similarity for graph structures with different node or edge types. It can effectively handle the heterogeneity of emotions and policies in terms of semantic granularity and expression, and accurately assess the degree of local incompatibility. In this embodiment, heterogeneous graph matching can construct a heterogeneous graph containing emotion nodes and policy nodes, model the difference relationship through cross-type edges, and optimize the alignment objective function to obtain the difference degree. Furthermore, heterogeneous graph matching can be a dual evaluation mechanism that consumes the difference feature set and outputs the difference degree evaluation result, complementing the semantic graph neural network. In a specific embodiment, heterogeneous graph matching can include, but is not limited to, heterogeneous graph matching based on optimal transmission, heterogeneous graph matching based on contrastive learning, and heterogeneous graph matching based on meta-paths. The difference degree evaluation result can be a structured score that quantifies the degree of mismatch between emotional semantics and policy features on a specific dimension. It can be used to reveal potential adaptation biases and implicit conflicts between adjustment strategies, and improve the pertinence and safety of remedial plans. For example, the difference degree evaluation result can be used to construct a heterogeneous association graph based on the difference feature set and calculate the node alignment cost or edge weight through a heterogeneous graph matching algorithm. In one exemplary embodiment, the difference assessment result can be complementary to the similarity measurement result and together constitute a two-dimensional criterion for semantic sentiment association matching.
[0105] Based on the difference feature set, heterogeneous graph matching is used to evaluate the difference between sentiment semantic feature vectors and each strategy feature vector to obtain the corresponding difference evaluation results. This can be achieved by constructing a heterogeneous graph with the difference feature set as the edge attribute and running a heterogeneous graph matching algorithm to calculate the alignment cost as the difference degree. Furthermore, the difference evaluation results can be obtained by using heterogeneous graph matching based on the difference feature set to minimize the distance between cross-type nodes or by using meta-path-based matching to aggregate specific difference channel information. This allows for accurate quantification of local incompatibilities in the heterogeneous semantic space and compensates for the inadequacy of single similarity evaluation in perceiving subtle conflicts.
[0106] Based on the similarity quantification results and the difference assessment results, semantic sentiment association matching is performed on the potential adaptation deviation data and the adjustment strategies of each music parameter to obtain the semantic sentiment association matching results.
[0107] Based on similarity metric results and difference assessment results, semantic sentiment correlation matching is performed on potential adaptation deviation data and various music parameter adjustment strategies to obtain semantic sentiment correlation matching results. This can be achieved by integrating scores from both similarity and difference dimensions and generating the final matching result through weighted combination or decision rules. Furthermore, semantic sentiment correlation matching can be achieved by using an adaptive weight network to dynamically balance the contributions of the two dimensions or by setting a difference threshold to filter high-risk matches before sorting by similarity. This allows for a two-dimensional correlation matching that balances overall fit and local safety, significantly improving the accuracy of the revised plan and the reliability of its artistic expression.
[0108] For example, in the scenario of correcting the background music for emotional transitions in film and television post-production, the dynamic background music generation method based on video frame-level sentiment analysis in this embodiment can be as follows: When a video in a suspense film suddenly changes from a tense atmosphere to a relieved mood, the system predicts that the potential adaptation deviation is that the tension has not been resolved. After obtaining the emotional semantic feature vector of this deviation and the feature vector of the candidate strategy of gentle string gradation, the semantic graph neural network determines that the two are highly similar in terms of emotional release semantics. However, heterogeneous graph matching finds that there is a significant difference in the rhythm transition rate dimension through the difference feature set. After comprehensive evaluation of the two dimensions, the system does not directly select the strategy, but matches a composite strategy of string music with a sustain effect and a slow rhythm descent and generates a correction plan. In the end, the background music not only continues the overall tone of the relieved mood, but also smoothly resolves the auditory discomfort caused by the sudden change in rhythm and achieves accurate emotional connection.
[0109] In addition, refer to Figure 2 To achieve the above objectives, the present invention also provides a dynamic background music generation device based on video frame-level emotion analysis, the device comprising: The sliding sampling module 10 is used to obtain the sequence frame images and inter-frame temporal correlation data of the video to be accompanied by music through the cross-modal multi-feature inference engine of the intelligent dynamic music generation system using the sliding frame sampling strategy, and to preprocess the data to obtain preprocessed video frame data. The community classification module 20 is used to divide the preprocessed video frame data into blocks to obtain the block-processed video frame block data; based on the community detection algorithm, the block-processed video frame block data is classified into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data. The evolution prediction module 30 is used to perform video temporal emotion evolution analysis based on the target frame-level emotion data to obtain temporal emotion evolution data; and to perform music matching requirement prediction based on the temporal emotion evolution data and the target frame-to-frame difference feature data using staged emotion modeling to obtain dynamic music matching requirement data. The graph inference module 40 is used to construct a music style knowledge graph. Based on the temporal emotion evolution data and dynamic music adaptation requirement data, the music style knowledge graph is used to predict the potential adaptation deviation of music generation and obtain potential adaptation deviation data. The semantic correction module 50 is used to obtain several music parameter adjustment strategy libraries from the music material library, perform semantic and emotional association matching on the potential adaptation deviation data and each music parameter adjustment strategy, obtain semantic and emotional association matching results, generate adaptation deviation correction plan based on the semantic and emotional association matching results, and dynamically generate and optimize dynamic music based on the adaptation deviation correction plan.
[0110] Other embodiments or specific implementations of the dynamic background music generation device based on video frame-level emotion analysis described in this invention can be referred to the above-described method embodiments, and will not be repeated here.
[0111] Furthermore, to achieve the above objectives, the present invention also provides a dynamic music generation device based on video frame-level sentiment analysis. The device includes: a memory, a processor, and a dynamic music generation program based on video frame-level sentiment analysis stored in the memory and executable on the processor. The dynamic music generation program based on video frame-level sentiment analysis is configured to implement the steps of the dynamic music generation method based on video frame-level sentiment analysis as described above.
[0112] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a dynamic music generation program based on video frame-level sentiment analysis, wherein when the dynamic music generation program based on video frame-level sentiment analysis is executed by a processor, it implements the steps of the dynamic music generation method based on video frame-level sentiment analysis as described above.
[0113] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for generating dynamic background music based on video frame-level sentiment analysis, characterized in that, The method is applied to an intelligent dynamic music generation system, which is equipped with a cross-modal multi-feature inference engine; the method includes: The cross-modal multi-feature inference engine of the intelligent dynamic music generation system uses a sliding frame sampling strategy to obtain the sequence frame images and inter-frame temporal correlation data of the video to be set to music, and preprocesses the data to obtain preprocessed video frame data. The preprocessed video frame data is divided into blocks to obtain block-processed video frame data; based on the community detection algorithm, the block-processed video frame data is classified into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data. Based on the target frame-level emotion data, video temporal emotion evolution analysis is performed to obtain temporal emotion evolution data; based on the temporal emotion evolution data and the target frame inter-frame difference feature data, staged emotion modeling is used to predict the music matching requirements to obtain dynamic music matching requirements data. A music style knowledge graph is constructed. Based on the temporal emotion evolution data and dynamic music adaptation requirement data, the music style knowledge graph is used to predict the potential adaptation deviation of music generation and obtain potential adaptation deviation data. Several music parameter adjustment strategy libraries are obtained from the music material library. Semantic and emotional association matching is performed on the potential adaptation deviation data and each music parameter adjustment strategy to obtain semantic and emotional association matching results. Adaptation deviation correction plan is generated based on the semantic and emotional association matching results. Dynamic music is dynamically generated and optimized based on the adaptation deviation correction plan.
2. The dynamic background music generation method based on video frame-level sentiment analysis as described in claim 1, characterized in that, The process of acquiring the sequence of frame images and inter-frame temporal correlation data of the video to be accompanied by music using a sliding frame sampling strategy, and preprocessing the data to obtain preprocessed video frame data, includes: The frame sampling period and frame sampling granularity are determined based on the preset video emotion resolution, and the frame sampling threshold is constructed based on the dynamic coupling relationship between the frame sampling period and the frame sampling granularity. Based on the frame sampling threshold, a sliding frame sampling strategy is determined, and based on the sliding frame sampling strategy, the sequence frame images and inter-frame temporal correlation data of the video to be accompanied by music are obtained. The video frame data is subjected to noise frame filtering processing to obtain noise frame filtered video frame data. Cross-modal feature alignment is performed on the video frame data after noise frame filtering to obtain preprocessed video frame data.
3. The dynamic background music generation method based on video frame-level sentiment analysis as described in claim 1, characterized in that, The method involves classifying the segmented video frame data using a community detection algorithm to obtain target frame-level sentiment data and target inter-frame difference feature data, including: Sentiment annotation is performed on feature nodes of the segmented video frame block data to obtain several sentiment annotation categories; Obtain the feature association matrix for each sentiment labeling category, and construct a feature community network model based on the feature association matrix using sentiment change intensity weight quantization. Based on the aforementioned feature community network model, the video frame block data after block processing is divided into communities to obtain the community division results. The hybrid classification method based on sentiment feature topology and inter-frame difference path uses the community division results to classify frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data.
4. The dynamic background music generation method based on video frame-level sentiment analysis as described in claim 1, characterized in that, The step of performing video temporal emotion evolution analysis based on the target frame-level emotion data to obtain temporal emotion evolution data includes: Based on the target frame-level emotion data, the intensity of change of emotion feature points is analyzed to obtain the intensity of change of emotion feature points. Based on the target frame-level emotion data, curve fitting is used to analyze the evolution trajectory between emotion feature points to obtain the dynamic evolution trajectory between emotion feature points. Based on the temporal emotion transfer probability network, the periodic extrapolation of emotion time sequence is performed using the change intensity and dynamic evolution trajectory to obtain periodic extrapolation data of emotion time sequence; Based on the intensity of change and dynamic evolution trajectory, a deep time series prediction model is used to infer the trend of emotion evolution and obtain emotion evolution trend inference data. Based on the periodic extrapolation data and the inference data on the trend of emotion evolution, video temporal emotion evolution analysis is performed to obtain temporal emotion evolution data.
5. The dynamic background music generation method based on video frame-level emotion analysis as described in claim 1, characterized in that, The method of predicting music adaptation requirements based on the temporal emotion evolution data and the target frame inter-frame difference feature data, using staged emotion modeling, to obtain dynamic music adaptation requirement data includes: An emotion difference curve is generated based on the target inter-frame difference feature data, and the threshold range of the adaptation stage is divided based on the emotion difference curve. Based on the threshold range, migration analysis is performed during the adaptation phase to obtain migration data for the adaptation phase. Based on the migration data of the adaptation stage, the temporal emotion evolution data is used to extrapolate the music adaptation requirements, and music adaptation requirement extrapolation data is obtained. Noise robustness estimation is performed based on the temporal emotion evolution data and the target frame inter-frame difference feature data to obtain noise robustness parameters; Based on the music adaptation requirement projection data and noise robustness parameters, a dynamic music adaptation requirement prediction is performed using an adaptation requirement simulator to obtain dynamic music adaptation requirement data.
6. The dynamic background music generation method based on video frame-level emotion analysis as described in claim 1, characterized in that, The construction of a music style knowledge graph involves using the music style knowledge graph to predict potential adaptation biases in music generation based on the temporal emotion evolution data and dynamic music adaptation requirement data, thereby obtaining potential adaptation bias data, including: The historical adaptation data of dynamic background music and video emotion topology network are obtained. The historical adaptation data includes historical emotion data and historical adaptation effect data. Based on the historical adaptation data, emotion semantic level division and adaptation quality level division are performed to obtain emotion semantic level division data and adaptation quality level division data. An adaptation bias matrix is constructed based on the aforementioned emotion semantic hierarchy segmentation data, adaptation quality hierarchy segmentation data, and video emotion topology network. Based on the historical adaptation data, an adaptation deviation coupling degree analysis is performed to obtain adaptation deviation coupling degree data. Based on the adaptation deviation matrix and adaptation deviation coupling degree data, a deviation chain relationship is constructed to obtain a deviation chain structure graph, and a music style knowledge graph is constructed based on the deviation chain structure graph. A potential adaptation bias prediction model is constructed based on the aforementioned music style knowledge graph and graph neural network prediction model. Based on the potential adaptation bias prediction model, the potential adaptation bias prediction of music generation is performed using the temporal emotion evolution data and dynamic music adaptation requirement data to obtain potential adaptation bias data.
7. The dynamic background music generation method based on video frame-level sentiment analysis as described in claim 1, characterized in that, The step of performing semantic-sentiment correlation matching on the potential adaptation deviation data and the adjustment strategies for each music parameter to obtain semantic-sentiment correlation matching results includes: Obtain the emotional semantic feature vector of the potential adaptation deviation data and the strategy feature vector of each music parameter adjustment strategy; The similarity measurement results are obtained by performing similarity measurement on the emotional semantic feature vector and the feature vector of each strategy based on the semantic graph neural network. Obtain the difference feature set of the sentiment semantic feature vector and each strategy feature vector; Based on the aforementioned difference feature set, heterogeneous graph matching is used to evaluate the difference between the sentiment semantic feature vector and each strategy feature vector, and the corresponding difference evaluation results are obtained. Based on the similarity quantification results and difference assessment results, semantic sentiment association matching is performed on the potential adaptation deviation data and the adjustment strategies of each music parameter to obtain semantic sentiment association matching results.
8. A dynamic background music generation device based on video frame-level emotion analysis, characterized in that, The device includes: The sliding sampling module is used to obtain the sequence frame images and inter-frame temporal correlation data of the video to be accompanied by music through the cross-modal multi-feature inference engine of the intelligent dynamic music generation system using the sliding frame sampling strategy, and to preprocess the data to obtain preprocessed video frame data. The community classification module is used to divide the preprocessed video frame data into blocks to obtain the block-processed video frame block data; based on the community detection algorithm, the block-processed video frame block data is classified into frame-level sentiment features and inter-frame difference features to obtain target frame-level sentiment data and target inter-frame difference feature data. The evolution prediction module is used to perform video temporal emotion evolution analysis based on the target frame-level emotion data to obtain temporal emotion evolution data; and to perform music matching requirement prediction based on the temporal emotion evolution data and the target frame inter-differential feature data using staged emotion modeling to obtain dynamic music matching requirement data. The graph inference module is used to construct a music style knowledge graph. Based on the temporal emotion evolution data and dynamic music adaptation requirement data, the music style knowledge graph is used to predict the potential adaptation deviation of music generation and obtain potential adaptation deviation data. The semantic correction module is used to obtain several music parameter adjustment strategy libraries from the music material library, perform semantic and emotional association matching on the potential adaptation deviation data and each music parameter adjustment strategy, obtain semantic and emotional association matching results, generate adaptation deviation correction plan based on the semantic and emotional association matching results, and dynamically generate and optimize dynamic music based on the adaptation deviation correction plan.
9. A dynamic background music generation device based on video frame-level emotion analysis, characterized in that, The device includes: a memory, a processor, and a dynamic music generation program based on video frame-level emotion analysis stored in the memory and executable on the processor, the dynamic music generation program based on video frame-level emotion analysis being configured to implement the steps of the dynamic music generation method based on video frame-level emotion analysis as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a dynamic music generation program based on video frame-level sentiment analysis, which, when executed by a processor, implements the steps of the dynamic music generation method based on video frame-level sentiment analysis as described in any one of claims 1 to 7.
